Skip to content

Conversation

acenolaza
Copy link
Collaborator

@acenolaza acenolaza commented Sep 29, 2025

Related to #38

Tested locally by running pnpm pack to create a TAR compressed file and importing it in another repo.

"dist"
],
"exports": {
".": "./dist/src/index.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

Mhh, won't this cause the JS imports not to work for any non index.js file? 🤔 I forgot how exactly the exports works.

Copy link
Collaborator Author

@acenolaza acenolaza Oct 1, 2025

Choose a reason for hiding this comment

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

That is correct but my intention was to have a single entrypoint to act as the primary public API for the package. So if we need to expose more functions from other files then we make the index.ts file re-export it without the need to come an update the package.json file

@acenolaza acenolaza force-pushed the 38-npm-package-support branch from 4371c08 to e93eaac Compare October 1, 2025 12:33
Copy link
Contributor

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@Siegrift
Copy link
Contributor

Siegrift commented Oct 1, 2025

Actually the issue shouldn't be closed. It should be only closed after the package is successfully released on NPM. For that we need to integrate https://github.com/api3dao/commons/tree/main/src/release-scripts#tagandrelease and I'll need to adjust the GH secrets.

@acenolaza acenolaza merged commit 751e9fd into main Oct 1, 2025
2 checks passed
@acenolaza acenolaza deleted the 38-npm-package-support branch October 1, 2025 14:39
@acenolaza acenolaza mentioned this pull request Oct 1, 2025
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