Skip to content

refactor(typecheck): add staged wrapper for check:public:docapi#3477

Merged
caio-pizzol merged 2 commits into
mainfrom
caio-pizzol/SD-typecheck-docapi-wrapper
May 24, 2026
Merged

refactor(typecheck): add staged wrapper for check:public:docapi#3477
caio-pizzol merged 2 commits into
mainfrom
caio-pizzol/SD-typecheck-docapi-wrapper

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

DocAPI parity with the SuperDoc wrapper. check:public:docapi was a four-script && chain in root package.json; it now runs as a staged wrapper with the same shape as check:public:superdoc (named stages, progress markers, blurbs, stage headers + final elapsed time, re-run hint on failure).

Same display-name rules as PR #3474: plain kebab, scope-only, no check- prefix, no flags-in-names.

Stages

# Name Underlying command
1 contract-parity pnpm exec tsx packages/document-api/scripts/check-contract-parity.ts
2 contract-outputs pnpm exec tsx packages/document-api/scripts/check-contract-outputs.ts
3 examples pnpm exec tsx packages/document-api/scripts/check-examples.ts
4 overview-alignment pnpm exec tsx packages/document-api/scripts/check-overview-alignment.ts

Cheap-to-expensive ordering: contract drift fails in seconds, before the slower output comparison and doc gates.

What did NOT change

  • The four underlying tsx scripts: untouched.
  • docapi:check legacy alias: still pnpm run check:public:docapi.
  • check:public umbrella: still check:public:superdoc && check:public:docapi.
  • Clean-checkout safety: stage 2 still builds gitignored artifacts in memory; generate:docapi not a prerequisite.
  • Non-mutating: still safe in CI.

Verified

  • pnpm check:public:docapi β†’ PASS, 4 stages, 2.0s. All four stages print with the new display names.
  • pnpm check:public (umbrella, both wrappers) β†’ PASS end-to-end.
  • pnpm check:types β†’ PASS.

Stacked on #3476.

Review: confirm the wrapper docstring lists the 4 stages and the legacy docapi:check alias still resolves. AGENTS.md and the README row for check:public:docapi now mention the four stage names.

DocAPI parity with SuperDoc. The four check-* scripts previously ran
as a single `&&` chain in root package.json:

  cmd1 && cmd2 && cmd3 && cmd4

That gave no per-stage timing, no progress markers, no failure-rerun
hint, and no place to document why each stage exists.

scripts/check-public-docapi.mjs adopts the same shape as
scripts/check-public-contract.mjs:

  1. contract-parity        - operation IDs / member maps / runtime
                              shape agree
  2. contract-outputs       - tracked outputs match the contract;
                              gitignored outputs built in memory
  3. examples               - required workflow example headings exist
  4. overview-alignment     - overview MDX structural correctness

Same display-name convention as the SuperDoc wrapper: plain kebab,
scope-only, no `check-` prefix, no flags-in-names. Cheap-to-expensive
ordering. Re-run hint on failure prints the actual command.

Root package.json change is a one-liner: check:public:docapi now
invokes `node scripts/check-public-docapi.mjs`. `docapi:check`
legacy alias preserved.

Verified:
- pnpm check:public:docapi β†’ PASS, 4 stages, 2.0s
- pnpm check:public        β†’ PASS (both wrappers, end-to-end)
- pnpm check:types         β†’ PASS
The wrapper reports total elapsed time at the end, not per-stage
timing. Match what the script actually prints.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 24, 2026 11:08
Base automatically changed from caio-pizzol/SD-typecheck-facade-source-of-truth to main May 24, 2026 14:53
@caio-pizzol caio-pizzol merged commit 44eaa52 into main May 24, 2026
44 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/SD-typecheck-docapi-wrapper branch May 24, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant