From 65259a0664162ee900ef419bd91e7afb998617c3 Mon Sep 17 00:00:00 2001 From: JuFeng Zhang Date: Sun, 1 Aug 2021 09:07:11 +0800 Subject: [PATCH] chore(ts): map @formily/* to src folder during development (#1917) * chore(ts): map @formily/* to src folder during development * chore(ts): add devtools to paths --- designable/antd/package.json | 4 ++-- designable/antd/tsconfig.build.json | 14 ++++++++++++++ designable/antd/tsconfig.json | 6 ------ designable/next/package.json | 4 ++-- designable/next/tsconfig.build.json | 14 ++++++++++++++ designable/next/tsconfig.json | 6 ------ designable/setters/package.json | 4 ++-- designable/setters/tsconfig.build.json | 14 ++++++++++++++ designable/setters/tsconfig.json | 6 ------ devtools/chrome-extension/tsconfig.build.json | 14 ++++++++++++++ devtools/chrome-extension/tsconfig.json | 6 ------ packages/antd/package.json | 4 ++-- packages/antd/tsconfig.build.json | 14 ++++++++++++++ packages/antd/tsconfig.json | 6 ------ packages/core/package.json | 4 ++-- packages/core/tsconfig.build.json | 14 ++++++++++++++ packages/core/tsconfig.json | 3 --- packages/element/tsconfig.build.json | 14 ++++++++++++++ packages/element/tsconfig.json | 6 +++++- packages/json-schema/package.json | 4 ++-- packages/json-schema/tsconfig.build.json | 14 ++++++++++++++ packages/json-schema/tsconfig.json | 6 ------ packages/next/package.json | 4 ++-- packages/next/tsconfig.build.json | 14 ++++++++++++++ packages/next/tsconfig.json | 6 ------ packages/path/package.json | 4 ++-- packages/path/tsconfig.build.json | 14 ++++++++++++++ packages/path/tsconfig.json | 6 ------ packages/react/package.json | 4 ++-- packages/react/tsconfig.build.json | 14 ++++++++++++++ packages/react/tsconfig.json | 6 ------ packages/reactive-react/package.json | 4 ++-- packages/reactive-react/tsconfig.build.json | 14 ++++++++++++++ packages/reactive-react/tsconfig.json | 6 ------ .../tsconfig.build.json | 14 ++++++++++++++ .../reactive-test-cases-for-react18/tsconfig.json | 6 +----- packages/reactive-vue/package.json | 4 ++-- packages/reactive-vue/tsconfig.build.json | 14 ++++++++++++++ packages/reactive-vue/tsconfig.json | 6 +----- packages/reactive/package.json | 4 ++-- packages/reactive/tsconfig.build.json | 14 ++++++++++++++ packages/reactive/tsconfig.json | 6 ------ packages/shared/package.json | 4 ++-- packages/shared/tsconfig.build.json | 14 ++++++++++++++ packages/shared/tsconfig.json | 6 ------ packages/validator/package.json | 4 ++-- packages/validator/tsconfig.build.json | 14 ++++++++++++++ packages/validator/tsconfig.json | 6 ------ packages/vue/package.json | 4 ++-- packages/vue/tsconfig.build.json | 14 ++++++++++++++ packages/vue/tsconfig.json | 6 +----- scripts/rollup.base.js | 2 +- tsconfig.jest.json | 6 +++++- tsconfig.json | 6 +++++- 54 files changed, 301 insertions(+), 130 deletions(-) create mode 100644 designable/antd/tsconfig.build.json create mode 100644 designable/next/tsconfig.build.json create mode 100644 designable/setters/tsconfig.build.json create mode 100644 devtools/chrome-extension/tsconfig.build.json create mode 100644 packages/antd/tsconfig.build.json create mode 100644 packages/core/tsconfig.build.json create mode 100644 packages/element/tsconfig.build.json create mode 100644 packages/json-schema/tsconfig.build.json create mode 100644 packages/next/tsconfig.build.json create mode 100644 packages/path/tsconfig.build.json create mode 100644 packages/react/tsconfig.build.json create mode 100644 packages/reactive-react/tsconfig.build.json create mode 100644 packages/reactive-test-cases-for-react18/tsconfig.build.json create mode 100644 packages/reactive-vue/tsconfig.build.json create mode 100644 packages/reactive/tsconfig.build.json create mode 100644 packages/shared/tsconfig.build.json create mode 100644 packages/validator/tsconfig.build.json create mode 100644 packages/vue/tsconfig.build.json diff --git a/designable/antd/package.json b/designable/antd/package.json index a828759da09..71b39e8d431 100644 --- a/designable/antd/package.json +++ b/designable/antd/package.json @@ -23,8 +23,8 @@ }, "scripts": { "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && ts-node copy", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:playground": "webpack-cli --config playground/webpack.prod.ts", "start": "webpack-dev-server --config playground/webpack.dev.ts" diff --git a/designable/antd/tsconfig.build.json b/designable/antd/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/designable/antd/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/designable/antd/tsconfig.json b/designable/antd/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/designable/antd/tsconfig.json +++ b/designable/antd/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/designable/next/package.json b/designable/next/package.json index f3da0b05c7a..e5625dac418 100644 --- a/designable/next/package.json +++ b/designable/next/package.json @@ -24,8 +24,8 @@ "scripts": { "start": "dumi dev", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && ts-node copy", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:docs": "dumi build" }, diff --git a/designable/next/tsconfig.build.json b/designable/next/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/designable/next/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/designable/next/tsconfig.json b/designable/next/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/designable/next/tsconfig.json +++ b/designable/next/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/designable/setters/package.json b/designable/setters/package.json index cdc1259d2b6..68a0cf81e1a 100644 --- a/designable/setters/package.json +++ b/designable/setters/package.json @@ -23,8 +23,8 @@ }, "scripts": { "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && ts-node copy", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "start": "webpack-dev-server --config playground/webpack.dev.ts" }, diff --git a/designable/setters/tsconfig.build.json b/designable/setters/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/designable/setters/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/designable/setters/tsconfig.json b/designable/setters/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/designable/setters/tsconfig.json +++ b/designable/setters/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/devtools/chrome-extension/tsconfig.build.json b/devtools/chrome-extension/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/devtools/chrome-extension/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/devtools/chrome-extension/tsconfig.json b/devtools/chrome-extension/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/devtools/chrome-extension/tsconfig.json +++ b/devtools/chrome-extension/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/antd/package.json b/packages/antd/package.json index 8245d2d2bd4..c6dbd4fe95b 100644 --- a/packages/antd/package.json +++ b/packages/antd/package.json @@ -33,8 +33,8 @@ "build": "rimraf -rf lib esm dist && npm run create:style && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:style", "create:style": "ts-node create-style", "build:style": "ts-node build-style", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:docs": "dumi build" }, diff --git a/packages/antd/tsconfig.build.json b/packages/antd/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/antd/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/antd/tsconfig.json b/packages/antd/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/antd/tsconfig.json +++ b/packages/antd/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/core/package.json b/packages/core/package.json index 48149ad874e..0bc4cac87c2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -23,8 +23,8 @@ "scripts": { "start": "dumi dev", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:global", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:global": "ts-node ../../scripts/build-global", "build:docs": "dumi build" diff --git a/packages/core/tsconfig.build.json b/packages/core/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/core/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 9c2b6181bfe..c6865c25a75 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,8 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib" - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/element/tsconfig.build.json b/packages/element/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/element/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/element/tsconfig.json b/packages/element/tsconfig.json index 1ea2424a073..c1db2601937 100644 --- a/packages/element/tsconfig.json +++ b/packages/element/tsconfig.json @@ -4,7 +4,11 @@ "outDir": "./lib", "skipLibCheck": true, "paths": { - "@formily/*": ["../*"] + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] }, "plugins": [{ "transform": "./transformer.ts", "after": true }] }, diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index b8e949a3d13..dee425b4970 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -22,8 +22,8 @@ }, "scripts": { "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:global", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:global": "ts-node ../../scripts/build-global" }, diff --git a/packages/json-schema/tsconfig.build.json b/packages/json-schema/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/json-schema/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/json-schema/tsconfig.json b/packages/json-schema/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/json-schema/tsconfig.json +++ b/packages/json-schema/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/next/package.json b/packages/next/package.json index 847014e2e98..0fc300c5f89 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -33,8 +33,8 @@ "build": "rimraf -rf lib esm dist && npm run create:style && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:style", "create:style": "ts-node create-style", "build:style": "ts-node build-style", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:docs": "dumi build" }, diff --git a/packages/next/tsconfig.build.json b/packages/next/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/next/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json index 388dd5352e8..07cae369e66 100644 --- a/packages/next/tsconfig.json +++ b/packages/next/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*"] } diff --git a/packages/path/package.json b/packages/path/package.json index 3ba03a32d70..7ba1db44c1a 100644 --- a/packages/path/package.json +++ b/packages/path/package.json @@ -23,8 +23,8 @@ "scripts": { "start": "dumi dev", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:docs": "dumi build", "benchmark": "ts-node ./benchmark" diff --git a/packages/path/tsconfig.build.json b/packages/path/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/path/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/path/tsconfig.json b/packages/path/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/path/tsconfig.json +++ b/packages/path/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/react/package.json b/packages/react/package.json index cf8f59384d6..3b056d82f0d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -23,8 +23,8 @@ "scripts": { "start": "dumi dev", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:global", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:global": "ts-node ../../scripts/build-global", "build:docs": "dumi build" diff --git a/packages/react/tsconfig.build.json b/packages/react/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/react/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/reactive-react/package.json b/packages/reactive-react/package.json index 36c6cf324d1..9d1438dae46 100644 --- a/packages/reactive-react/package.json +++ b/packages/reactive-react/package.json @@ -23,8 +23,8 @@ "scripts": { "start": "dumi dev", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:docs": "dumi build" }, diff --git a/packages/reactive-react/tsconfig.build.json b/packages/reactive-react/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/reactive-react/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/reactive-react/tsconfig.json b/packages/reactive-react/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/reactive-react/tsconfig.json +++ b/packages/reactive-react/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/reactive-test-cases-for-react18/tsconfig.build.json b/packages/reactive-test-cases-for-react18/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/reactive-test-cases-for-react18/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/reactive-test-cases-for-react18/tsconfig.json b/packages/reactive-test-cases-for-react18/tsconfig.json index e62d698fd14..e3c7ffcc2c1 100644 --- a/packages/reactive-test-cases-for-react18/tsconfig.json +++ b/packages/reactive-test-cases-for-react18/tsconfig.json @@ -1,11 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib", - "allowJs": true, - "paths": { - "@formily/*": ["../*"] - } + "allowJs": true }, "include": ["./src/**/*.js"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] diff --git a/packages/reactive-vue/package.json b/packages/reactive-vue/package.json index 989161b5816..c7c9a9a34ec 100644 --- a/packages/reactive-vue/package.json +++ b/packages/reactive-vue/package.json @@ -22,8 +22,8 @@ }, "scripts": { "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config" }, "devDependencies": { diff --git a/packages/reactive-vue/tsconfig.build.json b/packages/reactive-vue/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/reactive-vue/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/reactive-vue/tsconfig.json b/packages/reactive-vue/tsconfig.json index b85318c8760..8246466f62a 100644 --- a/packages/reactive-vue/tsconfig.json +++ b/packages/reactive-vue/tsconfig.json @@ -1,11 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib", - "skipLibCheck": true, - "paths": { - "@formily/*": ["../*"] - } + "skipLibCheck": true }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] diff --git a/packages/reactive/package.json b/packages/reactive/package.json index eea94e445e3..a078c0b9e25 100644 --- a/packages/reactive/package.json +++ b/packages/reactive/package.json @@ -23,8 +23,8 @@ "scripts": { "start": "dumi dev", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:global", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:global": "ts-node ../../scripts/build-global", "build:docs": "dumi build", diff --git a/packages/reactive/tsconfig.build.json b/packages/reactive/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/reactive/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/reactive/tsconfig.json b/packages/reactive/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/reactive/tsconfig.json +++ b/packages/reactive/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/shared/package.json b/packages/shared/package.json index 20d269d4690..5b53c5ae1e1 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -26,8 +26,8 @@ "gitHead": "ac79c196ae9324889aca5e0501146f9b37b04283", "scripts": { "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config" }, "dependencies": { diff --git a/packages/shared/tsconfig.build.json b/packages/shared/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/shared/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/validator/package.json b/packages/validator/package.json index baedc332487..dc27c0ddedc 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -22,8 +22,8 @@ }, "scripts": { "build": "rimraf -rf lib esm dist lib && npm run build:cjs && npm run build:esm && npm run build:umd", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config" }, "dependencies": { diff --git a/packages/validator/tsconfig.build.json b/packages/validator/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/validator/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/validator/tsconfig.json b/packages/validator/tsconfig.json index e66a12226f2..c6865c25a75 100644 --- a/packages/validator/tsconfig.json +++ b/packages/validator/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./lib", - "paths": { - "@formily/*": ["../*"] - } - }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] } diff --git a/packages/vue/package.json b/packages/vue/package.json index a49b545eed2..40f5dc8df49 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -15,8 +15,8 @@ "scripts": { "start": "vuepress dev docs", "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:global", - "build:cjs": "tsc --declaration", - "build:esm": "tsc --declaration --module es2015 --outDir esm", + "build:cjs": "tsc --project tsconfig.build.json", + "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", "build:umd": "rollup --config", "build:global": "ts-node ../../scripts/build-global", "build:docs": "vuepress build docs" diff --git a/packages/vue/tsconfig.build.json b/packages/vue/tsconfig.build.json new file mode 100644 index 00000000000..dbf069a065d --- /dev/null +++ b/packages/vue/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib", + "paths": { + "@formily/*": [ + "../../packages/*", + "../../designable/*", + "../../devtools/*" + ] + }, + "declaration": true + } +} diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json index b85318c8760..8246466f62a 100644 --- a/packages/vue/tsconfig.json +++ b/packages/vue/tsconfig.json @@ -1,11 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib", - "skipLibCheck": true, - "paths": { - "@formily/*": ["../*"] - } + "skipLibCheck": true }, "include": ["./src/**/*.ts", "./src/**/*.tsx"], "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] diff --git a/scripts/rollup.base.js b/scripts/rollup.base.js index d97a803696c..eb8c3798069 100644 --- a/scripts/rollup.base.js +++ b/scripts/rollup.base.js @@ -33,7 +33,7 @@ const presets = () => { } return [ typescript({ - tsconfig: './tsconfig.json', + tsconfig: './tsconfig.build.json', tsconfigOverride: { compilerOptions: { module: 'ESNext', diff --git a/tsconfig.jest.json b/tsconfig.jest.json index 838e4c634bc..84430123cad 100644 --- a/tsconfig.jest.json +++ b/tsconfig.jest.json @@ -3,7 +3,11 @@ "compilerOptions": { "jsx": "react", "paths": { - "@formily/*": ["./packages/*/src"] + "@formily/*": [ + "./packages/*/src", + "./designable/*/src", + "./devtools/*/src" + ] } }, "exclude": ["./packages/*/esm", "./packages/*/lib"] diff --git a/tsconfig.json b/tsconfig.json index 69ffca4c3bf..0c08fe2c16b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,11 @@ "downlevelIteration": true, "baseUrl": ".", "paths": { - "@formily/*": ["./packages/*", "./designable/*"] + "@formily/*": [ + "./packages/*/src", + "./designable/*/src", + "./devtools/*/src" + ] } } }