~/talk

Making A CLI with Vite (...kind of)

Talkat ViteConf 2023 · 2023-10-05..10-06· [developer-experience, javascript]
slides:none on file

A Vite SPA is packaged to run inside a CLI: the project serves the built web UI from the CLI process via Fastify and exposes file access and logs over trpc and websockets, with TypeScript types inferred end-to-end. Build pipeline uses Vite for the UI, NCC to produce a single-file Node bundle and tsup for additional packaging, copying the web dist into the CLI and rewriting routes. Output is a published package with no node_modules at runtime, and the setup works as a local webhook tester.

AI-written summary · about

  1. 0:00Introduction to Vite CLI
  2. 1:24Introducing Web Hook Thing
  3. 3:09Monorepo and CLI Core
  4. 5:54Web App with Vite
  5. 7:38Fastify Server Integration
  6. 8:18Bundling with NCC
  7. 10:44Final Build Output
  8. 11:46Demo and Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.