Skip to content

ci(docs): guard skills/docs against bare metadata literals (#2035) - #2127

Merged
xuyushun441-sys merged 1 commit into
mainfrom
docs/mdx-authoring-guard
Jun 21, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
docs/mdx-authoring-guard

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Collaborator

Follow-up to #2124 — closes the drift root cause found while updating the docs.

Why

The example apps are kept on the defineX factories by an ESLint no-restricted-syntax rule. But TypeScript code blocks inside Markdown/MDX are not type-checked or ESLinted by anything — which is exactly how skills/ and content/docs/ drifted back to teaching : Page = {} while the examples stayed clean (the 23 stale spots fixed in #2124). Skills are the corpus AI authors from, so a stale sample there is the worst place for it. Without a guard, it drifts again.

What

scripts/check-doc-authoring.mjs (dependency-free, ~70 lines) scans every ```ts / ```typescript / ```tsx fenced block under skills/ and content/ for an exported metadata literal annotated with one of the 16 factory domains (or its Input alias) instead of the defineX(...) factory, and fails with file:line + guidance. Generated files (references/, the frontmatter-generated skills.mdx) are skipped.

Wired into lint.yml's ESLint job via pnpm check:doc-authoring — no build, no new dependency, mirrors the existing standalone-check pattern (check:api-surface, check:skill-docs).

Verification

The gate family this completes

layer guard scope
app code ESLint no-restricted-syntax examples/**, packages/apps/**
docs corpus check:doc-authoring skills/**, content/**
spec API check:api-surface (names + signatures) @objectstack/spec exports
live consumer downstream-smoke.sh hotcrm, pre-publish

CI-only — no package code, no changeset.

🤖 Generated with Claude Code

Closes the drift root cause found while updating the docs (#2124): TypeScript
code blocks in Markdown/MDX are not type-checked or ESLinted, so skills/ and
content/docs/ silently drifted back to teaching the bare `: Page = {}` literal
while the example apps — which the ESLint guard polices — stayed clean. Skills
are the corpus AI authors from, so a stale sample there is the worst place for it.

`scripts/check-doc-authoring.mjs` (dependency-free) scans every ```ts/typescript/
tsx fenced block under skills/ and content/ for an exported metadata literal
annotated with one of the 16 factory domains (or its Input alias) instead of the
`defineX(...)` factory, and fails with file:line + guidance. Generated files
(references/, the frontmatter-generated skills.mdx) are skipped.

Wired into lint.yml's ESLint job via `pnpm check:doc-authoring` (no build, no new
dep). Verified: 160 files clean on current main (#2124 migration holds); teeth
confirmed — flags a bare `: Page` block, ignores `definePage({...})`.

CI-only — no package code, no changeset.
@vercel

vercel Bot commented Jun 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 21, 2026 1:02pm

Request Review

This branch was successfully deployed

1 active deployment
Preview — bbfee172 Deployed Jun 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd dependencies Pull requests that update a dependency file size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants