@theholocron/astromech 5.0.0-alpha.161 → 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
@@ -239,7 +239,7 @@ const WORKFLOW_TEMPLATES = {
239
239
  "delivery.publish": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n push:\n branches:\n - main\n - alpha\n workflow_dispatch:\n inputs:\n dry_run:\n description: >\n Dry run — analyze commits and preview the release without git writes\n or publish. Push-triggered runs always run fully; this only applies\n to manual workflow_dispatch triggers.\n required: false\n default: true\n type: boolean\n\npermissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n\nconcurrency:\n group: ${{ github.workflow }}-${{ github.ref }}\n cancel-in-progress: false\n\njobs:\n release:\n name: Release\n uses: theholocron/.github/.github/workflows/delivery.publish.yml@main\n with:\n dry-run: ${{ inputs.dry_run == true }}\n secrets: inherit\n",
240
240
  "delivery.deploy": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main]\n workflow_dispatch:\n\nconcurrency:\n group: pages\n cancel-in-progress: false\n\npermissions:\n contents: read\n pages: write\n id-token: write\n\njobs:\n deploy:\n name: Deploy\n uses: theholocron/.github/.github/workflows/delivery.deploy.yml@main\n secrets: inherit\n",
241
241
  "delivery.bundleSize": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n bundle-size:\n name: Audit the Bundle Size\n uses: theholocron/.github/.github/workflows/delivery.bundleSize.yml@main\n secrets: inherit\n",
242
- "delivery.previewCheck": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n deployment_status:\n\npermissions:\n contents: read\n\njobs:\n preview-check:\n name: Preview Check\n # environment_url is the only field documented to point at the live\n # app — target_url can point at a deployment-details page instead,\n # so there's no safe fallback to it. No environment_url means\n # nothing to check; skip the job entirely rather than hit the wrong\n # page.\n if: >-\n github.event.deployment_status.state == 'success' &&\n github.event.deployment.environment == 'Preview' &&\n github.event.deployment_status.environment_url != ''\n uses: theholocron/.github/.github/workflows/delivery.previewCheck.yml@main\n with:\n preview-url: ${{ github.event.deployment_status.environment_url }}\n # GitHub evaluates which version of this workflow file to run\n # from the default branch for a deployment_status event (unlike\n # push/pull_request) -- without this, the reusable workflow's\n # checkout would default to that same ref instead of the PR's\n # actual deployed commit.\n sha: ${{ github.event.deployment.sha }}\n secrets:\n # Named explicitly, not `secrets: inherit` -- this job needs only\n # these two secrets (holocron#1030/#1032), not every secret this\n # workflow's caller context has access to (e.g.\n # HOLOCRON_DEPLOYMENTS_TOKEN). VERCEL_TOKEN here is read-only use\n # (verifying deployment ownership), never a write/deploy\n # credential.\n VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n VERCEL_PROTECTION_BYPASS_SECRET: ${{ secrets.VERCEL_PROTECTION_BYPASS_SECRET }}\n",
242
+ "delivery.previewCheck": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n deployment_status:\n\npermissions:\n contents: read\n # Must be a superset of what the reusable workflow's own job\n # requests (holocron#1058) -- GitHub hard-fails the whole run at\n # startup, zero jobs dispatched, if the callee asks for more than\n # the caller grants. Needed for the author-trust step's\n # commits/{sha}/pulls lookup.\n pull-requests: read\n\njobs:\n preview-check:\n name: Preview Check\n # environment_url is the only field documented to point at the live\n # app — target_url can point at a deployment-details page instead,\n # so there's no safe fallback to it. No environment_url means\n # nothing to check; skip the job entirely rather than hit the wrong\n # page.\n if: >-\n github.event.deployment_status.state == 'success' &&\n github.event.deployment.environment == 'Preview' &&\n github.event.deployment_status.environment_url != ''\n uses: theholocron/.github/.github/workflows/delivery.previewCheck.yml@main\n with:\n preview-url: ${{ github.event.deployment_status.environment_url }}\n # GitHub evaluates which version of this workflow file to run\n # from the default branch for a deployment_status event (unlike\n # push/pull_request) -- without this, the reusable workflow's\n # checkout would default to that same ref instead of the PR's\n # actual deployed commit.\n sha: ${{ github.event.deployment.sha }}\n secrets:\n # Named explicitly, not `secrets: inherit` -- this job needs only\n # these two secrets (holocron#1030/#1032), not every secret this\n # workflow's caller context has access to (e.g.\n # HOLOCRON_DEPLOYMENTS_TOKEN). VERCEL_TOKEN here is read-only use\n # (verifying deployment ownership), never a write/deploy\n # credential.\n VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n VERCEL_PROTECTION_BYPASS_SECRET: ${{ secrets.VERCEL_PROTECTION_BYPASS_SECRET }}\n",
243
243
  "delivery.previewDeploy": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n pull_request: {}\n\nconcurrency:\n group: preview-deploy-${{ github.event.pull_request.number }}\n # Not true: a cancelled run could land between Vercel accepting the\n # upload and the report job posting a status, leaving a real preview\n # deployment with no corresponding GitHub check — worse than letting an\n # overlapping run for the same PR simply queue.\n cancel-in-progress: false\n\npermissions:\n contents: read\n deployments: write\n\njobs:\n preview-deploy:\n name: Preview Deploy\n uses: theholocron/.github/.github/workflows/delivery.previewDeploy.yml@main\n with:\n cwd: \".\"\n secrets: inherit\n",
244
244
  "platform.repoSync": "name: Platform\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main]\n paths:\n - holocron.config.ts\n - package.json\n - pnpm-workspace.yaml\n workflow_dispatch:\n inputs:\n steps:\n description: \"Sync steps to run (default: all)\"\n type: string\n required: false\n\nconcurrency:\n group: sync-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: write\n pull-requests: write\n\njobs:\n sync:\n name: Sync\n uses: theholocron/.github/.github/workflows/platform.repoSync.yml@main\n with:\n steps: ${{ inputs.steps }}\n secrets: inherit\n",
245
245
  "platform.commitStandards": "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\nconcurrency:\n group: platform-commit-standards-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n commit-standards:\n name: Commit Standards\n uses: theholocron/.github/.github/workflows/platform.commitStandards.yml@main\n secrets: inherit\n",
@@ -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.161",
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.161"
51
+ "@theholocron/datapad": "5.0.0-alpha.163"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@commitlint/config-conventional": "^21.2.3",