Skip to content

Fix exported extensions in package.json #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

lorisleiva
Copy link
Member

@lorisleiva lorisleiva commented Mar 14, 2024

Before adding the “module” package type in #21, tsup was generating CJS files as .js and ESM files as .mjs. After the PR, tsup started doing the opposite — i.e. CJS files as .cjs and ESM files as .js meaning our package.json was pointing to the wrong files.

This PR fixes this by updating the package.json accordingly but also defining the extension logic explicitly so we don’t get this sort of surprise in the future.

Test plan

I've updated @solana-program/system, @solana-program/memo, @solana-program/address-lookup-table and @solana-program/compute-budget with this patch. Before, they didn't work on CodeSandbox, now they do.

Before adding the “module” package type in #21, `tsup` was generating CJS files as `.js` and ESM files as `.mjs`. After the PR, `tsup` started doing the opposite — i.e. CJS files as `.cjs` and ESM files as `.js` meaning our `package.json` was pointing to the wrong files.

This PR fixes this by updating the `package.json` accordingly but also defining the extension logic explicitly so we don’t get this sort of surprise in the future.
Copy link

changeset-bot bot commented Mar 14, 2024

🦋 Changeset detected

Latest commit: 236cc68

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-solana-program Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lorisleiva lorisleiva requested a review from steveluscher March 14, 2024 15:05
@lorisleiva lorisleiva self-assigned this Mar 14, 2024
Copy link
Contributor

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

did-i-do-that-steve-urkel

@lorisleiva lorisleiva merged commit 289ccfd into main Mar 14, 2024
@github-actions github-actions bot mentioned this pull request Mar 14, 2024
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