kubernetes-sigs / kui

A hybrid command-line/UI development experience for cloud-native development
Apache License 2.0
2.84k stars 183 forks source link

chore: leverage babel watcher #9274

Closed starpit closed 1 year ago

starpit commented 1 year ago

Up till now, we've only used a typescript watcher and a webpack watcher. This PR adds in the babel watcher.

TODO: not covered by this PR is auto-regenerating the prescan.json (npx kui-prescan) in a watchy fashion. To do so would I think require somehow hooking into the babel watchers. Because we can only regenerate prescan after babel is done. I don't see (yet) a way to hook into babel in this fashion, i.e. a post-compile watch hook. I did look into using webpack for this, since it does have a notion of post-watch and post-compile; but there is still a race between babel, which results in massive instability. I also contemplated hooking into the typescript watcher (via tsc-watch); we could use this, but it would require rebuilding all of babel on every tiny typescript change. So, for now, one must still rerun npx kui-prescan manually, every time a new kui command registration is added.

Description of what you did:

Required Items

Optional Items

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: starpit

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/kui/blob/master/OWNERS)~~ [starpit] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment