Conversation
aurreco-uga
pushed a commit
that referenced
this pull request
Jan 9, 2026
* add SKIP_YARN_VERSION_CHECK opt-out * more dual mode work * getting closer. YARN_IGNORE_PATH could be the key * extra env var checks in check-package-manager.mjs * protect yarn.lock from being committed under yarn 3 * update GH actions * GH actions set env vars higher up * don't check env vars in CI environment * add direnv docs and example .envrc * make the direnv info an aside * more direnv-related styling of README * improve docs * attempt fix for npm publish error
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bob's commentary
Our dev server has Centos 7 which can't run Node 20+
This means that Corepack and Yarn 4.12.0 can't be used on the dev server.
I originally removed the bundled yarn-3.3.1 from
web-monoreposo that we were forced to get yarn via corepack.We need that bundled version back so it can be used on the dev server, configured via
yarnPathin .yarnrc.ymlWe would normally abort any yarn operations if the version is not 4.12.0 but by setting
SKIP_YARN_VERSION_CHECK=trueon the dev server, we can skip that check.But then when we're not skipping the check, we want to ignore
yarnPathon our local dev machines where we have the ability to run Node 24 and Yarn 4.12.0, so some environment variables are needed to override this (YARN_IGNORE_PATH=true) and we can't set thenpmMinimalAgeGatevariable in .yarnrc.yml because Yarn 3 will complain about the unknown directive! So we provide this on local dev machines withYARN_NPM_MINIMAL_AGE_GATE=10080. Thetools/scripts/check-package-manager.mjsnow checks for these two env vars in dev.It's all documented in README.adoc :-)
Testing
palmmy dev site rebuilds withwb sitewith locally checked-outweb-monorepoon this branch and the environment variables as described here: https://github.com/VEuPathDB/web-monorepo/blob/legacy-deployment-mode/README.adoc#deployment-on-legacy-systems (usemainbranch if this link goes stale after merge)Claude summary
Complete Solution Summary
We've successfully implemented a comprehensive dual-mode Yarn setup with multiple layers of protection:
✅ Files Modified/Created:
tools/scripts/check-package-manager.mjs- Added
SKIP_YARN_VERSION_CHECKbypass for legacy deployments- Added validation for
YARN_IGNORE_PATHandYARN_NPM_MINIMAL_AGE_GATEtools/scripts/check-yarn-lockfile.sh(new)- Pre-commit validation to block Yarn 3 lockfile commits
.husky/pre-commit- Added lockfile version check before lint-staged
.yarnrc.yml- Added yarnPath for Yarn 1 → Yarn 3 bootstrap
- Removed npmMinimalAgeGate (moved to env var)
.yarn/releases/yarn-3.3.1.cjs- Bundled Yarn 3.3.1 for legacy deployments (had removed this in the initial "hardening")
README.adoc- Complete documentation for both modes
- Documentation for
direnvfor developers- added
YARN_NPM_MINIMAL_AGE_GATE: 10080- removed
yarnPathwith sed (YARN_IGNORE_PATH=1did not work for some mysterious reason)- this ensures that yarn 4.12.0 runs the build with the age gate, and the immutable lockfile setting is applied too. (though the age gate only really applies when modifying the lockfile with
yarn addetc)✅ Protection Layers:
✅ Tested & Verified:
YARN_IGNORE_PATH=truePATH)