Skip to content

Commit

Permalink
Fix cjs usage of libraries (#256)
Browse files Browse the repository at this point in the history
* Fix cjs usage of libraries

* add changeset and clean up project.json files

---------

Co-authored-by: Youssef Gaber <1728215+Gabrola@users.noreply.github.com>
  • Loading branch information
gingermusketeer and Gabrola committed Jun 3, 2023
1 parent 3598bd1 commit 81560d4
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
12 changes: 12 additions & 0 deletions .changeset/moody-falcons-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@ts-rest/core': patch
'@ts-rest/express': patch
'@ts-rest/fastify': patch
'@ts-rest/nest': patch
'@ts-rest/next': patch
'@ts-rest/open-api': patch
'@ts-rest/react-query': patch
'@ts-rest/solid-query': patch
---

Fix ESM/CJS issues in package.json
3 changes: 1 addition & 2 deletions libs/ts-rest/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"publish": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/express/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"publish": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/fastify/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"publish": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/nest/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"publish": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/next/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"publish": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/open-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"publish": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/react-query/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"lint": {
Expand Down
3 changes: 1 addition & 2 deletions libs/ts-rest/solid-query/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"format": ["esm", "cjs"],
"compiler": "tsc",
"rollupConfig": "tools/scripts/rollup.config.js",
"generateExportsField": true,
"skipTypeField": true
"generateExportsField": true
}
},
"lint": {
Expand Down
2 changes: 2 additions & 0 deletions tools/scripts/fix-esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ for (const lib of libs) {
...JSON.parse(packageJson),
module: './index.mjs',
main: './index.js',
// Ensure that esm is not forced due to "type": "module" being added.
type: undefined,
exports: {
'.': {
types: './src/index.d.ts',
Expand Down

1 comment on commit 81560d4

@vercel
Copy link

@vercel vercel bot commented on 81560d4 Jun 3, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.