Skip to content

Commit 8a4244b

Browse files
committed
feat(): upgrade to react 19
BREAKING CHANGE: upgrade to react 19
0 parents  commit 8a4244b

File tree

90 files changed

+17347
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+17347
-0
lines changed

.easyops-yo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"usePublicScope": true
3+
}

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.{md,snap}]
11+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
/sdk

.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"root": true,
3+
"extends": "@next-core/eslint-config-next",
4+
"overrides": [
5+
{
6+
"files": [
7+
"packages/yo/**/*.js"
8+
],
9+
"extends": "@next-core/eslint-config-next/node"
10+
}
11+
]
12+
}

.github/pull_request_template.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## 依赖检查
2+
3+
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
4+
5+
请勾选以下两组选项其中之一:
6+
7+
- [ ] 本次 MR **没有使用**上游组件(例如框架、后台组件等)的较新版本提供的特性。
8+
9+
或者:
10+
11+
- [ ] 本次 MR **使用了**上游组件(例如框架、后台组件等)的较新版本提供的特性。
12+
- [ ] 在对应的文件中更新了该上游组件的依赖版本(或确认了当前声明的依赖版本已包含本次 MR 使用的新特性)。
13+
14+
## 提交信息检查
15+
16+
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
17+
18+
> 破坏性变更是针对于下游使用者而言,可以通过本次改动对下游使用者的影响来识别变更类型:
19+
>
20+
> - 下游使用者不做任何改动,仍可以正常工作时,那么它属于普通变更。
21+
> - 反之,下游使用者不做改动就无法正常工作时,那么它属于破坏性变更。
22+
>
23+
> 例如,构件修改了一个属性名,小产品 Storyboard 中需要使用新属性名才能工作,那么它就是破坏性变更。
24+
> 又例如,构件还没有任何下游使用者,那么它的任何变更都是普通变更。
25+
26+
### 破坏性变更:
27+
28+
- [ ] ⚠️ 本次 MR 包含**破坏性变更**的提交,请继续确认以下所有选项:
29+
- [ ] 没有更好的兼容方案,必须做破坏性变更。
30+
- [ ] 使用了 `feat` 作为提交类型。
31+
- [ ] 标注了 `BREAKING CHANGE: 你的变更说明`
32+
- [ ] 同时更新了本仓库中所有下游使用者的调用。
33+
- [ ] 同时更新了本仓库中所有下游使用者对该子包的依赖为即将发布的 major 版本。
34+
- [ ] 同时为其它仓库的 Migrating 做好了准备,例如文档或批量改动的方法。
35+
- [ ] 手动验证过破坏性变更在 Migrate 后可以正常工作。
36+
- [ ] 破坏性变更所在的提交没有意外携带其它子包的改动。
37+
38+
### 新特性:
39+
40+
- [ ] 本次 MR 包含新特性的提交,且该提交不带有破坏性变更,并使用了 `feat` 作为提交类型。
41+
- [ ] 给新特性添加了单元测试。
42+
- [ ] 手动验证过新特性可以正常工作。
43+
44+
### 问题修复:
45+
46+
- [ ] 本次 MR 包含问题修复的提交,且该提交不带有新特性或破坏性变更,并使用了 `fix` 作为提交类型。
47+
- [ ] 给问题修复添加了单元测试。
48+
- [ ] 手动验证过问题修复得到解决。
49+
50+
### 杂项工作:
51+
52+
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
53+
54+
- [ ] 本次 MR 包含杂项工作的提交,且该提交不带有问题修复、新特性或破坏性变更,并使用了 `chore`, `docs`, `test` 等作为提交类型。
55+
56+
<!-- ## 简单描述
57+
58+
<!-- 我在这个 MR 里都做了哪些工作?!-->
59+
60+
<!-- ## Todo
61+
62+
<!-- 我还有哪些事情没做?!-->

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
- renovate/*
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [20.x]
20+
21+
steps:
22+
- name: Setup timezone
23+
uses: zcong1993/setup-timezone@master
24+
with:
25+
timezone: Asia/Shanghai
26+
27+
- uses: actions/checkout@v4
28+
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
registry-url: 'https://registry.npmjs.org'
34+
35+
- name: Get yarn cache directory path
36+
id: yarn-cache-dir-path
37+
run: echo "::set-output name=dir::$(yarn cache dir)"
38+
39+
- name: Cache for yarn
40+
uses: actions/cache@v4
41+
with:
42+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43+
key: node-cache-${{ runner.os }}-yarn-master-${{ hashFiles('yarn.lock') }}
44+
restore-keys: |
45+
node-cache-${{ runner.os }}-yarn-master-
46+
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref_name == 'master')
47+
48+
- name: Cache for nx (master)
49+
uses: actions/cache@v4
50+
with:
51+
save-always: true
52+
path: .cache
53+
key: ${{ runner.os }}-nx-master-${{ hashFiles('yarn.lock', 'package.json') }}-${{ hashFiles('**/package.json') }}
54+
restore-keys: |
55+
${{ runner.os }}-nx-master-${{ hashFiles('yarn.lock', 'package.json') }}-
56+
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref_name == 'master')
57+
58+
# Fix `yarn install --frozen-lockfile` not working in monorepo.
59+
# https://github.com/yarnpkg/yarn/issues/5840#issuecomment-468782288
60+
- name: Get checksum before yarn install
61+
id: yarn-lock-check-before
62+
run: echo "::set-output name=sum::$(cksum yarn.lock)"
63+
64+
- run: yarn install --frozen-lockfile
65+
66+
- name: Get checksum after yarn install
67+
id: yarn-lock-check-after
68+
run: echo "::set-output name=sum::$(cksum yarn.lock)"
69+
70+
- name: Exit if yarn.lock updated
71+
run: exit 1
72+
if: steps.yarn-lock-check-before.outputs.sum != steps.yarn-lock-check-after.outputs.sum
73+
74+
- run: yarn build --concurrency 1
75+
env:
76+
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0'
77+
- run: yarn test:ci
78+
env:
79+
NX_REJECT_UNKNOWN_LOCAL_CACHE: '0'
80+
81+
- name: Get coverage files
82+
run: |
83+
echo "COVERAGE_FILES=$(find ./packages -maxdepth 1 -mindepth 1 -type d -exec echo "{}/.coverage/cobertura-coverage.xml" \; | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
84+
85+
- name: Codecov
86+
uses: codecov/codecov-action@v4
87+
with:
88+
token: ${{ secrets.CODECOV_TOKEN }}
89+
files: ${{ env.COVERAGE_FILES }}
90+
disable_search: true
91+
92+
- id: next-publish-from-tags
93+
uses: easyops-cn/actions-next-publish-from-tags@master
94+
with:
95+
npm-token: ${{ secrets.NPM_TOKEN }}
96+
if: github.event_name == 'push' && github.ref_name == 'master'
97+
98+
- name: Sync taobao npm mirror
99+
run: npx lerna exec -- curl -sLX PUT 'https://registry-direct.npmmirror.com/-/package/$LERNA_PACKAGE_NAME/syncs'
100+
if: github.event_name == 'push' && github.ref_name == 'master' && steps.next-publish-from-tags.outputs.has-tags
101+
continue-on-error: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: cleanup caches by a branch
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
13+
14+
- name: Cleanup
15+
run: |
16+
gh extension install actions/gh-actions-cache
17+
18+
echo "Fetching list of cache key"
19+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
20+
21+
## Setting this to not fail the workflow while deleting cache keys.
22+
set +e
23+
echo "Deleting caches..."
24+
for cacheKey in $cacheKeysForPR
25+
do
26+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
27+
done
28+
echo "Done"
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
REPO: ${{ github.repository }}
32+
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lerna version
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [20.x]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
token: ${{ secrets.GH_TOKEN_EVE }}
18+
fetch-depth: 0
19+
20+
- run: |
21+
git config --global user.name 'easyops-eve'
22+
git config --global user.email 'easyops-eve@users.noreply.github.com'
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
29+
- name: Lerna Version
30+
run: npx lerna version --yes --conventional-commits --create-release github
31+
env:
32+
GH_TOKEN: ${{ secrets.GH_TOKEN_EVE }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release after merged
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches: [master, v3]
7+
8+
jobs:
9+
release:
10+
11+
runs-on: ubuntu-latest
12+
13+
# Only if it is merged and contains a certain label.
14+
if: |
15+
github.event.pull_request.merged &&
16+
contains( github.event.pull_request.labels.*.name, 'eve: release after merged')
17+
18+
steps:
19+
20+
- name: Trigger lerna version
21+
uses: actions/github-script@v7
22+
with:
23+
github-token: ${{ secrets.GH_TOKEN_EVE }}
24+
script: |
25+
github.rest.actions.createWorkflowDispatch({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
workflow_id: 'lerna-version.yml',
29+
ref: context.payload.pull_request.base.ref,
30+
})

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
dist
2+
dist-*
3+
temp
4+
node_modules
5+
.coverage
6+
.vscode
7+
.idea
8+
.DS_Store
9+
.schema
10+
.cache
11+
.nx
12+
*.log
13+
report.*.json
14+
15+
/dev.config.js
16+
/dev.config.mjs
17+
/dev-settings.yaml
18+
/dev-https.key
19+
/dev-https.cert
20+
21+
/cypress/videos
22+
/cypress/screenshots
23+
24+
/bricks/*/.pkgbuild/
25+
/bricks/*/deploy/

0 commit comments

Comments
 (0)