Skip to content

fix(docs): restore pnpm check after catalog grade rename - #14

Open
0froq wants to merge 2 commits into
mainfrom
cursor/fix-docs-section-types-ae9b
Open

0froq wants to merge 2 commits into
mainfrom
cursor/fix-docs-section-types-ae9b

Conversation

@0froq

@0froq 0froq commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Related to CI failure on main tip 9a85656

Description

SECTIONS already used the foundation/chrome/control/pattern grades, but componentSectionLabel, the components index page, and en/zh/ja locale keys still referenced the old form/prose ids. This aligns labels and i18n with the current grade ids.

Docs typecheck also failed on Shiki theme JSON (type widened to string) and on defineNuxtConfig inference (excessive stack depth). Themes are narrowed with literal intersections; the config is passed through NuxtConfig with explicit hook parameter types.

Test

  • pnpm check
Open in Web Open in Cursor 

Update componentSectionLabel, the components index page, and en/zh/ja
locale keys for foundation, chrome, control, and pattern.
Narrow imported lig theme types and assign the config through NuxtConfig
so defineNuxtConfig no longer hits excessive stack depth.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 473c529 2026-11-04T00:30:06.996Z View logs ↗

@0froq

0froq commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/0froq/ui/14?from=0froq

raw result

💭 analyzed by pi/magpie/opencode-go/deepseek-v4.1-flash
🕰️ 2026-11-12 03:45 UTC
🔗 head 473c529
🤖 automated by pulls.review

{
  "headSha": "473c52924647a0a4fd986503fbae37df160de7bd",
  "result": {
    "overallSummary": "This PR repairs `pnpm check` on the docs package after the catalog section ids were renamed to the foundation/chrome/control/pattern grades. It re-aligns the section label mapping, the components index page and the en/zh/ja locale keys with those ids, and it silences two docs typecheck failures (Shiki theme JSON typing, `defineNuxtConfig` inference depth).",
    "groups": [
      {
        "key": "catalog-section-labels",
        "label": "Section labels → grade ids",
        "summary": "`SECTIONS` already used the new grade ids, but `componentSectionLabel` and the components index page still typed and switched on the old `form`/`prose` ids. `SectionId` is exported from `SECTIONS` so the page and the switch stay in lockstep with the single source of truth.",
        "category": "core",
        "filePaths": [
          "docs/app/utils/components.ts",
          "docs/app/pages/components/index.vue"
        ],
        "fileNotes": [
          {
            "path": "docs/app/pages/components/index.vue",
            "text": "The local `'' | 'form' | 'prose'` union is replaced by the exported `SectionId`, so new grades no longer need a manual edit here."
          }
        ],
        "lineNotes": [
          {
            "path": "docs/app/utils/components.ts",
            "side": "additions",
            "line": 41,
            "text": "`SectionLabelKey` is hard-coded as a literal union while `SectionId` is derived from `SECTIONS`: adding a section id without a matching locale key (or vice versa) is now a type error, but the two lists must be edited together."
          }
        ]
      },
      {
        "key": "i18n-section-keys",
        "label": "Locale section keys",
        "summary": "Renames the `components.sections.*` translation keys from `form`/`prose` to the four grade ids in en/ja/zh, so the labels rendered by `componentSectionLabel` resolve instead of falling back to raw keys.",
        "category": "i18n",
        "filePaths": [
          "docs/i18n/locales/en.json",
          "docs/i18n/locales/ja.json",
          "docs/i18n/locales/zh.json"
        ],
        "fileNotes": [
          {
            "path": "docs/i18n/locales/zh.json",
            "text": "`chrome` is translated as 装饰 (decoration) — worth a quick check that this is the intended reading for the chrome grade rather than a transliteration."
          }
        ]
      },
      {
        "key": "nuxt-typecheck",
        "label": "Nuxt config typecheck fixes",
        "summary": "Docs typecheck failed on two points: the Shiki theme JSON widening `type` to `string`, and excessive inference depth from `defineNuxtConfig`. Themes are narrowed with literal intersections and the config object is typed via `NuxtConfig`, with explicit hook parameter types.",
        "category": "build",
        "filePaths": [
          "docs/nuxt.config.ts"
        ],
        "lineNotes": [
          {
            "path": "docs/nuxt.config.ts",
            "side": "additions",
            "line": 164,
            "text": "The double cast (`as unknown as NuxtConfig`) opts the whole config object out of type checking against Nuxt's schema — a typo in any key or option inside will no longer be caught. Prefer `satisfies`/a directly typed object if the inference-depth issue can be narrowed to the offending property instead."
          },
          {
            "path": "docs/nuxt.config.ts",
            "side": "additions",
            "line": 13,
            "text": "`type: 'light' | 'dark'` is asserted onto the imported JSON; if `lig-themes.json` ever disagrees, the cast hides it and Shiki would receive a mismatched theme at runtime."
          }
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-12T03:45:37.785Z",
    "model": "pi/magpie/opencode-go/deepseek-v4.1-flash",
    "locale": "en"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants