[codex] add codex environment setup#4533
Conversation
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/data-prefetch
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
Bundle Size Report12 package(s) changed, 29 unchanged. Package dist + public ESM exports
Bundle targets
Total dist (raw): 10.68 MB (no change) Bundle sizes are generated with rslib (Rspack). Public ESM gzip aggregates explicit package export entry files (wildcard exports are ignored). Web/node bundles synthesize a single entry that imports those public ESM exports, set ENV_TARGET, and enable tree-shaking. Bare imports are externalized to keep sizes consistent with prior reporting, and assets are emitted as resources. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fb47201ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" | ||
| if [ -s "$NVM_DIR/nvm.sh" ]; then | ||
| . "$NVM_DIR/nvm.sh" | ||
| nvm use |
There was a problem hiding this comment.
Install required Node version before continuing setup
When nvm is present but the .nvmrc version is not installed yet (common on fresh machines), nvm use exits with an error and does not switch Node, but this script still proceeds to pnpm install under whatever host Node is active. That can recreate the exact unsupported-engine setup drift this bootstrap is intended to prevent; nvm itself indicates this case should run nvm install first, so this step should either install the requested version or fail fast.
Useful? React with 👍 / 👎.
Summary
This change adds a repository-local Codex environment bootstrap for
coreso Codex sessions start from the same baseline the repository already documents for contributors and CI-adjacent local work.The repository expects Node 20,
corepack, andpnpm install --frozen-lockfile. Before this change, Codex had no repo-scoped setup file to align its shell with those expectations, which meant Codex sessions could inherit whatever host Node version happened to be active instead of the version declared by.nvmrc.The new
.codex/environments/environment.tomlcaptures the expected bootstrap flow for this repository. Whennvmis available, it switches to the Node version declared by.nvmrc, then enablescorepackand installs dependencies with the frozen lockfile. That keeps Codex setup closer to the documented repository contract and reduces avoidable environment drift during local automation, validation, and edits.Validation
Validated the bootstrap path locally by confirming it resolves to the repo-aligned toolchain before install steps proceed:
bash -lc 'export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"; if [ -s "$NVM_DIR/nvm.sh" ]; then . "$NVM_DIR/nvm.sh"; nvm use >/tmp/core-codex-nvm.log; fi; node -v; corepack enable >/dev/null 2>&1; pnpm -v'bash -lc 'export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"; . "$NVM_DIR/nvm.sh"; nvm use >/dev/null; git commit -m "chore: add codex environment setup"'No additional workspace build/test/lint tasks were run because this is a repository bootstrap/config-only change, and the repo AGENTS guidance does not require broader checks for this change type.