Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
weareoutman committed Mar 27, 2023
0 parents commit 98b5282
Show file tree
Hide file tree
Showing 23 changed files with 8,387 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .easyops-yo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"usePublicScope": true
}
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{md,snap}]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"extends": "@next-core/eslint-config-next",
"overrides": [
{
"files": [
"bricks/*/scripts/**/*.js"
],
"extends": "@next-core/eslint-config-next/node"
}
]
}
62 changes: 62 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## 依赖检查

组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。

请勾选以下两组选项其中之一:

- [ ] 本次 MR **没有使用**上游组件(例如框架、后台组件等)的较新版本提供的特性。

或者:

- [ ] 本次 MR **使用了**上游组件(例如框架、后台组件等)的较新版本提供的特性。
- [ ] 在对应的文件中更新了该上游组件的依赖版本(或确认了当前声明的依赖版本已包含本次 MR 使用的新特性)。

## 提交信息检查

Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。

> 破坏性变更是针对于下游使用者而言,可以通过本次改动对下游使用者的影响来识别变更类型:
>
> - 下游使用者不做任何改动,仍可以正常工作时,那么它属于普通变更。
> - 反之,下游使用者不做改动就无法正常工作时,那么它属于破坏性变更。
>
> 例如,构件修改了一个属性名,小产品 Storyboard 中需要使用新属性名才能工作,那么它就是破坏性变更。
> 又例如,构件还没有任何下游使用者,那么它的任何变更都是普通变更。
### 破坏性变更:

- [ ] ⚠️ 本次 MR 包含**破坏性变更**的提交,请继续确认以下所有选项:
- [ ] 没有更好的兼容方案,必须做破坏性变更。
- [ ] 使用了 `feat` 作为提交类型。
- [ ] 标注了 `BREAKING CHANGE: 你的变更说明`
- [ ] 同时更新了本仓库中所有下游使用者的调用。
- [ ] 同时更新了本仓库中所有下游使用者对该子包的依赖为即将发布的 major 版本。
- [ ] 同时为其它仓库的 Migrating 做好了准备,例如文档或批量改动的方法。
- [ ] 手动验证过破坏性变更在 Migrate 后可以正常工作。
- [ ] 破坏性变更所在的提交没有意外携带其它子包的改动。

### 新特性:

- [ ] 本次 MR 包含新特性的提交,且该提交不带有破坏性变更,并使用了 `feat` 作为提交类型。
- [ ] 给新特性添加了单元测试。
- [ ] 手动验证过新特性可以正常工作。

### 问题修复:

- [ ] 本次 MR 包含问题修复的提交,且该提交不带有新特性或破坏性变更,并使用了 `fix` 作为提交类型。
- [ ] 给问题修复添加了单元测试。
- [ ] 手动验证过问题修复得到解决。

### 杂项工作:

即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:

- [ ] 本次 MR 包含杂项工作的提交,且该提交不带有问题修复、新特性或破坏性变更,并使用了 `chore`, `docs`, `test` 等作为提交类型。

<!-- ## 简单描述
<!-- 我在这个 MR 里都做了哪些工作?!-->

<!-- ## Todo
<!-- 我还有哪些事情没做?!-->
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: yarn

- name: Cache nx cache
uses: actions/cache@v3
with:
path: .cache
key: ${{ runner.os }}-nx-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-nx-
# Fix `yarn install --frozen-lockfile` not working in monorepo.
# https://github.com/yarnpkg/yarn/issues/5840#issuecomment-468782288
- name: Get checksum before yarn install
id: yarn-lock-check-before
run: echo "::set-output name=sum::$(cksum yarn.lock)"

- run: yarn install --frozen-lockfile

- name: Get checksum after yarn install
id: yarn-lock-check-after
run: echo "::set-output name=sum::$(cksum yarn.lock)"

- name: Exit if yarn.lock updated
run: exit 1
if: steps.yarn-lock-check-before.outputs.sum != steps.yarn-lock-check-after.outputs.sum

- run: yarn build
# - run: yarn test:ci

# - name: Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# directory: bricks

- uses: easyops-cn/actions-next-publish-from-tags@master
with:
npm-token: ${{ secrets.NPM_TOKEN }}
if: github.event_name == 'push'
30 changes: 30 additions & 0 deletions .github/workflows/lerna-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lerna version

on: workflow_dispatch

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN_EVE }}
fetch-depth: 0

- run: |
git config --global user.name 'easyops-eve'
git config --global user.email 'easyops-eve@users.noreply.github.com'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Lerna Version
run: npx lerna version --yes
29 changes: 29 additions & 0 deletions .github/workflows/release-after-merged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release after merged

on:
pull_request:
types: [closed]

jobs:
release:

runs-on: ubuntu-latest

# Only if it is merged and contains a certain label.
if: |
github.event.pull_request.merged &&
contains( github.event.pull_request.labels.*.name, 'eve: release after merged')
steps:

- name: Trigger lerna version
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN_EVE }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'lerna-version.yml',
ref: 'master',
})
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
dist
dist-*
node_modules
.coverage
.vscode
.idea
.DS_Store
.schema
.cache
*.log
report.*.json

/dev.config.js
/dev-settings.yaml
/dev-https.key
/dev-https.cert

/cypress/videos
/cypress/screenshots
10 changes: 10 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"*.{js,ts,jsx,tsx}": [
"cross-env ESLINT_ENV='production' eslint --fix --quiet",
"prettier --write"
],
"*.css": "prettier --write",
"*.html": "prettier --write",
"*.md": "prettier --write",
"*.json": "prettier --write"
}
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry=https://registry.npmjs.org
tag-version-prefix=
access=public
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
Loading

0 comments on commit 98b5282

Please sign in to comment.