@theholocron/astromech 5.0.0-alpha.146 → 5.0.0-alpha.148

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,5 +1,13 @@
1
1
  import { loadConfigFile, mergeConfig } from "@theholocron/datapad";
2
2
  //#region src/config/schema.ts
3
+ /**
4
+ * The `tasks` config shape — the single manifest of what a repo runs.
5
+ * Read from a dedicated `astromech.config.*` file or the `tasks` key of
6
+ * `holocron.config.*` (see {@link loadTasksConfig}).
7
+ *
8
+ * Runtime validation is the loader's job, not this type's — the type only
9
+ * describes what an author writes.
10
+ */
3
11
  /** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
4
12
  function normalizeTaskEntry(item) {
5
13
  return {
@@ -9,6 +17,25 @@ function normalizeTaskEntry(item) {
9
17
  };
10
18
  }
11
19
  //#endregion
20
+ //#region src/config/coerce-tasks.ts
21
+ /** A bare item array is shorthand for `{ tasks: [...] }`. */
22
+ function coerceTasks(value) {
23
+ if (value == null) return void 0;
24
+ return Array.isArray(value) ? { tasks: value } : value;
25
+ }
26
+ //#endregion
27
+ //#region src/config/merge-tasks-layers.ts
28
+ /**
29
+ * The merge step of {@link loadTasksConfig}, for callers that load the two
30
+ * sources some other way (Sentinel reads them from the GitHub API, not
31
+ * from disk, holocron#916): `holocron.config.*`'s `tasks` value first,
32
+ * then a dedicated `astromech.config.*`'s default export merged on top.
33
+ * Either may be `undefined` (source absent); returns `{}` when both are.
34
+ */
35
+ function mergeTasksLayers(parentTasks, dedicated) {
36
+ return [coerceTasks(parentTasks), coerceTasks(dedicated)].filter((layer) => layer !== void 0).reduce((acc, layer) => mergeConfig(acc, layer), {});
37
+ }
38
+ //#endregion
12
39
  //#region src/config/load.ts
13
40
  /**
14
41
  * Resolve the task manifest for a repo: the `tasks` key of
@@ -32,19 +59,5 @@ async function loadTasksConfig(cwd) {
32
59
  walkUp: true
33
60
  }))?.config.tasks, dedicated?.config);
34
61
  }
35
- /**
36
- * The merge step of {@link loadTasksConfig}, for callers that load the two
37
- * sources some other way (Sentinel reads them from the GitHub API, not
38
- * from disk, holocron#916): `holocron.config.*`'s `tasks` value first,
39
- * then a dedicated `astromech.config.*`'s default export merged on top.
40
- * Either may be `undefined` (source absent); returns `{}` when both are.
41
- */
42
- function mergeTasksLayers(parentTasks, dedicated) {
43
- return [coerce(parentTasks), coerce(dedicated)].filter((layer) => layer !== void 0).reduce((acc, layer) => mergeConfig(acc, layer), {});
44
- }
45
- function coerce(value) {
46
- if (value == null) return void 0;
47
- return Array.isArray(value) ? { tasks: value } : value;
48
- }
49
62
  //#endregion
50
63
  export { mergeTasksLayers as n, normalizeTaskEntry as r, loadTasksConfig as t };
@@ -1,12 +1,4 @@
1
- //#region src/config/schema.d.ts
2
- /**
3
- * The `tasks` config shape — the single manifest of what a repo runs.
4
- * Read from a dedicated `astromech.config.*` file or the `tasks` key of
5
- * `holocron.config.*` (see {@link loadTasksConfig}).
6
- *
7
- * Runtime validation is the loader's job, not this type's — the type only
8
- * describes what an author writes.
9
- */
1
+ //#region src/config/schema.type.d.ts
10
2
  interface TaskEntry {
11
3
  /** Registry task name — `verification.unitTests`, `sourceQuality.staticAnalysis`, `delivery.build`, … */
12
4
  name: string;
@@ -71,7 +63,5 @@ interface TasksConfig {
71
63
  prePush?: boolean;
72
64
  };
73
65
  }
74
- /** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
75
- declare function normalizeTaskEntry(item: TaskConfigItem): Required<Pick<TaskEntry, "name" | "ci" | "local">> & TaskEntry;
76
66
  //#endregion
77
- export { normalizeTaskEntry as i, TaskEntry as n, TasksConfig as r, TaskConfigItem as t };
67
+ export { TaskEntry as n, TasksConfig as r, TaskConfigItem as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/astromech",
3
- "version": "5.0.0-alpha.146",
3
+ "version": "5.0.0-alpha.148",
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",
@@ -37,7 +37,10 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@theholocron/datapad": "5.0.0-alpha.146"
40
+ "@theholocron/fs-utils": "^1.12.0",
41
+ "@theholocron/json-utils": "^1.12.0",
42
+ "@theholocron/pkg-utils": "^1.12.0",
43
+ "@theholocron/datapad": "5.0.0-alpha.148"
41
44
  },
42
45
  "devDependencies": {
43
46
  "@theholocron/eslint-config": "^8.7.1",
@@ -53,7 +56,7 @@
53
56
  "tsdown": "^0.22.14",
54
57
  "typescript": "^5.9.3",
55
58
  "vitest": "^4.1.11",
56
- "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.146"
59
+ "@theholocron/rollup-plugin-transform-template": "5.0.0-alpha.148"
57
60
  },
58
61
  "engines": {
59
62
  "node": ">=22"