@theholocron/astromech 5.0.0-alpha.252 → 5.0.0-alpha.253
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/config/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-
|
|
1
|
+
import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-CHShKm-U.mjs";
|
|
2
2
|
import { Loaded } from "@theholocron/datapad";
|
|
3
3
|
/**
|
|
4
4
|
* The `tasks` config shape — the single manifest of what a repo runs.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as TasksConfig } from "./schema.type-
|
|
1
|
+
import { r as TasksConfig } from "./schema.type-CHShKm-U.mjs";
|
|
2
2
|
import { ListWorkspacePackagesOptions, WorkspacePackageEntry } from "@theholocron/pkg-utils";
|
|
3
3
|
interface WorkspacePackage$1 {
|
|
4
4
|
slug: string;
|
|
@@ -250,6 +250,8 @@ interface RunTaskInput extends RunDeps {
|
|
|
250
250
|
required?: boolean;
|
|
251
251
|
/** `turbo --filter=<pkg>` passthrough (monorepo). Ignored when the repo has no `turbo.json`. */
|
|
252
252
|
filter?: string;
|
|
253
|
+
/** The task entry's `jobs` switches: a sub-job set to `false` (by key or alias) is not run. */
|
|
254
|
+
jobSwitches?: Record<string, boolean>;
|
|
253
255
|
}
|
|
254
256
|
interface RunTaskReport {
|
|
255
257
|
status: "ok" | "fail" | "skip" | "dry-run" | "unknown";
|
|
@@ -613,6 +615,11 @@ interface JobDef {
|
|
|
613
615
|
* jobs) lives in `WORKFLOW_CHECK_CONTEXTS`.
|
|
614
616
|
*/
|
|
615
617
|
checkContext: string;
|
|
618
|
+
/**
|
|
619
|
+
* The name a repo's config uses to switch this job off (`jobs: { packageRegistry: false }`),
|
|
620
|
+
* where the job's own key is vague or fixed by the reusable workflow. The key itself works too.
|
|
621
|
+
*/
|
|
622
|
+
alias?: string;
|
|
616
623
|
}
|
|
617
624
|
interface TaskDef {
|
|
618
625
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -456,9 +456,15 @@ function parseGroups(groups) {
|
|
|
456
456
|
* - A push releases every group; a manual run can pick one (and dry-run it) with the
|
|
457
457
|
* `group` input. A job's `if:` cannot see `matrix`, so the choice is made in `plan`.
|
|
458
458
|
* - `ungrouped` also releases everything that is in **no** group, together and under the
|
|
459
|
-
* repo's plain tags, as the single release did before; it runs
|
|
460
|
-
*
|
|
461
|
-
*
|
|
459
|
+
* repo's plain tags, as the single release did before; it runs **last**, from the branch's
|
|
460
|
+
* current tip (`from-branch-tip`), once every group has released. Packages in no group
|
|
461
|
+
* depend on the groups' packages through `workspace:` ranges, which are rewritten to
|
|
462
|
+
* concrete versions at publish time, so the groups must be on npm first; list `groups` in
|
|
463
|
+
* dependency order (a group before the groups that depend on it). It is skipped if a group
|
|
464
|
+
* failed, so a failed dependency does not leave a package published against a version
|
|
465
|
+
* that is not on npm. It takes the same per-release inputs as a group (`true` for none).
|
|
466
|
+
* A repo with groups and packages in no group needs it, or those packages would stop
|
|
467
|
+
* releasing.
|
|
462
468
|
* - `shared` entries (and the template's own `dry-run`) go to every release; the
|
|
463
469
|
* per-group inputs come from the matrix entry.
|
|
464
470
|
*/
|
|
@@ -499,18 +505,22 @@ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
|
|
|
499
505
|
const ungroupedJob = ungroupedInputs ? [
|
|
500
506
|
" release:",
|
|
501
507
|
" name: Release",
|
|
502
|
-
"
|
|
508
|
+
" # last: the packages in no group depend on the groups' packages, which must be on npm first.",
|
|
509
|
+
" # Runs even if the groups were skipped (a manual run picked `ungrouped`), but not if one failed.",
|
|
510
|
+
" needs: [plan, release-groups]",
|
|
511
|
+
" if: >-",
|
|
512
|
+
" ${{ !cancelled() && needs.plan.result == 'success' && needs.release-groups.result != 'failure' &&",
|
|
513
|
+
" (inputs.group == '' || inputs.group == 'all' || inputs.group == 'ungrouped') }}",
|
|
503
514
|
uses,
|
|
504
515
|
" with:",
|
|
505
516
|
...templateWith,
|
|
517
|
+
" from-branch-tip: true",
|
|
506
518
|
...sharedWith,
|
|
507
519
|
...Object.entries(ungroupedInputs).map(([key, value]) => ` ${key}: ${yamlScalar(value)}`),
|
|
508
|
-
" secrets: inherit"
|
|
509
|
-
""
|
|
520
|
+
" secrets: inherit"
|
|
510
521
|
] : [];
|
|
511
522
|
return [
|
|
512
523
|
`${head}jobs:`,
|
|
513
|
-
...ungroupedJob,
|
|
514
524
|
" plan:",
|
|
515
525
|
" name: Plan",
|
|
516
526
|
" runs-on: ubuntu-latest",
|
|
@@ -534,10 +544,9 @@ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
|
|
|
534
544
|
` ${ungroupedInputs ? "release-groups" : "release"}:`,
|
|
535
545
|
" name: Release ${{ matrix.group }}",
|
|
536
546
|
...ungroupedInputs ? [
|
|
537
|
-
" # after the ungrouped release, which pushes its own commit first; still run if it failed or was skipped.",
|
|
538
547
|
" # Choosing `ungrouped` by hand leaves the plan empty, and a matrix with no entries fails the run.",
|
|
539
|
-
" needs:
|
|
540
|
-
" if: ${{
|
|
548
|
+
" needs: plan",
|
|
549
|
+
" if: ${{ needs.plan.outputs.groups != '[]' }}"
|
|
541
550
|
] : [" needs: plan"],
|
|
542
551
|
" strategy:",
|
|
543
552
|
" fail-fast: false",
|
|
@@ -548,6 +557,7 @@ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
|
|
|
548
557
|
" with:",
|
|
549
558
|
...matrixWith,
|
|
550
559
|
" secrets: inherit",
|
|
560
|
+
...ungroupedJob.length > 0 ? ["", ...ungroupedJob] : [],
|
|
551
561
|
""
|
|
552
562
|
].join("\n");
|
|
553
563
|
}
|
|
@@ -1005,7 +1015,11 @@ const TASKS = {
|
|
|
1005
1015
|
"eslint.config.ts",
|
|
1006
1016
|
"eslint.config.js",
|
|
1007
1017
|
"eslint.config.mjs",
|
|
1008
|
-
"eslint.config.cjs"
|
|
1018
|
+
"eslint.config.cjs",
|
|
1019
|
+
"$TURBO_ROOT$/eslint.config.ts",
|
|
1020
|
+
"$TURBO_ROOT$/eslint.config.js",
|
|
1021
|
+
"$TURBO_ROOT$/eslint.config.mjs",
|
|
1022
|
+
"$TURBO_ROOT$/eslint.config.cjs"
|
|
1009
1023
|
],
|
|
1010
1024
|
outputs: [],
|
|
1011
1025
|
dependsOn: ["^delivery.build"]
|
|
@@ -1056,6 +1070,7 @@ const TASKS = {
|
|
|
1056
1070
|
"src/**",
|
|
1057
1071
|
"package.json",
|
|
1058
1072
|
"tsdown.config.ts",
|
|
1073
|
+
"$TURBO_ROOT$/tsdown.config.ts",
|
|
1059
1074
|
"vite.config.ts",
|
|
1060
1075
|
"rollup.config.ts",
|
|
1061
1076
|
"tsconfig.json"
|
|
@@ -1097,14 +1112,16 @@ const TASKS = {
|
|
|
1097
1112
|
tool: "node",
|
|
1098
1113
|
args: ["scripts/validate-registry.mjs"]
|
|
1099
1114
|
},
|
|
1100
|
-
checkContext: "platform.repoValidation / Validate registry consistency"
|
|
1115
|
+
checkContext: "platform.repoValidation / Validate registry consistency",
|
|
1116
|
+
alias: "packageRegistry"
|
|
1101
1117
|
},
|
|
1102
1118
|
docsPresence: {
|
|
1103
1119
|
local: {
|
|
1104
1120
|
tool: "node",
|
|
1105
1121
|
args: ["scripts/validate-docs-presence.mjs"]
|
|
1106
1122
|
},
|
|
1107
|
-
checkContext: "platform.repoValidation / Validate docs presence"
|
|
1123
|
+
checkContext: "platform.repoValidation / Validate docs presence",
|
|
1124
|
+
alias: "docsEnforcement"
|
|
1108
1125
|
}
|
|
1109
1126
|
}
|
|
1110
1127
|
},
|
|
@@ -1891,6 +1908,11 @@ function makeRunOne(input) {
|
|
|
1891
1908
|
};
|
|
1892
1909
|
};
|
|
1893
1910
|
}
|
|
1911
|
+
/** `false` when the repo's config switched this sub-job off, by its key or its alias. */
|
|
1912
|
+
function jobEnabled(name, jobDef, switches) {
|
|
1913
|
+
if (!switches) return true;
|
|
1914
|
+
return switches[name] !== false && (jobDef.alias === void 0 || switches[jobDef.alias] !== false);
|
|
1915
|
+
}
|
|
1894
1916
|
function runTask(input) {
|
|
1895
1917
|
const { print, logger, readFile, fileExists, listDir, task, cwd } = input;
|
|
1896
1918
|
const def = TASKS[task];
|
|
@@ -1916,6 +1938,19 @@ function runTask(input) {
|
|
|
1916
1938
|
};
|
|
1917
1939
|
}
|
|
1918
1940
|
const label = `${task} ${job}`;
|
|
1941
|
+
if (!jobEnabled(job, jobDef, input.jobSwitches)) {
|
|
1942
|
+
const message = `${label} is off in this repo's config (jobs.${jobDef.alias ?? job}: false)`;
|
|
1943
|
+
print(`· ${message}`);
|
|
1944
|
+
logger.debug({
|
|
1945
|
+
task,
|
|
1946
|
+
job,
|
|
1947
|
+
status: "skip"
|
|
1948
|
+
}, `run: ${label}`);
|
|
1949
|
+
return {
|
|
1950
|
+
status: "skip",
|
|
1951
|
+
message
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1919
1954
|
return runUnit(input, label, jobDef.local, makeRunOne({
|
|
1920
1955
|
...input,
|
|
1921
1956
|
task: label
|
|
@@ -2055,6 +2090,10 @@ function runAllJobs(input, jobs, passthrough) {
|
|
|
2055
2090
|
const reports = [];
|
|
2056
2091
|
for (const [name, jobDef] of Object.entries(jobs)) {
|
|
2057
2092
|
const label = `${task} ${name}`;
|
|
2093
|
+
if (!jobEnabled(name, jobDef, input.jobSwitches)) {
|
|
2094
|
+
print(`· ${jobDef.checkContext} — off in this repo's config (jobs.${jobDef.alias ?? name}: false)`);
|
|
2095
|
+
continue;
|
|
2096
|
+
}
|
|
2058
2097
|
print(`▶ ${jobDef.checkContext}`);
|
|
2059
2098
|
reports.push(runUnit(perJob, label, jobDef.local, makeRunOne({
|
|
2060
2099
|
...perJob,
|
|
@@ -2199,6 +2238,7 @@ function runCi(input) {
|
|
|
2199
2238
|
listDir: input.listDir,
|
|
2200
2239
|
lookPath: input.lookPath,
|
|
2201
2240
|
task: entry.name,
|
|
2241
|
+
...entry.jobs ? { jobSwitches: entry.jobs } : {},
|
|
2202
2242
|
cwd: input.cwd,
|
|
2203
2243
|
dryRun: input.dryRun ?? false,
|
|
2204
2244
|
required: entry.required === true,
|
|
@@ -2638,6 +2678,11 @@ function matchNamespace(config, namespace) {
|
|
|
2638
2678
|
* the rest, same as `runCi`'s own loop — so a single invocation surfaces
|
|
2639
2679
|
* every problem in the namespace at once instead of stopping at the first.
|
|
2640
2680
|
*/
|
|
2681
|
+
/** The `jobs` switches of a task's entry, as a `runTask` input; nothing when it has none. */
|
|
2682
|
+
function jobSwitches(config, name) {
|
|
2683
|
+
const jobs = config.tasks.map(normalizeTaskEntry).find((e) => e.name === name)?.jobs;
|
|
2684
|
+
return jobs ? { jobSwitches: jobs } : {};
|
|
2685
|
+
}
|
|
2641
2686
|
function runGroup(input) {
|
|
2642
2687
|
const { print, namespace } = input;
|
|
2643
2688
|
const names = matchNamespace(input.config, namespace);
|
|
@@ -2659,6 +2704,7 @@ function runGroup(input) {
|
|
|
2659
2704
|
listDir: input.listDir,
|
|
2660
2705
|
lookPath: input.lookPath,
|
|
2661
2706
|
task: name,
|
|
2707
|
+
...jobSwitches(input.config, name),
|
|
2662
2708
|
cwd: input.cwd,
|
|
2663
2709
|
dryRun: input.dryRun ?? false,
|
|
2664
2710
|
...input.filter ? { filter: input.filter } : {}
|
|
@@ -2692,6 +2738,11 @@ function createAstromech(options) {
|
|
|
2692
2738
|
lookPath: options.lookPath ?? realLookPath
|
|
2693
2739
|
};
|
|
2694
2740
|
const items = () => (options.config?.tasks ?? []).map((i) => normalizeTaskEntry(i));
|
|
2741
|
+
/** The `jobs` switches of a task's entry in the manifest, as a `runTask` input; nothing when it has none. */
|
|
2742
|
+
const jobSwitchesFor = (task) => {
|
|
2743
|
+
const jobs = items().find((e) => e.name === task)?.jobs;
|
|
2744
|
+
return jobs ? { jobSwitches: jobs } : {};
|
|
2745
|
+
};
|
|
2695
2746
|
/**
|
|
2696
2747
|
* Task names this repo's manifest can actually run locally — shared by
|
|
2697
2748
|
* {@link packageScripts} and by `holocron`'s own interactive task picker.
|
|
@@ -2729,7 +2780,8 @@ function createAstromech(options) {
|
|
|
2729
2780
|
passthrough: opts.passthrough ?? [],
|
|
2730
2781
|
dryRun: opts.dryRun ?? false,
|
|
2731
2782
|
required: opts.required ?? false,
|
|
2732
|
-
...opts.filter ? { filter: opts.filter } : {}
|
|
2783
|
+
...opts.filter ? { filter: opts.filter } : {},
|
|
2784
|
+
...jobSwitchesFor(task)
|
|
2733
2785
|
});
|
|
2734
2786
|
},
|
|
2735
2787
|
ci: (opts = {}) => runCi({
|
package/dist/release/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as TasksConfig } from "../schema.type-
|
|
1
|
+
import { r as TasksConfig } from "../schema.type-CHShKm-U.mjs";
|
|
2
2
|
import { defineConfig } from "@theholocron/semantic-release-config";
|
|
3
3
|
/** Runs `git` with `args` in `cwd`, feeding it `input` on stdin, and returns stdout. */
|
|
4
4
|
export type GitRun = (args: string[], input: string, cwd: string) => string;
|
|
@@ -20,6 +20,12 @@ interface TaskEntry {
|
|
|
20
20
|
required?: boolean;
|
|
21
21
|
/** Per-repo overrides on the same channel the reusable workflow reads. */
|
|
22
22
|
with?: Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Switch individual sub-jobs of a task off for this repo (`false`), by their registry key or alias:
|
|
25
|
+
* `{ name: "platform.repoValidation", jobs: { packageRegistry: false } }`. A job left out runs. The job's CI
|
|
26
|
+
* check still reports (green, "off in this repo's config"), so a required check never goes missing.
|
|
27
|
+
*/
|
|
28
|
+
jobs?: Record<string, boolean>;
|
|
23
29
|
/** Extra `on.push.paths` entries for the generated CI workflow. */
|
|
24
30
|
paths?: string[];
|
|
25
31
|
/**
|
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.253",
|
|
4
4
|
"description": "The Holocron task runner — one task manifest drives `holocron run`, `holocron run ci`, the CI workflows, package.json scripts, linters, and required checks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@commitlint/lint": "^21.2.3",
|
|
51
51
|
"@commitlint/load": "^21.2.3",
|
|
52
52
|
"@commitlint/types": "^21.2.3",
|
|
53
|
-
"@theholocron/
|
|
54
|
-
"@theholocron/
|
|
55
|
-
"@theholocron/
|
|
56
|
-
"@theholocron/
|
|
53
|
+
"@theholocron/datapad": "5.0.0-alpha.253",
|
|
54
|
+
"@theholocron/pkg-utils": "^1.16.1-alpha.1",
|
|
55
|
+
"@theholocron/json-utils": "^1.16.1-alpha.1",
|
|
56
|
+
"@theholocron/fs-utils": "^1.16.1-alpha.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@commitlint/config-conventional": "^21.2.3",
|
|
@@ -61,11 +61,7 @@
|
|
|
61
61
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
62
62
|
"@theholocron/commitlint-config": "^8.8.0",
|
|
63
63
|
"@theholocron/eslint-config": "^8.8.2",
|
|
64
|
-
"@theholocron/rollup-plugin-transform-template": "^8.8.2",
|
|
65
64
|
"@theholocron/semantic-release-config": "^8.8.2",
|
|
66
|
-
"@theholocron/tsconfig": "^8.8.2",
|
|
67
|
-
"@theholocron/tsdown-config": "^8.8.2",
|
|
68
|
-
"@theholocron/vitest-config": "^8.8.2",
|
|
69
65
|
"@types/node": "^26",
|
|
70
66
|
"@vitest/coverage-v8": "^5.0.5",
|
|
71
67
|
"@vitest/eslint-plugin": "^1.6.27",
|
|
@@ -74,7 +70,11 @@
|
|
|
74
70
|
"globals": "^17.11.0",
|
|
75
71
|
"tsdown": "^0.23.3",
|
|
76
72
|
"typescript": "^5.9.3",
|
|
77
|
-
"vitest": "^5.0.5"
|
|
73
|
+
"vitest": "^5.0.5",
|
|
74
|
+
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.3",
|
|
75
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.3",
|
|
76
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.3",
|
|
77
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.3"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@semantic-release/commit-analyzer": "^13",
|