Repository navigation
fix(ifc-converter): emit Node-resolvable ESM imports - #1297
Open
AleeAbdullah wants to merge 1 commit into
Open
AleeAbdullah wants to merge 1 commit into
AleeAbdullah wants to merge 1 commit into
Conversation
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]>
Aymericr
approved these changes
Nov 22, 2026
Aymericr
left a comment
Member
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #1285.
@pascal-app/ifc-converteris published as ESM, but itsdistkept extensionless relative imports (from './cleanup'). Loading the package or its./exportsubpath in Node failed withERR_MODULE_NOT_FOUND, andnodenextTypeScript projects withoutskipLibCheckhit TS2835 on the declarations.The build now runs
scripts/fix-node-esm-imports.tsaftertsc --build, the same step core, nodes, mcp and geometry-script already use. Asmoke:nodescript imports both entry points in Node, andprepublishOnlyruns it, matching core, so a regression stops the publish.How to test
cd packages/core && bun run buildcd packages/ifc-converter && bun run build && bun run smoke:nodedist/index.jsanddist/export/index.jswithmodule/moduleResolution: "nodenext", withoutskipLibCheck.Verified locally on Node 24.22.3:
main, both imports throwERR_MODULE_NOT_FOUND, and thenodenextcheck reports 6 × TS2835.smoke:nodepasses and thenodenextcheck is clean.bun run test(107 tests),check-typesand Biome pass.Screenshots / screen recording
None: this is a build-only change.
Checklist
bun devdoesn't apply)bun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Low Risk
Build and release-time smoke checks only; no runtime application logic changes.
Overview
@pascal-app/ifc-converternow post-processes compiled output so relative imports indistinclude.jsextensions, the samefix-node-esm-imports.tsstep used by core, nodes, mcp, and geometry-script.Build runs that script after
tsc --build. A newsmoke:nodescript imports./dist/index.jsand./dist/export/index.jsin Node, andprepublishOnlyruns 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.