Repository navigation
打包产物发布为 npm 包 @talebook/candle-reader - #21
Merged
Merged
Conversation
- package.json 改名为 @talebook/candle-reader,版本对齐 v1.1.0,只发布 dist/; 打包时已内联全部依赖,故依赖全部移入 devDependencies,宿主安装时不会再拉 vue/vuetify - release.yml 推送 v* tag 后按 tag 版本号经 npm Trusted Publishing(OIDC)发布, 已存在的版本跳过;Node 升到 22 以满足 Trusted Publishing 要求 - README 补充发版与 npm 包说明 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LmqWSvDpsfVCnBeA1tRjLx
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
tag 用发版日期(如 v26.10.09),发布到 npm 时去掉前导零(26.10.9), 不符合该格式的 tag 直接报错,不再发布。 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LmqWSvDpsfVCnBeA1tRjLx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d1839d0e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- 手动触发时先确定并检出要发布的 tag,dist.zip 和 npm 包都按该 tag 的源码构建 - npm view 只有确认 E404 才发布,其他错误直接失败;tag 早于 npm 包(包名不符)时跳过发布 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01LmqWSvDpsfVCnBeA1tRjLx
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.
Requested by Rex · project thread
背景
talebook 目前把阅读器的打包产物直接提交到
app/public/static/candle-reader/。每次升级或联调同步,都会在 talebook 的 git 历史里多留一份产物。计划改成:talebook 通过 npm 锁定版本,构建时再取用产物。这个 PR 先让 candle-reader 能发布成 npm 包;talebook 那边的改动等包首次发布后另开 PR。Before: 推送
v*tag 只会产出 GitHub Release 上的dist.zip。After: 推送日期版本 tag(如
v26.10.09)后,除了dist.zip,还会把dist/发布为 npm 包@talebook/[email protected]。关键改动
package.jsonteader改为@talebook/candle-reader,版本写成26.10.9。"files": ["dist"],发布的包里只有构建产物。license、repository、main/module、publishConfig.access=public。provenance 要求repository和实际发布的仓库一致。devDependencies,宿主安装时不会再拉 vue 和 vuetify。package-lock.json只多了对应的 dev 标记,没有升级任何依赖版本。.github/workflows/release.yml新增「Publish to npm」步骤:vYY.MM.DD格式。semver 不允许前导零,所以发布时去掉前导零,例如v26.10.09发布为26.10.9。格式不符的 tag 直接报错。id-token: write权限,Node 从 18 升到 22,npm 升到 11.5.1 及以上。README.md:新增「发版与 npm 包」一节。验证
npm run build:通过。npm pack --dry-run:23 个文件,全部是dist/加上 LICENSE、README、package.json;压缩后 4.1 MB。npm run lint:通过。executablePath,用例没有改。v26.10.09→26.10.9v26.01.05→26.1.5v26.10.09.1和build-3报错release.yml通过 YAML 语法检查。真实发布要等打 tag 时才能验证。合并后需要手动做的事(只需一次)
Trusted Publishing 只能在包已经存在后配置,所以首次发布要手动:
npm login && npm run build && npm publish --access public,发布26.10.9。@talebook/candle-reader的 Settings → Trusted Publisher → GitHub Actions,依次填写talebook、candle-reader、release.yml。v26.10.09并推送。发布步骤会发现26.10.9已存在而跳过,只上传 GitHub Release。风险与兼容性
v26.10.09.1)不能映射为不比原版本小的 semver,所以直接拒绝。trigger-candle-reader.yml和 talebook 现有的同步流程这次不改,等 talebook 切到 npm 包后一起删除。talebook 的同步 workflow 是按 tag 名字比较版本,换成日期 tag 不受影响。方案
本仓库没有
design/方案规范。整体方案在 talebook 项目的对话中讨论,正式方案文档会附在 talebook 侧的 PR 里。🤖 Generated with Claude Code
https://claude.ai/code/session_01LmqWSvDpsfVCnBeA1tRjLx