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

ci(docs): guard skills/docs against bare metadata literals (#2035)#2127
xuyushun441-sys merged 1 commit into
mainfrom
docs/mdx-authoring-guard

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

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

layerguardscope
app codeESLint no-restricted-syntaxexamples/**, packages/apps/**
docs corpuscheck:doc-authoringskills/**, content/**
spec APIcheck:api-surface (names + signatures)@objectstack/spec exports
live consumerdownstream-smoke.shhotcrm, 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

vercelBot commented Jun 21, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJun 21, 2026 1:02pm

Request Review

@github-actionsgithub-actionsBot added ci/cd dependencies Pull requests that update a dependency file size/s labels Jun 21, 2026
@xuyushun441-sys
xuyushun441-sys merged commit 1f8f6ac into mainJun 21, 2026
16 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the docs/mdx-authoring-guard branch June 21, 2026 13:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cddependenciesPull requests that update a dependency filesize/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang