@driftsys/markspec 0.8.0 → 0.10.1
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/esm/compiler/mod.d.ts +7 -0
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +17 -3
- package/esm/compiler/schema.d.ts +8 -1
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +8 -1
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +25 -0
- package/esm/discovery/gitignore.d.ts +40 -0
- package/esm/discovery/gitignore.d.ts.map +1 -0
- package/esm/discovery/gitignore.js +145 -0
- package/esm/discovery/mod.d.ts +54 -0
- package/esm/discovery/mod.d.ts.map +1 -0
- package/esm/discovery/mod.js +122 -0
- package/esm/formatter/dprint.d.ts +62 -0
- package/esm/formatter/dprint.d.ts.map +1 -0
- package/esm/formatter/dprint.js +83 -0
- package/esm/formatter/md_equiv.d.ts +24 -0
- package/esm/formatter/md_equiv.d.ts.map +1 -0
- package/esm/formatter/md_equiv.js +81 -0
- package/esm/formatter/mod.d.ts +25 -0
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +106 -6
- package/esm/formatter/prose.d.ts +48 -0
- package/esm/formatter/prose.d.ts.map +1 -0
- package/esm/formatter/prose.js +85 -0
- package/esm/mod.d.ts +10 -4
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +7 -2
- package/esm/model/mod.d.ts +25 -1
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +1 -0
- package/esm/model/profile.d.ts +34 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +28 -15
- package/esm/profile/chain.js +1 -0
- package/esm/profile/delivered.d.ts +27 -0
- package/esm/profile/delivered.d.ts.map +1 -0
- package/esm/profile/delivered.js +60 -0
- package/esm/profile/manifest.d.ts +1 -0
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +107 -0
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +21 -0
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +22 -0
- package/esm/reporter/mod.js +17 -4
- package/esm/self_upgrade/target.d.ts +3 -3
- package/esm/self_upgrade/target.d.ts.map +1 -1
- package/esm/self_upgrade/target.js +4 -2
- package/esm/validator/corpus.d.ts +25 -0
- package/esm/validator/corpus.d.ts.map +1 -0
- package/esm/validator/corpus.js +138 -0
- package/esm/validator/listing.d.ts.map +1 -1
- package/esm/validator/listing.js +4 -1
- package/esm/validator/mod.d.ts +2 -0
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +1 -0
- package/package.json +3 -1
- package/script/compiler/mod.d.ts +7 -0
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +16 -2
- package/script/compiler/schema.d.ts +8 -1
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +8 -1
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +25 -0
- package/script/discovery/gitignore.d.ts +40 -0
- package/script/discovery/gitignore.d.ts.map +1 -0
- package/script/discovery/gitignore.js +149 -0
- package/script/discovery/mod.d.ts +54 -0
- package/script/discovery/mod.d.ts.map +1 -0
- package/script/discovery/mod.js +128 -0
- package/script/formatter/dprint.d.ts +62 -0
- package/script/formatter/dprint.d.ts.map +1 -0
- package/script/formatter/dprint.js +120 -0
- package/script/formatter/md_equiv.d.ts +24 -0
- package/script/formatter/md_equiv.d.ts.map +1 -0
- package/script/formatter/md_equiv.js +87 -0
- package/script/formatter/mod.d.ts +25 -0
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +106 -5
- package/script/formatter/prose.d.ts +48 -0
- package/script/formatter/prose.d.ts.map +1 -0
- package/script/formatter/prose.js +88 -0
- package/script/mod.d.ts +10 -4
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +22 -3
- package/script/model/mod.d.ts +25 -1
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +1 -0
- package/script/model/profile.d.ts +34 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +27 -14
- package/script/profile/chain.js +1 -0
- package/script/profile/delivered.d.ts +27 -0
- package/script/profile/delivered.d.ts.map +1 -0
- package/script/profile/delivered.js +65 -0
- package/script/profile/manifest.d.ts +1 -0
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +108 -1
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +21 -0
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +22 -0
- package/script/reporter/mod.js +17 -4
- package/script/self_upgrade/target.d.ts +3 -3
- package/script/self_upgrade/target.d.ts.map +1 -1
- package/script/self_upgrade/target.js +4 -2
- package/script/validator/corpus.d.ts +25 -0
- package/script/validator/corpus.d.ts.map +1 -0
- package/script/validator/corpus.js +142 -0
- package/script/validator/listing.d.ts.map +1 -1
- package/script/validator/listing.js +4 -1
- package/script/validator/mod.d.ts +2 -0
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +4 -1
|
@@ -91,6 +91,31 @@ export interface DocTypeDef {
|
|
|
91
91
|
readonly contains: readonly string[];
|
|
92
92
|
readonly description?: string;
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* One `profile.delivers:` item as authored in `markspec.yaml`. `path` is
|
|
96
|
+
* relative to the profile directory, `/`-separated, and validated at parse
|
|
97
|
+
* time to stay inside it. `corpus: true` marks a Markdown file whose entries
|
|
98
|
+
* join the consuming project's traceability graph (ADR-030); default `false`
|
|
99
|
+
* means documentation-only.
|
|
100
|
+
*/
|
|
101
|
+
export interface DeliversDecl {
|
|
102
|
+
readonly path: string;
|
|
103
|
+
readonly corpus: boolean;
|
|
104
|
+
readonly description?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A delivered document after chain resolution (ADR-030): the manifest's
|
|
108
|
+
* `DeliversDecl` joined with the delivering tier's identity and on-disk
|
|
109
|
+
* location. `absPath` is `join(tier.baseDir, path)`.
|
|
110
|
+
*/
|
|
111
|
+
export interface DeliveredDocument {
|
|
112
|
+
readonly profileId: string;
|
|
113
|
+
readonly profileVersion: string;
|
|
114
|
+
readonly path: string;
|
|
115
|
+
readonly absPath: string;
|
|
116
|
+
readonly corpus: boolean;
|
|
117
|
+
readonly description?: string;
|
|
118
|
+
}
|
|
94
119
|
/** Specifier scheme identifying where a profile lives. */
|
|
95
120
|
export type ProfileSpecifier = {
|
|
96
121
|
readonly kind: "local";
|
|
@@ -132,6 +157,9 @@ export interface ProfileManifest {
|
|
|
132
157
|
readonly types: readonly DocTypeDef[];
|
|
133
158
|
readonly frontMatter: readonly AttrDecl[];
|
|
134
159
|
};
|
|
160
|
+
/** Files this profile delivers to consumers (ADR-030). Empty when the
|
|
161
|
+
* manifest declares no `profile.delivers:`. */
|
|
162
|
+
readonly delivers: readonly DeliversDecl[];
|
|
135
163
|
/**
|
|
136
164
|
* Profile-declared discipline kinds (ADR-017 Invariant 2). Maps kind
|
|
137
165
|
* name → declaration metadata. Empty when the manifest does not declare
|
|
@@ -240,6 +268,12 @@ export interface EffectiveProfile {
|
|
|
240
268
|
readonly types: ProvenancedMap<DocTypeDef>;
|
|
241
269
|
readonly frontMatter: ProvenancedMap<AttrDecl>;
|
|
242
270
|
};
|
|
271
|
+
/**
|
|
272
|
+
* Documents delivered by the chain (ADR-030), parent-first then manifest
|
|
273
|
+
* order — the deterministic corpus injection order. Deduped by
|
|
274
|
+
* `(profileId, path)`.
|
|
275
|
+
*/
|
|
276
|
+
readonly delivers: readonly DeliveredDocument[];
|
|
243
277
|
/** Discipline kinds declared across the profile chain (ADR-017). */
|
|
244
278
|
readonly kinds: ProvenancedMap<KindDecl>;
|
|
245
279
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAa,UAAU,EAAE,KAAK,EAAc,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/parser/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAa,UAAU,EAAE,KAAK,EAAc,MAAM,iBAAiB,CAAC;AAkBhF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAwB7C,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAkCD,oDAAoD;AACpD,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;CACpC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,mBAAmB,CA8CrB"}
|
|
@@ -14,6 +14,18 @@ const remark_js_1 = require("./remark.js");
|
|
|
14
14
|
const build_js_1 = require("../ast/build.js");
|
|
15
15
|
const translate_js_1 = require("./translate.js");
|
|
16
16
|
const mod_js_2 = require("../typl/mod.js");
|
|
17
|
+
/**
|
|
18
|
+
* Canonical set of trailer attribute keys the core recognizes: the union of
|
|
19
|
+
* every universal attribute, every core trace relation, and the extra inverse
|
|
20
|
+
* lock key (`Verified-by`). MSL-P020 (misplaced trailer) fires only when a
|
|
21
|
+
* body line's key is in this set; any other capitalized `Word:` lead-in
|
|
22
|
+
* (`Note:`, `Example:`, `Assumption:`) is prose, not a misplaced trailer (#654).
|
|
23
|
+
*/
|
|
24
|
+
const RECOGNIZED_TRAILER_KEYS = new Set([
|
|
25
|
+
...mod_js_1.UNIVERSAL_ATTRIBUTE_KEYS,
|
|
26
|
+
...mod_js_1.CORE_RELATIONS.map((r) => r.attr),
|
|
27
|
+
...mod_js_1.LOCK_EXTRA_INVERSE_KEYS,
|
|
28
|
+
]);
|
|
17
29
|
/**
|
|
18
30
|
* Slug pattern for referenced-entry display IDs.
|
|
19
31
|
*
|
|
@@ -213,17 +225,10 @@ function extractEntry(item, markdownLines, file, definitions, isReferencesDoc, d
|
|
|
213
225
|
const entryLine = item.position?.start.line ?? 1;
|
|
214
226
|
// MSL-P020: trailers block is not the final indented code block.
|
|
215
227
|
// Detect `Key: Value` lines in the body that likely should be trailers
|
|
216
|
-
// but are not at the final position (body content follows them).
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
"Figure",
|
|
221
|
-
"Table",
|
|
222
|
-
"Listing",
|
|
223
|
-
"Feature",
|
|
224
|
-
"Equation",
|
|
225
|
-
"List",
|
|
226
|
-
]);
|
|
228
|
+
// but are not at the final position (body content follows them). Only lines
|
|
229
|
+
// whose key is a recognized trailer attribute count — see
|
|
230
|
+
// RECOGNIZED_TRAILER_KEYS — so ordinary prose (`Note:`, `Example:`) and
|
|
231
|
+
// caption lead-ins (`Figure:`, `Table:`) are left as legitimate body content.
|
|
227
232
|
if (body.length > 0) {
|
|
228
233
|
const bodyLines = body.split("\n");
|
|
229
234
|
let inFencedBlock = false;
|
|
@@ -238,11 +243,13 @@ function extractEntry(item, markdownLines, file, definitions, isReferencesDoc, d
|
|
|
238
243
|
continue;
|
|
239
244
|
if (!attributes_js_1.ATTR_LINE_RE.test(trimmed))
|
|
240
245
|
continue;
|
|
241
|
-
//
|
|
246
|
+
// Only a RECOGNIZED trailer key signals a genuinely misplaced trailer.
|
|
247
|
+
// A body paragraph starting with any other capitalized word + colon
|
|
248
|
+
// (`Note:`, `Example:`, `Assumption:`) is prose, not a trailer (#654).
|
|
242
249
|
const keyMatch = trimmed.match(/^([A-Z][A-Za-z-]*):/);
|
|
243
|
-
if (keyMatch
|
|
250
|
+
if (!keyMatch || !RECOGNIZED_TRAILER_KEYS.has(keyMatch[1]))
|
|
244
251
|
continue;
|
|
245
|
-
// Found a
|
|
252
|
+
// Found a misplaced trailer-like line in the body — non-final position
|
|
246
253
|
diagnostics.push({
|
|
247
254
|
code: "MSL-P020",
|
|
248
255
|
severity: "error",
|
|
@@ -317,6 +324,12 @@ function extractEntry(item, markdownLines, file, definitions, isReferencesDoc, d
|
|
|
317
324
|
if (!colonMatch)
|
|
318
325
|
break; // stop at non-colon line
|
|
319
326
|
const key = colonMatch[1].trim();
|
|
327
|
+
// A genuine trailer key is a single token; it never contains internal
|
|
328
|
+
// whitespace or a pipe. A colon inside prose ("modes are: fast") or a
|
|
329
|
+
// Markdown table row ("| Fast | latency: 200ms |") is body content, not
|
|
330
|
+
// a malformed trailer — stop scanning at it (#648).
|
|
331
|
+
if (/[\s|]/.test(key))
|
|
332
|
+
break;
|
|
320
333
|
if (attributes_js_1.ATTR_LINE_RE.test(trimmed)) {
|
|
321
334
|
// Valid attr line in body → already caught by P020
|
|
322
335
|
continue;
|
package/script/profile/chain.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/profile/delivered
|
|
3
|
+
*
|
|
4
|
+
* Loader for profile-delivered documents (ADR-030). Checks every delivered
|
|
5
|
+
* file's existence (PROFILE-DELIVERS-001/002), parses the `corpus: true`
|
|
6
|
+
* files, and stamps each parsed entry with its profile origin. Pure — all
|
|
7
|
+
* I/O via the injected {@linkcode ReadFile}.
|
|
8
|
+
*/
|
|
9
|
+
import type { ReadFile } from "../config/mod.js";
|
|
10
|
+
import type { DeliveredDocument, Diagnostic, Entry } from "../model/mod.js";
|
|
11
|
+
/** Result of {@linkcode loadDeliveredCorpus}. */
|
|
12
|
+
export interface LoadDeliveredCorpusResult {
|
|
13
|
+
readonly entries: readonly Entry[];
|
|
14
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
15
|
+
}
|
|
16
|
+
/** Human-facing label of a delivered document's providing tier. */
|
|
17
|
+
export declare function corpusOriginLabel(doc: DeliveredDocument): string;
|
|
18
|
+
/** Index delivered documents by absolute path — used by CLI/LSP callers to
|
|
19
|
+
* recognise corpus locations when rendering diagnostics. */
|
|
20
|
+
export declare function buildCorpusIndex(delivers: readonly DeliveredDocument[]): ReadonlyMap<string, DeliveredDocument>;
|
|
21
|
+
/**
|
|
22
|
+
* Load the delivered corpus of an effective profile chain. Iterates
|
|
23
|
+
* `delivers` in order (parent-first + manifest order — the deterministic
|
|
24
|
+
* injection order), so the returned entry order is stable across runs.
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadDeliveredCorpus(delivers: readonly DeliveredDocument[], readFile: ReadFile): Promise<LoadDeliveredCorpusResult>;
|
|
27
|
+
//# sourceMappingURL=delivered.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivered.d.ts","sourceRoot":"","sources":["../../src/profile/delivered.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAGzB,iDAAiD;AACjD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAEhE;AAED;4DAC4D;AAC5D,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GACrC,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAIxC;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,yBAAyB,CAAC,CAgCpC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/profile/delivered
|
|
4
|
+
*
|
|
5
|
+
* Loader for profile-delivered documents (ADR-030). Checks every delivered
|
|
6
|
+
* file's existence (PROFILE-DELIVERS-001/002), parses the `corpus: true`
|
|
7
|
+
* files, and stamps each parsed entry with its profile origin. Pure — all
|
|
8
|
+
* I/O via the injected {@linkcode ReadFile}.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.corpusOriginLabel = corpusOriginLabel;
|
|
12
|
+
exports.buildCorpusIndex = buildCorpusIndex;
|
|
13
|
+
exports.loadDeliveredCorpus = loadDeliveredCorpus;
|
|
14
|
+
const mod_js_1 = require("../parser/mod.js");
|
|
15
|
+
/** Human-facing label of a delivered document's providing tier. */
|
|
16
|
+
function corpusOriginLabel(doc) {
|
|
17
|
+
return `${doc.profileId}@${doc.profileVersion}`;
|
|
18
|
+
}
|
|
19
|
+
/** Index delivered documents by absolute path — used by CLI/LSP callers to
|
|
20
|
+
* recognise corpus locations when rendering diagnostics. */
|
|
21
|
+
function buildCorpusIndex(delivers) {
|
|
22
|
+
const out = new Map();
|
|
23
|
+
for (const d of delivers)
|
|
24
|
+
out.set(d.absPath, d);
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Load the delivered corpus of an effective profile chain. Iterates
|
|
29
|
+
* `delivers` in order (parent-first + manifest order — the deterministic
|
|
30
|
+
* injection order), so the returned entry order is stable across runs.
|
|
31
|
+
*/
|
|
32
|
+
async function loadDeliveredCorpus(delivers, readFile) {
|
|
33
|
+
const entries = [];
|
|
34
|
+
const diagnostics = [];
|
|
35
|
+
for (const doc of delivers) {
|
|
36
|
+
const content = await readFile(doc.absPath);
|
|
37
|
+
if (content === undefined) {
|
|
38
|
+
diagnostics.push({
|
|
39
|
+
code: doc.corpus ? "PROFILE-DELIVERS-001" : "PROFILE-DELIVERS-002",
|
|
40
|
+
severity: doc.corpus ? "error" : "warning",
|
|
41
|
+
message: `delivered ${doc.corpus ? "corpus" : "document"} file ` +
|
|
42
|
+
`'${doc.path}' declared by ${corpusOriginLabel(doc)} is missing ` +
|
|
43
|
+
`from the profile package`,
|
|
44
|
+
location: { file: doc.absPath, line: 1, column: 1 },
|
|
45
|
+
});
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (!doc.corpus)
|
|
49
|
+
continue; // docs-only: existence check only, never parsed
|
|
50
|
+
const parsed = await (0, mod_js_1.parseFile)(content, { file: doc.absPath });
|
|
51
|
+
for (const d of parsed.diagnostics) {
|
|
52
|
+
diagnostics.push({
|
|
53
|
+
...d,
|
|
54
|
+
message: `delivered by ${corpusOriginLabel(doc)}: ${d.message}`,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const origin = {
|
|
58
|
+
kind: "profile",
|
|
59
|
+
profileId: doc.profileId,
|
|
60
|
+
profileVersion: doc.profileVersion,
|
|
61
|
+
};
|
|
62
|
+
entries.push(...parsed.entries.map((e) => ({ ...e, origin })));
|
|
63
|
+
}
|
|
64
|
+
return { entries, diagnostics };
|
|
65
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare const ALLOWED_PROFILE_KEYS: Set<string>;
|
|
|
11
11
|
export declare const ALLOWED_TYPE_KEYS: Set<string>;
|
|
12
12
|
export declare const ALLOWED_DOC_TYPE_KEYS: Set<string>;
|
|
13
13
|
export declare const ALLOWED_DOCUMENTS_KEYS: Set<string>;
|
|
14
|
+
export declare const ALLOWED_DELIVERS_KEYS: Set<string>;
|
|
14
15
|
export declare const ALLOWED_ATTR_KEYS: Set<string>;
|
|
15
16
|
export declare const ALLOWED_INVERSE_KEYS: Set<string>;
|
|
16
17
|
export declare const ALLOWED_TRACE_RULE_KEYS: Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/profile/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/profile/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA8BnE,eAAO,MAAM,iBAAiB,aAS5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,aAW/B,CAAC;AAEH,eAAO,MAAM,iBAAiB,aAU5B,CAAC;AAEH,eAAO,MAAM,qBAAqB,aAA6C,CAAC;AAChF,eAAO,MAAM,sBAAsB,aAAoC,CAAC;AACxE,eAAO,MAAM,qBAAqB,aAA6C,CAAC;AAEhF,eAAO,MAAM,iBAAiB,aAQ5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,aAAgC,CAAC;AAElE,eAAO,MAAM,uBAAuB,aAKlC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAq0CD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,UAAU,SAAoB,GAC7B,mBAAmB,CAyMrB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* schema violations.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ALLOWED_TRACE_RULE_KEYS = exports.ALLOWED_INVERSE_KEYS = exports.ALLOWED_ATTR_KEYS = exports.ALLOWED_DOCUMENTS_KEYS = exports.ALLOWED_DOC_TYPE_KEYS = exports.ALLOWED_TYPE_KEYS = exports.ALLOWED_PROFILE_KEYS = exports.ALLOWED_ROOT_KEYS = void 0;
|
|
10
|
+
exports.ALLOWED_TRACE_RULE_KEYS = exports.ALLOWED_INVERSE_KEYS = exports.ALLOWED_ATTR_KEYS = exports.ALLOWED_DELIVERS_KEYS = exports.ALLOWED_DOCUMENTS_KEYS = exports.ALLOWED_DOC_TYPE_KEYS = exports.ALLOWED_TYPE_KEYS = exports.ALLOWED_PROFILE_KEYS = exports.ALLOWED_ROOT_KEYS = void 0;
|
|
11
11
|
exports.parseManifest = parseManifest;
|
|
12
12
|
const yaml_1 = require("@std/yaml");
|
|
13
13
|
const mod_js_1 = require("../model/mod.js");
|
|
@@ -30,6 +30,7 @@ exports.ALLOWED_PROFILE_KEYS = new Set([
|
|
|
30
30
|
"conventions",
|
|
31
31
|
"types",
|
|
32
32
|
"documents",
|
|
33
|
+
"delivers",
|
|
33
34
|
"kinds",
|
|
34
35
|
"prose",
|
|
35
36
|
"discipline-mode",
|
|
@@ -47,6 +48,7 @@ exports.ALLOWED_TYPE_KEYS = new Set([
|
|
|
47
48
|
]);
|
|
48
49
|
exports.ALLOWED_DOC_TYPE_KEYS = new Set(["id", "contains", "description"]);
|
|
49
50
|
exports.ALLOWED_DOCUMENTS_KEYS = new Set(["types", "frontMatter"]);
|
|
51
|
+
exports.ALLOWED_DELIVERS_KEYS = new Set(["path", "corpus", "description"]);
|
|
50
52
|
exports.ALLOWED_ATTR_KEYS = new Set([
|
|
51
53
|
"name",
|
|
52
54
|
"type",
|
|
@@ -1098,6 +1100,106 @@ function parseDocumentsSection(raw, sourcePath, diagnostics) {
|
|
|
1098
1100
|
const frontMatter = parseAttrList(r.frontMatter, "profile.documents.frontMatter", sourcePath, diagnostics);
|
|
1099
1101
|
return { types, frontMatter };
|
|
1100
1102
|
}
|
|
1103
|
+
function parseDeliversSection(raw, sourcePath, diagnostics) {
|
|
1104
|
+
if (raw === undefined)
|
|
1105
|
+
return [];
|
|
1106
|
+
const loc = { file: sourcePath, line: 1, column: 1 };
|
|
1107
|
+
if (!Array.isArray(raw)) {
|
|
1108
|
+
diagnostics.push({
|
|
1109
|
+
code: "PROFILE-LOAD-003",
|
|
1110
|
+
severity: "error",
|
|
1111
|
+
message: `profile.delivers: must be a list`,
|
|
1112
|
+
location: loc,
|
|
1113
|
+
});
|
|
1114
|
+
return [];
|
|
1115
|
+
}
|
|
1116
|
+
const out = [];
|
|
1117
|
+
const seenPaths = new Set();
|
|
1118
|
+
for (const item of raw) {
|
|
1119
|
+
if (item == null || typeof item !== "object" || Array.isArray(item)) {
|
|
1120
|
+
diagnostics.push({
|
|
1121
|
+
code: "PROFILE-LOAD-003",
|
|
1122
|
+
severity: "error",
|
|
1123
|
+
message: `profile.delivers: each item must be a mapping`,
|
|
1124
|
+
location: loc,
|
|
1125
|
+
});
|
|
1126
|
+
continue;
|
|
1127
|
+
}
|
|
1128
|
+
const r = item;
|
|
1129
|
+
for (const key of Object.keys(r)) {
|
|
1130
|
+
if (!exports.ALLOWED_DELIVERS_KEYS.has(key)) {
|
|
1131
|
+
diagnostics.push({
|
|
1132
|
+
code: "PROFILE-LOAD-003",
|
|
1133
|
+
severity: "error",
|
|
1134
|
+
message: `profile.delivers: unknown key '${key}'`,
|
|
1135
|
+
location: loc,
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
const path = r.path;
|
|
1140
|
+
if (typeof path !== "string" || path.trim().length === 0) {
|
|
1141
|
+
diagnostics.push({
|
|
1142
|
+
code: "PROFILE-LOAD-003",
|
|
1143
|
+
severity: "error",
|
|
1144
|
+
message: `profile.delivers: item missing required 'path' (string)`,
|
|
1145
|
+
location: loc,
|
|
1146
|
+
});
|
|
1147
|
+
continue;
|
|
1148
|
+
}
|
|
1149
|
+
// PROFILE-DELIVERS-003 — the path must stay inside the profile
|
|
1150
|
+
// directory: no absolute paths (POSIX or drive-letter), no `..`.
|
|
1151
|
+
const normalized = path.replaceAll("\\", "/");
|
|
1152
|
+
if (normalized.startsWith("/") || /^[A-Za-z]:/.test(normalized) ||
|
|
1153
|
+
normalized.split("/").includes("..")) {
|
|
1154
|
+
diagnostics.push({
|
|
1155
|
+
code: "PROFILE-DELIVERS-003",
|
|
1156
|
+
severity: "error",
|
|
1157
|
+
message: `profile.delivers: path '${path}' escapes the profile ` +
|
|
1158
|
+
`directory (absolute paths and '..' segments are not allowed)`,
|
|
1159
|
+
location: loc,
|
|
1160
|
+
});
|
|
1161
|
+
continue;
|
|
1162
|
+
}
|
|
1163
|
+
if (r.corpus !== undefined && typeof r.corpus !== "boolean") {
|
|
1164
|
+
diagnostics.push({
|
|
1165
|
+
code: "PROFILE-LOAD-003",
|
|
1166
|
+
severity: "error",
|
|
1167
|
+
message: `profile.delivers: 'corpus' must be a boolean`,
|
|
1168
|
+
location: loc,
|
|
1169
|
+
});
|
|
1170
|
+
continue;
|
|
1171
|
+
}
|
|
1172
|
+
const corpus = r.corpus === true;
|
|
1173
|
+
if (corpus && !normalized.toLowerCase().endsWith(".md")) {
|
|
1174
|
+
diagnostics.push({
|
|
1175
|
+
code: "PROFILE-DELIVERS-004",
|
|
1176
|
+
severity: "error",
|
|
1177
|
+
message: `profile.delivers: 'corpus: true' requires a Markdown ` +
|
|
1178
|
+
`(.md) file, got '${path}'`,
|
|
1179
|
+
location: loc,
|
|
1180
|
+
});
|
|
1181
|
+
continue;
|
|
1182
|
+
}
|
|
1183
|
+
if (seenPaths.has(normalized)) {
|
|
1184
|
+
diagnostics.push({
|
|
1185
|
+
code: "PROFILE-LOAD-003",
|
|
1186
|
+
severity: "error",
|
|
1187
|
+
message: `profile.delivers: duplicate path '${path}'`,
|
|
1188
|
+
location: loc,
|
|
1189
|
+
});
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
seenPaths.add(normalized);
|
|
1193
|
+
out.push({
|
|
1194
|
+
path: normalized,
|
|
1195
|
+
corpus,
|
|
1196
|
+
description: typeof r.description === "string"
|
|
1197
|
+
? r.description
|
|
1198
|
+
: undefined,
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
return out;
|
|
1202
|
+
}
|
|
1101
1203
|
/**
|
|
1102
1204
|
* Parse and validate a raw markspec.yaml string.
|
|
1103
1205
|
*
|
|
@@ -1211,6 +1313,10 @@ function parseManifest(rawYaml, sourcePath = "<markspec.yaml>") {
|
|
|
1211
1313
|
if (diagnostics.some((d) => d.severity === "error")) {
|
|
1212
1314
|
return { manifest: null, diagnostics };
|
|
1213
1315
|
}
|
|
1316
|
+
const delivers = parseDeliversSection(profileSection.delivers, sourcePath, diagnostics);
|
|
1317
|
+
if (diagnostics.some((d) => d.severity === "error")) {
|
|
1318
|
+
return { manifest: null, diagnostics };
|
|
1319
|
+
}
|
|
1214
1320
|
const prose = parseProse(profileSection.prose, sourcePath, diagnostics);
|
|
1215
1321
|
if (diagnostics.some((d) => d.severity === "error")) {
|
|
1216
1322
|
return { manifest: null, diagnostics };
|
|
@@ -1240,6 +1346,7 @@ function parseManifest(rawYaml, sourcePath = "<markspec.yaml>") {
|
|
|
1240
1346
|
colors,
|
|
1241
1347
|
types: types,
|
|
1242
1348
|
documents: documents,
|
|
1349
|
+
delivers,
|
|
1243
1350
|
kinds,
|
|
1244
1351
|
prose,
|
|
1245
1352
|
disciplineMode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/profile/merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/profile/merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAGV,UAAU,EAGV,gBAAgB,EAKhB,YAAY,EASb,MAAM,iBAAiB,CAAC;AAGzB,oDAAoD;AACpD,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAiF3D"}
|
package/script/profile/merge.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.mergeChain = mergeChain;
|
|
13
|
+
const path_1 = require("@std/path");
|
|
13
14
|
const mod_js_1 = require("../model/mod.js");
|
|
14
15
|
const discipline_mode_js_1 = require("./discipline_mode.js");
|
|
15
16
|
/**
|
|
@@ -143,6 +144,13 @@ function foldTier(base, tier, diagnostics) {
|
|
|
143
144
|
// Overlap handling deferred.
|
|
144
145
|
}
|
|
145
146
|
const frontMatter = unionAttrMap(base.documents.frontMatter, m.documents.frontMatter, origin, diagnostics);
|
|
147
|
+
// Delivered documents — additive union keyed by (profileId, path).
|
|
148
|
+
const delivers = [...base.delivers];
|
|
149
|
+
for (const d of deliveredFromTier(tier)) {
|
|
150
|
+
if (!delivers.some((e) => e.profileId === d.profileId && e.path === d.path)) {
|
|
151
|
+
delivers.push(d);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
146
154
|
// Prose lexicons: list-additive across tiers (profile-schema §5.1).
|
|
147
155
|
const capAllow = unionList(base.prose.lexicons["capitalized-allow"], m.prose.lexicons["capitalized-allow"], origin);
|
|
148
156
|
const sentAbbrev = unionList(base.prose.lexicons["sentence-abbrev"], m.prose.lexicons["sentence-abbrev"], origin);
|
|
@@ -156,6 +164,7 @@ function foldTier(base, tier, diagnostics) {
|
|
|
156
164
|
types: docTypes,
|
|
157
165
|
frontMatter,
|
|
158
166
|
},
|
|
167
|
+
delivers,
|
|
159
168
|
kinds,
|
|
160
169
|
prose: {
|
|
161
170
|
lexicons: {
|
|
@@ -519,6 +528,17 @@ function stringifyMatcher(m) {
|
|
|
519
528
|
// ---------------------------------------------------------------------------
|
|
520
529
|
// Helpers: construct an EffectiveProfile from a single tier's manifest.
|
|
521
530
|
// ---------------------------------------------------------------------------
|
|
531
|
+
/** Resolve a tier's `delivers:` declarations against its baseDir (ADR-030). */
|
|
532
|
+
function deliveredFromTier(tier) {
|
|
533
|
+
return tier.manifest.delivers.map((d) => ({
|
|
534
|
+
profileId: tier.id,
|
|
535
|
+
profileVersion: tier.version,
|
|
536
|
+
path: d.path,
|
|
537
|
+
absPath: (0, path_1.join)(tier.baseDir, d.path),
|
|
538
|
+
corpus: d.corpus,
|
|
539
|
+
description: d.description,
|
|
540
|
+
}));
|
|
541
|
+
}
|
|
522
542
|
function seedFromTier(tier) {
|
|
523
543
|
const origin = tier.id;
|
|
524
544
|
const m = tier.manifest;
|
|
@@ -532,6 +552,7 @@ function seedFromTier(tier) {
|
|
|
532
552
|
types: mapFromDocTypes(m.documents.types, origin),
|
|
533
553
|
frontMatter: mapFromAttrList(m.documents.frontMatter, origin),
|
|
534
554
|
},
|
|
555
|
+
delivers: deliveredFromTier(tier),
|
|
535
556
|
kinds: mapFromKinds(m.kinds, origin),
|
|
536
557
|
prose: {
|
|
537
558
|
lexicons: {
|
package/script/refs/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/refs/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAO7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/refs/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAO7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAGnD,CAAC;AAEH,iFAAiF;AACjF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,QAAQ,CAajE;AAcD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,SAAS,QAAQ,EAAE,GAC1B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAgHtC"}
|
package/script/refs/mod.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.TRACE_ATTRIBUTE_KEYS = void 0;
|
|
|
17
17
|
exports.buildRefIndex = buildRefIndex;
|
|
18
18
|
exports.canonicalizeRefs = canonicalizeRefs;
|
|
19
19
|
const mod_js_1 = require("../model/mod.js");
|
|
20
|
+
const fence_js_1 = require("../util/fence.js");
|
|
20
21
|
/**
|
|
21
22
|
* Trace-attribute keys whose values are canonicalised/healed: the core
|
|
22
23
|
* relations plus `Verified-by`. Derived from {@linkcode CORE_RELATIONS} so new
|
|
@@ -89,12 +90,25 @@ function canonicalizeRefs(content, entries, index, ledger) {
|
|
|
89
90
|
};
|
|
90
91
|
const lines = content.split("\n");
|
|
91
92
|
let changed = false;
|
|
93
|
+
// Track fenced-code regions so illustrative trailers inside ``` / ~~~
|
|
94
|
+
// blocks (e.g. `Realizes: 01HGW...` in a ```markdown example) are never
|
|
95
|
+
// "healed" against the real ref index — the same verbatim-region rule
|
|
96
|
+
// every other fmt pass honors (§5.1; cf. `collapseBlankLines`). Without
|
|
97
|
+
// this, `markspec fmt` rewrites example IDs in spec/ADR docs on every run
|
|
98
|
+
// (#668). The parser/validator already treat fenced content as inert.
|
|
99
|
+
let inFence = false;
|
|
92
100
|
for (let i = 0; i < lines.length; i++) {
|
|
93
101
|
// Strip a trailing CR before matching so CRLF files are handled (the
|
|
94
102
|
// trailer regex ends in `$`, which `\r` would block) and re-append it on
|
|
95
103
|
// rewrite so line endings stay byte-for-byte lossless.
|
|
96
104
|
const cr = lines[i].endsWith("\r");
|
|
97
105
|
const bare = cr ? lines[i].slice(0, -1) : lines[i];
|
|
106
|
+
if (fence_js_1.FENCE_RE.test(bare)) {
|
|
107
|
+
inFence = !inFence;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (inFence)
|
|
111
|
+
continue;
|
|
98
112
|
const m = TRACE_TRAILER_RE.exec(bare);
|
|
99
113
|
if (!m)
|
|
100
114
|
continue;
|
|
@@ -121,6 +135,14 @@ function canonicalizeRefs(content, entries, index, ledger) {
|
|
|
121
135
|
j++;
|
|
122
136
|
const crj = lines[j].endsWith("\r");
|
|
123
137
|
const barej = crj ? lines[j].slice(0, -1) : lines[j];
|
|
138
|
+
// A fence marker is never continuation text. An indented one (e.g.
|
|
139
|
+
// ` ```md`) would otherwise match CONTINUATION_LINE_RE and be
|
|
140
|
+
// swallowed here without toggling `inFence`, desyncing fence tracking
|
|
141
|
+
// for the rest of the file. Back out and let the outer loop toggle it.
|
|
142
|
+
if (fence_js_1.FENCE_RE.test(barej)) {
|
|
143
|
+
j--;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
124
146
|
const cm = CONTINUATION_LINE_RE.exec(barej);
|
|
125
147
|
if (!cm) {
|
|
126
148
|
j--; // not a continuation line — leave it for the outer loop
|
package/script/reporter/mod.js
CHANGED
|
@@ -45,6 +45,17 @@ function filterEntries(result, scope, label) {
|
|
|
45
45
|
}
|
|
46
46
|
return entries;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Render an entry's provenance cell (ADR-030): `<profileId>@<profileVersion>`
|
|
50
|
+
* for an entry injected from a profile-delivered corpus, `"project"` for a
|
|
51
|
+
* project-authored entry. Shared by the traceability matrix builder so CSV,
|
|
52
|
+
* Markdown, and JSON rows all agree on the same value.
|
|
53
|
+
*/
|
|
54
|
+
function originCell(entry) {
|
|
55
|
+
return entry.origin
|
|
56
|
+
? `${entry.origin.profileId}@${entry.origin.profileVersion}`
|
|
57
|
+
: "project";
|
|
58
|
+
}
|
|
48
59
|
function buildTraceRows(result, entries) {
|
|
49
60
|
return entries.map((entry) => {
|
|
50
61
|
const fwd = result.forward.get(entry.displayId) ?? [];
|
|
@@ -53,6 +64,7 @@ function buildTraceRows(result, entries) {
|
|
|
53
64
|
id: entry.displayId,
|
|
54
65
|
title: entry.title,
|
|
55
66
|
entryType: entry.type ?? "",
|
|
67
|
+
origin: originCell(entry),
|
|
56
68
|
satisfies: fwd
|
|
57
69
|
.filter((l) => l.kind === "satisfies")
|
|
58
70
|
.map((l) => l.to)
|
|
@@ -70,20 +82,21 @@ function formatTraceability(result, entries, format) {
|
|
|
70
82
|
return JSON.stringify(rows, null, 2);
|
|
71
83
|
}
|
|
72
84
|
if (format === "csv") {
|
|
73
|
-
const header = "ID,Title,Type,Satisfies,Satisfied-by";
|
|
85
|
+
const header = "ID,Title,Type,Origin,Satisfies,Satisfied-by";
|
|
74
86
|
const lines = rows.map((r) => [
|
|
75
87
|
r.id,
|
|
76
88
|
csvEscape(r.title),
|
|
77
89
|
r.entryType,
|
|
90
|
+
csvEscape(r.origin),
|
|
78
91
|
csvEscape(r.satisfies),
|
|
79
92
|
csvEscape(r.satisfiedBy),
|
|
80
93
|
].join(","));
|
|
81
94
|
return [header, ...lines].join("\n");
|
|
82
95
|
}
|
|
83
96
|
// Markdown table
|
|
84
|
-
const header = "| ID | Title | Type | Satisfies | Satisfied-by |";
|
|
85
|
-
const sep = "| -- | ----- | ---- | --------- | ------------ |";
|
|
86
|
-
const lines = rows.map((r) => `| ${r.id} | ${r.title} | ${r.entryType} | ${r.satisfies || "\u2014"} | ${r.satisfiedBy || "\u2014"} |`);
|
|
97
|
+
const header = "| ID | Title | Type | Origin | Satisfies | Satisfied-by |";
|
|
98
|
+
const sep = "| -- | ----- | ---- | ------ | --------- | ------------ |";
|
|
99
|
+
const lines = rows.map((r) => `| ${r.id} | ${r.title} | ${r.entryType} | ${r.origin} | ${r.satisfies || "\u2014"} | ${r.satisfiedBy || "\u2014"} |`);
|
|
87
100
|
return [header, sep, ...lines].join("\n");
|
|
88
101
|
}
|
|
89
102
|
function computeCoverage(result, entries) {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Map (os, arch) → the GitHub release target string used in tarball
|
|
5
5
|
* names. Targets match those produced by the Release workflow:
|
|
6
|
-
* x86_64-unknown-linux-gnu,
|
|
7
|
-
* aarch64-apple-darwin, x86_64-pc-windows-msvc.
|
|
6
|
+
* x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu,
|
|
7
|
+
* x86_64-apple-darwin, aarch64-apple-darwin, x86_64-pc-windows-msvc.
|
|
8
8
|
*
|
|
9
9
|
* Pure functions — no I/O, no Deno.* APIs. The CLI passes
|
|
10
10
|
* `Deno.build.os` / `Deno.build.arch` strings to platformFromBuild;
|
|
@@ -17,7 +17,7 @@ export interface Platform {
|
|
|
17
17
|
readonly os: Os;
|
|
18
18
|
readonly arch: Arch;
|
|
19
19
|
}
|
|
20
|
-
export type Target = "x86_64-unknown-linux-gnu" | "x86_64-apple-darwin" | "aarch64-apple-darwin" | "x86_64-pc-windows-msvc";
|
|
20
|
+
export type Target = "x86_64-unknown-linux-gnu" | "aarch64-unknown-linux-gnu" | "x86_64-apple-darwin" | "aarch64-apple-darwin" | "x86_64-pc-windows-msvc";
|
|
21
21
|
/** Return the release target for a platform, or undefined if not shipped. */
|
|
22
22
|
export declare function detectTarget(platform: Platform): Target | undefined;
|
|
23
23
|
/** Parse Deno.build.{os,arch} strings into a typed Platform, or undefined. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/self_upgrade/target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,EAAE,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,MAAM,GACd,0BAA0B,GAC1B,qBAAqB,GACrB,sBAAsB,GACtB,wBAAwB,CAAC;AAE7B,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/self_upgrade/target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,EAAE,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,MAAM,GACd,0BAA0B,GAC1B,2BAA2B,GAC3B,qBAAqB,GACrB,sBAAsB,GACtB,wBAAwB,CAAC;AAE7B,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAQnE;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,GACX,QAAQ,GAAG,SAAS,CAKtB"}
|