@theholocron/astromech 5.0.0-alpha.39 → 5.0.0-alpha.40
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/index.d.mts +18 -6
- package/dist/index.mjs +47 -4
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -591,8 +591,18 @@ declare function requiredChecks(config: TasksConfig): string[];
|
|
|
591
591
|
* each tool's real `--config`/`--extends` loader, not just the file's shape).
|
|
592
592
|
* A repo doesn't need this package installed at all — every lookup degrades to
|
|
593
593
|
* `[]` (no flag added, the tool falls back to its own auto-discovery of a
|
|
594
|
-
* local file, unchanged from today) rather than throwing
|
|
595
|
-
*
|
|
594
|
+
* local file, unchanged from today) rather than throwing.
|
|
595
|
+
*
|
|
596
|
+
* **Local file wins.** A `<tool>.config.*` sitting in `cwd` (whether it's
|
|
597
|
+
* pure boilerplate or has real per-package customization on top of the
|
|
598
|
+
* shared bundle, e.g. `mergeConfig(base, { test: { coverage: { exclude }
|
|
599
|
+
* } })`) always skips the splice, even when the shared package is also
|
|
600
|
+
* installed — an explicit `--config <shared path>` flag beats a tool's own
|
|
601
|
+
* auto-discovery every time, so splicing it unconditionally would silently
|
|
602
|
+
* discard that customization the file is still sitting right there on disk.
|
|
603
|
+
* The shared bundle is only ever the fallback for a package with *no* local
|
|
604
|
+
* file at all — that's still the "delete the file to go fully shared" path
|
|
605
|
+
* this was designed for (#676); it just isn't unconditional (#749).
|
|
596
606
|
*
|
|
597
607
|
* `semantic-release`, `devmoji`, `editorconfig-checker`, and `knip` are
|
|
598
608
|
* deliberately absent — `semantic-release-config`'s `defineConfig()` needs
|
|
@@ -610,10 +620,12 @@ interface ResolverDeps {
|
|
|
610
620
|
declare const RESOLVABLE_TOOLS: ReadonlySet<string>;
|
|
611
621
|
/**
|
|
612
622
|
* `<flag> <absolute path>` for `tool`, resolved against `cwd`'s
|
|
613
|
-
* `node_modules` — or `[]` when the tool isn't mapped,
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
623
|
+
* `node_modules` — or `[]` when the tool isn't mapped, `cwd` already has its
|
|
624
|
+
* own local config file for it (#749 — local always wins, customized or
|
|
625
|
+
* not), the shared package isn't installed, its `package.json` doesn't
|
|
626
|
+
* declare the export subpath this needs, or the resolved file doesn't
|
|
627
|
+
* actually exist on disk (a stale install, or a package version that
|
|
628
|
+
* predates the export existing).
|
|
617
629
|
*/
|
|
618
630
|
declare function resolveToolConfig(tool: string, cwd: string, deps: ResolverDeps): string[];
|
|
619
631
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -364,18 +364,61 @@ const TOOL_CONFIGS = {
|
|
|
364
364
|
flag: ["--config"]
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
|
+
/**
|
|
368
|
+
* Every filename a tool's own auto-discovery would pick up from `cwd` —
|
|
369
|
+
* same extension set `registry.ts`'s `turbo.inputs`/`local.detect` entries
|
|
370
|
+
* already use for these tools, kept in sync by hand (no shared source of
|
|
371
|
+
* truth between the two today). Presence of any one of these means the
|
|
372
|
+
* package has its own local config — customized or not, `resolveToolConfig`
|
|
373
|
+
* can't tell the difference from the filename alone, so it defers to it
|
|
374
|
+
* either way (#749).
|
|
375
|
+
*/
|
|
376
|
+
const LOCAL_CONFIG_FILES = {
|
|
377
|
+
eslint: [
|
|
378
|
+
"eslint.config.ts",
|
|
379
|
+
"eslint.config.js",
|
|
380
|
+
"eslint.config.mjs",
|
|
381
|
+
"eslint.config.cjs"
|
|
382
|
+
],
|
|
383
|
+
prettier: [
|
|
384
|
+
"prettier.config.ts",
|
|
385
|
+
"prettier.config.js",
|
|
386
|
+
"prettier.config.mjs",
|
|
387
|
+
"prettier.config.cjs"
|
|
388
|
+
],
|
|
389
|
+
vitest: [
|
|
390
|
+
"vitest.config.ts",
|
|
391
|
+
"vitest.config.js",
|
|
392
|
+
"vitest.config.mjs"
|
|
393
|
+
],
|
|
394
|
+
tsdown: [
|
|
395
|
+
"tsdown.config.ts",
|
|
396
|
+
"tsdown.config.js",
|
|
397
|
+
"tsdown.config.mjs",
|
|
398
|
+
"tsdown.config.cjs"
|
|
399
|
+
],
|
|
400
|
+
commitlint: [
|
|
401
|
+
"commitlint.config.ts",
|
|
402
|
+
"commitlint.config.js",
|
|
403
|
+
"commitlint.config.mjs",
|
|
404
|
+
"commitlint.config.cjs"
|
|
405
|
+
]
|
|
406
|
+
};
|
|
367
407
|
/** Every tool name the resolver knows how to point at a shared config. */
|
|
368
408
|
const RESOLVABLE_TOOLS = new Set(Object.keys(TOOL_CONFIGS));
|
|
369
409
|
/**
|
|
370
410
|
* `<flag> <absolute path>` for `tool`, resolved against `cwd`'s
|
|
371
|
-
* `node_modules` — or `[]` when the tool isn't mapped,
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
411
|
+
* `node_modules` — or `[]` when the tool isn't mapped, `cwd` already has its
|
|
412
|
+
* own local config file for it (#749 — local always wins, customized or
|
|
413
|
+
* not), the shared package isn't installed, its `package.json` doesn't
|
|
414
|
+
* declare the export subpath this needs, or the resolved file doesn't
|
|
415
|
+
* actually exist on disk (a stale install, or a package version that
|
|
416
|
+
* predates the export existing).
|
|
375
417
|
*/
|
|
376
418
|
function resolveToolConfig(tool, cwd, deps) {
|
|
377
419
|
const spec = TOOL_CONFIGS[tool];
|
|
378
420
|
if (!spec) return [];
|
|
421
|
+
if ((LOCAL_CONFIG_FILES[tool] ?? []).some((name) => deps.fileExists(joinPath(cwd, name)))) return [];
|
|
379
422
|
const pkgDir = joinPath(cwd, "node_modules", ...spec.package.split("/"));
|
|
380
423
|
const pkgJsonPath = joinPath(pkgDir, "package.json");
|
|
381
424
|
if (!deps.fileExists(pkgJsonPath)) return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/astromech",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.40",
|
|
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.
|
|
40
|
+
"@theholocron/datapad": "5.0.0-alpha.40"
|
|
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.
|
|
56
|
+
"@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.40"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=22"
|