@theholocron/astromech 5.0.0-alpha.162 → 5.0.0-alpha.163

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,4 +1,4 @@
1
- import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-B9k8EoOb.mjs";
1
+ import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-BJmfOafW.mjs";
2
2
  import { Loaded } from "@theholocron/datapad";
3
3
  //#region src/config/schema/schema.d.ts
4
4
  /**
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as TasksConfig } from "./schema.type-B9k8EoOb.mjs";
1
+ import { r as TasksConfig } from "./schema.type-BJmfOafW.mjs";
2
2
  //#region src/generators/codecov/codecov.type.d.ts
3
3
  interface WorkspacePackage {
4
4
  slug: string;
package/dist/index.mjs CHANGED
@@ -928,10 +928,29 @@ function createTsconfig(options) {
928
928
  * vars to the registry default's cache-key hashing — the one thing that's
929
929
  * genuinely per-repo (e.g. a package tagging Sentry releases during its own
930
930
  * build needs `SENTRY_AUTH_TOKEN` in its cache key; most repos don't).
931
+ * `turbo.inputs` (holocron#845) appends extra input globs the same way —
932
+ * for a package whose layout the registry default doesn't cover (e.g. a
933
+ * flat-layout package with no `src/` directory at all).
931
934
  */
932
935
  /** Filed once per repo, unconditionally — every generated turbo.json's root. */
933
936
  const GLOBAL_DEPENDENCIES = ["pnpm-workspace.yaml", "tsconfig.json"];
934
937
  /**
938
+ * Guards against a malformed `turbo.inputs`/`turbo.passThroughEnv` override
939
+ * (review on holocron#845): a bare string instead of an array would
940
+ * otherwise spread into individual characters
941
+ * (`[..."**\/*.ts"]` → `["*", "*", "/", "*", ".", "t", "s"]`), silently
942
+ * emitting garbage entries instead of the intended single glob/env-var —
943
+ * the generated `turbo.json` would still be valid JSON, just wrong, with
944
+ * nothing surfacing the mistake. Only a config loaded from JSON or plain JS
945
+ * reaches this unchecked; a typed `holocron.config.ts` via `defineConfig`
946
+ * already rejects the wrong shape at compile time.
947
+ */
948
+ function validatedGlobList(value, taskName, field) {
949
+ if (value === void 0) return [];
950
+ if (!Array.isArray(value) || !value.every((item) => typeof item === "string")) throw new Error(`task "${taskName}": turbo.${field} must be an array of strings, got ${JSON.stringify(value)}`);
951
+ return value;
952
+ }
953
+ /**
935
954
  * `turbo.json` content for this manifest, pretty-printed — write it
936
955
  * directly, no merge (matches `thinCallers()` / `reusableTemplates()`: this
937
956
  * file is generated, not hand-edited). `null` when no task in the manifest
@@ -944,11 +963,16 @@ function turboConfig(config) {
944
963
  if (entry.local === false) continue;
945
964
  const turbo = TASKS[entry.name]?.turbo;
946
965
  if (!turbo) continue;
947
- const extraEnv = entry.turbo?.passThroughEnv;
948
- tasks[entry.name] = extraEnv && extraEnv.length > 0 ? {
966
+ const extraEnv = validatedGlobList(entry.turbo?.passThroughEnv, entry.name, "passThroughEnv");
967
+ const extraInputs = validatedGlobList(entry.turbo?.inputs, entry.name, "inputs");
968
+ const current = tasks[entry.name] ?? turbo;
969
+ const passThroughEnv = extraEnv.length > 0 ? [...current.passThroughEnv ?? [], ...extraEnv] : current.passThroughEnv;
970
+ const inputs = extraInputs.length > 0 ? [...current.inputs, ...extraInputs] : current.inputs;
971
+ tasks[entry.name] = {
949
972
  ...turbo,
950
- passThroughEnv: extraEnv
951
- } : turbo;
973
+ inputs,
974
+ ...passThroughEnv && passThroughEnv.length > 0 ? { passThroughEnv } : {}
975
+ };
952
976
  }
953
977
  if (Object.keys(tasks).length === 0) return null;
954
978
  return stringifyJson({
@@ -32,6 +32,15 @@ interface TaskEntry {
32
32
  turbo?: {
33
33
  /** Extra env vars turbo hashes into this task's cache key, appended to the registry default (empty when the task has none). */
34
34
  passThroughEnv?: string[];
35
+ /**
36
+ * Extra input globs appended to the registry default's `inputs`
37
+ * (holocron#845) — for a package whose layout the registry's
38
+ * `"src/**"` default doesn't cover (e.g. a flat-layout package with
39
+ * no `src/` directory at all). Appended, not replaced: the
40
+ * registry's other inputs (`package.json`, `tsdown.config.ts`, …)
41
+ * stay tracked without needing to be repeated here.
42
+ */
43
+ inputs?: string[];
35
44
  };
36
45
  }
37
46
  /** A task is either its bare name (all defaults) or an entry object. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/astromech",
3
- "version": "5.0.0-alpha.162",
3
+ "version": "5.0.0-alpha.163",
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",
@@ -48,7 +48,7 @@
48
48
  "@theholocron/fs-utils": "^1.15.1",
49
49
  "@theholocron/json-utils": "^1.15.1",
50
50
  "@theholocron/pkg-utils": "^1.15.1",
51
- "@theholocron/datapad": "5.0.0-alpha.162"
51
+ "@theholocron/datapad": "5.0.0-alpha.163"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@commitlint/config-conventional": "^21.2.3",