yarramate 1.13.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/CONSUMING-YARRAMATE.md +56 -0
- package/docs/MODEL-FLOOR.md +16 -0
- package/package.json +1 -1
|
@@ -484,6 +484,62 @@ Anything the mapping does not recognise is carried verbatim on `07 Other
|
|
|
484
484
|
Facts` rather than dropped, so a workbook stays lossless across a compiler
|
|
485
485
|
that grows new predicates.
|
|
486
486
|
|
|
487
|
+
**Marking up the sheets.** `WorkbookSheet` takes optional `headerStyle`,
|
|
488
|
+
`columnStyles` and `columnWidths`. The styles are a closed set of **roles**
|
|
489
|
+
rather than appearances — `header`, `muted`, `emphasis` — so the test for
|
|
490
|
+
admitting a fourth is whether it can be named without reference to how it
|
|
491
|
+
looks. A request for a colour is the one a closed set exists to refuse,
|
|
492
|
+
because that is what turns a style vocabulary into a styling engine.
|
|
493
|
+
|
|
494
|
+
The use worth having is not decoration. Where a workbook's columns differ in
|
|
495
|
+
what they reach — some binding to the model, some carried alongside it, some
|
|
496
|
+
computed and ignored on the way back — an editor cannot see which is which,
|
|
497
|
+
and finds out only when an import reports that a cell could not be written
|
|
498
|
+
back. A role in the file says it while they are typing.
|
|
499
|
+
|
|
500
|
+
**Formatting is not content in either direction, from 1.13.0.** A styled
|
|
501
|
+
workbook reads back exactly as an unstyled one, and an editor's own formatting
|
|
502
|
+
is ignored on import — then lost on the next export, because the workbook is
|
|
503
|
+
regenerated from the model. That last part is why producer-applied styling is
|
|
504
|
+
the only kind that survives.
|
|
505
|
+
|
|
506
|
+
The version matters here and nowhere else in this section, because this
|
|
507
|
+
sentence is a **guarantee**, and a guarantee's job is to let you decide not to
|
|
508
|
+
write a test. It did not hold in **v1.6.0 through v1.12.0**: a cell carrying
|
|
509
|
+
formatting and no value — which is what Excel writes for a formatted empty
|
|
510
|
+
cell — was read against the previous cell's column, so importing a workbook
|
|
511
|
+
somebody had merely opened and saved could clear a neighbouring value. If you
|
|
512
|
+
are pinned below 1.13.0, that path is the one place this section's promise is
|
|
513
|
+
worth testing rather than taking.
|
|
514
|
+
|
|
515
|
+
**An optional feature's absence is silent, and that is your test to write.**
|
|
516
|
+
Passing none of these fields produces byte-identical output to a release
|
|
517
|
+
before they existed. That is asserted here by a test that writes the same
|
|
518
|
+
sheet with and without the fields, and it has been checked the way you can
|
|
519
|
+
check it yourself: call `writeXlsx` with the same plain sheets under the
|
|
520
|
+
published 1.12.0 and 1.13.0 packages and hash the results. They are identical,
|
|
521
|
+
byte for byte, and two people have run it with different fixtures. That property is what makes the feature safe to adopt,
|
|
522
|
+
and it is exactly what makes its absence undetectable: if a rename, a bad
|
|
523
|
+
merge or a refactor stops the fields reaching the writer, every test that
|
|
524
|
+
asserts on *behaviour* stays green while the workbook ships with no roles at
|
|
525
|
+
all, because a workbook with no styling is completely valid.
|
|
526
|
+
|
|
527
|
+
The general form, which reaches past this feature to any optional thing you
|
|
528
|
+
take from a library: **assert the feature arrived, not only that the result
|
|
529
|
+
is well-formed.** One positive test at the consumer that fails when the
|
|
530
|
+
feature stops arriving — the styles part is in the bytes, the header is
|
|
531
|
+
present, the width was applied.
|
|
532
|
+
|
|
533
|
+
**Assert on the artefact, not on the call.** The obvious test is that you
|
|
534
|
+
passed `columnStyles` — inspect the object you handed the writer, or spy on
|
|
535
|
+
the argument — and it is both the easier test to write and the one that
|
|
536
|
+
passes forever while the feature stops arriving, because it asserts your
|
|
537
|
+
intent rather than the result. Read the produced bytes. An absence-shaped
|
|
538
|
+
regression is invisible to any assertion that never opens the output. Behavioural assertions cannot catch an
|
|
539
|
+
absence-shaped regression, because the behaviour is well-defined in both
|
|
540
|
+
cases. This is the same reason a `?? ''` default hides a missing column: what
|
|
541
|
+
degrades gracefully degrades quietly.
|
|
542
|
+
|
|
487
543
|
**Reading one back.** `yarramate import xlsx <workbook.xlsx> <workspace.yaml>`
|
|
488
544
|
merges an edited workbook into the model. An unedited round trip changes
|
|
489
545
|
nothing, byte for byte.
|
package/docs/MODEL-FLOOR.md
CHANGED
|
@@ -220,6 +220,22 @@ locator against the subject, with the provider named. Core never resolves,
|
|
|
220
220
|
fetches, or interprets the URI: URI ownership is the provider's (ADR 0068,
|
|
221
221
|
`docs/EVIDENCE.md`).
|
|
222
222
|
|
|
223
|
+
**So no condition can ask about what is inside it, and that is the design
|
|
224
|
+
rather than a gap.** An annex is not compiled, so nothing about its contents
|
|
225
|
+
reaches the graph the interrogation runs over. A catalogue therefore cannot
|
|
226
|
+
ask "are the field mappings recorded"; it can only ask **who confirmed that
|
|
227
|
+
they are**, which is what `missing-attestation` is for. An attestation names a
|
|
228
|
+
person and a date, and where the substance lives outside the graph that is the
|
|
229
|
+
only honest instrument left — a condition claiming to check annex contents
|
|
230
|
+
would be claiming to check something Core never read.
|
|
231
|
+
|
|
232
|
+
This is the adopter-facing half of CONTRIBUTING.md's fifth rule, arrived at
|
|
233
|
+
from the other side. There a check could not see what a declaration compiles
|
|
234
|
+
to, by accident. Here it cannot see what was deliberately never compiled, by
|
|
235
|
+
design. Same reach limit, opposite cause, and the remedies differ: that one is
|
|
236
|
+
fixed by reading the graph instead of the vocabulary, and this one is not
|
|
237
|
+
fixed at all, because there is nothing to read.
|
|
238
|
+
|
|
223
239
|
## Deliberately open
|
|
224
240
|
|
|
225
241
|
Two of the refusals above are recorded limits rather than settled doctrine,
|