Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/composite monorepo #8560

Merged
merged 35 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bed78a7
chore: query-query, react-query and persist-core to composite setup
TkDodo Jan 21, 2025
4adc4bb
fix: self contain packages by having shared configs as symlinks
TkDodo Jan 21, 2025
dd65acb
fix: add tsConfigPaths to vite config
TkDodo Jan 21, 2025
7710d43
chore: set outDir, rootDir and baseUrl for all packages
TkDodo Jan 21, 2025
68b42e0
chore: make legacy tsconfig extend regular tsconfig
TkDodo Jan 21, 2025
d40653d
fix: tsc --build
TkDodo Jan 21, 2025
62e0d41
feat: setup project references
TkDodo Jan 21, 2025
dd52a42
fix: legacy configs also need references
TkDodo Jan 21, 2025
609ca7d
fix: oops
TkDodo Jan 21, 2025
686e863
fix: tsup related builds
TkDodo Jan 22, 2025
a9dcc49
Merge branch 'main' into feature/composite-monorepo
TkDodo Jan 22, 2025
1a39ac9
fix: set rootDir for tsup builds
TkDodo Jan 22, 2025
c2dd8f0
fix: remove dependencies on ^build
TkDodo Jan 22, 2025
5d9b86b
fix: add separate out dir for tsc
TkDodo Jan 22, 2025
b6edaaf
fix: include root eslint config in globals
TkDodo Jan 22, 2025
38d1257
refactor: create compile task to depend on
TkDodo Jan 22, 2025
a03aa12
fix: typo
TkDodo Jan 22, 2025
7cf0c85
fix: dynamic alisases for vitest
TkDodo Jan 22, 2025
9601bab
chore: try to fix knip
TkDodo Jan 22, 2025
4866a89
fix: make compile a cacheable task
TkDodo Jan 23, 2025
c66abc9
Merge branch 'main' into feature/composite-monorepo
TkDodo Jan 25, 2025
10ef560
chore: temporary disable tests against older TS versions
TkDodo Jan 25, 2025
e74b2aa
fix: ts doesn't like string return types
TkDodo Jan 25, 2025
f371882
fix(vue-query-devtools): fix build
DamianOsipiuk Jan 25, 2025
6bc503d
fix: test types
DamianOsipiuk Jan 25, 2025
d6daded
Revert "chore: temporary disable tests against older TS versions"
TkDodo Jan 26, 2025
bd2d008
fix: make legacy ts builds output to their own directory
TkDodo Jan 26, 2025
fb7172a
chore: remove test:types from examples as they need a build step
TkDodo Jan 26, 2025
4894ae8
chore: fix knip
TkDodo Jan 26, 2025
6f5ab94
chore: remove test:types from all examples
TkDodo Jan 26, 2025
79b4844
Revert "Revert "chore: temporary disable tests against older TS versi…
TkDodo Jan 26, 2025
9162293
fix: outputs for compile task
TkDodo Jan 26, 2025
6d286ee
chore: remove test:types from integrations
TkDodo Jan 26, 2025
56b9a0e
Revert "Revert "Revert "chore: temporary disable tests against older …
TkDodo Jan 26, 2025
14f24df
Merge branch 'main' into feature/composite-monorepo
TkDodo Jan 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: query-query, react-query and persist-core to composite setup
TkDodo committed Jan 21, 2025
commit bed78a79b2ae7cc3d9292bdf34005089975f672a
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@
"typescript55": "npm:typescript@5.5",
"typescript56": "npm:typescript@5.6",
"vite": "^5.3.5",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.0.4"
},
"pnpm": {
2 changes: 1 addition & 1 deletion packages/query-core/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check

import rootConfig from '../../eslint.config.js'
import rootConfig from './root.eslint.config.js'

export default [...rootConfig]
1 change: 1 addition & 0 deletions packages/query-core/root.eslint.config.js
1 change: 1 addition & 0 deletions packages/query-core/root.tsup.config.js
5 changes: 4 additions & 1 deletion packages/query-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": ".",
"baseUrl": ".",
"moduleResolution": "Bundler"
},
"include": ["src", "eslint.config.js", "tsup.config.js", "vite.config.ts"]
"include": ["src", "*.config.js", "package.json"]
}
2 changes: 1 addition & 1 deletion packages/query-core/tsconfig.legacy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["src/__tests__"]
}
2 changes: 1 addition & 1 deletion packages/query-core/tsup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'tsup'
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'
import { legacyConfig, modernConfig } from './root.tsup.config.js'

export default defineConfig([
modernConfig({ entry: ['src/*.ts'] }),
2 changes: 2 additions & 0 deletions packages/query-core/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { defineConfig } from 'vitest/config'
import tsconfigPaths from 'vite-tsconfig-paths'
import packageJson from './package.json'

export default defineConfig({
plugins: [tsconfigPaths({ ignoreConfigErrors: true })],
test: {
name: packageJson.name,
dir: './src',
2 changes: 1 addition & 1 deletion packages/query-persist-client-core/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check

import rootConfig from '../../eslint.config.js'
import rootConfig from './root.eslint.config.js'

export default [...rootConfig]
1 change: 1 addition & 0 deletions packages/query-persist-client-core/root.eslint.config.js
1 change: 1 addition & 0 deletions packages/query-persist-client-core/root.tsup.config.js
6 changes: 5 additions & 1 deletion packages/query-persist-client-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": ".",
"baseUrl": ".",
"moduleResolution": "Bundler"
},
"include": ["src", "eslint.config.js", "tsup.config.js", "vite.config.ts"]
"include": ["src", "*.config.js", "*.config.ts", "package.json"],
"references": [{ "path": "../query-core" }]
}
2 changes: 1 addition & 1 deletion packages/query-persist-client-core/tsup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'tsup'
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'
import { legacyConfig, modernConfig } from './root.tsup.config.js'

export default defineConfig([
modernConfig({ entry: ['src/*.ts'] }),
2 changes: 2 additions & 0 deletions packages/query-persist-client-core/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { defineConfig } from 'vitest/config'
import tsconfigPaths from 'vite-tsconfig-paths'
import packageJson from './package.json'

export default defineConfig({
plugins: [tsconfigPaths({ ignoreConfigErrors: true })],
test: {
name: packageJson.name,
dir: './src',
2 changes: 1 addition & 1 deletion packages/react-query/eslint.config.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactCompiler from 'eslint-plugin-react-compiler'
// @ts-expect-error
import pluginReactHooks from 'eslint-plugin-react-hooks'
import rootConfig from '../../eslint.config.js'
import rootConfig from './root.eslint.config.js'

export default [
...rootConfig,
16 changes: 8 additions & 8 deletions packages/react-query/package.json
Original file line number Diff line number Diff line change
@@ -18,14 +18,14 @@
"clean": "premove ./build ./coverage",
"test:eslint": "eslint ./src",
"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js -p tsconfig.legacy.json",
"test:types:ts57": "tsc",
"test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js --build tsconfig.legacy.json",
"test:types:ts57": "tsc --build",
"test:lib": "vitest",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict && attw --pack",
1 change: 1 addition & 0 deletions packages/react-query/root.eslint.config.js
1 change: 1 addition & 0 deletions packages/react-query/root.tsup.config.js
2 changes: 2 additions & 0 deletions packages/react-query/src/__tests__/useMutation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@testing-library/jest-dom/vitest'

import { describe, expect, it, vi } from 'vitest'
import { fireEvent, render, waitFor } from '@testing-library/react'
import * as React from 'react'
13 changes: 7 additions & 6 deletions packages/react-query/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": ".",
"baseUrl": ".",
"jsx": "react-jsx",
"moduleResolution": "Bundler"
},
"include": [
"src",
"eslint.config.js",
"test-setup.ts",
"tsup.config.js",
"vite.config.ts"
"include": ["src", "*.config.js", "package.json"],
"references": [
{ "path": "../query-core" },
{ "path": "../query-persist-client-core" }
]
}
2 changes: 1 addition & 1 deletion packages/react-query/tsconfig.legacy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx"
},
2 changes: 1 addition & 1 deletion packages/react-query/tsup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check

import { defineConfig } from 'tsup'
import { legacyConfig, modernConfig } from '../../scripts/getTsupConfig.js'
import { legacyConfig, modernConfig } from './root.tsup.config.js'

export default defineConfig([
modernConfig({ entry: ['src/*.ts', 'src/*.tsx'] }),
4 changes: 3 additions & 1 deletion packages/react-query/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'

import packageJson from './package.json'

export default defineConfig({
plugins: [react()],
plugins: [react(), tsconfigPaths({ ignoreConfigErrors: true })],
test: {
name: packageJson.name,
dir: './src',
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

59 changes: 57 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -6,22 +6,77 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"checkJs": true,
"composite": true,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"isolatedModules": true,
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"module": "ES2022",
"moduleResolution": "Node",
"noEmit": true,
"noEmit": false,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "ES2020"
"target": "ES2020",
"paths": {
"@tanstack/angular-query-devtools-experimental": [
"../../packages/angular-query-devtools-experimental/src"
],
"@tanstack/angular-query-experimental": [
"../../packages/angular-query-experimental/src"
],
"@tanstack/eslint-plugin-query": [
"../../packages/eslint-plugin-query/src"
],
"@tanstack/query-async-storage-persister": [
"../../packages/query-async-storage-persister/src"
],
"@tanstack/query-broadcast-client-experimental": [
"../../packages/query-broadcast-client-experimental/src"
],
"@tanstack/query-core": ["../../packages/query-core/src"],
"@tanstack/query-devtools": ["../../packages/query-devtools/src"],
"@tanstack/query-persist-client-core": [
"../../packages/query-persist-client-core/src"
],
"@tanstack/query-sync-storage-persister": [
"../../packages/query-sync-storage-persister/src"
],
"@tanstack/react-query": ["../../packages/react-query/src"],
"@tanstack/react-query-devtools": [
"../../packages/react-query-devtools/src"
],
"@tanstack/react-query-next-experimental": [
"../../packages/react-query-next-experimental/src"
],
"@tanstack/react-query-persist-client": [
"../../packages/react-query-persist-client/src"
],
"@tanstack/solid-query": ["../../packages/solid-query/src"],
"@tanstack/solid-query-devtools": [
"../../packages/solid-query-devtools/src"
],
"@tanstack/solid-query-persist-client": [
"../../packages/solid-query-persist-client/src"
],
"@tanstack/svelte-query": ["../../packages/svelte-query/src"],
"@tanstack/svelte-query-devtools": [
"../../packages/svelte-query-devtools/src"
],
"@tanstack/svelte-query-persist-client": [
"../../packages/svelte-query-persist-client/src"
],
"@tanstack/vue-query": ["../../packages/vue-query/src"],
"@tanstack/vue-query-devtools": ["../../packages/vue-query-devtools/src"]
}
},
"include": ["eslint.config.js", "prettier.config.js"]
}