Skip to content

Commit 07d7d14

Browse files
committed
chore: Migrate from pnpm to npm, update GitHub Actions workflows, and refine build/test/lint processes.
1 parent 04d22a8 commit 07d7d14

File tree

4 files changed

+4318
-2411
lines changed

4 files changed

+4318
-2411
lines changed

.github/workflows/code-quality.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ on:
1313
- '.github/workflows/code-quality.yml'
1414
- 'tsconfig.json'
1515
- 'package.json'
16-
pull_request:
17-
branches: [main, develop]
16+
# pull_request:
17+
# branches: [main, develop]
1818

1919
permissions:
20-
contents: read
20+
contents: write
2121

2222
jobs:
2323
quality-check:
@@ -26,32 +26,30 @@ jobs:
2626
timeout-minutes: 10
2727
steps:
2828
- name: Checkout code
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030
with:
3131
ref: ${{ github.head_ref }}
32+
token: ${{ secrets.GITHUB_TOKEN }}
3233

3334
- name: Setup Node.js
34-
uses: actions/setup-node@v4
35+
uses: actions/setup-node@v6
3536
with:
3637
node-version: '20'
37-
cache: 'pnpm'
38-
39-
- name: Setup pnpm
40-
uses: pnpm/action-setup@v4
41-
with:
42-
version: '10'
38+
cache: 'npm'
4339

4440
- name: Install dependencies
45-
run: pnpm install --frozen-lockfile
41+
run: npm ci
4642

47-
- name: Format check
48-
run: pnpm exec prettier --check .
43+
# Auto-fix formatting on push to main/develop (not on PRs)
44+
- name: Format code
45+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
46+
run: npx prettier --write .
4947

50-
- name: Typecheck
51-
run: pnpm run typecheck
48+
- name: Run ESLint
49+
run: npm run lint
5250

53-
- name: Test
54-
run: pnpm run test
55-
56-
- name: Build
57-
run: pnpm run build
51+
- name: Commit formatting changes
52+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
53+
uses: stefanzweifel/git-auto-commit-action@v7
54+
with:
55+
commit_message: 'style: fix code formatting [skip ci]'

.github/workflows/run-tests.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010
- '**.jsx'
1111
- '.github/workflows/run-tests.yml'
1212
- 'package.json'
13-
- 'pnpm-lock.yaml'
13+
- 'package-lock.json'
1414
- 'tsconfig.json'
15-
- 'build.config.ts'
15+
- 'tsup.config.ts'
1616
pull_request:
1717
branches: [main, develop]
1818
workflow_run:
@@ -39,37 +39,29 @@ jobs:
3939

4040
steps:
4141
- name: Checkout code
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v5
4343

4444
- name: Setup Node.js
45-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@v6
4646
with:
4747
node-version: ${{ matrix.node-version }}
48-
cache: 'pnpm'
49-
50-
- name: Setup pnpm
51-
uses: pnpm/action-setup@v4
52-
with:
53-
version: '10'
48+
cache: 'npm'
5449

5550
- name: Install dependencies
56-
run: pnpm install --frozen-lockfile
51+
run: npm ci
5752

58-
- name: Type-check, test & build
59-
run: |
60-
pnpm run typecheck
61-
pnpm run test
62-
pnpm run build
53+
- name: Type-check, lint, test & build
54+
run: npm run prepublishOnly
6355

6456
- name: Verify build outputs
6557
run: |
66-
node -e "const fs=require('fs'); console.log('dist/ contents:'); fs.readdirSync('dist').forEach(f => console.log(f)); ['dist/index.mjs','dist/index.cjs','dist/index.d.ts'].forEach(f => {if(!fs.existsSync(f)) throw new Error(f+' not found')}); console.log('All required files exist')"
58+
node -e "const fs=require('fs'); console.log('dist/ contents:'); fs.readdirSync('dist').forEach(f => console.log(f)); ['dist/index.js','dist/index.d.ts'].forEach(f => {if(!fs.existsSync(f)) throw new Error(f+' not found')}); console.log('All required files exist')"
6759
6860
- name: Verify package imports
6961
run: |
7062
node -e "
7163
console.log('Testing ESM import...');
72-
import('./dist/index.mjs').then(esm => {
64+
import('./dist/index.js').then(esm => {
7365
console.log('ESM exports:', Object.keys(esm));
7466
console.log('Package imports working correctly!');
7567
}).catch(err => {

0 commit comments

Comments
 (0)