@orkestrel/guide 0.0.17 → 0.0.18
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 +40 -20
- package/dist/src/core/index.cjs +2400 -264
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +1616 -203
- package/dist/src/core/index.d.ts +1616 -203
- package/dist/src/core/index.js +2351 -269
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +3867 -0
- package/dist/src/server/index.cjs.map +1 -0
- package/dist/src/server/index.d.cts +686 -0
- package/dist/src/server/index.d.ts +686 -0
- package/dist/src/server/index.js +3833 -0
- package/dist/src/server/index.js.map +1 -0
- package/package.json +29 -17
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# @orkestrel/guide
|
|
2
2
|
|
|
3
|
-
A guides-parity
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`@orkestrel
|
|
3
|
+
> A guides-parity toolkit: pure inventory readers and comparisons in core, plus a reusable server
|
|
4
|
+
> command that checks or explicitly rewrites a package's guides.
|
|
5
|
+
|
|
6
|
+
Add it as a devDependency, drop one short test file into `tests/guides.test.ts`, wire a vitest
|
|
7
|
+
`guides` project, and thereafter every guide is proven — mechanically, in CI, as ordinary vitest
|
|
8
|
+
assertions — against the code it documents. The core remains I/O-free. The optional server command
|
|
9
|
+
owns native checking and explicit rewrites,
|
|
10
|
+
while package assertions remain in the guides worker. Built on `@orkestrel/markdown`. Part of the
|
|
11
|
+
`@orkestrel` line.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -61,6 +61,11 @@ for (const entry of manifest) {
|
|
|
61
61
|
Every row added to the consumer's `guides/README.md` manifest auto-extends
|
|
62
62
|
coverage with zero test edits.
|
|
63
63
|
|
|
64
|
+
Packages using the server entry point make `tests/guides.test.ts` their direct
|
|
65
|
+
`npm run test:guides` entry. Vitest loads it as the guides worker; a native run checks without
|
|
66
|
+
writing, and `--to guide` or `--to source` explicitly selects host writes. No separate command
|
|
67
|
+
helper script owns that workflow.
|
|
68
|
+
|
|
64
69
|
`exports()` inventories direct `type`, `interface`, `const`, `function`, and
|
|
65
70
|
`class` declarations in the selected directories' canonical-segment module
|
|
66
71
|
keys. `hidden()` reflects the same declaration keywords without `export`.
|
|
@@ -114,16 +119,23 @@ declaration.
|
|
|
114
119
|
instead of passing vacuously.
|
|
115
120
|
- **Examples presence** — every documented function and method appears in a
|
|
116
121
|
TypeScript fence or carries an immediately preceding eligible genuine JSDoc
|
|
117
|
-
chain whose final authoritative span has an
|
|
118
|
-
|
|
122
|
+
chain whose final authoritative span has an `@example` tag opening a line at
|
|
123
|
+
its first non-blank column. Title text is allowed; intervening material severs
|
|
124
|
+
association.
|
|
119
125
|
- **Fence-import reality** — every self-package name imported in a TypeScript
|
|
120
126
|
fence exists on the conventional public/barrel surface.
|
|
127
|
+
- **Summary and example equality** — every `Summary` cell equals its export's
|
|
128
|
+
doc-block description paragraph, every documented method's cell equals its
|
|
129
|
+
member's, and every titled guide fence equals the `@example` block of that
|
|
130
|
+
title. `findDrift` names both sides of each disagreement.
|
|
131
|
+
- **README pitch equality** — the blockquote under the README's H1 equals the
|
|
132
|
+
guide's tagline, both read through `createGuide(text).tagline()`.
|
|
121
133
|
|
|
122
134
|
## API
|
|
123
135
|
|
|
124
136
|
- `createGuide(source)` — parses one guide's markdown into a structured,
|
|
125
|
-
cached view with the projections (`sections()`, `
|
|
126
|
-
`links()`, `tests()`, `fences()`).
|
|
137
|
+
cached view with the projections (`sections()`, `tagline()`, `surface()`,
|
|
138
|
+
`methods()`, `unnamed()`, `links()`, `tests()`, `fences()`).
|
|
127
139
|
- `createSource(options)` — reflects intentional direct declarations with
|
|
128
140
|
`exports()`, conventional barrel reachability with `surface()`, members with
|
|
129
141
|
`methods()`, path presence with `exists()`, hidden declarations with
|
|
@@ -135,14 +147,23 @@ declaration.
|
|
|
135
147
|
from a manifest directory, including nested directories.
|
|
136
148
|
- `findMissingSymbols(symbols, source)` — the `(name, keyword)` set difference
|
|
137
149
|
driving surface bijection.
|
|
150
|
+
- `findDrift(guide, source)` — every disagreement between a guide and the
|
|
151
|
+
source it documents, naming both sites: Surface and Methods `Summary` cells
|
|
152
|
+
against doc-block description paragraphs, and titled guide fences against
|
|
153
|
+
`@example` blocks of the same title.
|
|
154
|
+
- `extractUnnamed(document)` — every `## Surface` or `## Methods` row whose
|
|
155
|
+
first cell carries no code span, the rows the surface and method readers skip
|
|
156
|
+
for want of a name, each returned as its cells' text on one line; `Guide`
|
|
157
|
+
caches it as `unnamed()`.
|
|
138
158
|
- `extractSourceLines(source)` — returns one `SourceLine` per physical line,
|
|
139
159
|
including the final line, with exact `source`, equal-length masked `code`, and
|
|
140
160
|
equal-length genuine `jsdoc` retaining every span at its physical column, or
|
|
141
161
|
`undefined`.
|
|
142
162
|
- `extractExampleLines(lines)` — selects the single physical candidate line
|
|
143
163
|
after an eligible leading JSDoc chain whose last whitespace-separated span
|
|
144
|
-
carries an
|
|
145
|
-
material severs association, and the next
|
|
164
|
+
carries an `@example` tag opening a line at its first non-blank column; title
|
|
165
|
+
text is allowed, intervening material severs association, and the next
|
|
166
|
+
physical record is consumed once.
|
|
146
167
|
- `hasCanonicalSegments(key)` — rejects empty, `.` and `..` opaque key
|
|
147
168
|
segments without normalization while retaining dotfiles.
|
|
148
169
|
- `normalizeDirectories(module)` — canonicalizes one or more module spellings
|
|
@@ -165,11 +186,10 @@ and guide index, see [`guides/`](./guides/).
|
|
|
165
186
|
|
|
166
187
|
## Package
|
|
167
188
|
|
|
168
|
-
Published
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
boundary.
|
|
189
|
+
Published through typed `@orkestrel/guide` and `@orkestrel/guide/server` entry points, with ESM and
|
|
190
|
+
CommonJS output. Core remains pure and I/O-free: the consumer supplies the file inventory `Source`
|
|
191
|
+
reflects over. The server entry owns the optional Node command shell and accepts the host inventory
|
|
192
|
+
reader and guides-project runner as direct ports.
|
|
173
193
|
|
|
174
194
|
## License
|
|
175
195
|
|