Skip to content

Commit f79fbe7

Browse files
committed
feat(workspace): add composite monorepo
1 parent 8ede6d0 commit f79fbe7

File tree

9 files changed

+79
-9
lines changed

9 files changed

+79
-9
lines changed

packages/form-core/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"module": "dist/esm/index.js",
3535
"exports": {
3636
".": {
37+
"@tanstack/custom-condition": "./src/index.ts",
3738
"import": {
3839
"types": "./dist/esm/index.d.ts",
3940
"default": "./dist/esm/index.js"
@@ -58,6 +59,7 @@
5859
"devDependencies": {
5960
"arktype": "^2.1.22",
6061
"valibot": "^1.1.0",
61-
"zod": "^3.25.76"
62+
"zod": "^3.25.76",
63+
"vite-tsconfig-paths": "^5.1.4"
6264
}
6365
}

packages/form-core/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"rootDir": ".",
5+
"outDir": "./dist",
6+
47
"moduleResolution": "Bundler"
5-
// "noErrorTruncation": true
68
},
7-
"include": ["src", "tests", "eslint.config.js", "vite.config.ts"]
9+
"include": ["src", "tests", "*.config.*", "package.json"]
810
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"incremental": false,
5+
"composite": false,
6+
"rootDir": "../../"
7+
}
8+
}

packages/form-core/vite.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
import { defineConfig, mergeConfig } from 'vitest/config'
2+
import tsconfigPaths from 'vite-tsconfig-paths'
3+
24
import { tanstackViteConfig } from '@tanstack/config/vite'
35
import packageJson from './package.json'
46

57
const config = defineConfig({
8+
plugins: [
9+
tsconfigPaths({
10+
projects: ['./tsconfig.prod.json'],
11+
}),
12+
],
13+
14+
// fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660
15+
resolve: {
16+
conditions: ['@tanstack/custom-condition'],
17+
},
18+
environments: {
19+
ssr: {
20+
resolve: {
21+
conditions: ['@tanstack/custom-condition'],
22+
},
23+
},
24+
},
25+
26+
// tests
627
test: {
728
name: packageJson.name,
829
dir: './tests',

packages/react-form/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"module": "dist/esm/index.js",
3535
"exports": {
3636
".": {
37+
"@tanstack/custom-condition": "./src/index.ts",
3738
"import": {
3839
"types": "./dist/esm/index.d.ts",
3940
"default": "./dist/esm/index.js"

packages/react-form/tsconfig.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"rootDir": ".",
5+
"outDir": "./dist",
6+
"baseUrl": ".",
7+
48
"jsx": "react-jsx",
5-
"moduleResolution": "Bundler",
6-
"paths": {
7-
"@tanstack/form-core": ["../form-core/src"]
8-
}
9+
"moduleResolution": "Bundler"
910
},
10-
"include": ["src", "tests", "eslint.config.js", "vite.config.ts"]
11+
"include": ["src", "tests", "*.config.*", "package.json"],
12+
"references": [{ "path": "../form-core" }]
1113
}

packages/react-form/vite.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ const config = defineConfig({
1414
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
1515
typecheck: { enabled: true },
1616
},
17+
// fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660
18+
resolve: {
19+
conditions: ['@tanstack/custom-condition'],
20+
},
21+
environments: {
22+
ssr: {
23+
resolve: {
24+
conditions: ['@tanstack/custom-condition'],
25+
},
26+
},
27+
},
1728
})
1829

1930
export default mergeConfig(

pnpm-lock.yaml

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

tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66
"allowUnreachableCode": false,
77
"allowUnusedLabels": false,
88
"checkJs": true,
9+
"composite": true,
10+
"customConditions": ["@tanstack/custom-condition"],
911
"declaration": true,
12+
"declarationMap": true,
13+
"emitDeclarationOnly": true,
1014
"esModuleInterop": true,
1115
"forceConsistentCasingInFileNames": true,
16+
"incremental": true,
1217
"isolatedModules": true,
1318
"lib": ["DOM", "DOM.Iterable", "ES2022"],
1419
"module": "ES2022",
1520
"moduleResolution": "Bundler",
16-
"noEmit": true,
21+
"noEmit": false,
1722
"noImplicitReturns": true,
1823
"noUncheckedIndexedAccess": true,
1924
"noUnusedLocals": false, // TODO enable

0 commit comments

Comments
 (0)