Skip to content

Commit 2af9174

Browse files
fix: restore missing exports declarations (#3892)
* fix: restore missing `exports` declarations * fix: restore package.json exports[C * fix: reexport types used by vue-query * fix: react-native uSES usage * fix: emit mjs for esm * fix: uSES build * fix: devtools exports to allow devtools in prod * fix: cjs and esm build bundled to lib dir * fix: sideEffect in react-query, better files paths * fix: generate declarations to lib * fix: lint and tests * fix: use the same ts build method for tests * fix: change force prod import
1 parent 454c584 commit 2af9174

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+383
-134
lines changed

package-lock.json

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"name": "query",
44
"repository": "https://github.com/tanstack/query.git",
55
"scripts": {
6-
"clean": "npm exec --workspaces -c \"rm -rf build || true\"",
6+
"clean": "lerna run clean --stream --no-bail",
77
"install:csb": "npm install --frozen-lockfile && node ./scripts/fix-package-json.js",
88
"test": "(is-ci && npm run test:ci) || npm run test:dev",
9-
"test:ci": "npm run compile && npm run test:format && npm run test:eslint && npm run test:jest",
10-
"test:dev": "npm run compile && npm run test:format && npm run test:eslint && npm run test:jest:dev",
9+
"test:ci": "npm run typecheck && npm run test:format && npm run test:eslint && npm run test:jest",
10+
"test:dev": "npm run typecheck && npm run test:format && npm run test:eslint && npm run test:jest:dev",
1111
"test:dev:17": "REACTJS_VERSION=17 jest --watch",
1212
"test:eslint": "lerna run test:eslint --stream --no-bail",
1313
"test:format": "npm run prettier -- --check",
@@ -23,8 +23,7 @@
2323
"prettier": "prettier \"packages/*/{src/**,examples/**/src/**}.{md,js,jsx,ts,tsx,json}\"",
2424
"prettier:write": "npm run prettier -- --write",
2525
"visualize": "lerna exec 'open build/stats-html.html'",
26-
"cipublish": "ts-node scripts/publish.ts",
27-
"compile": "lerna run compile --stream --no-bail"
26+
"cipublish": "ts-node scripts/publish.ts"
2827
},
2928
"namespace": "@tanstack",
3029
"workspaces": [
@@ -64,6 +63,7 @@
6463
"@commitlint/parse": "^16.2.1",
6564
"@faker-js/faker": "^6.3.1",
6665
"@rollup/plugin-babel": "^5.3.1",
66+
"@rollup/plugin-commonjs": "22.0.1",
6767
"@rollup/plugin-node-resolve": "^13.2.1",
6868
"@rollup/plugin-replace": "^4.0.0",
6969
"@testing-library/jest-dom": "^5.16.4",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
3+
"project": "./tsconfig.lint.json",
44
"sourceType": "module"
55
}
66
}

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,25 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13-
"module": "build/esm/index.js",
14-
"main": "build/cjs/index.js",
13+
"module": "build/lib/index.mjs",
14+
"main": "build/lib/index.js",
1515
"browser": "build/umd/index.production.js",
16-
"types": "build/types/packages/query-async-storage-persister/src/index.d.ts",
16+
"types": "build/lib/index.d.ts",
17+
"exports": {
18+
".": {
19+
"types": "./build/lib/index.d.ts",
20+
"import": "./build/lib/index.mjs",
21+
"default": "./build/lib/index.js"
22+
},
23+
"./package.json": "./package.json"
24+
},
1725
"files": [
18-
"build/*",
26+
"build/lib/*",
27+
"build/umd/*",
1928
"src"
2029
],
2130
"scripts": {
22-
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src",
23-
"compile": "../../node_modules/.bin/tsc -p tsconfig.json --noEmit --emitDeclarationOnly false"
31+
"clean": "rm -rf ./build",
32+
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src"
2433
}
2534
}
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
{
2-
"composite": true,
32
"extends": "../../tsconfig.base.json",
43
"compilerOptions": {
5-
"outDir": "./build/types"
4+
"composite": true,
5+
"rootDir": "./src",
6+
"outDir": "./build/lib",
7+
"tsBuildInfoFile": "./build/.tsbuildinfo"
68
},
7-
"files": ["src/index.ts"],
8-
"include": ["src"]
9+
"include": ["src"],
10+
"exclude": ["src/__tests__"],
11+
"references": [
12+
{ "path": "../query-core" },
13+
{ "path": "../react-query-persist-client" }
14+
]
915
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"rootDir": "./src",
6+
"outDir": "./build/lib",
7+
"tsBuildInfoFile": "./build/.tsbuildinfo"
8+
},
9+
"include": ["src"],
10+
"references": [
11+
{ "path": "../query-core" },
12+
{ "path": "../react-query-persist-client" }
13+
]
14+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
3+
"project": "./tsconfig.lint.json",
44
"sourceType": "module"
55
}
66
}

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,26 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13-
"module": "build/esm/index.js",
14-
"main": "build/cjs/packages/query-broadcast-client-experimental/src/index.js",
13+
"module": "build/lib/index.mjs",
14+
"main": "build/lib/index.js",
1515
"browser": "build/umd/index.production.js",
16-
"types": "build/types/query-broadcast-client-experimental/src/index.d.ts",
16+
"types": "build/lib/index.d.ts",
17+
"exports": {
18+
".": {
19+
"types": "./build/lib/index.d.ts",
20+
"import": "./build/lib/index.mjs",
21+
"default": "./build/lib/index.js"
22+
},
23+
"./package.json": "./package.json"
24+
},
1725
"files": [
18-
"build/*",
26+
"build/lib/*",
27+
"build/umd/*",
1928
"src"
2029
],
2130
"scripts": {
22-
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src",
23-
"compile": "../../node_modules/.bin/tsc -p tsconfig.json --noEmit --emitDeclarationOnly false"
31+
"clean": "rm -rf ./build",
32+
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src"
2433
},
2534
"dependencies": {
2635
"broadcast-channel": "^3.4.1"
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
2-
"composite": true,
32
"extends": "../../tsconfig.base.json",
43
"compilerOptions": {
5-
"outDir": "./build/types"
4+
"composite": true,
5+
"rootDir": "./src",
6+
"outDir": "./build/lib",
7+
"tsBuildInfoFile": "./build/.tsbuildinfo"
68
},
7-
"files": ["src/index.ts"],
8-
"include": ["src"]
9+
"include": ["src"],
10+
"exclude": ["src/__tests__"],
11+
"references": [{ "path": "../query-core" }]
912
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"rootDir": "./src",
6+
"outDir": "./build/lib",
7+
"tsBuildInfoFile": "./build/.tsbuildinfo"
8+
},
9+
"include": ["src"],
10+
"references": [{ "path": "../query-core" }]
11+
}

packages/query-broadcast-client-experimental/yarn.lock

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/query-core/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
3+
"project": "./tsconfig.lint.json",
44
"sourceType": "module"
55
}
66
}

packages/query-core/package.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,25 @@
1010
"type": "github",
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
13-
"module": "build/esm/index.js",
14-
"main": "build/cjs/index.js",
13+
"module": "build/lib/index.mjs",
14+
"main": "build/lib/index.js",
1515
"browser": "build/umd/index.production.js",
16-
"types": "build/types/packages/query-core/src/index.d.ts",
16+
"types": "build/lib/index.d.ts",
17+
"exports": {
18+
".": {
19+
"types": "./build/lib/index.d.ts",
20+
"import": "./build/lib/index.mjs",
21+
"default": "./build/lib/index.js"
22+
},
23+
"./package.json": "./package.json"
24+
},
1725
"files": [
18-
"build/*",
26+
"build/lib/*",
27+
"build/umd/*",
1928
"src"
2029
],
2130
"scripts": {
22-
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src",
23-
"compile": "../../node_modules/.bin/tsc -p tsconfig.json --noEmit --emitDeclarationOnly false"
31+
"clean": "rm -rf ./build",
32+
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src"
2433
}
2534
}

packages/query-core/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export {
1717
parseMutationFilterArgs,
1818
parseMutationArgs,
1919
} from './utils'
20-
export type { MutationFilters, QueryFilters } from './utils'
20+
export type { MutationFilters, QueryFilters, Updater } from './utils'
2121
export { isCancelledError } from './retryer'
2222
export { dehydrate, hydrate } from './hydration'
2323

2424
// Types
2525
export * from './types'
26-
export type { Query } from './query'
26+
export type { Query, QueryState } from './query'
2727
export type { Mutation } from './mutation'
2828
export type { Logger } from './logger'
2929
export type {

packages/query-core/tsconfig.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
2-
"composite": true,
32
"extends": "../../tsconfig.base.json",
43
"compilerOptions": {
5-
"outDir": "./build/types"
4+
"composite": true,
5+
"rootDir": "./src",
6+
"outDir": "./build/lib",
7+
"tsBuildInfoFile": "./build/.tsbuildinfo"
68
},
7-
"files": ["src/index.ts"],
8-
"include": ["src"]
9+
"include": ["src"],
10+
"exclude": ["src/tests"]
911
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"rootDir": "./src",
6+
"outDir": "./build/lib",
7+
"tsBuildInfoFile": "./build/.tsbuildinfo"
8+
},
9+
"include": ["src"]
10+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"parserOptions": {
3-
"project": "./tsconfig.json",
3+
"project": "./tsconfig.lint.json",
44
"sourceType": "module"
55
}
66
}

0 commit comments

Comments
 (0)