Name the version in every seed promise, and say to regenerate seeded fixtures when it changes
This commit is contained in:
@@ -829,8 +829,9 @@ the output.
|
|||||||
|
|
||||||
Semver tags on `main`, `v0.1.0` first; one version covers the shipped data, the
|
Semver tags on `main`, `v0.1.0` first; one version covers the shipped data, the
|
||||||
library and the CLI, and [`CHANGELOG.md`](CHANGELOG.md) names what each release
|
library and the CLI, and [`CHANGELOG.md`](CHANGELOG.md) names what each release
|
||||||
changed. A consumer's data, code and scripts keep working across a minor or a patch:
|
changed. A consumer's data, code and scripts keep working across a minor or a patch,
|
||||||
a minor only adds, and a major is the only release that changes what exists.
|
except output pinned to a seed. A minor only adds, and a major is the only release that
|
||||||
|
changes what exists.
|
||||||
|
|
||||||
| Surface | Major | Minor |
|
| Surface | Major | Minor |
|
||||||
|---------|-------|-------|
|
|---------|-------|-------|
|
||||||
@@ -843,9 +844,11 @@ a minor only adds, and a major is the only release that changes what exists.
|
|||||||
A patch changes no row of this table: performance, docs, or a fix inside a promised
|
A patch changes no row of this table: performance, docs, or a fix inside a promised
|
||||||
behaviour that adds or removes no value and changes no path, format or spelling.
|
behaviour that adds or removes no value and changes no path, format or spelling.
|
||||||
|
|
||||||
Any release, a patch too, may change what a seed draws, so pin seeded fixtures to one
|
Any release, a patch too, may change what a seed draws, so regenerate seeded fixtures
|
||||||
version. An error's wording may
|
whenever the fejkdata version changes.
|
||||||
improve in a minor; the path, rejected spelling and replacement it names may not.
|
|
||||||
|
An error's wording may improve in a minor; the path, rejected spelling and replacement
|
||||||
|
it names may not.
|
||||||
|
|
||||||
Before `v1.0.0` a minor is the breaking unit: `0.(x+1).0` may carry a major's
|
Before `v1.0.0` a minor is the breaking unit: `0.(x+1).0` may carry a major's
|
||||||
changes, each named in the changelog, and a `0.x.y` patch may not. `v1.0.0` is
|
changes, each named in the changelog, and a `0.x.y` patch may not. `v1.0.0` is
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ array, one JSON object per line, one CSV row (after a header), or one INSERT.
|
|||||||
--list list the paths the data offers, then exit
|
--list list the paths the data offers, then exit
|
||||||
--no-shipped-data load only the --data-path directories
|
--no-shipped-data load only the --data-path directories
|
||||||
-n, --repeat N render the value N times, 1..1048576 (default 1)
|
-n, --repeat N render the value N times, 1..1048576 (default 1)
|
||||||
-s, --seed N seed for reproducible output
|
-s, --seed N seed: the same seed, version and data give identical output
|
||||||
--separator S string between repeated values (default newline)
|
--separator S string between repeated values (default newline)
|
||||||
--table T the INSERT target for --format sql (default: the path's last segment, or records for an inline template)
|
--table T the INSERT target for --format sql (default: the path's last segment, or records for an inline template)
|
||||||
--version print the version, then exit
|
--version print the version, then exit
|
||||||
|
|||||||
+2
-2
@@ -57,8 +57,8 @@ type config struct {
|
|||||||
// Option configures a [Generator].
|
// Option configures a [Generator].
|
||||||
type Option func(*config)
|
type Option func(*config)
|
||||||
|
|
||||||
// WithSeed makes output reproducible: two generators with the same seed and data
|
// WithSeed makes output reproducible: two generators with the same seed, version and
|
||||||
// emit identical sequences.
|
// data emit identical sequences.
|
||||||
func WithSeed(seed uint64) Option {
|
func WithSeed(seed uint64) Option {
|
||||||
return func(c *config) { c.seed, c.seeded = seed, true }
|
return func(c *config) { c.seed, c.seeded = seed, true }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
### 77. Split the shipped data into Go modules per locale and country, which a library imports by choice, and embed every one in the CLI.
|
### 77. Split the shipped data into Go modules per locale and country, which a library imports by choice, and embed every one in the CLI.
|
||||||
|
|
||||||
The CLI binary carries every module and may grow to hundreds of MB; a library imports only what it uses, as it imports any dependency, and nothing is fetched at run time. Goal 2 says what ships where. The maintainer decided on 2026-10-04: one module per locale, one per country's `geo/` tree, and one for `misc`. A module registers nothing when imported; the library passes it to `New` as an option, per the technical principles "Compose, do not entangle" and "Explicit over implicit". Still to decide: what a bare `New()` loads; whether a module's data is an `fs.FS` passed to the existing `WithDataFS` or a new option such as `WithData(svse.Data)`; and whether `WithoutShippedData` goes. Before the module API ships, a panel of the README's audience personas tries pulling in data with it.
|
The CLI binary carries every module and may grow to hundreds of MB; a library imports only what it uses, as it imports any dependency, and nothing is fetched at run time. Goal 2 says what ships where. The maintainer decided on 2026-10-04: one module per locale, one per country's `geo/` tree, and one for `misc`. A module registers nothing when imported; the code importing it passes it to `New` as an option, per the technical principles "Compose, do not entangle" and "Explicit over implicit". Still to decide: what a bare `New()` loads; whether a module's data is an `fs.FS` passed to the existing `WithDataFS` or a new option such as `WithData(svse.Data)`; and whether `WithoutShippedData` goes. Before the module API ships, a panel of the README's audience personas tries pulling in data with it.
|
||||||
|
|
||||||
### 78. Ship 10% of every place's streets, at least 10, and 10% of all US places drawn by population, each place weighted by population.
|
### 78. Ship 10% of every place's streets, at least 10, and 10% of all US places drawn by population, each place weighted by population.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user