Skip to content

Commit

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

export default defineConfig({
title: 'monorepo-template',
// 部署在非根目录时, base 和 publicPath 都需要配置
base: '/',
publicPath: '/',
themeConfig: {
name: '@arvinxx/monorepo-template',
},
});
26 changes: 1 addition & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
page: true,
},
rules: {
'import/no-extraneous-dependencies': 0,
'import/default': 0,
'import/no-named-default': 0,
'import/no-unresolved': 0,
'import/no-named-as-default-member': 0,
'import/named': 0,
'no-param-reassign': 0,
'consistent-return': 0,
'no-useless-return': 0,
'no-restricted-globals': 0,
'no-continue': 0,
'no-shadow': 'warn',
'no-console': 0,
'no-underscore-dangle': 0,
'@typescript-eslint/consistent-type-definitions': 0,
'@typescript-eslint/no-shadow': 0,
},
ignorePatterns: ['*.js'],
};
module.exports = require('@umijs/lint/dist/config/eslint');
7 changes: 0 additions & 7 deletions .fatherrc.js

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/auto-merge.yml

This file was deleted.

33 changes: 22 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,38 @@ on:
push:
branches:
- master
- beta

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
- uses: actions/checkout@v3

- name: ⚙ 设置 pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: 🏗 准备 Node.js 环境
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'

- uses: c-hive/gha-yarn-cache@v1
- name: 🗳 安装依赖
run: pnpm install

- name: install
run: yarn
- name: 📦 构建 npm 包
run: pnpm run build

- name: Test
run: yarn test
# npm 8 和 9 会在 `npm version` 时执行依赖树命令,进而报错退出
# Refs: https://github.com/semantic-release/npm/issues/540
- name: Setup npm 7
run: npm i -g npm@7 --registry=https://registry.npmjs.org

- name: Release
- name: 🚀 npm 包发布
run: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
25 changes: 14 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
- name: ⚙ 设置 pnpm
uses: pnpm/action-setup@v2
with:
node-version: '14'
version: latest

- uses: c-hive/gha-yarn-cache@v1
- name: 🏗 准备 Node.js 环境
uses: actions/setup-node@v3
with:
node-version: '16'

- name: install
run: yarn
- name: 🗳 安装依赖
run: pnpm install

- name: test
run: yarn test:coverage
- name: ✅ 测试检查
run: pnpm run test:coverage

- name: Generate coverage
run: bash <(curl -s https://codecov.io/bash)
- name: ⬆️上传至 Codecov
uses: codecov/codecov-action@v3
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
13 changes: 0 additions & 13 deletions jest.config.base.js

This file was deleted.

9 changes: 0 additions & 9 deletions jest.config.js

This file was deleted.

Loading

1 comment on commit a7ed506

@vercel
Copy link

@vercel vercel bot commented on a7ed506 Apr 21, 2023

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.