From 41ed70044da59bce4094db9b67289043b82aea2b Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Thu, 30 Dec 2021 22:33:29 +0800 Subject: [PATCH 1/6] feat: config define "vite.config.ts" --- packages/create-vite/template-lit-ts/tsconfig.json | 2 +- packages/create-vite/template-preact-ts/tsconfig.json | 2 +- packages/create-vite/template-react-ts/tsconfig.json | 2 +- packages/create-vite/template-vue-ts/tsconfig.json | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/create-vite/template-lit-ts/tsconfig.json b/packages/create-vite/template-lit-ts/tsconfig.json index 8957a2f4482d3f..4cbf5f8a739d27 100644 --- a/packages/create-vite/template-lit-ts/tsconfig.json +++ b/packages/create-vite/template-lit-ts/tsconfig.json @@ -5,7 +5,7 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "./types", - "rootDir": "./src", + "rootDirs": ["./src", "./"], "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/packages/create-vite/template-preact-ts/tsconfig.json b/packages/create-vite/template-preact-ts/tsconfig.json index 3925179fdbfeae..0db1f779ca7bdf 100644 --- a/packages/create-vite/template-preact-ts/tsconfig.json +++ b/packages/create-vite/template-preact-ts/tsconfig.json @@ -18,5 +18,5 @@ "jsxFactory": "h", "jsxFragmentFactory": "Fragment" }, - "include": ["src"] + "include": ["src", "vite.config.ts"] } diff --git a/packages/create-vite/template-react-ts/tsconfig.json b/packages/create-vite/template-react-ts/tsconfig.json index 9f83659970ba0f..b6b2f2edb53097 100644 --- a/packages/create-vite/template-react-ts/tsconfig.json +++ b/packages/create-vite/template-react-ts/tsconfig.json @@ -16,5 +16,5 @@ "noEmit": true, "jsx": "react-jsx" }, - "include": ["./src"] + "include": ["./src", "vite.config.ts"] } diff --git a/packages/create-vite/template-vue-ts/tsconfig.json b/packages/create-vite/template-vue-ts/tsconfig.json index 8617c8a54fe868..1fb8da64219e3b 100644 --- a/packages/create-vite/template-vue-ts/tsconfig.json +++ b/packages/create-vite/template-vue-ts/tsconfig.json @@ -11,5 +11,11 @@ "esModuleInterop": true, "lib": ["esnext", "dom"] }, - "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] + "include": [ + "src/**/*.ts", + "src/**/*.d.ts", + "src/**/*.tsx", + "src/**/*.vue", + "vite.config.ts" + ] } From 2af2be811373b7d71174ad09bf885ab78888df4d Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Thu, 30 Dec 2021 22:37:45 +0800 Subject: [PATCH 2/6] fix: teamplate lit ts --- packages/create-vite/template-lit-ts/tsconfig.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/create-vite/template-lit-ts/tsconfig.json b/packages/create-vite/template-lit-ts/tsconfig.json index 4cbf5f8a739d27..0efea2ad9668f9 100644 --- a/packages/create-vite/template-lit-ts/tsconfig.json +++ b/packages/create-vite/template-lit-ts/tsconfig.json @@ -5,7 +5,6 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "./types", - "rootDirs": ["./src", "./"], "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -17,6 +16,6 @@ "forceConsistentCasingInFileNames": true, "useDefineForClassFields": false }, - "include": ["src/**/*.ts"], + "include": ["src/**/*.ts", "vite.config.ts"], "exclude": [] } From 475d543ba3dec2c1c10eb7efd033f5901c4701c9 Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Fri, 31 Dec 2021 08:06:13 +0800 Subject: [PATCH 3/6] feat: svelte template --- packages/create-vite/template-svelte-ts/tsconfig.json | 8 +++++++- .../template-svelte-ts/{vite.config.js => vite.config.ts} | 0 2 files changed, 7 insertions(+), 1 deletion(-) rename packages/create-vite/template-svelte-ts/{vite.config.js => vite.config.ts} (100%) diff --git a/packages/create-vite/template-svelte-ts/tsconfig.json b/packages/create-vite/template-svelte-ts/tsconfig.json index f9039a5aab1bb0..d0d4c144510d36 100644 --- a/packages/create-vite/template-svelte-ts/tsconfig.json +++ b/packages/create-vite/template-svelte-ts/tsconfig.json @@ -15,5 +15,11 @@ "allowJs": true, "checkJs": true }, - "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"] + "include": [ + "src/**/*.d.ts", + "src/**/*.ts", + "src/**/*.js", + "src/**/*.svelte", + "vite.config.ts" + ] } diff --git a/packages/create-vite/template-svelte-ts/vite.config.js b/packages/create-vite/template-svelte-ts/vite.config.ts similarity index 100% rename from packages/create-vite/template-svelte-ts/vite.config.js rename to packages/create-vite/template-svelte-ts/vite.config.ts From a35b5032dbac8b03eb9f87dcba8499502b536ddd Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Sat, 1 Jan 2022 08:47:37 +0800 Subject: [PATCH 4/6] chore: tsconfig --- packages/create-vite/template-react-ts/tsconfig.json | 2 +- packages/create-vite/template-vanilla-ts/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-vite/template-react-ts/tsconfig.json b/packages/create-vite/template-react-ts/tsconfig.json index b6b2f2edb53097..7b389012bf7207 100644 --- a/packages/create-vite/template-react-ts/tsconfig.json +++ b/packages/create-vite/template-react-ts/tsconfig.json @@ -16,5 +16,5 @@ "noEmit": true, "jsx": "react-jsx" }, - "include": ["./src", "vite.config.ts"] + "include": ["src", "vite.config.ts"] } diff --git a/packages/create-vite/template-vanilla-ts/tsconfig.json b/packages/create-vite/template-vanilla-ts/tsconfig.json index 8cdbb2ac97c4b1..1885c8f9b00106 100644 --- a/packages/create-vite/template-vanilla-ts/tsconfig.json +++ b/packages/create-vite/template-vanilla-ts/tsconfig.json @@ -14,5 +14,5 @@ "noUnusedParameters": true, "noImplicitReturns": true }, - "include": ["./src"] + "include": ["src"] } From e9f5f626de3e8a6b501334e3f2fd55fbd4142679 Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Sat, 8 Jan 2022 21:00:53 +0800 Subject: [PATCH 5/6] feat: env --- .../create-vite/template-lit-ts/tsconfig.json | 4 ++-- .../template-lit-ts/tsconfig.node.json | 19 +++++++++++++++++++ .../template-preact-ts/tsconfig.json | 3 ++- .../template-preact-ts/tsconfig.node.json | 19 +++++++++++++++++++ .../template-react-ts/tsconfig.json | 3 ++- .../template-react-ts/tsconfig.node.json | 19 +++++++++++++++++++ .../template-svelte-ts/tsconfig.json | 9 ++------- .../template-svelte-ts/tsconfig.node.json | 19 +++++++++++++++++++ .../create-vite/template-vue-ts/tsconfig.json | 9 ++------- .../template-vue-ts/tsconfig.node.json | 19 +++++++++++++++++++ 10 files changed, 105 insertions(+), 18 deletions(-) create mode 100644 packages/create-vite/template-lit-ts/tsconfig.node.json create mode 100644 packages/create-vite/template-preact-ts/tsconfig.node.json create mode 100644 packages/create-vite/template-react-ts/tsconfig.node.json create mode 100644 packages/create-vite/template-svelte-ts/tsconfig.node.json create mode 100644 packages/create-vite/template-vue-ts/tsconfig.node.json diff --git a/packages/create-vite/template-lit-ts/tsconfig.json b/packages/create-vite/template-lit-ts/tsconfig.json index 0efea2ad9668f9..03ecaf410c88be 100644 --- a/packages/create-vite/template-lit-ts/tsconfig.json +++ b/packages/create-vite/template-lit-ts/tsconfig.json @@ -16,6 +16,6 @@ "forceConsistentCasingInFileNames": true, "useDefineForClassFields": false }, - "include": ["src/**/*.ts", "vite.config.ts"], - "exclude": [] + "include": ["src/**/*.ts"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/create-vite/template-lit-ts/tsconfig.node.json b/packages/create-vite/template-lit-ts/tsconfig.node.json new file mode 100644 index 00000000000000..76a7e26a3799b3 --- /dev/null +++ b/packages/create-vite/template-lit-ts/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": true, + "module": "esnext", + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": false + }, + "include": ["vite.config.ts"] +} diff --git a/packages/create-vite/template-preact-ts/tsconfig.json b/packages/create-vite/template-preact-ts/tsconfig.json index 0db1f779ca7bdf..fda60ae884247a 100644 --- a/packages/create-vite/template-preact-ts/tsconfig.json +++ b/packages/create-vite/template-preact-ts/tsconfig.json @@ -18,5 +18,6 @@ "jsxFactory": "h", "jsxFragmentFactory": "Fragment" }, - "include": ["src", "vite.config.ts"] + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/create-vite/template-preact-ts/tsconfig.node.json b/packages/create-vite/template-preact-ts/tsconfig.node.json new file mode 100644 index 00000000000000..76a7e26a3799b3 --- /dev/null +++ b/packages/create-vite/template-preact-ts/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": true, + "module": "esnext", + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": false + }, + "include": ["vite.config.ts"] +} diff --git a/packages/create-vite/template-react-ts/tsconfig.json b/packages/create-vite/template-react-ts/tsconfig.json index 7b389012bf7207..c8bdc64082aa26 100644 --- a/packages/create-vite/template-react-ts/tsconfig.json +++ b/packages/create-vite/template-react-ts/tsconfig.json @@ -16,5 +16,6 @@ "noEmit": true, "jsx": "react-jsx" }, - "include": ["src", "vite.config.ts"] + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/create-vite/template-react-ts/tsconfig.node.json b/packages/create-vite/template-react-ts/tsconfig.node.json new file mode 100644 index 00000000000000..76a7e26a3799b3 --- /dev/null +++ b/packages/create-vite/template-react-ts/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": true, + "module": "esnext", + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": false + }, + "include": ["vite.config.ts"] +} diff --git a/packages/create-vite/template-svelte-ts/tsconfig.json b/packages/create-vite/template-svelte-ts/tsconfig.json index d0d4c144510d36..4d6c04cf0ab13b 100644 --- a/packages/create-vite/template-svelte-ts/tsconfig.json +++ b/packages/create-vite/template-svelte-ts/tsconfig.json @@ -15,11 +15,6 @@ "allowJs": true, "checkJs": true }, - "include": [ - "src/**/*.d.ts", - "src/**/*.ts", - "src/**/*.js", - "src/**/*.svelte", - "vite.config.ts" - ] + "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/create-vite/template-svelte-ts/tsconfig.node.json b/packages/create-vite/template-svelte-ts/tsconfig.node.json new file mode 100644 index 00000000000000..76a7e26a3799b3 --- /dev/null +++ b/packages/create-vite/template-svelte-ts/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": true, + "module": "esnext", + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": false + }, + "include": ["vite.config.ts"] +} diff --git a/packages/create-vite/template-vue-ts/tsconfig.json b/packages/create-vite/template-vue-ts/tsconfig.json index 1fb8da64219e3b..af31eb8152d3cb 100644 --- a/packages/create-vite/template-vue-ts/tsconfig.json +++ b/packages/create-vite/template-vue-ts/tsconfig.json @@ -11,11 +11,6 @@ "esModuleInterop": true, "lib": ["esnext", "dom"] }, - "include": [ - "src/**/*.ts", - "src/**/*.d.ts", - "src/**/*.tsx", - "src/**/*.vue", - "vite.config.ts" - ] + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/create-vite/template-vue-ts/tsconfig.node.json b/packages/create-vite/template-vue-ts/tsconfig.node.json new file mode 100644 index 00000000000000..76a7e26a3799b3 --- /dev/null +++ b/packages/create-vite/template-vue-ts/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "composite": true, + "module": "esnext", + "declaration": true, + "emitDeclarationOnly": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "forceConsistentCasingInFileNames": true, + "useDefineForClassFields": false + }, + "include": ["vite.config.ts"] +} From f21df40bb5965efe0c256082a954db100156714c Mon Sep 17 00:00:00 2001 From: poyoho <907415276@qq.com> Date: Mon, 17 Jan 2022 09:38:23 +0800 Subject: [PATCH 6/6] chore: simplify .node.json --- .../create-vite/template-lit-ts/tsconfig.node.json | 13 +------------ .../template-preact-ts/tsconfig.node.json | 13 +------------ .../template-react-ts/tsconfig.node.json | 13 +------------ .../template-svelte-ts/tsconfig.node.json | 13 +------------ .../create-vite/template-vue-ts/tsconfig.node.json | 13 +------------ 5 files changed, 5 insertions(+), 60 deletions(-) diff --git a/packages/create-vite/template-lit-ts/tsconfig.node.json b/packages/create-vite/template-lit-ts/tsconfig.node.json index 76a7e26a3799b3..e993792cb12c9d 100644 --- a/packages/create-vite/template-lit-ts/tsconfig.node.json +++ b/packages/create-vite/template-lit-ts/tsconfig.node.json @@ -2,18 +2,7 @@ "compilerOptions": { "composite": true, "module": "esnext", - "declaration": true, - "emitDeclarationOnly": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "useDefineForClassFields": false + "moduleResolution": "node" }, "include": ["vite.config.ts"] } diff --git a/packages/create-vite/template-preact-ts/tsconfig.node.json b/packages/create-vite/template-preact-ts/tsconfig.node.json index 76a7e26a3799b3..e993792cb12c9d 100644 --- a/packages/create-vite/template-preact-ts/tsconfig.node.json +++ b/packages/create-vite/template-preact-ts/tsconfig.node.json @@ -2,18 +2,7 @@ "compilerOptions": { "composite": true, "module": "esnext", - "declaration": true, - "emitDeclarationOnly": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "useDefineForClassFields": false + "moduleResolution": "node" }, "include": ["vite.config.ts"] } diff --git a/packages/create-vite/template-react-ts/tsconfig.node.json b/packages/create-vite/template-react-ts/tsconfig.node.json index 76a7e26a3799b3..e993792cb12c9d 100644 --- a/packages/create-vite/template-react-ts/tsconfig.node.json +++ b/packages/create-vite/template-react-ts/tsconfig.node.json @@ -2,18 +2,7 @@ "compilerOptions": { "composite": true, "module": "esnext", - "declaration": true, - "emitDeclarationOnly": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "useDefineForClassFields": false + "moduleResolution": "node" }, "include": ["vite.config.ts"] } diff --git a/packages/create-vite/template-svelte-ts/tsconfig.node.json b/packages/create-vite/template-svelte-ts/tsconfig.node.json index 76a7e26a3799b3..e993792cb12c9d 100644 --- a/packages/create-vite/template-svelte-ts/tsconfig.node.json +++ b/packages/create-vite/template-svelte-ts/tsconfig.node.json @@ -2,18 +2,7 @@ "compilerOptions": { "composite": true, "module": "esnext", - "declaration": true, - "emitDeclarationOnly": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "useDefineForClassFields": false + "moduleResolution": "node" }, "include": ["vite.config.ts"] } diff --git a/packages/create-vite/template-vue-ts/tsconfig.node.json b/packages/create-vite/template-vue-ts/tsconfig.node.json index 76a7e26a3799b3..e993792cb12c9d 100644 --- a/packages/create-vite/template-vue-ts/tsconfig.node.json +++ b/packages/create-vite/template-vue-ts/tsconfig.node.json @@ -2,18 +2,7 @@ "compilerOptions": { "composite": true, "module": "esnext", - "declaration": true, - "emitDeclarationOnly": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "useDefineForClassFields": false + "moduleResolution": "node" }, "include": ["vite.config.ts"] }