dev-cockpit 0.6.2 → 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;AAyBD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,aAAa,EAClB,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,YAAY,CAAC,CA0CvB;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
+ {"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"}
package/dist/index.js CHANGED
@@ -91130,22 +91130,35 @@ function createNodeModulesDriftCheck(opts = {}) {
91130
91130
 
91131
91131
  // src/health/predicates/composer-drift.ts
91132
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
+ ];
91133
91139
  function resolveScopes(workspaceRoot, dirs) {
91134
91140
  return dirs.map((d) => {
91135
91141
  const rel = d === "" || d === "." ? "" : d;
91136
91142
  const base = rel ? path15.join(workspaceRoot, rel) : workspaceRoot;
91137
91143
  return {
91138
91144
  lock: path15.join(base, "composer.lock"),
91139
- // Compare against the autoload dump, which `composer install` regenerates
91140
- // on EVERY run — even a no-op "Nothing to install". The `vendor/`
91141
- // directory mtime only moves when entries are added/removed directly in
91142
- // it, so a clean reinstall would never bump it and a drift flagged
91143
- // against the dir could never clear.
91144
- installed: path15.join(base, "vendor", "autoload.php"),
91145
+ vendorDir: path15.join(base, "vendor"),
91145
91146
  label: rel || "root"
91146
91147
  };
91147
91148
  });
91148
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
+ }
91149
91162
  async function checkComposerDrift(ctx, opts = {}) {
91150
91163
  const { workspaceRoot, fs: fs19 } = ctx;
91151
91164
  const scopes = resolveScopes(workspaceRoot, opts.packageDirs ?? ["."]);
@@ -91159,18 +91172,11 @@ async function checkComposerDrift(ctx, opts = {}) {
91159
91172
  } catch {
91160
91173
  continue;
91161
91174
  }
91162
- if (!fs19.existsSync(scope.installed)) {
91175
+ if (!fs19.existsSync(path15.join(scope.vendorDir, "autoload.php"))) {
91163
91176
  missing.push(scope.label);
91164
91177
  continue;
91165
91178
  }
91166
- let installedMtime;
91167
- try {
91168
- installedMtime = fs19.statSync(scope.installed).mtimeMs;
91169
- } catch {
91170
- stale.push(`${scope.label} (autoload unreadable)`);
91171
- continue;
91172
- }
91173
- if (lockMtime > installedMtime) {
91179
+ if (lockMtime > installFreshness(fs19, scope.vendorDir)) {
91174
91180
  stale.push(scope.label);
91175
91181
  }
91176
91182
  }