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

Publint fixes #15

Merged
merged 8 commits into from
Jan 31, 2024
Merged

Publint fixes #15

merged 8 commits into from
Jan 31, 2024

Conversation

felixpalmer
Copy link
Collaborator

Fixes based on issues reported by https://publint.dev/[email protected]

package.json Outdated
Comment on lines 13 to 15
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"require": "./dist/cjs/index.js"
Copy link
Member

@donmccurdy donmccurdy Jan 29, 2024

Choose a reason for hiding this comment

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

I think we're missing part of the fix here — can we rename the 'require' entrypoint to have a .cjs file extension? The effect of adding "type": "module" is that Node.js and various build tools will assume .js files are ESM by default, unless otherwise specified by a .cjs or .mjs file extension.

Copy link
Member

@donmccurdy donmccurdy Jan 29, 2024

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@donmccurdy do you know of a better way to change the file extension (currently using mv as I can't figure out how to change behavior of tsc)

Copy link
Member

@donmccurdy donmccurdy Jan 31, 2024

Choose a reason for hiding this comment

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

Discussed offline. Blocked in tsc by microsoft/TypeScript#49462. Alternative build tools ocular-dev-tools or microbundle would avoid the issue, see the ktx-parse / publint link above for example. But after discussion we're not inclined to swap out the build tool and will keep the mv for now, at least until the v9 migration settles down.

package.json Show resolved Hide resolved
@felixpalmer felixpalmer merged commit d38c5e2 into master Jan 31, 2024
4 checks passed
@felixpalmer felixpalmer deleted the felix/publint branch January 31, 2024 09:44
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.

3 participants