Repository navigation
修复部署:APP_VERSION 替换丢失引号 + me.ts 格式检查失败 - #108
Merged
todosdev[bot] merged 1 commit intoOct 17, 2026
Merged
Conversation
bb30985 dropped the single quotes when migrating the __APP_VERSION__ replacement, so wrangler parsed "1.0.0" as an invalid define value and deploy failed. Wrap the version in single quotes in both the workflow perl substitution and scripts/deploy.mjs so it lands as the JS literal '1.0.0'. Also apply biome formatting to worker/src/routes/me.ts, whose records.map block was failing CI's format check and skipping deploys. Checkpoint: RBEToLtNypnGGwg6Ggk-h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[define] APP_VERSION的版本号替换在提交bb30985迁移时丢失了单引号,导致 wrangler 把1.0.0当作无效 JS 表达式(Invalid define value)而失败。worker/src/routes/me.ts的 biome 格式问题(此前使 CI 的 Format check 失败、进而跳过 Deploy)。Changes
.github/workflows/deploy.yml:perl 替换改为s/__APP_VERSION__/'\''$ENV{APP_VERSION}'\''/g;,用 shell 单引号转义'\''给版本号包上单引号,替换后得到合法 TOML 的APP_VERSION = "'1.0.0'"([define]值作为 JS 字符串字面量'1.0.0'内联)。scripts/deploy.mjs:original.replaceAll("__APP_VERSION__", \'${version}'`)`,与 workflow 保持一致地把版本号写成带引号的 JS 字符串字面量。worker/src/routes/me.ts:仅用biome format --write重排records.map(...)回调的缩进,无逻辑改动。worker/wrangler.toml保持不动(APP_VERSION = "__APP_VERSION__"占位写法为有意设计,本地开发由typeof APP_VERSION !== "undefined"兜底)。Testing
pnpm lint、pnpm format:check、pnpm typecheck、pnpm build全部通过(exit 0)。deploy.mjs替换,均输出APP_VERSION = "'1.0.0'"。wrangler deploy --dry-run,不再报Invalid define value,打包产物中版本已内联为字符串:version: true ? "1.0.0" : "0.0.0";验证后wrangler.toml已恢复为占位写法。