Skip to content

Commit c837f02

Browse files
feat: Add explicit package.json type field
1 parent 25eda1b commit c837f02

File tree

18 files changed

+21
-3
lines changed

18 files changed

+21
-3
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "query",
33
"repository": "https://github.com/tanstack/query.git",
44
"packageManager": "[email protected]",
5+
"type": "module",
56
"scripts": {
67
"clean": "pnpm --filter \"./packages/**\" run clean",
78
"preinstall": "node -e \"if(process.env.CI == 'true') {console.log('Skipping preinstall...'); process.exit(1)}\" || npx -y only-allow pnpm",

packages/codemods/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"exports": {
1415
"./package.json": "./package.json"
1516
},

packages/eslint-plugin-query/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"main": "build/lib/index.js",
1415
"exports": {
1516
".": {

packages/query-async-storage-persister/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/query-broadcast-client-experimental/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/query-core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/query-devtools/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/types/index.d.ts",
1415
"main": "build/umd/index.js",
1516
"module": "build/esm/index.mjs",

packages/query-persist-client-core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/query-sync-storage-persister/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/react-query-devtools/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/react-query-persist-client/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/react-query/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/lib/index.d.ts",
1415
"main": "build/lib/index.js",
1516
"module": "build/lib/index.esm.js",

packages/solid-query/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13+
"type": "commonjs",
1314
"types": "build/types/index.d.ts",
1415
"main": "build/cjs/index.js",
1516
"module": "build/esm/index.js",

packages/svelte-query-devtools/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
"type": "module",
1414
"types": "build/lib/index.d.ts",
1515
"module": "build/lib/index.js",
16+
"svelte": "./build/lib/index.js",
1617
"exports": {
1718
".": {
1819
"types": "./build/lib/index.d.ts",
1920
"import": "./build/lib/index.js",
21+
"svelte": "./build/lib/index.js",
2022
"default": "./build/lib/index.js"
2123
},
2224
"./package.json": "./package.json"

packages/svelte-query/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
"type": "module",
1414
"types": "build/lib/index.d.ts",
1515
"module": "build/lib/index.js",
16+
"svelte": "./build/lib/index.js",
1617
"exports": {
1718
".": {
1819
"types": "./build/lib/index.d.ts",
1920
"import": "./build/lib/index.js",
21+
"svelte": "./build/lib/index.js",
2022
"default": "./build/lib/index.js"
2123
},
2224
"./package.json": "./package.json"

packages/vue-query/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"type": "github",
1515
"url": "https://github.com/sponsors/tannerlinsley"
1616
},
17+
"type": "commonjs",
1718
"types": "build/lib/index.d.ts",
1819
"main": "build/lib/index.js",
1920
"module": "build/lib/index.esm.js",

scripts/config.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ export const packages = [
6161
{
6262
name: '@tanstack/svelte-query',
6363
packageDir: 'packages/svelte-query',
64-
entries: ['module', 'types'],
64+
entries: ['module', 'svelte', 'types'],
6565
},
6666
{
6767
name: '@tanstack/svelte-query-devtools',
6868
packageDir: 'packages/svelte-query-devtools',
69-
entries: ['module', 'types'],
69+
entries: ['module', 'svelte', 'types'],
7070
},
7171
{
7272
name: '@tanstack/vue-query',

scripts/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export type Parsed = {
3939
export type Package = {
4040
name: string
4141
packageDir: string
42-
entries: Array<'main' | 'module' | 'types'>
42+
entries: Array<'main' | 'module' | 'svelte' | 'types'>
4343
}
4444

4545
export type BranchConfig = {

0 commit comments

Comments
 (0)