-
Notifications
You must be signed in to change notification settings - Fork 16
Build script improvements #212
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Even with `--offline` and installing a dependency that's contained in an internal worksace, `npm --workspace a install b` will put the latest published version of `b` (that it knows about) into the lock file rather than the current monorepo version of `b`. The only way I've found to get the version updated correctly in both `package.json` and `package-lock.json` is the way that @MiroslavDionisiev did it in the previous versioning script: just manually hammer the version number, then get `npm i --package-lock-only` to make the lock file consistent afterward.
cwillisf
commented
Mar 4, 2025
@@ -11,21 +11,27 @@ | |||
}, | |||
"scripts": { | |||
"refresh-gh-workflow": "ts-node scripts/build-gha-workflows.ts", | |||
"build-monorepo": "bash ./scripts/build-monorepo.sh", | |||
"build-monorepo": "cross-env-shell ./scripts/build-monorepo.sh", |
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.
I just learned about cross-env-shell
this week 😅
MiroslavDionisiev
approved these changes
Mar 5, 2025
Comment on lines
+97
to
+99
npm install --offline --no-audit --no-fund --ignore-scripts --package-lock-only | ||
# Sometimes it makes further changes the second time | ||
npm install --offline --no-audit --no-fund --ignore-scripts --package-lock-only |
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.
we don't ask how npm works
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 5, 2025
Build script improvements
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Changes to some of the build scripts:
clean
script and auditclean
scripts for each workspace (some were missing, some were incomplete)workspaces
to control the order of (for example)npm --workspaces run ...
npm run build
Reason for Changes
Most of this is just about developer ergonomics, but the version update also improves correctness. This approach ensures that several things happen:
package.json
package-lock.json
(global)Note that "package indirect dependencies" includes updating the version of indirect internal dependencies and updating indirect external dependencies if necessary. That can mean relatively complex
package-lock.json
changes that are difficult to predict or simulate with something likejq
.The details of the version update process are a little goofy and documented in the script itself.
Test Coverage
Tested locally with
npm run clean
,npm run build
, and variousnpm version
commands. Since thenpm run build
command is (now) used by CI, it's also tested by posting this PR.