Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: pnpm => bun #11358

Merged
merged 8 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: '' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: "weekly"
interval: 'weekly'
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: CI

on: [push, pull_request]

Expand All @@ -19,10 +19,11 @@ jobs:
with:
node-version: ${{ matrix.node_version }}
- run: echo ${{github.ref}}
- run: npm install
- run: yarn run lint
- run: yarn run tsc
- run: yarn run build
- uses: oven-sh/setup-bun@v2
- run: bun install
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

发现Bun设置与现有Node.js环境存在不一致

.github/workflows/ci.yml 中添加了 Bun 设置步骤,但 package.json 中的脚本仍然使用 npm 和 yarn。建议:

  • 确认是否所有脚本已经迁移到使用 Bun。
  • 如果计划继续使用 Bun,考虑移除 Node.js 的设置步骤以避免环境冲突。
  • 如果暂时不使用 Bun,移除相关的设置步骤以保持配置一致性。
🔗 Analysis chain

Bun设置步骤已添加,但需要澄清与Node.js的关系

添加Bun设置步骤表明项目正在转向使用Bun作为构建工具。这是一个积极的改变,可能会提高构建性能。

然而,工作流仍然设置了Node.js环境。建议澄清是否仍然需要Node.js设置,以及Bun和Node.js环境如何协同工作。请运行以下脚本来验证项目中Bun的使用情况:

根据脚本结果,请考虑以下问题:

  1. 是否所有脚本都已更新为使用Bun?
  2. 是否仍有依赖项需要Node.js?
  3. 是否可以完全移除Node.js设置步骤?
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证项目中Bun的使用情况

# 测试:搜索package.json中的Bun相关配置
echo "检查package.json中的Bun配置:"
jq '.scripts, .dependencies, .devDependencies' package.json

# 测试:搜索项目中可能使用Bun的其他配置文件
echo "检查其他可能使用Bun的配置文件:"
fd -e json -e js -e ts -e yaml -e yml | xargs rg 'bun'

Length of output: 733

- run: bun run lint
- run: bun run tsc
- run: bun run build
env:
CI: true
PROGRESS: none
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ "master" ]
branches: ['master']
pull_request:
branches: [ "master" ]
branches: ['master']
schedule:
- cron: "48 12 * * 2"
- cron: '48 12 * * 2'

jobs:
analyze:
Expand All @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ javascript ]
language: [javascript]

steps:
- name: Checkout
Expand All @@ -38,4 +38,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
category: '/language:${{ matrix.language }}'
12 changes: 7 additions & 5 deletions .github/workflows/pnpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16.x]
node_version: [20]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- run: echo ${{github.ref}}
- run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm config set store-dir ~/.pnpm-store
- run: pnpm install --strict-peer-dependencies=false
- run: pnpm install --strict-peer-dependencies=false
- run: pnpm run lint
- run: pnpm run tsc
- run: pnpm run build
Expand Down
5 changes: 4 additions & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"*": "prettier --ignore-unknown --write"
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts,less,md,json,yml}": [
"prettier --write"
]
}
28 changes: 11 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,15 @@
"test:update": "npm run jest -- -u",
"tsc": "tsc --noEmit"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
},
"browserslist": [
"defaults"
],
"dependencies": {
"@ant-design/icons": "^4.8.3",
"@ant-design/pro-components": "^2.7.9",
"@ant-design/pro-components": "^2.7.19",
"@testing-library/dom": "^10.4.0",
"antd": "^5.18.0",
"antd-style": "^3.6.2",
"antd": "^5.21.2",
"antd-style": "^3.7.0",
"classnames": "^2.5.1",
"dayjs": "^1.11.13",
"querystring": "^0.2.1",
Expand All @@ -64,17 +58,17 @@
"@types/classnames": "^2.3.1",
"@types/express": "^4.17.21",
"@types/history": "^4.7.11",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.4",
"@types/react": "^18.3.3",
"@types/jest": "^29.5.13",
"@types/lodash": "^4.17.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-helmet": "^6.1.11",
"@umijs/fabric": "^2.14.1",
"@umijs/lint": "^4.2.9",
"@umijs/max": "^4.2.9",
"@umijs/lint": "^4.3.24",
"@umijs/max": "^4.3.24",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"express": "^4.19.2",
"eslint": "^8.57.1",
"express": "^4.21.1",
"gh-pages": "^3.2.3",
"husky": "^9.1.6",
"jest": "^29.7.0",
Expand All @@ -85,7 +79,7 @@
"react-dev-inspector": "^1.9.0",
"swagger-ui-dist": "^4.19.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"typescript": "^5.6.3",
"umi-presets-pro": "^2.0.3",
"umi-serve": "^1.9.11"
},
Expand Down
Loading
Loading