-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Consider switching from gulp to npm scripts to reduce bloat #473
Comments
I checked that I also thought about one more requirement – currently, our lint tasks ignore files listed in |
There's the sweet npx now which makes gulp even less needed. |
So I've tested The only problem would be removing existing guppy git hook. Also from Husky README:
So as I understand this would require to:
|
After some trial and error we can add this to every project's {
"scripts": {
"lint": "eslint",
"precommit": "lint-staged"
},
"lint-staged": {
"**/[^(lib)]**/*.js": [ "eslint --fix", "git add" ]
}
} with additional dependencies of |
This will translate too (from the main project):
|
I think that getting rid of I'd like to use SourceTree again to more than browsing and diffing—in such a distributed project, it's a must–have thing IMO. |
Will you check if ST works fine with Husky (which replaces guppy) after @jodator will do the changes? |
@Reinmar Husky works nice in PHPStorm so I guess that ST will work also. |
Can you check it @jodator just to make sure? I'm in a totally different context at this moment. |
BTW, please don't add |
And |
Internal: Remove gulp dependency for pre-commit linting. Closes #473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
Actually, I realised that only part of the job was done. The other part is completely dropping gulp from the main package too. So, let's continue the journey :) We already have some scripts in the |
It also seems that we can remove |
OK I've started checking scripts and it looks that gulp would be easy to remove thanks to a way how gulp test --files=core
# is equal to:
npm test -- --files=core ps.: I've found only one place that uses |
There will also be the dev env and testing env guides to update after such a change. |
BTW, how will these calls look with npx? Is the |
I'm not sure whether I understood your question but the All parameters before |
I've been asking about npx (read more here: https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b). |
Npx… 😱 |
So the thing with npx is that it needs to find command in package. So some dev tools need to add "bin" to "package.json" so we can be able to use them. So for tests we can have either: npm t -- --files=core
# for installed script in .bin:
npx ckeditor5-dev-tests --files=core
# for command that npx cannot guess package:
npx ckeditor5-dev-tests-manual -p @ckeditor/ckeditor5-dev-test --files=core setting node params: # already defined in package.json
npm t
# must be passed to npx
npx -n=--max_old_space_size=4096 ckeditor5-dev-tests
npx --node-arg=--max_old_space_size=4096 ckeditor5-dev-tests Which for tests we can provide both: npm run-script and npx. Other dev dependencies might be ported as well to support npx like npx ckeditor5-dev-translations -p @ckeditor/ckeditor5-dev-env collect In the above if binary isn't named the same as package you must define from which package take binary. Running npx commands works well if command has the same name as package: npx @ckeditor/ckeditor5-dev-tests Above will fetch |
Internal: Removed gulp dependency in favor of npm scripts. Closes #473.
Internal: Removed gulp dependency for pre-commit linting. See ckeditor/ckeditor5#473.
We have
ckeditor5
repository andckeditor5-*
sub repositories. Right now all of them use gulp.As for
ckeditor5
itself, it doesn't matter that much, but we already have some npm scripts there, so it's a bit messy. We could try to standardise this.A bigger issue is with all the other packages. All of them base on gulp which isn't the most lightweight dependency and we use it to expose two simple tasks –
lint
andlint-staged
.So, every
ckeditor5-*
package depends on@ckeditor/ckeditor5-dev-lint
,gulp
,guppy-pre-commit
which have around 380 dependencies: https://gist.github.com/Reinmar/d9633ea5bf583c6a85111a269d273995.We install them using Lerna and only
guppy-pre-commit
is installed in every package physically. But it still takes a time to calculate all the deps for every package to see what needs to be hoisted tockeditor5
.Another thing is that we have one additional file –
gulpfile.js
that we could remove if we switched to npm scripts. And, we could drop theckeditor5-dev-lint
package altogether if we'd be lucky.So, the plan would be to try to implement:
lint
,lint-staged
andpre-commit
,guppy-pre-commit
but triggering npm instead of gulp).It seems that it can be easily done using https://github.com/okonet/lint-staged. We just need to figure out whether this will be any real improvement in terms of dependency bloat.
The text was updated successfully, but these errors were encountered: