@theholocron/astromech 5.0.0-alpha.255 → 5.0.0-alpha.257
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-C-3fZESa.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-C-3fZESa.mjs";
|
|
2
2
|
import { ListWorkspacePackagesOptions, WorkspacePackageEntry } from "@theholocron/pkg-utils";
|
|
3
3
|
interface WorkspacePackage$1 {
|
|
4
4
|
slug: string;
|
|
@@ -211,8 +211,13 @@ interface RunLogger {
|
|
|
211
211
|
debug(obj: Record<string, unknown>, msg?: string): void;
|
|
212
212
|
warn(obj: Record<string, unknown>, msg?: string): void;
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Runs `cmd` and reports its exit code. `opts.env` is added to the child's
|
|
216
|
+
* environment (on top of the parent's), e.g. `TURBO_SCM_BASE` for `--affected`.
|
|
217
|
+
*/
|
|
214
218
|
type ExecFn = (cmd: string, args: string[], opts: {
|
|
215
219
|
cwd: string;
|
|
220
|
+
env?: Record<string, string>;
|
|
216
221
|
}) => {
|
|
217
222
|
exitCode: number;
|
|
218
223
|
};
|
|
@@ -250,6 +255,12 @@ interface RunTaskInput extends RunDeps {
|
|
|
250
255
|
required?: boolean;
|
|
251
256
|
/** `turbo --filter=<pkg>` passthrough (monorepo). Ignored when the repo has no `turbo.json`. */
|
|
252
257
|
filter?: string;
|
|
258
|
+
/** `turbo --affected`: only the packages changed since `base`, plus their dependents. Ignored without a `turbo.json`. */
|
|
259
|
+
affected?: boolean;
|
|
260
|
+
/** Git ref `affected` compares against; falls back to `TURBO_SCM_BASE`. */
|
|
261
|
+
base?: string;
|
|
262
|
+
/** Environment `affected` reads (`GITHUB_EVENT_NAME`, `GITHUB_REF_NAME`, `TURBO_SCM_BASE`). Defaults to empty. */
|
|
263
|
+
env?: Record<string, string | undefined>;
|
|
253
264
|
/** The task entry's `jobs` switches: a sub-job set to `false` (by key or alias) is not run. */
|
|
254
265
|
jobSwitches?: Record<string, boolean>;
|
|
255
266
|
}
|
|
@@ -265,6 +276,12 @@ interface CiOptions {
|
|
|
265
276
|
dryRun?: boolean;
|
|
266
277
|
/** `turbo --filter=<pkg>` passthrough (monorepo). */
|
|
267
278
|
filter?: string;
|
|
279
|
+
/** `turbo --affected`: only the packages changed since `base`. */
|
|
280
|
+
affected?: boolean;
|
|
281
|
+
/** Git ref `affected` compares against. */
|
|
282
|
+
base?: string;
|
|
283
|
+
/** Environment `affected` reads. */
|
|
284
|
+
env?: Record<string, string | undefined>;
|
|
268
285
|
/** `"required"` (default) or `"all"` (every `ci: true` task). */
|
|
269
286
|
scope?: "required" | "all";
|
|
270
287
|
}
|
|
@@ -415,6 +432,12 @@ interface GroupOptions {
|
|
|
415
432
|
dryRun?: boolean;
|
|
416
433
|
/** `turbo --filter=<pkg>` passthrough (monorepo). */
|
|
417
434
|
filter?: string;
|
|
435
|
+
/** `turbo --affected`: only the packages changed since `base`. */
|
|
436
|
+
affected?: boolean;
|
|
437
|
+
/** Git ref `affected` compares against. */
|
|
438
|
+
base?: string;
|
|
439
|
+
/** Environment `affected` reads. */
|
|
440
|
+
env?: Record<string, string | undefined>;
|
|
418
441
|
}
|
|
419
442
|
interface GroupJobReport {
|
|
420
443
|
task: string;
|
|
@@ -460,6 +483,8 @@ interface AstromechOptions {
|
|
|
460
483
|
readFile?: (path: string) => string;
|
|
461
484
|
fileExists?: (path: string) => boolean;
|
|
462
485
|
listDir?: (path: string) => string[];
|
|
486
|
+
/** Injectable environment for `--affected` (tests). Defaults to `process.env`. */
|
|
487
|
+
env?: Record<string, string | undefined>;
|
|
463
488
|
/** Injectable binary lookup (tests). Default checks `node_modules/.bin` then `PATH`. */
|
|
464
489
|
lookPath?: (cwd: string, bin: string) => string | null;
|
|
465
490
|
}
|
|
@@ -478,6 +503,10 @@ interface RunOptions {
|
|
|
478
503
|
required?: boolean;
|
|
479
504
|
/** `turbo --filter=<pkg>` passthrough (monorepo). */
|
|
480
505
|
filter?: string;
|
|
506
|
+
/** `turbo --affected`: only the packages changed since `base`. */
|
|
507
|
+
affected?: boolean;
|
|
508
|
+
/** Git ref `affected` compares against. */
|
|
509
|
+
base?: string;
|
|
481
510
|
}
|
|
482
511
|
interface Astromech {
|
|
483
512
|
/**
|
|
@@ -709,7 +738,20 @@ declare function createIgnoreConfig(): string;
|
|
|
709
738
|
* `pnpm exec holocron`; the source repo passes `node cli/cli/dist/cli.mjs`.
|
|
710
739
|
*/
|
|
711
740
|
declare function createConfig(holocronScript?: string): string;
|
|
712
|
-
|
|
741
|
+
/** What varies in the generated `.github/dependabot.yml`; the rest of the file is the same for every repo. */
|
|
742
|
+
interface DependabotConfigOptions {
|
|
743
|
+
/**
|
|
744
|
+
* Packages Dependabot must not raise version updates for, by exact name. Each becomes a name-only
|
|
745
|
+
* `ignore` entry on the npm ecosystem. Security updates are not affected: for those, Dependabot
|
|
746
|
+
* only honours an `ignore` entry that lists `versions`.
|
|
747
|
+
*/
|
|
748
|
+
ignore?: readonly string[];
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* The content of `.github/dependabot.yml`, with its generated-file header. Names in `ignore` get a name-only
|
|
752
|
+
* `ignore` entry on the npm ecosystem; with none, the file is the shared body unchanged.
|
|
753
|
+
*/
|
|
754
|
+
declare function createConfig$1({ ignore }?: DependabotConfigOptions): string;
|
|
713
755
|
declare function createConfig$2(): string;
|
|
714
756
|
declare function createConfig$3(): string;
|
|
715
757
|
/**
|
|
@@ -807,4 +849,4 @@ export declare function discoverWorkspacePackages(repoRoot: string, options?: Di
|
|
|
807
849
|
* as `<root>/*` when there is no such file or it lists none.
|
|
808
850
|
*/
|
|
809
851
|
export declare function resolveWorkspaceGlobs(repoRoot: string, options?: Pick<DiscoverWorkspacePackagesOptions, "readText">): WorkspaceGlobs;
|
|
810
|
-
export { type Astromech, type AstromechOptions, type CiJobReport, type CiOptions, type CiReport, type CreateHeaderOptions, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type WorkspacePackage as DeployWorkspacePackage, type DiscoverWorkspacePackagesOptions, type ExecFn, type GroupJobReport, type GroupOptions, type GroupReport, type HeaderFunctions, type JobDef, type LocalRunner, type OrgContext, type PreviewConfig, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, type TaskDef, type TsconfigOptions, type WorkflowHeaderFormat, type WorkspaceGlobs, type WorkspacePackage$1 as WorkspacePackage, createIgnoreConfig as createAlexignore, createRcConfig as createAlexrc, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createIgnoreConfig$1 as createYamlignore, createConfig$9 as createYamllint };
|
|
852
|
+
export { type Astromech, type AstromechOptions, type CiJobReport, type CiOptions, type CiReport, type CreateHeaderOptions, type DependabotConfigOptions, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type WorkspacePackage as DeployWorkspacePackage, type DiscoverWorkspacePackagesOptions, type ExecFn, type GroupJobReport, type GroupOptions, type GroupReport, type HeaderFunctions, type JobDef, type LocalRunner, type OrgContext, type PreviewConfig, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, type TaskDef, type TsconfigOptions, type WorkflowHeaderFormat, type WorkspaceGlobs, type WorkspacePackage$1 as WorkspacePackage, createIgnoreConfig as createAlexignore, createRcConfig as createAlexrc, createConfig as createCommitMsg, createConfig$1 as createDependabot, createConfig$2 as createDevmoji, createConfig$3 as createEditorconfig, createConfig$4 as createEditorconfigChecker, createConfig$5 as createLabeler, createConfig$6 as createPreCommit, createConfig$7 as createPrePush, createConfig$8 as createPrepareCommitMsg, createIgnoreConfig$1 as createYamlignore, createConfig$9 as createYamllint };
|
package/dist/index.mjs
CHANGED
|
@@ -263,19 +263,19 @@ function codecovConfig(repoRoot, existing) {
|
|
|
263
263
|
// src/templates/reusable/actions/auto-commit.yml
|
|
264
264
|
var auto_commit_default = "name: Auto Commit\ndescription: >\n Commit and push any file changes using stefanzweifel/git-auto-commit-action.\n If a branch name is provided and differs from the current branch, a new branch\n is created automatically.\n\ninputs:\n token:\n description: >\n GitHub token with push access to the target branch. Used to authenticate\n the git remote so the commit can be pushed.\n required: true\n branch:\n description: >\n Branch to commit to. Leave empty to commit to the current branch (useful\n in PR contexts). Provide an explicit name (e.g. chore/auto-sync-<sha>) to push\n to a separate branch.\n required: false\n default: \"\"\n commit-message:\n description: Commit message.\n required: true\n commit-options:\n description: >\n Additional options passed to git commit (e.g. --no-verify).\n required: false\n default: \"\"\n commit-user-name:\n description: Git user.name for the commit.\n required: false\n default: \"github-actions[bot]\"\n commit-user-email:\n description: Git user.email for the commit.\n required: false\n default: \"41898282+github-actions[bot]@users.noreply.github.com\"\n commit-author:\n description: >\n Git author string in \"Name <email>\" format.\n required: false\n default: \"github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>\"\n\noutputs:\n changes-detected:\n description: \"'true' if any files were committed, 'false' otherwise.\"\n value: ${{ steps.commit.outputs.changes_detected }}\n\nruns:\n using: composite\n steps:\n - name: Configure git remote with token\n shell: bash\n run: |\n REMOTE_URL=$(git remote get-url origin)\n AUTHED_URL=$(echo \"$REMOTE_URL\" | sed \"s|https://|https://x-access-token:${TOKEN}@|\")\n git remote set-url origin \"$AUTHED_URL\"\n env:\n TOKEN: ${{ inputs.token }}\n\n - name: Reset branch to current HEAD\n if: ${{ inputs.branch != '' }}\n shell: bash\n run: git checkout -B \"$BRANCH\"\n env:\n BRANCH: ${{ inputs.branch }}\n\n - name: Build signed commit message\n id: msg\n shell: bash\n run: |\n TRAILER=\"Signed-off-by: ${COMMIT_USER_NAME} <${COMMIT_USER_EMAIL}>\"\n if echo \"$COMMIT_MESSAGE\" | grep -qF \"$TRAILER\"; then\n FINAL=\"$COMMIT_MESSAGE\"\n else\n FINAL=\"${COMMIT_MESSAGE}\"$'\\n\\n'\"${TRAILER}\"\n fi\n {\n echo \"value<<EOF_TRAILER\"\n printf '%s' \"$FINAL\"\n echo \"\"\n echo \"EOF_TRAILER\"\n } >> \"$GITHUB_OUTPUT\"\n env:\n COMMIT_MESSAGE: ${{ inputs.commit-message }}\n COMMIT_USER_NAME: ${{ inputs.commit-user-name }}\n COMMIT_USER_EMAIL: ${{ inputs.commit-user-email }}\n\n - uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # v7.2.0\n id: commit\n with:\n branch: ${{ inputs.branch }}\n commit_message: ${{ steps.msg.outputs.value }}\n commit_options: ${{ inputs.commit-options }}\n commit_user_name: ${{ inputs.commit-user-name }}\n commit_user_email: ${{ inputs.commit-user-email }}\n commit_author: ${{ inputs.commit-author }}\n";
|
|
265
265
|
// src/templates/reusable/actions/holocron.yml
|
|
266
|
-
var holocron_default = "name: Holocron\ndescription: >\n Run the Holocron CLI — `holocron run <task> [job]` by default, or any other\n subcommand via `command:` (`repo sync`, `sync github`, …). Resolves\n `@theholocron/cli` from `node_modules` (published tarball) or builds it from\n source when it resolves to an unbuilt workspace checkout (the holocron repo\n itself). Requires dependencies to be installed already (run the setup action\n first).\n\ninputs:\n command:\n description: >\n Holocron subcommand. Default `run` — then `task` (and optional `job`)\n name the manifest task. Set to `repo sync` / `sync github` / … to run that\n subcommand directly; `args` becomes everything after it.\n required: false\n default: run\n task:\n description: >\n Manifest task to run when command is run — typecheck, test, build, audit.\n required: false\n default: \"\"\n job:\n description: Optional sub-job within the task (e.g. knip, performance for audit).\n required: false\n default: \"\"\n args:\n description: >\n For `command: run`, extra arguments forwarded to the tool after `--`.\n For any other command, the arguments passed straight to it.\n required: false\n default: \"\"\n\noutputs:\n log-file:\n description: >\n Path to a file holding the full captured stdout+stderr of this\n invocation — the same text the live Actions log shows, saved for a\n caller that wants to ship it elsewhere (e.g. Sentinel's dispatched\n checks shipping it to Axiom, holocron#769/#794).\n value: ${{ steps.run.outputs.log-file }}\n\nruns:\n using: composite\n\n steps:\n - name: Build the workspace when the CLI resolves to an unbuilt checkout\n shell: bash\n # The holocron repo carries @theholocron/cli as `workspace:*`; its bin\n # (dist/cli.mjs) does not exist on a fresh checkout. `pnpm build` is a\n # turbo run — cached and cheap once warm. A no-op everywhere else, where\n # the published tarball already ships dist/.\n #\n # pnpm creates every workspace package's node_modules/.bin/holocron shim\n # once, during the setup action's earlier `pnpm install` — before this\n # build has run, so every one of them is silently skipped (\"Failed to\n # create bin ... ENOENT\"), not just @theholocron/cli's own. That's a\n # one-time decision: a later build doesn't retroactively fix a shim that\n # was never created. Re-running `pnpm install` here (fast — the lockfile\n # hasn't changed, so it only re-links `.bin`) is what actually fixes it,\n # confirmed against a real cold install: `holocron` stays unresolvable\n # from inside any package until this second install runs.\n run: |\n if [ ! -f node_modules/@theholocron/cli/dist/cli.mjs ]; then\n echo \"→ @theholocron/cli dist/ missing — building the workspace from source\" >&2\n pnpm build\n echo \"→ re-linking node_modules/.bin — pnpm skipped it pre-build\" >&2\n pnpm install --frozen-lockfile\n fi\n\n - name: holocron ${{ inputs.command }} ${{ inputs.task }}\n id: run\n shell: bash\n env:\n HOLOCRON_COMMAND: ${{ inputs.command }}\n HOLOCRON_TASK: ${{ inputs.task }}\n HOLOCRON_JOB: ${{ inputs.job }}\n HOLOCRON_ARGS: ${{ inputs.args }}\n run: |\n if [ \"$HOLOCRON_COMMAND\" = \"run\" ]; then\n set -- run \"$HOLOCRON_TASK\"\n [ -n \"$HOLOCRON_JOB\" ] && set -- \"$@\" \"$HOLOCRON_JOB\"\n # shellcheck disable=SC2086\n [ -n \"$HOLOCRON_ARGS\" ] && set -- \"$@\" -- $HOLOCRON_ARGS\n else\n # `command` may be a multi-word path (`repo sync`, `deploy on-release`):\n # word-split it so each token is its own argument.\n # shellcheck disable=SC2086\n set -- $HOLOCRON_COMMAND $HOLOCRON_ARGS\n fi\n # Invoke the built entry directly. `pnpm exec holocron` relies on a\n # node_modules/.bin/holocron shim that pnpm does not create for a\n # workspace package whose dist/ was absent at install time (the holocron\n # repo itself). Resolving the package's main export gives dist/index.mjs;\n # the bin sits next to it as dist/cli.mjs. This is `require.resolve` from\n # node_modules — it works in the holocron monorepo AND in every consumer\n # repo (theholocron/holocron#655), unlike a hard-coded `cli/cli/…`.\n cli=\"$(dirname \"$(node -e 'process.stdout.write(require.resolve(\"@theholocron/cli\"))')\")/cli.mjs\"\n if [ ! -f \"$cli\" ]; then\n echo \"::error::@theholocron/cli entry not found at $cli — is the workspace built?\" >&2\n exit 1\n fi\n echo \"→ $cli $*\" >&2\n # `tee` keeps the live Actions log streaming exactly as before while\n # also capturing it to a file callers can ship elsewhere (log-file\n # output, above). PIPESTATUS[0] -- not $? -- is `node`'s own exit\n # code; $? after a pipe is tee's, which succeeds even when node fails.\n log_file=\"${RUNNER_TEMP}/holocron-output.log\"\n node \"$cli\" \"$@\" 2>&1 | tee \"$log_file\"\n exit_code=${PIPESTATUS[0]}\n echo \"log-file=$log_file\" >> \"$GITHUB_OUTPUT\"\n exit \"$exit_code\"\n";
|
|
266
|
+
var holocron_default = "name: Holocron\ndescription: >\n Run the Holocron CLI — `holocron run <task> [job]` by default, or any other\n subcommand via `command:` (`repo sync`, `sync github`, …). Resolves\n `@theholocron/cli` from `node_modules` (published tarball) or builds it from\n source when it resolves to an unbuilt workspace checkout (the holocron repo\n itself). Requires dependencies to be installed already (run the setup action\n first).\n\ninputs:\n command:\n description: >\n Holocron subcommand. Default `run` — then `task` (and optional `job`)\n name the manifest task. Set to `repo sync` / `sync github` / … to run that\n subcommand directly; `args` becomes everything after it.\n required: false\n default: run\n task:\n description: >\n Manifest task to run when command is run — typecheck, test, build, audit.\n required: false\n default: \"\"\n job:\n description: Optional sub-job within the task (e.g. knip, performance for audit).\n required: false\n default: \"\"\n affected:\n description: >\n For `command: run`, only run the packages changed since the PR base (or the\n merge-base with the default branch), plus their dependents: `--affected`.\n Needs a checkout with enough history to reach the base (`fetch-depth: 0`);\n without it holocron logs a warning and runs everything.\n required: false\n default: \"false\"\n args:\n description: >\n For `command: run`, extra arguments forwarded to the tool after `--`.\n For any other command, the arguments passed straight to it.\n required: false\n default: \"\"\n\noutputs:\n log-file:\n description: >\n Path to a file holding the full captured stdout+stderr of this\n invocation — the same text the live Actions log shows, saved for a\n caller that wants to ship it elsewhere (e.g. Sentinel's dispatched\n checks shipping it to Axiom, holocron#769/#794).\n value: ${{ steps.run.outputs.log-file }}\n\nruns:\n using: composite\n\n steps:\n - name: Build the workspace when the CLI resolves to an unbuilt checkout\n shell: bash\n # The holocron repo carries @theholocron/cli as `workspace:*`; its bin\n # (dist/cli.mjs) does not exist on a fresh checkout. `pnpm build` is a\n # turbo run — cached and cheap once warm. A no-op everywhere else, where\n # the published tarball already ships dist/.\n #\n # pnpm creates every workspace package's node_modules/.bin/holocron shim\n # once, during the setup action's earlier `pnpm install` — before this\n # build has run, so every one of them is silently skipped (\"Failed to\n # create bin ... ENOENT\"), not just @theholocron/cli's own. That's a\n # one-time decision: a later build doesn't retroactively fix a shim that\n # was never created. Re-running `pnpm install` here (fast — the lockfile\n # hasn't changed, so it only re-links `.bin`) is what actually fixes it,\n # confirmed against a real cold install: `holocron` stays unresolvable\n # from inside any package until this second install runs.\n run: |\n if [ ! -f node_modules/@theholocron/cli/dist/cli.mjs ]; then\n echo \"→ @theholocron/cli dist/ missing — building the workspace from source\" >&2\n pnpm build\n echo \"→ re-linking node_modules/.bin — pnpm skipped it pre-build\" >&2\n pnpm install --frozen-lockfile\n fi\n\n - name: holocron ${{ inputs.command }} ${{ inputs.task }}\n id: run\n shell: bash\n env:\n HOLOCRON_COMMAND: ${{ inputs.command }}\n HOLOCRON_TASK: ${{ inputs.task }}\n HOLOCRON_JOB: ${{ inputs.job }}\n HOLOCRON_ARGS: ${{ inputs.args }}\n HOLOCRON_AFFECTED: ${{ inputs.affected }}\n HOLOCRON_PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}\n HOLOCRON_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}\n run: |\n if [ \"$HOLOCRON_COMMAND\" = \"run\" ]; then\n set -- run \"$HOLOCRON_TASK\"\n [ -n \"$HOLOCRON_JOB\" ] && set -- \"$@\" \"$HOLOCRON_JOB\"\n if [ \"$HOLOCRON_AFFECTED\" = \"true\" ]; then\n # A pull request compares against its base commit. Any other trigger\n # (a push to a PR branch) compares against where the branch left the\n # default branch. If neither resolves, no --base is passed and holocron\n # runs everything.\n base=\"$HOLOCRON_PR_BASE_SHA\"\n if [ -z \"$base\" ] && [ -n \"$HOLOCRON_DEFAULT_BRANCH\" ]; then\n git fetch --no-tags --quiet origin \"$HOLOCRON_DEFAULT_BRANCH\" || true\n base=\"$(git merge-base HEAD \"origin/$HOLOCRON_DEFAULT_BRANCH\" 2>/dev/null || true)\"\n fi\n set -- \"$@\" --affected\n [ -n \"$base\" ] && set -- \"$@\" --base \"$base\"\n fi\n # shellcheck disable=SC2086\n [ -n \"$HOLOCRON_ARGS\" ] && set -- \"$@\" -- $HOLOCRON_ARGS\n else\n # `command` may be a multi-word path (`repo sync`, `deploy on-release`):\n # word-split it so each token is its own argument.\n # shellcheck disable=SC2086\n set -- $HOLOCRON_COMMAND $HOLOCRON_ARGS\n fi\n # Invoke the built entry directly. `pnpm exec holocron` relies on a\n # node_modules/.bin/holocron shim that pnpm does not create for a\n # workspace package whose dist/ was absent at install time (the holocron\n # repo itself). Resolving the package's main export gives dist/index.mjs;\n # the bin sits next to it as dist/cli.mjs. This is `require.resolve` from\n # node_modules — it works in the holocron monorepo AND in every consumer\n # repo (theholocron/holocron#655), unlike a hard-coded `cli/cli/…`.\n cli=\"$(dirname \"$(node -e 'process.stdout.write(require.resolve(\"@theholocron/cli\"))')\")/cli.mjs\"\n if [ ! -f \"$cli\" ]; then\n echo \"::error::@theholocron/cli entry not found at $cli — is the workspace built?\" >&2\n exit 1\n fi\n echo \"→ $cli $*\" >&2\n # `tee` keeps the live Actions log streaming exactly as before while\n # also capturing it to a file callers can ship elsewhere (log-file\n # output, above). PIPESTATUS[0] -- not $? -- is `node`'s own exit\n # code; $? after a pipe is tee's, which succeeds even when node fails.\n log_file=\"${RUNNER_TEMP}/holocron-output.log\"\n node \"$cli\" \"$@\" 2>&1 | tee \"$log_file\"\n exit_code=${PIPESTATUS[0]}\n echo \"log-file=$log_file\" >> \"$GITHUB_OUTPUT\"\n exit \"$exit_code\"\n";
|
|
267
267
|
// src/templates/reusable/actions/install.yml
|
|
268
268
|
var install_default = "name: Install dependencies\ndescription: Install project dependencies with pnpm frozen lockfile.\n\nruns:\n using: composite\n\n steps:\n - name: Install dependencies\n if: ${{ hashFiles('pnpm-lock.yaml') != '' }}\n shell: bash\n run: pnpm install --frozen-lockfile\n";
|
|
269
269
|
// src/templates/reusable/actions/notify.yml
|
|
270
270
|
var notify_default = "name: Notify\ndescription: >\n Post a message to a chat channel through an incoming webhook. The request\n body is Discord-compatible (`content`, `username`, `allowed_mentions`), so\n the webhook must accept that shape. Does nothing (and never fails the\n calling job) when no webhook is provided, so repos that haven't set one up\n are unaffected. Set `strict` for a check whose only purpose is to prove the\n notification works: it then fails when the webhook is missing or rejects the post.\n\ninputs:\n webhook:\n description: >\n Incoming webhook URL for the target channel.\n A webhook posts to exactly one channel, so pass the secret for the\n channel this message belongs in (for example\n `secrets.HOLOCRON_NOTIFY_WEBHOOK_ALERTS`). Empty = skip.\n required: false\n default: \"\"\n message:\n description: Message text. Truncated to 2000 characters.\n required: true\n mention:\n description: >\n Optional role id (digits only) to ping. Only that one role can\n be mentioned; anything else in the message never pings.\n required: false\n default: \"\"\n username:\n description: Display name for the post.\n required: false\n default: \"Holocron\"\n strict:\n description: >\n \"true\" fails the step when no webhook is set or the post is rejected.\n Off by default: a notification problem must never fail the job it reports on.\n required: false\n default: \"false\"\n\nruns:\n using: composite\n steps:\n - name: Post the notification\n shell: bash\n run: |\n if [ -z \"$WEBHOOK\" ]; then\n if [ \"$STRICT\" = \"true\" ]; then\n echo \"::error::No notification webhook set.\"\n exit 1\n fi\n echo \"::notice::No notification webhook set — skipping notification.\"\n exit 0\n fi\n echo \"::add-mask::$WEBHOOK\"\n # allowed_mentions.parse = [] so message text can never ping @everyone\n # or a role; only the explicit `mention` role id is allowed through. The\n # body is built with jq so quotes/newlines in the message can't break the JSON.\n content=\"$MESSAGE\"\n roles='[]'\n # A mention that is not a role id is dropped, which is right for a real\n # notification but would let a check pass without ever pinging anyone.\n if [ \"$STRICT\" = \"true\" ] && [ -n \"$MENTION\" ] && ! [[ \"$MENTION\" =~ ^[0-9]+$ ]]; then\n echo \"::error::The mention is not a role id (digits only).\"\n exit 1\n fi\n if [[ \"$MENTION\" =~ ^[0-9]+$ ]]; then\n content=\"<@&$MENTION> $MESSAGE\"\n roles=$(jq -cn --arg r \"$MENTION\" '[$r]')\n fi\n body=$(jq -n --arg content \"${content:0:2000}\" --arg username \"$USERNAME\" --argjson roles \"$roles\" \\\n '{content: $content, username: $username, allowed_mentions: {parse: [], roles: $roles}}')\n status=$(curl -sS -o /dev/null -w '%{http_code}' --max-time 15 \\\n -H 'Content-Type: application/json' -d \"$body\" \"$WEBHOOK\" || true)\n case \"${status:-000}\" in\n 2??) echo \"Notification posted.\" ;;\n *)\n if [ \"$STRICT\" = \"true\" ]; then\n echo \"::error::Notification failed (HTTP ${status:-000}).\"\n exit 1\n fi\n echo \"::warning::Notification failed (HTTP ${status:-000}).\"\n ;;\n esac\n env:\n WEBHOOK: ${{ inputs.webhook }}\n MESSAGE: ${{ inputs.message }}\n MENTION: ${{ inputs.mention }}\n USERNAME: ${{ inputs.username }}\n STRICT: ${{ inputs.strict }}\n";
|
|
271
271
|
// src/templates/reusable/actions/setup.yml
|
|
272
|
-
var setup_default = "name: Setup\ndescription: Prepare the environment and install project dependencies.\n\ninputs:\n node-version:\n description: Node.js version\n required: false\n default: \"22.x\"\n\nruns:\n using: composite\n\n steps:\n - uses: theholocron/.github/.github/actions/setup-node@main\n with:\n node-version: ${{ inputs.node-version }}\n\n - uses: theholocron/.github/.github/actions/install@main\n\n # `@theholocron/cli`'s `dist/cli.mjs` doesn't exist yet at this point, so\n # pnpm's workspace bin-linking can't create `node_modules/.bin/holocron`\n # (silent `WARN ... ENOENT`, not a hard failure). Every package whose\n # scripts delegate via `holocron run <task> --` then fails at run time\n # with `holocron: not found` (#698). Same fix the `holocron` composite\n # action already applies for its own direct invocation (see its \"Build\n # the workspace when the CLI resolves to an unbuilt checkout\" step) —\n # mirrored here so it also covers *nested* `holocron run <task> --`\n # calls from inside package.json scripts, which that action's own guard\n # doesn't reach. `pnpm build` (not a scoped `--filter`) so the CLI's own\n # workspace dependencies (e.g. astromech) build\n # in topological order too — a scoped build skips them and fails.\n # No-op in every consumer repo, where the published tarball already\n # ships `dist/`.\n - name: Build the Holocron CLI\n shell: bash\n run: |\n if [ ! -f node_modules/@theholocron/cli/dist/cli.mjs ]; then\n echo \"→ @theholocron/cli dist/ missing — building the workspace from source\" >&2\n pnpm build\n echo \"→ re-linking node_modules/.bin — pnpm skipped it pre-build\" >&2\n pnpm install --frozen-lockfile\n fi\n\n
|
|
272
|
+
var setup_default = "name: Setup\ndescription: Prepare the environment and install project dependencies.\n\ninputs:\n node-version:\n description: Node.js version\n required: false\n default: \"22.x\"\n\nruns:\n using: composite\n\n steps:\n - uses: theholocron/.github/.github/actions/setup-node@main\n with:\n node-version: ${{ inputs.node-version }}\n\n - uses: theholocron/.github/.github/actions/install@main\n\n # Restored before the bootstrap build below so `pnpm build` replays from the cache instead of running cold.\n - name: Cache Turbo artifacts\n if: ${{ hashFiles('turbo.json') != '' }}\n uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0\n with:\n path: .turbo\n key: turbo-${{ runner.os }}-${{ github.sha }}\n restore-keys: |\n turbo-${{ runner.os }}-\n\n # `@theholocron/cli`'s `dist/cli.mjs` doesn't exist yet at this point, so\n # pnpm's workspace bin-linking can't create `node_modules/.bin/holocron`\n # (silent `WARN ... ENOENT`, not a hard failure). Every package whose\n # scripts delegate via `holocron run <task> --` then fails at run time\n # with `holocron: not found` (#698). Same fix the `holocron` composite\n # action already applies for its own direct invocation (see its \"Build\n # the workspace when the CLI resolves to an unbuilt checkout\" step) —\n # mirrored here so it also covers *nested* `holocron run <task> --`\n # calls from inside package.json scripts, which that action's own guard\n # doesn't reach. `pnpm build` (not a scoped `--filter`) so the CLI's own\n # workspace dependencies (e.g. astromech) build\n # in topological order too — a scoped build skips them and fails.\n # No-op in every consumer repo, where the published tarball already\n # ships `dist/`.\n - name: Build the Holocron CLI\n shell: bash\n run: |\n if [ ! -f node_modules/@theholocron/cli/dist/cli.mjs ]; then\n echo \"→ @theholocron/cli dist/ missing — building the workspace from source\" >&2\n pnpm build\n echo \"→ re-linking node_modules/.bin — pnpm skipped it pre-build\" >&2\n pnpm install --frozen-lockfile\n fi\n\n # A Turbo token with no team turns the remote cache off without a word: every task just runs cold. `TURBO_TEAM` is\n # an organization variable that `holocron repo setup` writes from `repo.variables.org.TURBO_TEAM` in\n # holocron.config.ts. Quiet when there is no token, because then the cache is meant to be off.\n - name: Warn when the Turbo remote cache is off\n if: ${{ hashFiles('turbo.json') != '' }}\n shell: bash\n run: |\n if [ -n \"$TURBO_TOKEN\" ] && [ -z \"$TURBO_TEAM\" ]; then\n echo \"::warning title=Turbo remote cache is off::TURBO_TOKEN is set but TURBO_TEAM is not. Declare it under repo.variables.org in holocron.config.ts and run holocron repo setup.\"\n fi\n";
|
|
273
273
|
// src/templates/reusable/actions/setup-node.yml
|
|
274
274
|
var setup_node_default = "name: Setup Node\ndescription: Install pnpm and Node.js with pnpm dependency caching.\n\ninputs:\n node-version:\n description: Node.js version\n required: false\n default: \"22.x\"\nruns:\n using: composite\n\n steps:\n - name: Setup pnpm\n if: ${{ hashFiles('pnpm-lock.yaml') != '' }}\n uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4\n\n - name: Setup Node.js\n uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0\n with:\n node-version: ${{ hashFiles('.node-version') != '' && '' || inputs.node-version }}\n node-version-file: ${{ hashFiles('.node-version') != '' && '.node-version' || '' }}\n cache: ${{ hashFiles('pnpm-lock.yaml') != '' && 'pnpm' || '' }}\n # Do NOT add registry-url here. setup-node writes .npmrc with\n # _authToken=${NODE_AUTH_TOKEN} and sets NPM_CONFIG_USERCONFIG to it.\n # pnpm reads that file, fails env-var substitution when the token is\n # empty, and loses auth entirely. Without registry-url, pnpm 10.15+\n # handles Trusted Publishing via its own native OIDC exchange.\n\n - name: Add node_modules/.bin to PATH\n shell: bash\n run: echo \"$GITHUB_WORKSPACE/node_modules/.bin\" >> $GITHUB_PATH\n";
|
|
275
275
|
// src/templates/reusable/bookkeeping.yml
|
|
276
276
|
var bookkeeping_default$1 = "name: Bookkeeping\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n configuration-path:\n description: Path to the labeler configuration file in the calling repo\n type: string\n required: false\n default: .github/labeler.yml\n\njobs:\n label:\n name: Apply Labels\n permissions:\n contents: read\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 5\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n with:\n sparse-checkout: ${{ inputs.configuration-path || '.github/labeler.yml' }}\n sparse-checkout-cone-mode: false\n\n - uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4\n if: ${{ github.event_name == 'pull_request' && hashFiles(inputs.configuration-path || '.github/labeler.yml') != '' }}\n # v3.4 bundles Node 20; allow it to run under Actions' current default.\n env:\n ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true\n with:\n # Fall back to default path when triggered directly (not via workflow_call)\n # because inputs.* defaults only apply on workflow_call events.\n configuration-path: ${{ inputs.configuration-path || '.github/labeler.yml' }}\n include-title: 1\n include-body: 0\n sync-labels: 1\n enable-versioned-regex: 0\n repo-token: ${{ github.token }}\n";
|
|
277
277
|
// src/templates/reusable/delivery.build.yml
|
|
278
|
-
var delivery_build_default$1 = "name: Build\n\n# Sanity check that every workspace actually compiles to dist/ — doesn't\n# upload or publish anything. delivery.publish builds again before\n# publishing; this just answers \"does it build?\" on every push/PR.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n TURBO_TOKEN:\n required: false\n\njobs:\n build:\n name: Build every workspace\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Build\n with:\n task: delivery.build\n";
|
|
278
|
+
var delivery_build_default$1 = "name: Build\n\n# Sanity check that every workspace actually compiles to dist/ — doesn't\n# upload or publish anything. delivery.publish builds again before\n# publishing; this just answers \"does it build?\" on every push/PR.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n affected:\n description: Run only the packages changed since the PR base, plus their dependents (turbo --affected). Needs a turbo.json; checks out full history. Other repos keep today's behaviour while this is false.\n type: boolean\n required: false\n default: false\n secrets:\n TURBO_TOKEN:\n required: false\n\njobs:\n build:\n name: Build every workspace\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n # --affected needs the base commit, which a depth-1 checkout does not have.\n fetch-depth: ${{ inputs.affected && '0' || '1' }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Build\n with:\n task: delivery.build\n affected: ${{ inputs.affected }}\n";
|
|
279
279
|
// src/templates/reusable/delivery.bundleSize.yml
|
|
280
280
|
var delivery_bundleSize_default$1 = "name: Audit the Bundle Size\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n CODECOV_TOKEN:\n required: false\n TURBO_TOKEN:\n required: false\n\njobs:\n bundle-size:\n name: Upload bundle stats to Codecov\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n # Read by the bundle-stats uploader inside `holocron run delivery.build`.\n CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Build and upload bundle stats\n with:\n task: delivery.build\n";
|
|
281
281
|
// src/templates/reusable/delivery.deploy.yml
|
|
@@ -331,9 +331,9 @@ var tag_default = "name: Tag\n\n# Release Please — fully automated tag and Git
|
|
|
331
331
|
// src/templates/reusable/verification.performance.yml
|
|
332
332
|
var verification_performance_default$1 = "name: Audit the Performance\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n lighthouse-config:\n description: >\n Path to the Lighthouse CI config file, forwarded to `holocron run\n verification.performance -- --config`. Defaults to\n lighthouse.config.cjs (the org standard).\n type: string\n required: false\n default: lighthouse.config.cjs\n secrets:\n LHCI_GITHUB_APP_TOKEN:\n required: false\n TURBO_TOKEN:\n required: false\n\njobs:\n performance:\n name: Run Lighthouse CI\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n # Read by `lhci autorun` inside `holocron run verification.performance`.\n LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: npm install -g @lhci/cli@0.14.x\n name: Install Lighthouse CLI\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Run Lighthouse CI\n with:\n task: verification.performance\n args: --config=${{ inputs.lighthouse-config }}\n";
|
|
333
333
|
// src/templates/reusable/verification.typeSafety.yml
|
|
334
|
-
var verification_typeSafety_default$1 = "name: Typecheck\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n TURBO_TOKEN:\n required: false\n\njobs:\n typecheck:\n name: Run tsc --noEmit\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Type check\n with:\n task: verification.typeSafety\n";
|
|
334
|
+
var verification_typeSafety_default$1 = "name: Typecheck\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n affected:\n description: Run only the packages changed since the PR base, plus their dependents (turbo --affected). Needs a turbo.json; checks out full history. Other repos keep today's behaviour while this is false.\n type: boolean\n required: false\n default: false\n secrets:\n TURBO_TOKEN:\n required: false\n\njobs:\n typecheck:\n name: Run tsc --noEmit\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n # --affected needs the base commit, which a depth-1 checkout does not have.\n fetch-depth: ${{ inputs.affected && '0' || '1' }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Type check\n with:\n task: verification.typeSafety\n affected: ${{ inputs.affected }}\n";
|
|
335
335
|
// src/templates/reusable/verification.unitTests.yml
|
|
336
|
-
var verification_unitTests_default$1 = "name: Test\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n run-unit:\n description: Run unit tests with coverage (disable for UI-only repos that use Storybook testing exclusively)\n type: boolean\n required: false\n default: true\n run-storybook:\n description: Run Storybook vitest interaction tests (requires .storybook/ setup)\n type: boolean\n required: false\n default: false\n run-interaction:\n description: Run Storybook interaction and accessibility tests with Playwright\n type: boolean\n required: false\n default: false\n run-user-flow:\n description: Run Cypress E2E user-flow tests (requires cypress.config.*)\n type: boolean\n required: false\n default: false\n wait-on-url:\n description: URL to wait for before running Cypress tests (default is Vite dev server; override for non-Vite stacks e.g. http://localhost:3000 for Next.js)\n type: string\n required: false\n default: \"http://localhost:5173\"\n secrets:\n CYPRESS_RECORD_KEY:\n required: false\n TURBO_TOKEN:\n required: false\n\njobs:\n unit:\n name: Run unit tests and collect coverage\n if: ${{ inputs.run-unit }}\n permissions:\n contents: read\n id-token: write\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Run tests with coverage\n with:\n task: verification.unitTests\n\n # A Codecov upload must not fail silently. fail_ci_if_error makes a failed\n # upload fail this step (the action's default is to log the error and pass),\n # which fails the job and so the `Test / Conclusion` check. Whether that\n # blocks a merge is up to whether the check is required, not this workflow\n # (holocron#934).\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload coverage to Codecov\n with:\n use_oidc: true\n fail_ci_if_error: true\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload test results to Codecov\n if: ${{ !cancelled() }}\n with:\n use_oidc: true\n fail_ci_if_error: true\n report_type: test_results\n files: \"**/test-report.junit.xml\"\n\n storybook:\n name: Run Storybook interaction tests\n if: ${{ inputs.run-storybook }}\n permissions:\n contents: read\n id-token: write\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm exec playwright install chromium --with-deps\n name: Install Playwright\n\n - run: pnpm test:storybook\n name: Run Storybook tests\n\n # A Codecov upload must not fail silently. fail_ci_if_error makes a failed\n # upload fail this step (the action's default is to log the error and pass),\n # which fails the job and so the `Test / Conclusion` check. Whether that\n # blocks a merge is up to whether the check is required, not this workflow\n # (holocron#934).\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload coverage to Codecov\n with:\n use_oidc: true\n fail_ci_if_error: true\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload test results to Codecov\n if: ${{ !cancelled() }}\n with:\n use_oidc: true\n fail_ci_if_error: true\n report_type: test_results\n files: \"**/test-report.junit.xml\"\n\n interaction-and-accessibility:\n name: Run interactions and accessibility tests\n if: ${{ inputs.run-interaction }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm exec playwright install --with-deps\n name: Install Playwright\n\n - run: pnpm test:storybook\n name: Run interaction and accessibility tests\n\n user-flow:\n name: Run user flow tests\n if: ${{ inputs.run-user-flow }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n strategy:\n fail-fast: false\n matrix:\n containers: [1, 2]\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm exec cypress install\n name: Install Cypress binary\n\n - uses: cypress-io/github-action@1052aa98bbbe4f55210f844878213c07d9c8c399 # v6.7.13\n name: Cypress run\n with:\n start: pnpm dev\n wait-on: ${{ inputs.wait-on-url }}\n record: true\n parallel: true\n env:\n CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n conclusion:\n name: Conclusion\n runs-on: ubuntu-latest\n if: always()\n needs: [unit, storybook, interaction-and-accessibility, user-flow]\n steps:\n - name: Check job statuses\n run: |\n if [[ \"$RESULTS\" == *\"failure\"* ]] || [[ \"$RESULTS\" == *\"cancelled\"* ]]; then\n exit 1\n fi\n env:\n RESULTS: ${{ join(needs.*.result, ',') }}\n";
|
|
336
|
+
var verification_unitTests_default$1 = "name: Test\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n affected:\n description: Run only the packages changed since the PR base, plus their dependents (turbo --affected). Needs a turbo.json; checks out full history. Other repos keep today's behaviour while this is false.\n type: boolean\n required: false\n default: false\n run-unit:\n description: Run unit tests with coverage (disable for UI-only repos that use Storybook testing exclusively)\n type: boolean\n required: false\n default: true\n run-storybook:\n description: Run Storybook vitest interaction tests (requires .storybook/ setup)\n type: boolean\n required: false\n default: false\n run-interaction:\n description: Run Storybook interaction and accessibility tests with Playwright\n type: boolean\n required: false\n default: false\n run-user-flow:\n description: Run Cypress E2E user-flow tests (requires cypress.config.*)\n type: boolean\n required: false\n default: false\n wait-on-url:\n description: URL to wait for before running Cypress tests (default is Vite dev server; override for non-Vite stacks e.g. http://localhost:3000 for Next.js)\n type: string\n required: false\n default: \"http://localhost:5173\"\n secrets:\n CYPRESS_RECORD_KEY:\n required: false\n TURBO_TOKEN:\n required: false\n\njobs:\n unit:\n name: Run unit tests and collect coverage\n if: ${{ inputs.run-unit }}\n permissions:\n contents: read\n id-token: write\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n # --affected needs the base commit, which a depth-1 checkout does not have.\n fetch-depth: ${{ inputs.affected && '0' || '1' }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Run tests with coverage\n with:\n task: verification.unitTests\n affected: ${{ inputs.affected }}\n\n # With `affected`, a run that selects nothing (a README-only PR) writes no coverage. The two\n # required Codecov statuses still have to post, so say so with an empty upload instead of\n # failing the upload. Without `affected` a missing report stays an error.\n - id: reports\n name: Look for coverage and test reports\n if: ${{ inputs.affected }}\n shell: bash\n run: |\n # find, not hashFiles('**/…'): hashFiles walks node_modules and can time out in a large workspace.\n has() { [ -n \"$(find . -path ./node_modules -prune -o -path '*/node_modules' -prune -o -name \"$1\" -print -quit)\" ]; }\n has lcov.info && echo \"coverage=true\" >> \"$GITHUB_OUTPUT\" || echo \"coverage=false\" >> \"$GITHUB_OUTPUT\"\n has test-report.junit.xml && echo \"tests=true\" >> \"$GITHUB_OUTPUT\" || echo \"tests=false\" >> \"$GITHUB_OUTPUT\"\n\n # A Codecov upload must not fail silently. fail_ci_if_error makes a failed\n # upload fail this step (the action's default is to log the error and pass),\n # which fails the job and so the `Test / Conclusion` check. Whether that\n # blocks a merge is up to whether the check is required, not this workflow\n # (holocron#934).\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload coverage to Codecov\n if: ${{ !inputs.affected || steps.reports.outputs.coverage == 'true' }}\n with:\n use_oidc: true\n fail_ci_if_error: true\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload test results to Codecov\n if: ${{ !cancelled() && (!inputs.affected || steps.reports.outputs.tests == 'true') }}\n with:\n use_oidc: true\n fail_ci_if_error: true\n report_type: test_results\n files: \"**/test-report.junit.xml\"\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Post the Codecov statuses without a report\n if: ${{ inputs.affected && steps.reports.outputs.coverage != 'true' }}\n with:\n use_oidc: true\n fail_ci_if_error: true\n run_command: empty-upload\n\n storybook:\n name: Run Storybook interaction tests\n if: ${{ inputs.run-storybook }}\n permissions:\n contents: read\n id-token: write\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm exec playwright install chromium --with-deps\n name: Install Playwright\n\n - run: pnpm test:storybook\n name: Run Storybook tests\n\n # A Codecov upload must not fail silently. fail_ci_if_error makes a failed\n # upload fail this step (the action's default is to log the error and pass),\n # which fails the job and so the `Test / Conclusion` check. Whether that\n # blocks a merge is up to whether the check is required, not this workflow\n # (holocron#934).\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload coverage to Codecov\n with:\n use_oidc: true\n fail_ci_if_error: true\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload test results to Codecov\n if: ${{ !cancelled() }}\n with:\n use_oidc: true\n fail_ci_if_error: true\n report_type: test_results\n files: \"**/test-report.junit.xml\"\n\n interaction-and-accessibility:\n name: Run interactions and accessibility tests\n if: ${{ inputs.run-interaction }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm exec playwright install --with-deps\n name: Install Playwright\n\n - run: pnpm test:storybook\n name: Run interaction and accessibility tests\n\n user-flow:\n name: Run user flow tests\n if: ${{ inputs.run-user-flow }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n strategy:\n fail-fast: false\n matrix:\n containers: [1, 2]\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - run: pnpm exec cypress install\n name: Install Cypress binary\n\n - uses: cypress-io/github-action@1052aa98bbbe4f55210f844878213c07d9c8c399 # v6.7.13\n name: Cypress run\n with:\n start: pnpm dev\n wait-on: ${{ inputs.wait-on-url }}\n record: true\n parallel: true\n env:\n CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}\n GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n conclusion:\n name: Conclusion\n runs-on: ubuntu-latest\n if: always()\n needs: [unit, storybook, interaction-and-accessibility, user-flow]\n steps:\n - name: Check job statuses\n run: |\n if [[ \"$RESULTS\" == *\"failure\"* ]] || [[ \"$RESULTS\" == *\"cancelled\"* ]]; then\n exit 1\n fi\n env:\n RESULTS: ${{ join(needs.*.result, ',') }}\n";
|
|
337
337
|
// src/templates/reusable/verification.visualRegression.yml
|
|
338
338
|
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";
|
|
339
339
|
// src/templates/workflows/bookkeeping.yml
|
|
@@ -1016,9 +1016,13 @@ const TASKS = {
|
|
|
1016
1016
|
turbo: {
|
|
1017
1017
|
inputs: [
|
|
1018
1018
|
"src/**",
|
|
1019
|
+
"test/**",
|
|
1019
1020
|
"vitest.config.ts",
|
|
1020
1021
|
"vitest.config.js",
|
|
1021
1022
|
"vitest.config.mjs",
|
|
1023
|
+
"$TURBO_ROOT$/vitest.config.ts",
|
|
1024
|
+
"$TURBO_ROOT$/vitest.config.js",
|
|
1025
|
+
"$TURBO_ROOT$/vitest.config.mjs",
|
|
1022
1026
|
"package.json"
|
|
1023
1027
|
],
|
|
1024
1028
|
outputs: ["test-report.junit.xml", "coverage/**"],
|
|
@@ -1031,7 +1035,11 @@ const TASKS = {
|
|
|
1031
1035
|
args: ["--noEmit"]
|
|
1032
1036
|
},
|
|
1033
1037
|
turbo: {
|
|
1034
|
-
inputs: [
|
|
1038
|
+
inputs: [
|
|
1039
|
+
"src/**",
|
|
1040
|
+
"test/**",
|
|
1041
|
+
"tsconfig.json"
|
|
1042
|
+
],
|
|
1035
1043
|
outputs: [],
|
|
1036
1044
|
dependsOn: ["^delivery.build"]
|
|
1037
1045
|
}
|
|
@@ -1295,6 +1303,143 @@ function createTsconfig(options) {
|
|
|
1295
1303
|
};
|
|
1296
1304
|
return stringifyJson(config);
|
|
1297
1305
|
}
|
|
1306
|
+
// src/utils/create-header/create-header.ts
|
|
1307
|
+
/**
|
|
1308
|
+
* Factory that binds `source` and `tool` once and returns all header
|
|
1309
|
+
* constructors for auto-generated files. Prefer this over passing source
|
|
1310
|
+
* as a positional argument at every call site.
|
|
1311
|
+
*
|
|
1312
|
+
* @example
|
|
1313
|
+
* const { workflowHeader, scaffoldHeader } = createHeader({
|
|
1314
|
+
* source: "cli/astromech/src/templates/configs/editorconfig/create-config.ts",
|
|
1315
|
+
* });
|
|
1316
|
+
*
|
|
1317
|
+
* export function createConfig(): string {
|
|
1318
|
+
* return `${workflowHeader()}${body}`;
|
|
1319
|
+
* }
|
|
1320
|
+
*
|
|
1321
|
+
* ## Which header to use
|
|
1322
|
+
*
|
|
1323
|
+
* | Function | When to use | User can edit? |
|
|
1324
|
+
* |-------------------|----------------------------------------------------|----------------|
|
|
1325
|
+
* | `workflowHeader` | Files overwritten on every setup / sync-github run | No — "AUTO-GENERATED — do not edit" |
|
|
1326
|
+
* | `scaffoldHeader` | Files written once; user takes ownership after | Yes — "Scaffolded — edit this file freely" |
|
|
1327
|
+
*
|
|
1328
|
+
* ## `workflowHeader` formats
|
|
1329
|
+
*
|
|
1330
|
+
* | Format | Comment style | Used for |
|
|
1331
|
+
* |---------------------|------------------------|-------------------------------------------------------|
|
|
1332
|
+
* | `"yaml"` (default) | `# …` lines | YAML workflows, ignore files, `.editorconfig`, labeler|
|
|
1333
|
+
* | `"cjs"` | `/* … *\/` block | CommonJS config files (`.cjs`) |
|
|
1334
|
+
* | `"shebang"` | `#!/bin/sh` + `# …` | Shell scripts (`prepare-commit-msg`, hooks) |
|
|
1335
|
+
*/
|
|
1336
|
+
function createHeader(options) {
|
|
1337
|
+
const { source, tool = "holocron repo setup", forPrimary = false } = options;
|
|
1338
|
+
const doNotEdit = forPrimary ? `AUTO-GENERATED — do not edit in theholocron/.github directly.` : `AUTO-GENERATED — do not edit directly.`;
|
|
1339
|
+
return {
|
|
1340
|
+
workflowHeader(format = "yaml") {
|
|
1341
|
+
if (format === "cjs") return [
|
|
1342
|
+
`/* ${doNotEdit}`,
|
|
1343
|
+
` * Source: theholocron/holocron · ${source}`,
|
|
1344
|
+
` * Tool: ${tool}`,
|
|
1345
|
+
` * Changes: edit source in theholocron/holocron`,
|
|
1346
|
+
` */`,
|
|
1347
|
+
``
|
|
1348
|
+
].join("\n");
|
|
1349
|
+
const yamlLines = [
|
|
1350
|
+
`# ${doNotEdit}`,
|
|
1351
|
+
`# Source: theholocron/holocron · ${source}`,
|
|
1352
|
+
`# Tool: ${tool}`,
|
|
1353
|
+
`# Changes: edit source in theholocron/holocron`,
|
|
1354
|
+
``
|
|
1355
|
+
].join("\n");
|
|
1356
|
+
if (format === "shebang") return `#!/bin/sh\n\n${yamlLines}`;
|
|
1357
|
+
return yamlLines;
|
|
1358
|
+
},
|
|
1359
|
+
scaffoldHeader() {
|
|
1360
|
+
return [
|
|
1361
|
+
`# Scaffolded by holocron repo setup — edit this file freely.`,
|
|
1362
|
+
`# Source: theholocron/holocron · ${source}`,
|
|
1363
|
+
``
|
|
1364
|
+
].join("\n");
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
// src/utils/default-list-dirs/default-list-dirs.ts
|
|
1369
|
+
const defaultListDirs = (path) => readdirSync(path, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
1370
|
+
// src/utils/default-read-json/default-read-json.ts
|
|
1371
|
+
const defaultReadJson = (path) => JSON.parse(readFileSync(path, "utf8"));
|
|
1372
|
+
// src/utils/default-run/default-run.ts
|
|
1373
|
+
const defaultRun = (command, args, opts) => spawnSync(command, args, {
|
|
1374
|
+
encoding: "utf8",
|
|
1375
|
+
...opts
|
|
1376
|
+
});
|
|
1377
|
+
// src/utils/default-sleep/default-sleep.ts
|
|
1378
|
+
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
1379
|
+
// src/utils/exec/exec.ts
|
|
1380
|
+
/** Runs `cmd` with the parent's stdio; a signal-killed or unspawnable process reports `-1`. */
|
|
1381
|
+
const realExec = (cmd, args, opts) => {
|
|
1382
|
+
return { exitCode: spawnSync(cmd, args, {
|
|
1383
|
+
cwd: opts.cwd,
|
|
1384
|
+
stdio: "inherit",
|
|
1385
|
+
...opts.env ? { env: {
|
|
1386
|
+
...process.env,
|
|
1387
|
+
...opts.env
|
|
1388
|
+
} } : {}
|
|
1389
|
+
}).status ?? -1 };
|
|
1390
|
+
};
|
|
1391
|
+
// src/utils/format-json/format-json.ts
|
|
1392
|
+
/** Prettier's default for a JSON file under this repo's config (`printWidth: 120`, 2-space indent). */
|
|
1393
|
+
const PRINT_WIDTH = 120;
|
|
1394
|
+
const INDENT = " ";
|
|
1395
|
+
const pad = (depth) => INDENT.repeat(depth);
|
|
1396
|
+
const isPlain = (value) => value === null || typeof value !== "object";
|
|
1397
|
+
/**
|
|
1398
|
+
* `column` is how many characters are already on the line before `value`, and `comma` is 1 when a `,` follows it:
|
|
1399
|
+
* Prettier counts both when it decides whether an array fits on its line.
|
|
1400
|
+
*/
|
|
1401
|
+
function render(value, depth, column, comma) {
|
|
1402
|
+
if (isPlain(value)) return JSON.stringify(value);
|
|
1403
|
+
if (Array.isArray(value)) {
|
|
1404
|
+
if (value.length === 0) return "[]";
|
|
1405
|
+
if (value.every(isPlain)) {
|
|
1406
|
+
const oneLine = `[${value.map((item) => JSON.stringify(item)).join(", ")}]`;
|
|
1407
|
+
if (column + oneLine.length + comma <= PRINT_WIDTH) return oneLine;
|
|
1408
|
+
}
|
|
1409
|
+
return `[\n${value.map((item, i) => {
|
|
1410
|
+
const last = i === value.length - 1;
|
|
1411
|
+
return `${pad(depth + 1)}${render(item, depth + 1, (depth + 1) * 2, last ? 0 : 1)}`;
|
|
1412
|
+
}).join(",\n")}\n${pad(depth)}]`;
|
|
1413
|
+
}
|
|
1414
|
+
const entries = Object.entries(value);
|
|
1415
|
+
if (entries.length === 0) return "{}";
|
|
1416
|
+
return `{\n${entries.map(([key, member], i) => {
|
|
1417
|
+
const prefix = `${pad(depth + 1)}${JSON.stringify(key)}: `;
|
|
1418
|
+
return `${prefix}${render(member, depth + 1, prefix.length, i === entries.length - 1 ? 0 : 1)}`;
|
|
1419
|
+
}).join(",\n")}\n${pad(depth)}}`;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* `value` as JSON laid out the way this repo's Prettier lays out a `.json` file, so a file a generator writes is
|
|
1423
|
+
* already what the formatting check expects and a re-run does not change it. Objects are always expanded, one key
|
|
1424
|
+
* per line; an array of plain values stays on one line when it fits in 120 columns and goes one value per line when
|
|
1425
|
+
* it does not (what Prettier does for strings). Ends in a single newline.
|
|
1426
|
+
*
|
|
1427
|
+
* `JSON.stringify` rules apply first: `undefined`, functions and symbols are dropped from objects.
|
|
1428
|
+
*/
|
|
1429
|
+
function formatJson(value) {
|
|
1430
|
+
const text = JSON.stringify(value);
|
|
1431
|
+
if (text === void 0) throw new TypeError("Cannot format a value that has no JSON representation");
|
|
1432
|
+
return `${render(JSON.parse(text), 0, 0, 0)}\n`;
|
|
1433
|
+
}
|
|
1434
|
+
// src/utils/look-path/look-path.ts
|
|
1435
|
+
/** `node_modules/.bin/<bin>`, else the first `PATH` entry that has it, else `null`. */
|
|
1436
|
+
const realLookPath = (cwd, bin) => findExecutableSync(bin, { path: join(cwd, "node_modules", ".bin") }) ?? findExecutableSync(bin) ?? null;
|
|
1437
|
+
// src/utils/noop-logger/noop-logger.ts
|
|
1438
|
+
/** The `RunLogger` used when the caller injects none: drops every record. */
|
|
1439
|
+
const noopLogger = {
|
|
1440
|
+
debug() {},
|
|
1441
|
+
warn() {}
|
|
1442
|
+
};
|
|
1298
1443
|
// src/generators/turbo/turbo.ts
|
|
1299
1444
|
/**
|
|
1300
1445
|
* `turboConfig(config)` — the generated `turbo.json` for a repo's task
|
|
@@ -1316,8 +1461,20 @@ function createTsconfig(options) {
|
|
|
1316
1461
|
* for a package whose layout the registry default doesn't cover (e.g. a
|
|
1317
1462
|
* flat-layout package with no `src/` directory at all).
|
|
1318
1463
|
*/
|
|
1319
|
-
/**
|
|
1320
|
-
|
|
1464
|
+
/**
|
|
1465
|
+
* Filed once per repo, unconditionally — every generated turbo.json's root. A change to any of these
|
|
1466
|
+
* selects every package under `--affected`.
|
|
1467
|
+
*
|
|
1468
|
+
* `holocron.config.*` and `astromech.config.*` define the tasks themselves. The lockfile is deliberately
|
|
1469
|
+
* not here: turbo already compares it per package, so a dependency bump only invalidates the packages
|
|
1470
|
+
* whose resolved dependencies changed. Workflow files are not here either, so a CI tweak is not a full run.
|
|
1471
|
+
*/
|
|
1472
|
+
const GLOBAL_DEPENDENCIES = [
|
|
1473
|
+
"pnpm-workspace.yaml",
|
|
1474
|
+
"tsconfig.json",
|
|
1475
|
+
"holocron.config.*",
|
|
1476
|
+
"astromech.config.*"
|
|
1477
|
+
];
|
|
1321
1478
|
/**
|
|
1322
1479
|
* Guards against a malformed `turbo.inputs`/`turbo.passThroughEnv` override
|
|
1323
1480
|
* (review on holocron#845): a bare string instead of an array would
|
|
@@ -1349,17 +1506,20 @@ function turboConfig(config) {
|
|
|
1349
1506
|
if (!turbo) continue;
|
|
1350
1507
|
const extraEnv = validatedGlobList(entry.turbo?.passThroughEnv, entry.name, "passThroughEnv");
|
|
1351
1508
|
const extraInputs = validatedGlobList(entry.turbo?.inputs, entry.name, "inputs");
|
|
1509
|
+
const extraDependsOn = validatedGlobList(entry.turbo?.dependsOn, entry.name, "dependsOn");
|
|
1352
1510
|
const current = tasks[entry.name] ?? turbo;
|
|
1353
1511
|
const passThroughEnv = extraEnv.length > 0 ? [...current.passThroughEnv ?? [], ...extraEnv] : current.passThroughEnv;
|
|
1354
1512
|
const inputs = extraInputs.length > 0 ? [...current.inputs, ...extraInputs] : current.inputs;
|
|
1513
|
+
const dependsOn = [.../* @__PURE__ */ new Set([...current.dependsOn, ...extraDependsOn])];
|
|
1355
1514
|
tasks[entry.name] = {
|
|
1356
1515
|
...turbo,
|
|
1357
1516
|
inputs,
|
|
1517
|
+
dependsOn,
|
|
1358
1518
|
...passThroughEnv && passThroughEnv.length > 0 ? { passThroughEnv } : {}
|
|
1359
1519
|
};
|
|
1360
1520
|
}
|
|
1361
1521
|
if (Object.keys(tasks).length === 0) return null;
|
|
1362
|
-
return
|
|
1522
|
+
return formatJson({
|
|
1363
1523
|
$schema: "https://turborepo.org/schema.json",
|
|
1364
1524
|
globalDependencies: GLOBAL_DEPENDENCIES,
|
|
1365
1525
|
tasks
|
|
@@ -1661,6 +1821,42 @@ function resolveLinters(opts) {
|
|
|
1661
1821
|
def: LINTERS[name]
|
|
1662
1822
|
}));
|
|
1663
1823
|
}
|
|
1824
|
+
// src/tasks/run/resolve-affected/resolve-affected.ts
|
|
1825
|
+
/** Branches that releases are cut from: on a push to one, HEAD equals the base, so nothing would be "affected". */
|
|
1826
|
+
const RELEASE_BRANCHES = /* @__PURE__ */ new Set(["main", "alpha"]);
|
|
1827
|
+
/**
|
|
1828
|
+
* Decide whether `turbo run` gets `--affected`, and against which base.
|
|
1829
|
+
*
|
|
1830
|
+
* `--affected` is dropped (everything runs, the safe direction) on a push to a
|
|
1831
|
+
* release branch, and when the base ref is missing or not in this checkout —
|
|
1832
|
+
* raw turbo would error on that, a shallow CI clone must not.
|
|
1833
|
+
*/
|
|
1834
|
+
function resolveAffected(input) {
|
|
1835
|
+
if (!input.affected) return { affected: false };
|
|
1836
|
+
const { env, exec, cwd } = input;
|
|
1837
|
+
const branch = env.GITHUB_REF_NAME;
|
|
1838
|
+
if (env.GITHUB_EVENT_NAME === "push" && branch !== void 0 && RELEASE_BRANCHES.has(branch)) return {
|
|
1839
|
+
affected: false,
|
|
1840
|
+
notice: `--affected ignored on a push to ${branch}: running everything`
|
|
1841
|
+
};
|
|
1842
|
+
const base = input.base ?? env.TURBO_SCM_BASE;
|
|
1843
|
+
if (!base) return {
|
|
1844
|
+
affected: false,
|
|
1845
|
+
notice: "--affected ignored: no base given (--base or TURBO_SCM_BASE); running everything"
|
|
1846
|
+
};
|
|
1847
|
+
if (exec("git", [
|
|
1848
|
+
"cat-file",
|
|
1849
|
+
"-e",
|
|
1850
|
+
`${base}^{commit}`
|
|
1851
|
+
], { cwd }).exitCode !== 0) return {
|
|
1852
|
+
affected: false,
|
|
1853
|
+
notice: `--affected ignored: base "${base}" is not in this checkout (fetch more history); running everything`
|
|
1854
|
+
};
|
|
1855
|
+
return {
|
|
1856
|
+
affected: true,
|
|
1857
|
+
env: { TURBO_SCM_BASE: base }
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1664
1860
|
// src/tasks/run/resolve-bin/resolve-bin.ts
|
|
1665
1861
|
/** `<cwd>/node_modules/.bin/<tool>` when it exists, else the bare `tool` name (left to `PATH`). */
|
|
1666
1862
|
function resolveBin(cwd, tool, fileExists) {
|
|
@@ -1915,7 +2111,7 @@ function turboDefinesTask(cwd, task, readFile, fileExists) {
|
|
|
1915
2111
|
function makeRunOne(input) {
|
|
1916
2112
|
const { print, logger, exec, task, cwd } = input;
|
|
1917
2113
|
const dryRun = input.dryRun ?? false;
|
|
1918
|
-
return (cmd, args) => {
|
|
2114
|
+
return (cmd, args, env) => {
|
|
1919
2115
|
const command = [cmd, ...args].join(" ");
|
|
1920
2116
|
if (dryRun) {
|
|
1921
2117
|
print(`would run: ${command}`);
|
|
@@ -1930,7 +2126,10 @@ function makeRunOne(input) {
|
|
|
1930
2126
|
};
|
|
1931
2127
|
}
|
|
1932
2128
|
print(`→ ${command}`);
|
|
1933
|
-
const { exitCode } = exec(cmd, args,
|
|
2129
|
+
const { exitCode } = exec(cmd, args, env ? {
|
|
2130
|
+
cwd,
|
|
2131
|
+
env
|
|
2132
|
+
} : { cwd });
|
|
1934
2133
|
const status = exitCode === 0 ? "ok" : "fail";
|
|
1935
2134
|
logger[status === "fail" ? "warn" : "debug"]({
|
|
1936
2135
|
task,
|
|
@@ -2010,14 +2209,25 @@ function runTask(input) {
|
|
|
2010
2209
|
if (turboDefinesTask(cwd, task, readFile, fileExists)) {
|
|
2011
2210
|
const filterArg = input.filter ? [`--filter=${input.filter}`] : [];
|
|
2012
2211
|
const forwarded = [...def?.local && !def.local.command && def.local.tool ? def.flags?.[def.local.tool] ?? [] : [], ...passthrough];
|
|
2212
|
+
const plan = resolveAffected({
|
|
2213
|
+
affected: input.affected,
|
|
2214
|
+
base: input.base,
|
|
2215
|
+
env: input.env ?? {},
|
|
2216
|
+
exec: input.exec,
|
|
2217
|
+
cwd
|
|
2218
|
+
});
|
|
2219
|
+
if (plan.notice) print(`· ${plan.notice}`);
|
|
2220
|
+
const affectedArg = plan.affected ? ["--affected"] : [];
|
|
2013
2221
|
const args = [
|
|
2014
2222
|
"run",
|
|
2015
2223
|
task,
|
|
2016
2224
|
...filterArg,
|
|
2225
|
+
...affectedArg,
|
|
2017
2226
|
...forwarded.length ? ["--", ...forwarded] : []
|
|
2018
2227
|
];
|
|
2019
|
-
return run(resolveBin(cwd, "turbo", fileExists), args);
|
|
2228
|
+
return run(resolveBin(cwd, "turbo", fileExists), args, plan.env);
|
|
2020
2229
|
}
|
|
2230
|
+
if (input.affected) print("· --affected ignored: this repo has no turbo task for it");
|
|
2021
2231
|
const script = readPackageJsonSync(cwd, { readFile })?.scripts?.[task];
|
|
2022
2232
|
if (script && !/^holocron run\b/.test(script.trim())) return run(detectPackageManager(cwd, {
|
|
2023
2233
|
readFile,
|
|
@@ -2292,7 +2502,10 @@ function runCi(input) {
|
|
|
2292
2502
|
cwd: input.cwd,
|
|
2293
2503
|
dryRun: input.dryRun ?? false,
|
|
2294
2504
|
required: entry.required === true,
|
|
2295
|
-
...input.filter ? { filter: input.filter } : {}
|
|
2505
|
+
...input.filter ? { filter: input.filter } : {},
|
|
2506
|
+
...input.affected ? { affected: true } : {},
|
|
2507
|
+
...input.base ? { base: input.base } : {},
|
|
2508
|
+
...input.env ? { env: input.env } : {}
|
|
2296
2509
|
});
|
|
2297
2510
|
const status = r.status;
|
|
2298
2511
|
jobs.push({
|
|
@@ -2318,96 +2531,6 @@ function runCi(input) {
|
|
|
2318
2531
|
function taskName(item) {
|
|
2319
2532
|
return typeof item === "string" ? item : item.name;
|
|
2320
2533
|
}
|
|
2321
|
-
// src/utils/create-header/create-header.ts
|
|
2322
|
-
/**
|
|
2323
|
-
* Factory that binds `source` and `tool` once and returns all header
|
|
2324
|
-
* constructors for auto-generated files. Prefer this over passing source
|
|
2325
|
-
* as a positional argument at every call site.
|
|
2326
|
-
*
|
|
2327
|
-
* @example
|
|
2328
|
-
* const { workflowHeader, scaffoldHeader } = createHeader({
|
|
2329
|
-
* source: "cli/astromech/src/templates/configs/editorconfig/create-config.ts",
|
|
2330
|
-
* });
|
|
2331
|
-
*
|
|
2332
|
-
* export function createConfig(): string {
|
|
2333
|
-
* return `${workflowHeader()}${body}`;
|
|
2334
|
-
* }
|
|
2335
|
-
*
|
|
2336
|
-
* ## Which header to use
|
|
2337
|
-
*
|
|
2338
|
-
* | Function | When to use | User can edit? |
|
|
2339
|
-
* |-------------------|----------------------------------------------------|----------------|
|
|
2340
|
-
* | `workflowHeader` | Files overwritten on every setup / sync-github run | No — "AUTO-GENERATED — do not edit" |
|
|
2341
|
-
* | `scaffoldHeader` | Files written once; user takes ownership after | Yes — "Scaffolded — edit this file freely" |
|
|
2342
|
-
*
|
|
2343
|
-
* ## `workflowHeader` formats
|
|
2344
|
-
*
|
|
2345
|
-
* | Format | Comment style | Used for |
|
|
2346
|
-
* |---------------------|------------------------|-------------------------------------------------------|
|
|
2347
|
-
* | `"yaml"` (default) | `# …` lines | YAML workflows, ignore files, `.editorconfig`, labeler|
|
|
2348
|
-
* | `"cjs"` | `/* … *\/` block | CommonJS config files (`.cjs`) |
|
|
2349
|
-
* | `"shebang"` | `#!/bin/sh` + `# …` | Shell scripts (`prepare-commit-msg`, hooks) |
|
|
2350
|
-
*/
|
|
2351
|
-
function createHeader(options) {
|
|
2352
|
-
const { source, tool = "holocron repo setup", forPrimary = false } = options;
|
|
2353
|
-
const doNotEdit = forPrimary ? `AUTO-GENERATED — do not edit in theholocron/.github directly.` : `AUTO-GENERATED — do not edit directly.`;
|
|
2354
|
-
return {
|
|
2355
|
-
workflowHeader(format = "yaml") {
|
|
2356
|
-
if (format === "cjs") return [
|
|
2357
|
-
`/* ${doNotEdit}`,
|
|
2358
|
-
` * Source: theholocron/holocron · ${source}`,
|
|
2359
|
-
` * Tool: ${tool}`,
|
|
2360
|
-
` * Changes: edit source in theholocron/holocron`,
|
|
2361
|
-
` */`,
|
|
2362
|
-
``
|
|
2363
|
-
].join("\n");
|
|
2364
|
-
const yamlLines = [
|
|
2365
|
-
`# ${doNotEdit}`,
|
|
2366
|
-
`# Source: theholocron/holocron · ${source}`,
|
|
2367
|
-
`# Tool: ${tool}`,
|
|
2368
|
-
`# Changes: edit source in theholocron/holocron`,
|
|
2369
|
-
``
|
|
2370
|
-
].join("\n");
|
|
2371
|
-
if (format === "shebang") return `#!/bin/sh\n\n${yamlLines}`;
|
|
2372
|
-
return yamlLines;
|
|
2373
|
-
},
|
|
2374
|
-
scaffoldHeader() {
|
|
2375
|
-
return [
|
|
2376
|
-
`# Scaffolded by holocron repo setup — edit this file freely.`,
|
|
2377
|
-
`# Source: theholocron/holocron · ${source}`,
|
|
2378
|
-
``
|
|
2379
|
-
].join("\n");
|
|
2380
|
-
}
|
|
2381
|
-
};
|
|
2382
|
-
}
|
|
2383
|
-
// src/utils/default-list-dirs/default-list-dirs.ts
|
|
2384
|
-
const defaultListDirs = (path) => readdirSync(path, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
2385
|
-
// src/utils/default-read-json/default-read-json.ts
|
|
2386
|
-
const defaultReadJson = (path) => JSON.parse(readFileSync(path, "utf8"));
|
|
2387
|
-
// src/utils/default-run/default-run.ts
|
|
2388
|
-
const defaultRun = (command, args, opts) => spawnSync(command, args, {
|
|
2389
|
-
encoding: "utf8",
|
|
2390
|
-
...opts
|
|
2391
|
-
});
|
|
2392
|
-
// src/utils/default-sleep/default-sleep.ts
|
|
2393
|
-
const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
2394
|
-
// src/utils/exec/exec.ts
|
|
2395
|
-
/** Runs `cmd` with the parent's stdio; a signal-killed or unspawnable process reports `-1`. */
|
|
2396
|
-
const realExec = (cmd, args, opts) => {
|
|
2397
|
-
return { exitCode: spawnSync(cmd, args, {
|
|
2398
|
-
cwd: opts.cwd,
|
|
2399
|
-
stdio: "inherit"
|
|
2400
|
-
}).status ?? -1 };
|
|
2401
|
-
};
|
|
2402
|
-
// src/utils/look-path/look-path.ts
|
|
2403
|
-
/** `node_modules/.bin/<bin>`, else the first `PATH` entry that has it, else `null`. */
|
|
2404
|
-
const realLookPath = (cwd, bin) => findExecutableSync(bin, { path: join(cwd, "node_modules", ".bin") }) ?? findExecutableSync(bin) ?? null;
|
|
2405
|
-
// src/utils/noop-logger/noop-logger.ts
|
|
2406
|
-
/** The `RunLogger` used when the caller injects none: drops every record. */
|
|
2407
|
-
const noopLogger = {
|
|
2408
|
-
debug() {},
|
|
2409
|
-
warn() {}
|
|
2410
|
-
};
|
|
2411
2534
|
// src/tasks/deploy-on-release/constants.ts
|
|
2412
2535
|
/** A stable release (no prerelease identifier) is on `main`, the default channel for a task. */
|
|
2413
2536
|
const MAIN_CHANNEL = "main";
|
|
@@ -2757,7 +2880,10 @@ function runGroup(input) {
|
|
|
2757
2880
|
...jobSwitches(input.config, name),
|
|
2758
2881
|
cwd: input.cwd,
|
|
2759
2882
|
dryRun: input.dryRun ?? false,
|
|
2760
|
-
...input.filter ? { filter: input.filter } : {}
|
|
2883
|
+
...input.filter ? { filter: input.filter } : {},
|
|
2884
|
+
...input.affected ? { affected: true } : {},
|
|
2885
|
+
...input.base ? { base: input.base } : {},
|
|
2886
|
+
...input.env ? { env: input.env } : {}
|
|
2761
2887
|
});
|
|
2762
2888
|
jobs.push({
|
|
2763
2889
|
task: name,
|
|
@@ -2787,6 +2913,7 @@ function createAstromech(options) {
|
|
|
2787
2913
|
listDir: options.listDir ?? ((path) => readdirSync(path)),
|
|
2788
2914
|
lookPath: options.lookPath ?? realLookPath
|
|
2789
2915
|
};
|
|
2916
|
+
const env = options.env ?? process.env;
|
|
2790
2917
|
const items = () => (options.config?.tasks ?? []).map((i) => normalizeTaskEntry(i));
|
|
2791
2918
|
/** The `jobs` switches of a task's entry in the manifest, as a `runTask` input; nothing when it has none. */
|
|
2792
2919
|
const jobSwitchesFor = (task) => {
|
|
@@ -2820,7 +2947,12 @@ function createAstromech(options) {
|
|
|
2820
2947
|
config: options.config,
|
|
2821
2948
|
namespace: task,
|
|
2822
2949
|
dryRun: opts.dryRun ?? false,
|
|
2823
|
-
...opts.filter ? { filter: opts.filter } : {}
|
|
2950
|
+
...opts.filter ? { filter: opts.filter } : {},
|
|
2951
|
+
...opts.affected ? {
|
|
2952
|
+
affected: true,
|
|
2953
|
+
env
|
|
2954
|
+
} : {},
|
|
2955
|
+
...opts.base ? { base: opts.base } : {}
|
|
2824
2956
|
});
|
|
2825
2957
|
return runTask({
|
|
2826
2958
|
...deps,
|
|
@@ -2831,6 +2963,11 @@ function createAstromech(options) {
|
|
|
2831
2963
|
dryRun: opts.dryRun ?? false,
|
|
2832
2964
|
required: opts.required ?? false,
|
|
2833
2965
|
...opts.filter ? { filter: opts.filter } : {},
|
|
2966
|
+
...opts.affected ? {
|
|
2967
|
+
affected: true,
|
|
2968
|
+
env
|
|
2969
|
+
} : {},
|
|
2970
|
+
...opts.base ? { base: opts.base } : {},
|
|
2834
2971
|
...jobSwitchesFor(task)
|
|
2835
2972
|
});
|
|
2836
2973
|
},
|
|
@@ -2838,6 +2975,7 @@ function createAstromech(options) {
|
|
|
2838
2975
|
...deps,
|
|
2839
2976
|
cwd: options.cwd,
|
|
2840
2977
|
config: options.config ?? {},
|
|
2978
|
+
...opts.affected ? { env } : {},
|
|
2841
2979
|
...opts
|
|
2842
2980
|
}),
|
|
2843
2981
|
thinCallers: () => {
|
|
@@ -2899,7 +3037,7 @@ var alexignore_default = ".github/*\nCHANGELOG.md\nLICENSE\n";
|
|
|
2899
3037
|
// src/templates/configs/alexjs/create-config.ts
|
|
2900
3038
|
const { workflowHeader: workflowHeader$9 } = createHeader({ source: "cli/astromech/src/templates/configs/alexjs/create-config.ts" });
|
|
2901
3039
|
function createRcConfig() {
|
|
2902
|
-
return
|
|
3040
|
+
return formatJson(alexrc_default);
|
|
2903
3041
|
}
|
|
2904
3042
|
function createIgnoreConfig() {
|
|
2905
3043
|
return `${workflowHeader$9()}${alexignore_default}`;
|
|
@@ -2924,8 +3062,18 @@ function createConfig(holocronScript = "pnpm exec holocron") {
|
|
|
2924
3062
|
var dependabot_default = "version: 2\nupdates:\n - package-ecosystem: npm\n directory: /\n schedule:\n interval: weekly\n commit-message:\n prefix: \"chore(deps)\"\n prefix-development: \"chore(deps-dev)\"\n groups:\n security-patches:\n applies-to: security-updates\n patterns:\n - \"*\"\n all-dependencies:\n update-types:\n - minor\n - patch\n\n - package-ecosystem: github-actions\n directory: /\n schedule:\n interval: weekly\n commit-message:\n prefix: \"chore(deps)\"\n groups:\n all-actions:\n patterns:\n - \"*\"\n";
|
|
2925
3063
|
// src/templates/configs/dependabot/create-config.ts
|
|
2926
3064
|
const { workflowHeader: workflowHeader$7 } = createHeader({ source: "cli/astromech/src/templates/configs/dependabot/create-config.ts" });
|
|
2927
|
-
|
|
2928
|
-
|
|
3065
|
+
/** Where the npm entry's `groups:` begins. The `ignore:` block goes right before it (the first `groups:` is npm's). */
|
|
3066
|
+
const NPM_GROUPS = " groups:\n";
|
|
3067
|
+
function ignoreBlock(names) {
|
|
3068
|
+
return ` ignore:\n${[...new Set(names)].sort().map((name) => ` - dependency-name: "${name}"\n`).join("")}`;
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* The content of `.github/dependabot.yml`, with its generated-file header. Names in `ignore` get a name-only
|
|
3072
|
+
* `ignore` entry on the npm ecosystem; with none, the file is the shared body unchanged.
|
|
3073
|
+
*/
|
|
3074
|
+
function createConfig$1({ ignore = [] } = {}) {
|
|
3075
|
+
const body = ignore.length === 0 ? dependabot_default : dependabot_default.replace(NPM_GROUPS, `${ignoreBlock(ignore)}${NPM_GROUPS}`);
|
|
3076
|
+
return `${workflowHeader$7()}${body}`;
|
|
2929
3077
|
}
|
|
2930
3078
|
// src/templates/configs/devmoji/create-config.ts
|
|
2931
3079
|
const { workflowHeader: workflowHeader$6 } = createHeader({ source: "cli/astromech/src/templates/configs/devmoji/create-config.ts" });
|
|
@@ -2958,7 +3106,7 @@ function createConfig$3() {
|
|
|
2958
3106
|
* buys nothing.
|
|
2959
3107
|
*/
|
|
2960
3108
|
function createConfig$4() {
|
|
2961
|
-
return
|
|
3109
|
+
return formatJson(editorconfig_checker_default);
|
|
2962
3110
|
}
|
|
2963
3111
|
// src/templates/configs/labeler/labeler.yml
|
|
2964
3112
|
var labeler_default = "bug:\n - \"^fix\"\n\nchore:\n - '^chore(?!\\(deps)'\n\nci:\n - \"^ci\"\n\ndependencies:\n - '^chore\\(deps'\n\ndocumentation:\n - \"^docs\"\n\nenhancement:\n - \"^feat\"\n\nperformance:\n - \"^perf\"\n\nrefactor:\n - \"^refactor\"\n\ntest:\n - \"^test\"\n";
|
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-C-3fZESa.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;
|
|
@@ -46,6 +46,14 @@ interface TaskEntry {
|
|
|
46
46
|
* stay tracked without needing to be repeated here.
|
|
47
47
|
*/
|
|
48
48
|
inputs?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Extra tasks this one waits for, appended to the registry default's
|
|
51
|
+
* `dependsOn` — for a build the package does not list as a dependency
|
|
52
|
+
* but its task loads anyway (e.g. `staticAnalysis` loading the root
|
|
53
|
+
* ESLint config, which imports a package of the workspace). Turbo
|
|
54
|
+
* syntax: `"<package>#<task>"`, `"^<task>"`.
|
|
55
|
+
*/
|
|
56
|
+
dependsOn?: string[];
|
|
49
57
|
};
|
|
50
58
|
}
|
|
51
59
|
/** 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.
|
|
3
|
+
"version": "5.0.0-alpha.257",
|
|
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,31 +50,32 @@
|
|
|
50
50
|
"@commitlint/lint": "^21.2.3",
|
|
51
51
|
"@commitlint/load": "^21.2.3",
|
|
52
52
|
"@commitlint/types": "^21.2.3",
|
|
53
|
-
"@theholocron/
|
|
53
|
+
"@theholocron/datapad": "5.0.0-alpha.257",
|
|
54
|
+
"@theholocron/pkg-utils": "^1.16.1-alpha.1",
|
|
54
55
|
"@theholocron/fs-utils": "^1.16.1-alpha.1",
|
|
55
|
-
"@theholocron/
|
|
56
|
-
"@theholocron/pkg-utils": "^1.16.1-alpha.1"
|
|
56
|
+
"@theholocron/json-utils": "^1.16.1-alpha.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@commitlint/config-conventional": "^21.2.3",
|
|
60
60
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
61
61
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
62
|
-
"@theholocron/commitlint-config": "^8.8.0",
|
|
63
|
-
"@theholocron/eslint-config": "^8.8.2",
|
|
64
|
-
"@theholocron/semantic-release-config": "^8.8.2",
|
|
65
62
|
"@types/node": "^26",
|
|
66
63
|
"@vitest/coverage-v8": "^5.0.5",
|
|
67
64
|
"@vitest/eslint-plugin": "^1.6.27",
|
|
68
65
|
"eslint": "^10.8.1",
|
|
69
66
|
"eslint-plugin-n": "^18.3.0",
|
|
70
67
|
"globals": "^17.11.0",
|
|
68
|
+
"prettier": "^3.9.6",
|
|
71
69
|
"tsdown": "^0.23.3",
|
|
72
70
|
"typescript": "^5.9.3",
|
|
73
71
|
"vitest": "^5.0.5",
|
|
72
|
+
"@theholocron/commitlint-config": "^8.9.0-alpha.3",
|
|
74
73
|
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.3",
|
|
75
|
-
"@theholocron/
|
|
74
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.3",
|
|
75
|
+
"@theholocron/semantic-release-config": "^8.9.0-alpha.3",
|
|
76
76
|
"@theholocron/tsconfig": "^8.9.0-alpha.3",
|
|
77
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.3"
|
|
77
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.3",
|
|
78
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.3"
|
|
78
79
|
},
|
|
79
80
|
"peerDependencies": {
|
|
80
81
|
"@semantic-release/commit-analyzer": "^13",
|