-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Improve current workflow #25908
Comments
This repo is designed so that you can download it once and build or develop node without 1) having an existing install of node or 2) an internet connection Using npm/yarn would break that.
There is a reason that git doesn't track/automatically install git hooks. Husky is a pretty dangerous tool and I'd be uncomfortable with it being used here. |
Good point, maybe only use it in lint and check steps. Currently some tools in
I think husky is pretty useful. Many repos is using it. |
I wholeheartedly agree with @devsnek about avoiding husky. I would be hesitate to contribute if you install git hooks willy-nilly like that. The same goes for other But I also agree that the node community is arguably more comfortable using tools from npm. Having a package.json, but checking in node_modules or similar, might be a middle ground worth exploring. Anyway, that's just my two cents coming from the sidelines. Thanks for all the great work you do, really appreciate it ❤️ |
IMO git hooks do not help with everyone's workflows, especially when they are installed by default as part of the development workflow without a way out. Hooks like pre-commit or pre-push could be helpful when working on smaller changes, for example, PRs with only one patch and only a diff < 100 lines, but they could also get in the way when prototyping bigger changes locally and in personal forks. |
I don't know if that's the case in cpp. But with js project even big pr it will help a lot. I see electron use git hook for cpp too: https://github.com/electron/electron/blob/d53b51607c7b69bbc53c41b984963eef21d69f0b/package.json#L79. But maybe not the case for node ? Or we can just use it with js files ? |
@gengjiawen This is just me guessing but electron has a dedicated team whose members work at the same company so it would be easier to enforce development practices via things like git hooks. The same applies to v8 and chromium to some extent but even |
I have update some info in original post.
|
If we are going to use npm to install the development tools, we could just put all that into https://github.com/nodejs/node-core-utils and implement something like (But I am not sure if people are going to like the idea of having to |
How current npm lib are installed in tools folder like clang-format ? Update on 19/02/11: Lines 1238 to 1239 in 4deb23a
|
Closing this as there's been no further activity. @gengjiawen , if this is something you still believe we should pursue then it can be reopened. |
The core idea
Introduce Nodejs as base dependency to simplify current workflow.
The problem
When I work on src: refactor to nullptr #25888. I am pretty painful. With @joyeecheung awesome's work, we have
clang-format
also withmake-formatc-cpp
. But it's only available on unix-like os. And we have not clang-format the whole repo. I ended up copy the related snippet.Node community is more familiar with nodejs tools like npm or yarn instead of bash or bat file.
We may need to introduce more tools to improve develop efficiency like
prettier
andhusky
.How do we achieve this
package.json
in project root and add nodejs inprerequesite.md
pacakge.json
, remove the sources.husky
andlint-staged
, and addclang-format
to the hooks. We can see it in electron and repo likeCRA
see https://github.com/facebook/create-react-app/blob/master/package.json and https://github.com/electron/electron/blob/master/package.json.Also we should agree on
.clang-format
rules and format thesrc
andtest
folder commit to the repo.Update on 2019-02-07:
husky
andlint-staged
for now, see Improve current workflow #25908 (comment)Update on 2019-02-12
eslint
andbabel-eslint
and all its dependency code to this repo. It's just a tool. Also with this review eslint upgrade will be much easier.Makefile
andvcbuild.bat
. Unify it inpackage.json
will remove redundant code.The text was updated successfully, but these errors were encountered: