webtoon / psd

Fast zero-dependency PSD parser for the web and Node.js
https://webtoon.github.io/psd
MIT License
1.21k stars 55 forks source link

build: use wireit, npm-run-all2 for build & watch #53

Closed pastelmind closed 2 years ago

pastelmind commented 2 years ago

Use wireit to specify dependency relationships between build scripts of each package, cache build outputs, incrementally rebuild scripts, and watch for changes.

Furthermore, use npm-run-all2 to run Vite and wireit in watch mode for @webtoon/psd-example-browser and @webtoon/psd-benchmark. This is needed because wireit currently does not support "service" scripts. (see: https://github.com/google/wireit/issues/33)

Using wireit and npm-run-all2 makes our development NPM scripts (e.g. npm run start:browser) more reliable. The scripts now "just work" in a fresh local clone of the repo, and do not require arbitrary sleep calls or polling delays to properly rebuild multiple packages.

Since wireit and npm-run-all2 handle our build orchestration, we can remove packages like rollup-plugin-shell, rollup-plugin-watcher, and nodedev that we previously used for watching the filesystem and running build tools.

Resolves #28