Skip to content

Commit

Permalink
chore!: Only allow js variants for .gulp config files (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 17, 2024
1 parent ed86da7 commit e5c7983
Show file tree
Hide file tree
Showing 51 changed files with 111 additions and 108 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -91,15 +91,15 @@ 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

The CLI adds `process.env.INIT_CWD` which is the original cwd it was launched from.

## 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 (`~`).

Expand Down Expand Up @@ -224,6 +224,9 @@ __Some flags only work with gulp 4 and will be ignored when invoked against gulp

MIT

<!-- prettier-ignore-start -->
[interpret-js-variants]: https://github.com/gulpjs/interpret#jsvariants
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/gulp-cli.svg?style=flat-square
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -38,13 +38,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,
},
],
});
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
description: "gulp-cli/test/fixtures"
};
3 changes: 0 additions & 3 deletions test/fixtures/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/continue/f/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
continue: false
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/continue/f/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/continue/t/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
continue: true
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/continue/t/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
gulpfile: "./other_dir/gulpfile.coffee"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/gulpfile/autoload-fail/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/gulpfile/autoload/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
gulpfile: "other_folder/gulpfile-exports.babel.js"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/gulpfile/autoload/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/gulpfile/cwd/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
gulpfile: "../is/here/gulpfile-by-cwd-cfg.js"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/gulpfile/cwd/.gulp.json

This file was deleted.

@@ -0,0 +1,3 @@
module.exports = {
gulpfile: "../cwd/gulpfile.js"
};

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/gulpfile/prj/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
gulpfile: "../is/here/gulpfile-by-prj-cfg.js"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/gulpfile/prj/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/logLevel/L/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
logLevel: 1
}
}
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/logLevel/L/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/logLevel/LL/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
logLevel: 2
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/logLevel/LL/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/logLevel/LLL/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
logLevel: 3
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/logLevel/LLL/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/nodeFlags/array/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
nodeFlags: ["--lazy", "--trace-deprecation"]
}
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/nodeFlags/array/.gulp.json

This file was deleted.

@@ -1,6 +1,6 @@
{
"preload": [
module.exports = {
preload: [
"./preload_one",
"./preload_two"
]
}
};
5 changes: 5 additions & 0 deletions test/fixtures/config/flags/preload/join-flags/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
preload: [
"./preload_two"
]
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/preload/join-flags/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/preload/string/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
preload: "./preload"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/preload/string/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/flags/preload/with-cwd/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
preload: "../preload"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/flags/preload/with-cwd/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/series/f/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
series: false
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/series/f/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/series/t/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
series: true
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/series/t/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/silent/f/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
silent: false
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/silent/f/.gulp.json

This file was deleted.

5 changes: 5 additions & 0 deletions test/fixtures/config/flags/silent/t/.gulp.js
@@ -0,0 +1,5 @@
module.exports = {
flags: {
silent: true
}
};
5 changes: 0 additions & 5 deletions test/fixtures/config/flags/silent/t/.gulp.json

This file was deleted.

6 changes: 6 additions & 0 deletions test/fixtures/config/flags/sortTasks/f/.gulp.js
@@ -0,0 +1,6 @@
module.exports = {
gulpfile: "../../../../gulpfiles/gulpfile-4.js",
flags: {
sortTasks: false
}
};
6 changes: 0 additions & 6 deletions test/fixtures/config/flags/sortTasks/f/.gulp.json

This file was deleted.

6 changes: 6 additions & 0 deletions test/fixtures/config/flags/sortTasks/t/.gulp.js
@@ -0,0 +1,6 @@
module.exports = {
gulpfile: "../../../../gulpfiles/gulpfile-4.js",
flags: {
sortTasks: true
}
};
6 changes: 0 additions & 6 deletions test/fixtures/config/flags/sortTasks/t/.gulp.json

This file was deleted.

6 changes: 6 additions & 0 deletions test/fixtures/config/flags/tasksDepth/.gulp.js
@@ -0,0 +1,6 @@
module.exports = {
gulpfile: "../../../gulpfiles/gulpfile-4.js",
flags: {
tasksDepth: 4
}
};
6 changes: 0 additions & 6 deletions test/fixtures/config/flags/tasksDepth/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/config/foo/bar/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
description: "Description by .gulp.json in directory foo/bar"
};
3 changes: 0 additions & 3 deletions test/fixtures/config/foo/bar/.gulp.json

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/gulpfiles/.gulp.js
@@ -0,0 +1,3 @@
module.exports = {
description: "gulp-cli/test/fixtures/gulpfiles"
};
3 changes: 0 additions & 3 deletions test/fixtures/gulpfiles/.gulp.json

This file was deleted.

0 comments on commit e5c7983

Please sign in to comment.