Skip to content

feat: "create-typegpu" CLI package#1903

Open
iwoplaza wants to merge 6 commits into
mainfrom
feat/create-typegpu
Open

feat: "create-typegpu" CLI package#1903
iwoplaza wants to merge 6 commits into
mainfrom
feat/create-typegpu

Conversation

@iwoplaza

@iwoplaza iwoplaza commented Nov 10, 2025

Copy link
Copy Markdown
Collaborator

Executing npm create typegpu has the same behavior as npx typegpu@latest. It's important to note that it always targets the latest released version of @typegpu/cli

@github-actions

github-actions Bot commented Nov 10, 2025

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/create-typegpu@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/tgpu-gen@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/tinyest-for-wgsl@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/color@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/radiance-cascades@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/sdf@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/three@697cbadd68d48f8d6d02ff224fecbafc424c3df3
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@697cbadd68d48f8d6d02ff224fecbafc424c3df3

benchmark
view benchmark

commit
view commit

@iwoplaza iwoplaza force-pushed the feat/create-typegpu branch 3 times, most recently from a1e106e to ece16aa Compare July 7, 2026 09:55
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 321 0 0

import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):

Test tsdown
tgpu_init.ts 256.41 kB ($${\color{green}-3.2\%}$$)
tgpu_initFromDevice.ts 255.90 kB ($${\color{green}-3.4\%}$$)
tgpu_resolve.ts 187.13 kB ($${\color{green}-29.4\%}$$)
tgpu_resolveWithContext.ts 187.07 kB ($${\color{green}-29.4\%}$$)
tgpu_bindGroupLayout.ts 69.01 kB ($${\color{green}-73.9\%}$$)
tgpu_mutableAccessor.ts 65.98 kB ($${\color{green}-75.1\%}$$)
tgpu_accessor.ts 65.97 kB ($${\color{green}-75.1\%}$$)
tgpu_privateVar.ts 65.30 kB ($${\color{green}-75.3\%}$$)
tgpu_workgroupVar.ts 65.30 kB ($${\color{green}-75.3\%}$$)
tgpu_const.ts 64.53 kB ($${\color{green}-75.6\%}$$)
tgpu_fn.ts 37.94 kB ($${\color{green}-85.7\%}$$)
tgpu_fragmentFn.ts 37.87 kB ($${\color{green}-85.7\%}$$)
tgpu_vertexFn.ts 37.69 kB ($${\color{green}-85.8\%}$$)
tgpu_computeFn.ts 37.39 kB ($${\color{green}-85.9\%}$$)
tgpu_vertexLayout.ts 26.61 kB ($${\color{green}-90.0\%}$$)
tgpu_comptime.ts 14.41 kB ($${\color{green}-94.6\%}$$)
tgpu_unroll.ts 2.60 kB ($${\color{green}-99.0\%}$$)
tgpu_slot.ts 1.57 kB ($${\color{green}-99.4\%}$$)
tgpu_lazy.ts 1.22 kB ($${\color{green}-99.5\%}$$)

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

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 [0.82, 1.72, 3.81, 5.95, 6.49, 10.90, 19.60, 22.65]
  line [0.86, 1.70, 3.96, 5.34, 6.35, 11.56, 20.04, 19.74]
  line [0.73, 1.59, 3.41, 5.64, 6.72, 9.55, 19.87, 20.41]
Loading
---
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.32, 0.53, 0.67, 0.74, 1.08, 1.16, 1.36, 1.49]
  line [0.25, 0.49, 0.62, 0.78, 1.04, 1.06, 1.28, 1.46]
  line [0.33, 0.53, 0.60, 0.73, 0.96, 1.03, 1.25, 1.35]
Loading
---
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.80, 1.91, 4.35, 5.57, 10.96, 24.24, 50.13, 101.49]
  line [0.85, 1.88, 3.93, 5.73, 11.01, 22.76, 50.22, 101.55]
  line [0.73, 1.88, 3.87, 5.52, 11.02, 22.91, 49.49, 101.94]
Loading

@iwoplaza iwoplaza force-pushed the feat/create-typegpu branch 3 times, most recently from ee9887c to 95e76c3 Compare July 9, 2026 14:57
iwoplaza added 3 commits July 9, 2026 17:02
Update pnpm-lock.yaml

Add files

Not private
Update pnpm-lock.yaml

Add files

Not private
@iwoplaza iwoplaza force-pushed the feat/create-typegpu branch from 95e76c3 to c07313d Compare July 9, 2026 15:03
@iwoplaza iwoplaza force-pushed the feat/create-typegpu branch from 5aa7c55 to 1b9c59a Compare July 9, 2026 16:23
@iwoplaza iwoplaza force-pushed the feat/create-typegpu branch from 1b9c59a to 9c77259 Compare July 9, 2026 16:26
@iwoplaza iwoplaza marked this pull request as ready for review July 9, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new create-typegpu workspace package intended to support npm create typegpu by delegating execution to the latest released @typegpu/cli.

Changes:

  • Introduces packages/create-typegpu with a Node shebang bin.mjs that spawns npx @typegpu/cli@latest.
  • Adds package metadata (package.json), minimal TS config, and a README for the new package.
  • Updates pnpm-lock.yaml to include the new workspace package’s devDependencies.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds lockfile entries for the new create-typegpu workspace package.
packages/create-typegpu/tsconfig.json Adds a minimal TS config for type-checking the package entrypoint.
packages/create-typegpu/README.md Documents the new npm create typegpu entrypoint and relationship to @typegpu/cli.
packages/create-typegpu/package.json Declares the new package, its bin entry, scripts, and engine constraints.
packages/create-typegpu/bin.mjs Implements the proxy behavior by spawning npx @typegpu/cli@latest.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/create-typegpu/README.md Outdated
Comment thread packages/create-typegpu/package.json Outdated
Comment on lines +6 to +20
function asyncSpawn(/** @type {Parameters<typeof spawn>} */ ...args) {
return new Promise((resolve, _reject) => {
const child = spawn(...args);

child.on('exit', (code, signal) => {
if (signal) {
process.kill(process.pid, signal);
process.exit(0);
return;
}

resolve(code);
});
});
}
Comment on lines +22 to +27
(async () => {
const code = await asyncSpawn('npx', [`@typegpu/cli@latest`, ...process.argv.slice(2)], {
stdio: 'inherit',
});
process.exit(code ?? 0);
})();
Comment thread packages/create-typegpu/package.json Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The proxy wrapper has a couple of small but real correctness issues (signal exit codes and missing spawn-error handling) plus a README markdown typo that should be fixed before merge.

Reviewed changes — adds the create-typegpu npm initializer package that forwards npm create typegpu (and npx create-typegpu) to npx @typegpu/cli@latest.

  • Adds packages/create-typegpu/package.json, bin.mjs, tsconfig.json, and README.md.
  • bin.mjs spawns @typegpu/cli@latest with inherited stdio and returns the child exit code.
  • Adds the new workspace package to pnpm-lock.yaml.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread packages/create-typegpu/bin.mjs Outdated
Comment thread packages/create-typegpu/bin.mjs Outdated
Comment thread packages/create-typegpu/README.md Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — follow-up commit on feat/create-typegpu addresses prior Pullfrog review feedback and hardens the initializer's cross-platform behavior.

  • Fixed the malformed @typegpu/cli markdown link in the README.
  • Removed process.exit(0) after signal forwarding in bin.mjs, so the proxy no longer reports success when the child is killed by a signal.
  • Added a child.on('error') listener that rejects the spawn promise, plus a top-level try/catch that logs spawn failures and exits non-zero.
  • Switched the spawned command to npx.cmd on Windows so the wrapper works outside WSL.
  • Updated test:types to target the project tsconfig.json without emit and raised the declared Node engine to >=22.0.0.

Pullfrog  | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@iwoplaza iwoplaza force-pushed the feat/create-typegpu branch from a896887 to 697cbad Compare July 9, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants