Skip to content

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Oct 14, 2025

Fixes #

Changelog Entry

Description

Design

Build scripts changes

  • npm run build:pre will rewrite package.json/localDependencies and package.json/scripts/start
    • scripts/start is computed and overwrite automatically 🥳
    • By overwriting things directly in package.json, we can see what it will run against
  • npm run start actually run npm run build:run once and exit, no tsup --watch
    • Will pick up new changes in tsup.config.ts 🥳
    • Build error will be retried on next file change, no more silent build stop 🥳
  • Use inotifywatch to watch for changes
    • No initial build, devs must run npm run build themselves first 🥳
  • It still use brute-force to "keep rebuilding until no files change"
    • I don't want to build a complex "what need to build first/last" script right now
  • Trigger next package by touching package.json, right after ESM is built
    • It was waiting until all CJS + ESM + DTS is done... I think we only need ESM is done is fine... tweakable
    • tsup --onSuccess will be triggered twice, one for CJS and one for ESM
  • DTS easily takes ~20 seconds to build
    • dtsroll is in build:post:dtsroll, because we don't need it in development environment
  • Why not prebuild/postbuild... because I want to keep --ignore-scripts enabled
  • I also relocated some scripts under /scripts/npm/bump-dev.sh, etc...

Tried nodemon and node --watch, both doesn't work as good as inotifywait. Especially around how it queue up changes while the build is ongoing. inotifywait in shell script is most flexible option.

Specific Changes

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

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.

1 participant