mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-08 07:46:59 +00:00
scripts/cli-command-tree.ts loads every command module that cli.ts's
commandLoaders registers and prints the citty command tree (subcommands,
flags, aliases, value types, hidden and deprecated markers) as JSON. It reads
the real definitions, not --help text, so it sees exactly what citty parses.
scripts/check-docs-cli-references.mjs scans docs/**/*.mdx (fenced blocks with
backslash continuations, inline code, and the catalog's InstallCommand
command props) for `hyperframes ...` / `npx hyperframes ...` invocations and
resolves each one the way citty does: the first non-flag word that is not a
string flag's value names the subcommand. Unknown commands, subcommands and
flags are errors with a "did you mean"; deprecated commands and flags and
hidden flags are warnings. Placeholders (<dir>, [opts], {id}, $VAR, ...),
comments, `--`, other tools (`npx skills add heygen-com/hyperframes`,
`npm i -g hyperframes`) and the release logs are left alone. Quoted CLI
output opts out with {/* cli-references: ignore */}.
The Docs workflow runs it on docs and CLI source changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86 lines
2.5 KiB
YAML
86 lines
2.5 KiB
YAML
name: Docs
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# Suppress hyperframes CLI telemetry from HeyGen's own CI runs.
|
|
# External users' CI continues to emit telemetry unless they set this themselves.
|
|
env:
|
|
HYPERFRAMES_NO_TELEMETRY: "1"
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "docs/**"
|
|
- "DOCS_GUIDELINES.md"
|
|
- "packages/core/schemas/**"
|
|
- "scripts/sync-schemas.ts"
|
|
# A CLI change can strand a command or flag the docs still show.
|
|
- "packages/cli/src/**"
|
|
- "scripts/cli-command-tree.ts"
|
|
- "scripts/check-docs-cli-references.mjs"
|
|
- ".github/workflows/docs.yml"
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "docs/**"
|
|
- "DOCS_GUIDELINES.md"
|
|
- "packages/core/schemas/**"
|
|
- "scripts/sync-schemas.ts"
|
|
# A CLI change can strand a command or flag the docs still show.
|
|
- "packages/cli/src/**"
|
|
- "scripts/cli-command-tree.ts"
|
|
- "scripts/check-docs-cli-references.mjs"
|
|
- ".github/workflows/docs.yml"
|
|
|
|
concurrency:
|
|
group: docs-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate docs
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Check schema mirror (core → docs)
|
|
run: npx tsx scripts/sync-schemas.ts --check
|
|
|
|
- name: Validate build
|
|
working-directory: docs
|
|
run: npx mint validate
|
|
|
|
- name: Check broken links
|
|
working-directory: docs
|
|
# --check-redirects also resolves every redirect destination, so a
|
|
# restructure cannot leave a redirect pointing at a page it removed.
|
|
run: npx mint broken-links --check-redirects
|
|
|
|
cli-references:
|
|
name: CLI references
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
|
|
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
|
|
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- run: bash scripts/ci/install-workspace-dependencies.sh
|
|
|
|
# The command tree loads the CLI's command modules, which import core's generated sources.
|
|
- run: bun run --cwd packages/core build
|
|
|
|
- name: Check every command and flag the docs show exists in the CLI
|
|
run: node scripts/check-docs-cli-references.mjs
|