-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3384 from alphagov/build-tasks-gulpfile-app
Build tasks: Move review app tasks into `app/tasks`
- Loading branch information
Showing
32 changed files
with
1,396 additions
and
684 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
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,16 @@ | ||
import gulp from 'gulp' | ||
|
||
import * as build from './tasks/build/index.mjs' | ||
import { scripts, styles } from './tasks/index.mjs' | ||
|
||
/** | ||
* Build target tasks | ||
*/ | ||
gulp.task('build', build.dist) | ||
gulp.task('dev', build.dev) | ||
|
||
/** | ||
* Utility tasks | ||
*/ | ||
gulp.task('scripts', scripts) | ||
gulp.task('styles', 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
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 { files } from '../../tasks/index.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,17 @@ | ||
import gulp from 'gulp' | ||
|
||
import { paths } from '../../../config/index.js' | ||
import { npm } from '../../../tasks/index.mjs' | ||
import { watch } from '../index.mjs' | ||
|
||
import dist from './dist.mjs' | ||
|
||
/** | ||
* Dev task | ||
* Runs a sequence of tasks on start | ||
*/ | ||
export default gulp.series( | ||
dist, | ||
watch, | ||
npm.script('serve', paths.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,16 @@ | ||
import gulp from 'gulp' | ||
|
||
import { assets, clean, scripts, styles } from '../index.mjs' | ||
|
||
/** | ||
* Build review app task | ||
* Prepare dist folder for review app | ||
*/ | ||
export default gulp.series( | ||
clean, | ||
gulp.parallel( | ||
assets, | ||
scripts, | ||
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 { files } from '../../tasks/index.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,26 @@ | ||
import { join } from 'path' | ||
|
||
import gulp from 'gulp' | ||
|
||
import { paths } from '../../config/index.js' | ||
import { npm, scripts, task } from '../../tasks/index.mjs' | ||
|
||
/** | ||
* JavaScripts task (for watch) | ||
* Compilation, documentation | ||
*/ | ||
export const compile = gulp.series( | ||
task.name('compile:js', () => | ||
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 | ||
npm.script('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,26 @@ | ||
import { join } from 'path' | ||
|
||
import gulp from 'gulp' | ||
|
||
import { paths } from '../../config/index.js' | ||
import { npm, styles, task } from '../../tasks/index.mjs' | ||
|
||
/** | ||
* Stylesheets task (for watch) | ||
* Compilation, documentation | ||
*/ | ||
export const compile = gulp.series( | ||
task.name('compile:scss', () => | ||
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 | ||
npm.script('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
Oops, something went wrong.