electric-sql / legacy-cli

ElectricSQL command line interface (CLI) tool.
https://electric-sql.com/docs
Apache License 2.0
10 stars 0 forks source link

[BREAKING] config: rename `.electricrc` to `electric.json`. #22

Closed thruflo closed 1 year ago

thruflo commented 1 year ago

The point of this is to enable to file to be loaded by Javascript code using the default builder plugins, such as https://esbuild.github.io/content-types/#json

Given that it is a JSON file, if we give it the .json ending, then it's trivially importable by Javascript code. If not, then we and users need to faff around with custom loader config to treat the file as JSON.

The payoff for this is large: we get to just configure the app identifier once, using electric init and then setup all the examples to load the config from electric.json. That removes a bunch of duplication in the instructions.

Warning: we need to coordinate before merging this to align the examples and the documentation with the new filename.

balegas commented 1 year ago

I think this is a great improvement to have electric init generate the initial configuration and everything is built from that.

It is also an opportunity to simplify migrations import and get rid of import { data as bundle } from './migrations/dist', or at least have this pre-configured on the generated file.

balegas commented 1 year ago

Need to change the base branch so it doesn't include #20