Skip to content

Commit

Permalink
Merge pull request #410 from iwyvi/feature/v3
Browse files Browse the repository at this point in the history
Feature/v3
  • Loading branch information
keenwon authored Dec 22, 2022
2 parents df69255 + 7c049a5 commit fcdd026
Show file tree
Hide file tree
Showing 254 changed files with 13,682 additions and 13,584 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,3 @@ updates:
assignees:
- keenwon
versioning-strategy: increase
ignore:
# husky 3 以上对 git 版本有要求
- dependency-name: husky
versions: ">=3"

# fs-extra 10+ 要求 nodejs 12
- dependency-name: fs-extra
versions: ">=10"

# configstore 6+ 要求 nodejs 12
- dependency-name: configstore
versions: ">=6"
36 changes: 15 additions & 21 deletions .github/workflows/system_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,29 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['10', '16']
node_version: ['16', '18']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
- uses: pnpm/[email protected]
with:
node-version: ${{ matrix.node_version }}
version: 7.0.0

- name: get npm cache directory
id: npm-cache
- name: Setup git config
run: |
echo "::set-output name=dir::$(npm config get cache)"
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-system-test-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-system-test
- name: npm ci
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'

- name: install yarn # 全局安装 yarn
run: npm install -g yarn
- name: Install dependencies ignore scripts
run: pnpm install --ignore-scripts

- name: npm run test:system
run: npm run test:system
- name: Run system test
run: pnpm --filter elint run test:system
42 changes: 22 additions & 20 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,43 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['10', '16']
node_version: ['16', '18']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2

- uses: pnpm/[email protected]
with:
version: 7.0.0

- name: Setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'

- name: get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Install dependencies ignore scripts
run: pnpm install --ignore-scripts

- name: cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-unit-test-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-unit-test
- name: Build
run: pnpm run build

- name: npm ci
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Install dependencies
run: pnpm install

- name: npm run test:lint
run: npm run test:lint
- name: Run lint
run: pnpm run lint

- name: npm run test:unit
run: npm run test:unit
- name: Run unit test
run: pnpm --filter elint run test:unit

- name: Upload coverage to Codecov
if: matrix.node_version == 10 && matrix.os == 'ubuntu-latest'
if: matrix.node_version == 16 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
Expand Down
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
.vscode/
node_modules/
npm-debug.log
!test/unit/test-project/node_modules/
!**/test/unit/test-project/node_modules/
coverage/
.nyc_output/
**/*.tgz
dist
verdaccio/

/.husky
/.eslintrc.js
/.eslintignore
/.prettierrc.js
/.prettierignore
/.commitlintrc.js
/.stylelintrc.js
/.stylelintignore
7 changes: 0 additions & 7 deletions .huskyrc.js

This file was deleted.

24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contributing

## 依赖安装

使用 `pnpm` v7 安装依赖

```bash
# 第一次安装时忽略 scripts,因为 prepare 钩子会调用 elint 的方法
pnpm install --ignore-scripts

# 编译项目
pnpm run build

# 安装 git hooks,移动 lint 配置文件
pnpm install
```

## 运行

1. 使用编译后的 elint lint 项目本身 `pnpm run lint`
2. 运行 elint 源码 lint 项目本身 `pnpm run start`
3. 执行全部测试 `pnpm run test`
4. 执行 elint 单元测试 `pnpm --filter elint run test:unit`
5. 执行 elint 系统测试 `pnpm --filter elint run test:system`
Loading

0 comments on commit fcdd026

Please sign in to comment.