@theholocron/astromech 5.0.0-alpha.41 → 5.0.0-alpha.42

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.
Files changed (2) hide show
  1. package/dist/index.mjs +19 -6
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -792,10 +792,11 @@ const mkRunner = (tool, args = []) => ({
792
792
  });
793
793
  /**
794
794
  * Resolve `{ tool, args }` for a runner, applying `detect[]` against repo
795
- * files, then (#750) each candidate's `tool` name against `package.json`'s
796
- * own declared dependencies. Only called for `tool` / `detect` runners — the
797
- * caller handles `command` runners itself, so `local.detect` is present
798
- * whenever `local.tool` is not.
795
+ * files, falling back (#750) to each candidate's `tool` name against
796
+ * `package.json`'s own declared dependencies when neither matches by
797
+ * filename. Only called for `tool` / `detect` runners — the caller handles
798
+ * `command` runners itself, so `local.detect` is present whenever
799
+ * `local.tool` is not.
799
800
  *
800
801
  * The dependency fallback matters once a Bucket A migration (#680) deletes
801
802
  * a build tool's own config file (`tsdown.config.ts`, `vite.config.ts`, …):
@@ -805,6 +806,19 @@ const mkRunner = (tool, args = []) => ({
805
806
  * package can't actually build with `tsdown` without it in
806
807
  * `dependencies`/`devDependencies`, so that's a signal at least as reliable
807
808
  * as the config file, and one deleting the file doesn't remove.
809
+ *
810
+ * **Per-candidate, not two full passes** (#750 follow-up — the first
811
+ * shipped version got this wrong): `delivery.build`'s own `detect[]` ends
812
+ * with `{ when: /^tsconfig\.json$/, tool: "tsc" }` as its last-resort
813
+ * fallback, and `tsconfig.json` exists in essentially every package
814
+ * regardless of build tool. A "check every candidate's filename, *then*
815
+ * check every candidate's dependency" two-pass design would let that
816
+ * always-present fallback file win over a real `tsdown`/`vite`/`rollup`
817
+ * dependency match, the moment the earlier candidates' own config files are
818
+ * gone — exactly backwards. Checking `(file match) || (dependency match)`
819
+ * together for each candidate before moving to the next preserves the
820
+ * intended precedence: a real signal for an *earlier* candidate, by either
821
+ * means, still wins over a later candidate's mere filename presence.
808
822
  */
809
823
  function resolveRunner(local, cwd, listDir, readFile) {
810
824
  if (local.tool) return mkRunner(local.tool, local.args);
@@ -814,9 +828,8 @@ function resolveRunner(local, cwd, listDir, readFile) {
814
828
  } catch {
815
829
  files = [];
816
830
  }
817
- for (const candidate of local.detect) if (files.some((f) => candidate.when.test(f))) return mkRunner(candidate.tool, candidate.args);
818
831
  const deps = packageJsonDependencies(cwd, readFile);
819
- for (const candidate of local.detect) if (deps.has(candidate.tool)) return mkRunner(candidate.tool, candidate.args);
832
+ for (const candidate of local.detect) if (files.some((f) => candidate.when.test(f)) || deps.has(candidate.tool)) return mkRunner(candidate.tool, candidate.args);
820
833
  }
821
834
  /** Every key from `package.json`'s `dependencies` + `devDependencies`, or an empty set on any read/parse failure. */
822
835
  function packageJsonDependencies(cwd, readFile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/astromech",
3
- "version": "5.0.0-alpha.41",
3
+ "version": "5.0.0-alpha.42",
4
4
  "description": "The Holocron task runner — one task manifest drives `holocron run`, `holocron ci`, the CI workflows, package.json scripts, linters, and required checks.",
5
5
  "keywords": [
6
6
  "ci",
@@ -37,7 +37,7 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@theholocron/datapad": "5.0.0-alpha.41"
40
+ "@theholocron/datapad": "5.0.0-alpha.42"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@theholocron/eslint-config": "^8.0.0",
@@ -53,7 +53,7 @@
53
53
  "tsdown": "^0.22.14",
54
54
  "typescript": "^5.9.3",
55
55
  "vitest": "^4.1.11",
56
- "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.41"
56
+ "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.42"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"