Skip to content

Commit

Permalink
⬆️ build: 升级组件打包工具到 father4 (#889)
Browse files Browse the repository at this point in the history
* ⬆️ chore: 升级到 father4

* 🔧 chore: 移除lock文件

* ⬆️ chore: 组件升级 father4

* 🔧 ci: 调整 CI 配置

* 🔧 ci: 调整 CI 配置

* ⬆️ chore: 组件升级 father4

* ⬆️ chore: 组件升级 father4

* ⬇️ chore: 升级全局依赖

* 🔧 ci: 调整 CI 配置

* ✅ test: fix test
  • Loading branch information
arvinxx authored Oct 9, 2022
1 parent ae8f231 commit faf1cc3
Show file tree
Hide file tree
Showing 92 changed files with 411 additions and 25,346 deletions.
35 changes: 0 additions & 35 deletions .fatherrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from 'father';

export default defineConfig({ esm: { output: 'dist' } });
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
shamefully-hoist=true
registry=https://registry.npmmirror.com/
lockfile=false
strict-peer-dependencies=false
15 changes: 9 additions & 6 deletions jest.config.base.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
const {
default: umiConfig,
} = require('@umijs/test/lib/createDefaultConfig/createDefaultConfig');
const { default: umiConfig } = require('@umijs/test/lib/createDefaultConfig/createDefaultConfig');

const defaultConfig = umiConfig(process.cwd(), {});

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': '<rootDir>/packages/asset-gallery/src',
'@arvinxu/preloader': '<rootDir>/packages/preloader/src',
'@arvinxu/macos-traffic-light':
'<rootDir>/packages/macos-traffic-light/src',
'@arvinxu/macos-traffic-light': '<rootDir>/packages/macos-traffic-light/src',
'@arvinxu/journey-map': '<rootDir>/packages/journey-map/src',
'@arvinxu/user-panel': '<rootDir>/packages/user-panel/src',
'@arvinxu/heatmap-calendar': '<rootDir>/packages/heatmap-calendar/src',
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
},
"useWorkspaces": true,
"version": "independent",
"npmClient": "yarn"
"npmClient": "pnpm"
}
133 changes: 64 additions & 69 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions packages/asset-gallery/.fatherrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions packages/asset-gallery/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from 'father';

export default defineConfig({
esm: { output: 'dist' },
});
14 changes: 7 additions & 7 deletions packages/asset-gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"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": {
"registry": "https://registry.npmjs.org",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports[`Header 有 logo 1`] = `
class="ant-space-item"
>
<div
class="ant-slider"
class="ant-slider ant-slider-horizontal"
style="width: 100px;"
>
<div
Expand All @@ -76,15 +76,11 @@ exports[`Header 有 logo 1`] = `
aria-disabled="false"
aria-valuemax="-1"
aria-valuemin="-4"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left: 133.33333333333331%; transform: translateX(-50%);"
tabindex="0"
/>
<div
class="ant-slider-mark"
/>
</div>
</div>
</div>
Expand Down
Loading

1 comment on commit faf1cc3

@vercel
Copy link

@vercel vercel bot commented on faf1cc3 Oct 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.