observablehq / framework

A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
https://observablehq.com/framework/
ISC License
2.41k stars 111 forks source link

Allow specifying multiple configuration files, use it to simplify example configurations #1392

Closed mythmon closed 4 months ago

mythmon commented 4 months ago

I implemented the layered config idea I sketched out in https://github.com/observablehq/framework/pull/1390#issuecomment-2127933059. This allows the --config option to be passed multiple times. The passed configs are merged together before normalization to produce a final configuration. Configuration files can also be functions that take the current config spec as input.

With that done, I used it to simplify the examples. I removed all the common boiler plate that was marked as "feel free to remove this" and moved it to a single file at examples/common/confing.js. To build the examples for deploy now we would run (from the specific example's directory).

yarn build --config ./observablehq.config.js --config ../common/config.js

This approach would replace #1390 and #1389 if we provide a way to specify deploy info or deploy config paths in the main config.

Fil commented 4 months ago

superseded by #1396