Skip to content

Commit ae46035

Browse files
chore: Use @tanstack/config for build config (#549)
* Migrate form-core * Remove tsup and unnecessary vite plugins * Update other package configs * Add react and vue plugins * Add tsconfig.legacy.json * Run prettier
1 parent 30b4c94 commit ae46035

Some content is hidden

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

48 files changed

+658
-425
lines changed

examples/react/next-server-actions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "next dev",
77
"build": "next build",
8-
"test:types": "tsc --noEmit",
8+
"test:types": "tsc",
99
"test:eslint": "next lint"
1010
},
1111
"dependencies": {

examples/react/simple/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"dev": "vite --port=3001",
77
"build": "vite build",
88
"preview": "vite preview",
9-
"test:types": "tsc --noEmit"
9+
"test:types": "tsc"
1010
},
1111
"dependencies": {
1212
"@tanstack/react-form": "<1.0.0",
1313
"react": "^18.0.0",
1414
"react-dom": "^18.0.0"
1515
},
1616
"devDependencies": {
17-
"@vitejs/plugin-react": "^4.0.4",
17+
"@vitejs/plugin-react": "^4.2.1",
1818
"vite": "^5.0.10"
1919
},
2020
"browserslist": {

examples/react/valibot/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite --port=3001",
77
"build": "vite build",
88
"preview": "vite preview",
9-
"test:types": "tsc --noEmit"
9+
"test:types": "tsc"
1010
},
1111
"dependencies": {
1212
"@tanstack/react-form": "<1.0.0",
@@ -16,7 +16,7 @@
1616
"valibot": "^0.20.1"
1717
},
1818
"devDependencies": {
19-
"@vitejs/plugin-react": "^4.0.4",
19+
"@vitejs/plugin-react": "^4.2.1",
2020
"vite": "^5.0.10"
2121
},
2222
"browserslist": {

examples/react/yup/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite --port=3001",
77
"build": "vite build",
88
"preview": "vite preview",
9-
"test:types": "tsc --noEmit"
9+
"test:types": "tsc"
1010
},
1111
"dependencies": {
1212
"@tanstack/react-form": "<1.0.0",
@@ -16,7 +16,7 @@
1616
"yup": "^1.3.2"
1717
},
1818
"devDependencies": {
19-
"@vitejs/plugin-react": "^4.0.4",
19+
"@vitejs/plugin-react": "^4.2.1",
2020
"vite": "^5.0.10"
2121
},
2222
"browserslist": {

examples/react/zod/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite --port=3001",
77
"build": "vite build",
88
"preview": "vite preview",
9-
"test:types": "tsc --noEmit"
9+
"test:types": "tsc"
1010
},
1111
"dependencies": {
1212
"@tanstack/react-form": "<1.0.0",
@@ -16,7 +16,7 @@
1616
"zod": "^3.21.4"
1717
},
1818
"devDependencies": {
19-
"@vitejs/plugin-react": "^4.0.4",
19+
"@vitejs/plugin-react": "^4.2.1",
2020
"vite": "^5.0.10"
2121
},
2222
"browserslist": {

examples/solid/simple/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "vite",
77
"build": "tsc && vite build",
8-
"test:types": "tsc --noEmit",
8+
"test:types": "tsc",
99
"preview": "vite preview"
1010
},
1111
"dependencies": {

examples/solid/valibot/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "vite",
77
"build": "tsc && vite build",
8-
"test:types": "tsc --noEmit",
8+
"test:types": "tsc",
99
"preview": "vite preview"
1010
},
1111
"dependencies": {

examples/solid/yup/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "vite",
77
"build": "tsc && vite build",
8-
"test:types": "tsc --noEmit",
8+
"test:types": "tsc",
99
"preview": "vite preview"
1010
},
1111
"dependencies": {

examples/solid/zod/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "vite",
77
"build": "tsc && vite build",
8-
"test:types": "tsc --noEmit",
8+
"test:types": "tsc",
99
"preview": "vite preview"
1010
},
1111
"dependencies": {

examples/vue/simple/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"dev": "vite",
66
"build": "vite build",
77
"build:dev": "vite build -m development",
8-
"test:types": "vue-tsc --noEmit",
8+
"test:types": "vue-tsc",
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
1212
"@tanstack/vue-form": "<1.0.0",
1313
"vue": "^3.3.4"
1414
},
1515
"devDependencies": {
16-
"@vitejs/plugin-vue": "^4.3.4",
16+
"@vitejs/plugin-vue": "^4.5.0",
1717
"typescript": "^5.0.4",
1818
"vite": "^5.0.10",
1919
"vue-tsc": "^1.8.10"

examples/vue/simple/vite.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'vite'
2-
import createVuePlugin from '@vitejs/plugin-vue'
2+
import vue from '@vitejs/plugin-vue'
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [createVuePlugin()],
6+
plugins: [vue()],
77
optimizeDeps: {
88
exclude: ['@tanstack/vue-form'],
99
},

examples/vue/valibot/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dev": "vite",
66
"build": "vite build",
77
"build:dev": "vite build -m development",
8-
"test:types": "vue-tsc --noEmit",
8+
"test:types": "vue-tsc",
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
@@ -15,7 +15,7 @@
1515
"valibot": "^0.20.1"
1616
},
1717
"devDependencies": {
18-
"@vitejs/plugin-vue": "^4.3.4",
18+
"@vitejs/plugin-vue": "^4.5.0",
1919
"typescript": "^5.0.4",
2020
"vite": "^5.0.10",
2121
"vue-tsc": "^1.8.10"

examples/vue/valibot/vite.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'vite'
2-
import createVuePlugin from '@vitejs/plugin-vue'
2+
import vue from '@vitejs/plugin-vue'
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [createVuePlugin()],
6+
plugins: [vue()],
77
optimizeDeps: {
88
exclude: ['@tanstack/vue-form'],
99
},

examples/vue/yup/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dev": "vite",
66
"build": "vite build",
77
"build:dev": "vite build -m development",
8-
"test:types": "vue-tsc --noEmit",
8+
"test:types": "vue-tsc",
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
@@ -15,7 +15,7 @@
1515
"yup": "^1.3.2"
1616
},
1717
"devDependencies": {
18-
"@vitejs/plugin-vue": "^4.3.4",
18+
"@vitejs/plugin-vue": "^4.5.0",
1919
"typescript": "^5.0.4",
2020
"vite": "^5.0.10",
2121
"vue-tsc": "^1.8.10"

examples/vue/yup/vite.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'vite'
2-
import createVuePlugin from '@vitejs/plugin-vue'
2+
import vue from '@vitejs/plugin-vue'
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [createVuePlugin()],
6+
plugins: [vue()],
77
optimizeDeps: {
88
exclude: ['@tanstack/vue-form'],
99
},

examples/vue/zod/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dev": "vite",
66
"build": "vite build",
77
"build:dev": "vite build -m development",
8-
"test:types": "vue-tsc --noEmit",
8+
"test:types": "vue-tsc",
99
"serve": "vite preview"
1010
},
1111
"dependencies": {
@@ -15,7 +15,7 @@
1515
"zod": "^3.21.4"
1616
},
1717
"devDependencies": {
18-
"@vitejs/plugin-vue": "^4.3.4",
18+
"@vitejs/plugin-vue": "^4.5.0",
1919
"typescript": "^5.0.4",
2020
"vite": "^5.0.10",
2121
"vue-tsc": "^1.8.10"

examples/vue/zod/vite.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'vite'
2-
import createVuePlugin from '@vitejs/plugin-vue'
2+
import vue from '@vitejs/plugin-vue'
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [createVuePlugin()],
6+
plugins: [vue()],
77
optimizeDeps: {
88
exclude: ['@tanstack/vue-form'],
99
},

package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"devDependencies": {
3636
"@commitlint/parse": "^18.4.3",
3737
"@solidjs/testing-library": "^0.8.5",
38+
"@tanstack/config": "^0.1.1",
3839
"@testing-library/jest-dom": "^6.1.5",
3940
"@testing-library/react": "^14.1.2",
4041
"@testing-library/react-hooks": "^8.0.1",
@@ -57,7 +58,6 @@
5758
"axios": "^1.6.2",
5859
"chalk": "^5.3.0",
5960
"current-git-branch": "^1.1.0",
60-
"esbuild-plugin-file-path-extensions": "^2.0.0",
6161
"eslint": "^8.56.0",
6262
"eslint-config-prettier": "^9.1.0",
6363
"eslint-import-resolver-typescript": "^3.6.1",
@@ -79,15 +79,12 @@
7979
"semver": "^7.5.4",
8080
"solid-js": "^1.7.8",
8181
"stream-to-array": "^2.3.0",
82-
"tsup": "^8.0.1",
8382
"type-fest": "^4.8.3",
8483
"typescript": "^5.2.2",
8584
"typescript49": "npm:[email protected]",
8685
"typescript50": "npm:[email protected]",
8786
"typescript51": "npm:[email protected]",
8887
"vite": "^5.0.10",
89-
"vite-plugin-dts": "^3.7.0",
90-
"vite-plugin-externalize-deps": "^0.8.0",
9188
"vitest": "^1.1.0",
9289
"vue": "^3.3.4"
9390
}

packages/form-core/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"url": "https://github.com/sponsors/tannerlinsley"
1212
},
1313
"type": "module",
14-
"types": "dist/mjs/index.d.mts",
14+
"types": "dist/esm/index.d.ts",
1515
"main": "dist/cjs/index.cjs",
16-
"module": "dist/mjs/index.mjs",
16+
"module": "dist/esm/index.js",
1717
"exports": {
1818
".": {
1919
"import": {
20-
"types": "./dist/mjs/index.d.mts",
21-
"default": "./dist/mjs/index.mjs"
20+
"types": "./dist/esm/index.d.ts",
21+
"default": "./dist/esm/index.js"
2222
},
2323
"require": {
2424
"types": "./dist/cjs/index.d.cts",
@@ -35,10 +35,10 @@
3535
"scripts": {
3636
"clean": "rimraf ./dist && rimraf ./coverage",
3737
"test:eslint": "eslint --ext .ts,.tsx ./src",
38-
"test:types:versions49": "../../node_modules/typescript49/bin/tsc --noEmit",
39-
"test:types:versions50": "../../node_modules/typescript50/bin/tsc --noEmit",
40-
"test:types:versions51": "../../node_modules/typescript51/bin/tsc --noEmit",
41-
"test:types:versions52": "tsc --noEmit",
38+
"test:types:versions49": "../../node_modules/typescript49/bin/tsc --project tsconfig.legacy.json",
39+
"test:types:versions50": "../../node_modules/typescript50/bin/tsc",
40+
"test:types:versions51": "../../node_modules/typescript51/bin/tsc",
41+
"test:types:versions52": "tsc",
4242
"test:types": "pnpm run \"/^test:types:versions.*/\"",
4343
"test:lib": "vitest",
4444
"test:lib:dev": "pnpm run test:lib --watch",

packages/form-core/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"noEmit": true,
4+
"moduleResolution": "Bundler",
55
"types": ["vitest/globals"]
66
},
77
"include": ["src/**/*.ts", "src/**/*.tsx", ".eslintrc.cjs", "vite.config.ts"]
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"moduleResolution": "Node"
5+
},
6+
"include": ["src/**/*.ts", "src/**/*.tsx"],
7+
"exclude": ["src/tests/**"]
8+
}

packages/form-core/vite.config.ts

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import { defineConfig, mergeConfig } from 'vitest/config'
2-
import { getDefaultViteConfig } from '../../getViteConfig'
2+
import { tanstackBuildConfig } from '@tanstack/config/build'
33

4-
console.log(__dirname)
4+
const config = defineConfig({
5+
test: {
6+
name: 'form-core',
7+
dir: './src',
8+
watch: false,
9+
environment: 'jsdom',
10+
globals: true,
11+
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
12+
typecheck: { enabled: true },
13+
},
14+
})
515

616
export default mergeConfig(
7-
getDefaultViteConfig({ dirname: __dirname, entryPath: 'src/index.ts' }),
8-
defineConfig({
9-
test: {
10-
name: 'form-core',
11-
dir: './src',
12-
watch: false,
13-
environment: 'jsdom',
14-
globals: true,
15-
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
16-
typecheck: { enabled: true },
17-
},
17+
config,
18+
tanstackBuildConfig({
19+
entry: './src/index.ts',
20+
srcDir: './src',
21+
exclude: ['./src/tests'],
1822
}),
1923
)

packages/react-form/package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"scripts": {
1515
"clean": "rimraf ./dist && rimraf ./coverage",
1616
"test:eslint": "eslint --ext .ts,.tsx ./src",
17-
"test:types:versions49": "../../node_modules/typescript49/bin/tsc --noEmit",
18-
"test:types:versions50": "../../node_modules/typescript50/bin/tsc --noEmit",
19-
"test:types:versions51": "../../node_modules/typescript51/bin/tsc --noEmit",
20-
"test:types:versions52": "tsc --noEmit",
17+
"test:types:versions49": "../../node_modules/typescript49/bin/tsc --project tsconfig.legacy.json",
18+
"test:types:versions50": "../../node_modules/typescript50/bin/tsc",
19+
"test:types:versions51": "../../node_modules/typescript51/bin/tsc",
20+
"test:types:versions52": "tsc",
2121
"test:types": "pnpm run \"/^test:types:versions.*/\"",
2222
"test:lib": "vitest",
2323
"test:lib:dev": "pnpm run test:lib --watch",
@@ -29,14 +29,14 @@
2929
"src"
3030
],
3131
"type": "module",
32-
"types": "dist/mjs/index.d.mts",
32+
"types": "dist/esm/index.d.ts",
3333
"main": "dist/cjs/index.cjs",
34-
"module": "dist/mjs/index.mjs",
34+
"module": "dist/esm/index.js",
3535
"exports": {
3636
".": {
3737
"import": {
38-
"types": "./dist/mjs/index.d.mts",
39-
"default": "./dist/mjs/index.mjs"
38+
"types": "./dist/esm/index.d.ts",
39+
"default": "./dist/esm/index.js"
4040
},
4141
"require": {
4242
"types": "./dist/cjs/index.d.cts",
@@ -50,6 +50,7 @@
5050
"@types/react": "^18.2.45",
5151
"@types/react-dom": "^18.0.5",
5252
"@types/use-sync-external-store": "^0.0.3",
53+
"@vitejs/plugin-react": "^4.2.1",
5354
"react": "^18.2.0",
5455
"react-dom": "^18.2.0",
5556
"react-error-boundary": "^3.1.4"

0 commit comments

Comments
 (0)