Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ updates:
directory: /
schedule:
interval: weekly
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ jobs:
- uses: actions/setup-node@v7
with:
node-version: "22"
# 版本由 package.json 的 packageManager 字段提供,此处不可再传 version
# (同时指定会报 Multiple versions of pnpm specified)
- uses: pnpm/action-setup@v4
- name: 安装 esbuild(体积守卫依赖)
run: npm ci
run: pnpm install --frozen-lockfile
- name: 产物体积守卫(gzip ≤ 300KB)
run: bundle exec rake size
- name: source map 指回 .rb
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ jobs:
- uses: actions/setup-node@v7
with:
node-version: "22"
- name: 安装 JS 工具链(T1:esbuild 是 rake size 的 dev 依赖,随 package-lock 钉版)
run: npm ci
# 版本由 package.json 的 packageManager 字段提供,此处不可再传 version
# (同时指定会报 Multiple versions of pnpm specified)
- uses: pnpm/action-setup@v4
- name: 安装 JS 工具链(T1:esbuild 是 rake size 的 dev 依赖,随 pnpm-lock 钉版)
run: pnpm install --frozen-lockfile
- name: 发布门禁(T2:与 CI 对齐——单测 + 桩验收 + lint + 体积守卫)
run: |
bundle exec rake
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
git clone https://github.com/ShiningRay/citrine.git
cd citrine
bundle install # Ruby ≥ 3.0;本地开发建议 rbenv 装 3.3.x
npm ci # 可选:仅 rake size 体积守卫需要 esbuild
pnpm install # 可选:仅 rake size 体积守卫需要 esbuild
```

## 测试与验收命令
Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ desc "产物体积守卫(T-A1):无 map 编译 + esbuild 压缩,gzip 后
task :size do
Dir.chdir("examples") do
sh "opal -c --no-source-map -I../lib -I. -o counter.js counter.rb"
if system("npx --no-install esbuild --version > /dev/null 2>&1")
sh "npx --no-install esbuild counter.js --minify --target=es2015 --allow-overwrite --outfile=counter.min.js"
if system("pnpm exec esbuild --version > /dev/null 2>&1")
sh "pnpm exec esbuild counter.js --minify --target=es2015 --allow-overwrite --outfile=counter.min.js"
else
notice = "esbuild 不可用:体积守卫降级为仅校验未压缩产物(仓库根 npm ci 安装 dev 依赖后恢复完整守卫)"
notice = "esbuild 不可用:体积守卫降级为仅校验未压缩产物(仓库根 pnpm install 安装 dev 依赖后恢复完整守卫)"
warn " (#{notice})"
puts "::notice::#{notice}" if ENV["CI"] # GitHub Actions 注记:降级必须可见,不能静默溜过发布门禁(T1)
end
Expand Down
Loading
Loading