@theholocron/astromech 5.0.0-alpha.243 → 5.0.0-alpha.245

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,5 @@
1
- import { n as coerceTasks, r as normalizeTaskEntry, t as loadTasksConfig } from "../load-DdHEVFlG.mjs";
1
+ import { t as normalizeTaskEntry } from "../schema-Djtv0sLM.mjs";
2
+ import { n as coerceTasks, t as loadTasksConfig } from "../load-Bk9SYAfX.mjs";
2
3
  import { createDefineConfig, mergeLayers } from "@theholocron/datapad";
3
4
  //#region src/config/define/define.ts
4
5
  /**
package/dist/index.d.mts CHANGED
@@ -848,6 +848,12 @@ interface DiscoverWorkspacePackagesOptions extends Pick<ListWorkspacePackagesOpt
848
848
  * `observability`). A package belongs when it is that folder or sits under it.
849
849
  */
850
850
  group?: string;
851
+ /**
852
+ * Leave out the packages of these version groups. A repo that releases some folders on
853
+ * their own line releases everything else together, and that release must not sweep the
854
+ * independent groups in.
855
+ */
856
+ excludeGroups?: readonly string[];
851
857
  }
852
858
  /**
853
859
  * Every package the repo's `pnpm-workspace.yaml` declares, as
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { r as normalizeTaskEntry, t as loadTasksConfig } from "./load-DdHEVFlG.mjs";
1
+ import { t as normalizeTaskEntry } from "./schema-Djtv0sLM.mjs";
2
+ import { t as loadTasksConfig } from "./load-Bk9SYAfX.mjs";
2
3
  import { n as alexrc_default, t as editorconfig_checker_default } from "./editorconfig-checker-DPejtR5z.mjs";
3
4
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
5
  import { isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -82,8 +83,8 @@ function discoverWorkspacePackages(repoRoot, options = {}) {
82
83
  listDirs: options.listDirs
83
84
  })) if (!exclude.some((pattern) => matches(entry.relativeDir, pattern))) entries.set(entry.relativeDir, entry);
84
85
  }
85
- const found = [...entries.values()];
86
- return options.group === void 0 ? found : found.filter(({ relativeDir }) => inGroup(relativeDir, options.group));
86
+ const { group, excludeGroups = [] } = options;
87
+ return [...entries.values()].filter(({ relativeDir }) => (group === void 0 || inGroup(relativeDir, group)) && !excludeGroups.some((excluded) => inGroup(relativeDir, excluded)));
87
88
  }
88
89
  /** `relativeDir` is the group's folder, or is under it. `clients` holds `clients/http`, not `clients-old/x`. */
89
90
  function inGroup(relativeDir, group) {
@@ -366,6 +367,251 @@ var verification_unitTests_default$1 = "name: Test\n\non: # yamllint disable-lin
366
367
  //#region src/templates/reusable/verification.visualRegression.yml
367
368
  var verification_visualRegression_default$1 = "name: Visual Regression\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n chromatic-projects:\n description: >\n JSON array of Chromatic projects to build, one matrix job per entry.\n Each entry: { \"tokenName\": \"WEB\", \"workingDir\": \"apps/web\", \"buildScript\": \"build:storybook\" }.\n tokenName maps to secret CHROMATIC_PROJECT_TOKEN_<TOKENNAME>; use \"default\"\n (or omit for the legacy empty-string form) to use the bare CHROMATIC_PROJECT_TOKEN\n secret for single-project repos.\n buildScript defaults to \"build:storybook\" when omitted.\n Required -- this task only exists in a repo's workflow list when it\n opts into Chromatic at all (holocron#394/#1062): GitHub evaluates a\n job's `if:` before expanding its `strategy.matrix`, so no default\n here (empty or otherwise) can make a *disabled* Chromatic job\n disappear from PR checks -- only not generating this job's thin\n caller in the first place can. A repo that doesn't want Chromatic\n simply omits `verification.visualRegression` from its `tasks:`.\n type: string\n required: true\n secrets:\n CHROMATIC_PROJECT_TOKEN:\n required: false\n\njobs:\n visual-and-composition:\n name: Run visual and composition tests\n strategy:\n fail-fast: false\n matrix:\n project: ${{ fromJSON(inputs.chromatic-projects) }}\n permissions:\n contents: read\n statuses: write\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: chromaui/action@14cfaef73576e69f95f47f60058063f46ca38719 # v18\n name: Publish to Chromatic\n with:\n projectToken: ${{ (matrix.project.tokenName == 'default' || matrix.project.tokenName == '') && secrets.CHROMATIC_PROJECT_TOKEN || secrets[format('CHROMATIC_PROJECT_TOKEN_{0}', matrix.project.tokenName)] }}\n token: ${{ github.token }}\n buildScriptName: ${{ matrix.project.buildScript || 'build:storybook' }}\n workingDir: ${{ matrix.project.workingDir || '.' }}\n storybookBaseDir: ${{ matrix.project.storybookBaseDir || '' }}\n untraced: ${{ matrix.project.untraced || '' }}\n onlyStoryFiles: ${{ matrix.project.onlyStoryFiles || '' }}\n exitZeroOnChanges: ${{ matrix.project.exitZeroOnChanges || false }}\n";
368
369
  //#endregion
370
+ //#region src/templates/workflows/bookkeeping.yml
371
+ var bookkeeping_default = "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n types:\n - opened\n - edited\n\npermissions:\n contents: read\n issues: write\n pull-requests: write\n\njobs:\n bookkeeping:\n name: Bookkeeping\n uses: theholocron/.github/.github/workflows/bookkeeping.yml@main\n secrets: inherit\n";
372
+ //#endregion
373
+ //#region src/templates/workflows/delivery.build.yml
374
+ var delivery_build_default = "name: Delivery\n\non: # yamllint disable-line rule:truthy\n push:\n branches-ignore:\n - main # delivery.publish builds before publishing\n pull_request:\n branches:\n - main\n\nconcurrency:\n group: delivery.build-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n build:\n name: Build\n uses: theholocron/.github/.github/workflows/delivery.build.yml@main\n secrets: inherit\n";
375
+ //#endregion
376
+ //#region src/templates/workflows/delivery.bundleSize.yml
377
+ var delivery_bundleSize_default = "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";
378
+ //#endregion
379
+ //#region src/templates/workflows/delivery.deploy.yml
380
+ var delivery_deploy_default = "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";
381
+ //#endregion
382
+ //#region src/templates/workflows/delivery.previewCheck.yml
383
+ var delivery_previewCheck_default = "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";
384
+ //#endregion
385
+ //#region src/templates/workflows/delivery.previewDeploy.yml
386
+ var delivery_previewDeploy_default = "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 # Must be a superset of what the reusable workflow's own job requests\n # (holocron#1058) -- its new path-relevance check lists the PR's\n # changed files via the API (holocron#1023).\n pull-requests: read\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";
387
+ //#endregion
388
+ //#region src/templates/workflows/delivery.publish.yml
389
+ var delivery_publish_default = "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";
390
+ //#endregion
391
+ //#region src/templates/workflows/dependencies.yml
392
+ var dependencies_default = "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\npermissions:\n contents: write\n pull-requests: write\n\njobs:\n dependencies:\n name: Dependencies\n uses: theholocron/.github/.github/workflows/dependencies.yml@main\n secrets: inherit\n";
393
+ //#endregion
394
+ //#region src/templates/workflows/greetings.yml
395
+ var greetings_default = "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n issues:\n\npermissions:\n issues: write\n pull-requests: write\n\njobs:\n greetings:\n name: Greetings\n uses: theholocron/.github/.github/workflows/greetings.yml@main\n secrets: inherit\n";
396
+ //#endregion
397
+ //#region src/templates/workflows/knowledge.wiki.yml
398
+ var knowledge_wiki_default = "name: Knowledge\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main]\n pull_request:\n branches: [main]\n\nconcurrency:\n group: ${{ github.event_name == 'pull_request' && format('wiki-preview-{0}', github.event.pull_request.number) || 'wiki' }}\n cancel-in-progress: ${{ github.event_name == 'pull_request' }}\n\npermissions:\n contents: read\n deployments: write\n\njobs:\n publish:\n name: Publish\n if: ${{ github.event_name != 'pull_request' }}\n uses: theholocron/.github/.github/workflows/knowledge.wiki.yml@main\n secrets: inherit\n\n preview:\n name: Preview\n if: ${{ github.event_name == 'pull_request' }}\n uses: theholocron/.github/.github/workflows/knowledge.wiki.yml@main\n with:\n preview: true\n preview-id: pr-${{ github.event.pull_request.number }}\n secrets: inherit\n";
399
+ //#endregion
400
+ //#region src/templates/workflows/platform.commitStandards.yml
401
+ var platform_commitStandards_default = "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";
402
+ //#endregion
403
+ //#region src/templates/workflows/platform.notifyCheck.yml
404
+ var platform_notifyCheck_default = "name: Platform\n\non: # yamllint disable-line rule:truthy\n workflow_dispatch: {}\n\npermissions: {}\n\njobs:\n notify-check:\n name: Notify Check\n uses: theholocron/.github/.github/workflows/platform.notifyCheck.yml@main\n secrets: inherit\n";
405
+ //#endregion
406
+ //#region src/templates/workflows/platform.repoSync.yml
407
+ var platform_repoSync_default = "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";
408
+ //#endregion
409
+ //#region src/templates/workflows/platform.repoValidation.yml
410
+ var platform_repoValidation_default = "name: Platform\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n repo-validation:\n name: Repo Validation\n uses: theholocron/.github/.github/workflows/platform.repoValidation.yml@main\n secrets: inherit\n";
411
+ //#endregion
412
+ //#region src/templates/workflows/platform.syncTemplates.yml
413
+ var platform_syncTemplates_default = "name: Platform\n\n# Bootstrap note: this `uses:` a reusable workflow that must already exist\n# on theholocron/.github's main branch to resolve at all — a brand-new\n# reusable workflow here needs ONE manual `holocron sync github` run\n# (pushing directly to theholocron/.github) before this thin caller can\n# ever successfully trigger it, since GitHub resolves `uses:` at run time,\n# not at merge time. Same deadlock every reusable workflow added here hits\n# on its first introduction.\non: # yamllint disable-line rule:truthy\n push:\n # main only — this publishes to theholocron/.github, consumed by every\n # other repo's CI. alpha is the prerelease channel; publishing from it\n # would let unreleased/unstable template changes overwrite what main\n # just published, the same stable-vs-prerelease split this org already\n # enforces for npm's dist-tags and Sentinel's own deploy trigger.\n branches: [main]\n paths:\n - cli/astromech/src/templates/**\n - cli/astromech/src/generators/**\n - cli/astromech/src/registry/**\n - cli/cli/src/templates/**\n workflow_dispatch: {}\n\nconcurrency:\n group: sync-templates\n cancel-in-progress: false\n\npermissions:\n contents: read\n\njobs:\n sync-templates:\n name: Sync Templates\n # workflow_dispatch can target ANY ref, not only main — without this,\n # anyone able to dispatch this workflow (a broader group than who can\n # push to main) could run it against an arbitrary branch, checking out\n # and building that ref's own code with the sync token present, then\n # publishing that ref's templates to theholocron/.github.\n if: github.ref == 'refs/heads/main'\n uses: theholocron/.github/.github/workflows/platform.syncTemplates.yml@main\n secrets: inherit\n";
414
+ //#endregion
415
+ //#region src/templates/workflows/preview.yml
416
+ var preview_default = "name: Preview\n\non: # yamllint disable-line rule:truthy\n pull_request:\n branches: [main]\n\nconcurrency:\n group: preview-${{ github.event.pull_request.number }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n deployments: write\n pull-requests: write\n\njobs:\n preview:\n name: Preview\n uses: theholocron/.github/.github/workflows/preview.yml@main\n secrets: inherit\n";
417
+ //#endregion
418
+ //#region src/templates/workflows/review.yml
419
+ var review_default = "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\nconcurrency:\n group: review-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n checks: write\n pull-requests: write\n\njobs:\n review:\n name: Annotations\n uses: theholocron/.github/.github/workflows/review.yml@main\n secrets: inherit\n";
420
+ //#endregion
421
+ //#region src/templates/workflows/security.codeScanning.yml
422
+ var security_codeScanning_default = "name: Security\n\non: # yamllint disable-line rule:truthy\n push:\n branches:\n - main\n pull_request:\n branches:\n - main\n schedule:\n - cron: \"0 0 * * 1\"\n\npermissions:\n actions: read\n contents: read\n security-events: write\n\njobs:\n security:\n name: Code Scanning\n uses: theholocron/.github/.github/workflows/security.codeScanning.yml@main\n secrets: inherit\n";
423
+ //#endregion
424
+ //#region src/templates/workflows/security.secretDetection.yml
425
+ var security_secretDetection_default = "name: Security\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: security-secret-detection-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n secret-detection:\n name: Secret Detection\n uses: theholocron/.github/.github/workflows/security.secretDetection.yml@main\n secrets: inherit\n";
426
+ //#endregion
427
+ //#region src/templates/workflows/sourceQuality.deadCodeAnalysis.yml
428
+ var sourceQuality_deadCodeAnalysis_default = "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n dead-code-analysis:\n name: Dead Code Analysis\n uses: theholocron/.github/.github/workflows/sourceQuality.deadCodeAnalysis.yml@main\n secrets: inherit\n";
429
+ //#endregion
430
+ //#region src/templates/workflows/sourceQuality.formatting.yml
431
+ var sourceQuality_formatting_default = "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: source-quality-formatting-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: write\n statuses: write\n\njobs:\n formatting:\n name: Formatting\n uses: theholocron/.github/.github/workflows/sourceQuality.formatting.yml@main\n secrets: inherit\n";
432
+ //#endregion
433
+ //#region src/templates/workflows/sourceQuality.staticAnalysis.yml
434
+ var sourceQuality_staticAnalysis_default = "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: source-quality-static-analysis-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: write\n statuses: write\n\njobs:\n static-analysis:\n name: Static Analysis\n uses: theholocron/.github/.github/workflows/sourceQuality.staticAnalysis.yml@main\n secrets: inherit\n";
435
+ //#endregion
436
+ //#region src/templates/workflows/sourceQuality.structuredDataValidation.yml
437
+ var sourceQuality_structuredDataValidation_default = "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: source-quality-structured-data-validation-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n structured-data-validation:\n name: Structured Data Validation\n uses: theholocron/.github/.github/workflows/sourceQuality.structuredDataValidation.yml@main\n secrets: inherit\n";
438
+ //#endregion
439
+ //#region src/templates/workflows/stale.yml
440
+ var stale_default = "name: Stale\n\non: # yamllint disable-line rule:truthy\n schedule:\n - cron: \"30 1 * * *\"\n\npermissions:\n contents: write\n issues: write\n pull-requests: write\n\njobs:\n stale:\n uses: theholocron/.github/.github/workflows/stale.yml@main\n with:\n exempt-issue-labels: \"in-progress,wip\"\n exempt-all-issue-milestones: true\n exempt-all-issue-projects: true\n exempt-all-pr-projects: true\n secrets: inherit\n";
441
+ //#endregion
442
+ //#region src/templates/workflows/verification.performance.yml
443
+ var verification_performance_default = "name: Verification\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n performance:\n name: Audit the Performance\n uses: theholocron/.github/.github/workflows/verification.performance.yml@main\n secrets: inherit\n";
444
+ //#endregion
445
+ //#region src/templates/workflows/verification.typeSafety.yml
446
+ var verification_typeSafety_default = "name: Verification\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: typecheck-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n typecheck:\n name: Typecheck\n uses: theholocron/.github/.github/workflows/verification.typeSafety.yml@main\n secrets: inherit\n";
447
+ //#endregion
448
+ //#region src/templates/workflows/verification.unitTests.yml
449
+ var verification_unitTests_default = "name: Verification\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: test-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n id-token: write\n statuses: write\n\njobs:\n test:\n name: Test\n uses: theholocron/.github/.github/workflows/verification.unitTests.yml@main\n with:\n run-unit: true\n secrets: inherit\n";
450
+ //#endregion
451
+ //#region src/templates/workflows/verification.visualRegression.yml
452
+ var verification_visualRegression_default = "name: Visual Regression\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n statuses: write\n\njobs:\n visual-and-composition:\n name: Visual Regression\n uses: theholocron/.github/.github/workflows/verification.visualRegression.yml@main\n secrets: inherit\n";
453
+ //#endregion
454
+ //#region src/generators/github-action-thin-callers/grouped-publish/yaml-scalar.ts
455
+ /**
456
+ * A value as a YAML scalar for a `with:` entry. Bare `[` and `{` would parse as
457
+ * sequence and mapping nodes, so values that start with one (JSON) are single-quoted
458
+ * and stay strings.
459
+ */
460
+ function yamlScalar(value) {
461
+ if (value === true) return "true";
462
+ if (value === false) return "false";
463
+ const text = String(value);
464
+ return text.startsWith("[") || text.startsWith("{") ? `'${text}'` : text;
465
+ }
466
+ //#endregion
467
+ //#region src/generators/github-action-thin-callers/grouped-publish/grouped-publish.ts
468
+ /** The reusable's inputs a group may set for itself; everything else is shared by all releases. */
469
+ const GROUP_INPUTS = [
470
+ "deploy-on-release",
471
+ "post-release",
472
+ "run-build",
473
+ "sentry-project"
474
+ ];
475
+ /** Same rule as `groupReleaseConfig()`: the name is a tag prefix and a folder. */
476
+ const GROUP_NAME = /^[a-z][a-z0-9-]*$/;
477
+ /** Names the `group` choice already uses. */
478
+ const RESERVED = ["all", "ungrouped"];
479
+ /** Validate a group's (or the ungrouped release's) own inputs. */
480
+ function parseInputs(label, inputs) {
481
+ for (const [key, value] of Object.entries(inputs)) {
482
+ if (!GROUP_INPUTS.includes(key)) throw new TypeError(`delivery.publish: ${label} sets "${key}", which is not per-release; use one of ${GROUP_INPUTS.join(", ")}`);
483
+ if (typeof value !== "string" && typeof value !== "boolean") throw new TypeError(`delivery.publish: ${label} input "${key}" must be a string or a boolean`);
484
+ }
485
+ return inputs;
486
+ }
487
+ /**
488
+ * Validate a `delivery.publish` `groups` list and flatten it to matrix entries.
489
+ * A group is its folder name, or `{ name, ...inputs }` to set some of the reusable's
490
+ * inputs for that group alone (`sentry-project` and `deploy-on-release` belong to one
491
+ * release, not to every release in the matrix).
492
+ */
493
+ function parseGroups(groups) {
494
+ if (!Array.isArray(groups) || groups.length === 0) throw new TypeError("delivery.publish: `groups` must be a non-empty list of version-group folders");
495
+ const seen = /* @__PURE__ */ new Set();
496
+ return groups.map((raw) => {
497
+ const { name, ...inputs } = typeof raw === "string" ? { name: raw } : raw ?? {};
498
+ if (typeof name !== "string" || !GROUP_NAME.test(name) || RESERVED.includes(name)) throw new TypeError(`delivery.publish: a group is a lowercase folder name like "clients" (not ${RESERVED.map((r) => `"${r}"`).join(" or ")}), got ${JSON.stringify(name)}`);
499
+ if (seen.has(name)) throw new TypeError(`delivery.publish: group "${name}" is listed twice`);
500
+ seen.add(name);
501
+ return {
502
+ group: name,
503
+ ...parseInputs(`group "${name}"`, inputs)
504
+ };
505
+ });
506
+ }
507
+ /**
508
+ * The `delivery.publish` thin caller for a repo that releases several version groups:
509
+ * a `plan` job picks the groups, and a matrix job calls the reusable workflow once per
510
+ * group. `base` is the plain caller template; its triggers, permissions and concurrency
511
+ * are kept, and its `jobs:` replaced.
512
+ *
513
+ * - Groups release **one at a time** (`max-parallel: 1`): each release pushes a commit to
514
+ * the branch, and the next group's run checks out the branch tip (see the reusable's
515
+ * `group` input). `fail-fast` is off so one group's failure does not skip the rest.
516
+ * - A push releases every group; a manual run can pick one (and dry-run it) with the
517
+ * `group` input. A job's `if:` cannot see `matrix`, so the choice is made in `plan`.
518
+ * - `ungrouped` also releases everything that is in **no** group, together and under the
519
+ * repo's plain tags, as the single release did before; it runs first. It takes the same
520
+ * per-release inputs as a group (`true` for none). A repo with groups and packages in no
521
+ * group needs it, or those packages would stop releasing.
522
+ * - `shared` entries (and the template's own `dry-run`) go to every release; the
523
+ * per-group inputs come from the matrix entry.
524
+ */
525
+ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
526
+ const entries = parseGroups(groups);
527
+ const ungroupedInputs = ungrouped === true ? {} : ungrouped && typeof ungrouped === "object" && !Array.isArray(ungrouped) ? parseInputs("`ungrouped`", ungrouped) : void 0;
528
+ if (ungrouped !== false && ungrouped !== void 0 && ungroupedInputs === void 0) throw new TypeError("delivery.publish: `ungrouped` must be true, or an object of per-release inputs");
529
+ const perGroup = GROUP_INPUTS.filter((key) => entries.some((entry) => key in entry));
530
+ const clash = [...perGroup, ...Object.keys(ungroupedInputs ?? {})].filter((key) => key in shared);
531
+ if (clash.length > 0) throw new TypeError(`delivery.publish: ${[...new Set(clash)].join(", ")} is set both for every release and for one`);
532
+ const groupInput = [
533
+ " group:",
534
+ " description: >",
535
+ " Release one version group instead of all of them. Push-triggered",
536
+ " runs always release everything.",
537
+ " required: false",
538
+ " default: all",
539
+ " type: choice",
540
+ " options:",
541
+ " - all",
542
+ ...ungroupedInputs ? [" - ungrouped"] : [],
543
+ ...entries.map((entry) => ` - ${entry.group}`),
544
+ ""
545
+ ].join("\n");
546
+ const head = base.slice(0, base.indexOf("jobs:\n")).replace(/( {8}type: boolean\n)/, `$1${groupInput}`);
547
+ const templateWith = base.match(/ {4}with:\n((?: {6}[^\n]+\n)*)/)[1].split("\n").filter(Boolean);
548
+ const sharedWith = Object.entries(shared).map(([key, value]) => ` ${key}: ${yamlScalar(value)}`);
549
+ const matrixWith = [
550
+ ...templateWith,
551
+ " group: ${{ matrix.group }}",
552
+ ...sharedWith,
553
+ ...perGroup.map((key) => {
554
+ return ` ${key}: \${{ matrix.${key}${entries.every((entry) => !(key in entry) || typeof entry[key] === "boolean") ? " == true" : ""} }}`;
555
+ })
556
+ ];
557
+ const matrixJson = JSON.stringify(entries).replaceAll("'", "''");
558
+ const uses = " uses: theholocron/.github/.github/workflows/delivery.publish.yml@main";
559
+ const ungroupedJob = ungroupedInputs ? [
560
+ " release:",
561
+ " name: Release",
562
+ " if: ${{ inputs.group == '' || inputs.group == 'all' || inputs.group == 'ungrouped' }}",
563
+ uses,
564
+ " with:",
565
+ ...templateWith,
566
+ ...sharedWith,
567
+ ...Object.entries(ungroupedInputs).map(([key, value]) => ` ${key}: ${yamlScalar(value)}`),
568
+ " secrets: inherit",
569
+ ""
570
+ ] : [];
571
+ return [
572
+ `${head}jobs:`,
573
+ ...ungroupedJob,
574
+ " plan:",
575
+ " name: Plan",
576
+ " runs-on: ubuntu-latest",
577
+ " permissions: {}",
578
+ " outputs:",
579
+ " groups: ${{ steps.plan.outputs.groups }}",
580
+ " steps:",
581
+ " - id: plan",
582
+ " name: Choose the groups to release",
583
+ " env:",
584
+ " GROUP: ${{ inputs.group }}",
585
+ ` ALL_GROUPS: '${matrixJson}'`,
586
+ " run: |",
587
+ " if [ -n \"$GROUP\" ] && [ \"$GROUP\" != \"all\" ]; then",
588
+ ` groups=$(jq -c --arg group "$GROUP" '[.[] | select(.group == $group)]' <<<"$ALL_GROUPS")`,
589
+ " else",
590
+ " groups=$ALL_GROUPS",
591
+ " fi",
592
+ " echo \"groups=$groups\" >> \"$GITHUB_OUTPUT\"",
593
+ "",
594
+ ` ${ungroupedInputs ? "release-groups" : "release"}:`,
595
+ " name: Release ${{ matrix.group }}",
596
+ ...ungroupedInputs ? [
597
+ " # after the ungrouped release, which pushes its own commit first; still run if it failed or was skipped.",
598
+ " # Choosing `ungrouped` by hand leaves the plan empty, and a matrix with no entries fails the run.",
599
+ " needs: [plan, release]",
600
+ " if: ${{ !cancelled() && needs.plan.result == 'success' && needs.plan.outputs.groups != '[]' }}"
601
+ ] : [" needs: plan"],
602
+ " strategy:",
603
+ " fail-fast: false",
604
+ " max-parallel: 1",
605
+ " matrix:",
606
+ " include: ${{ fromJSON(needs.plan.outputs.groups) }}",
607
+ uses,
608
+ " with:",
609
+ ...matrixWith,
610
+ " secrets: inherit",
611
+ ""
612
+ ].join("\n");
613
+ }
614
+ //#endregion
369
615
  //#region src/generators/github-action-thin-callers/github-action-thin-callers.ts
370
616
  /**
371
617
  * Workflow templates + thin-caller generation.
@@ -375,34 +621,34 @@ var verification_visualRegression_default$1 = "name: Visual Regression\n\non: #
375
621
  * into the thin caller `holocron repo setup` / `holocron repo sync` write locally.
376
622
  */
377
623
  const WORKFLOW_TEMPLATES = {
378
- "verification.unitTests": "name: Verification\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: test-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n id-token: write\n statuses: write\n\njobs:\n test:\n name: Test\n uses: theholocron/.github/.github/workflows/verification.unitTests.yml@main\n with:\n run-unit: true\n secrets: inherit\n",
379
- "verification.visualRegression": "name: Visual Regression\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n statuses: write\n\njobs:\n visual-and-composition:\n name: Visual Regression\n uses: theholocron/.github/.github/workflows/verification.visualRegression.yml@main\n secrets: inherit\n",
380
- "verification.typeSafety": "name: Verification\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: typecheck-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n typecheck:\n name: Typecheck\n uses: theholocron/.github/.github/workflows/verification.typeSafety.yml@main\n secrets: inherit\n",
381
- "verification.performance": "name: Verification\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n performance:\n name: Audit the Performance\n uses: theholocron/.github/.github/workflows/verification.performance.yml@main\n secrets: inherit\n",
382
- "sourceQuality.staticAnalysis": "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: source-quality-static-analysis-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: write\n statuses: write\n\njobs:\n static-analysis:\n name: Static Analysis\n uses: theholocron/.github/.github/workflows/sourceQuality.staticAnalysis.yml@main\n secrets: inherit\n",
383
- "sourceQuality.formatting": "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: source-quality-formatting-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: write\n statuses: write\n\njobs:\n formatting:\n name: Formatting\n uses: theholocron/.github/.github/workflows/sourceQuality.formatting.yml@main\n secrets: inherit\n",
384
- "sourceQuality.structuredDataValidation": "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: source-quality-structured-data-validation-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n structured-data-validation:\n name: Structured Data Validation\n uses: theholocron/.github/.github/workflows/sourceQuality.structuredDataValidation.yml@main\n secrets: inherit\n",
385
- "sourceQuality.deadCodeAnalysis": "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n dead-code-analysis:\n name: Dead Code Analysis\n uses: theholocron/.github/.github/workflows/sourceQuality.deadCodeAnalysis.yml@main\n secrets: inherit\n",
386
- "security.secretDetection": "name: Security\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\nconcurrency:\n group: security-secret-detection-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n secret-detection:\n name: Secret Detection\n uses: theholocron/.github/.github/workflows/security.secretDetection.yml@main\n secrets: inherit\n",
387
- "security.codeScanning": "name: Security\n\non: # yamllint disable-line rule:truthy\n push:\n branches:\n - main\n pull_request:\n branches:\n - main\n schedule:\n - cron: \"0 0 * * 1\"\n\npermissions:\n actions: read\n contents: read\n security-events: write\n\njobs:\n security:\n name: Code Scanning\n uses: theholocron/.github/.github/workflows/security.codeScanning.yml@main\n secrets: inherit\n",
388
- "delivery.build": "name: Delivery\n\non: # yamllint disable-line rule:truthy\n push:\n branches-ignore:\n - main # delivery.publish builds before publishing\n pull_request:\n branches:\n - main\n\nconcurrency:\n group: delivery.build-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n\njobs:\n build:\n name: Build\n uses: theholocron/.github/.github/workflows/delivery.build.yml@main\n secrets: inherit\n",
389
- "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",
390
- "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",
391
- "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",
392
- "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",
393
- "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 # Must be a superset of what the reusable workflow's own job requests\n # (holocron#1058) -- its new path-relevance check lists the PR's\n # changed files via the API (holocron#1023).\n pull-requests: read\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",
394
- "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",
395
- "platform.notifyCheck": "name: Platform\n\non: # yamllint disable-line rule:truthy\n workflow_dispatch: {}\n\npermissions: {}\n\njobs:\n notify-check:\n name: Notify Check\n uses: theholocron/.github/.github/workflows/platform.notifyCheck.yml@main\n secrets: inherit\n",
396
- "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",
397
- "platform.repoValidation": "name: Platform\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main, alpha]\n pull_request:\n\npermissions:\n contents: read\n\njobs:\n repo-validation:\n name: Repo Validation\n uses: theholocron/.github/.github/workflows/platform.repoValidation.yml@main\n secrets: inherit\n",
398
- "platform.syncTemplates": "name: Platform\n\n# Bootstrap note: this `uses:` a reusable workflow that must already exist\n# on theholocron/.github's main branch to resolve at all — a brand-new\n# reusable workflow here needs ONE manual `holocron sync github` run\n# (pushing directly to theholocron/.github) before this thin caller can\n# ever successfully trigger it, since GitHub resolves `uses:` at run time,\n# not at merge time. Same deadlock every reusable workflow added here hits\n# on its first introduction.\non: # yamllint disable-line rule:truthy\n push:\n # main only — this publishes to theholocron/.github, consumed by every\n # other repo's CI. alpha is the prerelease channel; publishing from it\n # would let unreleased/unstable template changes overwrite what main\n # just published, the same stable-vs-prerelease split this org already\n # enforces for npm's dist-tags and Sentinel's own deploy trigger.\n branches: [main]\n paths:\n - cli/astromech/src/templates/**\n - cli/astromech/src/generators/**\n - cli/astromech/src/registry/**\n - cli/cli/src/templates/**\n workflow_dispatch: {}\n\nconcurrency:\n group: sync-templates\n cancel-in-progress: false\n\npermissions:\n contents: read\n\njobs:\n sync-templates:\n name: Sync Templates\n # workflow_dispatch can target ANY ref, not only main — without this,\n # anyone able to dispatch this workflow (a broader group than who can\n # push to main) could run it against an arbitrary branch, checking out\n # and building that ref's own code with the sync token present, then\n # publishing that ref's templates to theholocron/.github.\n if: github.ref == 'refs/heads/main'\n uses: theholocron/.github/.github/workflows/platform.syncTemplates.yml@main\n secrets: inherit\n",
399
- "knowledge.wiki": "name: Knowledge\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main]\n pull_request:\n branches: [main]\n\nconcurrency:\n group: ${{ github.event_name == 'pull_request' && format('wiki-preview-{0}', github.event.pull_request.number) || 'wiki' }}\n cancel-in-progress: ${{ github.event_name == 'pull_request' }}\n\npermissions:\n contents: read\n deployments: write\n\njobs:\n publish:\n name: Publish\n if: ${{ github.event_name != 'pull_request' }}\n uses: theholocron/.github/.github/workflows/knowledge.wiki.yml@main\n secrets: inherit\n\n preview:\n name: Preview\n if: ${{ github.event_name == 'pull_request' }}\n uses: theholocron/.github/.github/workflows/knowledge.wiki.yml@main\n with:\n preview: true\n preview-id: pr-${{ github.event.pull_request.number }}\n secrets: inherit\n",
400
- preview: "name: Preview\n\non: # yamllint disable-line rule:truthy\n pull_request:\n branches: [main]\n\nconcurrency:\n group: preview-${{ github.event.pull_request.number }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n deployments: write\n pull-requests: write\n\njobs:\n preview:\n name: Preview\n uses: theholocron/.github/.github/workflows/preview.yml@main\n secrets: inherit\n",
401
- review: "name: Source Quality\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\nconcurrency:\n group: review-${{ github.ref }}\n cancel-in-progress: true\n\npermissions:\n contents: read\n checks: write\n pull-requests: write\n\njobs:\n review:\n name: Annotations\n uses: theholocron/.github/.github/workflows/review.yml@main\n secrets: inherit\n",
402
- stale: "name: Stale\n\non: # yamllint disable-line rule:truthy\n schedule:\n - cron: \"30 1 * * *\"\n\npermissions:\n contents: write\n issues: write\n pull-requests: write\n\njobs:\n stale:\n uses: theholocron/.github/.github/workflows/stale.yml@main\n with:\n exempt-issue-labels: \"in-progress,wip\"\n exempt-all-issue-milestones: true\n exempt-all-issue-projects: true\n exempt-all-pr-projects: true\n secrets: inherit\n",
403
- greetings: "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n issues:\n\npermissions:\n issues: write\n pull-requests: write\n\njobs:\n greetings:\n name: Greetings\n uses: theholocron/.github/.github/workflows/greetings.yml@main\n secrets: inherit\n",
404
- dependencies: "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n\npermissions:\n contents: write\n pull-requests: write\n\njobs:\n dependencies:\n name: Dependencies\n uses: theholocron/.github/.github/workflows/dependencies.yml@main\n secrets: inherit\n",
405
- bookkeeping: "name: Platform\n\non: # yamllint disable-line rule:truthy\n pull_request:\n types:\n - opened\n - edited\n\npermissions:\n contents: read\n issues: write\n pull-requests: write\n\njobs:\n bookkeeping:\n name: Bookkeeping\n uses: theholocron/.github/.github/workflows/bookkeeping.yml@main\n secrets: inherit\n"
624
+ "verification.unitTests": verification_unitTests_default,
625
+ "verification.visualRegression": verification_visualRegression_default,
626
+ "verification.typeSafety": verification_typeSafety_default,
627
+ "verification.performance": verification_performance_default,
628
+ "sourceQuality.staticAnalysis": sourceQuality_staticAnalysis_default,
629
+ "sourceQuality.formatting": sourceQuality_formatting_default,
630
+ "sourceQuality.structuredDataValidation": sourceQuality_structuredDataValidation_default,
631
+ "sourceQuality.deadCodeAnalysis": sourceQuality_deadCodeAnalysis_default,
632
+ "security.secretDetection": security_secretDetection_default,
633
+ "security.codeScanning": security_codeScanning_default,
634
+ "delivery.build": delivery_build_default,
635
+ "delivery.publish": delivery_publish_default,
636
+ "delivery.deploy": delivery_deploy_default,
637
+ "delivery.bundleSize": delivery_bundleSize_default,
638
+ "delivery.previewCheck": delivery_previewCheck_default,
639
+ "delivery.previewDeploy": delivery_previewDeploy_default,
640
+ "platform.repoSync": platform_repoSync_default,
641
+ "platform.notifyCheck": platform_notifyCheck_default,
642
+ "platform.commitStandards": platform_commitStandards_default,
643
+ "platform.repoValidation": platform_repoValidation_default,
644
+ "platform.syncTemplates": platform_syncTemplates_default,
645
+ "knowledge.wiki": knowledge_wiki_default,
646
+ preview: preview_default,
647
+ review: review_default,
648
+ stale: stale_default,
649
+ greetings: greetings_default,
650
+ dependencies: dependencies_default,
651
+ bookkeeping: bookkeeping_default
406
652
  };
407
653
  const KNOWN_WORKFLOWS = new Set(Object.keys(WORKFLOW_TEMPLATES));
408
654
  /**
@@ -451,12 +697,10 @@ const WORKFLOW_CHECK_CONTEXTS = {
451
697
  function generateThinCallerContent(name, withOverrides, additionalPaths, logger, comments) {
452
698
  const base = WORKFLOW_TEMPLATES[name];
453
699
  if (!base) return "";
454
- const yamlScalar = (v) => {
455
- if (v === true) return "true";
456
- if (v === false) return "false";
457
- const s = String(v);
458
- return s.startsWith("[") || s.startsWith("{") ? `'${s}'` : s;
459
- };
700
+ if (name === "delivery.publish" && withOverrides && "groups" in withOverrides) {
701
+ const { groups, ungrouped, ...shared } = withOverrides;
702
+ return groupedPublishCaller(base, groups, shared, ungrouped);
703
+ }
460
704
  const fmt = (k, v) => {
461
705
  const line = ` ${k}: ${yamlScalar(v)}`;
462
706
  return comments?.[k] ? ` # ${comments[k]}\n${line}` : line;
@@ -621,7 +865,7 @@ function normalizeWorkflowWith(raw) {
621
865
  ...p,
622
866
  ...Array.isArray(p.untraced) ? { untraced: p.untraced.join("\n") } : {}
623
867
  }));
624
- for (const [k, v] of Object.entries(result)) if (Array.isArray(v)) result[k] = JSON.stringify(v);
868
+ for (const [k, v] of Object.entries(result)) if (Array.isArray(v) && k !== "groups") result[k] = JSON.stringify(v);
625
869
  return result;
626
870
  }
627
871
  /**
@@ -1,22 +1,4 @@
1
1
  import { loadLayered } from "@theholocron/datapad";
2
- //#region src/config/schema/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
- */
11
- /** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
12
- function normalizeTaskEntry(item) {
13
- return {
14
- ci: true,
15
- local: true,
16
- ...typeof item === "string" ? { name: item } : item
17
- };
18
- }
19
- //#endregion
20
2
  //#region src/config/coerce-tasks/coerce-tasks.ts
21
3
  /** A bare item array is shorthand for `{ tasks: [...] }`. */
22
4
  function coerceTasks(value) {
@@ -52,4 +34,4 @@ async function loadTasksConfig(cwd, options = {}) {
52
34
  }))?.config ?? {};
53
35
  }
54
36
  //#endregion
55
- export { coerceTasks as n, normalizeTaskEntry as r, loadTasksConfig as t };
37
+ export { coerceTasks as n, loadTasksConfig as t };
@@ -1,3 +1,4 @@
1
+ import { r as TasksConfig } from "../schema.type-eVRlTGL1.mjs";
1
2
  import { defineConfig } from "@theholocron/semantic-release-config";
2
3
  //#region src/release/commit-files/commit-files.d.ts
3
4
  /** Runs `git` with `args` in `cwd`, feeding it `input` on stdin, and returns stdout. */
@@ -24,15 +25,18 @@ interface ReleaseContext {
24
25
  [key: string]: unknown;
25
26
  }
26
27
  /** A semantic-release plugin step that looks at commits. */
27
- type CommitStep = "analyzeCommits" | "generateNotes";
28
+ type CommitStep = "analyzeCommits" | "generateNotes" | "success";
28
29
  type StepFn = (pluginConfig: unknown, context: ReleaseContext) => unknown;
29
30
  /** A plugin module that implements `Step`. */
30
31
  type StepPlugin<Step extends CommitStep> = Partial<Record<Step, StepFn>>;
31
32
  //#endregion
32
33
  //#region src/release/folder-scoped/folder-scoped.type.d.ts
33
34
  interface FolderScopedDeps {
34
- /** Loads a plugin module by specifier. Defaults to a dynamic `import()`. */
35
- load?: (specifier: string) => Promise<unknown>;
35
+ /**
36
+ * Loads a plugin module by specifier, resolved from `cwd` (the repo being released). Defaults to a
37
+ * dynamic `import()` of the module as `cwd` resolves it, which is how semantic-release loads its own plugins.
38
+ */
39
+ load?: (specifier: string, cwd: string) => Promise<unknown>;
36
40
  /** Lists the files each commit changed. Defaults to `git diff-tree`. */
37
41
  listFiles?: typeof commitFiles;
38
42
  }
@@ -50,7 +54,26 @@ interface FolderScopedDeps {
50
54
  * where a release actually runs. Commits are listed with one `git diff-tree`
51
55
  * call, in `context.cwd`.
52
56
  */
53
- declare function folderScoped<Step extends CommitStep>(step: Step, paths: readonly string[], { load, listFiles }?: FolderScopedDeps): StepPlugin<Step>;
57
+ declare function folderScoped<Step extends CommitStep>(step: Step, paths: readonly string[], deps?: FolderScopedDeps): StepPlugin<Step>;
58
+ /**
59
+ * The mirror of {@link folderScoped}, for the release of everything that is in **no**
60
+ * version group: it sees only commits that changed a file outside every group folder. A commit
61
+ * confined to a group (and the group's imported history) belongs to that group's release; letting the
62
+ * repo-wide one analyze it would release the repo for a change that is not in it, and write the
63
+ * group's commits into the repo's changelog.
64
+ */
65
+ declare function ungroupedScoped<Step extends CommitStep>(step: Step, groups: readonly string[], deps?: FolderScopedDeps): StepPlugin<Step>;
66
+ /** The file `specifier` resolves to for the repo at `cwd`, else for `semantic-release`; `requireFrom` is a seam for tests. */
67
+ declare function resolvePlugin(specifier: string, cwd: string, requireFrom?: (file: string) => {
68
+ resolve(id: string): string;
69
+ }): string;
70
+ /**
71
+ * Splits the GitHub plugin's entry so its "released in…" comments and labels go only to the PRs and
72
+ * issues of the commits `scoped` keeps. The entry stays as it was, so it still publishes the GitHub
73
+ * release, but with the commenting turned off; `scoped` (a {@link folderScoped} or
74
+ * {@link ungroupedScoped} `success` step) then does the commenting with the entry's own config.
75
+ */
76
+ declare function commentOnlyFor(entry: string | [string, Record<string, unknown> | undefined], scoped: StepPlugin<"success">): ((string | [string, Record<string, unknown> | undefined]) | [object, unknown])[];
54
77
  //#endregion
55
78
  //#region src/release/group-release-config/group-release-config.type.d.ts
56
79
  /** What `defineConfig()` from `@theholocron/semantic-release-config` accepts. */
@@ -90,5 +113,36 @@ declare function groupReleaseConfig(options: GroupReleaseOptions): object;
90
113
  * not `clients-old/x.ts`.
91
114
  */
92
115
  declare function inScope(files: readonly string[], paths: readonly string[]): boolean;
116
+ /**
117
+ * Whether any of `files` sits **outside** every one of `folders`: the mirror of
118
+ * {@link inScope}. A commit that only touches the version groups' folders is out;
119
+ * one that touches anything else, even beside a group's files, is in.
120
+ */
121
+ declare function outsideFolders(files: readonly string[], folders: readonly string[]): boolean;
122
+ //#endregion
123
+ //#region src/release/release-groups/release-groups.d.ts
124
+ /**
125
+ * The version groups a repo releases on their own: the folder names listed under `groups`
126
+ * in its `delivery.publish` task. This is what the generated publish workflow reads, so a
127
+ * release config that asks here stays in step with it instead of keeping a second list.
128
+ * `[]` for a repo that releases as one.
129
+ */
130
+ declare function releaseGroups(config: Pick<TasksConfig, "tasks">): string[];
131
+ //#endregion
132
+ //#region src/release/ungrouped-release-config/ungrouped-release-config.type.d.ts
133
+ interface UngroupedReleaseOptions extends DefineConfigOptions {
134
+ /** The version groups released on their own: folders of the repo whose commits this release ignores. */
135
+ groups: readonly string[];
136
+ }
137
+ //#endregion
138
+ //#region src/release/ungrouped-release-config/ungrouped-release-config.d.ts
139
+ /**
140
+ * The semantic-release config for everything that is in no version group, built on the org's
141
+ * `defineConfig()`: tags, changelog and release commit are the repo's own, as before. The commit
142
+ * analyzer and notes generator skip commits confined to the `groups` folders, because those
143
+ * belong to the groups' releases ({@link ungroupedScoped}). With no groups it is `defineConfig()`
144
+ * unchanged.
145
+ */
146
+ declare function ungroupedReleaseConfig({ groups, ...options }: UngroupedReleaseOptions): object;
93
147
  //#endregion
94
- export { type CommitStep, type DefineConfigOptions, type FolderScopedDeps, GitRun, type GroupReleaseOptions, type ReleaseCommit, type ReleaseContext, type StepPlugin, commitFiles, folderScoped, groupReleaseConfig, inScope };
148
+ export { type CommitStep, type DefineConfigOptions, type FolderScopedDeps, GitRun, type GroupReleaseOptions, type ReleaseCommit, type ReleaseContext, type StepPlugin, type UngroupedReleaseOptions, commentOnlyFor, commitFiles, folderScoped, groupReleaseConfig, inScope, outsideFolders, releaseGroups, resolvePlugin, ungroupedReleaseConfig, ungroupedScoped };
@@ -1,4 +1,8 @@
1
+ import { t as normalizeTaskEntry } from "../schema-Djtv0sLM.mjs";
2
+ import { createRequire } from "node:module";
3
+ import { join } from "node:path";
1
4
  import { execFileSync } from "node:child_process";
5
+ import { pathToFileURL } from "node:url";
2
6
  import { defineConfig } from "@theholocron/semantic-release-config";
3
7
  //#region src/release/commit-files/commit-files.ts
4
8
  const defaultGitRun = (args, input, cwd) => execFileSync("git", args, {
@@ -45,12 +49,22 @@ function inScope(files, paths) {
45
49
  const folders = paths.map((path) => path.replace(/^\.\//, "").replace(/\/+$/, ""));
46
50
  return files.some((file) => folders.some((folder) => file === folder || file.startsWith(`${folder}/`)));
47
51
  }
52
+ /**
53
+ * Whether any of `files` sits **outside** every one of `folders`: the mirror of
54
+ * {@link inScope}. A commit that only touches the version groups' folders is out;
55
+ * one that touches anything else, even beside a group's files, is in.
56
+ */
57
+ function outsideFolders(files, folders) {
58
+ const normalized = folders.map((folder) => folder.replace(/^\.\//, "").replace(/\/+$/, ""));
59
+ return files.some((file) => !normalized.some((folder) => file === folder || file.startsWith(`${folder}/`)));
60
+ }
48
61
  //#endregion
49
62
  //#region src/release/folder-scoped/folder-scoped.ts
50
- /** The semantic-release plugin that implements each commit-reading step. */
63
+ /** The semantic-release plugin that implements each commit-reading step. `success` is the GitHub plugin's "released in…" comments. */
51
64
  const MODULES = {
52
65
  analyzeCommits: "@semantic-release/commit-analyzer",
53
- generateNotes: "@semantic-release/release-notes-generator"
66
+ generateNotes: "@semantic-release/release-notes-generator",
67
+ success: "@semantic-release/github"
54
68
  };
55
69
  /**
56
70
  * An inline semantic-release plugin that runs `step` of the stock plugin
@@ -64,19 +78,63 @@ const MODULES = {
64
78
  * where a release actually runs. Commits are listed with one `git diff-tree`
65
79
  * call, in `context.cwd`.
66
80
  */
67
- function folderScoped(step, paths, { load = (specifier) => import(specifier), listFiles = commitFiles } = {}) {
81
+ function folderScoped(step, paths, deps = {}) {
82
+ return scopedBy(step, (files) => inScope(files, paths), deps);
83
+ }
84
+ /**
85
+ * The mirror of {@link folderScoped}, for the release of everything that is in **no**
86
+ * version group: it sees only commits that changed a file outside every group folder. A commit
87
+ * confined to a group (and the group's imported history) belongs to that group's release; letting the
88
+ * repo-wide one analyze it would release the repo for a change that is not in it, and write the
89
+ * group's commits into the repo's changelog.
90
+ */
91
+ function ungroupedScoped(step, groups, deps = {}) {
92
+ return scopedBy(step, (files) => outsideFolders(files, groups), deps);
93
+ }
94
+ /**
95
+ * `import()` of `specifier` the way semantic-release finds its own plugins: as the repo at `cwd` resolves it,
96
+ * else as `semantic-release` does (the stock plugins are its dependencies, not the repo's). A bare `import()`
97
+ * would resolve from this file, inside astromech, where neither is visible.
98
+ */
99
+ function importFrom(specifier, cwd) {
100
+ return import(pathToFileURL(resolvePlugin(specifier, cwd)).href);
101
+ }
102
+ /** The file `specifier` resolves to for the repo at `cwd`, else for `semantic-release`; `requireFrom` is a seam for tests. */
103
+ function resolvePlugin(specifier, cwd, requireFrom = createRequire) {
104
+ const fromRepo = requireFrom(join(cwd, "package.json"));
105
+ try {
106
+ return fromRepo.resolve(specifier);
107
+ } catch {
108
+ return requireFrom(fromRepo.resolve("semantic-release")).resolve(specifier);
109
+ }
110
+ }
111
+ function scopedBy(step, keep, { load = importFrom, listFiles = commitFiles }) {
68
112
  const scoped = async (pluginConfig, context) => {
69
- const inner = await load(MODULES[step]);
70
113
  const { commits = [], cwd = process.cwd() } = context;
114
+ const inner = await load(MODULES[step], cwd);
71
115
  const files = listFiles(cwd, commits.map((commit) => commit.hash));
72
- const inFolder = commits.filter((commit) => inScope(files.get(commit.hash) ?? [], paths));
116
+ const kept = commits.filter((commit) => keep(files.get(commit.hash) ?? []));
73
117
  return inner[step]?.(pluginConfig, {
74
118
  ...context,
75
- commits: inFolder
119
+ commits: kept
76
120
  });
77
121
  };
78
122
  return { [step]: scoped };
79
123
  }
124
+ /**
125
+ * Splits the GitHub plugin's entry so its "released in…" comments and labels go only to the PRs and
126
+ * issues of the commits `scoped` keeps. The entry stays as it was, so it still publishes the GitHub
127
+ * release, but with the commenting turned off; `scoped` (a {@link folderScoped} or
128
+ * {@link ungroupedScoped} `success` step) then does the commenting with the entry's own config.
129
+ */
130
+ function commentOnlyFor(entry, scoped) {
131
+ const [name, config] = Array.isArray(entry) ? entry : [entry, void 0];
132
+ return [[name, {
133
+ ...config,
134
+ successComment: false,
135
+ releasedLabels: false
136
+ }], [scoped, config]];
137
+ }
80
138
  //#endregion
81
139
  //#region src/release/group-release-config/group-release-config.ts
82
140
  const GROUP = /^[a-z][a-z0-9-]*$/;
@@ -108,23 +166,24 @@ function groupReleaseConfig(options) {
108
166
  const scope = (entry) => {
109
167
  const [name, config] = Array.isArray(entry) ? entry : [entry, void 0];
110
168
  switch (name) {
111
- case "@semantic-release/commit-analyzer": return [folderScoped("analyzeCommits", paths), config];
112
- case "@semantic-release/release-notes-generator": return [folderScoped("generateNotes", paths), config];
113
- case "@semantic-release/changelog": return [name, {
169
+ case "@semantic-release/commit-analyzer": return [[folderScoped("analyzeCommits", paths), config]];
170
+ case "@semantic-release/release-notes-generator": return [[folderScoped("generateNotes", paths), config]];
171
+ case "@semantic-release/changelog": return [[name, {
114
172
  ...config,
115
173
  changelogFile
116
- }];
117
- case "@semantic-release/git": return [name, {
174
+ }]];
175
+ case "@semantic-release/git": return [[name, {
118
176
  ...config,
119
177
  message: groupMessage(config?.["message"], group)
120
- }];
121
- default: return entry;
178
+ }]];
179
+ case "@semantic-release/github": return commentOnlyFor(entry, folderScoped("success", paths));
180
+ default: return [entry];
122
181
  }
123
182
  };
124
183
  return {
125
184
  ...base,
126
185
  tagFormat: `${group}-v\${version}`,
127
- plugins: base.plugins.map(scope)
186
+ plugins: base.plugins.flatMap(scope)
128
187
  };
129
188
  }
130
189
  /** `chore(release): <version> …` becomes `chore(release): <group> <version> …`. */
@@ -132,4 +191,46 @@ function groupMessage(message, group) {
132
191
  return message.replace(/^chore\(release\): /, `chore(release): ${group} `);
133
192
  }
134
193
  //#endregion
135
- export { commitFiles, folderScoped, groupReleaseConfig, inScope };
194
+ //#region src/release/release-groups/release-groups.ts
195
+ /**
196
+ * The version groups a repo releases on their own: the folder names listed under `groups`
197
+ * in its `delivery.publish` task. This is what the generated publish workflow reads, so a
198
+ * release config that asks here stays in step with it instead of keeping a second list.
199
+ * `[]` for a repo that releases as one.
200
+ */
201
+ function releaseGroups(config) {
202
+ const groups = (config.tasks ?? []).map(normalizeTaskEntry).find((entry) => entry.name === "delivery.publish")?.with?.["groups"];
203
+ if (!Array.isArray(groups)) return [];
204
+ return groups.flatMap((group) => {
205
+ const name = typeof group === "string" ? group : group?.name;
206
+ return typeof name === "string" ? [name] : [];
207
+ });
208
+ }
209
+ //#endregion
210
+ //#region src/release/ungrouped-release-config/ungrouped-release-config.ts
211
+ /**
212
+ * The semantic-release config for everything that is in no version group, built on the org's
213
+ * `defineConfig()`: tags, changelog and release commit are the repo's own, as before. The commit
214
+ * analyzer and notes generator skip commits confined to the `groups` folders, because those
215
+ * belong to the groups' releases ({@link ungroupedScoped}). With no groups it is `defineConfig()`
216
+ * unchanged.
217
+ */
218
+ function ungroupedReleaseConfig({ groups, ...options }) {
219
+ const base = defineConfig(options);
220
+ if (groups.length === 0) return base;
221
+ const scope = (entry) => {
222
+ const [name, config] = Array.isArray(entry) ? entry : [entry, void 0];
223
+ switch (name) {
224
+ case "@semantic-release/commit-analyzer": return [[ungroupedScoped("analyzeCommits", groups), config]];
225
+ case "@semantic-release/release-notes-generator": return [[ungroupedScoped("generateNotes", groups), config]];
226
+ case "@semantic-release/github": return commentOnlyFor(entry, ungroupedScoped("success", groups));
227
+ default: return [entry];
228
+ }
229
+ };
230
+ return {
231
+ ...base,
232
+ plugins: base.plugins.flatMap(scope)
233
+ };
234
+ }
235
+ //#endregion
236
+ export { commentOnlyFor, commitFiles, folderScoped, groupReleaseConfig, inScope, outsideFolders, releaseGroups, resolvePlugin, ungroupedReleaseConfig, ungroupedScoped };
@@ -0,0 +1,19 @@
1
+ //#region src/config/schema/schema.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
+ */
10
+ /** Normalise a `TaskConfigItem` to a full {@link TaskEntry} with defaults applied. */
11
+ function normalizeTaskEntry(item) {
12
+ return {
13
+ ci: true,
14
+ local: true,
15
+ ...typeof item === "string" ? { name: item } : item
16
+ };
17
+ }
18
+ //#endregion
19
+ export { normalizeTaskEntry as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/astromech",
3
- "version": "5.0.0-alpha.243",
3
+ "version": "5.0.0-alpha.245",
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",
@@ -53,7 +53,7 @@
53
53
  "@theholocron/fs-utils": "^1.16.0",
54
54
  "@theholocron/json-utils": "^1.16.0",
55
55
  "@theholocron/pkg-utils": "^1.16.0",
56
- "@theholocron/datapad": "5.0.0-alpha.243"
56
+ "@theholocron/datapad": "5.0.0-alpha.245"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@commitlint/config-conventional": "^21.2.3",