diff --git a/README.md b/README.md index 78ae7453..1e9089e0 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Add `gulp --completion=fish | source` to `~/.config/fish/config.fish`. ## Compilers -You can find a list of supported languages at https://github.com/gulpjs/interpret. If you would like to add support for a new language, send pull requests/open issues on that project. +You can find a list of supported JavaScript variant languages in [Interpret][interpret-js-variants]. If you would like to add support for a new language, send pull requests/open issues on that project. ## Environment @@ -99,7 +99,7 @@ The CLI adds `process.env.INIT_CWD` which is the original cwd it was launched fr ## Configuration -Configuration is supported through the use of a `.gulp.*` file (e.g. `.gulp.json`, `.gulp.yml`). You can find a list of supported languages at https://github.com/gulpjs/interpret. +Configuration is supported through the use of a `.gulp.*` file (e.g. `.gulp.js`, `.gulp.ts`). You can find a list of supported JavaScript variant languages in [Interpret][interpret-js-variants]. A configuration file from the current working directory (`cwd`) or above are selected before a configuration file from the home directory (`~`). @@ -224,6 +224,9 @@ __Some flags only work with gulp 4 and will be ignored when invoked against gulp MIT + +[interpret-js-variants]: https://github.com/gulpjs/interpret#jsvariants + [downloads-image]: https://img.shields.io/npm/dm/gulp-cli.svg?style=flat-square diff --git a/index.js b/index.js index 2a2c7ad4..b0d50969 100644 --- a/index.js +++ b/index.js @@ -41,13 +41,13 @@ var cli = new Liftoff({ { name: '.gulp', path: '.', - extensions: interpret.extensions, + extensions: interpret.jsVariants, findUp: true, }, { name: '.gulp', path: '~', - extensions: interpret.extensions, + extensions: interpret.jsVariants, }, ], }); diff --git a/test/fixtures/.gulp.js b/test/fixtures/.gulp.js index 08a9d1e7..ad18e9c8 100644 --- a/test/fixtures/.gulp.js +++ b/test/fixtures/.gulp.js @@ -7,4 +7,4 @@ module.exports = { return "gulp-cli/test/fixtures"; } } -} +}; diff --git a/test/fixtures/config/flags/continue/f/.gulp.js b/test/fixtures/config/flags/continue/f/.gulp.js new file mode 100644 index 00000000..6edb0159 --- /dev/null +++ b/test/fixtures/config/flags/continue/f/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + continue: false + } +}; diff --git a/test/fixtures/config/flags/continue/f/.gulp.json b/test/fixtures/config/flags/continue/f/.gulp.json deleted file mode 100644 index e0a7cbf2..00000000 --- a/test/fixtures/config/flags/continue/f/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "continue": false - } -} diff --git a/test/fixtures/config/flags/continue/t/.gulp.js b/test/fixtures/config/flags/continue/t/.gulp.js new file mode 100644 index 00000000..ed371532 --- /dev/null +++ b/test/fixtures/config/flags/continue/t/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + continue: true + } +}; diff --git a/test/fixtures/config/flags/continue/t/.gulp.json b/test/fixtures/config/flags/continue/t/.gulp.json deleted file mode 100644 index 7161f7a2..00000000 --- a/test/fixtures/config/flags/continue/t/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "continue": true - } -} diff --git a/test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.js b/test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.js new file mode 100644 index 00000000..ecfc61d3 --- /dev/null +++ b/test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + gulpfile: "./other_dir/gulpfile.coffee" +}; diff --git a/test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.json b/test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.json deleted file mode 100644 index 42846df5..00000000 --- a/test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gulpfile": "./other_dir/gulpfile.coffee" -} diff --git a/test/fixtures/config/flags/gulpfile/autoload/.gulp.js b/test/fixtures/config/flags/gulpfile/autoload/.gulp.js new file mode 100644 index 00000000..b307baf1 --- /dev/null +++ b/test/fixtures/config/flags/gulpfile/autoload/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + gulpfile: "other_folder/gulpfile-exports.babel.js" +}; diff --git a/test/fixtures/config/flags/gulpfile/autoload/.gulp.json b/test/fixtures/config/flags/gulpfile/autoload/.gulp.json deleted file mode 100644 index 10c5b586..00000000 --- a/test/fixtures/config/flags/gulpfile/autoload/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gulpfile": "other_folder/gulpfile-exports.babel.js" -} diff --git a/test/fixtures/config/flags/gulpfile/cwd/.gulp.js b/test/fixtures/config/flags/gulpfile/cwd/.gulp.js new file mode 100644 index 00000000..3ff2eb25 --- /dev/null +++ b/test/fixtures/config/flags/gulpfile/cwd/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + gulpfile: "../is/here/gulpfile-by-cwd-cfg.js" +}; diff --git a/test/fixtures/config/flags/gulpfile/cwd/.gulp.json b/test/fixtures/config/flags/gulpfile/cwd/.gulp.json deleted file mode 100644 index 7f0181dd..00000000 --- a/test/fixtures/config/flags/gulpfile/cwd/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gulpfile": "../is/here/gulpfile-by-cwd-cfg.js" -} diff --git a/test/fixtures/config/flags/gulpfile/override-by-cliflag/.gulp.js b/test/fixtures/config/flags/gulpfile/override-by-cliflag/.gulp.js new file mode 100644 index 00000000..3aa3b2db --- /dev/null +++ b/test/fixtures/config/flags/gulpfile/override-by-cliflag/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + gulpfile: "../cwd/gulpfile.js" +}; diff --git a/test/fixtures/config/flags/gulpfile/override-by-cliflag/.gulp.json b/test/fixtures/config/flags/gulpfile/override-by-cliflag/.gulp.json deleted file mode 100644 index fb737ede..00000000 --- a/test/fixtures/config/flags/gulpfile/override-by-cliflag/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gulpfile": "../cwd/gulpfile.js" -} diff --git a/test/fixtures/config/flags/gulpfile/prj/.gulp.js b/test/fixtures/config/flags/gulpfile/prj/.gulp.js new file mode 100644 index 00000000..321e3bdf --- /dev/null +++ b/test/fixtures/config/flags/gulpfile/prj/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + gulpfile: "../is/here/gulpfile-by-prj-cfg.js" +}; diff --git a/test/fixtures/config/flags/gulpfile/prj/.gulp.json b/test/fixtures/config/flags/gulpfile/prj/.gulp.json deleted file mode 100644 index 625bb7c1..00000000 --- a/test/fixtures/config/flags/gulpfile/prj/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gulpfile": "../is/here/gulpfile-by-prj-cfg.js" -} diff --git a/test/fixtures/config/flags/logLevel/L/.gulp.js b/test/fixtures/config/flags/logLevel/L/.gulp.js new file mode 100644 index 00000000..fca4e6b7 --- /dev/null +++ b/test/fixtures/config/flags/logLevel/L/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + logLevel: 1 + } +} diff --git a/test/fixtures/config/flags/logLevel/L/.gulp.json b/test/fixtures/config/flags/logLevel/L/.gulp.json deleted file mode 100644 index 8b4448e9..00000000 --- a/test/fixtures/config/flags/logLevel/L/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "logLevel": 1 - } -} diff --git a/test/fixtures/config/flags/logLevel/LL/.gulp.js b/test/fixtures/config/flags/logLevel/LL/.gulp.js new file mode 100644 index 00000000..033e74d7 --- /dev/null +++ b/test/fixtures/config/flags/logLevel/LL/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + logLevel: 2 + } +}; diff --git a/test/fixtures/config/flags/logLevel/LL/.gulp.json b/test/fixtures/config/flags/logLevel/LL/.gulp.json deleted file mode 100644 index cd498c8d..00000000 --- a/test/fixtures/config/flags/logLevel/LL/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "logLevel": 2 - } -} diff --git a/test/fixtures/config/flags/logLevel/LLL/.gulp.js b/test/fixtures/config/flags/logLevel/LLL/.gulp.js new file mode 100644 index 00000000..5120f6f1 --- /dev/null +++ b/test/fixtures/config/flags/logLevel/LLL/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + logLevel: 3 + } +}; diff --git a/test/fixtures/config/flags/logLevel/LLL/.gulp.json b/test/fixtures/config/flags/logLevel/LLL/.gulp.json deleted file mode 100644 index 267a3cec..00000000 --- a/test/fixtures/config/flags/logLevel/LLL/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "logLevel": 3 - } -} diff --git a/test/fixtures/config/flags/nodeFlags/array/.gulp.js b/test/fixtures/config/flags/nodeFlags/array/.gulp.js new file mode 100644 index 00000000..29053b1a --- /dev/null +++ b/test/fixtures/config/flags/nodeFlags/array/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + nodeFlags: ["--lazy", "--trace-deprecation"] +} diff --git a/test/fixtures/config/flags/nodeFlags/array/.gulp.json b/test/fixtures/config/flags/nodeFlags/array/.gulp.json deleted file mode 100644 index 79cd530d..00000000 --- a/test/fixtures/config/flags/nodeFlags/array/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "nodeFlags": ["--lazy", "--trace-deprecation"] -} diff --git a/test/fixtures/config/flags/preload/array/.gulp.json b/test/fixtures/config/flags/preload/array/.gulp.js similarity index 56% rename from test/fixtures/config/flags/preload/array/.gulp.json rename to test/fixtures/config/flags/preload/array/.gulp.js index 2f4855e1..da5c398f 100644 --- a/test/fixtures/config/flags/preload/array/.gulp.json +++ b/test/fixtures/config/flags/preload/array/.gulp.js @@ -1,6 +1,6 @@ -{ - "preload": [ +module.exports = { + preload: [ "./preload_one", "./preload_two" ] -} +}; diff --git a/test/fixtures/config/flags/preload/join-flags/.gulp.js b/test/fixtures/config/flags/preload/join-flags/.gulp.js new file mode 100644 index 00000000..fe2a9b08 --- /dev/null +++ b/test/fixtures/config/flags/preload/join-flags/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + preload: [ + "./preload_two" + ] +}; diff --git a/test/fixtures/config/flags/preload/join-flags/.gulp.json b/test/fixtures/config/flags/preload/join-flags/.gulp.json deleted file mode 100644 index 63405ae5..00000000 --- a/test/fixtures/config/flags/preload/join-flags/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "preload": [ - "./preload_two" - ] -} diff --git a/test/fixtures/config/flags/preload/string/.gulp.js b/test/fixtures/config/flags/preload/string/.gulp.js new file mode 100644 index 00000000..cb913254 --- /dev/null +++ b/test/fixtures/config/flags/preload/string/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + preload: "./preload" +}; diff --git a/test/fixtures/config/flags/preload/string/.gulp.json b/test/fixtures/config/flags/preload/string/.gulp.json deleted file mode 100644 index 22886303..00000000 --- a/test/fixtures/config/flags/preload/string/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "preload": "./preload" -} diff --git a/test/fixtures/config/flags/preload/with-cwd/.gulp.js b/test/fixtures/config/flags/preload/with-cwd/.gulp.js new file mode 100644 index 00000000..e51966f4 --- /dev/null +++ b/test/fixtures/config/flags/preload/with-cwd/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + preload: "../preload" +}; diff --git a/test/fixtures/config/flags/preload/with-cwd/.gulp.json b/test/fixtures/config/flags/preload/with-cwd/.gulp.json deleted file mode 100644 index c92f9743..00000000 --- a/test/fixtures/config/flags/preload/with-cwd/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "preload": "../preload" -} diff --git a/test/fixtures/config/flags/series/f/.gulp.js b/test/fixtures/config/flags/series/f/.gulp.js new file mode 100644 index 00000000..6605aca5 --- /dev/null +++ b/test/fixtures/config/flags/series/f/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + series: false + } +}; diff --git a/test/fixtures/config/flags/series/f/.gulp.json b/test/fixtures/config/flags/series/f/.gulp.json deleted file mode 100644 index 6da4dba0..00000000 --- a/test/fixtures/config/flags/series/f/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "series": false - } -} diff --git a/test/fixtures/config/flags/series/t/.gulp.js b/test/fixtures/config/flags/series/t/.gulp.js new file mode 100644 index 00000000..f21fe066 --- /dev/null +++ b/test/fixtures/config/flags/series/t/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + series: true + } +}; diff --git a/test/fixtures/config/flags/series/t/.gulp.json b/test/fixtures/config/flags/series/t/.gulp.json deleted file mode 100644 index 7f1f5a44..00000000 --- a/test/fixtures/config/flags/series/t/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "series": true - } -} diff --git a/test/fixtures/config/flags/silent/f/.gulp.js b/test/fixtures/config/flags/silent/f/.gulp.js new file mode 100644 index 00000000..4630a77a --- /dev/null +++ b/test/fixtures/config/flags/silent/f/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + silent: false + } +}; diff --git a/test/fixtures/config/flags/silent/f/.gulp.json b/test/fixtures/config/flags/silent/f/.gulp.json deleted file mode 100644 index 4f3822ab..00000000 --- a/test/fixtures/config/flags/silent/f/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "silent": false - } -} diff --git a/test/fixtures/config/flags/silent/t/.gulp.js b/test/fixtures/config/flags/silent/t/.gulp.js new file mode 100644 index 00000000..22486fd8 --- /dev/null +++ b/test/fixtures/config/flags/silent/t/.gulp.js @@ -0,0 +1,5 @@ +module.exports = { + flags: { + silent: true + } +}; diff --git a/test/fixtures/config/flags/silent/t/.gulp.json b/test/fixtures/config/flags/silent/t/.gulp.json deleted file mode 100644 index 9917bd8c..00000000 --- a/test/fixtures/config/flags/silent/t/.gulp.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "flags": { - "silent": true - } -} diff --git a/test/fixtures/config/flags/sortTasks/f/.gulp.js b/test/fixtures/config/flags/sortTasks/f/.gulp.js new file mode 100644 index 00000000..e4640d82 --- /dev/null +++ b/test/fixtures/config/flags/sortTasks/f/.gulp.js @@ -0,0 +1,6 @@ +module.exports = { + gulpfile: "../../../../gulpfiles/gulpfile-4.js", + flags: { + sortTasks: false + } +}; diff --git a/test/fixtures/config/flags/sortTasks/f/.gulp.json b/test/fixtures/config/flags/sortTasks/f/.gulp.json deleted file mode 100644 index daa8a926..00000000 --- a/test/fixtures/config/flags/sortTasks/f/.gulp.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "gulpfile": "../../../../gulpfiles/gulpfile-4.js", - "flags": { - "sortTasks": false - } -} diff --git a/test/fixtures/config/flags/sortTasks/t/.gulp.js b/test/fixtures/config/flags/sortTasks/t/.gulp.js new file mode 100644 index 00000000..aae6877b --- /dev/null +++ b/test/fixtures/config/flags/sortTasks/t/.gulp.js @@ -0,0 +1,6 @@ +module.exports = { + gulpfile: "../../../../gulpfiles/gulpfile-4.js", + flags: { + sortTasks: true + } +}; diff --git a/test/fixtures/config/flags/sortTasks/t/.gulp.json b/test/fixtures/config/flags/sortTasks/t/.gulp.json deleted file mode 100644 index 254cd26a..00000000 --- a/test/fixtures/config/flags/sortTasks/t/.gulp.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "gulpfile": "../../../../gulpfiles/gulpfile-4.js", - "flags": { - "sortTasks": true - } -} diff --git a/test/fixtures/config/flags/tasksDepth/.gulp.js b/test/fixtures/config/flags/tasksDepth/.gulp.js new file mode 100644 index 00000000..6960b163 --- /dev/null +++ b/test/fixtures/config/flags/tasksDepth/.gulp.js @@ -0,0 +1,6 @@ +module.exports = { + gulpfile: "../../../gulpfiles/gulpfile-4.js", + flags: { + tasksDepth: 4 + } +}; diff --git a/test/fixtures/config/flags/tasksDepth/.gulp.json b/test/fixtures/config/flags/tasksDepth/.gulp.json deleted file mode 100644 index bc309203..00000000 --- a/test/fixtures/config/flags/tasksDepth/.gulp.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "gulpfile": "../../../gulpfiles/gulpfile-4.js", - "flags": { - "tasksDepth": 4 - } -} diff --git a/test/fixtures/config/foo/bar/.gulp.js b/test/fixtures/config/foo/bar/.gulp.js new file mode 100644 index 00000000..4c3e35e7 --- /dev/null +++ b/test/fixtures/config/foo/bar/.gulp.js @@ -0,0 +1,3 @@ +module.exports = { + description: "Description by .gulp.json in directory foo/bar" +}; diff --git a/test/fixtures/config/foo/bar/.gulp.json b/test/fixtures/config/foo/bar/.gulp.json deleted file mode 100644 index 186db419..00000000 --- a/test/fixtures/config/foo/bar/.gulp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Description by .gulp.json in directory foo/bar" -} diff --git a/test/fixtures/gulpfiles/.gulp.js b/test/fixtures/gulpfiles/.gulp.js index e82d59c2..a4eb937f 100644 --- a/test/fixtures/gulpfiles/.gulp.js +++ b/test/fixtures/gulpfiles/.gulp.js @@ -7,4 +7,4 @@ module.exports = { return "gulp-cli/test/fixtures/gulpfiles"; } } -} +};