-
-
Notifications
You must be signed in to change notification settings - Fork 711
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
Prettier package not actually being cached #1169
Comments
Oh that's so frustrating! I was worried about that - I spotted a few runs that seemed faster and hoped that it meant that the package was coming out of the You've convinced me that Datasette itself should have a But... I'd really love to figure out a general pattern for using Any ideas? The best I can think of is for the workflow itself to write out a |
And @benpickles yes I would land that pull request straight away as-is. Thanks! |
Also welcome in that PR would be a bit of documentation for contributors, see #1167 - but no problem if you leave that out, I'm happy to add it later. |
I somewhat share your reluctance to add a package.json to seemingly every project out there but ultimately if they're project dependencies it's important they're managed within the codebase. |
With the current configuration Prettier seems to be installed on every run - which can been seen from the output:
Prettier isn't explicitly being installed (it's surprising that actually installing the dependencies isn't included in the actions/cache docs) but it turns out that
npx
will automatically install the package for the specified command (it actually guesses the package name from the name of the command). I'm not sure where Prettier ends up being installed but it doesn't appear to be in~/.npm
according to the post-cache output (or./node_modules
when I tested locally):I think there are a couple of approaches to tackling this, you could manually install/cache Prettier within the action, or add a
package.json
with Prettier. I would go with the latter because it's a more standard and maintainable approach and it will also ensure that, along with CI, anyone working on the project will run the same version of Prettier (you'll also get Dependabot JavaScript updates).I've tested the
package.json
approach on a branch and am happy to turn it into a pull request if you fancy.The text was updated successfully, but these errors were encountered: