--template does not resolve pnpm catalog: references before uploading to StackBlitz
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- build-system, cli
调研方向
首先跟踪命令 pkg-pr-new publish --pnpm 中对 --template 的处理,并将其与现有的已发布 package 的 catalog: 解析进行比较。使用示例中的 template package.json 和 pnpm-workspace.yaml 作为输入,然后验证上传的 StackBlitz template 能够在没有未解析的 catalog: 引用的情况下完成安装。
由索引模型根据 Issue 内容生成。
描述
Problem
When using --template with pkg-pr-new publish --pnpm, the template's package.json is copied verbatim to StackBlitz. If the template uses pnpm's catalog: protocol for dependencies, those references are not resolved — even though --pnpm correctly resolves catalog: in the published packages themselves.
This means any template that lives inside a pnpm workspace and uses catalog: will break in StackBlitz because the catalog: protocol has no meaning outside the workspace.
Example
Our CI command:
pnpm dlx pkg-pr-new publish --pnpm \
--template './samples/pkg-new-template' \
'./packages/atomic' \
'./packages/headless'
Our template's package.json:
{
"devDependencies": {
"vite": "catalog:"
}
}
The published packages correctly have catalog: resolved to real versions. But the template is copied as-is, so StackBlitz sees "vite": "catalog:" and fails to install.
Expected behavior
--template should resolve catalog: (and catalog:<name>) references in the template's package.json before uploading to StackBlitz, the same way --pnpm resolves them for published packages.
Current workaround
We run a script before pkg-pr-new publish that reads pnpm-workspace.yaml and replaces catalog: entries in the template's package.json with resolved versions.
Related
- #204 — original
catalog:support issue (fixed for published packages via--pnpm) - #446 — confirmation that
--pnpmis the way to resolvecatalog:
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 131
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stackblitz-labs/pkg.pr.new 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 52/100
stackblitz-labs/pkg.pr.new#557 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
stackblitz-labs/pkg.pr.new#531 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
stackblitz-labs/pkg.pr.new#482 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
stackblitz-labs/pkg.pr.new#343 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
stackblitz-labs/pkg.pr.new#320 · 2 条评论 · 1 个 reaction ·
查看 stackblitz-labs/pkg.pr.new 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
Equal-Vote/bettervoting#1754 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
Doist/todoist-sdk-typescript#740 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 62/100
privatenumber/cleye#47 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P1
难度 2/5 1-3 小时 新手友好度 70/100
steipete/oracle#614 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
MoonshotAI/kimi-code#4591 ·
维护者通常 1 天内回复