software-mansion / TypeGPU

TypeScript library that enhances the WebGPU API, allowing resource management in a type-safe, declarative way.
http://typegpu.com
MIT License
143 stars 2 forks source link

Run a dev build before starting watch to properly initialize every package in order. #302

Closed iwoplaza closed 1 month ago

iwoplaza commented 1 month ago

pnpm --parallel -r dev runs the dev script for every package that has it. It has to do it in parallel because by default, pnpm runs these scripts in the order of dependencies, for example:

This does not work for watch scripts, because they never finish. This however creates a problem, where if typegpu-docs builds before typegpu does, we get an error, so we usually have to rerun the script a couple times.

Possible solution

Change:

"dev": "EXPERIMENTAL=true pnpm --parallel -r dev",

Into:

"dev": "pnpm -r dev:build && pnpm --parallel -r dev:watch",

Where dev:build builds a package in development mode, so no need to do production-step checks and such, and dev:watch works like dev worked previously.