@eriknaslund/skiss 0.3.0 → 0.5.0
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/LICENSE +1 -1
- package/README.md +8 -2
- package/dist/cli.js +412 -58
- package/dist/index.d.ts +15 -7
- package/dist/index.js +299 -52
- package/package.json +6 -3
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ Skiss is text you can type while someone talks. A field is one line. A change is
|
|
|
41
41
|
- **What you leave out means "not yet".** Never "unknown", never "none". A sketch is silent about what you do not know.
|
|
42
42
|
- **`@Catalog` says which system owns a thing.** On a class, or on a single field when the box is really a view over two systems.
|
|
43
43
|
- **`~` and `=` are two different statements.** `~` says two classes are about the same thing. `=` says which field joins to which. The first is a domain conversation, the second an integration conversation.
|
|
44
|
+
- **`<` inherits, once.** `Jedi < Character` on the class line: the child has everything the parent has and adds its own. One parent, no mixins; it compiles to `is_a`.
|
|
44
45
|
- **`#` describes, `?` doubts.** A description ends up in generated documentation. A doubt never does.
|
|
45
46
|
- **Every line stands on its own.** A half-typed line breaks that line and nothing else, so the diagram keeps rendering while you type.
|
|
46
47
|
- **Everything you can write compiles to valid LinkML.** Skiss is a strict subset. Nothing is lost on the way up.
|
|
@@ -62,9 +63,11 @@ Or without installing: `npx @eriknaslund/skiss diagram model.skiss`.
|
|
|
62
63
|
|
|
63
64
|
`skiss diagram` writes a Mermaid class diagram to standard output; `-o diagram.mmd` writes it to a file, `--notes` includes the `?` doubts as notes, and `-` reads standard input. Anything the file gets wrong is reported on standard error, one line each, and the diagram is still drawn from the lines that parse. `--strict` makes that a non-zero exit. `skiss --help` lists the rest.
|
|
64
65
|
|
|
66
|
+
`skiss render model.skiss -o model.svg` writes a picture rather than the Mermaid text. A class diagram is laid out in a browser, so this one command needs a browser: it delegates to the official [Mermaid CLI](https://github.com/mermaid-js/mermaid-cli), which you install yourself with `npm install -g @mermaid-js/mermaid-cli`. Nothing in the package or the library depends on it, and `skiss render` says that line and exits 2 when it is not there. The format is the extension of `-o` — `.svg` or `.png` — and `--format svg|png` overrides it; with no `-o` the SVG goes to standard output, and a PNG always needs an `-o`. `--scale` is what the PNG is rasterised at and defaults to 2; `--notes`, `--strict` and the diagnostics work as they do for `diagram`. When `mmdc` itself fails, its exit status is the command's.
|
|
67
|
+
|
|
65
68
|
`skiss compile model.skiss` writes a LinkML schema instead, as YAML on standard output. `--json` writes the same schema as JSON, `--name` sets the schema name (it defaults to the file name without its extension, and to `sketch` when reading standard input), and `-o`, `-`, `--strict` and the diagnostics work exactly as they do for `diagram`.
|
|
66
69
|
|
|
67
|
-
`skiss import schema.linkml.yaml` goes the other way: it reads a LinkML schema, YAML or JSON, and writes Skiss. What the projection could not carry —
|
|
70
|
+
`skiss import schema.linkml.yaml` goes the other way: it reads a LinkML schema, YAML or JSON, and writes Skiss. What the projection could not carry — patterns, `required`, `mixins`, the names it had to convert — is one line on standard error before the diagnostics, because a sketch is a smaller language than LinkML and that line says by how much. `-o`, `-` and the diagnostics work as they do for `compile`; `--strict` exits 1 when the projected sketch has a diagnostic, and also when anything was dropped. An input that is not a schema at all — not YAML, or YAML no schema can be read out of — produces no sketch, says why on standard error, and exits 2, the code every command uses for unreadable input.
|
|
68
71
|
|
|
69
72
|
`npm install @eriknaslund/skiss` also gives you the library: `compile`, `formatDiagnostic`, `parse`, `resolve`, `toLinkML`, `serialize`, `toMermaid`, `toSkiss`, `fromLinkML`, `formatDropped`, `importLinkML` and `VERSION`, browser-safe.
|
|
70
73
|
|
|
@@ -79,11 +82,14 @@ Editors that render Skiss live are separate projects built on this package. This
|
|
|
79
82
|
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | How the code is organised. |
|
|
80
83
|
| [docs/adr/](docs/adr/) | Architecture decision records. |
|
|
81
84
|
| [docs/ROADMAP.md](docs/ROADMAP.md) | What comes next. |
|
|
85
|
+
| [docs/RELEASING.md](docs/RELEASING.md) | How a version reaches npm. |
|
|
82
86
|
| [AGENTS.md](AGENTS.md) | How this repository is built. |
|
|
83
87
|
|
|
84
88
|
## Status
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
0.5.0, published on npm as [`@eriknaslund/skiss`](https://www.npmjs.com/package/@eriknaslund/skiss). The language parses, resolves and diagnoses; `skiss diagram` draws it, `skiss compile` writes LinkML that the real LinkML toolchain validates in CI, and `skiss import` reads a LinkML schema back into a sketch. The library exports the same in both directions and is browser-safe.
|
|
91
|
+
|
|
92
|
+
The [specification](docs/SPEC.md) is at 0.3 and moves when the language does, which is not with every release. Not built: editing a projected schema so that what Skiss cannot express survives the edit (SPEC §8.1). [CHANGELOG.md](CHANGELOG.md) is what changed when.
|
|
87
93
|
|
|
88
94
|
## License
|
|
89
95
|
|