Commit 40f29771 authored by Dan Allen's avatar Dan Allen

add --package option to Gulp CLI help for all tasks

parent e4297265
Pipeline #41646347 passed with stages
in 4 minutes and 49 seconds
......@@ -292,7 +292,7 @@ While not enforced by eslint yet, your code should also comply with the followin
When you <<run-tests,run the test suite>>, it will automatically lint (i.e., style check) your JavaScript code first.
If you ever want to run the linter separately, you can use the following gulp task:
If you ever want to run the linter separately, you can use the following Gulp task:
$ gulp lint
......@@ -300,7 +300,7 @@ While ESLint checks for syntax, it doesn't cover all the aesthetics of a code st
We employ {uri-prettier}[prettier] to automatically format the code.
Run prettier *after* you commit all your code changes as the format task will modify your files.
To run prettier, enter the following gulp task:
To run prettier, enter the following Gulp task:
$ gulp format
......@@ -577,7 +577,7 @@ To build Antora, which means running all the main tasks, use:
$ gulp build
You can omit the `build` argument since it's the default command:
Since `build` is the default command, you can omit the `build` argument:
$ gulp
......@@ -610,7 +610,7 @@ If you don't want the `lint` task to run when running tests, call the `test` tas
$ gulp test
If you want to run the linter separately, use the following gulp task:
If you want to run the linter separately, use the following Gulp task:
$ gulp lint
......@@ -649,7 +649,7 @@ Prettier is run by the `format` task.
The `format` task isn't (yet) run as part of the CI pipeline, so you'll need to run it manually.
But don't forget to run the `format` task before you submit a merge request!
To run prettier on your code, execute the following gulp task:
To run prettier on your code, execute the following Gulp task:
$ gulp format
......
......@@ -16,16 +16,19 @@ const glob = opts.package
sourceFiles: ['{gulpfile.js,lib-example,scripts,test}/**/*.js', 'packages/*/{lib,test}/**/*.js'],
testFiles: ['test/**/*-test.js', 'packages/*/test/**/*-test.js'],
}
const sharedOpts = { '--package <name>': 'Only run on files in the specified package' }
const lintTask = task({
name: 'lint',
desc: 'Lint JavaScript files using eslint (JavaScript Standard profile)',
opts: sharedOpts,
exec: lint(glob.sourceFiles),
})
const formatTask = task({
name: 'format',
desc: 'Format JavaScript files using prettier (JavaScript Standard profile)',
opts: sharedOpts,
exec: format(glob.sourceFiles),
})
......@@ -37,13 +40,14 @@ const testRunTask = task({
const testTask = task({
name: 'test',
desc: 'Run the test suite',
opts: { '--watch': 'Watch files and run the test suite whenever a file is changed' },
opts: Object.assign({}, sharedOpts, { '--watch': 'Watch files and run the test suite whenever a file is changed' }),
exec: opts.watch ? () => watch(glob.sourceFiles, { ignoreInitial: false }, testRunTask) : testRunTask,
})
const buildTask = task({
name: 'build',
desc: 'Run the test suite followed by the linter',
opts: sharedOpts,
exec: series(testTask, lintTask),
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment