-
Notifications
You must be signed in to change notification settings - Fork 502
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 experience of checking in node_modules #4
Comments
What would the dev inner loop look like for this when exploring context-related things? Right now to quickly and iteratively work on this I would get my workflow.yml and actions.yml set up to use my repo with a trigger on PR, and then quickly edit yml/ts files as needed in order to iterate quickly on things I can't test locally. |
A solution could be to use the Yarn Zero-Install feature in Yarn v2! Even if it's not released yet, it's quite stable. With it, dependencies are stored in a single folder as zipfiles, no need to keep a Drawbacks:
I could make a PR if you want to give it a try! |
I think what we've settled on (and this is reflected in the current state of this repo/linked docs) is not adding node_modules to master and only installing node_modules on release branches. This also encourages good patterns of having a release branch to pin to. I think the editor concerns you listed are significant enough, along with it still being in preview, that I probably want to stick with that solution (and I think it works pretty well so I don't see a huge need to switch). With that said, the zero-install feature looks really cool and I'm definitely intrigued - I definitely want to try it out. Also note, I want to leave this issue open until we update our first party actions to use the pattern I just laid out, so I think it should stay open for now. |
Some thoughts:
|
Not super strong in this area, but given what you've described I guess not. With that said, it seems like the right choice - I don't really think we want to be building those at runtime. In general, that's the pattern we're trying to avoid - having every action in your workflow build at runtime and adding a bunch of time to every job.
Yep, this is by design. A released version should remain static for security reasons (e.g. if someone were to maliciously update a dependency, we don't slide without an explicit choice)
Yep. We don't have those in our .gitignore, and that's part of our guidance docs. |
I don't think you can avoid that, especially if you want for actions to work across different OSes. Native modules won't work even on the same OS across different versions sometimes, or different versions of dependencies (e.g. header files) not to mention an entirely different OS. One modules comes to mind that often needs rebuilding: Maybe packaging actions as Docker images would work better. But then they won't be able to run natively on an OS, but I am not sure if this is a requirement. |
I think in general, my guidance would be to use a docker action if you need native modules. If that absolutely doesn't work for you, you could install your own dependencies at runtime (e.g. exec an npm install from node, or exec a script that does that) - that's not a pattern we recommend though simply because of the time that adds on to execution. |
@damccorm have you sen this repo/action to help automate this - https://github.com/bumfo/action-deploy Perhaps something to consider for template use? |
How about using the package registry to distribute them? |
Why not we use some tools like |
We're actually reconsidering this and thinking about both of these/similar solutions. Note that using the GitHub Package Registry isn't supported (yet), but you can use something like |
I've found
|
Thanks @swinton my projects "watch": "ncc build index.js --watch --minify",
"build": "ncc build index.js --minify", |
Have you considered requiring actions to attach specific files to a release? |
Update:
Just know that the feedback is heard loud and clear and we're investing in this area. I'm going to close since we're tracking the GPR work. Thanks so much for the feedback and the time to write this up. |
That is awesome 🚀 |
Use repository name
chore: test pr number
Update workflow trigger
Right now, we use husky but its kinda painful. In particular, for users who use editors like VSCode, not having node_modules in the gitignore causes some problems.
We've thought about the idea of having master (or another branch) basically be a dev branch, with no node_modules checked in and then creating an action to automatically create release branches. Definitely open to suggestions here as well.
The text was updated successfully, but these errors were encountered: