Skip to content

Commit d59a2a0

Browse files
authored
Merge branch 'main' into fix/exclude-source-maps
2 parents 0305191 + d7a4afc commit d59a2a0

12 files changed

Lines changed: 33775 additions & 567 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Setup Node.js
4242
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4343
with:
44-
node-version: 22
44+
node-version: 24
4545
cache: 'pnpm'
4646

4747
# Update npm to the latest version to enable OIDC
@@ -71,6 +71,8 @@ jobs:
7171
7272
- name: Report Compressed Size
7373
uses: ./
74+
env:
75+
AI_TOKEN: ${{ secrets.AI_TOKEN }}
7476
with:
7577
github_token: ${{ secrets.GITHUB_TOKEN }}
7678
file_path: 'examples/**/*/.rsdoctor/rsdoctor-data.json'

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default defineConfig({
6363
| `file_path` | Path to Rsdoctor JSON data file | Yes | - |
6464
| `target_branch` | Target branch for baseline comparison | No | `main` |
6565

66+
> AI-assisted analysis reads `AI_TOKEN` from the action step environment. Store it as a GitHub Actions secret in repository settings, then pass it to the step with `AI_TOKEN: ${{ secrets.AI_TOKEN }}`.
67+
6668
- `target_branch`: If you want to use a dynamic target branch (e.g., the PR base branch instead of a fixed main), use:
6769
`target_branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }}`
6870

@@ -137,6 +139,8 @@ jobs:
137139
138140
- name: Bundle Analysis
139141
uses: web-infra-dev/rsdoctor-action@main
142+
env:
143+
AI_TOKEN: ${{ secrets.AI_TOKEN }}
140144
with:
141145
file_path: 'dist/.rsdoctor/rsdoctor-data.json'
142146
target_branch: 'main'
@@ -217,4 +221,4 @@ pnpm run build
217221
cd examples/rsbuild-demo
218222
pnpm install
219223
pnpm run build
220-
```
224+
```

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: '@yifancong/bundle-action'
2-
description: 'A simple demo for checking compressed size differences'
2+
description: 'A simple demo for checking compressed size differences. Requires the AI_TOKEN secret for AI-assisted analysis.'
33
branding:
44
icon: 'archive'
55
color: 'purple'
@@ -20,7 +20,12 @@ inputs:
2020
required: false
2121
default: ''
2222
type: string
23+
ai_model:
24+
description: 'AI model to use for degradation analysis (e.g. claude-3-5-haiku-latest, gpt-4o-mini). Provider is auto-detected from the model name prefix. Set AI_TOKEN as a GitHub Actions secret and pass it to the action step for AI-assisted analysis.'
25+
required: false
26+
default: 'claude-3-5-haiku-latest'
27+
type: string
2328

2429
runs:
25-
using: 'node20'
26-
main: 'dist/index.js'
30+
using: 'node24'
31+
main: 'dist/index.js'

dist/682.js

Lines changed: 424 additions & 0 deletions
Large diffs are not rendered by default.

dist/749.js

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.

dist/index.js

Lines changed: 32505 additions & 351 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@
3636
"access": "public"
3737
},
3838
"devDependencies": {
39+
"@ai-sdk/anthropic": "^3.0.69",
40+
"@ai-sdk/deepseek": "^2.0.29",
41+
"@ai-sdk/google": "^3.0.63",
42+
"@ai-sdk/openai": "^3.0.52",
43+
"ai": "^6.0.159",
3944
"@actions/artifact": "^2.3.2",
4045
"@actions/core": "^1.2.6",
4146
"@actions/github": "^4.0.0",
4247
"@playwright/test": "^1.42.1",
43-
"@rsdoctor/cli": "1.3.3-beta.2",
44-
"@rsdoctor/client": "1.3.3-beta.2",
48+
"@rsdoctor/cli": "1.5.8",
49+
"@rsdoctor/client": "1.5.8",
4550
"@rslib/core": "^0.16.0",
4651
"@rstest/core": "^0.5.4",
4752
"@types/node": "^24.5.2",
@@ -53,6 +58,7 @@
5358
"yauzl": "^3.2.0"
5459
},
5560
"overrides": {
56-
"@rsdoctor/client": "1.3.3-beta.2"
57-
}
61+
"@rsdoctor/client": "1.5.8"
62+
},
63+
"packageManager": "pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531"
5864
}

0 commit comments

Comments
 (0)