@theholocron/astromech 5.0.0-alpha.440 → 5.0.0-alpha.441
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/README.md +31 -30
- package/dist/config/index.mjs +1 -1
- package/dist/index.mjs +13 -1
- package/dist/{load-CW6958Ft.mjs → load-DZJEjuTY.mjs} +5 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -59,36 +59,37 @@ what it actually runs, and why. Tool names never appear in
|
|
|
59
59
|
`holocron.config.ts` — they're an implementation detail this table
|
|
60
60
|
documents, not a naming convention repos need to follow.
|
|
61
61
|
|
|
62
|
-
| Task | Runs | Notes
|
|
63
|
-
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
-
| `test:unit` | vitest | always runs with coverage: `vitest run --coverage`, there is no flag
|
|
65
|
-
| `typecheck` | tsc | `tsc --noEmit`
|
|
66
|
-
| `test:perf` | Lighthouse CI | only runs with a `lighthouse.config.*` present
|
|
67
|
-
| `lint:code` | eslint, actionlint, git-merge-conflict-markers | a `linterGroup` — see below
|
|
68
|
-
| `lint:editorconfig`, `lint:markdown` | editorconfig-checker, markdownlint-cli2 | each is a `linterGroup` of one tool
|
|
69
|
-
| `format` | prettier | writes by default, `--check` is read-only; no workflow of its own
|
|
70
|
-
| `lint:data` | yamllint |
|
|
71
|
-
| `lint:unused` | knip |
|
|
72
|
-
| `scan:secrets` | gitleaks |
|
|
73
|
-
| `scan:code` | CodeQL | no local equivalent — CI only
|
|
74
|
-
| `check-tokens` | `holocron doctor secrets --verify` | scheduled daily in CI; fails on a rejected token or one with 7 days or fewer left; never part of `run ci`
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `check-
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `validate:
|
|
85
|
-
| `validate:
|
|
86
|
-
| `validate:
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `deploy-
|
|
62
|
+
| Task | Runs | Notes |
|
|
63
|
+
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `test:unit` | vitest | always runs with coverage: `vitest run --coverage`, there is no flag |
|
|
65
|
+
| `typecheck` | tsc | `tsc --noEmit` |
|
|
66
|
+
| `test:perf` | Lighthouse CI | only runs with a `lighthouse.config.*` present |
|
|
67
|
+
| `lint:code` | eslint, actionlint, git-merge-conflict-markers | a `linterGroup` — see below |
|
|
68
|
+
| `lint:editorconfig`, `lint:markdown` | editorconfig-checker, markdownlint-cli2 | each is a `linterGroup` of one tool |
|
|
69
|
+
| `format` | prettier | writes by default, `--check` is read-only; no workflow of its own |
|
|
70
|
+
| `lint:data` | yamllint | |
|
|
71
|
+
| `lint:unused` | knip | |
|
|
72
|
+
| `scan:secrets` | gitleaks | |
|
|
73
|
+
| `scan:code` | CodeQL | no local equivalent — CI only |
|
|
74
|
+
| `check-tokens` | `holocron doctor secrets --verify` | scheduled daily in CI; fails on a rejected token or one with 7 days or fewer left; never part of `run ci` |
|
|
75
|
+
| `doctor-tokens` | `holocron doctor tokens` | scheduled daily in CI; each layer's tokens against their declaration; unreadable layers skip; never part of `run ci` |
|
|
76
|
+
| `build` | tsdown / vite / rollup / tsc, detected from the repo's own config file, or `package.json`'s own `dependencies`/`devDependencies` if that config file isn't there | |
|
|
77
|
+
| `release` | semantic-release | no local equivalent — CI only; carries `preview` (npm dist-tags) |
|
|
78
|
+
| `deploy` | Cloudflare Pages / Vercel | no local equivalent — CI only; carries `preview` |
|
|
79
|
+
| `measure:bundle` | bundle-size upload to Codecov | no local equivalent — CI only |
|
|
80
|
+
| `check-preview` | `holocron check monitor <url>` against the PR's own Vercel preview URL | no local equivalent — CI only; triggered by `deployment_status`, not `push`/`pull_request` |
|
|
81
|
+
| `check-notify` | _(none — manual workflow)_ | posts a labelled test message to every notification channel; fails per channel that does not work |
|
|
82
|
+
| `sync-repo` | `holocron sync` | keeps generated files current |
|
|
83
|
+
| `lint:commits` | commitlint | no local equivalent — enforced by the `commit-msg` hook locally, over the PR's commit range in CI |
|
|
84
|
+
| `validate:specs` | `holocron probe specs check` | spec/ADR frontmatter — a leaf of the `validate` suite, not a linter |
|
|
85
|
+
| `validate:docs` | `holocron probe docs validate` | docs presence (warns) and token docs (fails) — a leaf of the `validate` suite, not a linter |
|
|
86
|
+
| `validate:deps` | `holocron probe deps check` | dependency catalogs — a leaf of the `validate` suite, not a linter |
|
|
87
|
+
| `validate:generated` | `holocron probe generated check` | generated files match the config — a leaf of the `validate` suite, not a linter |
|
|
88
|
+
| `measure:docs` | `holocron probe docs coverage` | doc-comment coverage, uploaded to Codecov as the `documentation` flag; the Codecov status gates, not the job |
|
|
89
|
+
| `remind-doctor` | _(none — posts through a webhook secret)_ | a weekly #alerts line that reminds a maintainer to run `doctor notifications --post` |
|
|
90
|
+
| `publish-wiki` | Fern | publishes `docs/wiki/*.md` — not a sync, a publish; carries `preview` |
|
|
91
|
+
| `deploy-docs` | Astro build | the docs site itself; carries `preview` (defaults on) |
|
|
92
|
+
| `deploy-components` | Storybook build | a browsable component catalog — "Storybook" is the tool, not the intent; carries `preview` (defaults on) |
|
|
92
93
|
|
|
93
94
|
**`preview` is a cross-cutting feature, not a namespace.** npm has staging
|
|
94
95
|
dist-tags, Cloudflare/Vercel do per-PR preview deploys, Fern previews
|
package/dist/config/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as coerceTasks, r as isTask, t as loadTasksConfig, u as normalizeTaskEntry } from "../load-
|
|
1
|
+
import { n as coerceTasks, r as isTask, t as loadTasksConfig, u as normalizeTaskEntry } from "../load-DZJEjuTY.mjs";
|
|
2
2
|
import { createDefineConfig, mergeLayers } from "@theholocron/datapad";
|
|
3
3
|
// src/config/define/define.ts
|
|
4
4
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as legacyName, c as CI_ORDER, i as resolveTaskName, l as TASKS, o as ownLegacyName, r as isTask, s as LEGACY_NAMES, t as loadTasksConfig, u as normalizeTaskEntry } from "./load-
|
|
1
|
+
import { a as legacyName, c as CI_ORDER, i as resolveTaskName, l as TASKS, o as ownLegacyName, r as isTask, s as LEGACY_NAMES, t as loadTasksConfig, u as normalizeTaskEntry } from "./load-DZJEjuTY.mjs";
|
|
2
2
|
import { n as alexrc_default, t as editorconfig_checker_default } from "./editorconfig-checker-B-hWWYHk.mjs";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative } from "node:path";
|
|
@@ -54,6 +54,7 @@ var ci_default = "name: CI\n\n# The one stable required check (spec ci-flat-task
|
|
|
54
54
|
var deploy_preview_default$1 = "name: Preview Deploy\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n cwd:\n description: Directory to run the delivery.previewDeploy task from — the opted-in package's own directory in a monorepo. Defaults to the repo root.\n required: false\n type: string\n default: \".\"\n paths:\n description: >\n JSON array of repo-relative path prefixes (each ending in \"/\") --\n a PR touching none of them skips the actual deploy work instead\n of spinning up a Vercel preview for every PR in the monorepo\n regardless of relevance (holocron#1023). Defaults to an empty\n array: no filter, every PR is relevant -- correct for a\n single-repo consumer, where every PR IS a PR to that package.\n required: false\n type: string\n default: \"[]\"\n secrets:\n HOLOCRON_VERCEL_TOKEN:\n description: The Vercel token. Read first; the vendor-native VERCEL_TOKEN secret is the fallback.\n required: false\n VERCEL_TOKEN:\n required: false\n HOLOCRON_DEPLOYMENTS_TOKEN:\n description: >\n A dedicated fine-grained PAT (Deployments: read/write only — see\n docs/tokens.md), not the default GITHUB_TOKEN — GitHub does not\n start a new workflow run for a deployment_status event created\n using a run's own GITHUB_TOKEN, which would make a\n deployment_status-triggered check (e.g. delivery.previewCheck)\n silently never fire. No existing HOLOCRON_<FEATURE>_TOKEN carries\n the Deployments permission, so `secrets: inherit` on the thin\n caller forwards nothing for this unless a repo/org secret\n literally named HOLOCRON_DEPLOYMENTS_TOKEN has been provisioned.\n required: false\n\njobs:\n # Two jobs, deliberately not one: \"report\" never checks out the repo at\n # all, so it never runs a single line of this PR's own code. \"deploy\"\n # does — it has to, to build and stage the preview — and runs with\n # VERCEL_TOKEN present for that (tracked as a residual risk, #1020: the\n # build step still runs this monorepo's own PR-affectable CLI build,\n # pre-review). Without the split, a malicious build/stage script could\n # persist a `gh` shim onto $GITHUB_PATH (or similar runner-state\n # tampering) that a LATER step in the SAME job — the one that finally\n # gets GH_TOKEN — would then execute instead of the real `gh` CLI,\n # stealing that token too. Separate jobs run on separate, fresh\n # runners; \"report\" has nothing of the first job's runner state to\n # inherit.\n deploy:\n name: Deploy preview\n runs-on: ubuntu-latest\n # Setup/build/stage, plus the deploy capability's own\n # wait-for-ready polling (up to 10 minutes by itself) — 10 would kill\n # this before that polling could even finish.\n timeout-minutes: 20\n permissions:\n contents: read\n # Listing the PR's changed files (below, via `gh api`) needs this —\n # must be granted here too, not only on the thin caller: GitHub\n # hard-fails the whole run at startup, zero jobs dispatched, if a\n # called reusable workflow's job asks for more than the caller\n # grants (holocron#1058).\n pull-requests: read\n outputs:\n url: ${{ steps.extract.outputs.url }}\n steps:\n - name: Check whether the PR touches any watched path\n id: filter\n env:\n GH_TOKEN: ${{ github.token }}\n PATHS: ${{ inputs.paths }}\n run: |\n # No checkout needed — the PR's changed-file list comes from the\n # API, not local git history (which this job's later shallow\n # checkout, below, doesn't have enough of to diff against the\n # base branch anyway).\n #\n # `jq -e` both parses PATHS and rejects anything that isn't a\n # JSON array (holocron#1069 review) -- a malformed input (bad\n # JSON, or valid JSON that isn't an array) fails the job loudly\n # instead of the process-substitution loop below silently\n # reading zero prefixes and skipping the deploy with a green\n # check and no explanation.\n paths=$(echo \"$PATHS\" | jq -e 'if type != \"array\" then error(\"paths input is not a JSON array\") else . end') || {\n echo \"::error::delivery.previewDeploy's paths input is not a valid JSON array: $PATHS\"\n exit 1\n }\n # `jq 'length'` on the PARSED value, not a comparison against the\n # literal string \"[]\" -- any valid JSON encoding of an empty\n # array (e.g. \" [ ] \") means the same \"no filter\" thing.\n if [ \"$(echo \"$paths\" | jq 'length')\" = \"0\" ]; then\n echo \"relevant=true\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n # Both the new name AND the old one for a rename -- a file\n # renamed OUT of a watched package (old path matches, new\n # doesn't) is still a real change to that package's tree.\n files=$(gh api \"repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files\" --paginate --jq '.[] | .filename, (.previous_filename // empty)')\n file_count=$(echo \"$files\" | grep -c . || true)\n if [ \"$file_count\" -ge 3000 ]; then\n # The pulls-files endpoint caps out at 3,000 entries even with\n # --paginate -- past that, a watched path could be among the\n # files we never saw. Can't prove the PR irrelevant, so fail\n # safe to relevant rather than risk silently skipping a real\n # deploy.\n echo \"::warning::PR has >= 3000 changed files -- can't reliably determine path relevance, treating as relevant\"\n echo \"relevant=true\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n relevant=false\n while IFS= read -r prefix; do\n [ -z \"$prefix\" ] && continue\n while IFS= read -r file; do\n [ -z \"$file\" ] && continue\n # Unquoted $prefix (deliberately) -- case pattern-matches it\n # as a glob, anchored at the START of the repo-relative path\n # (holocron#1069 review: grep -F matched the prefix as a\n # literal substring anywhere in the filename, and couldn't\n # match a configured glob like \"custom/**\" at all). The\n # trailing `*` covers a plain directory prefix like\n # \"apps/sentinel/\"; a caller-supplied prefix that already\n # has its own wildcards (e.g. \"custom/**\") just gets one\n # more, harmlessly.\n case \"$file\" in\n $prefix*) relevant=true; break 2 ;;\n esac\n done <<< \"$files\"\n done < <(echo \"$paths\" | jq -r '.[]')\n echo \"relevant=$relevant\" >> \"$GITHUB_OUTPUT\"\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n if: ${{ steps.filter.outputs.relevant == 'true' }}\n with:\n # The PR's exact head SHA, not the default pull_request\n # merge-commit ref — what gets built and deployed must be the\n # exact commit the PR actually points at.\n ref: ${{ github.event.pull_request.head.sha }}\n persist-credentials: false\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n if: ${{ steps.filter.outputs.relevant == 'true' }}\n\n - name: Check deploy credentials are available\n if: ${{ steps.filter.outputs.relevant == 'true' }}\n id: creds\n env:\n VERCEL_TOKEN: ${{ secrets.HOLOCRON_VERCEL_TOKEN || secrets.VERCEL_TOKEN }}\n run: |\n # `secrets` isn't valid in a step `if:` (actionlint-enforced) —\n # a fork PR never receives this secret, so the deploy step below\n # skips cleanly on an empty token instead of failing on a\n # missing credential -- correct, and must stay that way: a\n # fork-triggered pull_request run never gets a write-scoped\n # token either, so there's no way to post a PR comment or check\n # run from here regardless (that needs a separate,\n # pull_request_target-triggered job in the base repo's\n # context -- a real feature with its own review surface, not\n # this step; holocron#1027 explicitly scoped this fix to\n # observability only). The ::notice:: below needs no extra\n # permission -- it's a log annotation the runner itself renders,\n # not an API write -- so it's the cheap half of #1027 that IS\n # worth doing here: a visible, on-PR explanation instead of\n # silence.\n if [ -n \"$VERCEL_TOKEN\" ]; then\n echo \"available=true\" >> \"$GITHUB_OUTPUT\"\n else\n echo \"available=false\" >> \"$GITHUB_OUTPUT\"\n echo \"::notice title=No preview deployed::This run has no VERCEL_TOKEN available, so no preview was deployed -- most commonly because GitHub withholds repository secrets from a pull_request run triggered by a fork, though any run missing this secret ends up here the same way. Since this run creates no deployment, it won't trigger delivery.previewCheck for this PR. A maintainer can deploy one manually if needed.\"\n fi\n\n - name: Deploy preview\n id: deploy\n if: ${{ steps.creds.outputs.available == 'true' }}\n env:\n VERCEL_TOKEN: ${{ secrets.HOLOCRON_VERCEL_TOKEN || secrets.VERCEL_TOKEN }}\n uses: theholocron/.github/.github/actions/holocron@main\n with:\n command: run deploy-preview\n args: --cwd=${{ inputs.cwd }}\n\n - name: Extract and validate the preview URL\n id: extract\n # Only after a real deploy — false both when the step above\n # failed and when it skipped cleanly (fork PR, no credential).\n if: ${{ steps.deploy.outcome == 'success' }}\n env:\n LOG_FILE: ${{ steps.deploy.outputs.log-file }}\n run: |\n # A loose https://\\S+ grab would match whatever text follows an\n # attacker-chosen URL this log happens to contain; grabbing\n # candidate text here and separately requiring the PARSED\n # hostname end in .vercel.app (below) closes that regardless of\n # how the candidate text is shaped — e.g. a userinfo trick like\n # \"https://x.vercel.app@127.0.0.1/\" would satisfy almost any\n # hand-written regex character class while actually parsing to\n # host 127.0.0.1, which a naive regex-only check already missed\n # once.\n candidate=$(grep -oE 'https://[^[:space:]\"]+' \"$LOG_FILE\" | tail -1)\n if [ -z \"$candidate\" ]; then\n echo \"::error::deploy succeeded but no https:// URL was found in its output\"\n exit 1\n fi\n host=$(node -e 'try { process.stdout.write(new URL(process.argv[1]).hostname) } catch { process.exit(1) }' \"$candidate\") || host=\"\"\n if [[ \"$host\" != *.vercel.app ]]; then\n echo \"::error::extracted URL '$candidate' does not parse to a *.vercel.app host (parsed host: '${host:-<unparseable>}')\"\n exit 1\n fi\n echo \"url=$candidate\" >> \"$GITHUB_OUTPUT\"\n\n report:\n name: Report deployment status\n needs: deploy\n if: ${{ needs.deploy.outputs.url != '' }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n permissions:\n deployments: write\n steps:\n - name: Create GitHub deployment and report status\n env:\n # gh reads GH_TOKEN as its auto-auth env var by its own\n # convention -- the secret feeding it is named\n # HOLOCRON_DEPLOYMENTS_TOKEN, matching this org's\n # HOLOCRON_<FEATURE>_TOKEN naming (docs/tokens.md).\n GH_TOKEN: ${{ secrets.HOLOCRON_DEPLOYMENTS_TOKEN }}\n # The PR's head BRANCH, not its SHA — GitHub's PR \"Environments\"\n # widget associates a Deployment with a PR by matching `ref` to\n # the PR's own branch name, not by SHA. GitHub resolves the\n # branch to whatever commit it points to AT CREATION TIME,\n # though, which is a separate moment from the deploy job's own\n # checkout (below, SHA) -- cross-checked after creation rather\n # than assumed.\n REF: ${{ github.event.pull_request.head.ref }}\n # The exact commit the deploy job checked out and built,\n # captured from the same frozen event payload this whole run\n # was triggered by -- stays constant for the run's lifetime\n # even if the PR branch itself moves while this job is running.\n SHA: ${{ github.event.pull_request.head.sha }}\n URL: ${{ needs.deploy.outputs.url }}\n run: |\n if [ -z \"$GH_TOKEN\" ]; then\n echo \"::error::HOLOCRON_DEPLOYMENTS_TOKEN secret is not set -- posting this status with the default GITHUB_TOKEN would not trigger a deployment_status-triggered check\"\n exit 1\n fi\n\n post_status() {\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}/statuses\" \\\n --method POST --field state=\"$1\" --field environment_url=\"$URL\" >/dev/null\n }\n latest_status() {\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}/statuses\" --jq '.[0].state // empty' 2>/dev/null\n }\n # A deployment this very run may have already created\n # server-side on an earlier attempt whose client-side response\n # got lost (e.g. a dropped connection) -- reused instead of\n # creating a second one, which would leave the first\n # permanently pending (nothing ever posts its status). Scoped\n # to the last 2 minutes so an OLDER deployment for the same\n # ref/environment (a previous, unrelated run) is never\n # mistaken for this one.\n find_recent_deployment() {\n gh api \"repos/${GITHUB_REPOSITORY}/deployments\" --method GET -f ref=\"$REF\" -f environment=Preview --jq '\n [.[] | select((now - (.created_at | fromdateiso8601)) < 120)] | sort_by(.created_at) | last | .id // empty' 2>/dev/null\n }\n\n # jq, not a hand-built string -- a branch name containing a\n # literal double quote (git allows it; GitHub's branch-naming\n # rules don't forbid it either) would otherwise break out of a\n # printf-constructed JSON string and produce an invalid payload\n # gh api can't send.\n payload=$(jq -n --arg ref \"$REF\" '{\n ref: $ref,\n environment: \"Preview\",\n description: \"Vercel Preview (file deploy)\",\n production_environment: false,\n auto_merge: false,\n required_contexts: []\n }')\n deploy_id=\"\"\n for attempt in 1 2 3; do\n deploy_id=$(find_recent_deployment)\n if [ -n \"$deploy_id\" ]; then\n echo \"reusing deployment ${deploy_id} created by an earlier attempt of this run\" >&2\n break\n fi\n deploy_id=$(echo \"$payload\" | gh api \"repos/${GITHUB_REPOSITORY}/deployments\" --method POST --input - | jq -r '.id // empty')\n if [ -n \"$deploy_id\" ]; then break; fi\n echo \"deployment creation failed (attempt ${attempt}/3) -- retrying...\" >&2\n sleep 5\n done\n if [ -z \"$deploy_id\" ]; then\n echo \"::error::failed to create a GitHub deployment after 3 attempts -- Vercel already has the preview, but nothing will report or check it\"\n exit 1\n fi\n\n # `ref` resolves to the branch's CURRENT tip at creation time --\n # only guaranteed to be the commit this job actually built if\n # the branch hasn't moved since the triggering push. A push to\n # the same PR while this job was still running would otherwise\n # silently associate the preview URL (built from the OLD\n # commit) with the NEW commit's deployment. A newer workflow\n # run already covers that new commit (cancel-in-progress:\n # false queues rather than cancels), so failing this stale one\n # loses nothing.\n deployed_sha=$(gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}\" --jq '.sha // empty')\n if [ \"$deployed_sha\" != \"$SHA\" ]; then\n echo \"::error::deployment ${deploy_id} resolved to ${deployed_sha}, not the deployed commit ${SHA} -- the PR branch moved while this job was running; a newer run already covers the new commit\"\n exit 1\n fi\n\n for attempt in 1 2 3; do\n if post_status success; then\n exit 0\n fi\n # The POST may have actually succeeded server-side even though\n # this client call reported failure (e.g. a dropped connection\n # after GitHub processed it) — checked before retrying, so a\n # transient client-side error never posts a second success and\n # fires delivery.previewCheck twice for the same preview.\n if [ \"$(latest_status)\" = \"success\" ]; then\n exit 0\n fi\n echo \"status POST failed (attempt ${attempt}/3) for deployment ${deploy_id} -- retrying...\" >&2\n sleep 5\n done\n\n # Exhausted retries — one last attempt to mark the deployment\n # failed rather than leaving it permanently \"pending\" in GitHub's\n # UI; best-effort, its own failure doesn't change this step's\n # already-failed outcome.\n post_status error || true\n echo \"::error::failed to post a success status for deployment ${deploy_id} after 3 attempts -- marked it failed instead of leaving it pending\"\n exit 1\n";
|
|
55
55
|
var deploy_sentinel_default$1 = "name: Deploy Sentinel\n\n# Sentinel's own CI-based deploy (holocron#800): `pnpm run deploy` in `apps/sentinel` (build, stage, `holocron deploy`),\n# the command a person runs from a checkout. The caller runs it on demand and on a push to `main` that touches\n# `apps/sentinel/**`; alpha releases deploy Sentinel themselves through the release job's `holocron deploy on-release`.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_VERCEL_TOKEN:\n description: The Vercel token the deploy uses. `VERCEL_TOKEN` is the fallback.\n required: false\n VERCEL_TOKEN:\n required: false\n\njobs:\n deploy-sentinel:\n name: Build, stage and deploy Sentinel\n # One deploy at a time, and a running one is never cancelled halfway.\n concurrency:\n group: sentinel-deploy\n cancel-in-progress: false\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 10\n env:\n VERCEL_TOKEN: ${{ secrets.HOLOCRON_VERCEL_TOKEN || secrets.VERCEL_TOKEN }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Build, stage, and deploy\n working-directory: apps/sentinel\n run: pnpm run deploy\n";
|
|
56
56
|
var deploy_default$1 = "name: Deploy\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n type:\n description: \"Type of deployment: docs or storybook\"\n required: true\n type: string\n storybook-projects:\n description: >\n JSON array of { \"name\"?, \"workingDir\", \"outputDir\"? } objects for storybook deploys.\n Each is built via `pnpm -C <workingDir> build:storybook`. If \"name\" is provided the\n output is placed under `sandbox/<name>/`; omit \"name\" for single-repo deploys and the\n output lands directly in `sandbox/`.\n type: string\n required: false\n default: \"[]\"\n build-script:\n description: pnpm script that builds the Storybook static output (single storybook, type:storybook only)\n type: string\n required: false\n default: build:storybook\n output-dir:\n description: Directory where Storybook writes its static output (single storybook, type:storybook only)\n type: string\n required: false\n default: storybook-static\n\njobs:\n deploy:\n name: Deploy\n runs-on: ubuntu-latest\n permissions:\n contents: read\n pages: write\n id-token: write\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Build docs site\n if: ${{ inputs.type == 'docs' }}\n run: pnpm -C docs build\n\n - name: Build Storybook projects\n if: ${{ inputs.storybook-projects != '[]' }}\n env:\n PROJECTS: ${{ inputs.storybook-projects }}\n run: |\n echo \"$PROJECTS\" | jq -c '.[]' | while IFS= read -r project; do\n workingDir=$(echo \"$project\" | jq -r '.workingDir')\n pnpm -C \"$workingDir\" build:storybook\n done\n\n - name: Build Storybook\n if: ${{ inputs.type == 'storybook' && inputs.storybook-projects == '[]' }}\n env:\n BUILD_SCRIPT: ${{ inputs.build-script }}\n run: pnpm run \"$BUILD_SCRIPT\"\n\n - name: Assemble site\n env:\n DEPLOY_TYPE: ${{ inputs.type }}\n PROJECTS: ${{ inputs.storybook-projects }}\n STORYBOOK_OUTPUT_DIR: ${{ inputs.output-dir }}\n run: |\n mkdir -p _site\n if [ \"$DEPLOY_TYPE\" = \"docs\" ]; then\n cp -r docs/dist/. _site/\n fi\n if [ \"$PROJECTS\" != \"[]\" ]; then\n echo \"$PROJECTS\" | jq -c '.[]' | while IFS= read -r project; do\n name=$(echo \"$project\" | jq -r '.name // \"\"')\n workingDir=$(echo \"$project\" | jq -r '.workingDir')\n outputDir=$(echo \"$project\" | jq -r '.outputDir // \"storybook-static\"')\n if [ -n \"$name\" ]; then\n target=\"_site/sandbox/${name}\"\n else\n target=\"_site/sandbox\"\n fi\n mkdir -p \"$target\"\n cp -r \"${workingDir}/${outputDir}/.\" \"$target/\"\n done\n elif [ \"$DEPLOY_TYPE\" = \"storybook\" ]; then\n mkdir -p _site/sandbox\n cp -r \"${STORYBOOK_OUTPUT_DIR}/.\" _site/sandbox/\n fi\n\n - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0\n name: Upload pages artifact\n with:\n path: _site\n\n - uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1\n id: deployment\n name: Deploy to GitHub Pages\n";
|
|
57
|
+
var doctor_tokens_default$1 = "name: Doctor Tokens\n\n# Runs `holocron doctor tokens` on a schedule (#2158, epic #2147): for each layer and each token a configured plugin\n# declares, it reads the layer's 1Password Environment in memory and runs the provider's `token` probe against the token\n# held there, so a token that gained a permission it must not have, lost one it needs, is past its rotation age or is near\n# its expiry fails this job. A failed run reaches #alerts through `platform.notifications.yml`; there is no other channel.\n#\n# Only what the runner can read is checked. The job reads Environments through a 1Password service account\n# (`HOLOCRON_OP_SERVICE_ACCOUNT_TOKEN`); give it read access to the `ci` Environment and nothing else. A layer the\n# account cannot read (`local`, `dev`, `prod`) is a `skip` row with the reason, never a failure, so the run proves what CI\n# itself can reach and says what it did not look at. `doctor tokens` has no flag to limit the layers: a layer the account\n# can read is checked, and its fail rules are unchanged. Without the secret every row is a skip and the run passes, which\n# the job notes with a warning.\n#\n# Daily, a little after `check-tokens`, so a token near its expiry stays in view until it is renewed. Values are never\n# printed: the probes scrub every token they use from their output.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_OP_SERVICE_ACCOUNT_TOKEN:\n description: A 1Password service account with read access to the `ci` layer Environment.\n required: false\n\njobs:\n doctor-tokens:\n name: Run holocron doctor tokens\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.HOLOCRON_OP_SERVICE_ACCOUNT_TOKEN }}\n steps:\n - name: Warn when no Environment can be read\n if: ${{ env.OP_SERVICE_ACCOUNT_TOKEN == '' }}\n run: echo \"::warning::HOLOCRON_OP_SERVICE_ACCOUNT_TOKEN is not set, so no Environment can be read and every row is a skip.\"\n\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: 1password/install-cli-action@1a3160d5e9de1ae0803eaa08a88746f5ae3daa50 # v4.1.0\n name: Install the 1Password CLI\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Run holocron doctor tokens\n with:\n task: doctor-tokens\n";
|
|
57
58
|
var greet_default$1 = "name: Greetings\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n\njobs:\n greeting:\n name: Greet first-time contributors\n permissions:\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 5\n # Group by the issue/PR number so duplicate events don't race each other.\n steps:\n - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0\n name: Greet on first contribution\n with:\n script: |\n // Only greet on the initial open — ignore synchronize, reopened, etc.\n if (context.payload.action !== 'opened') return;\n\n const actor = context.actor;\n const { owner, repo } = context.repo;\n\n // Payload inspection is more reliable than context.eventName for detecting\n // whether this is an issue vs. PR event — works regardless of how GitHub\n // propagates event names through workflow_call chains.\n const isIssue = !!context.payload.issue && !context.payload.pull_request;\n // listForRepo returns both issues and PRs (GitHub treats PRs as issues),\n // sorted newest-first. Filter by type to track first-issue and first-PR\n // independently, and avoid search-index eventual-consistency lag.\n const { data: recent } = await github.rest.issues.listForRepo({\n owner, repo,\n creator: actor,\n state: 'all',\n per_page: 100\n });\n\n const sameType = recent.filter(item =>\n isIssue ? !item.pull_request : !!item.pull_request\n );\n\n if (sameType.length !== 1) return;\n const body = isIssue\n ? `Hey @${actor}!\\n\\nWe really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we are a limited number of volunteers, so it is possible that this will not be addressed as swiftly.\\n\\nYour patience is much appreciated and we will get back to you as quickly as possible.`\n : `Hey @${actor}!\\n\\nWe really appreciate you taking the time to help out with this PR. The collaborators on this project attempt to help as many people as possible, but we are a limited number of volunteers, so it is possible that this will not be addressed as swiftly.\\n\\nYour patience is much appreciated and we will get back to you as quickly as possible.`;\n\n await github.rest.issues.createComment({\n owner,\n repo,\n issue_number: context.issue.number,\n body\n });\n";
|
|
58
59
|
var label_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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n with:\n sparse-checkout: ${{ inputs.configuration-path || '.github/labeler.yml' }}\n sparse-checkout-cone-mode: false\n\n - uses: github/issue-labeler@ccca1e16fcb66762200e616fc29b57b940c1cb67 # v3.5\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";
|
|
59
60
|
var code_default$1$1 = "name: Static Analysis\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n HOLOCRON_TURBO_TOKEN:\n description: The Turbo remote cache token. Read first; the TURBO_TOKEN secret is the fallback.\n required: false\n TURBO_TOKEN:\n required: false\n\njobs:\n static-analysis:\n name: Run eslint, actionlint and prettier\n permissions:\n contents: read\n statuses: write\n runs-on: ubuntu-latest\n timeout-minutes: 15\n env:\n TURBO_TOKEN: ${{ secrets.HOLOCRON_TURBO_TOKEN || secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.HOLOCRON_TURBO_TEAM || vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1\n name: Checkout repository\n with:\n fetch-depth: 0\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n # actionlint has no npm distribution — install the prebuilt binary via\n # the maintainer's own documented download script.\n # NOTE: unverified against a live CI run at authoring time (D12) — flag\n # here if this needs adjustment.\n - name: Install actionlint\n run: |\n bash <(curl -sSf https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)\n sudo mv ./actionlint /usr/local/bin/actionlint\n\n - name: Check for merge-conflict markers\n # No package distributes this as a standalone tool — a plain grep for\n # the marker lines (the same check the old bundled linter ran, D12).\n run: |\n if grep -rlnE '^(<{7}|={7}|>{7})( |$)' \\\n --exclude-dir=.git --exclude-dir=node_modules .; then\n echo \"::error::merge-conflict markers found\"\n exit 1\n fi\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Run eslint and actionlint\n with:\n task: lint:code\n\n # prettier's check is the `format` action, not a workflow\n # of its own. It is called by path because the action is new and `theholocron/.github` is frozen, so no\n # remote copy of it exists; the path resolves in the repo that hosts the reusables, which is the only caller of\n # this file until `ci-v1` exists (then it becomes `theholocron/holocron/ci/actions/format@ci-v1`).\n - uses: ./ci/actions/format\n name: Run prettier\n";
|
|
@@ -134,6 +135,7 @@ const WORKFLOWS = Object.fromEntries(Object.entries(/* @__PURE__ */ Object.assig
|
|
|
134
135
|
"../workflows/deploy-preview.yml": deploy_preview_default$1,
|
|
135
136
|
"../workflows/deploy-sentinel.yml": deploy_sentinel_default$1,
|
|
136
137
|
"../workflows/deploy.yml": deploy_default$1,
|
|
138
|
+
"../workflows/doctor-tokens.yml": doctor_tokens_default$1,
|
|
137
139
|
"../workflows/greet.yml": greet_default$1,
|
|
138
140
|
"../workflows/label.yml": label_default$1,
|
|
139
141
|
"../workflows/lint/code.yml": code_default$1$1,
|
|
@@ -246,6 +248,13 @@ const LEGACY_CALLERS = {
|
|
|
246
248
|
name: "Token Expiry"
|
|
247
249
|
} }
|
|
248
250
|
},
|
|
251
|
+
"doctor-tokens": {
|
|
252
|
+
name: "Doctor Tokens",
|
|
253
|
+
jobs: { "doctor-tokens": {
|
|
254
|
+
id: "doctor-tokens",
|
|
255
|
+
name: "Doctor Tokens"
|
|
256
|
+
} }
|
|
257
|
+
},
|
|
249
258
|
"deploy-preview": {
|
|
250
259
|
name: "Delivery",
|
|
251
260
|
jobs: { "deploy-preview": {
|
|
@@ -856,6 +865,8 @@ var deploy_preview_default = "name: deploy-preview\n\non: # yamllint disable-lin
|
|
|
856
865
|
var deploy_sentinel_default = "name: deploy-sentinel\n\non: # yamllint disable-line rule:truthy\n push:\n branches: [main]\n paths:\n - \"apps/sentinel/**\"\n workflow_dispatch: {}\n\npermissions:\n contents: read\n\njobs:\n deploy-sentinel:\n name: deploy-sentinel\n uses: theholocron/.github/.github/workflows/deploy-sentinel.yml@main\n secrets: inherit\n";
|
|
857
866
|
// src/templates/workflows/deploy.yml
|
|
858
867
|
var deploy_default = "name: deploy\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/deploy.yml@main\n secrets: inherit\n";
|
|
868
|
+
// src/templates/workflows/doctor-tokens.yml
|
|
869
|
+
var doctor_tokens_default = "name: doctor-tokens\n\non: # yamllint disable-line rule:truthy\n schedule:\n - cron: \"41 6 * * *\"\n workflow_dispatch: {}\n\npermissions:\n contents: read\n\njobs:\n doctor-tokens:\n name: doctor-tokens\n uses: theholocron/.github/.github/workflows/doctor-tokens.yml@main\n secrets: inherit\n";
|
|
859
870
|
// src/templates/workflows/greet.yml
|
|
860
871
|
var greet_default = "name: greet\n\non: # yamllint disable-line rule:truthy\n pull_request:\n issues:\n\npermissions:\n issues: write\n pull-requests: write\n\njobs:\n greet:\n name: greet\n uses: theholocron/.github/.github/workflows/greet.yml@main\n secrets: inherit\n";
|
|
861
872
|
// src/templates/workflows/label.yml
|
|
@@ -1105,6 +1116,7 @@ const WORKFLOW_TEMPLATES = rehomeAll(Object.fromEntries(Object.entries(/* @__PUR
|
|
|
1105
1116
|
"../../templates/workflows/deploy-preview.yml": deploy_preview_default,
|
|
1106
1117
|
"../../templates/workflows/deploy-sentinel.yml": deploy_sentinel_default,
|
|
1107
1118
|
"../../templates/workflows/deploy.yml": deploy_default,
|
|
1119
|
+
"../../templates/workflows/doctor-tokens.yml": doctor_tokens_default,
|
|
1108
1120
|
"../../templates/workflows/greet.yml": greet_default,
|
|
1109
1121
|
"../../templates/workflows/label.yml": label_default,
|
|
1110
1122
|
"../../templates/workflows/lint/code.yml": code_default$1,
|
|
@@ -198,6 +198,11 @@ const TASKS = {
|
|
|
198
198
|
scope: "repo",
|
|
199
199
|
local: { command: "doctor secrets --verify" }
|
|
200
200
|
},
|
|
201
|
+
"doctor-tokens": {
|
|
202
|
+
group: "Security",
|
|
203
|
+
scope: "repo",
|
|
204
|
+
local: { command: "doctor tokens" }
|
|
205
|
+
},
|
|
201
206
|
build: {
|
|
202
207
|
group: "Delivery",
|
|
203
208
|
scope: "package",
|
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.441",
|
|
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",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"@commitlint/lint": "^21.2.3",
|
|
56
56
|
"@commitlint/load": "^21.2.3",
|
|
57
57
|
"@commitlint/types": "^21.2.3",
|
|
58
|
+
"@theholocron/datapad": "5.0.0-alpha.441",
|
|
58
59
|
"@theholocron/fs-utils": "^1.17.0-alpha.4",
|
|
59
60
|
"@theholocron/json-utils": "^1.17.0-alpha.4",
|
|
60
|
-
"@theholocron/pkg-utils": "^1.17.0-alpha.4",
|
|
61
61
|
"@theholocron/misc-utils": "^1.17.0-alpha.4",
|
|
62
|
-
"@theholocron/
|
|
62
|
+
"@theholocron/pkg-utils": "^1.17.0-alpha.4"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@commitlint/config-conventional": "^21.2.3",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"typescript": "^5.9.3",
|
|
75
75
|
"vitest": "^5.1.0",
|
|
76
76
|
"@theholocron/ci": "1.0.0",
|
|
77
|
+
"@theholocron/commitlint-config": "^8.9.0-alpha.17",
|
|
77
78
|
"@theholocron/eslint-config": "^8.9.0-alpha.17",
|
|
78
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.17",
|
|
79
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.17",
|
|
80
79
|
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.17",
|
|
81
|
-
"@theholocron/
|
|
82
|
-
"@theholocron/
|
|
80
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.17",
|
|
81
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.17",
|
|
82
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.17"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=22"
|