Skip to content

fix: tolerate node engine warnings in lint-fix#4535

Merged
ScriptedAlchemy merged 3 commits intomainfrom
codex/lint-fix-node-warning
Mar 12, 2026
Merged

fix: tolerate node engine warnings in lint-fix#4535
ScriptedAlchemy merged 3 commits intomainfrom
codex/lint-fix-node-warning

Conversation

@ScriptedAlchemy
Copy link
Copy Markdown
Member

Summary

When this repo is run under a non-supported Node version, pnpm emits an engine warning before some command output. That warning currently breaks pnpm run lint-fix because the script assumes pnpm exec turbo ls --output=json returns clean JSON on stdout.

This is most visible in the pre-commit hook, where lint-fix should still do its work or at least fail only on real lint errors. Instead, the warning text can cause the workspace package discovery step to throw before linting decisions are made.

Root Cause

tools/scripts/lint-fix.mjs parsed Turbo package discovery with JSON.parse(result.stdout || "{}"). If pnpm prepends an engine warning to stdout, that raw output is no longer valid JSON and the script exits even though Turbo itself succeeded.

Fix

Use the existing shared Turbo output parser so lint-fix can recover the JSON payload from noisy command output. The behavior for real Turbo failures is unchanged; this only hardens the JSON parsing step against warning preambles.

Validation

  • Ran pnpm install --frozen-lockfile under Node v22.22.1 and observed the engine warning.
  • Ran pnpm run lint-fix under Node v22.22.1; it completed successfully and did not fail on the warning.
  • Ran pnpm exec prettier --check tools/scripts/lint-fix.mjs.
  • Ran node --input-type=module -e "import { parseJsonFromTurboOutput } from ./tools/scripts/turbo-script-utils.mjs" equivalent parser validation with a synthetic engine-warning preamble and confirmed it parsed the JSON payload.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 12, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit f378aba
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69b30ebc290e6a0008b21d13
😎 Deploy Preview https://deploy-preview-4535--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.

@ScriptedAlchemy ScriptedAlchemy changed the title [codex] tolerate node engine warnings in lint-fix fix: tolerate node engine warnings in lint-fix Mar 12, 2026
…arning

# Conflicts:
#	tools/scripts/lint-fix.mjs
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: f378aba

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 19:02
@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@d1434a7

@module-federation/cli

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

create-module-federation

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

@module-federation/data-prefetch

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

@module-federation/dts-plugin

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

@module-federation/enhanced

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

@module-federation/error-codes

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

@module-federation/esbuild

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

@module-federation/managers

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

@module-federation/manifest

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

@module-federation/metro

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

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

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

@module-federation/metro-plugin-rnef

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

@module-federation/modern-js

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

@module-federation/modern-js-v3

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

@module-federation/native-federation-tests

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

@module-federation/native-federation-typescript

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

@module-federation/nextjs-mf

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

@module-federation/node

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

@module-federation/retry-plugin

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

@module-federation/rsbuild-plugin

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

@module-federation/rspack

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

@module-federation/rspress-plugin

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

@module-federation/runtime

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

@module-federation/runtime-core

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

@module-federation/runtime-tools

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

@module-federation/sdk

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

@module-federation/storybook-addon

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

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

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

@module-federation/treeshake-frontend

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

@module-federation/treeshake-server

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

@module-federation/typescript

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

@module-federation/utilities

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

@module-federation/webpack-bundler-runtime

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

@module-federation/bridge-react

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

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

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

@module-federation/bridge-shared

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

@module-federation/bridge-vue3

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

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

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

commit: d1434a7

@github-actions
Copy link
Copy Markdown
Contributor

Bundle Size Report

9 package(s) changed, 31 unchanged.

Package dist + ESM entry

Package Total dist (raw) Delta 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 819.7 kB no change 712 B no change
@module-federation/managers 69.9 kB no change 334 B no change
@module-federation/manifest 138.4 kB no change 182 B no change
@module-federation/metro-plugin-rnc-cli 0 B no change 314 B no change
@module-federation/node 188.4 kB no change 217 B no change
@module-federation/storybook-addon 76.5 kB no change 100 B 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 -31 B (-2.9%)
@module-federation/enhanced 5.9 kB -58 B (-0.9%) 5.9 kB -58 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-plugin-rnc-cli 411 B -26 B (-5.9%) 411 B -26 B (-5.9%)
@module-federation/node 9.2 kB -29 B (-0.3%) 9.2 kB -29 B (-0.3%)
@module-federation/storybook-addon 1.9 kB -25 B (-1.3%) 1.7 kB -24 B (-1.3%)
@module-federation/utilities 2.6 kB -32 B (-1.2%) 2.6 kB -32 B (-1.2%)

Consumer scenarios

Scenario Web output (gzip) Delta Node output (gzip) Delta Gap (node-web) Delta
Enhanced remoteEntry 19.1 kB -12 B (-0.1%) 20.1 kB -16 B (-0.1%) +1.0 kB -4 B

Total dist (raw): 10.63 MB (no change)
Total ESM gzip: 68.7 kB (no change)
Total web bundle (gzip): 158.6 kB (-305 B (-0.2%))
Total node bundle (gzip): 159.2 kB (-302 B (-0.2%))
Tracked ./bundler entry gzip: 556 B (no change)
Tracked ./bundler web bundle (gzip): 4.5 kB (no change)
Tracked ./bundler node bundle (gzip): 4.5 kB (no change)

Bundle sizes are generated with rslib (Rspack). Package-root metrics preserve the historical report. Tracked subpath exports such as ./bundler are measured separately so ENV_TARGET-driven tree-shaking is visible. Bare imports are externalized to keep package-level sizes consistent, and assets are emitted as resources.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: 5184d89

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 merged commit 007b3fa into main Mar 12, 2026
22 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the codex/lint-fix-node-warning branch March 12, 2026 19:13
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant