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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Publint fixes
felixpalmer committed Jan 29, 2024
commit c31ab4d3a38e74e20b5d0687ded47baaec1545b8
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -3,19 +3,24 @@
"version": "0.1.9",
"description": "Utility functions for working with Quadbins",
"license": "MIT",
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"umd:main": "dist/umd/index.js",
"types": "dist/types/index.d.js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"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.

},
"./*": "./*"
},
"keywords": ["quadbin", "webgl", "visualization"],
"keywords": [
"quadbin",
"webgl",
"visualization"
],
"repository": {
"type": "git",
"url": "https://github.com/CartoDB/quadbin-js.git"