@codedrifters/configulator 0.0.276 → 0.0.277
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/lib/index.d.mts +244 -1
- package/lib/index.d.ts +245 -2
- package/lib/index.js +410 -17
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +405 -19
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -321,7 +321,11 @@ __export(index_exports, {
|
|
|
321
321
|
classifyRun: () => classifyRun,
|
|
322
322
|
companyProfileBundle: () => companyProfileBundle,
|
|
323
323
|
compileFencedSamples: () => compileFencedSamples,
|
|
324
|
+
createApiDiffCheck: () => createApiDiffCheck,
|
|
325
|
+
createReferenceMismatchCheck: () => createReferenceMismatchCheck,
|
|
326
|
+
createTsdocCoverageCheck: () => createTsdocCoverageCheck,
|
|
324
327
|
customerProfileBundle: () => customerProfileBundle,
|
|
328
|
+
diffApiRollups: () => diffApiRollups,
|
|
325
329
|
docsSyncBundle: () => docsSyncBundle,
|
|
326
330
|
emptyCategoryBuckets: () => emptyCategoryBuckets,
|
|
327
331
|
extractApiProcedure: () => extractApiProcedure,
|
|
@@ -336,11 +340,13 @@ __export(index_exports, {
|
|
|
336
340
|
maintenanceAuditBundle: () => maintenanceAuditBundle,
|
|
337
341
|
meetingAnalysisBundle: () => meetingAnalysisBundle,
|
|
338
342
|
orchestratorBundle: () => orchestratorBundle,
|
|
343
|
+
parseApiRollup: () => parseApiRollup,
|
|
339
344
|
peopleProfileBundle: () => peopleProfileBundle,
|
|
340
345
|
persistAuditReport: () => persistAuditReport,
|
|
341
346
|
pnpmBundle: () => pnpmBundle,
|
|
342
347
|
prReviewBundle: () => prReviewBundle,
|
|
343
348
|
projenBundle: () => projenBundle,
|
|
349
|
+
referenceRecordToFinding: () => referenceRecordToFinding,
|
|
344
350
|
regulatoryResearchBundle: () => regulatoryResearchBundle,
|
|
345
351
|
renderAgentTierCaseStatement: () => renderAgentTierCaseStatement,
|
|
346
352
|
renderAgentTierSection: () => renderAgentTierSection,
|
|
@@ -403,6 +409,7 @@ __export(index_exports, {
|
|
|
403
409
|
slackBundle: () => slackBundle,
|
|
404
410
|
softwareProfileBundle: () => softwareProfileBundle,
|
|
405
411
|
standardsResearchBundle: () => standardsResearchBundle,
|
|
412
|
+
tsdocRecordToFindings: () => tsdocRecordToFindings,
|
|
406
413
|
turborepoBundle: () => turborepoBundle,
|
|
407
414
|
typescriptBundle: () => typescriptBundle,
|
|
408
415
|
validateAgentTierConfig: () => validateAgentTierConfig,
|
|
@@ -26803,8 +26810,8 @@ var FALLBACKS = {
|
|
|
26803
26810
|
monorepoLayoutSeedBlock: ""
|
|
26804
26811
|
};
|
|
26805
26812
|
var TEMPLATE_RE = /\{\{(\w+(?:\.\w+)*)\}\}/g;
|
|
26806
|
-
function getNestedValue(obj,
|
|
26807
|
-
const parts =
|
|
26813
|
+
function getNestedValue(obj, path8) {
|
|
26814
|
+
const parts = path8.split(".");
|
|
26808
26815
|
let current = obj;
|
|
26809
26816
|
for (const part of parts) {
|
|
26810
26817
|
if (current == null || typeof current !== "object") {
|
|
@@ -29413,9 +29420,388 @@ function auditReportJsonSchema() {
|
|
|
29413
29420
|
};
|
|
29414
29421
|
}
|
|
29415
29422
|
|
|
29423
|
+
// src/docs-sync/scan/checks/api-diff-check.ts
|
|
29424
|
+
function parseApiRollup(rollup) {
|
|
29425
|
+
const fenceContents = extractFirstTsFence(rollup);
|
|
29426
|
+
if (fenceContents === void 0) {
|
|
29427
|
+
return [];
|
|
29428
|
+
}
|
|
29429
|
+
const lines = fenceContents.split("\n");
|
|
29430
|
+
const entries = [];
|
|
29431
|
+
let i = 0;
|
|
29432
|
+
while (i < lines.length) {
|
|
29433
|
+
const line = lines[i];
|
|
29434
|
+
const trimmed = line.trim();
|
|
29435
|
+
if (!trimmed.startsWith("export ")) {
|
|
29436
|
+
i += 1;
|
|
29437
|
+
continue;
|
|
29438
|
+
}
|
|
29439
|
+
const startIndex = i;
|
|
29440
|
+
let buffer = trimmed;
|
|
29441
|
+
let braceDepth = countBraceDelta(trimmed);
|
|
29442
|
+
let endsWithSemicolon = trimmed.endsWith(";");
|
|
29443
|
+
i += 1;
|
|
29444
|
+
while (i < lines.length && !isComplete(buffer, braceDepth, endsWithSemicolon)) {
|
|
29445
|
+
const next = lines[i];
|
|
29446
|
+
const nextTrimmed = next.trim();
|
|
29447
|
+
if (nextTrimmed.length === 0 || nextTrimmed.startsWith("//")) {
|
|
29448
|
+
i += 1;
|
|
29449
|
+
continue;
|
|
29450
|
+
}
|
|
29451
|
+
buffer = `${buffer} ${nextTrimmed}`;
|
|
29452
|
+
braceDepth += countBraceDelta(nextTrimmed);
|
|
29453
|
+
endsWithSemicolon = nextTrimmed.endsWith(";");
|
|
29454
|
+
i += 1;
|
|
29455
|
+
}
|
|
29456
|
+
const normalized = normalizeWhitespace(buffer);
|
|
29457
|
+
const name = extractDeclarationName(normalized);
|
|
29458
|
+
if (name) {
|
|
29459
|
+
entries.push({ name, signature: normalized });
|
|
29460
|
+
}
|
|
29461
|
+
if (name && normalized.startsWith("export {")) {
|
|
29462
|
+
const names = extractExportListNames(normalized);
|
|
29463
|
+
if (names.length > 1) {
|
|
29464
|
+
entries.pop();
|
|
29465
|
+
for (const exportName of names) {
|
|
29466
|
+
entries.push({ name: exportName, signature: normalized });
|
|
29467
|
+
}
|
|
29468
|
+
}
|
|
29469
|
+
}
|
|
29470
|
+
if (i === startIndex) {
|
|
29471
|
+
i += 1;
|
|
29472
|
+
}
|
|
29473
|
+
}
|
|
29474
|
+
const dedup = /* @__PURE__ */ new Map();
|
|
29475
|
+
for (const entry of entries) {
|
|
29476
|
+
if (!dedup.has(entry.name)) {
|
|
29477
|
+
dedup.set(entry.name, entry);
|
|
29478
|
+
}
|
|
29479
|
+
}
|
|
29480
|
+
return Array.from(dedup.values()).sort(
|
|
29481
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
29482
|
+
);
|
|
29483
|
+
}
|
|
29484
|
+
function diffApiRollups(baselineRollup, currentRollup) {
|
|
29485
|
+
const baseline = /* @__PURE__ */ new Map();
|
|
29486
|
+
for (const entry of parseApiRollup(baselineRollup)) {
|
|
29487
|
+
baseline.set(entry.name, entry);
|
|
29488
|
+
}
|
|
29489
|
+
const current = /* @__PURE__ */ new Map();
|
|
29490
|
+
for (const entry of parseApiRollup(currentRollup)) {
|
|
29491
|
+
current.set(entry.name, entry);
|
|
29492
|
+
}
|
|
29493
|
+
const added = [];
|
|
29494
|
+
const removed = [];
|
|
29495
|
+
const changed = [];
|
|
29496
|
+
for (const [name, entry] of current.entries()) {
|
|
29497
|
+
const before = baseline.get(name);
|
|
29498
|
+
if (!before) {
|
|
29499
|
+
added.push(entry);
|
|
29500
|
+
continue;
|
|
29501
|
+
}
|
|
29502
|
+
if (before.signature !== entry.signature) {
|
|
29503
|
+
changed.push(entry);
|
|
29504
|
+
}
|
|
29505
|
+
}
|
|
29506
|
+
for (const [name, entry] of baseline.entries()) {
|
|
29507
|
+
if (!current.has(name)) {
|
|
29508
|
+
removed.push(entry);
|
|
29509
|
+
}
|
|
29510
|
+
}
|
|
29511
|
+
added.sort((a, b) => a.name.localeCompare(b.name));
|
|
29512
|
+
removed.sort((a, b) => a.name.localeCompare(b.name));
|
|
29513
|
+
changed.sort((a, b) => a.name.localeCompare(b.name));
|
|
29514
|
+
return { added, removed, changed };
|
|
29515
|
+
}
|
|
29516
|
+
function createApiDiffCheck(options) {
|
|
29517
|
+
const baseline = options.baselineRollup;
|
|
29518
|
+
const current = options.currentRollup;
|
|
29519
|
+
const rollupPath = options.rollupPath ?? "";
|
|
29520
|
+
return {
|
|
29521
|
+
name: options.name ?? "apiDiff",
|
|
29522
|
+
run(_context) {
|
|
29523
|
+
const diff = diffApiRollups(baseline, current);
|
|
29524
|
+
const findings = [];
|
|
29525
|
+
for (const entry of diff.added) {
|
|
29526
|
+
findings.push({
|
|
29527
|
+
category: AuditCategory.ApiDiff,
|
|
29528
|
+
severity: AuditSeverity.Mechanical,
|
|
29529
|
+
location: { file: rollupPath, line: 0 },
|
|
29530
|
+
subject: entry.name,
|
|
29531
|
+
details: `New public export \`${entry.name}\` not present in baseline rollup.`,
|
|
29532
|
+
change: "added",
|
|
29533
|
+
symbol: entry.name,
|
|
29534
|
+
fixHint: "stub-tsdoc"
|
|
29535
|
+
});
|
|
29536
|
+
}
|
|
29537
|
+
for (const entry of diff.removed) {
|
|
29538
|
+
findings.push({
|
|
29539
|
+
category: AuditCategory.ApiDiff,
|
|
29540
|
+
severity: AuditSeverity.Advisory,
|
|
29541
|
+
location: { file: rollupPath, line: 0 },
|
|
29542
|
+
subject: entry.name,
|
|
29543
|
+
details: `Public export \`${entry.name}\` was present in baseline rollup but is gone in the current rollup.`,
|
|
29544
|
+
change: "removed",
|
|
29545
|
+
symbol: entry.name
|
|
29546
|
+
});
|
|
29547
|
+
}
|
|
29548
|
+
for (const entry of diff.changed) {
|
|
29549
|
+
findings.push({
|
|
29550
|
+
category: AuditCategory.ApiDiff,
|
|
29551
|
+
severity: AuditSeverity.Advisory,
|
|
29552
|
+
location: { file: rollupPath, line: 0 },
|
|
29553
|
+
subject: entry.name,
|
|
29554
|
+
details: `Public export \`${entry.name}\` signature changed since baseline rollup.`,
|
|
29555
|
+
change: "changed",
|
|
29556
|
+
symbol: entry.name
|
|
29557
|
+
});
|
|
29558
|
+
}
|
|
29559
|
+
return findings;
|
|
29560
|
+
}
|
|
29561
|
+
};
|
|
29562
|
+
}
|
|
29563
|
+
function extractFirstTsFence(rollup) {
|
|
29564
|
+
const lines = rollup.split("\n");
|
|
29565
|
+
let start = -1;
|
|
29566
|
+
for (let i = 0; i < lines.length; i++) {
|
|
29567
|
+
const line = lines[i].trim();
|
|
29568
|
+
if (line === "```ts" || line === "```typescript") {
|
|
29569
|
+
start = i + 1;
|
|
29570
|
+
break;
|
|
29571
|
+
}
|
|
29572
|
+
}
|
|
29573
|
+
if (start < 0) {
|
|
29574
|
+
return void 0;
|
|
29575
|
+
}
|
|
29576
|
+
for (let j = start; j < lines.length; j++) {
|
|
29577
|
+
if (lines[j].trim() === "```") {
|
|
29578
|
+
return lines.slice(start, j).join("\n");
|
|
29579
|
+
}
|
|
29580
|
+
}
|
|
29581
|
+
return lines.slice(start).join("\n");
|
|
29582
|
+
}
|
|
29583
|
+
function countBraceDelta(line) {
|
|
29584
|
+
let delta = 0;
|
|
29585
|
+
for (const ch of line) {
|
|
29586
|
+
if (ch === "{") {
|
|
29587
|
+
delta += 1;
|
|
29588
|
+
} else if (ch === "}") {
|
|
29589
|
+
delta -= 1;
|
|
29590
|
+
}
|
|
29591
|
+
}
|
|
29592
|
+
return delta;
|
|
29593
|
+
}
|
|
29594
|
+
function isComplete(buffer, braceDepth, endsWithSemicolon) {
|
|
29595
|
+
if (braceDepth > 0) {
|
|
29596
|
+
return false;
|
|
29597
|
+
}
|
|
29598
|
+
if (endsWithSemicolon) {
|
|
29599
|
+
return true;
|
|
29600
|
+
}
|
|
29601
|
+
return buffer.trimEnd().endsWith("}");
|
|
29602
|
+
}
|
|
29603
|
+
function normalizeWhitespace(s) {
|
|
29604
|
+
return s.replace(/\s+/g, " ").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")").replace(/\[\s+/g, "[").replace(/\s+\]/g, "]").replace(/\{\s+/g, "{").replace(/\s+\}/g, "}").replace(/\s+,/g, ",").replace(/\s+;/g, ";").replace(/\s+:/g, ":").trim();
|
|
29605
|
+
}
|
|
29606
|
+
var DECLARATION_KEYWORDS = [
|
|
29607
|
+
"function",
|
|
29608
|
+
"class",
|
|
29609
|
+
"interface",
|
|
29610
|
+
"type",
|
|
29611
|
+
"enum",
|
|
29612
|
+
"const",
|
|
29613
|
+
"let",
|
|
29614
|
+
"var",
|
|
29615
|
+
"namespace",
|
|
29616
|
+
"abstract",
|
|
29617
|
+
"default",
|
|
29618
|
+
"async"
|
|
29619
|
+
];
|
|
29620
|
+
function extractDeclarationName(declaration) {
|
|
29621
|
+
const tokens = declaration.split(/\s+/);
|
|
29622
|
+
if (tokens.length === 0 || tokens[0] !== "export") {
|
|
29623
|
+
return void 0;
|
|
29624
|
+
}
|
|
29625
|
+
let cursor = 1;
|
|
29626
|
+
while (cursor < tokens.length && DECLARATION_KEYWORDS.includes(tokens[cursor])) {
|
|
29627
|
+
cursor += 1;
|
|
29628
|
+
}
|
|
29629
|
+
if (cursor >= tokens.length) {
|
|
29630
|
+
return void 0;
|
|
29631
|
+
}
|
|
29632
|
+
const candidate = tokens[cursor];
|
|
29633
|
+
if (candidate.startsWith("{")) {
|
|
29634
|
+
const stripped = candidate.replace(/^\{/, "").replace(/[},].*$/, "");
|
|
29635
|
+
return stripped || void 0;
|
|
29636
|
+
}
|
|
29637
|
+
const cleaned = candidate.replace(/[<(:;].*$/, "");
|
|
29638
|
+
return cleaned || void 0;
|
|
29639
|
+
}
|
|
29640
|
+
function extractExportListNames(declaration) {
|
|
29641
|
+
const open = declaration.indexOf("{");
|
|
29642
|
+
const close = declaration.indexOf("}", open);
|
|
29643
|
+
if (open < 0 || close < 0) {
|
|
29644
|
+
return [];
|
|
29645
|
+
}
|
|
29646
|
+
const inside = declaration.slice(open + 1, close);
|
|
29647
|
+
const names = [];
|
|
29648
|
+
for (const part of inside.split(",")) {
|
|
29649
|
+
const token = part.trim();
|
|
29650
|
+
if (!token) {
|
|
29651
|
+
continue;
|
|
29652
|
+
}
|
|
29653
|
+
const asMatch = token.match(/\sas\s+(\S+)$/);
|
|
29654
|
+
if (asMatch) {
|
|
29655
|
+
names.push(asMatch[1]);
|
|
29656
|
+
} else {
|
|
29657
|
+
names.push(token);
|
|
29658
|
+
}
|
|
29659
|
+
}
|
|
29660
|
+
return names;
|
|
29661
|
+
}
|
|
29662
|
+
|
|
29663
|
+
// src/docs-sync/scan/checks/reference-mismatch-check.ts
|
|
29664
|
+
function referenceRecordToFinding(record, signatureChangedSymbols) {
|
|
29665
|
+
if (signatureChangedSymbols.has(record.symbol)) {
|
|
29666
|
+
return {
|
|
29667
|
+
category: AuditCategory.ReferenceMismatches,
|
|
29668
|
+
severity: AuditSeverity.Advisory,
|
|
29669
|
+
location: { file: record.docPath, line: record.line },
|
|
29670
|
+
subject: record.symbol,
|
|
29671
|
+
details: `Inline reference \`${record.symbol}\` resolves to a symbol whose signature has changed; review the surrounding prose.`,
|
|
29672
|
+
mismatch: "signature-changed",
|
|
29673
|
+
symbol: record.symbol
|
|
29674
|
+
};
|
|
29675
|
+
}
|
|
29676
|
+
if (!record.isKnown) {
|
|
29677
|
+
return {
|
|
29678
|
+
category: AuditCategory.ReferenceMismatches,
|
|
29679
|
+
severity: AuditSeverity.Advisory,
|
|
29680
|
+
location: { file: record.docPath, line: record.line },
|
|
29681
|
+
subject: record.symbol,
|
|
29682
|
+
details: `Inline reference \`${record.symbol}\` does not match any known public export.`,
|
|
29683
|
+
mismatch: "unknown-symbol",
|
|
29684
|
+
symbol: record.symbol
|
|
29685
|
+
};
|
|
29686
|
+
}
|
|
29687
|
+
return void 0;
|
|
29688
|
+
}
|
|
29689
|
+
function createReferenceMismatchCheck(options) {
|
|
29690
|
+
const records = options.records;
|
|
29691
|
+
const signatureChangedSymbols = new Set(
|
|
29692
|
+
options.signatureChangedSymbols ?? []
|
|
29693
|
+
);
|
|
29694
|
+
return {
|
|
29695
|
+
name: options.name ?? "referenceMismatches",
|
|
29696
|
+
run(_context) {
|
|
29697
|
+
const findings = [];
|
|
29698
|
+
for (const record of records) {
|
|
29699
|
+
const finding = referenceRecordToFinding(
|
|
29700
|
+
record,
|
|
29701
|
+
signatureChangedSymbols
|
|
29702
|
+
);
|
|
29703
|
+
if (finding !== void 0) {
|
|
29704
|
+
findings.push(finding);
|
|
29705
|
+
}
|
|
29706
|
+
}
|
|
29707
|
+
return findings;
|
|
29708
|
+
}
|
|
29709
|
+
};
|
|
29710
|
+
}
|
|
29711
|
+
|
|
29712
|
+
// src/docs-sync/scan/checks/tsdoc-coverage-check.ts
|
|
29713
|
+
var path5 = __toESM(require("path"));
|
|
29714
|
+
function tsdocRecordToFindings(record, context) {
|
|
29715
|
+
const findings = [];
|
|
29716
|
+
const file = relativizeFile(record.location.file, context.repoRoot);
|
|
29717
|
+
const line = record.location.line;
|
|
29718
|
+
const symbol = record.symbol;
|
|
29719
|
+
if (!record.hasSummary) {
|
|
29720
|
+
findings.push({
|
|
29721
|
+
category: AuditCategory.TsdocCoverage,
|
|
29722
|
+
severity: AuditSeverity.Mechanical,
|
|
29723
|
+
location: { file, line },
|
|
29724
|
+
subject: symbol,
|
|
29725
|
+
details: `Public export \`${symbol}\` is missing a TSDoc summary.`,
|
|
29726
|
+
shortfall: "missing-summary",
|
|
29727
|
+
symbol,
|
|
29728
|
+
fixHint: "stub-tsdoc"
|
|
29729
|
+
});
|
|
29730
|
+
return findings;
|
|
29731
|
+
}
|
|
29732
|
+
if (record.hasThinSummary) {
|
|
29733
|
+
findings.push({
|
|
29734
|
+
category: AuditCategory.TsdocCoverage,
|
|
29735
|
+
severity: AuditSeverity.Advisory,
|
|
29736
|
+
location: { file, line },
|
|
29737
|
+
subject: symbol,
|
|
29738
|
+
details: `Public export \`${symbol}\` carries a thin TSDoc summary; consider expanding it.`,
|
|
29739
|
+
shortfall: "thin-summary",
|
|
29740
|
+
symbol
|
|
29741
|
+
});
|
|
29742
|
+
}
|
|
29743
|
+
if (!record.hasParams && isParamCarryingKind(record)) {
|
|
29744
|
+
findings.push({
|
|
29745
|
+
category: AuditCategory.TsdocCoverage,
|
|
29746
|
+
severity: AuditSeverity.Advisory,
|
|
29747
|
+
location: { file, line },
|
|
29748
|
+
subject: symbol,
|
|
29749
|
+
details: `Public export \`${symbol}\` has parameters with no \`@param\` block tag.`,
|
|
29750
|
+
shortfall: "missing-params",
|
|
29751
|
+
symbol
|
|
29752
|
+
});
|
|
29753
|
+
}
|
|
29754
|
+
if (!record.hasReturns && isReturnCarryingKind(record)) {
|
|
29755
|
+
findings.push({
|
|
29756
|
+
category: AuditCategory.TsdocCoverage,
|
|
29757
|
+
severity: AuditSeverity.Advisory,
|
|
29758
|
+
location: { file, line },
|
|
29759
|
+
subject: symbol,
|
|
29760
|
+
details: `Public export \`${symbol}\` has a return value with no \`@returns\` block tag.`,
|
|
29761
|
+
shortfall: "missing-returns",
|
|
29762
|
+
symbol
|
|
29763
|
+
});
|
|
29764
|
+
}
|
|
29765
|
+
return findings;
|
|
29766
|
+
}
|
|
29767
|
+
function createTsdocCoverageCheck(options) {
|
|
29768
|
+
const records = options.records;
|
|
29769
|
+
return {
|
|
29770
|
+
name: options.name ?? "tsdocCoverage",
|
|
29771
|
+
run(context) {
|
|
29772
|
+
const findings = [];
|
|
29773
|
+
for (const record of records) {
|
|
29774
|
+
for (const finding of tsdocRecordToFindings(record, context)) {
|
|
29775
|
+
findings.push(finding);
|
|
29776
|
+
}
|
|
29777
|
+
}
|
|
29778
|
+
return findings;
|
|
29779
|
+
}
|
|
29780
|
+
};
|
|
29781
|
+
}
|
|
29782
|
+
function isParamCarryingKind(record) {
|
|
29783
|
+
return record.kind === "Function";
|
|
29784
|
+
}
|
|
29785
|
+
function isReturnCarryingKind(record) {
|
|
29786
|
+
return record.kind === "Function";
|
|
29787
|
+
}
|
|
29788
|
+
function relativizeFile(file, repoRoot) {
|
|
29789
|
+
if (!file) {
|
|
29790
|
+
return "";
|
|
29791
|
+
}
|
|
29792
|
+
if (!path5.isAbsolute(file)) {
|
|
29793
|
+
return toPosix3(file);
|
|
29794
|
+
}
|
|
29795
|
+
const rel = path5.relative(repoRoot, file);
|
|
29796
|
+
return toPosix3(rel);
|
|
29797
|
+
}
|
|
29798
|
+
function toPosix3(p) {
|
|
29799
|
+
return p.split(path5.sep).join("/");
|
|
29800
|
+
}
|
|
29801
|
+
|
|
29416
29802
|
// src/docs-sync/scan/run-scan.ts
|
|
29417
29803
|
var fs3 = __toESM(require("fs"));
|
|
29418
|
-
var
|
|
29804
|
+
var path6 = __toESM(require("path"));
|
|
29419
29805
|
var DEFAULT_AUDIT_REPORT_DIR = ".claude/state/docs-sync";
|
|
29420
29806
|
var SEVERITY_RANK = {
|
|
29421
29807
|
blocking: 0,
|
|
@@ -29430,7 +29816,7 @@ var AUDIT_CATEGORY_ORDER = [
|
|
|
29430
29816
|
AuditCategory.SampleFailures
|
|
29431
29817
|
];
|
|
29432
29818
|
function runScan(options) {
|
|
29433
|
-
const repoRoot =
|
|
29819
|
+
const repoRoot = path6.resolve(options.repoRoot);
|
|
29434
29820
|
const mode = options.mode;
|
|
29435
29821
|
const scope = options.scope ?? "";
|
|
29436
29822
|
const issueNumber = options.issueNumber;
|
|
@@ -29505,11 +29891,11 @@ function buildReport(args) {
|
|
|
29505
29891
|
};
|
|
29506
29892
|
}
|
|
29507
29893
|
function persistAuditReport(args) {
|
|
29508
|
-
const repoRoot =
|
|
29894
|
+
const repoRoot = path6.resolve(args.repoRoot);
|
|
29509
29895
|
const reportDir = args.reportDir ?? DEFAULT_AUDIT_REPORT_DIR;
|
|
29510
|
-
const targetDir =
|
|
29896
|
+
const targetDir = path6.resolve(repoRoot, reportDir);
|
|
29511
29897
|
fs3.mkdirSync(targetDir, { recursive: true });
|
|
29512
|
-
const targetFile =
|
|
29898
|
+
const targetFile = path6.join(
|
|
29513
29899
|
targetDir,
|
|
29514
29900
|
`${args.report.issueNumber}-audit.json`
|
|
29515
29901
|
);
|
|
@@ -29572,7 +29958,7 @@ function compareFindings(a, b) {
|
|
|
29572
29958
|
}
|
|
29573
29959
|
|
|
29574
29960
|
// src/docs-sync/tsdoc-coverage/coverage.ts
|
|
29575
|
-
var
|
|
29961
|
+
var path7 = __toESM(require("path"));
|
|
29576
29962
|
var import_tsdoc = require("@microsoft/tsdoc");
|
|
29577
29963
|
var ts2 = __toESM(require("typescript"));
|
|
29578
29964
|
var TsDocCoverageKind = {
|
|
@@ -29590,8 +29976,8 @@ var DEFAULT_THIN_SUMMARY_WORD_THRESHOLD = 4;
|
|
|
29590
29976
|
var DEFAULT_ENTRY_POINT = "src/index.ts";
|
|
29591
29977
|
function analyzeTsDocCoverage(options) {
|
|
29592
29978
|
const resolvedOptions = typeof options === "string" ? { packageRoot: options } : options;
|
|
29593
|
-
const packageRoot =
|
|
29594
|
-
const entryPoint =
|
|
29979
|
+
const packageRoot = path7.resolve(resolvedOptions.packageRoot);
|
|
29980
|
+
const entryPoint = path7.resolve(
|
|
29595
29981
|
packageRoot,
|
|
29596
29982
|
resolvedOptions.entryPoint ?? DEFAULT_ENTRY_POINT
|
|
29597
29983
|
);
|
|
@@ -29654,7 +30040,7 @@ function analyzeTsDocCoverage(options) {
|
|
|
29654
30040
|
}
|
|
29655
30041
|
function resolveCompilerOptions(packageRoot, tsconfigPath) {
|
|
29656
30042
|
if (tsconfigPath) {
|
|
29657
|
-
const absoluteTsconfig =
|
|
30043
|
+
const absoluteTsconfig = path7.resolve(packageRoot, tsconfigPath);
|
|
29658
30044
|
const configFile = ts2.readConfigFile(absoluteTsconfig, ts2.sys.readFile);
|
|
29659
30045
|
if (configFile.error) {
|
|
29660
30046
|
throw new Error(
|
|
@@ -29664,7 +30050,7 @@ function resolveCompilerOptions(packageRoot, tsconfigPath) {
|
|
|
29664
30050
|
const parsed = ts2.parseJsonConfigFileContent(
|
|
29665
30051
|
configFile.config,
|
|
29666
30052
|
ts2.sys,
|
|
29667
|
-
|
|
30053
|
+
path7.dirname(absoluteTsconfig)
|
|
29668
30054
|
);
|
|
29669
30055
|
return { ...parsed.options, noEmit: true };
|
|
29670
30056
|
}
|
|
@@ -29973,14 +30359,14 @@ var LAYOUT_ROOT_BY_PROJECT_TYPE = {
|
|
|
29973
30359
|
};
|
|
29974
30360
|
function validateMonorepoLayout(root) {
|
|
29975
30361
|
const violations = [];
|
|
29976
|
-
const rootOutdir =
|
|
30362
|
+
const rootOutdir = toPosix4(root.outdir);
|
|
29977
30363
|
for (const sub of root.subprojects) {
|
|
29978
30364
|
const className = sub.constructor.name;
|
|
29979
30365
|
const expectedRoot = expectedRootFor(sub, className);
|
|
29980
30366
|
if (expectedRoot === void 0) {
|
|
29981
30367
|
continue;
|
|
29982
30368
|
}
|
|
29983
|
-
const relOutdir = relativeOutdir(rootOutdir,
|
|
30369
|
+
const relOutdir = relativeOutdir(rootOutdir, toPosix4(sub.outdir));
|
|
29984
30370
|
if (!outdirMatchesRoot(relOutdir, expectedRoot)) {
|
|
29985
30371
|
violations.push({
|
|
29986
30372
|
projectName: sub.name,
|
|
@@ -30039,7 +30425,7 @@ function outdirMatchesRoot(relOutdir, expectedRoot) {
|
|
|
30039
30425
|
}
|
|
30040
30426
|
return segments.length >= 2;
|
|
30041
30427
|
}
|
|
30042
|
-
function
|
|
30428
|
+
function toPosix4(p) {
|
|
30043
30429
|
return p.replace(/\\/g, "/");
|
|
30044
30430
|
}
|
|
30045
30431
|
function relativeOutdir(rootOutdir, subOutdir) {
|
|
@@ -30119,8 +30505,8 @@ var ResetTask = class _ResetTask extends import_projen14.Component {
|
|
|
30119
30505
|
const resetTask = this.project.tasks.addTask(this.taskName, {
|
|
30120
30506
|
description: "Delete build artifacts specified by pathsToRemove option, or artifactsDirectory if pathsToRemove is empty"
|
|
30121
30507
|
});
|
|
30122
|
-
this.pathsToRemove.forEach((
|
|
30123
|
-
resetTask.exec(`[ -e "${
|
|
30508
|
+
this.pathsToRemove.forEach((path8) => {
|
|
30509
|
+
resetTask.exec(`[ -e "${path8}" ] && rm -rf ${path8} || true`);
|
|
30124
30510
|
});
|
|
30125
30511
|
const rootHasTurbo = TurboRepo.of(this.project.root) !== void 0;
|
|
30126
30512
|
const isSubproject = this.project !== this.project.root;
|
|
@@ -32213,7 +32599,11 @@ var TypeScriptConfig = class extends import_projen23.Component {
|
|
|
32213
32599
|
classifyRun,
|
|
32214
32600
|
companyProfileBundle,
|
|
32215
32601
|
compileFencedSamples,
|
|
32602
|
+
createApiDiffCheck,
|
|
32603
|
+
createReferenceMismatchCheck,
|
|
32604
|
+
createTsdocCoverageCheck,
|
|
32216
32605
|
customerProfileBundle,
|
|
32606
|
+
diffApiRollups,
|
|
32217
32607
|
docsSyncBundle,
|
|
32218
32608
|
emptyCategoryBuckets,
|
|
32219
32609
|
extractApiProcedure,
|
|
@@ -32228,11 +32618,13 @@ var TypeScriptConfig = class extends import_projen23.Component {
|
|
|
32228
32618
|
maintenanceAuditBundle,
|
|
32229
32619
|
meetingAnalysisBundle,
|
|
32230
32620
|
orchestratorBundle,
|
|
32621
|
+
parseApiRollup,
|
|
32231
32622
|
peopleProfileBundle,
|
|
32232
32623
|
persistAuditReport,
|
|
32233
32624
|
pnpmBundle,
|
|
32234
32625
|
prReviewBundle,
|
|
32235
32626
|
projenBundle,
|
|
32627
|
+
referenceRecordToFinding,
|
|
32236
32628
|
regulatoryResearchBundle,
|
|
32237
32629
|
renderAgentTierCaseStatement,
|
|
32238
32630
|
renderAgentTierSection,
|
|
@@ -32295,6 +32687,7 @@ var TypeScriptConfig = class extends import_projen23.Component {
|
|
|
32295
32687
|
slackBundle,
|
|
32296
32688
|
softwareProfileBundle,
|
|
32297
32689
|
standardsResearchBundle,
|
|
32690
|
+
tsdocRecordToFindings,
|
|
32298
32691
|
turborepoBundle,
|
|
32299
32692
|
typescriptBundle,
|
|
32300
32693
|
validateAgentTierConfig,
|