Repository navigation
refactor(web): load the wgsl module types from tsconfig - #67
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
wgsl-env.d.ts held a single triple-slash directive, which is comment syntax carrying real behavior: it gave TypeScript the module declarations for the shader imports. @vgpu/wgsl documents a compilerOptions.types entry as the equivalent setup, so list the package types in tsconfig.json and delete the file. Without the entry, typecheck fails with TS2307 on the three shader imports in the landing store canvas, so the entry is what supplies the types.
09895aa to
2ef8bab
Compare
Background
apps/web/wgsl-env.d.tsheld a single line,/// <reference types="@vgpu/wgsl/wgsl-types" />. That directive is written as a comment but changes behavior: it gives TypeScript thedeclare module "*.wgsl"types that the landing page's three shader imports need. The repository keeps no comments in code. The@vgpu/wgslREADME documents a second setup, acompilerOptions.typesentry intsconfig.json.Summary
"types": ["@vgpu/wgsl/wgsl-types"]toapps/web/tsconfig.json.apps/web/wgsl-env.d.ts.Verification
bun run typecheckinapps/web(next typegen && tsc --noEmit) passes../bloom.wgsl,./glow.wgsl, and./scene.wgslincomponents/landing/store/canvas.tsx. So the new entry is what supplies the types.bun run buildinapps/webpasses. Next leavestsconfig.jsonunchanged.bun run checkpasses.Setting
typesmeans only the listed packages load as globals. Typecheck passes with just this entry, because the app reaches React and Node types through imports andnext-env.d.ts. If a global type package is needed later, add it to the list.Checklist
vecstore-sdk(site only)