Skip to content
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

fix: add exports field to package.json #129

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Conversation

musoke
Copy link
Collaborator

@musoke musoke commented Jun 27, 2023

e4fbbd0 added "typde": "module" to package.json. This broke importing of sandbag in openbeta-graphql.

package.json also needs an exports field, telling it which modules are exposed for export. Add it.

Also update to typescript ^4.9.5, a version which supports package.json exports. See
https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

Fixes #123

e4fbbd0 added `"typde": "module"` to
`package.json`.  This broke importing of sandbag in openbeta-graphql.

package.json also needs an exports field, telling it which modules are
exposed for export.  Add it.

Also update to typescript ^4.9.5, a version which supports
`package.json` exports.  See
https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

Fixes OpenBeta#123
@musoke musoke requested a review from vnugent June 27, 2023 02:31
@vnugent
Copy link
Contributor

vnugent commented Jun 27, 2023

I haven't been following CommonJS and ESM as a library author. Since we use tsdx to generate the final packag, may be the issue is somehow related how we configure tsdx?

https://tsdx.io/customization

@musoke
Copy link
Collaborator Author

musoke commented Jun 27, 2023

I haven't been following CommonJS and ESM as a library author. Since we use tsdx to generate the final packag, may be the issue is somehow related how we configure tsdx?

https://tsdx.io/customization

Yes, it seems to be. After reading those docs, I think the fix in this PR is correct.

@musoke musoke merged commit 9a007ff into OpenBeta:develop Jun 27, 2023
1 check passed
@musoke musoke deleted the fix-exports branch June 27, 2023 20:56
@musoke musoke temporarily deployed to Production June 27, 2023 20:56 — with GitHub Actions Inactive
@musoke musoke temporarily deployed to Production June 27, 2023 21:35 — with GitHub Actions Inactive
@musoke musoke temporarily deployed to Production June 27, 2023 21:44 — with GitHub Actions Inactive
@musoke musoke temporarily deployed to Production June 27, 2023 21:56 — with GitHub Actions Inactive
@musoke musoke temporarily deployed to Production June 27, 2023 21:59 — with GitHub Actions Inactive
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.

importing sandbag in openbeta-graphql is broken
2 participants