@orkestrel/guide 0.0.15 → 0.0.17
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 -12
- package/dist/src/core/index.cjs +323 -229
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +528 -351
- package/dist/src/core/index.d.ts +528 -351
- package/dist/src/core/index.js +306 -214
- package/dist/src/core/index.js.map +1 -1
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -27,13 +27,13 @@ The entire consumer-side footprint is one short test file. An excerpt of the
|
|
|
27
27
|
drop-in pattern (`tests/guides.test.ts`):
|
|
28
28
|
|
|
29
29
|
The consumer supplies the file inventory `Source` reflects over. The inventory
|
|
30
|
-
|
|
30
|
+
following is an illustrative, non-runnable placeholder until the consumer supplies
|
|
31
31
|
real workspace text; the complete runnable implementation is
|
|
32
32
|
[`tests/guides.test.ts`](tests/guides.test.ts).
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
35
|
import { expect, it } from 'vitest'
|
|
36
|
-
import { createGuide, createSource,
|
|
36
|
+
import { createGuide, createSource, findMissingSymbols, parseManifest } from '@orkestrel/guide'
|
|
37
37
|
|
|
38
38
|
declare const files: Readonly<Record<string, string>> // illustrative root-relative inventory
|
|
39
39
|
declare function readText(relative: string): string // required exact lookup supplied by the consumer
|
|
@@ -50,10 +50,10 @@ for (const entry of manifest) {
|
|
|
50
50
|
|
|
51
51
|
it('keeps direct declarations, the public barrel, and the guide equal', () => {
|
|
52
52
|
expect(guide.surface().length).toBeGreaterThan(0)
|
|
53
|
-
expect(
|
|
54
|
-
expect(
|
|
55
|
-
expect(
|
|
56
|
-
expect(
|
|
53
|
+
expect(findMissingSymbols(source.exports(), source.surface())).toEqual([])
|
|
54
|
+
expect(findMissingSymbols(source.surface(), source.exports())).toEqual([])
|
|
55
|
+
expect(findMissingSymbols(source.surface(), guide.surface())).toEqual([])
|
|
56
|
+
expect(findMissingSymbols(guide.surface(), source.surface())).toEqual([])
|
|
57
57
|
})
|
|
58
58
|
}
|
|
59
59
|
```
|
|
@@ -63,7 +63,7 @@ coverage with zero test edits.
|
|
|
63
63
|
|
|
64
64
|
`exports()` inventories direct `type`, `interface`, `const`, `function`, and
|
|
65
65
|
`class` declarations in the selected directories' canonical-segment module
|
|
66
|
-
keys. `hidden()` reflects the same
|
|
66
|
+
keys. `hidden()` reflects the same declaration keywords without `export`.
|
|
67
67
|
Both use the one structured physical-line projection: each record retains exact
|
|
68
68
|
raw source, equal-length projected code, and an equal-length genuine JSDoc view
|
|
69
69
|
that retains every genuine span at its physical column. Comment and template
|
|
@@ -101,7 +101,7 @@ declaration.
|
|
|
101
101
|
|
|
102
102
|
- **Surface parity** — intentional direct declarations, the conventional
|
|
103
103
|
barrel-reachable surface, and documented `## Surface` symbols match by name
|
|
104
|
-
and
|
|
104
|
+
and keyword in both directions.
|
|
105
105
|
- **Methods bijection + class-no-extra** — every documented `## Methods`
|
|
106
106
|
member matches the interface's implementer, and the implementing class
|
|
107
107
|
exposes no undocumented public method.
|
|
@@ -122,18 +122,18 @@ declaration.
|
|
|
122
122
|
## API
|
|
123
123
|
|
|
124
124
|
- `createGuide(source)` — parses one guide's markdown into a structured,
|
|
125
|
-
cached view with
|
|
126
|
-
`links()`, `tests()`, `
|
|
125
|
+
cached view with the projections (`sections()`, `surface()`, `methods()`,
|
|
126
|
+
`links()`, `tests()`, `fences()`).
|
|
127
127
|
- `createSource(options)` — reflects intentional direct declarations with
|
|
128
128
|
`exports()`, conventional barrel reachability with `surface()`, members with
|
|
129
129
|
`methods()`, path presence with `exists()`, hidden declarations with
|
|
130
130
|
`hidden()`, and TSDoc example membership with `examples()`, over a
|
|
131
131
|
consumer-supplied file inventory for one or more source directories. Both
|
|
132
|
-
declaration projections are lazy, cached, deduplicated by name and
|
|
132
|
+
declaration projections are lazy, cached, deduplicated by name and keyword, and
|
|
133
133
|
sorted by name.
|
|
134
134
|
- `parseManifest(markdown, directory)` — extracts the `## By concept` rows
|
|
135
135
|
from a manifest directory, including nested directories.
|
|
136
|
-
- `
|
|
136
|
+
- `findMissingSymbols(symbols, source)` — the `(name, keyword)` set difference
|
|
137
137
|
driving surface bijection.
|
|
138
138
|
- `extractSourceLines(source)` — returns one `SourceLine` per physical line,
|
|
139
139
|
including the final line, with exact `source`, equal-length masked `code`, and
|