diff --git a/.changeset/bright-docs-primitives.md b/.changeset/bright-docs-primitives.md new file mode 100644 index 0000000..7f0bb26 --- /dev/null +++ b/.changeset/bright-docs-primitives.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": minor +--- + +Add reusable ComponentExample, ApiTable, and PageHeader primitives for documentation interfaces. diff --git a/.changeset/calm-containers-toggle.md b/.changeset/calm-containers-toggle.md new file mode 100644 index 0000000..f64d186 --- /dev/null +++ b/.changeset/calm-containers-toggle.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": minor +--- + +Add Container, Section, and ThemeToggle components for unified responsive page layouts and ready-to-use theme toggles. diff --git a/.changeset/calm-markdown-renderer.md b/.changeset/calm-markdown-renderer.md new file mode 100644 index 0000000..6261511 --- /dev/null +++ b/.changeset/calm-markdown-renderer.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": minor +--- + +Add Markdown rendering system with GFM, TOC heading extraction, Shiki code blocks, and documentation directive extensions. diff --git a/.changeset/calm-shiki-pipeline.md b/.changeset/calm-shiki-pipeline.md new file mode 100644 index 0000000..5b21571 --- /dev/null +++ b/.changeset/calm-shiki-pipeline.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": patch +--- + +Reuse one process-wide Shiki highlighting pipeline during Nuxt SSR and prerendering while retaining on-demand grammar loading. diff --git a/.changeset/config.json b/.changeset/config.json index 38a3feb..b821332 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,11 +1,11 @@ { - "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", - "changelog": "@changesets/cli/changelog", - "commit": false, - "fixed": [], - "linked": [], - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "ignore": [] + "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] } diff --git a/.changeset/fair-inline-code-wraps.md b/.changeset/fair-inline-code-wraps.md new file mode 100644 index 0000000..c7945cf --- /dev/null +++ b/.changeset/fair-inline-code-wraps.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": patch +--- + +Wrap long InlineCode values into independently decorated line fragments in narrow containers instead of overflowing or leaving trailing background space. diff --git a/.changeset/green-search-inputs.md b/.changeset/green-search-inputs.md new file mode 100644 index 0000000..dbfda81 --- /dev/null +++ b/.changeset/green-search-inputs.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": minor +--- + +Add SearchInput and SearchBox components with debounced querying, clearable input, loading state, shortcuts, and suggestions flyout. diff --git a/.changeset/lazy-code-blocks-improve.md b/.changeset/lazy-code-blocks-improve.md new file mode 100644 index 0000000..62531bf --- /dev/null +++ b/.changeset/lazy-code-blocks-improve.md @@ -0,0 +1,5 @@ +--- +"@recloudstudio/ui": minor +--- + +Expand CodeBlock language support with on-demand syntax loading, resilient retries, accessible scrolling, adaptive line numbers, and smoother collapsed and height-limited states. diff --git a/AGENTS.md b/AGENTS.md index cc76829..5ddd949 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,11 +41,25 @@ Read only the standard required for the current work; do not preload all three t ## Verification -- For a library-only change, run `bun run --cwd packages/ui typecheck`, `bun run --cwd packages/ui test`, and `bun run --cwd packages/ui build`. -- For component, export, Nuxt-module, or documentation changes, also run `bun run --cwd apps/playground build`. +### Mandatory pre-commit gate + +**Before every `git commit` or push, run the complete verification sequence from the repository root. Do not skip a command because a subset was run earlier, and do not commit or push when any command fails.** + +1. Run `bun run format`. This command writes formatting changes; inspect and intentionally include or revert every resulting diff before continuing. +2. Run `git diff --check`. +3. Run `bun run lint`. +4. Run `bun run typecheck`. +5. Run `bun run test`. +6. Run `bun run build`. +7. Run `bun run ci` as the final aggregate gate, even though it repeats lint, typecheck, test, and build. + +For changes that affect component rendering, exports, the Nuxt module, Playground configuration, documentation pages, or static routes, also run `bun run --cwd apps/playground generate` after the mandatory gate. Stop any Playground dev server first because it holds `apps/playground/.nuxt`. + +Record the commands and their passing results in the handoff, PR, or final status report. If a formatter, build, test, or validation command changes files, repeat every affected verification command before committing. + +- `bun run ci` is the full workspace gate: `lint`, `typecheck`, `test`, then `build`. It does not replace the explicit commands above; the redundancy is intentional. +- Biome intentionally excludes `.vue` files, so do not treat a passing root lint as Vue validation. The Playground build/generate gate provides the required Vue and Nuxt coverage. - Put `--cwd` after `run`. Bun 1.4.2 treats `bun --cwd run diff --git a/apps/playground/components/DocApiTable.vue b/apps/playground/components/DocApiTable.vue deleted file mode 100644 index fe418e8..0000000 --- a/apps/playground/components/DocApiTable.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/apps/playground/components/DocExample.vue b/apps/playground/components/DocExample.vue deleted file mode 100644 index 582cdd8..0000000 --- a/apps/playground/components/DocExample.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/apps/playground/components/DocFooter.vue b/apps/playground/components/DocFooter.vue index 42b8d84..99b96cd 100644 --- a/apps/playground/components/DocFooter.vue +++ b/apps/playground/components/DocFooter.vue @@ -1,88 +1,46 @@ diff --git a/apps/playground/components/DocPageHeader.vue b/apps/playground/components/DocPageHeader.vue deleted file mode 100644 index 41c3f68..0000000 --- a/apps/playground/components/DocPageHeader.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/apps/playground/components/DocPageNav.vue b/apps/playground/components/DocPageNav.vue index 520fe4d..cd2f513 100644 --- a/apps/playground/components/DocPageNav.vue +++ b/apps/playground/components/DocPageNav.vue @@ -1,28 +1,21 @@ diff --git a/apps/playground/nuxt.config.ts b/apps/playground/nuxt.config.ts index ee77171..91a5140 100644 --- a/apps/playground/nuxt.config.ts +++ b/apps/playground/nuxt.config.ts @@ -1,46 +1,73 @@ -import { defineNuxtConfig } from 'nuxt/config' -import tailwindcss from '@tailwindcss/vite' -import { createThemeInitScript } from '../../packages/ui/src/utils/themeScript' +import { fileURLToPath } from "node:url"; +import { defineNuxtConfig } from "nuxt/config"; +import tailwindcss from "@tailwindcss/vite"; +import { createThemeInitScript } from "../../packages/ui/src/utils/themeScript"; + +// Dev 直连源码:模块、组件、组合式函数与图标都指向 packages/ui/src, +// 源码改动即时 HMR,无需先构建 dist。生产构建仍消费 dist(与发布产物一致)。 +const isDev = process.env.NODE_ENV === "development"; +const uiSrc = (path: string) => + fileURLToPath(new URL(`../../packages/ui/src/${path}`, import.meta.url)); export default defineNuxtConfig({ // 固定 buildDir:Nuxt 4 生产构建会在 .nuxt 已存在时自动切到 node_modules/.cache, // 导致 tsconfig extends 在干净环境(CI/Pages)与本地行为不一致 - buildDir: '.nuxt', - css: ['~/src/style.css'], - modules: [['@recloudstudio/ui/nuxt', { prefix: '', injectTheme: false }]], + buildDir: ".nuxt", + css: ["~/src/style.css"], + modules: [ + [ + // Dev 加载 Nuxt 模块源码,组件自动注册随之指向 packages/ui/src。 + isDev ? uiSrc("nuxt/index.ts") : "@recloudstudio/ui/nuxt", + { prefix: "", injectTheme: false }, + ], + ], app: { head: { - title: 'ReCloud UI · ReCloud Studio 设计系统', + title: "ReCloud UI · ReCloud Studio 设计系统", script: [ { // 首屏应用完整的主题偏好,避免 Vue hydration 前的颜色、密度与圆角闪烁。 - innerHTML: createThemeInitScript() - } + innerHTML: createThemeInitScript(), + }, ], link: [ - { rel: 'icon', type: 'image/svg+xml', href: '/icon.svg' }, - { rel: 'apple-touch-icon', href: '/icon.svg' }, + { rel: "icon", type: "image/svg+xml", href: "/icon.svg" }, + { rel: "apple-touch-icon", href: "/icon.svg" }, // 全站字体:Maple Mono NF CN(OFL-1.1,v7.9),由 ZeoSeven FontsAPI 按 unicode-range 分包提供。 // 四个字重同属 "Maple Mono NF CN" 族,对应 font-normal / medium / semibold / bold。 - { rel: 'preconnect', href: 'https://fontsapi.zeoseven.com', crossorigin: '' }, - ...['main', 'medium', 'semi-bold', 'bold'].map((style) => ({ - rel: 'stylesheet' as const, - href: `https://fontsapi.zeoseven.com/442/${style}/result.css` - })) - ] - } + { rel: "preconnect", href: "https://fontsapi.zeoseven.com", crossorigin: "" }, + ...["main", "medium", "semi-bold", "bold"].map((style) => ({ + rel: "stylesheet" as const, + href: `https://fontsapi.zeoseven.com/442/${style}/result.css`, + })), + ], + }, }, vite: { - plugins: [tailwindcss()] + plugins: [tailwindcss()], + ...(isDev + ? { + resolve: { + // 子路径必须排在包名之前:字符串别名按前缀匹配,顺序即优先级。 + alias: { + "@recloudstudio/ui/icons": uiSrc("icons/index.ts"), + "@recloudstudio/ui/markdown": uiSrc("markdown/index.ts"), + "@recloudstudio/ui": uiSrc("index.ts"), + }, + }, + // Dev 下 SSR 同样走源码,避免服务端 external 到 dist 造成双实例。 + ssr: { noExternal: [/^@recloudstudio\/ui(\/.*)?$/] }, + } + : {}), }, devtools: { enabled: true }, runtimeConfig: { public: { - cfPages: process.env.CF_PAGES || '', - cfPagesBranch: process.env.CF_PAGES_BRANCH || '', - cfPagesCommitSha: process.env.CF_PAGES_COMMIT_SHA || '', - cfPagesUrl: process.env.CF_PAGES_URL || '' - } + cfPages: process.env.CF_PAGES || "", + cfPagesBranch: process.env.CF_PAGES_BRANCH || "", + cfPagesCommitSha: process.env.CF_PAGES_COMMIT_SHA || "", + cfPagesUrl: process.env.CF_PAGES_URL || "", + }, }, - compatibilityDate: '2026-10-02' -}) + compatibilityDate: "2026-10-02", +}); diff --git a/apps/playground/package.json b/apps/playground/package.json index d61f45b..ad21163 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "nuxt dev", + "dev": "nuxt dev --host 0.0.0.0 --port 3100", "build": "nuxt build", "generate": "nuxt generate", "preview": "nuxt preview", @@ -12,13 +12,14 @@ }, "dependencies": { "@recloudstudio/ui": "workspace:*", - "nuxt": "^4.0.0" + "nuxt": "^4.0.0", + "vue-router": "^5.3.1" }, "devDependencies": { "@tailwindcss/vite": "^4.0.0", "shiki": "^4.5.0", "tailwindcss": "^4.0.0", "typescript": "^5.7.2", - "vue-tsc": "^2.2.8" + "vue-tsc": "^3.3.12" } } diff --git a/apps/playground/pages/components/accordion.vue b/apps/playground/pages/components/accordion.vue index 08bc33d..497e996 100644 --- a/apps/playground/pages/components/accordion.vue +++ b/apps/playground/pages/components/accordion.vue @@ -1,16 +1,16 @@