Skip to content

fix: prune final require calls#4176

Merged
erickzhao merged 2 commits intonextfrom
make-esm
Mar 19, 2026
Merged

fix: prune final require calls#4176
erickzhao merged 2 commits intonextfrom
make-esm

Conversation

@erickzhao
Copy link
Copy Markdown
Member

@erickzhao erickzhao commented Mar 18, 2026

Fix 1

require.main does not exist in ESM context, making the make command broken in the latest publish.

Notes:

  • We should republish a new Alpha build once this is released.
  • We should probably upgrade engines to 22.18.0 to be able to pick up the Node.js import.meta.main feature (esm: implement import.meta.main nodejs/node#57804).
  • Test coverage for the CLI is non-existent. We should have some sort of sanity test to make sure that our API layer works, full-stop.

Fix 2

There was a stray require() call in MakerBase.ts. That's a straight replacement with import.meta.resolve().

The lint rule happened to be turned off for Maker files so this snuck past me:

forge/.eslintrc.json

Lines 140 to 146 in 9f2c01f

"files": [
"packages/api/core/spec/**/*.ts",
"packages/maker/*/src/Maker*.ts"
],
"rules": {
"@typescript-eslint/no-require-imports": "off"
}

@erickzhao erickzhao marked this pull request as ready for review March 18, 2026 23:45
@erickzhao erickzhao requested a review from a team as a code owner March 18, 2026 23:45
@erickzhao erickzhao changed the title fix(cli): avoid calling require.main in make command fix: prune final require calls Mar 19, 2026
@erickzhao erickzhao enabled auto-merge (squash) March 19, 2026 00:09
@erickzhao erickzhao merged commit 213c1c5 into next Mar 19, 2026
14 checks passed
@erickzhao erickzhao deleted the make-esm branch March 19, 2026 00:12
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.

2 participants