diff --git a/package.json b/package.json index 04b4accbffc..dead13d5f82 100644 --- a/package.json +++ b/package.json @@ -116,6 +116,7 @@ "mfetch": "^0.2.27", "mobx": "^6.0.4", "mobx-react-lite": "^3.1.6", + "escape-string-regexp":"^4.0.0", "onchange": "^5.2.0", "opencollective": "^1.0.3", "opencollective-postinstall": "^2.0.2", diff --git a/packages/antd/copy.ts b/packages/antd/copy.ts index 3c21f033c58..529c0cd1b4b 100644 --- a/packages/antd/copy.ts +++ b/packages/antd/copy.ts @@ -1,6 +1,6 @@ -import { copy, readFile, writeFile, existsSync } from 'fs-extra' +import { copySync, readFileSync, writeFileSync, existsSync } from 'fs-extra' import glob from 'glob' - +import excape from 'escape-string-regexp' export const runCopy = ({ esStr, libStr, @@ -10,42 +10,29 @@ export const runCopy = ({ return Promise.resolve() } - const fileContent: string = (await readFile(filename)).toString() - - return writeFile( + const fileContent: string = readFileSync(filename, 'utf-8') + writeFileSync( filename, - fileContent.replace(new RegExp(libStr, 'g'), esStr) + fileContent.replace(new RegExp(excape(libStr), 'g'), esStr), + { + encoding: 'utf-8', + } ) } - return new Promise((resolve, reject) => { - glob(`./src/**/*`, (err, files) => { - if (err) { - return reject(err) - } - - const all = [] as Promise[] - - for (let i = 0; i < files.length; i += 1) { - const filename = files[i] - - if (/\.(less|scss)$/.test(filename)) { - all.push(copy(filename, filename.replace(/src\//, 'esm/'))) - all.push(copy(filename, filename.replace(/src\//, 'lib/'))) - - continue - } - - if (/\/style.ts$/.test(filename)) { - replaceOperation( - filename.replace(/src\//, 'esm/').replace(/\.ts$/, '.js') - ) - - continue - } + glob(`./src/**/*`, (err, files) => { + if (err) { + throw err + } + files.forEach((filename) => { + if (/\.(less|scss)$/.test(filename)) { + copySync(filename, filename.replace(/src\//, 'esm/')) + copySync(filename, filename.replace(/src\//, 'lib/')) + } else if (/\/style.ts$/.test(filename)) { + replaceOperation( + filename.replace(/src\//, 'esm/').replace(/\.ts$/, '.js') + ) } - - return Promise.all(all).then(resolve).catch(reject) }) }) } diff --git a/packages/antd/package.json b/packages/antd/package.json index 3e96d4f1111..e4d6216f968 100644 --- a/packages/antd/package.json +++ b/packages/antd/package.json @@ -1,6 +1,6 @@ { "name": "@formily/antd", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -42,12 +42,12 @@ }, "dependencies": { "@ant-design/icons": "^4.0.0", - "@formily/core": "^2.0.0-beta.13", - "@formily/json-schema": "^2.0.0-beta.13", - "@formily/react": "^2.0.0-beta.13", - "@formily/reactive": "^2.0.0-beta.13", - "@formily/reactive-react": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", + "@formily/core": "^2.0.0-beta.14", + "@formily/json-schema": "^2.0.0-beta.14", + "@formily/react": "^2.0.0-beta.14", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/reactive-react": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", "classnames": "^2.2.6", "react-sortable-hoc": "^1.11.0", "react-sticky-box": "^0.9.3", diff --git a/packages/core/package.json b/packages/core/package.json index af76b4462a1..374bfbe13e6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@formily/core", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -35,9 +35,9 @@ "dumi": "^1.1.0-rc.8" }, "dependencies": { - "@formily/reactive": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", - "@formily/validator": "^2.0.0-beta.13" + "@formily/reactive": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", + "@formily/validator": "^2.0.0-beta.14" }, "publishConfig": { "access": "public" diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 0e4d477cb34..4d770bbe939 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -1,6 +1,6 @@ { "name": "@formily/devtools", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "repository": { "type": "git", @@ -20,8 +20,8 @@ "start": "webpack-dev-server --config config/webpack.dev.js" }, "dependencies": { - "@formily/core": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", + "@formily/core": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", "react": "^17.0.0", "react-dom": "^17.0.0", "react-json-view": "^1.19.1", diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index 579424021e6..ea87fa4c519 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -1,6 +1,6 @@ { "name": "@formily/json-schema", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -27,9 +27,9 @@ "build:umd": "rollup --config" }, "dependencies": { - "@formily/core": "^2.0.0-beta.13", - "@formily/reactive": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13" + "@formily/core": "^2.0.0-beta.14", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14" }, "publishConfig": { "access": "public" diff --git a/packages/next/package.json b/packages/next/package.json index 4ccbd46b193..8bdbd2f7f85 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@formily/next", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "umd:main": "dist/formily.next.umd.production.js", @@ -42,12 +42,12 @@ }, "dependencies": { "@ant-design/icons": "^4.0.0", - "@formily/core": "^2.0.0-beta.13", - "@formily/json-schema": "^2.0.0-beta.13", - "@formily/react": "^2.0.0-beta.13", - "@formily/reactive": "^2.0.0-beta.13", - "@formily/reactive-react": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", + "@formily/core": "^2.0.0-beta.14", + "@formily/json-schema": "^2.0.0-beta.14", + "@formily/react": "^2.0.0-beta.14", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/reactive-react": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", "classnames": "^2.2.6", "react-sortable-hoc": "^1.11.0", "react-sticky-box": "^0.9.3", diff --git a/packages/next/src/array-table/style.ts b/packages/next/src/array-table/style.ts index 71dd6e6bef2..edd6661c5e9 100644 --- a/packages/next/src/array-table/style.ts +++ b/packages/next/src/array-table/style.ts @@ -3,4 +3,4 @@ import '@alifd/next/lib/badge/style' import '@alifd/next/lib/pagination/style' import '@alifd/next/lib/select/style' import '@alifd/next/lib/table/style' -import './main.scss' \ No newline at end of file +import './main.scss' diff --git a/packages/path/package.json b/packages/path/package.json index e2804b05e8c..54081db2645 100644 --- a/packages/path/package.json +++ b/packages/path/package.json @@ -1,6 +1,6 @@ { "name": "@formily/path", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", diff --git a/packages/react/package.json b/packages/react/package.json index 83019cdd8ce..f98f149f923 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@formily/react", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -38,12 +38,12 @@ "dumi": "^1.1.0-rc.8" }, "dependencies": { - "@formily/core": "^2.0.0-beta.13", - "@formily/json-schema": "^2.0.0-beta.13", - "@formily/reactive": "^2.0.0-beta.13", - "@formily/reactive-react": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", - "@formily/validator": "^2.0.0-beta.13", + "@formily/core": "^2.0.0-beta.14", + "@formily/json-schema": "^2.0.0-beta.14", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/reactive-react": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", + "@formily/validator": "^2.0.0-beta.14", "hoist-non-react-statics": "^3.3.2" }, "publishConfig": { diff --git a/packages/reactive-react/package.json b/packages/reactive-react/package.json index dc4d53eee97..c5da0ddd7e4 100644 --- a/packages/reactive-react/package.json +++ b/packages/reactive-react/package.json @@ -1,6 +1,6 @@ { "name": "@formily/reactive-react", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -38,8 +38,8 @@ "dumi": "^1.1.0-rc.8" }, "dependencies": { - "@formily/reactive": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", "hoist-non-react-statics": "^3.3.2" }, "publishConfig": { diff --git a/packages/reactive-vue/package.json b/packages/reactive-vue/package.json index ff7cd91a49d..c6339a987f4 100644 --- a/packages/reactive-vue/package.json +++ b/packages/reactive-vue/package.json @@ -1,6 +1,6 @@ { "name": "@formily/reactive-vue", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -41,8 +41,8 @@ "vuepress": "^1.8.2" }, "dependencies": { - "@formily/reactive": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", "vue-demi": "latest" }, "publishConfig": { diff --git a/packages/reactive/package.json b/packages/reactive/package.json index 93b5f24a332..f408dff29af 100644 --- a/packages/reactive/package.json +++ b/packages/reactive/package.json @@ -1,6 +1,6 @@ { "name": "@formily/reactive", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -32,7 +32,7 @@ "dumi": "^1.1.0-rc.8" }, "dependencies": { - "@formily/shared": "^2.0.0-beta.13" + "@formily/shared": "^2.0.0-beta.14" }, "publishConfig": { "access": "public" diff --git a/packages/shared/package.json b/packages/shared/package.json index 8c1fdb314d6..0fd9d57c250 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@formily/shared", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -34,7 +34,7 @@ "@types/react": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@formily/path": "^2.0.0-beta.13", + "@formily/path": "^2.0.0-beta.14", "camel-case": "^4.1.1", "lower-case": "^2.0.1", "no-case": "^3.0.4", diff --git a/packages/validator/package.json b/packages/validator/package.json index 3a378f2b0f7..1cbc1aa5507 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -1,6 +1,6 @@ { "name": "@formily/validator", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -27,7 +27,7 @@ "build:umd": "rollup --config" }, "dependencies": { - "@formily/shared": "^2.0.0-beta.13" + "@formily/shared": "^2.0.0-beta.14" }, "publishConfig": { "access": "public" diff --git a/packages/vue/package.json b/packages/vue/package.json index d3abc6fb0ff..342ec6e7dc4 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@formily/vue", - "version": "2.0.0-beta.13", + "version": "2.0.0-beta.14", "license": "MIT", "main": "lib", "module": "esm", @@ -32,12 +32,12 @@ "vuepress": "^1.8.2" }, "dependencies": { - "@formily/core": "^2.0.0-beta.13", - "@formily/json-schema": "^2.0.0-beta.13", - "@formily/reactive": "^2.0.0-beta.13", - "@formily/reactive-vue": "^2.0.0-beta.13", - "@formily/shared": "^2.0.0-beta.13", - "@formily/validator": "^2.0.0-beta.13", + "@formily/core": "^2.0.0-beta.14", + "@formily/json-schema": "^2.0.0-beta.14", + "@formily/reactive": "^2.0.0-beta.14", + "@formily/reactive-vue": "^2.0.0-beta.14", + "@formily/shared": "^2.0.0-beta.14", + "@formily/validator": "^2.0.0-beta.14", "vue-demi": "latest", "vue-frag": "^1.1.4" },