binyamin / cedar

A set of tools for building static sites
MIT License
0 stars 0 forks source link

In serve mode, reload when dependencies change #5

Open binyamin opened 2 years ago

binyamin commented 2 years ago

Summary

In serve mode, reload a file when one of its dependencies changes. This makes development much easier, and matches the behavior of many task-runners and static-site generators.

Tasks

Notes

binyamin commented 2 years ago

Currently, this is how each entity is connected.

graph TD;
    A{CLI} --- B[server];
    A --- C[runner];
    C --- D[Plugin #1];
    C --- E[Plugin #2];

The best place to create the dependency graph is in the runner, pulling from each plugin. We would then pass that to the CLI, which would communicate with the server.


graph RL
    A{CLI} --> B["Server (watcher)"]
    subgraph build [Create the graph]
    D1[Plugin #1] & D2[Plugin #2] --> C[Runner]
    end
    C --> A