-
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
d1aaa28
commit 6605963
Showing
28 changed files
with
232 additions
and
242 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,10 @@ | ||
|
||
import gulp from 'gulp' | ||
|
||
import * as build from './tasks/build/index.mjs' | ||
|
||
/** | ||
* Build target tasks | ||
*/ | ||
gulp.task('build:public', build.public) | ||
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, 'public/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.public() | ||
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,5 @@ | ||
/** | ||
* Build target tasks | ||
*/ | ||
export { default as dev } from './dev.mjs' | ||
export { default as public } from './public.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,15 @@ | ||
import * as tasks from '../index.mjs' | ||
|
||
/** | ||
* Build public task | ||
* Prepare public 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,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, 'public') | ||
}) | ||
} |
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,23 @@ | ||
import { join, normalize } 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, 'public/javascripts'), | ||
|
||
filePath (file) { | ||
return normalize(`${file.name}.min.js`) | ||
} | ||
}) | ||
|
||
// Build JSDoc for /docs/javascript | ||
await npm.run('build:jsdoc') | ||
} |
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,23 @@ | ||
import { join, normalize } 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'), | ||
destPath: join(paths.app, 'public/stylesheets'), | ||
|
||
filePath (file) { | ||
return normalize(`${file.name}.min.css`) | ||
} | ||
}) | ||
|
||
// Build SassDoc for /docs/sass | ||
await npm.run('build:sassdoc') | ||
} |
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
Oops, something went wrong.