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

Force node to use CJS to get around dependency import errors, and validate package types in CI #259

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ jobs:
# Run the tests and print out the coverage information. In the future,
# we could integrate with Codecov or something.
run: pnpm run test:coverage

- name: Validate the build's packaging CJS and ESM compatibility
run: npx @arethetypeswrong/[email protected] --pack
2 changes: 1 addition & 1 deletion example/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,26 @@
"files": [
"dist"
],
"types": "./dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/esm/index.js"
"types": "./dist/cjs/index.d.ts",
"module": "./dist/esm/index.js",
"default": "./dist/cjs/index.js"
},
"./icons": {
"types": "./dist/icons/index.d.ts",
"require": "./dist/icons/index.js",
"import": "./dist/esm/icons/index.js"
"types": "./dist/cjs/icons/index.d.ts",
"module": "./dist/esm/icons/index.js",
"default": "./dist/cjs/icons/index.js"
}
},
"typesVersions": {
"*": {
"icons": [
"./dist/icons/index.d.ts"
"./dist/cjs/icons/index.d.ts"
],
"*": [
"*"
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "./tsconfig.json",
"include": ["./src"],
"exclude": ["./src/demo", "./src/**/__tests__"]
"exclude": ["./src/demo", "./src/**/__tests__"],
"compilerOptions": {
"outDir": "./dist/cjs"
}
}
Loading