@sprig-and-prose/sprig-universe 0.2.0 → 0.3.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/package.json +1 -1
- package/src/ast.js +30 -32
- package/src/cli.js +1 -210
- package/src/graph.js +635 -147
- package/src/ir.js +21 -6
- package/src/parser.js +225 -215
- package/test/fixtures/amaranthine-mini.prose +14 -8
- package/test/fixtures/multi-file-universe-a.prose +9 -4
- package/test/fixtures/multi-file-universe-b.prose +5 -4
- package/test/fixtures/named-duplicate.prose +6 -4
- package/test/fixtures/reference-attachments.prose +19 -0
- package/test/fixtures/reference-commas.prose +15 -0
- package/test/fixtures/reference-inline.prose +14 -0
- package/test/fixtures/reference-raw-url.prose +9 -0
- package/test/fixtures/reference-repo-paths.prose +11 -0
- package/test/fixtures/reference-unknown.prose +7 -0
- package/test/references.test.js +105 -0
- package/test/universe-basic.test.js +21 -166
- package/repositories/sprig-repository-github/index.js +0 -29
package/src/ir.js
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* @property {NodeId} [container] - Container node ID (for book/chapter "in" relationship; always set for book/chapter nodes when resolved)
|
|
64
64
|
* @property {TextBlock} [describe] - Describe block if present
|
|
65
65
|
* @property {UnknownBlock[]} [unknownBlocks] - Unknown blocks if any
|
|
66
|
-
* @property {
|
|
66
|
+
* @property {string[]} [references] - Reference IDs attached to this node
|
|
67
67
|
* @property {Array<{title?: string, kind: string, path: string, describe?: TextBlock, source: SourceSpan}>} [documentation] - Documentation if any
|
|
68
68
|
* @property {SourceSpan} source - Source span
|
|
69
69
|
* @property {NodeId[]} [endpoints] - Endpoint node IDs (for relates nodes)
|
|
@@ -88,12 +88,27 @@
|
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* @typedef {Object}
|
|
91
|
+
* @typedef {Object} RepositoryModel
|
|
92
|
+
* @property {string} id - Repository ID (qualified)
|
|
93
|
+
* @property {string} name - Repository name
|
|
94
|
+
* @property {string} url - Base URL
|
|
95
|
+
* @property {TextBlock} [describe] - Optional describe block
|
|
96
|
+
* @property {TextBlock} [note] - Optional note block
|
|
97
|
+
* @property {string} [title] - Optional title
|
|
98
|
+
* @property {SourceSpan} source - Source span
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @typedef {Object} ReferenceModel
|
|
103
|
+
* @property {string} id - Reference ID (qualified)
|
|
92
104
|
* @property {string} name - Reference name
|
|
93
|
-
* @property {string} repository - Repository name
|
|
94
|
-
* @property {string[]} paths - Array of path strings
|
|
95
105
|
* @property {string} [kind] - Optional reference kind
|
|
106
|
+
* @property {string} [title] - Optional title
|
|
96
107
|
* @property {TextBlock} [describe] - Optional describe block
|
|
108
|
+
* @property {TextBlock} [note] - Optional note block
|
|
109
|
+
* @property {string[]} urls - Computed URLs
|
|
110
|
+
* @property {string} [repositoryRef] - Repository ID if reference uses a repository
|
|
111
|
+
* @property {string[]} [paths] - Raw paths (if provided)
|
|
97
112
|
* @property {SourceSpan} source - Source span
|
|
98
113
|
*/
|
|
99
114
|
|
|
@@ -113,9 +128,9 @@
|
|
|
113
128
|
* @property {Record<NodeId, NodeModel>} nodes - Nodes keyed by ID
|
|
114
129
|
* @property {Record<EdgeId, EdgeModel>} edges - Edges keyed by ID
|
|
115
130
|
* @property {Diagnostic[]} diagnostics - Diagnostics
|
|
116
|
-
* @property {Record<string,
|
|
131
|
+
* @property {Record<string, RepositoryModel>} [repositories] - Repositories by ID
|
|
132
|
+
* @property {Record<string, ReferenceModel>} [references] - References by ID
|
|
117
133
|
* @property {string} [generatedAt] - ISO timestamp when manifest was generated
|
|
118
|
-
* @property {Record<string, Record<string, NamedReferenceModel>>} [referencesByName] - Named references by universe name, then by reference name
|
|
119
134
|
* @property {Record<string, Record<string, NamedDocumentModel>>} [documentsByName] - Named documents by universe name, then by document name
|
|
120
135
|
*/
|
|
121
136
|
|