Tailwind

Banyan now uses Tailwind 3.0 to build the CSS, both in live server and during static site generation. This does add nodeJS as our dev dependencuy, but on the plus side we get all the cool new features of Tailwind (like print:hidden).

PbBEzg5uCNOH9
2022-01-03 16:08:20.719 UTC

node’s concurrently is a decent package that mimics Procfile.

  "scripts": {
    "dev": "concurrently npm:banyan:*",
    "banyan:tailwind": "cd tailwind && make",
    "banyan:haskell": "bin/run-haskell"
  }

I use this to spawn both ghcid and tailwindcss watcher in the same process, with output interleaved. Though concurrently seems to have trouble with actually shutting down ghcid. I have to manually kill a stale ghcid spawned process to make the port available.

TWOlhrUudRkKK
2022-01-03 15:44:01.489 UTC

Keeping generated CSS in source control.

So banyan user will not have to be running Tailwind watcher. For apps like Emanote we want the user to be able to do this, though. But other Ema apps don’t need to. So there are two models here:

  1. Dev-time Tailwind watcher
  2. Run-time Tailwind watcher

No. 1 is simpler to implement, and should be sufficient for most Ema apps. But Emanote will need No. 2, which also brings in a long-running nodeJS process into user’s machine.

uMz4MuRwCsHKa
2022-01-03 02:13:53.895 UTC

Initial prototype for this is working well. Just need to run tailwindcss watcher in separate terminal, and the model static file “versioning” trick picks up the Tailwind’s artifact, albeit with a slight delay, which is acceptable.

Just (Meta {title = Just "Tailwind", date = Just 2022-01-03 02:13:14.615 UTC, parent = Just PjorLl0gmEykt})