Skip to content

[codex] add codex environment setup#4533

Merged
ScriptedAlchemy merged 1 commit intomainfrom
codex/add-codex-environment-setup
Mar 12, 2026
Merged

[codex] add codex environment setup#4533
ScriptedAlchemy merged 1 commit intomainfrom
codex/add-codex-environment-setup

Conversation

@ScriptedAlchemy
Copy link
Copy Markdown
Member

@ScriptedAlchemy ScriptedAlchemy commented Mar 12, 2026

Summary

This change adds a repository-local Codex environment bootstrap for core so Codex sessions start from the same baseline the repository already documents for contributors and CI-adjacent local work.

The repository expects Node 20, corepack, and pnpm 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.toml captures the expected bootstrap flow for this repository. When nvm is available, it switches to the Node version declared by .nvmrc, then enables corepack and 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.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 12, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 8fb4720
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69b25ed65c44f7000885c283
😎 Deploy Preview https://deploy-preview-4533--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: 8fb4720

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review March 12, 2026 06:37
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 12, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@4533

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@4533

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@4533

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/@module-federation/data-prefetch@4533

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@4533

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@4533

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@4533

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@4533

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@4533

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@4533

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@4533

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@4533

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@4533

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@4533

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@4533

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@4533

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@4533

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@4533

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@4533

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@4533

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@4533

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@4533

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@4533

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@4533

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@4533

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@4533

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@4533

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@4533

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@4533

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@4533

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@4533

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@4533

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@4533

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@4533

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@4533

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@4533

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@4533

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@4533

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@4533

commit: 609f682

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Size Report

12 package(s) changed, 29 unchanged.

Package dist + public ESM exports

Package Total dist (raw) Delta Public ESM gzip Delta
@module-federation/cli 26.7 kB no change 786 B no change
@module-federation/core 39.1 kB no change 173 B no change
@module-federation/enhanced 841.5 kB no change 1.8 kB no change
@module-federation/managers 70.0 kB no change 334 B no change
@module-federation/manifest 138.4 kB no change 182 B no change
@module-federation/metro 243.9 kB no change 1.6 kB no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/modern-js 183.6 kB no change 11.8 kB no change
@module-federation/modern-js-v3 175.2 kB no change 11.3 kB no change
@module-federation/node 188.4 kB no change 4.6 kB no change
@module-federation/storybook-addon 76.5 kB no change 1.1 kB no change
@module-federation/utilities 110.6 kB no change 328 B no change

Bundle targets

Package Web bundle (gzip) Delta Node bundle (gzip) Delta
@module-federation/cli 2.3 kB -34 B (-1.4%) 2.3 kB -34 B (-1.4%)
@module-federation/core 1.1 kB -33 B (-2.9%) 1.0 kB -32 B (-3.0%)
@module-federation/enhanced 6.3 kB -61 B (-0.9%) 6.3 kB -61 B (-0.9%)
@module-federation/managers 2.4 kB -28 B (-1.1%) 2.4 kB -28 B (-1.1%)
@module-federation/manifest 6.2 kB -40 B (-0.6%) 6.2 kB -40 B (-0.6%)
@module-federation/metro 11.4 kB -55 B (-0.5%) 11.4 kB -54 B (-0.5%)
@module-federation/metro-plugin-rnc-cli 411 B -27 B (-6.2%) 411 B -27 B (-6.2%)
@module-federation/modern-js 7.0 kB -28 B (-0.4%) 7.0 kB -28 B (-0.4%)
@module-federation/modern-js-v3 6.8 kB -26 B (-0.4%) 6.8 kB -26 B (-0.4%)
@module-federation/node 13.2 kB -31 B (-0.2%) 13.1 kB -42 B (-0.3%)
@module-federation/storybook-addon 2.4 kB -25 B (-1.0%) 2.2 kB -25 B (-1.1%)
@module-federation/utilities 2.6 kB -33 B (-1.2%) 2.6 kB -33 B (-1.2%)

Total dist (raw): 10.68 MB (no change)
Total ESM gzip: 116.1 kB (no change)
Total web bundle (gzip): 194.9 kB (-421 B (-0.2%))
Total node bundle (gzip): 195.4 kB (-430 B (-0.2%))

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.

@ScriptedAlchemy ScriptedAlchemy merged commit 9e6bcfd into main Mar 12, 2026
24 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the codex/add-codex-environment-setup branch March 12, 2026 06:38
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@2heal1 2heal1 mentioned this pull request Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant