Skip to content

Commit

Permalink
fix(build): fixes issue with incorrect bundling of types (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewvolk authored Nov 22, 2023
1 parent 7381ecf commit 012c1e2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/silly-avocados-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"bigrequest": patch
"bigexec": patch
---

Fixes issue with types not being bundled with the package correctly. Adds `cjsInterop` flag to maintain default export parity for commonjs. **NOTE: It is recommended to set `"esModuleInterop": true` in `tsconfig.json` if using this library in Typescript projects.**
3 changes: 2 additions & 1 deletion packages/bigexec/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"strict": true,
"noUnusedLocals": false /* eslint */,
"noUnusedParameters": false /* eslint */,
"skipLibCheck": true
"skipLibCheck": true,
"esModuleInterop": true
},
"include": ["src/**/*.ts", "tsup.config.ts"]
}
3 changes: 2 additions & 1 deletion packages/bigrequest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"jsonwebtoken": "^9.0.1",
"openapi-fetch": "^0.7.1",
"openapi-fetch": "^0.8.1",
"zod": "^3.21.4"
},
"devDependencies": {
Expand All @@ -37,6 +37,7 @@
"@types/node": "18.0.0",
"eslint": "^8.46.0",
"openapi-typescript": "^6.4.0",
"openapi-typescript-helpers": "^0.0.4",
"prettier": "^3.0.1",
"tsup": "^7.2.0",
"typescript": "^5.1.6"
Expand Down
3 changes: 2 additions & 1 deletion packages/bigrequest/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"strict": true,
"noUnusedLocals": false /* eslint */,
"noUnusedParameters": false /* eslint */,
"skipLibCheck": true
"skipLibCheck": true,
"types": ["openapi-typescript-helpers"]
},
"include": ["src/**/*.ts", "tsup.config.ts"]
}
2 changes: 1 addition & 1 deletion packages/bigrequest/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
noExternal: ['openapi-fetch'],
cjsInterop: true,
dts: true,
clean: true,
platform: 'node',
Expand Down
16 changes: 12 additions & 4 deletions pnpm-lock.yaml

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

0 comments on commit 012c1e2

Please sign in to comment.