Skip to content

Commit

Permalink
🧱 feat: 升级基础设施
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 全量依赖大版本升级
  • Loading branch information
arvinxx committed Apr 21, 2023
1 parent a34ff1f commit 0f60411
Show file tree
Hide file tree
Showing 23 changed files with 103 additions and 23,733 deletions.
8 changes: 8 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'monorepo-template',
// 部署在非根目录时, base 和 publicPath 都需要配置
base: '/',
publicPath: '/',
});
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ lambda/mock/index.js
.temp/**

# umi
.umi
.umi-production
.dumi

# screenshot
screenshot
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
6 changes: 0 additions & 6 deletions .huskyrc

This file was deleted.

3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .npmrc
lockfile=false
resolution-mode=highest
29 changes: 0 additions & 29 deletions config/config.ts

This file was deleted.

1 change: 0 additions & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: 快速上手
order: 1
toc: menu
---

# 使用指南
Expand Down
106 changes: 35 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
"repository": "git+https://github.com/arvinxx/monorepo-template.git",
"license": "MIT",
"scripts": {
"start": "concurrently \"yarn api:dev\" \"yarn site:dev\"",
"build": "father-build && yarn build:webpack",
"build:webpack": "lerna run webpack",
"start": "concurrently \"npm run api:dev\" \"npm run site:dev\"",
"build": "father build",
"---------": "",
"release": "multi-semantic-release",
"--------- ": "",
"api:dev": "concurrently \"yarn api:watch\" \"yarn api:server\"",
"api:dev": "concurrently \"npm run api:watch\" \"npm run api:server\"",
"api:build": "typedoc",
"api:watch": "onchange 'packages/**/src/**/*.ts' -- npx typedoc",
"api:server": "serve apis",
Expand All @@ -31,8 +30,8 @@
"test:update": "lerna run test:update",
"test:coverage": "jest --coverage",
"--------- ": "",
"check": "yarn check:lint && yarn check:circular && yarn check:types",
"check:lint": "yarn lint-eslint",
"check": "npm run check:lint && npm run check:circular && npm run check:types",
"check:lint": "npm run lint-eslint",
"check:circular": "dpdm packages/**/*.ts --warning false --tree false --exit-code circular:1 -T true",
"check:types": "tsc -p tsconfig-check.json",
"lint-eslint": "eslint --cache --ext .ts,.tsx --format=pretty ./packages",
Expand All @@ -41,30 +40,19 @@
"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": "yarn clean && lerna clean && rm -rf node_modules && yarn",
"prepublishOnly": "yarn build",
"reinstall": "npm run clean && lerna clean && rm -rf node_modules && npm run",
"prepublishOnly": "npm run build",
"prettier": "prettier -c --write \"**/**\"",
"n": "ts-node"
},
"lint-staged": {
"**/*.less": "stylelint --syntax less",
"**/*.{js,jsx,tsx,ts,md,json}": [
"prettier --write",
"git add"
],
"**/*.{ts,tsx}": "npm run lint-staged:ts"
},
"devDependencies": {
"@ant-design/pro-skeleton": "^1.0.0-beta.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/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/release-notes-generator": "^9.0.1",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^10.0.2",
"@testing-library/react-hooks": "^3.2.1",
Expand All @@ -73,59 +61,35 @@
"@types/jest": "^26.0.0",
"@types/jsdom": "^16.2.3",
"@types/node": "^14.14.10",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.1",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/uuid": "^8.3.0",
"@umijs/fabric": "^2.2.2",
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.10",
"babel-loader": "^8.1.0",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-import": "^1.12.2",
"babel-plugin-module-resolver": "^4.1.0",
"commitlint": "^11.0.0",
"commitlint-config-cz": "^0.13.1",
"commitlint-config-gitmoji": "^2.2.1",
"concurrently": "^5.3.0",
"commitlint": "^17",
"commitlint-config-gitmoji": "^2",
"conventional-changelog-gitmoji-config": "^1.4.0",
"cross-env": "^7.0.0",
"dpdm": "^3.5.0",
"dumi": "^1.1.0",
"enzyme-to-json": "^3.4.3",
"eslint": "^7.7.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^2.2.1",
"father-build": "^1.18.1",
"fs-extra": "^9.0.1",
"gh-pages": "^3.1.0",
"husky": "^4.0.0",
"jest": "^26.4.2",
"lerna": "^3.22.1",
"less-loader": "^6.0.0",
"lint-staged": "^10.0.2",
"mini-css-extract-plugin": "^0.9.0",
"multi-semantic-release": "^2.6.0",
"onchange": "^7.1.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"prettier": "^2.1.2",
"progress-bar-webpack-plugin": "^2.1.0",
"semantic-release": "^17.3.7",
"serve": "^11.3.2",
"stylelint": "^13.0.0",
"terser-webpack-plugin": "^3.0.2",
"tplant": "^2.3.6",
"ts-jest": "^26.4.4",
"ts-node": "^9.1.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.20.13",
"typescript": "^4.1.3",
"umi": "^3.0.0",
"utility-types": "^3.10.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^3.3.12"
},
"engines": {
"node": ">=8.0.0"
"concurrently": "^7",
"cross-env": "^7",
"dumi": "^2.1.21",
"dumi-theme-antd-style": "latest",
"dumi-assets-types": "^1",
"dpdm": "^3",
"eslint": "^8",
"father": "^4",
"husky": "^8",
"jsdom": "^21",
"lint-staged": "^13",
"onchange": "^7",
"prettier": "^2",
"prettier-plugin-organize-imports": "^3",
"prettier-plugin-packagejson": "^2",
"react": "^18",
"react-dom": "^18",
"multi-semantic-release": "^3",
"semantic-release": "^20",
"semantic-release-config-gitmoji": "^1",
"stylelint": "^14",
"typedoc": "^0.24",
"typescript": "^5",
"vitest": "latest"
}
}
7 changes: 0 additions & 7 deletions packages/bar/.fatherrc.js

This file was deleted.

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

export default defineConfig({
esm: { output: 'es' },
cjs: { output: 'lib' },
});
12 changes: 6 additions & 6 deletions packages/bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"@arvinxu/foo": "1.1.0"
},
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
"react": "^18",
"react-dom": "^18"
},
"scripts": {
"build": "father-build",
"webpack": "webpack",
"test": "jest",
"test:update": "jest -u",
"build": "father build",
"test": "vitest",
"test:update": "vitest -u",
"cov": "jest --coverage",
"doctor": "father doctor",
"clean": "rm -rf es lib dist build coverage .umi"
}
}
3 changes: 3 additions & 0 deletions packages/bar/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '../../vitest.config.base';

export default config;
20 changes: 0 additions & 20 deletions packages/bar/webpack.config.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/foo/.fatherrc.js

This file was deleted.

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

export default defineConfig({
esm: { output: 'es' },
cjs: { output: 'lib' },
});
16 changes: 8 additions & 8 deletions packages/foo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"access": "public"
},
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
"react": "^18",
"react-dom": "^18"
},
"scripts": {
"build": "father-build",
"webpack": "webpack",
"test": "jest",
"test:update": "jest -u",
"cov": "jest --coverage",
"clean": "rm -rf es lib dist build coverage .umi"
"build": "father build",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:update": "vitest -u",
"doctor": "father doctor",
"clean": "rm -rf es lib dist build coverage .dumi"
}
}
15 changes: 0 additions & 15 deletions packages/foo/webpack.config.js

This file was deleted.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- 'packages/**'
Empty file added tests/test-setup.ts
Empty file.
17 changes: 17 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from 'vitest/config';
import { join } from 'path';

export default defineConfig({
esbuild: {
jsxInject: "import React from 'react'",
},
test: {
setupFiles: './tests/test-setup.ts',
environment: 'jsdom',
globals: true,
alias: {
'@arvinxu/foo': join(__dirname, '/packages/foo/src'),
'@arvinxu/bar': join(__dirname, '/packages/bar/src'),
},
},
});
Loading

0 comments on commit 0f60411

Please sign in to comment.