Skip to content

fix esm output - #1

Closed
flobacher wants to merge 4 commits into
commitspark:mainfrom
flobacher:main
Closed

fix esm output#1
flobacher wants to merge 4 commits into
commitspark:mainfrom
flobacher:main

Conversation

@flobacher

@flobacher flobacher commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

simmilar to the git-adapter-github pr, this adds the extensions to relative imports.
As it feels weird and breaks direct execution of ts files, I opted to the ts extension, that tsc will change to js upon compilation due to the rewriteRelativeImportExtensions: true compiler setting.
To make the nodejs runtime aware to treat the files from the esm output dir as esm, the most minimalistic package.json with type:module is added upon build.
One final optimisation is the exclusion of tsbuildinfo files (ts incremental build cache afaik) from the published npm package. If you approve to this please add this to the git-adapter-github pr as well. Thank you very much for your awesome work on commitspark 🎉

The one usecase I found the bug with (creating migrations via the payload-cms cli that runs esm natively in nodejs without further compilation steps) works with the updated esm version. The commonjs version also still works..

@advancingu

Copy link
Copy Markdown
Contributor

Thank you @flobacher !

Merged via #2

@advancingu advancingu closed this Feb 18, 2026
@flobacher

Copy link
Copy Markdown
Contributor Author

Happy to contribute 🙌
When can WE expect a new package Version in npm?

@advancingu

Copy link
Copy Markdown
Contributor

@flobacher New versions released for all packages.

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