Repository navigation
Conversation
|
pkg.pr.new packages benchmark commit |
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 355 | 0 | 0 |
No notable changes.
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [1.06, 2.13, 4.48, 6.88, 8.40, 13.47, 27.29, 26.12]
line [1.12, 2.17, 4.71, 7.04, 8.72, 15.12, 28.52, 29.62]
line [0.93, 2.04, 4.48, 7.04, 8.93, 12.36, 26.54, 25.15]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.28, 0.51, 0.71, 0.87, 1.13, 1.21, 1.48, 1.65]
line [0.36, 0.54, 0.72, 0.89, 1.28, 1.30, 1.57, 1.76]
line [0.32, 0.49, 0.74, 0.90, 1.16, 1.29, 1.43, 1.58]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.97, 2.02, 4.45, 7.76, 13.73, 27.65, 59.07, 120.31]
line [1.00, 2.26, 4.74, 7.78, 13.99, 28.87, 62.26, 127.38]
line [0.94, 2.41, 4.22, 7.36, 13.55, 27.94, 60.25, 119.99]
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change aligning scaffolded projects and add-ons with build-time package versions.
No open issues 🎉
What changed in this PR
This PR ties TypeGPU dependency versions in scaffolded projects and add-ons to the package versions captured when the CLI is built, replacing manually maintained version ranges.
Changes:
- Embed public workspace package versions into the CLI at build time.
- Replace hard-coded TypeGPU versions in six templates with
workspace:^placeholders. - Resolve placeholders during scaffolding, reject unresolved versions, and use the same version lookup for add-ons.
| File | Description |
|---|---|
packages/typegpu-cli/tsdown.config.ts |
Collect and inject public workspace package versions. |
packages/typegpu-cli/templates/template-waku-bare/_package.json |
Use workspace placeholders for Waku template dependencies. |
packages/typegpu-cli/templates/template-vite-react/_package.json |
Use workspace placeholders for Vite React template dependencies. |
packages/typegpu-cli/templates/template-vite-complex/_package.json |
Use workspace placeholders for the complex Vite template. |
packages/typegpu-cli/templates/template-vite-bare/_package.json |
Use workspace placeholders for the bare Vite template. |
packages/typegpu-cli/templates/template-nextjs-bare/_package.json |
Use workspace placeholders for Next.js template dependencies. |
packages/typegpu-cli/templates/template-expo-bare/_package.json |
Use workspace placeholders for Expo template dependencies. |
packages/typegpu-cli/src/utils/pkg.ts |
Add package-specific version lookup and placeholder resolution. |
packages/typegpu-cli/src/utils/inputs.ts |
Resolve selected add-on versions individually. |
packages/typegpu-cli/src/utils/files.ts |
Resolve template versions and validate them during scaffolding. |
packages/typegpu-cli/src/steps/typegpu.ts |
Use captured package versions when installing TypeGPU packages. |
Review effort: Balanced
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — verified the template version resolution end to end: built the CLI, scaffolded templates with and without add-ons, and typechecked/linted the changed sources.
- Build-time version map —
tsdown.config.tsscanspackages/*/package.jsonfor non-private packages and injects__WORKSPACE_PACKAGE_VERSIONS__viadefine; the identifier is inlined into the bundle (confirmed indist/index.js). - Placeholder resolution —
resolveWorkspaceVersionsrewritesworkspace:^in template deps to^<version>and returns unresolved names, whichscaffoldProjectturns into an[INTERNAL]failure. - Add-on versions —
getVersionRangereplaces the removedVERSIONconstant in the three call sites; every name it receives is pre-validated againsttypegpuPkgsbyparseAddons, so the newthrowis effectively unreachable. - Templates — all six templates now use
workspace:^for TypeGPU packages; no hard-coded TypeGPU versions remain.
The release paths (scripts/publish.ts, scripts/publish-pkg-pr.ts) build via prepublishOnly at publish time, so the baked versions track the versions already committed to source — the "can't drift apart" goal holds.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Templates now use
workspace:^for our packages instead of hard-coded versions. When scaffolding, the CLI replaces it with^<version>, using the package versions from the repo at the time the CLI was built. Add-ons use the same versions.This way templates can rely on any API released alongside the CLI, and the versions can't drift apart.