From faf1cc387a148df86c24c347f3c42e5c8880fc83 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Sun, 9 Oct 2022 21:09:51 +0800 Subject: [PATCH] =?UTF-8?q?:arrow=5Fup:=20build:=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=89=93=E5=8C=85=E5=B7=A5=E5=85=B7=E5=88=B0?= =?UTF-8?q?=20father4=20(#889)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :arrow_up: chore: 升级到 father4 * :wrench: chore: 移除lock文件 * :arrow_up: chore: 组件升级 father4 * :wrench: ci: 调整 CI 配置 * :wrench: ci: 调整 CI 配置 * :arrow_up: chore: 组件升级 father4 * :arrow_up: chore: 组件升级 father4 * :arrow_down: chore: 升级全局依赖 * :wrench: ci: 调整 CI 配置 * :white_check_mark: test: fix test --- .fatherrc.js | 35 - .fatherrc.ts | 3 + .github/workflows/build.yml | 3 +- .github/workflows/release.yml | 3 +- .github/workflows/test.yml | 5 +- .npmrc | 2 + jest.config.base.js | 15 +- lerna.json | 2 +- package.json | 133 +- packages/asset-gallery/.fatherrc.js | 5 - packages/asset-gallery/.fatherrc.ts | 5 + packages/asset-gallery/package.json | 14 +- .../__snapshots__/Header.test.tsx.snap | 6 +- .../tests/__snapshots__/index.test.tsx.snap | 15 +- packages/asset-gallery/tsconfig.json | 18 +- packages/asset-gallery/webpack.config.js | 11 - .../tests/__snapshots__/index.test.tsx.snap | 375 - packages/float-label-input/.fatherrc.js | 5 - packages/float-label-input/.fatherrc.ts | 4 + packages/float-label-input/package.json | 13 +- packages/float-label-input/src/useHover.ts | 8 +- packages/float-label-input/webpack.config.js | 11 - packages/heatmap-calendar/.fatherrc.js | 5 - packages/heatmap-calendar/.fatherrc.ts | 4 + packages/heatmap-calendar/package.json | 16 +- packages/heatmap-calendar/tsconfig.json | 14 +- packages/heatmap-calendar/webpack.config.js | 11 - packages/i18n/.fatherrc.js | 5 - packages/i18n/.fatherrc.ts | 4 + packages/i18n/package.json | 16 +- packages/i18n/webpack.config.js | 11 - packages/journey-map/.fatherrc.js | 5 - packages/journey-map/.fatherrc.ts | 4 + packages/journey-map/package.json | 15 +- .../schema/journey-map.schema.json | 9 +- .../__snapshots__/ErrorFallback.test.tsx.snap | 4 +- packages/journey-map/tsconfig.json | 14 +- packages/journey-map/webpack.config.js | 12 - packages/layout-kit/.fatherrc.js | 5 - packages/layout-kit/.fatherrc.ts | 4 + packages/layout-kit/package.json | 11 +- .../tests/__snapshots__/index.test.tsx.snap | 2 +- packages/layout-kit/tsconfig.json | 14 +- packages/layout-kit/webpack.config.js | 11 - packages/macos-traffic-light/.fatherrc.js | 5 - packages/macos-traffic-light/.fatherrc.ts | 4 + packages/macos-traffic-light/package.json | 13 +- packages/macos-traffic-light/tsconfig.json | 14 +- .../macos-traffic-light/webpack.config.js | 11 - packages/mindflow/.fatherrc.js | 5 - packages/mindflow/.fatherrc.ts | 4 + packages/mindflow/package.json | 3 +- packages/mindflow/tsconfig.json | 14 +- packages/mindflow/webpack.config.js | 19 - packages/page-loading/.fatherrc.js | 5 - packages/page-loading/.fatherrc.ts | 4 + packages/page-loading/package.json | 16 +- packages/page-loading/tsconfig.json | 19 +- packages/page-loading/webpack.config.js | 19 - packages/preloader/.fatherrc.js | 5 - packages/preloader/.fatherrc.ts | 4 + packages/preloader/package.json | 14 +- packages/preloader/tsconfig.json | 18 +- packages/preloader/webpack.config.js | 15 - packages/sortable-list/.fatherrc.js | 5 - packages/sortable-list/.fatherrc.ts | 4 + packages/sortable-list/package.json | 16 +- .../tests/__snapshots__/index.test.tsx.snap | 8 +- packages/sortable-list/tsconfig.json | 14 +- packages/sortable-list/webpack.config.js | 15 - packages/tag-selector/.fatherrc.js | 5 - packages/tag-selector/.fatherrc.ts | 4 + packages/tag-selector/package.json | 22 +- packages/tag-selector/tsconfig.json | 10 +- packages/tag-selector/webpack.config.js | 11 - packages/user-panel/.fatherrc.js | 10 - packages/user-panel/.fatherrc.ts | 4 + packages/user-panel/package.json | 13 +- .../login/__snapshots__/index.test.tsx.snap | 229 +- packages/user-panel/tsconfig.json | 14 +- packages/utils/.fatherrc.js | 5 - packages/utils/.fatherrc.ts | 4 + packages/utils/package.json | 12 +- packages/utils/tsconfig.json | 13 +- pnpm-lock.yaml | 24173 ---------------- .../create-package/template/.fatherrc.js.ejs | 5 - .../create-package/template/.fatherrc.ts.ejs | 4 + .../create-package/template/package.json.ejs | 21 +- .../create-package/template/src/index.tsx.ejs | 1 - .../create-package/template/tsconfig.json.ejs | 14 +- .../template/webpack.config.js.ejs | 11 - tsconfig.json | 12 +- 92 files changed, 411 insertions(+), 25346 deletions(-) delete mode 100644 .fatherrc.js create mode 100644 .fatherrc.ts delete mode 100644 packages/asset-gallery/.fatherrc.js create mode 100644 packages/asset-gallery/.fatherrc.ts delete mode 100644 packages/asset-gallery/webpack.config.js delete mode 100644 packages/color-picker/tests/__snapshots__/index.test.tsx.snap delete mode 100644 packages/float-label-input/.fatherrc.js create mode 100644 packages/float-label-input/.fatherrc.ts delete mode 100644 packages/float-label-input/webpack.config.js delete mode 100644 packages/heatmap-calendar/.fatherrc.js create mode 100644 packages/heatmap-calendar/.fatherrc.ts delete mode 100644 packages/heatmap-calendar/webpack.config.js delete mode 100644 packages/i18n/.fatherrc.js create mode 100644 packages/i18n/.fatherrc.ts delete mode 100644 packages/i18n/webpack.config.js delete mode 100644 packages/journey-map/.fatherrc.js create mode 100644 packages/journey-map/.fatherrc.ts delete mode 100644 packages/journey-map/webpack.config.js delete mode 100644 packages/layout-kit/.fatherrc.js create mode 100644 packages/layout-kit/.fatherrc.ts delete mode 100644 packages/layout-kit/webpack.config.js delete mode 100644 packages/macos-traffic-light/.fatherrc.js create mode 100644 packages/macos-traffic-light/.fatherrc.ts delete mode 100644 packages/macos-traffic-light/webpack.config.js delete mode 100644 packages/mindflow/.fatherrc.js create mode 100644 packages/mindflow/.fatherrc.ts delete mode 100644 packages/mindflow/webpack.config.js delete mode 100644 packages/page-loading/.fatherrc.js create mode 100644 packages/page-loading/.fatherrc.ts delete mode 100644 packages/page-loading/webpack.config.js delete mode 100644 packages/preloader/.fatherrc.js create mode 100644 packages/preloader/.fatherrc.ts delete mode 100644 packages/preloader/webpack.config.js delete mode 100644 packages/sortable-list/.fatherrc.js create mode 100644 packages/sortable-list/.fatherrc.ts delete mode 100644 packages/sortable-list/webpack.config.js delete mode 100644 packages/tag-selector/.fatherrc.js create mode 100644 packages/tag-selector/.fatherrc.ts delete mode 100644 packages/tag-selector/webpack.config.js delete mode 100644 packages/user-panel/.fatherrc.js create mode 100644 packages/user-panel/.fatherrc.ts delete mode 100644 packages/utils/.fatherrc.js create mode 100644 packages/utils/.fatherrc.ts delete mode 100644 pnpm-lock.yaml delete mode 100644 scripts/create-package/template/.fatherrc.js.ejs create mode 100644 scripts/create-package/template/.fatherrc.ts.ejs delete mode 100644 scripts/create-package/template/webpack.config.js.ejs diff --git a/.fatherrc.js b/.fatherrc.js deleted file mode 100644 index 63d68c33..00000000 --- a/.fatherrc.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - entry: 'src/index.ts', - cjs: 'babel', - esm: 'babel', - extraBabelPlugins: [ - [ - 'import', - { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }, - 'antd', - ], - [ - 'import', - { - libraryName: '@ant-design/charts', - libraryDirectory: 'es', - }, - ], - ], - pkgs: [ - 'utils', - 'preloader', - 'page-loading', - 'asset-gallery', - 'float-label-input', - 'heatmap-calendar', - 'i18n', - 'journey-map', - 'macos-traffic-light', - 'mindflow', - 'tag-selector', - 'user-panel', - 'layout-kit', - 'sortable-list', - ], -}; diff --git a/.fatherrc.ts b/.fatherrc.ts new file mode 100644 index 00000000..4f81ba60 --- /dev/null +++ b/.fatherrc.ts @@ -0,0 +1,3 @@ +import { defineConfig } from 'father'; + +export default defineConfig({ esm: { output: 'dist' } }); diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91f90e96..070c8cf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '14' - cache: 'pnpm' + node-version: '16' - name: Install deps run: pnpm install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0061f7f..ef858966 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '14' - cache: 'pnpm' + node-version: '16' - name: Install deps run: pnpm install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f5977cd..17529c5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,14 +15,13 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '14' - cache: 'pnpm' + node-version: '16' - name: Install deps run: pnpm install - name: test - run: pnpm run cov + run: pnpm run test:cov - name: Generate coverage run: bash <(curl -s https://codecov.io/bash) diff --git a/.npmrc b/.npmrc index eab44a52..9fc16946 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,4 @@ shamefully-hoist=true registry=https://registry.npmmirror.com/ +lockfile=false +strict-peer-dependencies=false diff --git a/jest.config.base.js b/jest.config.base.js index befa90b1..632a9455 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -1,6 +1,4 @@ -const { - default: umiConfig, -} = require('@umijs/test/lib/createDefaultConfig/createDefaultConfig'); +const { default: umiConfig } = require('@umijs/test/lib/createDefaultConfig/createDefaultConfig'); const defaultConfig = umiConfig(process.cwd(), {}); @@ -8,12 +6,17 @@ const path = require('path'); module.exports = { ...defaultConfig, - setupFiles: [...defaultConfig.setupFiles, './tests/setup.ts'], + setupFiles: [ + ...defaultConfig.setupFiles, + // 为了解决 @antv/g2 等 npm 包使用 worker 造成的 Worker is not defined 报错 + // 添加 jsdom-worker 作为 jsdom 环境下 worker 的 polyfill ref: https://www.npmjs.com/package/jsdom-worker + 'jsdom-worker', + './tests/setup.ts', + ], moduleNameMapper: { '@arvinxu/asset-gallery': '/packages/asset-gallery/src', '@arvinxu/preloader': '/packages/preloader/src', - '@arvinxu/macos-traffic-light': - '/packages/macos-traffic-light/src', + '@arvinxu/macos-traffic-light': '/packages/macos-traffic-light/src', '@arvinxu/journey-map': '/packages/journey-map/src', '@arvinxu/user-panel': '/packages/user-panel/src', '@arvinxu/heatmap-calendar': '/packages/heatmap-calendar/src', diff --git a/lerna.json b/lerna.json index c4880102..5a848710 100644 --- a/lerna.json +++ b/lerna.json @@ -7,5 +7,5 @@ }, "useWorkspaces": true, "version": "independent", - "npmClient": "yarn" + "npmClient": "pnpm" } diff --git a/package.json b/package.json index 74ed5473..304a53da 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,8 @@ "license": "MIT", "scripts": { "start": "pnpm run docs:dev", + "build": "lerna run build --parallel", "prebuild": "pnpm run clean", - "build": "pnpm run build:lib && pnpm run build:umd", - "build:lib": "father-build", - "build:umd": "lerna run webpack", "c": "ts-node scripts/create-package", "---------": "", "release": "multi-semantic-release", @@ -34,7 +32,7 @@ "--------- ": "", "test": "jest", "test:update": "jest -u", - "cov": "jest --coverage", + "test:cov": "jest --coverage", "--------- ": "", "check": "pnpm run check:lint && pnpm run check:circular && pnpm run check:types", "check:lint": "pnpm run lint-eslint", @@ -45,8 +43,8 @@ "lint-staged:ts": "eslint --cache --ext .ts,.tsx --format=pretty", "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ", "--------- ": "", - "clean": "lerna run clean && rm -rf es lib dist build coverage .umi .eslintcache apis", - "reinstall": "pnpm run clean && lerna clean && rm -rf node_modules && pnpm run", + "clean": "lerna run clean --parallel && rm -rf es lib dist build coverage .umi .eslintcache apis", + "reinstall": "pnpm run clean && lerna clean && rm -rf node_modules", "prepublishOnly": "pnpm run build", "prettier": "prettier -c --write \"**/**\"", "prepare": "husky install", @@ -60,80 +58,77 @@ "**/*.{ts,tsx}": "pnpm run lint-staged:ts" }, "devDependencies": { - "@ant-design/icons": "^4.x", - "@ant-design/pro-form": "^1.x", - "@ant-design/pro-skeleton": "^1.0.2", - "@babel/core": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-react-jsx": "^7.12.16", - "@babel/preset-env": "^7.8.3", - "@babel/preset-react": "^7.8.3", - "@babel/preset-typescript": "^7.8.3", - "@semantic-release/npm": "^8.0.3", - "@testing-library/jest-dom": "^5.11.9", - "@testing-library/react": "^12.1.2", + "@ant-design/icons": "^4.7.0", + "@ant-design/pro-form": "^1.74.6", + "@ant-design/pro-skeleton": "^1.0.13", + "@babel/core": "^7.19.3", + "@babel/plugin-proposal-object-rest-spread": "^7.18.9", + "@babel/plugin-transform-react-jsx": "^7.19.0", + "@babel/preset-env": "^7.19.3", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.18.6", + "@semantic-release/npm": "^9.0.1", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^7.0.2", - "@testing-library/user-event": "^13.0.8", - "@types/fs-extra": "^9.0.1", - "@types/jest": "^26.0.20", - "@types/jsdom": "^16.2.3", - "@types/node": "^15.0.0", - "@types/react": "^17.0.2", - "@types/react-dom": "^17.0.2", - "@types/uuid": "^8.3.0", - "@umijs/fabric": "~2.8.0", - "@umijs/preset-dumi": "^1.1.33", - "@umijs/preset-react": "^1.8.30", - "@umijs/test": "^3.2.10", - "antd": "^4.18.5", - "babel-loader": "^8.1.0", + "@testing-library/user-event": "^13.5.0", + "@types/fs-extra": "^9.0.13", + "@types/jest": "^26.0.24", + "@types/jsdom": "^16.2.15", + "@types/node": "^15.14.9", + "@types/react": "^17.0.50", + "@types/react-dom": "^17.0.17", + "@types/uuid": "^8.3.4", + "@umijs/fabric": "~2.8.1", + "@umijs/preset-dumi": "^1.1.48", + "@umijs/preset-react": "^1.8.31", + "@umijs/test": "^3.5.34", + "ahooks": "^3.7.1", + "antd": "^4.23.4", + "babel-loader": "^8.2.5", "babel-plugin-add-module-exports": "^1.0.4", - "babel-plugin-import": "^1.12.2", + "babel-plugin-import": "^1.13.5", "babel-plugin-module-resolver": "^4.1.0", - "canvas": "^2.9.3", - "commitlint": "^16.0.0", + "canvas": "^2.10.1", + "commitlint": "^16.3.0", "commitlint-config-gitmoji": "^2.2.5", - "concurrently": "^7.0.0", - "cross-env": "^7.0.0", - "css-loader": "^5.1.3", - "dayjs": "^1.10.5", - "dpdm": "^3.5.0", - "ejs": "^3.1.6", - "enzyme-to-json": "^3.4.3", - "eslint": "^7.7.0", + "concurrently": "^7.4.0", + "cross-env": "^7.0.3", + "css-loader": "^5.2.7", + "dayjs": "^1.11.5", + "dpdm": "^3.10.0", + "ejs": "^3.1.8", + "enzyme-to-json": "^3.6.2", + "eslint": "^7.32.0", "eslint-import-resolver-alias": "^1.1.2", - "eslint-import-resolver-typescript": "^2.2.1", - "father-build": "1.20.0", - "fs-extra": "^10.0.0", - "gh-pages": "^3.1.0", + "eslint-import-resolver-typescript": "^2.7.1", + "father": "^4.0.7", + "fs-extra": "^10.1.0", + "gh-pages": "^3.2.3", "husky": "^8.0.1", - "jest": "^26.4.2", + "jest": "^26.6.3", + "jsdom-worker": "^0.3.0", "lerna": "^4.0.0", - "less-loader": "^6.0.0", - "lint-staged": "^11.0.0", - "mini-css-extract-plugin": "^1.3.9", - "multi-semantic-release": "^2.11.1", + "less-loader": "^6.2.0", + "lint-staged": "^11.2.6", + "mini-css-extract-plugin": "^1.6.2", + "multi-semantic-release": "^2.13.0", "onchange": "^7.1.0", - "optimize-css-assets-webpack-plugin": "^6.0.0", - "prettier": "^2.5.1", + "optimize-css-assets-webpack-plugin": "^6.0.1", + "prettier": "^2.7.1", "prettier-plugin-style-order": "^0.2.2", - "semantic-release": "^19.0.2", + "semantic-release": "^19.0.5", "semantic-release-config-gitmoji": "^1.2.4", - "serve": "^12.0.0", + "serve": "^12.0.1", "style-loader": "^2.0.0", - "stylelint": "^13.0.0", - "terser-webpack-plugin": "^5.1.1", - "ts-jest": "^27.0.2", - "ts-node": "^10.0.0", - "tslint": "^6.1.3", - "tslint-config-prettier": "^1.18.0", - "typedoc": "^0.21.0", - "typescript": "^4.5.5", - "umi": "^3.5.20", - "utility-types": "^3.10.0", - "webpack": "^5.26.1", - "webpack-bundle-analyzer": "^4.1.0", - "webpack-cli": "^4.5.0" + "stylelint": "^13.13.1", + "terser-webpack-plugin": "^5.3.6", + "ts-jest": "^27.1.5", + "ts-node": "^10.9.1", + "typedoc": "^0.21.10", + "typescript": "^4.8.4", + "umi": "^3.5.34", + "utility-types": "^3.10.0" }, "engines": { "node": ">=12" diff --git a/packages/asset-gallery/.fatherrc.js b/packages/asset-gallery/.fatherrc.js deleted file mode 100644 index 87f204d0..00000000 --- a/packages/asset-gallery/.fatherrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require('../../.fatherrc'); - -module.exports = { - ...base, -}; diff --git a/packages/asset-gallery/.fatherrc.ts b/packages/asset-gallery/.fatherrc.ts new file mode 100644 index 00000000..0fe7b227 --- /dev/null +++ b/packages/asset-gallery/.fatherrc.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'father'; + +export default defineConfig({ + esm: { output: 'dist' }, +}); diff --git a/packages/asset-gallery/package.json b/packages/asset-gallery/package.json index d3f49ccc..d5353da3 100644 --- a/packages/asset-gallery/package.json +++ b/packages/asset-gallery/package.json @@ -2,11 +2,11 @@ "name": "@arvinxu/asset-gallery", "version": "1.3.4", "files": [ - "lib", - "es" + "dist" ], - "main": "lib/index.js", - "module": "es/index.js", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", "homepage": "https://github.com/arvinxx/components/tree/master/packages/asset-gallery#readme", "repository": "git+https://github.com/arvinxx/components.git", "publishConfig": { @@ -14,13 +14,13 @@ "access": "public" }, "scripts": { - "build": "father-build && pnpm run webpack", - "webpack": "webpack", + "build": "father build", + "prebuild": "pnpm run clean", "test": "jest", "test:update": "jest -u", "cov": "jest --coverage", "prepublishOnly": "pnpm run build", - "clean": "rm -rf es lib dist build coverage .umi" + "clean": "rm -rf dist build coverage .umi" }, "dependencies": { "@ant-design/icons": "^4.6.2", diff --git a/packages/asset-gallery/src/components/__snapshots__/Header.test.tsx.snap b/packages/asset-gallery/src/components/__snapshots__/Header.test.tsx.snap index ed430e3a..10d29349 100644 --- a/packages/asset-gallery/src/components/__snapshots__/Header.test.tsx.snap +++ b/packages/asset-gallery/src/components/__snapshots__/Header.test.tsx.snap @@ -59,7 +59,7 @@ exports[`Header 有 logo 1`] = ` class="ant-space-item" >
-
diff --git a/packages/asset-gallery/tests/__snapshots__/index.test.tsx.snap b/packages/asset-gallery/tests/__snapshots__/index.test.tsx.snap index fd19adef..879b6089 100644 --- a/packages/asset-gallery/tests/__snapshots__/index.test.tsx.snap +++ b/packages/asset-gallery/tests/__snapshots__/index.test.tsx.snap @@ -54,7 +54,7 @@ exports[`AssetGallery 加载数据 1`] = ` class="ant-space-item" >
-
@@ -384,7 +381,7 @@ exports[`AssetGallery 图片源为 PNG 1`] = ` class="ant-space-item" >
-
@@ -685,7 +679,7 @@ exports[`AssetGallery 默认状态 1`] = ` class="ant-space-item" >
-
diff --git a/packages/asset-gallery/tsconfig.json b/packages/asset-gallery/tsconfig.json index 2a314b02..596e2cf7 100644 --- a/packages/asset-gallery/tsconfig.json +++ b/packages/asset-gallery/tsconfig.json @@ -1,20 +1,4 @@ { "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": true, - "jsx": "react-jsx", - "skipLibCheck": true, - /* babel 输出类型 */ - "moduleResolution": "Node", - "target": "ESNext", - "module": "ESNext", - /* 模块导入配置项 */ - "esModuleInterop": true, - "lib": ["ESNext", "DOM"], - "baseUrl": "../..", - "paths": { - "@arvinxu/asset-gallery": ["./packages/asset-gallery/src"] - }, - "types": ["../../types", "@types/jest", "./types"] - } + "include": ["src"] } diff --git a/packages/asset-gallery/webpack.config.js b/packages/asset-gallery/webpack.config.js deleted file mode 100644 index 8804951c..00000000 --- a/packages/asset-gallery/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); -const config = require('../../webpack.config'); - -module.exports = { - ...config, - output: { - ...config.output, - library: 'AssetGallery', - path: path.resolve(__dirname, 'dist'), - }, -}; diff --git a/packages/color-picker/tests/__snapshots__/index.test.tsx.snap b/packages/color-picker/tests/__snapshots__/index.test.tsx.snap deleted file mode 100644 index c968286f..00000000 --- a/packages/color-picker/tests/__snapshots__/index.test.tsx.snap +++ /dev/null @@ -1,375 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ColorPicker 默认状态 1`] = ` -
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- hex -
-
-
- -
-
- h -
-
- s -
-
- v -
-
-
- Alpha -
-
-
-
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
-
-
-`; diff --git a/packages/float-label-input/.fatherrc.js b/packages/float-label-input/.fatherrc.js deleted file mode 100644 index 87f204d0..00000000 --- a/packages/float-label-input/.fatherrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require('../../.fatherrc'); - -module.exports = { - ...base, -}; diff --git a/packages/float-label-input/.fatherrc.ts b/packages/float-label-input/.fatherrc.ts new file mode 100644 index 00000000..036b3cc8 --- /dev/null +++ b/packages/float-label-input/.fatherrc.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'father'; +import config from '../../.fatherrc'; + +export default defineConfig({ ...config }); diff --git a/packages/float-label-input/package.json b/packages/float-label-input/package.json index a8e13adc..4cddbb96 100644 --- a/packages/float-label-input/package.json +++ b/packages/float-label-input/package.json @@ -2,11 +2,14 @@ "name": "@arvinxu/float-label-input", "version": "1.4.0", "files": [ - "lib", - "es" + "dist" + ], + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "sideEffects": [ + "*.less" ], - "main": "lib/index.js", - "module": "es/index.js", "homepage": "https://github.com/arvinxx/components/tree/master/packages/float-label-input#readme", "repository": "git+https://github.com/arvinxx/components.git", "publishConfig": { @@ -24,7 +27,7 @@ "react-dom": "^17.0.1" }, "scripts": { - "build": "father-build && webpack", + "build": "father build", "test": "jest", "test:update": "jest -u", "prepublishOnly": "pnpm run build", diff --git a/packages/float-label-input/src/useHover.ts b/packages/float-label-input/src/useHover.ts index e559dd33..7a47f31e 100644 --- a/packages/float-label-input/src/useHover.ts +++ b/packages/float-label-input/src/useHover.ts @@ -1,13 +1,11 @@ import { useRef } from 'react'; -import type { Input } from 'antd'; import { useSize } from 'ahooks'; +import type { InputRef } from 'antd'; export const useHover = () => { - const inputRef = useRef(null); + const inputRef = useRef(null); const labelRef = useRef(null); - const { height: inputHeight } = useSize( - inputRef.current && inputRef.current.input, - ); + const { height: inputHeight } = useSize(inputRef.current && inputRef.current.input); let baseGap = 8; const { height: labelHeight } = useSize(labelRef); diff --git a/packages/float-label-input/webpack.config.js b/packages/float-label-input/webpack.config.js deleted file mode 100644 index d2749bba..00000000 --- a/packages/float-label-input/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); -const config = require('../../webpack.config'); - -module.exports = { - ...config, - output: { - ...config.output, - library: 'FloatLabelInput', - path: path.resolve(__dirname, 'dist'), - }, -}; diff --git a/packages/heatmap-calendar/.fatherrc.js b/packages/heatmap-calendar/.fatherrc.js deleted file mode 100644 index 87f204d0..00000000 --- a/packages/heatmap-calendar/.fatherrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require('../../.fatherrc'); - -module.exports = { - ...base, -}; diff --git a/packages/heatmap-calendar/.fatherrc.ts b/packages/heatmap-calendar/.fatherrc.ts new file mode 100644 index 00000000..036b3cc8 --- /dev/null +++ b/packages/heatmap-calendar/.fatherrc.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'father'; +import config from '../../.fatherrc'; + +export default defineConfig({ ...config }); diff --git a/packages/heatmap-calendar/package.json b/packages/heatmap-calendar/package.json index 9727f9a0..cc13f9d4 100644 --- a/packages/heatmap-calendar/package.json +++ b/packages/heatmap-calendar/package.json @@ -2,11 +2,14 @@ "name": "@arvinxu/heatmap-calendar", "version": "1.0.1", "files": [ - "lib", - "es" + "dist" + ], + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "sideEffects": [ + "*.less" ], - "main": "lib/index.js", - "module": "es/index.js", "homepage": "https://github.com/arvinxx/components/tree/master/packages/heatmap-calendar#readme", "repository": "git+https://github.com/arvinxx/components.git", "publishConfig": { @@ -14,13 +17,12 @@ "access": "public" }, "scripts": { - "build": "father-build && yarn webpack", - "webpack": "webpack", + "build": "father build", "test": "jest", "test:update": "jest -u", "prepublishOnly": "pnpm run build", "cov": "jest --coverage", - "clean": "rm -rf es lib dist build coverage .umi" + "clean": "rm -rf dist build coverage .umi" }, "dependencies": { "@ant-design/charts": "^1.1.3" diff --git a/packages/heatmap-calendar/tsconfig.json b/packages/heatmap-calendar/tsconfig.json index b61bb516..4082f16a 100644 --- a/packages/heatmap-calendar/tsconfig.json +++ b/packages/heatmap-calendar/tsconfig.json @@ -1,15 +1,3 @@ { - "extends": "../../tsconfig.json", - "compilerOptions": { - "declaration": true, - "jsx": "react-jsx", - "skipLibCheck": true, - /* babel 输出类型 */ - "moduleResolution": "Node", - "target": "ESNext", - "module": "ESNext", - /* 模块导入配置项 */ - "esModuleInterop": true, - "types": ["../../types", "@types/jest"] - } + "extends": "../../tsconfig.json" } diff --git a/packages/heatmap-calendar/webpack.config.js b/packages/heatmap-calendar/webpack.config.js deleted file mode 100644 index c4230cb7..00000000 --- a/packages/heatmap-calendar/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); -const config = require('../../webpack.config'); - -module.exports = { - ...config, - output: { - ...config.output, - library: 'HeatmapCalendar', - path: path.resolve(__dirname, 'dist'), - }, -}; diff --git a/packages/i18n/.fatherrc.js b/packages/i18n/.fatherrc.js deleted file mode 100644 index 87f204d0..00000000 --- a/packages/i18n/.fatherrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require('../../.fatherrc'); - -module.exports = { - ...base, -}; diff --git a/packages/i18n/.fatherrc.ts b/packages/i18n/.fatherrc.ts new file mode 100644 index 00000000..036b3cc8 --- /dev/null +++ b/packages/i18n/.fatherrc.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'father'; +import config from '../../.fatherrc'; + +export default defineConfig({ ...config }); diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 6a681490..07d43c53 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -2,11 +2,14 @@ "name": "@arvinxu/i18n", "version": "1.0.1", "files": [ - "lib", - "es" + "dist" + ], + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "sideEffects": [ + "*.less" ], - "main": "lib/index.js", - "module": "es/index.js", "homepage": "https://github.com/arvinxx/components/tree/master/packages/i18n#readme", "repository": "git+https://github.com/arvinxx/components.git", "publishConfig": { @@ -17,12 +20,11 @@ "react-intl": "^5.20.4" }, "scripts": { - "build": "father-build && yarn webpack", - "webpack": "webpack", + "build": "father build", "test": "jest", "test:update": "jest -u", "prepublishOnly": "pnpm run build", "cov": "jest --coverage", - "clean": "rm -rf es lib dist build coverage .umi" + "clean": "rm -rf dist coverage .umi" } } diff --git a/packages/i18n/webpack.config.js b/packages/i18n/webpack.config.js deleted file mode 100644 index a5d9a71b..00000000 --- a/packages/i18n/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -const path = require('path'); -const config = require('../../webpack.config'); - -module.exports = { - ...config, - output: { - ...config.output, - library: 'I18n', - path: path.resolve(__dirname, 'dist'), - }, -}; diff --git a/packages/journey-map/.fatherrc.js b/packages/journey-map/.fatherrc.js deleted file mode 100644 index 87f204d0..00000000 --- a/packages/journey-map/.fatherrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require('../../.fatherrc'); - -module.exports = { - ...base, -}; diff --git a/packages/journey-map/.fatherrc.ts b/packages/journey-map/.fatherrc.ts new file mode 100644 index 00000000..036b3cc8 --- /dev/null +++ b/packages/journey-map/.fatherrc.ts @@ -0,0 +1,4 @@ +import { defineConfig } from 'father'; +import config from '../../.fatherrc'; + +export default defineConfig({ ...config }); diff --git a/packages/journey-map/package.json b/packages/journey-map/package.json index 6c934475..f48abcfe 100644 --- a/packages/journey-map/package.json +++ b/packages/journey-map/package.json @@ -2,13 +2,15 @@ "name": "@arvinxu/journey-map", "version": "2.1.5", "files": [ - "lib", - "es", "dist", "schema" ], - "main": "lib/index.js", - "module": "es/index.js", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "sideEffects": [ + "*.less" + ], "homepage": "https://github.com/arvinxx/components/tree/master/packages/journey-map#readme", "repository": "git+https://github.com/arvinxx/components.git", "publishConfig": { @@ -16,14 +18,13 @@ "access": "public" }, "scripts": { - "build": "yarn schema && father-build && yarn webpack", - "webpack": "webpack", + "build": "pnpm run schema && father build", "schema": "typescript-json-schema src/types/yml.ts YMLJourneyMapRawData -o ./schema/journey-map.schema.json --required --ignoreErrors", "test": "jest", "test:update": "jest -u", "prepublishOnly": "pnpm run build", "cov": "jest --coverage", - "clean": "rm -rf es lib dist build coverage .umi", + "clean": "rm -rf dist build coverage .umi", "lint-staged": "lint-staged" }, "lint-staged": { diff --git a/packages/journey-map/schema/journey-map.schema.json b/packages/journey-map/schema/journey-map.schema.json index 1447cbe3..d5d29cf0 100644 --- a/packages/journey-map/schema/journey-map.schema.json +++ b/packages/journey-map/schema/journey-map.schema.json @@ -15,14 +15,7 @@ "sections": { "description": "待显示的区块\n默认为: ['stage', 'action', 'emotion','thought']", "items": { - "enum": [ - "action", - "chance", - "emotion", - "painPoint", - "stage", - "thought" - ], + "enum": ["action", "chance", "emotion", "painPoint", "stage", "thought"], "type": "string" }, "type": "array" diff --git a/packages/journey-map/src/components/__snapshots__/ErrorFallback.test.tsx.snap b/packages/journey-map/src/components/__snapshots__/ErrorFallback.test.tsx.snap index 4682def6..56a8c3b5 100644 --- a/packages/journey-map/src/components/__snapshots__/ErrorFallback.test.tsx.snap +++ b/packages/journey-map/src/components/__snapshots__/ErrorFallback.test.tsx.snap @@ -57,13 +57,13 @@ exports[`ErrorFallback 默认 1`] = `