An open source design system that's fully customizable and agent ready
TypeScript
docs(theme): add npm install step to Theme System guide (#3094)
nynexman4464d5d2d57ae9c2
diff --git a/.changeset/theme-doc-install-step.md b/.changeset/theme-doc-install-step.mdnew file mode 100644index 0000000000..4085a99c6f--- /dev/null+++ b/.changeset/theme-doc-install-step.md@@ -0,0 +1,8 @@+---+'@astryxdesign/cli': patch+---++[docs] Add npm install step to the Theme System guide+@nynexman4464++The Quick Start section jumped straight to `import {neutralTheme} from '@astryxdesign/theme-neutral'`, which fails with `Cannot find module` for anyone who hasn't already installed the theme package. Prepend a one-line preamble + `npm install` code block, and add a short prose note above the Available Themes table pointing at the install command pattern. Reported in #3082.diff --git a/packages/cli/docs/theme.doc.dense.mjs b/packages/cli/docs/theme.doc.dense.mjsindex 8fc7d441d9..14dc8937b2 100644--- a/packages/cli/docs/theme.doc.dense.mjs+++ b/packages/cli/docs/theme.doc.dense.mjs@@ -5,8 +5,8 @@export const docsDense = {description: 'Theme provider, custom themes, light/dark, component overrides',sections: [- { title: 'Quick Start', content: [null, null, { type: 'prose', text: 'default import = runtime injection. /built import = pre-compiled CSS (pair with theme.css).' }] },- { title: 'Themes', content: [null, { type: 'prose', text: 'published: neutral (start here), butter, chocolate, gothic (dark-only), matcha, stone, y2k. @astryxdesign/theme-{name} = source (runtime). @astryxdesign/theme-{name}/built = optimized (+ theme.css).' }] },+ { title: 'Quick Start', content: [null, null, null, null, { type: 'prose', text: 'default import = runtime injection. /built import = pre-compiled CSS (pair with theme.css).' }] },+ { title: 'Themes', content: [null, null, { type: 'prose', text: 'published: neutral (start here), butter, chocolate, gothic (dark-only), matcha, stone, y2k. @astryxdesign/theme-{name} = source (runtime). @astryxdesign/theme-{name}/built = optimized (+ theme.css).' }] },{ title: 'Props', content: [null] },{ title: 'Custom Theme', content: [{ type: 'prose', text: 'CLI wizard or manual defineTheme. only override tokens that differ.' }, null] },{ title: 'defineTheme', content: [{ type: 'prose', text: 'scale configs (color, typography, radius, motion) + explicit token overrides + component overrides. color derives full palette from accent hex via HCT.' }, null, null] },diff --git a/packages/cli/docs/theme.doc.mjs b/packages/cli/docs/theme.doc.mjsindex 1d7feffdb5..6490565438 100644--- a/packages/cli/docs/theme.doc.mjs+++ b/packages/cli/docs/theme.doc.mjs@@ -14,6 +14,12 @@ export const docs = {title: 'Quick Start',category: 'guide',content: [+ {+ type: 'code',+ lang: 'bash',+ label: 'Install a theme package',+ code: 'npm install @astryxdesign/theme-neutral',+ },{type: 'code',lang: 'tsx',@@ -45,6 +51,10 @@ function App() {);}`,},+ {+ type: 'prose',+ text: 'Each theme ships as its own npm package. Install the one you want, then wrap your app in `<Theme>` — the same pattern works for every theme; just swap the package and import name.',+ },{type: 'prose',text: 'The default import uses runtime style injection, which works everywhere with no build step. The `/built` import skips injection and relies on the pre-compiled CSS file for better performance and SSR support.',@@ -55,6 +65,10 @@ function App() {title: 'Available Themes',category: 'guide',content: [+ {+ type: 'prose',+ text: 'Install the theme package you want with `npm install @astryxdesign/theme-{name}`, then import its theme object as shown below.',+ },{type: 'table',headers: ['Theme', 'Import', 'Description'],diff --git a/packages/cli/docs/theme.doc.zh.mjs b/packages/cli/docs/theme.doc.zh.mjsindex 1ab8dcc485..6a6a420836 100644--- a/packages/cli/docs/theme.doc.zh.mjs+++ b/packages/cli/docs/theme.doc.zh.mjs@@ -5,8 +5,8 @@export const docsZh = {description: 'Theme 提供者、自定义主题、亮/暗模式和组件样式覆盖。',sections: [- { title: '快速开始', content: [null, null, { type: 'prose', text: '默认导入使用运行时样式注入。/built 导入使用预编译 CSS(需配合 theme.css)。' }] },- { title: '可用主题', content: [null, { type: 'prose', text: '已发布主题:neutral(推荐起点)、butter、chocolate、gothic(仅暗色)、matcha、stone、y2k。@astryxdesign/theme-{name} = 源码版(运行时注入)。@astryxdesign/theme-{name}/built = 优化版(配合 theme.css)。' }] },+ { title: '快速开始', content: [null, null, null, null, { type: 'prose', text: '默认导入使用运行时样式注入。/built 导入使用预编译 CSS(需配合 theme.css)。' }] },+ { title: '可用主题', content: [null, null, { type: 'prose', text: '已发布主题:neutral(推荐起点)、butter、chocolate、gothic(仅暗色)、matcha、stone、y2k。@astryxdesign/theme-{name} = 源码版(运行时注入)。@astryxdesign/theme-{name}/built = 优化版(配合 theme.css)。' }] },{ title: 'Theme 属性', content: [null] },{ title: '创建自定义主题', content: [{ type: 'prose', text: '使用 CLI 向导(推荐)或手动 defineTheme。只覆盖与默认值不同的令牌。' }, null] },{ title: 'defineTheme', content: [{ type: 'prose', text: '支持比例配置(typography、radius、motion)+ 显式令牌覆盖 + 组件覆盖。' }, null, null] },