Skip to content

fix(package): correct the Node engine floor - #72

Merged
GSTJ merged 1 commit into
mainfrom
fix/node-engine-metadata
Aug 5, 2026
Merged

fix(package): correct the Node engine floor#72
GSTJ merged 1 commit into
mainfrom
fix/node-engine-metadata

Conversation

@GSTJ

@GSTJ GSTJ commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

The package now declares Node 14 as its minimum runtime, matching the JavaScript in the published build.

Details

  • The emitted build uses nullish coalescing, which Node 12 fails to parse.
  • The Node 14 engine floor lets strict package managers reject incompatible installs before runtime.

Testing steps

  1. From the root of the checked-out repository, run:

    pnpm install --frozen-lockfile
    pnpm run build
    npm pack
  2. From the same directory, run:

    docker run --rm -v "$PWD:/package:ro" node:12-alpine sh -lc 'mkdir /app && cd /app && npm_config_engine_strict=true npm install /package/eslint-plugin-safe-jsx-1.3.7.tgz'

    The install should stop with an unsupported engine error.

  3. Run:

    docker run --rm -v "$PWD:/package:ro" node:14-alpine sh -lc 'mkdir /app && cd /app && npm_config_engine_strict=true npm install --no-save /package/eslint-plugin-safe-jsx-1.3.7.tgz >/dev/null && node -e "console.log(require(\"eslint-plugin-safe-jsx\").meta)"'

    The command should print the plugin name and version.

  4. Run the repository checks:

    pnpm run lint
    pnpm run format
    pnpm run typecheck
    pnpm run test
    pnpm run build
    pnpm run changelog:check
    pnpm audit --audit-level low

Match the declared runtime range to the emitted syntax. Node 12 fails to parse the current build while Node 14 loads it.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

馃帀 Congratulations on making your first pull request in '@gstj/safe-jsx'! We appreciate your contribution and will review it as soon as possible. Thank you for helping us make this project better.

@GSTJ

GSTJ commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Proof from 742b7c5: Node 12 rejects the package under strict engine checks, and Node 14 runs the rule through ESLint. The second image has the full local suite.

Node 12 rejection and Node 14 ESLint behavior

Local suite

@GSTJ
GSTJ merged commit fe09789 into main Aug 5, 2026
5 checks passed
@GSTJ
GSTJ deleted the fix/node-engine-metadata branch August 5, 2026 23:53
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