Skip to content

Commit

Permalink
chore(deps): update dependency rollup to v4 (#216)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency rollup to v4

* chore(deps): update dependency rollup to v4

* build: upgrade rollup4

* refactor: vitest replace jest

* ci: add compatibility for Yarn 4

* chore: modify yarn.lock

* chore: ignore unhandled vitest errors

* style: compatible with yjs tsconfig

* refactor:  refactor test、build depts
- use turbo build
- use vitest replace jest
- delete unuse config\dept

* test: coverage testing with c8

* chore: revert some eslint rule

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: cycleccc <[email protected]>
  • Loading branch information
renovate[bot] and cycleccc authored Oct 8, 2024
1 parent 1f42f9c commit 74ccf09
Show file tree
Hide file tree
Showing 93 changed files with 28,501 additions and 20,693 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
},
globals: {
globalThis:'readonly',
vi: "readonly"
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
Expand Down
68 changes: 44 additions & 24 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# github actions 中文文档 https://docs.github.com/cn/actions/getting-started-with-github-actions

name: coverage test
name: coverage test

on:
push:
Expand All @@ -18,22 +14,46 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.com
- name: Install dependencies
run: yarn install
- name: Build packages
run: yarn build
- name: Unit test
run: yarn run test-c
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
# 检出代码库
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# 设置 Node.js 版本
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.com

# 启用 Corepack 以支持 Yarn 4
- name: Enable Corepack
run: corepack enable

# 准备 Yarn 4.x
- name: Prepare Yarn
run: corepack prepare [email protected] --activate

# 安装依赖
- name: Install dependencies
run: yarn install

# 构建项目
- name: Build packages
run: yarn build

# 运行单元测试并生成覆盖率报告
- name: Unit test
run: yarn run test-c

# 上传覆盖率报告到 Codecov
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
48 changes: 30 additions & 18 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# github actions 中文文档 https://docs.github.com/cn/actions/getting-started-with-github-actions

name: Cypress tests

on:
Expand Down Expand Up @@ -31,21 +27,37 @@ on:
jobs:
test-e2e:
runs-on: ubuntu-latest
container:
container:
image: cypress/browsers:latest
options: --user 1001
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
- uses: actions/checkout@v4

# 设置 Node.js 版本
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: yarn install
- name: Build packages
run: yarn build
- uses: cypress-io/github-action@v6
with:
browser: chrome
start: yarn run example
wait-on: 'http://localhost:8881/examples/default-mode.html'

# 启用 Corepack
- name: Enable Corepack
run: corepack enable

# 安装并激活 Yarn 4.x
- name: Prepare Yarn
run: corepack prepare [email protected] --activate

# 安装项目依赖
- name: Install dependencies
run: yarn install

# 构建项目
- name: Build packages
run: yarn build

# 运行 Cypress 测试
- uses: cypress-io/github-action@v6
with:
browser: chrome
start: yarn run example
wait-on: 'http://localhost:8881/examples/default-mode.html'
33 changes: 19 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,28 @@ jobs:
node-version: [18]

steps:
# 检出代码库
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# 设置 Node.js 版本
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4

with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'

# 启用 Corepack 以支持 Yarn 4
- name: Enable Corepack
run: corepack enable

# 准备 Yarn 4.x
- name: Prepare Yarn
run: corepack prepare [email protected] --activate

# 加载依赖缓存
- name: Load cached dependencies
uses: actions/[email protected]
id: cache
Expand All @@ -48,32 +58,27 @@ jobs:
/home/runner/.cache/Cypress
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

# 安装依赖
- name: Install dependencies
run: yarn install

# - name: Load cached dependencies
# uses: actions/[email protected]
# id: cache
# with:
# path: |
# **/node_modules
# **/.turbo
# /home/runner/.cache/Cypress
# key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Dependencies
# 构建项目
- name: Build packages
run: yarn build

# 运行单元测试
- name: Unit test
run: yarn run test
run: yarn run test

# 运行 E2E 测试
- name: E2E test
uses: cypress-io/github-action@v6
with:
browser: chrome
start: yarn run example
wait-on: 'http://localhost:8881/examples/default-mode.html'

# 创建 Release PR 或发布稳定版本到 npm
- name: Create Release PR or publish stable version to npm
id: changesets
uses: changesets/action@v1
Expand All @@ -85,4 +90,4 @@ jobs:
${{ github.ref_name == 'master' && 'chore(release): publish a new release version' || 'chore(release): publish a new pre-release version' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54 changes: 34 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# github actions 中文文档 https://docs.github.com/cn/actions/getting-started-with-github-actions

name: unit test
name: Unit Test

on:
push:
Expand All @@ -29,19 +25,37 @@ on:
jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.com
- name: Install dependencies
run: yarn install
- name: Build packages
run: yarn build
- name: Unit test
run: yarn run test
# 检出代码库
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# 设置 Node.js 版本
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.com

# 启用 Corepack 以支持 Yarn 4
- name: Enable Corepack
run: corepack enable

# 准备 Yarn 4.x
- name: Prepare Yarn
run: corepack prepare [email protected] --activate

# 安装依赖
- name: Install dependencies
run: yarn install

# 构建项目
- name: Build packages
run: yarn build

# 运行单元测试
- name: Unit test
run: yarn run test
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ typings/

# Yarn Integrity file
.yarn-integrity
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# dotenv environment variables file
.env
Expand Down Expand Up @@ -127,4 +134,4 @@ stats.html


# Turbo cache
.turbo
.turbo
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint:staged
yarn lint:staged
File renamed without changes.
29 changes: 0 additions & 29 deletions .vscode/launch.json

This file was deleted.

2 changes: 0 additions & 2 deletions .yarnrc

This file was deleted.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org/"
Loading

0 comments on commit 74ccf09

Please sign in to comment.