dev-cockpit 0.6.1 → 0.6.3
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":"composer-drift.d.ts","sourceRoot":"","sources":["../../../src/health/predicates/composer-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"composer-drift.d.ts","sourceRoot":"","sources":["../../../src/health/predicates/composer-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAoDD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,aAAa,EAClB,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,YAAY,CAAC,CAoCvB;AAeD,MAAM,WAAW,+BAAgC,SAAQ,yBAAyB;IAChF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CAC1C;AAED,wBAAgB,wBAAwB,CACtC,IAAI,GAAE,+BAAoC,GACzC,WAAW,CA4Bb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remediations.d.ts","sourceRoot":"","sources":["../../src/health/remediations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"remediations.d.ts","sourceRoot":"","sources":["../../src/health/remediations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EAEb,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,WAAW,EAAE,EACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACrC,WAAW,EAAE,CASf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAevE;AAED,wBAAsB,cAAc,CAClC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,WAAW,EAAE,EACrB,GAAG,EAAE,aAAa,EAClB,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACrC,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,WAAW,EAAE,GACpB,WAAW,GAAG,SAAS,CAEzB;AAED,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,aAAa,EAClB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
package/dist/index.js
CHANGED
|
@@ -88260,22 +88260,21 @@ async function dispatchRemediation(remediation, ctx, workspaceRoot, sourceId) {
|
|
|
88260
88260
|
await streamCommand(ctx, sourceId, program2, args, cwd);
|
|
88261
88261
|
}
|
|
88262
88262
|
async function streamCommand(ctx, sourceId, program2, args, cwd) {
|
|
88263
|
+
const emit = (severity, text) => ctx.appendOutput?.({ ts: Date.now(), source: `health:${sourceId}`, severity, text });
|
|
88263
88264
|
const handle = spawnStream(program2, args, {
|
|
88264
88265
|
cwd,
|
|
88265
|
-
|
|
88266
|
-
|
|
88267
|
-
|
|
88268
|
-
|
|
88269
|
-
|
|
88270
|
-
|
|
88271
|
-
onStderr: (line2) => ctx.appendOutput?.({
|
|
88272
|
-
ts: Date.now(),
|
|
88273
|
-
source: `health:${sourceId}`,
|
|
88274
|
-
severity: "warn",
|
|
88275
|
-
text: line2
|
|
88276
|
-
})
|
|
88266
|
+
// Stream both channels as info. Many CLIs (composer, git, npm) write all of
|
|
88267
|
+
// their normal progress to stderr, so the channel says nothing about
|
|
88268
|
+
// severity — treating stderr as a warning renders ordinary success output
|
|
88269
|
+
// as a wall of ⚠. Success vs failure is decided by the exit code below.
|
|
88270
|
+
onStdout: (line2) => emit("info", line2),
|
|
88271
|
+
onStderr: (line2) => emit("info", line2)
|
|
88277
88272
|
});
|
|
88278
|
-
|
|
88273
|
+
const code = await handle.exitCode;
|
|
88274
|
+
const label = [program2, ...args].join(" ");
|
|
88275
|
+
if (code === 0) emit("info", `\u2713 ${label}`);
|
|
88276
|
+
else emit("error", `\u2717 ${label} failed (exit ${code})`);
|
|
88277
|
+
return code;
|
|
88279
88278
|
}
|
|
88280
88279
|
|
|
88281
88280
|
// src/health/notify-resolver.ts
|
|
@@ -91131,17 +91130,35 @@ function createNodeModulesDriftCheck(opts = {}) {
|
|
|
91131
91130
|
|
|
91132
91131
|
// src/health/predicates/composer-drift.ts
|
|
91133
91132
|
import path15 from "node:path";
|
|
91133
|
+
var INSTALL_MARKERS = [
|
|
91134
|
+
"composer/installed.php",
|
|
91135
|
+
"composer/installed.json",
|
|
91136
|
+
"composer/autoload_classmap.php",
|
|
91137
|
+
"autoload.php"
|
|
91138
|
+
];
|
|
91134
91139
|
function resolveScopes(workspaceRoot, dirs) {
|
|
91135
91140
|
return dirs.map((d) => {
|
|
91136
91141
|
const rel = d === "" || d === "." ? "" : d;
|
|
91137
91142
|
const base = rel ? path15.join(workspaceRoot, rel) : workspaceRoot;
|
|
91138
91143
|
return {
|
|
91139
91144
|
lock: path15.join(base, "composer.lock"),
|
|
91140
|
-
|
|
91145
|
+
vendorDir: path15.join(base, "vendor"),
|
|
91141
91146
|
label: rel || "root"
|
|
91142
91147
|
};
|
|
91143
91148
|
});
|
|
91144
91149
|
}
|
|
91150
|
+
function installFreshness(fs19, vendorDir) {
|
|
91151
|
+
let newest = 0;
|
|
91152
|
+
const paths = [vendorDir, ...INSTALL_MARKERS.map((m) => path15.join(vendorDir, m))];
|
|
91153
|
+
for (const p of paths) {
|
|
91154
|
+
if (!fs19.existsSync(p)) continue;
|
|
91155
|
+
try {
|
|
91156
|
+
newest = Math.max(newest, fs19.statSync(p).mtimeMs);
|
|
91157
|
+
} catch {
|
|
91158
|
+
}
|
|
91159
|
+
}
|
|
91160
|
+
return newest;
|
|
91161
|
+
}
|
|
91145
91162
|
async function checkComposerDrift(ctx, opts = {}) {
|
|
91146
91163
|
const { workspaceRoot, fs: fs19 } = ctx;
|
|
91147
91164
|
const scopes = resolveScopes(workspaceRoot, opts.packageDirs ?? ["."]);
|
|
@@ -91155,18 +91172,11 @@ async function checkComposerDrift(ctx, opts = {}) {
|
|
|
91155
91172
|
} catch {
|
|
91156
91173
|
continue;
|
|
91157
91174
|
}
|
|
91158
|
-
if (!fs19.existsSync(scope.
|
|
91175
|
+
if (!fs19.existsSync(path15.join(scope.vendorDir, "autoload.php"))) {
|
|
91159
91176
|
missing.push(scope.label);
|
|
91160
91177
|
continue;
|
|
91161
91178
|
}
|
|
91162
|
-
|
|
91163
|
-
try {
|
|
91164
|
-
vendorMtime = fs19.statSync(scope.vendor).mtimeMs;
|
|
91165
|
-
} catch {
|
|
91166
|
-
stale.push(`${scope.label} (vendor unreadable)`);
|
|
91167
|
-
continue;
|
|
91168
|
-
}
|
|
91169
|
-
if (lockMtime > vendorMtime) {
|
|
91179
|
+
if (lockMtime > installFreshness(fs19, scope.vendorDir)) {
|
|
91170
91180
|
stale.push(scope.label);
|
|
91171
91181
|
}
|
|
91172
91182
|
}
|
|
@@ -91174,7 +91184,7 @@ async function checkComposerDrift(ctx, opts = {}) {
|
|
|
91174
91184
|
return status3("ok", "composer.lock and vendor/ are in sync");
|
|
91175
91185
|
}
|
|
91176
91186
|
const parts = [];
|
|
91177
|
-
if (missing.length > 0) parts.push(`
|
|
91187
|
+
if (missing.length > 0) parts.push(`dependencies not installed in: ${missing.join(", ")}`);
|
|
91178
91188
|
if (stale.length > 0) parts.push(`composer.lock newer than vendor/ in: ${stale.join(", ")}`);
|
|
91179
91189
|
return status3("error", `${parts.join("; ")} \u2014 run composer install`);
|
|
91180
91190
|
}
|