Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: Only allow js variants for .gulp config files #261

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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.

Loading