@decantr/cli 3.5.3 → 3.5.4
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/dist/bin.js +4 -4
- package/dist/{chunk-4WT6AVKO.js → chunk-4WVKE2AQ.js} +42 -22
- package/dist/{chunk-SUB3F5RO.js → chunk-EWUWVQYM.js} +1 -1
- package/dist/{chunk-KFGL6DVJ.js → chunk-GPGBJFMF.js} +20 -15
- package/dist/{chunk-FE3N5MAO.js → chunk-UDBPH25I.js} +1 -1
- package/dist/{heal-M6V2I6DB.js → heal-4BQCO4ST.js} +1 -1
- package/dist/{health-RIOSZEJP.js → health-WO2BQYIC.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/{studio-7JSGAGVX.js → studio-TXFV3PDM.js} +3 -3
- package/dist/{workspace-PFUW4W65.js → workspace-G6PN53XI.js} +3 -3
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-GPGBJFMF.js";
|
|
3
3
|
import "./chunk-SIDKK73N.js";
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-UDBPH25I.js";
|
|
5
|
+
import "./chunk-EWUWVQYM.js";
|
|
6
|
+
import "./chunk-4WVKE2AQ.js";
|
|
@@ -458,6 +458,8 @@ function walkSvelteKitRoutes(dir, baseDir, segments) {
|
|
|
458
458
|
var ROUTER_FILE_EXTENSIONS = /* @__PURE__ */ new Set([".tsx", ".ts", ".jsx", ".js"]);
|
|
459
459
|
var ROUTE_VARIABLE_NAMES = "(?:path|pathname|route|currentPath|currentRoute|locationPath|activePath)";
|
|
460
460
|
var ROUTE_ASSET_EXTENSION_RE = /\.(?:avif|bmp|css|gif|ico|jpeg|jpg|js|json|map|mp4|pdf|png|svg|webp|woff2?)$/i;
|
|
461
|
+
var JSX_ROUTE_PATH_RE = /<(?:Route|[A-Z][\w.]*Route)\b[^>]*\bpath\s*=\s*(?:"([^"]+)"|'([^']+)'|{\s*"([^"]+)"\s*}|{\s*'([^']+)'\s*}|{\s*`([^`]+)`\s*})/g;
|
|
462
|
+
var OBJECT_ROUTE_PATH_RE = /\bpath\s*:\s*(?:"([^"]+)"|'([^']+)'|`([^`]+)`)/g;
|
|
461
463
|
function collectRouteCandidateFiles(dir, files, depth = 0) {
|
|
462
464
|
if (depth > 5) return;
|
|
463
465
|
let entries;
|
|
@@ -501,11 +503,13 @@ function scanReactRouter(projectRoot) {
|
|
|
501
503
|
const relativePath = relative2(projectRoot, absolutePath);
|
|
502
504
|
const pathMatches = /* @__PURE__ */ new Set();
|
|
503
505
|
if (isReactRouterFile) {
|
|
504
|
-
for (const match of content.matchAll(
|
|
505
|
-
|
|
506
|
+
for (const match of content.matchAll(JSX_ROUTE_PATH_RE)) {
|
|
507
|
+
const route = firstRouteLiteralMatch(match);
|
|
508
|
+
if (route) pathMatches.add(route);
|
|
506
509
|
}
|
|
507
|
-
for (const match of content.matchAll(
|
|
508
|
-
|
|
510
|
+
for (const match of content.matchAll(OBJECT_ROUTE_PATH_RE)) {
|
|
511
|
+
const route = firstRouteLiteralMatch(match);
|
|
512
|
+
if (route) pathMatches.add(route);
|
|
509
513
|
}
|
|
510
514
|
}
|
|
511
515
|
for (const route of detectDeclarativeRouteSpecRoutes(content)) {
|
|
@@ -519,32 +523,48 @@ function scanReactRouter(projectRoot) {
|
|
|
519
523
|
pathMatches.add("/");
|
|
520
524
|
}
|
|
521
525
|
for (const path of pathMatches) {
|
|
522
|
-
const routePath
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
for (const routePath of normalizeDetectedRouteLiterals(path)) {
|
|
527
|
+
if (routeMap.has(routePath)) continue;
|
|
528
|
+
routeMap.set(routePath, {
|
|
529
|
+
path: routePath,
|
|
530
|
+
file: relativePath,
|
|
531
|
+
hasLayout: false
|
|
532
|
+
});
|
|
533
|
+
}
|
|
529
534
|
}
|
|
530
535
|
}
|
|
531
536
|
return [...routeMap.values()];
|
|
532
537
|
}
|
|
533
|
-
function
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
function firstRouteLiteralMatch(match) {
|
|
539
|
+
return match.slice(1).find((value) => typeof value === "string") ?? null;
|
|
540
|
+
}
|
|
541
|
+
function normalizeDetectedRouteLiterals(value) {
|
|
542
|
+
const withoutHash = value.trim().split("#")[0];
|
|
543
|
+
const cleaned = withoutHash.includes("?") && !withoutHash.endsWith(")?") ? withoutHash.split("?")[0] : withoutHash;
|
|
544
|
+
if (!cleaned || cleaned === "/") return ["/"];
|
|
545
|
+
if (cleaned === "*" || cleaned === "**" || cleaned.startsWith("#")) return [];
|
|
546
|
+
if (cleaned === "/*" || cleaned === "/**") return [];
|
|
547
|
+
if (!cleaned.startsWith("/") || cleaned.startsWith("//")) return [];
|
|
548
|
+
if (ROUTE_ASSET_EXTENSION_RE.test(cleaned)) return [];
|
|
549
|
+
const optionalGroup = cleaned.match(/^\/\(([^()]+)\)\?$/);
|
|
550
|
+
if (optionalGroup) {
|
|
551
|
+
return [
|
|
552
|
+
"/",
|
|
553
|
+
...optionalGroup[1].split("|").map((segment) => segment.trim()).filter(Boolean).map((segment) => `/${segment}`)
|
|
554
|
+
];
|
|
555
|
+
}
|
|
556
|
+
const withoutTrailingWildcard = cleaned.endsWith("*") && !cleaned.endsWith("/*") && !/:\w+\*$/.test(cleaned) ? cleaned.slice(0, -1) : cleaned;
|
|
557
|
+
const normalized2 = withoutTrailingWildcard.replace(/\/+$/g, "") || "/";
|
|
558
|
+
if (normalized2 === "/*" || normalized2 === "/**") return [];
|
|
559
|
+
return [normalized2];
|
|
540
560
|
}
|
|
541
561
|
function collectRouteLiterals(pattern, content, routes) {
|
|
542
562
|
let count = 0;
|
|
543
563
|
for (const match of content.matchAll(pattern)) {
|
|
544
|
-
const route
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
564
|
+
for (const route of normalizeDetectedRouteLiterals(match[1] ?? "")) {
|
|
565
|
+
routes.add(route);
|
|
566
|
+
count += 1;
|
|
567
|
+
}
|
|
548
568
|
}
|
|
549
569
|
return count;
|
|
550
570
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
sendProjectHealthCiFailedTelemetry,
|
|
4
4
|
sendProjectHealthPromptTelemetry,
|
|
5
5
|
sendProjectHealthReportTelemetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4WVKE2AQ.js";
|
|
7
7
|
|
|
8
8
|
// src/commands/health.ts
|
|
9
9
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
listWorkspaceCandidates,
|
|
23
23
|
listWorkspaceProjects,
|
|
24
24
|
shouldFailWorkspaceHealth
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-UDBPH25I.js";
|
|
26
26
|
import {
|
|
27
27
|
acceptBrownfieldLocalLaw,
|
|
28
28
|
acceptStyleBridge,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
writeBrownfieldCodifyProposal,
|
|
53
53
|
writeHostedPatternMappingProposal,
|
|
54
54
|
writeStyleBridgeProposal
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-EWUWVQYM.js";
|
|
56
56
|
import {
|
|
57
57
|
buildGuardRegistryContext,
|
|
58
58
|
createDoctrineMap,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
sendCliCommandTelemetry,
|
|
70
70
|
sendNewProjectCompletedTelemetry,
|
|
71
71
|
writeDoctrineMap
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-4WVKE2AQ.js";
|
|
73
73
|
|
|
74
74
|
// src/index.ts
|
|
75
75
|
import { existsSync as existsSync29, mkdirSync as mkdirSync16, readdirSync as readdirSync8, readFileSync as readFileSync22, writeFileSync as writeFileSync19 } from "fs";
|
|
@@ -6220,11 +6220,16 @@ function walkFiles(dir) {
|
|
|
6220
6220
|
return files;
|
|
6221
6221
|
}
|
|
6222
6222
|
function trackedGeneratedFiles(projectRoot) {
|
|
6223
|
-
|
|
6223
|
+
const files = [
|
|
6224
6224
|
join24(projectRoot, "DECANTR.md"),
|
|
6225
|
-
...walkFiles(join24(projectRoot, ".decantr", "context"))
|
|
6226
|
-
|
|
6227
|
-
|
|
6225
|
+
...walkFiles(join24(projectRoot, ".decantr", "context"))
|
|
6226
|
+
];
|
|
6227
|
+
if (!isContractOnlyProject2(projectRoot)) {
|
|
6228
|
+
files.push(
|
|
6229
|
+
...["global.css", "tokens.css", "treatments.css", "decantr-bridge.css"].map((file) => join24(projectRoot, "src", "styles", file)).filter((path) => existsSync22(path))
|
|
6230
|
+
);
|
|
6231
|
+
}
|
|
6232
|
+
return files.filter((path) => existsSync22(path));
|
|
6228
6233
|
}
|
|
6229
6234
|
function snapshotGeneratedFiles(projectRoot) {
|
|
6230
6235
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -11073,7 +11078,7 @@ async function cmdAdoptWorkflow(args) {
|
|
|
11073
11078
|
await cmdGraph(projectRoot, { displayRoot: process.cwd() });
|
|
11074
11079
|
if (process.exitCode && process.exitCode !== 0) return;
|
|
11075
11080
|
if (runVerify) {
|
|
11076
|
-
const { cmdHealth } = await import("./health-
|
|
11081
|
+
const { cmdHealth } = await import("./health-WO2BQYIC.js");
|
|
11077
11082
|
await cmdHealth(projectRoot, {
|
|
11078
11083
|
browser: runBrowser,
|
|
11079
11084
|
browserBaseUrl: baseUrl,
|
|
@@ -11147,7 +11152,7 @@ async function cmdVerifyWorkflow(args) {
|
|
|
11147
11152
|
return;
|
|
11148
11153
|
}
|
|
11149
11154
|
if (workspaceMode) {
|
|
11150
|
-
const { cmdWorkspace } = await import("./workspace-
|
|
11155
|
+
const { cmdWorkspace } = await import("./workspace-G6PN53XI.js");
|
|
11151
11156
|
await cmdWorkspace(process.cwd(), ["workspace", "health", ...withoutWorkflowOnlyFlags(args)]);
|
|
11152
11157
|
return;
|
|
11153
11158
|
}
|
|
@@ -11180,7 +11185,7 @@ async function cmdVerifyWorkflow(args) {
|
|
|
11180
11185
|
}
|
|
11181
11186
|
let guardExitCode;
|
|
11182
11187
|
if (brownfield) {
|
|
11183
|
-
const { cmdHeal, collectCheckIssues } = await import("./heal-
|
|
11188
|
+
const { cmdHeal, collectCheckIssues } = await import("./heal-4BQCO4ST.js");
|
|
11184
11189
|
if (quietOutput) {
|
|
11185
11190
|
const result = collectCheckIssues(workspaceInfo.appRoot, { brownfield: true });
|
|
11186
11191
|
guardExitCode = result.issues.some((issue) => issue.type === "error") ? 1 : void 0;
|
|
@@ -11190,7 +11195,7 @@ async function cmdVerifyWorkflow(args) {
|
|
|
11190
11195
|
process.exitCode = void 0;
|
|
11191
11196
|
}
|
|
11192
11197
|
}
|
|
11193
|
-
const { cmdHealth, parseHealthArgs } = await import("./health-
|
|
11198
|
+
const { cmdHealth, parseHealthArgs } = await import("./health-WO2BQYIC.js");
|
|
11194
11199
|
await cmdHealth(workspaceInfo.appRoot, parseHealthArgs(healthArgs));
|
|
11195
11200
|
if (localPatterns) {
|
|
11196
11201
|
const validation = validateLocalLaw(workspaceInfo.appRoot);
|
|
@@ -12827,7 +12832,7 @@ async function main() {
|
|
|
12827
12832
|
`${YELLOW13}Note: \`decantr heal\` is deprecated. Use \`decantr check\` instead.${RESET17}`
|
|
12828
12833
|
);
|
|
12829
12834
|
}
|
|
12830
|
-
const { cmdHeal } = await import("./heal-
|
|
12835
|
+
const { cmdHeal } = await import("./heal-4BQCO4ST.js");
|
|
12831
12836
|
const { flags } = parseLooseArgs(args);
|
|
12832
12837
|
const workspaceInfo = resolveWorkflowProject(flags, "check");
|
|
12833
12838
|
if (!workspaceInfo) break;
|
|
@@ -12852,7 +12857,7 @@ async function main() {
|
|
|
12852
12857
|
const { flags } = parseLooseArgs(args);
|
|
12853
12858
|
const workspaceInfo = resolveWorkflowProject(flags, "health");
|
|
12854
12859
|
if (!workspaceInfo) break;
|
|
12855
|
-
const { cmdHealth, parseHealthArgs } = await import("./health-
|
|
12860
|
+
const { cmdHealth, parseHealthArgs } = await import("./health-WO2BQYIC.js");
|
|
12856
12861
|
await cmdHealth(workspaceInfo.appRoot, parseHealthArgs(stripProjectArgs(args)));
|
|
12857
12862
|
} catch (e) {
|
|
12858
12863
|
console.error(error2(e.message));
|
|
@@ -12880,7 +12885,7 @@ async function main() {
|
|
|
12880
12885
|
cmdStudioHelp();
|
|
12881
12886
|
break;
|
|
12882
12887
|
}
|
|
12883
|
-
const { cmdStudio, parseStudioArgs } = await import("./studio-
|
|
12888
|
+
const { cmdStudio, parseStudioArgs } = await import("./studio-TXFV3PDM.js");
|
|
12884
12889
|
await cmdStudio(process.cwd(), parseStudioArgs(args));
|
|
12885
12890
|
} catch (e) {
|
|
12886
12891
|
console.error(error2(e.message));
|
|
@@ -12894,7 +12899,7 @@ async function main() {
|
|
|
12894
12899
|
cmdWorkspaceHelp();
|
|
12895
12900
|
break;
|
|
12896
12901
|
}
|
|
12897
|
-
const { cmdWorkspace } = await import("./workspace-
|
|
12902
|
+
const { cmdWorkspace } = await import("./workspace-G6PN53XI.js");
|
|
12898
12903
|
await cmdWorkspace(process.cwd(), args);
|
|
12899
12904
|
} catch (e) {
|
|
12900
12905
|
console.error(error2(e.message));
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
renderProjectHealthCiWorkflow,
|
|
14
14
|
shouldFailHealth,
|
|
15
15
|
writeProjectHealthCiWorkflow
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-EWUWVQYM.js";
|
|
17
|
+
import "./chunk-4WVKE2AQ.js";
|
|
18
18
|
export {
|
|
19
19
|
cmdHealth,
|
|
20
20
|
collectDesignTokenEvidence,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-GPGBJFMF.js";
|
|
2
2
|
import "./chunk-SIDKK73N.js";
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-UDBPH25I.js";
|
|
4
|
+
import "./chunk-EWUWVQYM.js";
|
|
5
|
+
import "./chunk-4WVKE2AQ.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkspaceHealthReport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UDBPH25I.js";
|
|
4
4
|
import {
|
|
5
5
|
createProjectHealthReport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EWUWVQYM.js";
|
|
7
7
|
import {
|
|
8
8
|
sendStudioHealthRefreshedTelemetry,
|
|
9
9
|
sendStudioStartedTelemetry
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4WVKE2AQ.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/studio.ts
|
|
13
13
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
listWorkspaceProjects,
|
|
8
8
|
parseWorkspaceArgs,
|
|
9
9
|
shouldFailWorkspaceHealth
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-UDBPH25I.js";
|
|
11
|
+
import "./chunk-EWUWVQYM.js";
|
|
12
|
+
import "./chunk-4WVKE2AQ.js";
|
|
13
13
|
export {
|
|
14
14
|
cmdWorkspace,
|
|
15
15
|
createWorkspaceHealthReport,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decantr/cli",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "Decantr CLI - adopt, verify, graph, and govern frontend codebases touched by AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"decantr",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"ajv": "^8.20.0",
|
|
52
52
|
"@decantr/essence-spec": "3.4.0",
|
|
53
53
|
"@decantr/core": "3.5.0",
|
|
54
|
-
"@decantr/
|
|
54
|
+
"@decantr/telemetry": "3.4.0",
|
|
55
55
|
"@decantr/registry": "3.4.0",
|
|
56
|
-
"@decantr/
|
|
56
|
+
"@decantr/verifier": "3.5.4"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup",
|