-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split review app tasks into app/tasks (without Gulp)
- Loading branch information
1 parent
a39a8ec
commit 09453b3
Showing
28 changed files
with
238 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: npm run heroku | ||
web: npm start --workspace app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import gulp from 'gulp' | ||
|
||
import * as build from './tasks/build/index.mjs' | ||
|
||
/** | ||
* Build target tasks | ||
*/ | ||
gulp.task('build', build.dist) | ||
gulp.task('dev', build.dev) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { join } from 'path' | ||
|
||
import { paths } from '../../config/index.js' | ||
import * as files from '../../tasks/files.mjs' | ||
|
||
/** | ||
* Copy GOV.UK Frontend static assets | ||
*/ | ||
export async function assets () { | ||
await files.copy('**/*', { | ||
srcPath: join(paths.src, 'govuk/assets'), | ||
destPath: join(paths.app, 'dist/assets') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as npm from '../../../tasks/npm.mjs' | ||
import * as tasks from '../index.mjs' | ||
|
||
import * as build from './index.mjs' | ||
|
||
/** | ||
* Dev task | ||
* Runs a sequence of tasks on start | ||
*/ | ||
export default async function dev () { | ||
await build.dist() | ||
await tasks.watch() | ||
await npm.run('serve') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as tasks from '../index.mjs' | ||
|
||
/** | ||
* Build review app task | ||
* Prepare dist folder for review app | ||
*/ | ||
export default async function build () { | ||
await tasks.clean() | ||
|
||
await Promise.all([ | ||
tasks.assets(), | ||
tasks.scripts(), | ||
tasks.styles() | ||
]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** | ||
* Build target tasks | ||
*/ | ||
export { default as dev } from './dev.mjs' | ||
export { default as dist } from './dist.mjs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { join } from 'path' | ||
|
||
import { paths } from '../../config/index.js' | ||
import * as files from '../../tasks/files.mjs' | ||
|
||
/** | ||
* Clean task | ||
*/ | ||
export async function clean () { | ||
await files.clean('**/*', { | ||
destPath: join(paths.app, 'dist') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Build tasks | ||
*/ | ||
export { assets } from './assets.mjs' | ||
export { clean } from './clean.mjs' | ||
export { compile as scripts } from './scripts.mjs' | ||
export { compile as styles } from './styles.mjs' | ||
export { watch } from './watch.mjs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { join } from 'path' | ||
|
||
import { paths } from '../../config/index.js' | ||
import * as npm from '../../tasks/npm.mjs' | ||
import * as scripts from '../../tasks/scripts.mjs' | ||
|
||
/** | ||
* JavaScripts task (for watch) | ||
* Compilation, documentation | ||
*/ | ||
export async function compile () { | ||
await scripts.compile('all.mjs', { | ||
srcPath: join(paths.src, 'govuk'), | ||
destPath: join(paths.app, 'dist/javascripts'), | ||
|
||
filePath (file) { | ||
return join(file.dir, `${file.name}.min.js`) | ||
} | ||
}) | ||
|
||
// Build JSDoc for /docs/javascript | ||
await npm.run('build:jsdoc') | ||
} | ||
|
||
compile.displayName = 'compile:scripts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { join } from 'path' | ||
|
||
import { paths } from '../../config/index.js' | ||
import * as npm from '../../tasks/npm.mjs' | ||
import * as styles from '../../tasks/styles.mjs' | ||
|
||
/** | ||
* Stylesheets task (for watch) | ||
* Compilation, documentation | ||
*/ | ||
export async function compile () { | ||
await styles.compile('**/[!_]*.scss', { | ||
srcPath: join(paths.app, 'src/stylesheets'), | ||
destPath: join(paths.app, 'dist/stylesheets'), | ||
|
||
filePath (file) { | ||
return join(file.dir, `${file.name}.min.css`) | ||
} | ||
}) | ||
|
||
// Build SassDoc for /docs/sass | ||
await npm.run('build:sassdoc') | ||
} | ||
|
||
compile.displayName = 'compile:styles' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.