Skip to content

Commit c5fece7

Browse files
feat: Split rollup config for Nx caching (#5487)
1 parent 02f5581 commit c5fece7

40 files changed

+261
-189
lines changed

nx.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"test:eslint",
99
"test:types",
1010
"test:build",
11-
"build:types",
1211
"build",
13-
"rollup"
12+
"build:rollup",
13+
"build:codemods",
14+
"build:types"
1415
],
1516
"accessToken": "ZDdkNDA4MGEtYjNmYi00MWI4LWE1N2QtYTdlNmYxMGJlZWM2fHJlYWQ="
1617
}
@@ -63,13 +64,12 @@
6364
"inputs": ["default", "^public"],
6465
"dependsOn": ["^test:types"]
6566
},
66-
"build:types": {
67+
"build": {
6768
"outputs": [
68-
"{projectRoot}/build/**/*.d.ts",
69-
"{projectRoot}/build/.tsbuildinfo"
69+
"{projectRoot}/build/**/*"
7070
],
7171
"inputs": ["default", "^public"],
72-
"dependsOn": ["^build:types"]
72+
"dependsOn": ["^build"]
7373
},
7474
"test:build": {
7575
"dependsOn": ["build"],

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
"test:lib:dev": "pnpm --filter \"./packages/**\" run test:lib:dev",
1515
"test:build": "nx run-many --target=test:build --projects=root",
1616
"test:types": "nx affected --target=test:types --parallel=5",
17-
"build": "nx run-many --target=build --projects=root",
18-
"build:types": "nx affected --target=build:types --parallel=5",
19-
"watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"pnpm run build:types --watch\"",
17+
"build": "nx run-many --target=build --projects=root --parallel=5",
18+
"watch": "concurrently --kill-others \"pnpm -r build:rollup -w\" \"pnpm -r build:types --watch\"",
2019
"dev": "pnpm run watch",
2120
"prettier": "prettier --plugin-search-dir . \"{packages,examples}/**/src/**/*.{md,js,jsx,cjs,ts,tsx,json,vue,svelte}\"",
2221
"prettier:write": "pnpm run prettier --write",

packages/codemods/tsconfig.eslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"compilerOptions": {
44
"noEmit": true
55
},
6-
"include": ["**/*.ts", "**/*.tsx", "./.eslintrc.cjs"]
6+
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs"]
77
}

packages/eslint-plugin-query/tsconfig.eslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"compilerOptions": {
44
"noEmit": true
55
},
6-
"include": ["**/*.ts", "**/*.tsx", "./.eslintrc.cjs"]
6+
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs"]
77
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"test:types": "tsc",
3434
"test:lib": "vitest run --coverage",
3535
"test:lib:dev": "pnpm run test:lib --watch",
36+
"build": "pnpm build:rollup && pnpm build:types",
37+
"build:rollup": "rollup --config rollup.config.mjs",
3638
"build:types": "tsc --build"
3739
},
3840
"dependencies": {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @ts-check
2+
3+
import { defineConfig } from 'rollup'
4+
import { buildConfigs } from "../../scripts/getRollupConfig.mjs"
5+
6+
export default defineConfig([
7+
...buildConfigs({
8+
name: 'query-async-storage-persister',
9+
packageDir: '.',
10+
jsName: 'QueryAsyncStoragePersister',
11+
outputFile: 'index',
12+
entryFile: 'src/index.ts',
13+
globals: {
14+
'@tanstack/query-persist-client-core': 'QueryPersistClientCore',
15+
},
16+
}),
17+
])

packages/query-async-storage-persister/tsconfig.eslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"compilerOptions": {
44
"noEmit": true
55
},
6-
"include": ["**/*.ts", "**/*.tsx", "./.eslintrc.cjs"]
6+
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.mjs"]
77
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"clean": "rimraf ./build",
3232
"test:eslint": "eslint --ext .ts,.tsx ./src",
3333
"test:types": "tsc",
34+
"build": "pnpm build:rollup && pnpm build:types",
35+
"build:rollup": "rollup --config rollup.config.mjs",
3436
"build:types": "tsc --build"
3537
},
3638
"dependencies": {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// @ts-check
2+
3+
import { defineConfig } from 'rollup'
4+
import { buildConfigs } from "../../scripts/getRollupConfig.mjs"
5+
6+
export default defineConfig([
7+
...buildConfigs({
8+
name: 'query-broadcast-client-experimental',
9+
packageDir: '.',
10+
jsName: 'QueryBroadcastClient',
11+
outputFile: 'index',
12+
entryFile: 'src/index.ts',
13+
globals: {
14+
'@tanstack/query-core': 'QueryCore',
15+
'broadcast-channel': 'BroadcastChannel',
16+
},
17+
}),
18+
])

packages/query-broadcast-client-experimental/tsconfig.eslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"compilerOptions": {
44
"noEmit": true
55
},
6-
"include": ["**/*.ts", "**/*.tsx", "./.eslintrc.cjs"]
6+
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.mjs"]
77
}

0 commit comments

Comments
 (0)