-
Notifications
You must be signed in to change notification settings - Fork 22.4k
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
no need for the BUILD_FILES env var #122
no need for the BUILD_FILES env var #122
Conversation
# The reason this script isn't in `package.json` is because | ||
# you don't need that script as a writer. It's only used in CI | ||
# and it can't use the default CONTENT_ROOT that gets set in | ||
# package.json. | ||
node node_modules/@mdn/yari/build/cli.js | ||
node node_modules/@mdn/yari/build/cli.js ${{ env.GIT_DIFF }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was the original thing I wanted to change. Now the build/cli.js
is a caporal
CLI app, its default argument is (0-N) the file paths to the index.html
files to build. This used to not be possible before.
Depending on BUILD_FILES
never felt great because it's a string that you need to manually split up. By relying on UNIX principles (aka. bash and caporal
) you're instead letting them take care of that.
@escattone This PR became a double-concern thing. I first wanted to change how we invoke the builder based on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peterbe I like it.
@peterbe I don't know why the |
Probably because, at least at some point, I did make an edit to one of the |
Here's the problem, it seems the yarn install stuff isn't getting cached at all.
![Screen Shot 2020-11-20 at 10 19 17 AM](https://user-images.githubusercontent.com/26739/99816640-ef115780-2b19-11eb-9f14-596636fe7477.png)
Cool! It totally works.
![Screen Shot 2020-11-20 at 10 47 26 AM](https://user-images.githubusercontent.com/26739/99819724-d2771e80-2b1d-11eb-9260-10a48507f95d.png)
Now, taking care of
yarn
andnode_modules
takes ~7s on a warm cache. And a warm cache is extremely likely on this repo because 9 out of 10 PRs are expected to be edits to thefiles/**/index.html
files.Unlike the "default suggestion for Node Yarn" I opted for the same solution we're doing for the poetry install in Yari.
And this is actually the recommended way for "Node - Lerna".
The net effect is that we cache the whole
node_modules
directory. And it's keyed by OS and byyarn.lock
so it's very unlikely that a cache hit is stale.