From 582ce09db216a4c4eda76f90e1ecc7b36821f458 Mon Sep 17 00:00:00 2001 From: Xie Jay Date: Sat, 27 Jan 2024 09:50:27 +0800 Subject: [PATCH] fix: fix tsconfig for not Vue projects (#1342) --- tsconfig.json | 4 ++-- tsconfig.react.json | 32 ++++++++++++++++++++++++++++++++ tsconfig.vue2.7.json | 25 ++++++++++++++++++++++--- tsconfig.vue2.json | 25 ++++++++++++++++++++++--- tsconfig.vue3.json | 25 ++++++++++++++++++++++--- 5 files changed, 100 insertions(+), 11 deletions(-) create mode 100644 tsconfig.react.json diff --git a/tsconfig.json b/tsconfig.json index 7bc486177..e6bfc9f46 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "./tsconfig.vue3.json" -} \ No newline at end of file + "references": [{ "path": "./tsconfig.react.json" }, { "path": "./tsconfig.vue3.json" }] +} diff --git a/tsconfig.react.json b/tsconfig.react.json new file mode 100644 index 000000000..33888cd92 --- /dev/null +++ b/tsconfig.react.json @@ -0,0 +1,32 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "compilerOptions": { + "composite": true, + "allowJs": true, + "noImplicitAny": false, + "baseUrl": ".", + "jsx": "react-jsx", + "jsxImportSource": "react", + "paths": { + "@opentiny/react-*": ["packages/react-*", "packages/react/src/*"], + "@opentiny/vue-renderless/types*": ["packages/renderless/types*"], + "@opentiny/vue-renderless*": ["packages/renderless/src*"], + "virtual:common/adapter/react": ["packages/react-common/src/adapter/react/index.ts"], + "virtual:locale/react": ["packages/react-locale/src/react/index.ts"] + }, + "types": ["node", "vite/client"] + }, + "include": [ + "packages/react/**/*.ts", + "packages/react/**/*.tsx", + "packages/react-common/**/*.ts", + "packages/react-common/**/*.tsx", + "packages/react-icon/**/*.ts", + "packages/react-icon/**/*.tsx", + "packages/react-locale/**/*.ts", + "packages/react-locale/**/*.tsx", + "examples/react/shims-app.d.ts", + "examples/react/shims-react.d.ts" + ], + "exclude": ["**/node_modules", "**/dist*", "**/*.md"] +} diff --git a/tsconfig.vue2.7.json b/tsconfig.vue2.7.json index 44e008795..c5f0d9af9 100644 --- a/tsconfig.vue2.7.json +++ b/tsconfig.vue2.7.json @@ -1,6 +1,7 @@ { "extends": "@vue/tsconfig/tsconfig.dom.json", "compilerOptions": { + "composite": true, "allowJs": true, "noImplicitAny": false, "baseUrl": ".", @@ -20,9 +21,27 @@ "target": 2.7 }, "include": [ - "packages/**/*.ts", - "packages/**/*.tsx", - "packages/**/*.vue", + "packages/design/**/*.ts", + "packages/design/**/*.tsx", + "packages/design/**/*.vue", + "packages/renderless/**/*.ts", + "packages/renderless/**/*.tsx", + "packages/renderless/**/*.vue", + "packages/vue/**/*.ts", + "packages/vue/**/*.tsx", + "packages/vue/**/*.vue", + "packages/vue-common/**/*.ts", + "packages/vue-common/**/*.tsx", + "packages/vue-common/**/*.vue", + "packages/vue-icon/**/*.ts", + "packages/vue-icon/**/*.tsx", + "packages/vue-icon/**/*.vue", + "packages/vue-icon-saas/**/*.ts", + "packages/vue-icon-saas/**/*.tsx", + "packages/vue-icon-saas/**/*.vue", + "packages/vue-locale/**/*.ts", + "packages/vue-locale/**/*.tsx", + "packages/vue-locale/**/*.vue", "examples/vue2.7/shims-app.d.ts", "examples/vue2.7/shims-vue.d.ts" ], diff --git a/tsconfig.vue2.json b/tsconfig.vue2.json index 75a77145d..db1042d56 100644 --- a/tsconfig.vue2.json +++ b/tsconfig.vue2.json @@ -1,6 +1,7 @@ { "extends": "@vue/tsconfig/tsconfig.dom.json", "compilerOptions": { + "composite": true, "allowJs": true, "noImplicitAny": false, "baseUrl": ".", @@ -20,9 +21,27 @@ "target": 2 }, "include": [ - "packages/**/*.ts", - "packages/**/*.tsx", - "packages/**/*.vue", + "packages/design/**/*.ts", + "packages/design/**/*.tsx", + "packages/design/**/*.vue", + "packages/renderless/**/*.ts", + "packages/renderless/**/*.tsx", + "packages/renderless/**/*.vue", + "packages/vue/**/*.ts", + "packages/vue/**/*.tsx", + "packages/vue/**/*.vue", + "packages/vue-common/**/*.ts", + "packages/vue-common/**/*.tsx", + "packages/vue-common/**/*.vue", + "packages/vue-icon/**/*.ts", + "packages/vue-icon/**/*.tsx", + "packages/vue-icon/**/*.vue", + "packages/vue-icon-saas/**/*.ts", + "packages/vue-icon-saas/**/*.tsx", + "packages/vue-icon-saas/**/*.vue", + "packages/vue-locale/**/*.ts", + "packages/vue-locale/**/*.tsx", + "packages/vue-locale/**/*.vue", "examples/vue2/shims-app.d.ts", "examples/vue2/shims-vue.d.ts" ], diff --git a/tsconfig.vue3.json b/tsconfig.vue3.json index f8c5e211d..1974cbb2a 100644 --- a/tsconfig.vue3.json +++ b/tsconfig.vue3.json @@ -1,6 +1,7 @@ { "extends": "@vue/tsconfig/tsconfig.dom.json", "compilerOptions": { + "composite": true, "allowJs": true, "noImplicitAny": false, "baseUrl": ".", @@ -20,9 +21,27 @@ "target": 3 }, "include": [ - "packages/**/*.ts", - "packages/**/*.tsx", - "packages/**/*.vue", + "packages/design/**/*.ts", + "packages/design/**/*.tsx", + "packages/design/**/*.vue", + "packages/renderless/**/*.ts", + "packages/renderless/**/*.tsx", + "packages/renderless/**/*.vue", + "packages/vue/**/*.ts", + "packages/vue/**/*.tsx", + "packages/vue/**/*.vue", + "packages/vue-common/**/*.ts", + "packages/vue-common/**/*.tsx", + "packages/vue-common/**/*.vue", + "packages/vue-icon/**/*.ts", + "packages/vue-icon/**/*.tsx", + "packages/vue-icon/**/*.vue", + "packages/vue-icon-saas/**/*.ts", + "packages/vue-icon-saas/**/*.tsx", + "packages/vue-icon-saas/**/*.vue", + "packages/vue-locale/**/*.ts", + "packages/vue-locale/**/*.tsx", + "packages/vue-locale/**/*.vue", "examples/vue3/shims-app.d.ts", "examples/vue3/shims-vue.d.ts" ],