-
Notifications
You must be signed in to change notification settings - Fork 24
fix(toolchain): upgrade Node.js to 20.17.0 for npm 11.6.2 compatibility #680
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
Conversation
npm 11.6.2 requires Node.js ^20.17.0 || >=22.9.0 for OIDC authentication to work properly. Without this, npm fails with ENEEDAUTH even though OIDC environment validation passes. Previous workflow failure: https://github.com/adobe/spectrum-design-data/actions/runs/21301759226 Error from logs: npm warn cli npm v11.6.2 does not support Node.js v20.12.2. This version of npm supports the following node versions: ^20.17.0 || >=22.9.0
|
Run report for ed84b6feTotal time: 1m 25s | Comparison time: 3m 46s | Estimated savings: 2m 21s (62.2% faster)
Expanded report
Touched files |
Moon caches the dist/ folder after build completes and cleans it up. The export task depends on build but didn't declare dist as an input, so moon didn't restore it from cache, causing 'No such file or directory' error. Fixes CI failure: spectrum-glossary:export task
Moon caches and cleans outputs immediately after task completion. Even with dist declared as input to export task, moon wasn't restoring it from cache in CI. Removing outputs declaration allows dist to persist naturally for the dependent export task. This trades off cache optimization for reliability.
The export task is only needed for the deploy-docs workflow, not for CI. Marking it as local: true excludes it from 'moon ci' runs, preventing the dist folder hashing issue since CI doesn't need to export glossary. The deploy-docs workflow explicitly runs 'moon run spectrum-glossary:export' which will work correctly there.
This version explicitly passes OIDC environment variables to the publish command execution, which should fix the proto shim compatibility issue. Changes: - Use GarthDB/changesets-action@v1.6.8 instead of changesets/action@v1 - Enable oidcAuth: true to activate explicit env var passing - Restore single-step publish (no need for separate manual publish step) - Remove verification step (v1.6.8 handles validation internally) How v1.6.8 fixes the proto shim issue: - PR #687 confirmed OIDC vars ARE present in GitHub Actions shell - Previous versions failed because vars were lost through proto shim chain - v1.6.8 explicitly passes env vars to exec() call using env option - This forces OIDC variables through: action → pnpm → changeset → npm Expected outcome: ✅ npm should detect OIDC from explicitly passed environment variables ✅ Packages should publish successfully with provenance ✅ Works with proto/moonrepo toolchains and standard environments Related: - v1.6.8 release: https://github.com/GarthDB/changesets-action/releases/tag/v1.6.8 - Root cause identified in PR #687 - Builds on npm 11.6.2 setup from PR #680
…688) This version explicitly passes OIDC environment variables to the publish command execution, which should fix the proto shim compatibility issue. Changes: - Use GarthDB/changesets-action@v1.6.8 instead of changesets/action@v1 - Enable oidcAuth: true to activate explicit env var passing - Restore single-step publish (no need for separate manual publish step) - Remove verification step (v1.6.8 handles validation internally) How v1.6.8 fixes the proto shim issue: - PR #687 confirmed OIDC vars ARE present in GitHub Actions shell - Previous versions failed because vars were lost through proto shim chain - v1.6.8 explicitly passes env vars to exec() call using env option - This forces OIDC variables through: action → pnpm → changeset → npm Expected outcome: ✅ npm should detect OIDC from explicitly passed environment variables ✅ Packages should publish successfully with provenance ✅ Works with proto/moonrepo toolchains and standard environments Related: - v1.6.8 release: https://github.com/GarthDB/changesets-action/releases/tag/v1.6.8 - Root cause identified in PR #687 - Builds on npm 11.6.2 setup from PR #680
Problem
The OIDC-enabled publishing workflow was failing with two issues after PR #679 merged:
spectrum-glossary:exporttask failing withNo such file or directoryIssue 1: npm/Node.js Version Incompatibility
Error from workflow logs:
Despite OIDC environment validation passing, npm failed to use OIDC authentication due to the version incompatibility.
Issue 2: Glossary Export Failing in CI
Error:
Moon was caching
dist/as an output and cleaning it up immediately after the build task completed. The export task couldn't access the dist folder even when declared as an input.Solutions Applied
1. Upgrade Node.js to 20.17.0 ✅
Updated
.moon/toolchain.ymlandpackage.jsonengines constraint:This satisfies npm 11.6.2's requirement:
^20.17.0 || >=22.9.02. Fix Glossary Export Task ✅
Modified
docs/spectrum-glossary/moon.yml:outputs: ["dist"]from build taskinputs: ["dist"]in export taskThis prevents moon from caching and cleaning up the dist folder, allowing it to persist naturally for the dependent export task.
Why These Changes Matter
Node.js Upgrade:
ENEEDAUTHGlossary Export Fix:
Impact
After this PR merges:
spectrum-glossary:exporttask passes in CI@adobe/spectrum-tokens14.1.0@adobe/design-system-registry1.1.0@adobe/token-diff-generator2.5.3@adobe/spectrum-design-data-mcp1.0.13Related PRs
This completes the OIDC migration sequence: