Skip to content

fix(ifc-converter): emit Node-resolvable ESM imports - #1297

Open
AleeAbdullah wants to merge 1 commit into
pascalorg:mainfrom
AleeAbdullah:fix/ifc-converter-node-esm
Open

AleeAbdullah wants to merge 1 commit into
pascalorg:mainfrom
AleeAbdullah:fix/ifc-converter-node-esm

Conversation

@AleeAbdullah

@AleeAbdullah AleeAbdullah commented Nov 20, 2026 •

Copy link
Copy Markdown

What does this PR do?

Fixes #1285. @pascal-app/ifc-converter is published as ESM, but its dist kept extensionless relative imports (from './cleanup'). Loading the package or its ./export subpath in Node failed with ERR_MODULE_NOT_FOUND, and nodenext TypeScript projects without skipLibCheck hit TS2835 on the declarations.

The build now runs scripts/fix-node-esm-imports.ts after tsc --build, the same step core, nodes, mcp and geometry-script already use. A smoke:node script imports both entry points in Node, and prepublishOnly runs it, matching core, so a regression stops the publish.

How to test

  1. cd packages/core && bun run build
  2. cd packages/ifc-converter && bun run build && bun run smoke:node
  3. Optional: type-check a file that imports dist/index.js and dist/export/index.js with module/moduleResolution: "nodenext", without skipLibCheck.

Verified locally on Node 24.22.3:

  • On main, both imports throw ERR_MODULE_NOT_FOUND, and the nodenext check reports 6 × TS2835.
  • On this branch, smoke:node passes and the nodenext check is clean.
  • bun run test (107 tests), check-types and Biome pass.

Screenshots / screen recording

None: this is a build-only change.

Checklist

  • I've tested this locally (package build, Node import smoke, tests; no UI change, so bun dev doesn't apply)
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable): none needed
  • This PR targets the main branch

🤖 Generated with Claude Code


Note

Low Risk
Build and release-time smoke checks only; no runtime application logic changes.

Overview
@pascal-app/ifc-converter now post-processes compiled output so relative imports in dist include .js extensions, the same fix-node-esm-imports.ts step used by core, nodes, mcp, and geometry-script.

Build runs that script after tsc --build. A new smoke:node script imports ./dist/index.js and ./dist/export/index.js in Node, and prepublishOnly runs it after build so extensionless-import regressions block publish.

Reviewed by Cursor Bugbot for commit 9f2186e. Bugbot is set up for automated code reviews on this repo. Configure here.

The published dist kept extensionless relative imports, so loading
@pascal-app/ifc-converter or its ./export subpath in Node failed with
ERR_MODULE_NOT_FOUND, and nodenext TypeScript consumers hit TS2835 on
the declarations. Run the same post-build rewrite core, nodes, mcp and
geometry-script use, and smoke both entrypoints in Node before publish.

Fixes pascalorg#1285

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @AleeAbdullah, this matches how core, nodes, mcp and geometry-script already post-process their dist with scripts/fix-node-esm-imports.ts, so ifc-converter was just the odd one out (#1285). I built the package locally from this branch and ran the new smoke:node script: both ./dist/index.js and ./dist/export/index.js import cleanly in plain Node. Gating prepublishOnly on the smoke test is a good guard against regressions.

LGTM. CI for this fork is waiting on maintainer approval to run; it can merge once that's green.

This branch has not been deployed

No deployments
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.

@pascal-app/ifc-converter: published ESM uses extensionless relative imports, failing in Node with ERR_MODULE_NOT_FOUND

3 participants