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
Show file tree
Hide file tree
Changes from 2 commits
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
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
"version": "0.1.9",
"description": "Utility functions for working with Quadbins",
"license": "MIT",
"type": "module",
felixpalmer marked this conversation as resolved.
Show resolved Hide resolved
"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"
Expand All @@ -26,7 +31,7 @@
"build:cjs": "tsc -p tsconfig/tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig/tsconfig.esm.json",
"build:types": "tsc -p tsconfig/tsconfig.types.json",
"build:umd": "webpack --config tsconfig/webpack.config.js",
"build:umd": "webpack --config tsconfig/webpack.config.cjs",
"lint": "npx prettier --check src",
"test": "yarn lint && yarn test-fast",
"test-fast": "npx ts-node node_modules/tape/bin/tape test/**/*.spec.js"
Expand Down
File renamed without changes.
Loading