@quillmark/quiver 0.8.0 → 0.10.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/README.md +12 -13
- package/dist/bin/quiver.d.ts +16 -0
- package/dist/bin/quiver.js +165 -0
- package/dist/engine-types.d.ts +2 -0
- package/dist/preview.d.ts +9 -9
- package/dist/preview.js +9 -24
- package/dist/testing.d.ts +6 -4
- package/dist/testing.js +12 -8
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -44,17 +44,16 @@ my-quiver/
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
Recommended CI: use the bundled `@quillmark/quiver/testing` harness — it
|
|
47
|
-
loads with `Quiver.fromDir
|
|
48
|
-
surface on publish, not on the consumer's
|
|
49
|
-
`node:test` (built into Node 18+); no extra
|
|
50
|
-
required. If you prefer vitest/jest/mocha, write a
|
|
51
|
-
the main API instead.
|
|
47
|
+
loads with `Quiver.fromDir`, compiles every quill, and renders each quill's
|
|
48
|
+
blueprint so validation errors surface on publish, not on the consumer's
|
|
49
|
+
build. The harness uses `node:test` (built into Node 18+); no extra
|
|
50
|
+
test-runner dependency required. If you prefer vitest/jest/mocha, write a
|
|
51
|
+
12-line loop against the main API instead.
|
|
52
52
|
|
|
53
53
|
## Manual validation (rendering samples)
|
|
54
54
|
|
|
55
55
|
The CI harness proves every quill _compiles_; it does not produce output a
|
|
56
|
-
human can look at. To eyeball real renders,
|
|
57
|
-
quill's template (`quills/<name>/<x.y.z>/example.md`) and run the
|
|
56
|
+
human can look at. To eyeball real renders, run the
|
|
58
57
|
`@quillmark/quiver/preview` helper:
|
|
59
58
|
|
|
60
59
|
```ts
|
|
@@ -69,12 +68,12 @@ await renderQuiverSamples(import.meta.url, {
|
|
|
69
68
|
// → writes ./preview/<name>@<version>.<fmt> + index.html
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
It renders every quill's `
|
|
73
|
-
(default `preview/`), and emits an `index.html`
|
|
74
|
-
written into `outDir` so the generated artifacts
|
|
75
|
-
committed.
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
It renders every quill's auto-generated blueprint (`quill.blueprint`), writes
|
|
72
|
+
the artifacts to `outDir` (default `preview/`), and emits an `index.html`
|
|
73
|
+
gallery. A `.gitignore` is written into `outDir` so the generated artifacts
|
|
74
|
+
are never accidentally committed. A quill that throws is recorded as failed —
|
|
75
|
+
with every diagnostic, not just the first — without aborting the run, so one
|
|
76
|
+
broken quill never hides the rest.
|
|
78
77
|
|
|
79
78
|
To iterate on a subset, pass `include` / `exclude` (each entry matches a
|
|
80
79
|
quill name or canonical ref):
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Quiver CLI — build, test, and preview a quiver collection.
|
|
4
|
+
*
|
|
5
|
+
* Commands:
|
|
6
|
+
* quiver build [--out <dir>]
|
|
7
|
+
* quiver test
|
|
8
|
+
* quiver preview [--out <dir>] [--format <fmt>] [--quiet]
|
|
9
|
+
* [--include <ref>...] [--exclude <ref>...]
|
|
10
|
+
*
|
|
11
|
+
* Engine discovery (for `test` and `preview`):
|
|
12
|
+
* 1. Named exports `engine` and `Document` from `quiver.config.js` at the
|
|
13
|
+
* collection root, if the file exists.
|
|
14
|
+
* 2. Auto-imported `@quillmark/wasm` from the collection's node_modules.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Quiver CLI — build, test, and preview a quiver collection.
|
|
4
|
+
*
|
|
5
|
+
* Commands:
|
|
6
|
+
* quiver build [--out <dir>]
|
|
7
|
+
* quiver test
|
|
8
|
+
* quiver preview [--out <dir>] [--format <fmt>] [--quiet]
|
|
9
|
+
* [--include <ref>...] [--exclude <ref>...]
|
|
10
|
+
*
|
|
11
|
+
* Engine discovery (for `test` and `preview`):
|
|
12
|
+
* 1. Named exports `engine` and `Document` from `quiver.config.js` at the
|
|
13
|
+
* collection root, if the file exists.
|
|
14
|
+
* 2. Auto-imported `@quillmark/wasm` from the collection's node_modules.
|
|
15
|
+
*/
|
|
16
|
+
import { createRequire } from "node:module";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { pathToFileURL } from "node:url";
|
|
19
|
+
import { Quiver } from "../node.js";
|
|
20
|
+
import { renderQuiverSamples } from "../preview.js";
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Arg parsing helpers
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
const argv = process.argv.slice(2);
|
|
25
|
+
const command = argv[0];
|
|
26
|
+
function flag(name) {
|
|
27
|
+
const i = argv.indexOf(name);
|
|
28
|
+
return i !== -1 && i + 1 < argv.length ? argv[i + 1] : undefined;
|
|
29
|
+
}
|
|
30
|
+
function multiFlag(name) {
|
|
31
|
+
const out = [];
|
|
32
|
+
for (let i = 0; i < argv.length - 1; i++) {
|
|
33
|
+
if (argv[i] === name)
|
|
34
|
+
out.push(argv[i + 1]);
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
function hasFlag(name) {
|
|
39
|
+
return argv.includes(name);
|
|
40
|
+
}
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// Engine discovery
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
async function loadEngine(cwd) {
|
|
45
|
+
// 1. Named exports from quiver.config.js, if present.
|
|
46
|
+
try {
|
|
47
|
+
const cfg = await import(pathToFileURL(join(cwd, "quiver.config.js")).href);
|
|
48
|
+
if (cfg.engine != null && cfg.Document != null) {
|
|
49
|
+
return {
|
|
50
|
+
engine: cfg.engine,
|
|
51
|
+
Document: cfg.Document,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// File absent or incomplete — fall through to auto-discovery.
|
|
57
|
+
}
|
|
58
|
+
// 2. Auto-discover @quillmark/wasm from the collection's own node_modules.
|
|
59
|
+
const req = createRequire(pathToFileURL(join(cwd, "package.json")).href);
|
|
60
|
+
let wasmPath;
|
|
61
|
+
try {
|
|
62
|
+
wasmPath = req.resolve("@quillmark/wasm");
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
throw new Error("Cannot find @quillmark/wasm in this collection's node_modules.\n" +
|
|
66
|
+
" Install it: npm install @quillmark/wasm\n" +
|
|
67
|
+
" Or export { engine, Document } from quiver.config.js for a custom engine.");
|
|
68
|
+
}
|
|
69
|
+
const wasm = (await import(pathToFileURL(wasmPath).href));
|
|
70
|
+
return { engine: new wasm.Quillmark(), Document: wasm.Document };
|
|
71
|
+
}
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// Commands
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
async function build() {
|
|
76
|
+
const cwd = process.cwd();
|
|
77
|
+
const outDir = flag("--out") ?? "dist";
|
|
78
|
+
console.log(`quiver build: ${cwd} → ${outDir}`);
|
|
79
|
+
await Quiver.build(cwd, outDir);
|
|
80
|
+
console.log("done.");
|
|
81
|
+
}
|
|
82
|
+
async function test() {
|
|
83
|
+
const cwd = process.cwd();
|
|
84
|
+
const { engine, Document } = await loadEngine(cwd);
|
|
85
|
+
const quiver = await Quiver.fromDir(cwd);
|
|
86
|
+
const names = quiver.quillNames();
|
|
87
|
+
if (names.length === 0) {
|
|
88
|
+
console.error("error: quiver has no quills");
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
let pass = 0;
|
|
92
|
+
let fail = 0;
|
|
93
|
+
for (const name of names) {
|
|
94
|
+
for (const version of quiver.versionsOf(name)) {
|
|
95
|
+
const ref = `${name}@${version}`;
|
|
96
|
+
try {
|
|
97
|
+
const quill = await quiver.getQuill(ref, { engine });
|
|
98
|
+
const doc = Document.fromMarkdown(quill.blueprint);
|
|
99
|
+
const result = quill.render(doc);
|
|
100
|
+
if (!Array.isArray(result.artifacts) || result.artifacts.length === 0) {
|
|
101
|
+
throw new Error("blueprint render produced no artifacts");
|
|
102
|
+
}
|
|
103
|
+
console.log(`pass ${ref}`);
|
|
104
|
+
pass++;
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
console.error(`FAIL ${ref} — ${err.message}`);
|
|
108
|
+
fail++;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const total = pass + fail;
|
|
113
|
+
console.log(`\n${pass}/${total} passed`);
|
|
114
|
+
if (fail > 0)
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
117
|
+
async function preview() {
|
|
118
|
+
const cwd = process.cwd();
|
|
119
|
+
const { engine, Document } = await loadEngine(cwd);
|
|
120
|
+
const outDir = flag("--out");
|
|
121
|
+
const format = flag("--format");
|
|
122
|
+
const quiet = hasFlag("--quiet");
|
|
123
|
+
const include = multiFlag("--include");
|
|
124
|
+
const exclude = multiFlag("--exclude");
|
|
125
|
+
await renderQuiverSamples(cwd, {
|
|
126
|
+
engine,
|
|
127
|
+
Document,
|
|
128
|
+
...(outDir !== undefined && { outDir }),
|
|
129
|
+
...(format !== undefined && { format }),
|
|
130
|
+
quiet,
|
|
131
|
+
...(include.length > 0 && { include }),
|
|
132
|
+
...(exclude.length > 0 && { exclude }),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// Dispatch
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
function usage() {
|
|
139
|
+
console.error([
|
|
140
|
+
"Usage:",
|
|
141
|
+
" quiver build [--out <dir>]",
|
|
142
|
+
" quiver test",
|
|
143
|
+
" quiver preview [--out <dir>] [--format <fmt>] [--quiet]",
|
|
144
|
+
" [--include <ref>...] [--exclude <ref>...]",
|
|
145
|
+
].join("\n"));
|
|
146
|
+
}
|
|
147
|
+
function die(err) {
|
|
148
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
149
|
+
console.error(`error: ${msg}`);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
switch (command) {
|
|
153
|
+
case "build":
|
|
154
|
+
build().catch(die);
|
|
155
|
+
break;
|
|
156
|
+
case "test":
|
|
157
|
+
test().catch(die);
|
|
158
|
+
break;
|
|
159
|
+
case "preview":
|
|
160
|
+
preview().catch(die);
|
|
161
|
+
break;
|
|
162
|
+
default:
|
|
163
|
+
usage();
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
package/dist/engine-types.d.ts
CHANGED
|
@@ -23,4 +23,6 @@ export interface QuillmarkLike {
|
|
|
23
23
|
export interface QuillLike {
|
|
24
24
|
render(doc: unknown, opts?: unknown): unknown;
|
|
25
25
|
open?: (doc: unknown) => unknown;
|
|
26
|
+
/** Auto-generated annotated Markdown blueprint — always present in @quillmark/wasm >=0.79.0. */
|
|
27
|
+
blueprint: string;
|
|
26
28
|
}
|
package/dist/preview.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `runQuiverTests` (`@quillmark/quiver/testing`) proves every quill *compiles*
|
|
5
5
|
* — it never produces a rendered artifact a human can look at. This module
|
|
6
|
-
* closes that gap: it renders each quill's
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* closes that gap: it renders each quill's blueprint, writes the artifacts to
|
|
7
|
+
* a directory, and emits an `index.html` gallery so an author can eyeball real
|
|
8
|
+
* output before publishing.
|
|
9
9
|
*
|
|
10
10
|
* Node-only: writes files and loads a source quiver from disk.
|
|
11
11
|
*
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
* });
|
|
21
21
|
* // → open ./preview/index.html
|
|
22
22
|
*
|
|
23
|
-
* The
|
|
24
|
-
*
|
|
25
|
-
* skipped
|
|
23
|
+
* The sample document is the auto-generated blueprint (`quill.blueprint`) for
|
|
24
|
+
* each quill version. Every quill always has a blueprint, so no quills are
|
|
25
|
+
* skipped for lack of a sample document.
|
|
26
26
|
*
|
|
27
27
|
* A `.gitignore` is written into `outDir` so the generated artifacts are not
|
|
28
28
|
* accidentally committed.
|
|
@@ -61,8 +61,8 @@ export interface RenderQuiverSamplesOptions {
|
|
|
61
61
|
export interface RenderedSample {
|
|
62
62
|
/** Canonical ref, e.g. `"memo@1.0.0"`. */
|
|
63
63
|
ref: string;
|
|
64
|
-
/** `rendered` — artifacts written; `
|
|
65
|
-
status: "rendered" | "
|
|
64
|
+
/** `rendered` — artifacts written; `failed` — error. */
|
|
65
|
+
status: "rendered" | "failed";
|
|
66
66
|
/** Artifact filenames written under `outDir` (relative). */
|
|
67
67
|
files: string[];
|
|
68
68
|
/** Render warnings, formatted `"severity: message"`. */
|
|
@@ -74,7 +74,7 @@ export interface RenderedSample {
|
|
|
74
74
|
reasons: string[];
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Renders every quill's
|
|
77
|
+
* Renders every quill's blueprint and writes the artifacts plus an
|
|
78
78
|
* `index.html` gallery to `outDir`.
|
|
79
79
|
*
|
|
80
80
|
* Does NOT fail fast: a quill that throws is recorded as `failed` and the
|
package/dist/preview.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `runQuiverTests` (`@quillmark/quiver/testing`) proves every quill *compiles*
|
|
5
5
|
* — it never produces a rendered artifact a human can look at. This module
|
|
6
|
-
* closes that gap: it renders each quill's
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* closes that gap: it renders each quill's blueprint, writes the artifacts to
|
|
7
|
+
* a directory, and emits an `index.html` gallery so an author can eyeball real
|
|
8
|
+
* output before publishing.
|
|
9
9
|
*
|
|
10
10
|
* Node-only: writes files and loads a source quiver from disk.
|
|
11
11
|
*
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
* });
|
|
21
21
|
* // → open ./preview/index.html
|
|
22
22
|
*
|
|
23
|
-
* The
|
|
24
|
-
*
|
|
25
|
-
* skipped
|
|
23
|
+
* The sample document is the auto-generated blueprint (`quill.blueprint`) for
|
|
24
|
+
* each quill version. Every quill always has a blueprint, so no quills are
|
|
25
|
+
* skipped for lack of a sample document.
|
|
26
26
|
*
|
|
27
27
|
* A `.gitignore` is written into `outDir` so the generated artifacts are not
|
|
28
28
|
* accidentally committed.
|
|
@@ -30,12 +30,10 @@
|
|
|
30
30
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
31
31
|
import { join } from "node:path";
|
|
32
32
|
import { Quiver } from "./node.js";
|
|
33
|
-
/** The `example.md` filename looked up inside each quill version directory. */
|
|
34
|
-
const EXAMPLE_FILE = "example.md";
|
|
35
33
|
/** Default directory rendered artifacts are written to. */
|
|
36
34
|
const DEFAULT_OUT_DIR = "preview";
|
|
37
35
|
/**
|
|
38
|
-
* Renders every quill's
|
|
36
|
+
* Renders every quill's blueprint and writes the artifacts plus an
|
|
39
37
|
* `index.html` gallery to `outDir`.
|
|
40
38
|
*
|
|
41
39
|
* Does NOT fail fast: a quill that throws is recorded as `failed` and the
|
|
@@ -86,21 +84,10 @@ function failureReasons(err) {
|
|
|
86
84
|
}
|
|
87
85
|
async function renderOne(quiver, name, version, outDir, opts) {
|
|
88
86
|
const ref = `${name}@${version}`;
|
|
89
|
-
const tree = await quiver.loadTree(name, version);
|
|
90
|
-
const exampleBytes = tree.get(EXAMPLE_FILE);
|
|
91
|
-
if (exampleBytes === undefined) {
|
|
92
|
-
return {
|
|
93
|
-
ref,
|
|
94
|
-
status: "skipped",
|
|
95
|
-
files: [],
|
|
96
|
-
warnings: [],
|
|
97
|
-
reasons: [`no ${EXAMPLE_FILE} in quill directory`],
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
87
|
let result;
|
|
101
88
|
try {
|
|
102
89
|
const quill = await quiver.getQuill(ref, { engine: opts.engine });
|
|
103
|
-
const markdown =
|
|
90
|
+
const markdown = quill.blueprint;
|
|
104
91
|
const doc = opts.Document.fromMarkdown(markdown);
|
|
105
92
|
result = quill.render(doc, opts.format ? { format: opts.format } : undefined);
|
|
106
93
|
}
|
|
@@ -145,8 +132,7 @@ function printSummary(quiverName, outDir, results) {
|
|
|
145
132
|
for (const w of r.warnings)
|
|
146
133
|
console.log(` ⚠ ${w}`);
|
|
147
134
|
}
|
|
148
|
-
console.log(`\n${count("rendered")} rendered, ${count("
|
|
149
|
-
`${count("failed")} failed`);
|
|
135
|
+
console.log(`\n${count("rendered")} rendered, ${count("failed")} failed`);
|
|
150
136
|
console.log(`Open ${join(outDir, "index.html")} to review.\n`);
|
|
151
137
|
}
|
|
152
138
|
function escapeHtml(text) {
|
|
@@ -198,7 +184,6 @@ function renderIndexHtml(quiverName, results) {
|
|
|
198
184
|
.card { background: #fff; border: 1px solid #ddd; border-radius: 8px;
|
|
199
185
|
padding: 1rem; margin: 1rem 0; }
|
|
200
186
|
.card.failed { border-color: #e0b4b4; }
|
|
201
|
-
.card.skipped { opacity: 0.7; }
|
|
202
187
|
h2 { font-size: 1rem; margin: 0 0 0.5rem; }
|
|
203
188
|
.badge { font-size: 0.7rem; text-transform: uppercase; background: #eee;
|
|
204
189
|
border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
|
package/dist/testing.d.ts
CHANGED
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Usage (place this file next to your Quiver.yaml):
|
|
9
9
|
*
|
|
10
|
-
* import { Quillmark } from "@quillmark/wasm";
|
|
10
|
+
* import { Quillmark, Document } from "@quillmark/wasm";
|
|
11
11
|
* import { runQuiverTests } from "@quillmark/quiver/testing";
|
|
12
12
|
* const engine = new Quillmark();
|
|
13
|
-
* runQuiverTests(import.meta.url, engine);
|
|
13
|
+
* runQuiverTests(import.meta.url, engine, Document);
|
|
14
14
|
*
|
|
15
15
|
* Run with `node --test`.
|
|
16
16
|
*/
|
|
17
17
|
import type { QuillmarkLike } from "./engine-types.js";
|
|
18
|
+
import type { DocumentFactoryLike } from "./preview.js";
|
|
18
19
|
/**
|
|
19
20
|
* Registers a `node:test` describe block that validates every quill
|
|
20
21
|
* version in the quiver at `metaUrlOrDir` against the provided engine.
|
|
@@ -23,6 +24,7 @@ import type { QuillmarkLike } from "./engine-types.js";
|
|
|
23
24
|
* to Quiver.yaml). Pass an absolute directory path for any other layout.
|
|
24
25
|
*
|
|
25
26
|
* Validation covers the full loading pipeline: Quiver.yaml, Quill.yaml,
|
|
26
|
-
* all template files,
|
|
27
|
+
* all template files, engine compilation via engine.quill(tree), and a
|
|
28
|
+
* full render of each quill's blueprint document.
|
|
27
29
|
*/
|
|
28
|
-
export declare function runQuiverTests(metaUrlOrDir: string, engine: QuillmarkLike): void;
|
|
30
|
+
export declare function runQuiverTests(metaUrlOrDir: string, engine: QuillmarkLike, Document: DocumentFactoryLike): void;
|
package/dist/testing.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Usage (place this file next to your Quiver.yaml):
|
|
9
9
|
*
|
|
10
|
-
* import { Quillmark } from "@quillmark/wasm";
|
|
10
|
+
* import { Quillmark, Document } from "@quillmark/wasm";
|
|
11
11
|
* import { runQuiverTests } from "@quillmark/quiver/testing";
|
|
12
12
|
* const engine = new Quillmark();
|
|
13
|
-
* runQuiverTests(import.meta.url, engine);
|
|
13
|
+
* runQuiverTests(import.meta.url, engine, Document);
|
|
14
14
|
*
|
|
15
15
|
* Run with `node --test`.
|
|
16
16
|
*/
|
|
@@ -27,9 +27,10 @@ import { Quiver } from "./node.js";
|
|
|
27
27
|
* to Quiver.yaml). Pass an absolute directory path for any other layout.
|
|
28
28
|
*
|
|
29
29
|
* Validation covers the full loading pipeline: Quiver.yaml, Quill.yaml,
|
|
30
|
-
* all template files,
|
|
30
|
+
* all template files, engine compilation via engine.quill(tree), and a
|
|
31
|
+
* full render of each quill's blueprint document.
|
|
31
32
|
*/
|
|
32
|
-
export function runQuiverTests(metaUrlOrDir, engine) {
|
|
33
|
+
export function runQuiverTests(metaUrlOrDir, engine, Document) {
|
|
33
34
|
describe("Quiver", () => {
|
|
34
35
|
let quiver;
|
|
35
36
|
before(async () => {
|
|
@@ -40,12 +41,15 @@ export function runQuiverTests(metaUrlOrDir, engine) {
|
|
|
40
41
|
throw new Error("Quiver has no quills");
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
|
-
it("compiles every quill
|
|
44
|
+
it("compiles and renders every quill's blueprint without error", async () => {
|
|
44
45
|
for (const name of quiver.quillNames()) {
|
|
45
46
|
for (const version of quiver.versionsOf(name)) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const ref = `${name}@${version}`;
|
|
48
|
+
const quill = await quiver.getQuill(ref, { engine });
|
|
49
|
+
const doc = Document.fromMarkdown(quill.blueprint);
|
|
50
|
+
const result = quill.render(doc);
|
|
51
|
+
if (!Array.isArray(result.artifacts) || result.artifacts.length === 0) {
|
|
52
|
+
throw new Error(`${ref}: blueprint render produced no artifacts`);
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillmark/quiver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Quiver registry and build tooling for Quillmark",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,6 +63,9 @@
|
|
|
63
63
|
"typescript": "^5.9.3",
|
|
64
64
|
"vitest": "^4.0.18"
|
|
65
65
|
},
|
|
66
|
+
"bin": {
|
|
67
|
+
"quiver": "./dist/bin/quiver.js"
|
|
68
|
+
},
|
|
66
69
|
"scripts": {
|
|
67
70
|
"build": "tsc",
|
|
68
71
|
"test": "vitest run",
|