@lensmcp/nx-plugin 1.0.0 → 1.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-verify.d.ts","sourceRoot":"","sources":["../../../src/executors/agent-verify/agent-verify.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,UAAU,cAAc;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAmBD;;;;;;;;;;;;;GAaG;AACH,wBAA8B,mBAAmB,CAC/C,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"agent-verify.d.ts","sourceRoot":"","sources":["../../../src/executors/agent-verify/agent-verify.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D,UAAU,cAAc;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAmBD;;;;;;;;;;;;;GAaG;AACH,wBAA8B,mBAAmB,CAC/C,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAgHzB"}
|
|
@@ -43,11 +43,7 @@ async function agentVerifyExecutor(options, context) {
|
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
const t0 = Date.now();
|
|
46
|
-
|
|
47
|
-
const r = (0, node_child_process_1.spawnSync)(tscBin, ['--noEmit', '-p', tsconfig], {
|
|
48
|
-
cwd: projectRoot,
|
|
49
|
-
stdio: 'inherit',
|
|
50
|
-
});
|
|
46
|
+
const r = runStageCommand('tsc --noEmit', tscBin, ['--noEmit', '-p', tsconfig], projectRoot);
|
|
51
47
|
stages.push({
|
|
52
48
|
name: 'typecheck',
|
|
53
49
|
result: r.status === 0 ? 'passed' : 'failed',
|
|
@@ -67,8 +63,7 @@ async function agentVerifyExecutor(options, context) {
|
|
|
67
63
|
}
|
|
68
64
|
else {
|
|
69
65
|
const t0 = Date.now();
|
|
70
|
-
|
|
71
|
-
const r = (0, node_child_process_1.spawnSync)(eslintBin, ['.'], { cwd: projectRoot, stdio: 'inherit' });
|
|
66
|
+
const r = runStageCommand('eslint .', eslintBin, ['.'], projectRoot);
|
|
72
67
|
stages.push({
|
|
73
68
|
name: 'lint',
|
|
74
69
|
result: r.status === 0 ? 'passed' : 'failed',
|
|
@@ -90,11 +85,7 @@ async function agentVerifyExecutor(options, context) {
|
|
|
90
85
|
const viteConfig = resolveFirstExisting(['vite.config.ts', 'vite.config.js', 'vite.config.mjs'], projectRoot) ??
|
|
91
86
|
(0, node_path_1.join)(projectRoot, 'vite.config.ts');
|
|
92
87
|
const t0 = Date.now();
|
|
93
|
-
|
|
94
|
-
const r = (0, node_child_process_1.spawnSync)(viteBin, ['build', '--config', viteConfig, projectRoot], {
|
|
95
|
-
cwd: projectRoot,
|
|
96
|
-
stdio: 'inherit',
|
|
97
|
-
});
|
|
88
|
+
const r = runStageCommand('vite build', viteBin, ['build', '--config', viteConfig, projectRoot], projectRoot);
|
|
98
89
|
stages.push({
|
|
99
90
|
name: 'build',
|
|
100
91
|
result: r.status === 0 ? 'passed' : 'failed',
|
|
@@ -135,6 +126,25 @@ async function agentVerifyExecutor(options, context) {
|
|
|
135
126
|
console.log(`[agent-verify] ${status} in ${report.durationMs}ms`);
|
|
136
127
|
return { success: status === 'passed' };
|
|
137
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Run a verify sub-command, capturing its output and re-emitting it INDENTED.
|
|
131
|
+
*
|
|
132
|
+
* agent-verify deliberately runs commands that may fail — it IS the agent's
|
|
133
|
+
* edit→verify loop, so a failing stage is a normal, expected outcome. In CI a
|
|
134
|
+
* raw tool error printed at column 0 (`file(line,col): error TS....`) is picked
|
|
135
|
+
* up by GitHub's problem matchers and turned into a spurious build *annotation*.
|
|
136
|
+
* Indenting every line by two spaces keeps the output fully readable while
|
|
137
|
+
* defeating the matchers (they anchor on a non-space first character), so a
|
|
138
|
+
* verify failure never masquerades as a CI error.
|
|
139
|
+
*/
|
|
140
|
+
function runStageCommand(label, bin, args, cwd) {
|
|
141
|
+
console.log(`[agent-verify] ${label}`);
|
|
142
|
+
const r = (0, node_child_process_1.spawnSync)(bin, args, { cwd, encoding: 'utf8' });
|
|
143
|
+
const out = `${r.stdout ?? ''}${r.stderr ?? ''}`;
|
|
144
|
+
if (out.trim())
|
|
145
|
+
process.stdout.write(out.replace(/^(?=.)/gm, ' '));
|
|
146
|
+
return r;
|
|
147
|
+
}
|
|
138
148
|
function locateBin(name, roots) {
|
|
139
149
|
for (const root of roots) {
|
|
140
150
|
const candidate = (0, node_path_1.join)(root, 'node_modules', '.bin', name);
|
package/executors.json
CHANGED
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
"version": "0.0.1",
|
|
5
5
|
"executors": {
|
|
6
6
|
"agent-dev": {
|
|
7
|
-
"implementation": "./
|
|
8
|
-
"schema": "./
|
|
7
|
+
"implementation": "./executors/agent-dev/agent-dev",
|
|
8
|
+
"schema": "./executors/agent-dev/schema.json",
|
|
9
9
|
"description": "Start a project with the LensMCP lens attached (Vite dev server + Chrome sidecar + MCP server)."
|
|
10
10
|
},
|
|
11
11
|
"agent-build": {
|
|
12
|
-
"implementation": "./
|
|
13
|
-
"schema": "./
|
|
12
|
+
"implementation": "./executors/agent-build/agent-build",
|
|
13
|
+
"schema": "./executors/agent-build/schema.json",
|
|
14
14
|
"description": "Instrumented production build that produces a bundle report and updates the baseline."
|
|
15
15
|
},
|
|
16
16
|
"agent-verify": {
|
|
17
|
-
"implementation": "./
|
|
18
|
-
"schema": "./
|
|
17
|
+
"implementation": "./executors/agent-verify/agent-verify",
|
|
18
|
+
"schema": "./executors/agent-verify/schema.json",
|
|
19
19
|
"description": "Deterministic verification: typecheck → lint → build, with a per-run report under .lensmcp/verifications/."
|
|
20
20
|
}
|
|
21
21
|
}
|
package/generators.json
CHANGED
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
"version": "0.0.1",
|
|
5
5
|
"generators": {
|
|
6
6
|
"init": {
|
|
7
|
-
"factory": "./
|
|
8
|
-
"schema": "./
|
|
7
|
+
"factory": "./generators/init/init",
|
|
8
|
+
"schema": "./generators/init/schema.json",
|
|
9
9
|
"description": "Install LensMCP into a host Nx workspace (idempotent)."
|
|
10
10
|
},
|
|
11
11
|
"setup-vite": {
|
|
12
|
-
"factory": "./
|
|
13
|
-
"schema": "./
|
|
12
|
+
"factory": "./generators/setup-vite/setup-vite",
|
|
13
|
+
"schema": "./generators/setup-vite/schema.json",
|
|
14
14
|
"description": "Wire LensMCP into a Vite project (patches vite.config + adds agent-dev target)."
|
|
15
15
|
},
|
|
16
16
|
"setup-nest": {
|
|
17
|
-
"factory": "./
|
|
18
|
-
"schema": "./
|
|
17
|
+
"factory": "./generators/setup-nest/setup-nest",
|
|
18
|
+
"schema": "./generators/setup-nest/schema.json",
|
|
19
19
|
"description": "Wire LensMCP into a NestJS project (rewrites main.ts bootstrap to createLensmcpNestApp + agent-dev target)."
|
|
20
20
|
}
|
|
21
21
|
}
|