From 5db92c8cb28cee2d7d707d1c45596441a44b4e48 Mon Sep 17 00:00:00 2001
From: Wenjun Xu <906626481@qq.com>
Date: Mon, 9 Jan 2023 18:12:36 +0800
Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BD=BF=E7=94=A8=20pnpm=20=E4=BD=9C?=
=?UTF-8?q?=E4=B8=BA=E5=8C=85=E7=AE=A1=E7=90=86=E5=99=A8=20(#2027)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* chore: 使用 pnpm 替换 yarn
* refactor: 更新 validate-deps 路径
* chore: 替换子包中 package.json 脚本
* chore: 更新 g-lite 版本
* chore: 替换根目录中 package.json 配置
* chore: 更新 github action
* chore: 修复 s2-react 层依赖问题
* chore: 将 s2-site 加入 workspace
* chore: 删除 lerna 相关配置
* chore: 修复 lint fix 传参方式
* chore: 处理幽灵依赖
* test: 修复 antd 升级后的单测问题
* chore: 取消 test 脚本并行
* test: 修复单测
* chore: 修复 compressed action 报错
* docs: 更新贡献文档
* revert: revert clean script
* fix: 修复 jest-less-loader 测试时无法找到 node_modules 样式文件问题
* chore: 更新 pnpm-lock
* chore: 简化 bump-version 命令
---
.github/workflows/auto-release.yml | 12 +-
.github/workflows/compressed-size.yml | 6 +-
.github/workflows/lint.yml | 14 +-
.github/workflows/release-success.yml | 25 +-
.github/workflows/test.yml | 12 +-
.husky/pre-push | 2 +-
.npmrc | 2 +
.yarnrc | 7 -
README.en-US.md | 19 +-
README.md | 19 +-
lerna.json | 38 -
package.json | 108 +-
packages/s2-core/README.en-US.md | 25 +-
packages/s2-core/README.md | 34 +-
packages/s2-core/package.json | 17 +-
.../__snapshots__/pagination-spec.tsx.snap | 3 -
.../spreadsheet/table-sheet-spec.tsx | 2 +-
.../__snapshots__/index-spec.tsx.snap | 1 -
.../sheets/__snapshots__/index-spec.tsx.snap | 5 -
packages/s2-react/package.json | 23 +-
packages/s2-shared/package.json | 6 +-
packages/s2-vue/package.json | 16 +-
pnpm-lock.yaml | 22978 ++++++++++++++++
pnpm-workspace.yaml | 3 +
s2-site/docs/common/development.en.md | 34 +-
s2-site/docs/common/development.zh.md | 23 +-
s2-site/docs/manual/contribution.en.md | 25 +-
s2-site/docs/manual/contribution.zh.md | 25 +-
s2-site/package.json | 5 +-
...latest-bump-version.js => bump-version.js} | 6 +-
scripts/validate-deps.js | 55 -
yarn.lock | 16538 -----------
32 files changed, 23227 insertions(+), 16861 deletions(-)
delete mode 100644 .yarnrc
delete mode 100644 lerna.json
create mode 100644 pnpm-lock.yaml
create mode 100644 pnpm-workspace.yaml
rename scripts/{latest-bump-version.js => bump-version.js} (65%)
delete mode 100644 scripts/validate-deps.js
delete mode 100644 yarn.lock
diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml
index e3dd88b922..b78bac4baa 100644
--- a/.github/workflows/auto-release.yml
+++ b/.github/workflows/auto-release.yml
@@ -21,11 +21,15 @@ jobs:
with:
python-version: '3.10'
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 7
+
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16 # semantic-release 需要 >= 16 的 Node.js 环境
- cache: 'yarn'
+ cache: 'pnpm'
# 发布开始通知
- name: Release start ding talk dev group notify
@@ -45,10 +49,10 @@ jobs:
}
- name: Install dependencies
- run: yarn
+ run: pnpm bootstrap
- name: Build
- run: yarn build
+ run: pnpm build
# 自动发布完成后 触发 github.release.published 事件
# 如果是 action 自带的 机器人 token, 出于安全考虑, github 会禁止循环触发, 使用真实用户的 token 可解决这个问题
@@ -57,7 +61,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.JINKE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
npm_config_legacy_peer_deps: true
- run: yarn release
+ run: pnpm release
# 发布失败通知内部开发群
- name: Release failed ding talk dev group notify
diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml
index bec0742878..ee7b677838 100644
--- a/.github/workflows/compressed-size.yml
+++ b/.github/workflows/compressed-size.yml
@@ -19,9 +19,13 @@ jobs:
with:
python-version: '3.10'
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 7
+
- uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pattern: "./packages/**/dist/**/*.{js,css}"
build-script: "build:umd"
- # clean-script: "clean:lock-file"
+ clean-script: "clean"
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 505194ee85..63f6b2710e 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -24,23 +24,27 @@ jobs:
with:
python-version: '3.10'
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 7
+
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- cache: 'yarn'
+ cache: 'pnpm'
- name: Install dependencies
- run: yarn
+ run: pnpm bootstrap
- name: Lint scripts, type, style and docs
- run: yarn lint
+ run: pnpm lint
- name: Build
- run: yarn build
+ run: pnpm build
- name: Bundle size
- run: yarn bundle:size
+ run: pnpm bundle:size
env:
CI: true
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}
diff --git a/.github/workflows/release-success.yml b/.github/workflows/release-success.yml
index 48ecc6ed71..9e110c8ddf 100644
--- a/.github/workflows/release-success.yml
+++ b/.github/workflows/release-success.yml
@@ -13,15 +13,12 @@ jobs:
runs-on: ubuntu-latest
# 自动发布成功后
if: github.event.workflow_run.conclusion == 'success'
+ defaults:
+ run:
+ working-directory: s2-site
steps:
- uses: actions/checkout@v3
- - name: Use Node.js 16
- uses: actions/setup-node@v3
- with:
- node-version: 16
- cache: 'yarn'
-
- name: Git bootstrap
run: |
git config --global user.name 'Jinke Li'
@@ -50,7 +47,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.JINKE_GITHUB_TOKEN }}
# 开始部署官网
- - name: 🔊 Delpoy start notify
+ - name: 🔊 Deploy start notify
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
@@ -66,16 +63,22 @@ jobs:
}
}
+ - name: Use Node.js 16
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+ cache: 'yarn'
+
# 安装官网依赖
- name: Install Dependencies
- run: yarn site:bootstrap
+ run: yarn
# 部署官网
- - name: Delpoy Site
- run: yarn site:deploy
+ - name: Deploy Site
+ run: yarn deploy
# 失败通知
- - name: 🔊 Delpoy failed notify
+ - name: 🔊 Deploy failed notify
if: ${{ failure() }}
uses: zcong1993/actions-ding@master
with:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d2d2bdec5e..da20e07a4a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -26,18 +26,22 @@ jobs:
with:
python-version: '3.10'
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 7
+
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- cache: 'yarn'
+ cache: 'pnpm'
- name: Install dependencies
- run: yarn
+ run: pnpm bootstrap
- name: Test
run: |
- yarn test:ci-coverage
+ pnpm test:ci-coverage
- name: Upload test coverage
uses: codecov/codecov-action@v2
@@ -67,7 +71,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
labels: '🚨 test failed'
-
+
- name: Remove test failed label
if: ${{ success() && github.event.pull_request.number != '' }}
uses: actions-cool/issues-helper@main
diff --git a/.husky/pre-push b/.husky/pre-push
index 04c19268ba..68c17e3e60 100755
--- a/.husky/pre-push
+++ b/.husky/pre-push
@@ -2,4 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"
. "$(dirname -- "$0")/common.sh"
-yarn validate:deps && yarn lint:type
+yarn lint:type
diff --git a/.npmrc b/.npmrc
index 7893a764c1..baafe6f833 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1 +1,3 @@
npm_config_legacy_peer_deps=true
+side-effects-cache=false
+prefer-workspace-packages=true
diff --git a/.yarnrc b/.yarnrc
deleted file mode 100644
index 32b9dbf74c..0000000000
--- a/.yarnrc
+++ /dev/null
@@ -1,7 +0,0 @@
-registry "https://registry.npm.taobao.org"
-sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
-phantomjs_cdnurl "http://cnpmjs.org/downloads"
-electron_mirror "https://npm.taobao.org/mirrors/electron/"
-sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
-profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
-chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"
\ No newline at end of file
diff --git a/README.en-US.md b/README.en-US.md
index 166fd4efca..30039d76d5 100644
--- a/README.en-US.md
+++ b/README.en-US.md
@@ -187,34 +187,35 @@ s2.render();
Contributions, issues and feature requests are welcome.
Feel free to check [issues](https://github.com/antvis/S2/issues) page if you want to contribute.
+> S2 use pnpm as package manager
+
```bash
git clone git@github.com:antvis/S2.git
cd S2
-yarn # or yarn bootstrap
+pnpm install # or pnpm bootstrap
# build all
-yarn build
+pnpm build
# debug s2-core
-yarn core:start
+pnpm core:start
# debug s2-react
-yarn react:playground
+pnpm react:playground
# debug s2-vue
-yarn vue:playground
+pnpm vue:playground
# unit test
-yarn test
+pnpm test
# check the code style and the type definition
-yarn lint
+pnpm lint
# start the website
-yarn site:bootstrap
-yarn site:start
+pnpm site:start
```
## 👁️ Insight
diff --git a/README.md b/README.md
index d636c4b73d..4fe19ac9d4 100644
--- a/README.md
+++ b/README.md
@@ -180,35 +180,36 @@ s2.render();
## 🤝 参与贡献
+> S2 使用 pnpm 作为包管理器
+
```bash
git clone git@github.com:antvis/S2.git
cd S2
# 安装依赖
-yarn # 或者 yarn bootstrap
+pnpm install # 或者 pnpm bootstrap
# 打包
-yarn build
+pnpm build
# 调试 s2-core
-yarn core:start
+pnpm core:start
# 调试 s2-react
-yarn react:playground
+pnpm react:playground
# 调试 s2-vue
-yarn vue:playground
+pnpm vue:playground
# 单元测试
-yarn test
+pnpm test
# 代码风格和类型检测
-yarn lint
+pnpm lint
# 本地启动官网
-yarn site:bootstrap
-yarn site:start
+pnpm site:start
```
## 👁️ 洞察
diff --git a/lerna.json b/lerna.json
deleted file mode 100644
index 3bc34f0003..0000000000
--- a/lerna.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "version": "independent",
- "npmClient": "yarn",
- "useWorkspaces": true,
- "command": {
- "publish": {
- "ignoreChanges": [
- "*.md",
- "**/_tests_/**"
- ],
- "message": "chore(release): :bookmark: publish the new version [skip ci]"
- },
- "bootstrap": {
- "npmClientArgs": [
- "--no-ci"
- ]
- }
- },
- "changelog": {
- "repo": "antvis/S2",
- "labels": {
- "pr(fix)": ":bug: Bug Fix",
- "pr(chore)": ":turtle: Chore",
- "pr(feature)": ":tada: New feature",
- "pr(breaking)": ":boom: Breaking Change",
- "pr(internal)": ":house: Internal",
- "pr(dependency)": ":shamrock: Dependency",
- "pr(documentation)": ":book: Documentation",
- "pr(enhancement)": ":rocket: Enhancement",
- "pr(refactor)": ":100: Refactoring",
- "pr(test)": ":white_check_mark: Test Case"
- },
- "cacheDir": ".changelog"
- },
- "packages": [
- "packages/*"
- ]
-}
diff --git a/package.json b/package.json
index 821ee66f2c..71a25a437c 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,6 @@
{
- "name": "@antv/s2",
+ "name": "@antv/s2-monorepo",
"private": true,
- "workspaces": [
- "packages/*"
- ],
"keywords": [
"antv",
"S2",
@@ -17,60 +14,52 @@
"spreadsheet"
],
"scripts": {
- "bootstrap": "yarn",
- "clean": "lerna clean -y && rimraf node_modules",
- "clean:lock-file": "rm -rf yarn.lock",
- "core:start": "yarn workspace @antv/s2 start",
- "core:watch": " yarn workspace @antv/s2 watch",
- "core:build": "yarn workspace @antv/s2 build",
- "core:test": "yarn workspace @antv/s2 test",
- "core:sync-event": "yarn workspace @antv/s2 sync-event",
- "react:start": "yarn workspace @antv/s2-react test:live",
- "react:playground": "yarn workspace @antv/s2-react start",
- "react:build": "yarn workspace @antv/s2-react build",
- "react:test": "yarn workspace @antv/s2-react test",
- "react:watch": " yarn workspace @antv/s2-react watch",
- "vue:playground": "yarn workspace @antv/s2-vue start",
- "vue:build": "yarn workspace @antv/s2-vue build",
- "vue:test": "yarn workspace @antv/s2-vue test",
- "vue:watch": " yarn workspace @antv/s2-vue watch",
- "build": "lerna run build --include-dependencies --stream",
- "build:esm": "lerna run build:esm --include-dependencies --stream",
- "build:umd": "lerna run build:umd --include-dependencies --stream",
- "bundle:size": "lerna run bundle:size --stream",
- "release": "lerna exec --ignore @antv/s2-shared --concurrency 1 -- npx --no-install semantic-release",
- "release:bump-latest": "node ./scripts/latest-bump-version.js",
- "release:preview": "yarn release --dry-run --no-ci",
- "prepublish:manual": "yarn build",
- "publish:manual": "lerna publish",
- "test": "lerna run test --stream",
- "test:coverage": "lerna run test:coverage --stream",
- "test:ci": "lerna run test:ci --stream",
- "test:ci-coverage": "lerna run test:ci-coverage --stream",
- "test:watch": "lerna run test:watch --stream",
- "site:bootstrap": "cd ./s2-site && yarn",
- "site:start": "cd ./s2-site && yarn start",
- "site:build": "cd ./s2-site && NODE_OPTIONS='--max-old-space-size=4096' yarn build",
- "site:clean": "cd ./s2-site && yarn clean",
- "site:deploy": "cd ./s2-site && yarn deploy",
- "site:preview": "cd ./s2-site && yarn preview",
- "site:clear": "cd ./s2-site && yarn rimraf node_modules",
- "site:sync-s2-lock": "cd ./s2-site && yarn sync:s2-lock",
- "lint": "yarn lint:type && yarn lint:script && yarn lint:style && yarn lint:docs && yarn lint:word",
- "lint:type": "lerna run tsc --stream",
+ "preinstall": "npx only-allow pnpm",
+ "bootstrap": "pnpm install",
+ "prepare": "husky install",
+ "clean": "pnpm -r --parallel exec rimraf node_modules && rimraf node_modules",
+ "clean:lock-file": "rm -rf pnpm-lock.yaml",
+ "update:deps": "pnpm update -i",
+ "core:start": "pnpm --filter @antv/s2 start",
+ "core:watch": " pnpm --filter @antv/s2 watch",
+ "core:build": "pnpm --filter @antv/s2 build",
+ "core:test": "pnpm --filter @antv/s2 test",
+ "core:sync-event": "pnpm --filter @antv/s2 sync-event",
+ "react:start": "pnpm --filter @antv/s2-react test:live",
+ "react:playground": "pnpm --filter @antv/s2-react start",
+ "react:build": "pnpm --filter @antv/s2-react build",
+ "react:test": "pnpm --filter @antv/s2-react test",
+ "react:watch": " pnpm --filter @antv/s2-react watch",
+ "vue:playground": "pnpm --filter @antv/s2-vue start",
+ "vue:build": "pnpm --filter @antv/s2-vue build",
+ "vue:test": "pnpm --filter @antv/s2-vue test",
+ "vue:watch": " pnpm --filter @antv/s2-vue watch",
+ "build": "pnpm -r --filter './packages/*' --stream build",
+ "build:esm": "pnpm -r --filter './packages/*' --stream build:esm",
+ "build:umd": "pnpm -r --filter './packages/*' --stream build:umd",
+ "bundle:size": "pnpm -r --filter './packages/*' --stream bundle:size",
+ "release": "pnpm -r --filter !@antv/s2-shared --filter !@antv/s2-site --workspace-concurrency=1 exec npx --no-install semantic-release",
+ "release:preview": "pnpm release --dry-run --no-ci",
+ "release:bump-version": "node ./scripts/bump-version.js",
+ "test": "pnpm -r --filter './packages/*' --stream test",
+ "test:coverage": "pnpm -r --filter './packages/*' --stream test:coverage",
+ "test:ci": "pnpm -r --filter './packages/*' --stream test:ci",
+ "test:ci-coverage": "pnpm -r --filter './packages/*' --stream test:ci-coverage",
+ "lint": "run-s lint:type lint:script lint:style lint:docs lint:word",
+ "lint:type": "pnpm -r --filter './packages/*' --stream tsc",
"lint:script": "eslint . --ext '.js,.jsx,.ts,.tsx,.vue'",
"lint:style": "stylelint packages/**/*.less",
"lint:docs": "markdownlint '**/*.md'",
"lint:word": "case-police '**/*.md'",
- "lint:fix-word": "yarn lint:word --fix",
- "lint:fix": "yarn lint:fix-script && yarn lint:fix-style && yarn lint:fix-docs && yarn lint:fix-word",
- "lint:fix-script": "yarn lint:script --fix",
- "lint:fix-style": "yarn lint:style --fix",
- "lint:fix-docs": "yarn lint:docs --fix && yarn lint:fix-word",
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s && lerna run changelog --stream",
- "update:deps": "yarn upgrade-interactive",
- "prepare": "husky install",
- "validate:deps": "node ./scripts/validate-deps.js"
+ "lint:fix": "run-s lint:fix-script lint:fix-style lint:fix-docs lint:fix-word",
+ "lint:fix-word": "pnpm lint:word --fix",
+ "lint:fix-script": "pnpm lint:script --fix",
+ "lint:fix-style": "pnpm lint:style --fix",
+ "lint:fix-docs": "pnpm lint:docs --fix",
+ "site:start": "pnpm --filter @antv/s2-site start",
+ "site:build": "NODE_OPTIONS='--max-old-space-size=4096' pnpm --filter @antv/s2-site build",
+ "site:preview": "pnpm --filter @antv/s2-site preview",
+ "site:deploy": "pnpm --filter @antv/s2-site deploy"
},
"commitlint": {
"extends": [
@@ -126,7 +115,6 @@
"bundlesize": "^0.18.1",
"case-police": "^0.5.10",
"concurrently": "^7.5.0",
- "conventional-changelog-cli": "^2.2.2",
"cpx": "^1.5.0",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
@@ -140,14 +128,16 @@
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-vue": "^8.5.0",
"gh-pages": "^3.2.3",
+ "glob": "^8.0.3",
"husky": "^8.0.2",
+ "inquirer": "^8.2.0",
+ "inquirer-autocomplete-prompt": "^2.0.0",
"jest": "^26.6.3",
"jest-electron": "^0.1.12",
"jest-extended": "^0.11.5",
- "jest-less-loader": "^0.1.2",
+ "jest-less-loader": "^0.2.0",
"jest-raw-loader": "^1.0.1",
"jest-url-loader": "^0.1.0",
- "lerna": "^4.0.0",
"less": "^4.1.3",
"lint-staged": "^13.0.3",
"lodash-es": "^4.17.21",
@@ -162,7 +152,7 @@
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-terser": "^7.0.2",
- "rollup-plugin-typescript2": "^0.31.2",
+ "rollup-plugin-typescript2": "^0.34.1",
"rollup-plugin-visualizer": "^5.6.0",
"semantic-release": "^19.0.5",
"semantic-release-monorepo": "^7.0.5",
@@ -179,4 +169,4 @@
},
"license": "MIT",
"repository": "git@github.com:antvis/S2.git"
-}
\ No newline at end of file
+}
diff --git a/packages/s2-core/README.en-US.md b/packages/s2-core/README.en-US.md
index 7c13467759..f27f5f2953 100644
--- a/packages/s2-core/README.en-US.md
+++ b/packages/s2-core/README.en-US.md
@@ -187,20 +187,35 @@ s2.render()
Contributions, issues and feature requests are welcome.
Feel free to check [issues](https://github.com/antvis/S2/issues) page if you want to contribute.
+> S2 use pnpm as package manager
+
```bash
git clone git@github.com:antvis/S2.git
cd S2
-yarn
+pnpm install # or pnpm bootstrap
-yarn core:start
+# build all
+pnpm build
-# start the website
+# debug s2-core
+pnpm core:start
+
+# debug s2-react
+pnpm react:playground
-yarn site:bootstrap
+# debug s2-vue
+pnpm vue:playground
-yarn site:start
+# unit test
+pnpm test
+
+# check the code style and the type definition
+pnpm lint
+
+# start the website
+pnpm site:start
```
## 📧 Contact Us
diff --git a/packages/s2-core/README.md b/packages/s2-core/README.md
index 3f32e3aa91..371e455600 100644
--- a/packages/s2-core/README.md
+++ b/packages/s2-core/README.md
@@ -168,11 +168,11 @@ s2.render();
### 📦 Packages
-| Package | Latest | Beta | Alpha | Next | Size | Download |
-| - | - | - | - | - | - | - |
-| [@antv/s2](https://github.com/antvis/S2/tree/master/packages/s2-core) | ![latest](https://img.shields.io/npm/v/@antv/s2/latest.svg) | ![beta](https://img.shields.io/npm/v/@antv/s2/beta.svg) | ![alpha](https://img.shields.io/npm/v/@antv/s2/alpha.svg) | ![next](https://img.shields.io/npm/v/@antv/s2/next.svg) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2.svg) |
-| [@antv/s2-react](https://github.com/antvis/S2/tree/master/packages/s2-react) | ![latest](https://img.shields.io/npm/v/@antv/s2-react/latest.svg) | ![beta](https://img.shields.io/npm/v/@antv/s2-react/beta.svg) | ![alpha](https://img.shields.io/npm/v/@antv/s2-react/alpha.svg) | ![next](https://img.shields.io/npm/v/@antv/s2-react/next.svg)| ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-react@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-react.svg) |
-| [@antv/s2-vue](https://github.com/antvis/S2/tree/master/packages/s2-vue) | ![latest](https://img.shields.io/npm/v/@antv/s2-vue/latest.svg) | ![beta](https://img.shields.io/npm/v/@antv/s2-vue/beta.svg) | ![alpha](https://img.shields.io/npm/v/@antv/s2-vue/alpha.svg) | ![next](https://img.shields.io/npm/v/@antv/s2-vue/next.svg) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-vue@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-vue.svg) |
+| Package | Latest | Beta | Alpha | Next | Size | Download |
+| ---------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
+| [@antv/s2](https://github.com/antvis/S2/tree/master/packages/s2-core) | ![latest](https://img.shields.io/npm/v/@antv/s2/latest.svg) | ![beta](https://img.shields.io/npm/v/@antv/s2/beta.svg) | ![alpha](https://img.shields.io/npm/v/@antv/s2/alpha.svg) | ![next](https://img.shields.io/npm/v/@antv/s2/next.svg) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2.svg) |
+| [@antv/s2-react](https://github.com/antvis/S2/tree/master/packages/s2-react) | ![latest](https://img.shields.io/npm/v/@antv/s2-react/latest.svg) | ![beta](https://img.shields.io/npm/v/@antv/s2-react/beta.svg) | ![alpha](https://img.shields.io/npm/v/@antv/s2-react/alpha.svg) | ![next](https://img.shields.io/npm/v/@antv/s2-react/next.svg) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-react@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-react.svg) |
+| [@antv/s2-vue](https://github.com/antvis/S2/tree/master/packages/s2-vue) | ![latest](https://img.shields.io/npm/v/@antv/s2-vue/latest.svg) | ![beta](https://img.shields.io/npm/v/@antv/s2-vue/beta.svg) | ![alpha](https://img.shields.io/npm/v/@antv/s2-vue/alpha.svg) | ![next](https://img.shields.io/npm/v/@antv/s2-vue/next.svg) | ![size](https://img.badgesize.io/https:/unpkg.com/@antv/s2-vue@latest/dist/index.min.js?label=gzip%20size&compression=gzip) | ![download](https://img.shields.io/npm/dm/@antv/s2-vue.svg) |
## 👤 Author
@@ -180,32 +180,36 @@ s2.render();
## 🤝 参与贡献
+> S2 使用 pnpm 作为包管理器
+
```bash
git clone git@github.com:antvis/S2.git
cd S2
# 安装依赖
-yarn # 或者 yarn bootstrap
+pnpm install # 或者 pnpm bootstrap
+
+# 打包
+pnpm build
# 调试 s2-core
-yarn core:start
+pnpm core:start
# 调试 s2-react
-yarn react:playground
+pnpm react:playground
-# 单元测试
-yarn test
+# 调试 s2-vue
+pnpm vue:playground
-# 打包
-yarn build
+# 单元测试
+pnpm test
# 代码风格和类型检测
-yarn lint
+pnpm lint
# 本地启动官网
-yarn site:bootstrap
-yarn site:start
+pnpm site:start
```
## 📧 联系我们
diff --git a/packages/s2-core/package.json b/packages/s2-core/package.json
index b39db6e17a..766f1d1c55 100644
--- a/packages/s2-core/package.json
+++ b/packages/s2-core/package.json
@@ -38,7 +38,7 @@
"table"
],
"scripts": {
- "start": "yarn test:live",
+ "start": "pnpm test:live",
"clean": "rimraf lib esm dist temp",
"build": "npm-run-all clean --parallel build:umd build:cjs build:esm build:dts",
"build:esm": "cross-env FORMAT=es rollup -c rollup.config.js",
@@ -49,16 +49,15 @@
"dts:build": "tsc -p tsconfig.declaration.json",
"dts:extract": "cross-env LIB=s2-core node ../../scripts/dts.js",
"bundle:size": "bundlesize",
- "watch": "rimraf esm && yarn build:esm -w",
+ "watch": "rimraf esm && pnpm build:esm -w",
"test:live": "node ./scripts/test-live.mjs",
"sync-event": "node ./scripts/sync-event.mjs",
"test": "jest --passWithNoTests",
- "test:coverage": "yarn test --coverage",
- "test:ci": "yarn test --maxWorkers=3",
- "test:ci-coverage": "yarn test:coverage --maxWorkers=3",
- "test:watch": "yarn test --watch",
- "tsc": "tsc --noEmit",
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
+ "test:coverage": "pnpm test -- --coverage",
+ "test:ci": "pnpm test -- --maxWorkers=3",
+ "test:ci-coverage": "pnpm test:coverage --maxWorkers=3",
+ "test:watch": "pnpm test -- --watch",
+ "tsc": "tsc --noEmit"
},
"dependencies": {
"@antv/event-emitter": "^0.1.3",
@@ -79,8 +78,6 @@
"@types/tinycolor2": "^1.4.3",
"csstype": "^3.0.11",
"d3-dsv": "^1.1.1",
- "inquirer": "^8.2.0",
- "inquirer-autocomplete-prompt": "^2.0.0",
"tinycolor2": "^1.4.2"
},
"sideEffects": [
diff --git a/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap b/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap
index 5c338e3f15..2c0f7d46eb 100644
--- a/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap
+++ b/packages/s2-react/__tests__/spreadsheet/__snapshots__/pagination-spec.tsx.snap
@@ -6,7 +6,6 @@ exports[`Pagination Tests should receive antd