@astryx-vue/cli 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,6 +26,8 @@ Agents should call a project script so the binary path stays stable:
26
26
 
27
27
  ```sh
28
28
  npm run astryx-vue -- component Button
29
+ npm run astryx-vue -- composable useClipboard
30
+ npm run astryx-vue -- docs guide/dark-mode
29
31
  npm run astryx-vue -- search dialog --json
30
32
  npm run astryx-vue -- manifest --json
31
33
  ```
@@ -35,8 +37,12 @@ npm run astryx-vue -- manifest --json
35
37
  | Command | What it prints |
36
38
  | --- | --- |
37
39
  | `astryx-vue component --list` | Every documented component |
38
- | `astryx-vue component <Name>` | Usage, props, slots, events, and notes for one component |
39
- | `astryx-vue search <query>` | Ranked components and guide topics |
40
+ | `astryx-vue component <Name>` | Usage, props, slots, events, examples, and notes for one component |
41
+ | `astryx-vue composable --list` | Every documented composable, the `use*` functions |
42
+ | `astryx-vue composable <Name>` | Parameters, return values, usage, and examples for one composable |
43
+ | `astryx-vue docs` | Every guide and theme topic |
44
+ | `astryx-vue docs <topic>` | One topic's page text, such as `docs guide/dark-mode` or `docs themes/tokens` |
45
+ | `astryx-vue search <query>` | Ranked components, composables, and docs topics |
40
46
  | `astryx-vue manifest --json` | Commands, options, response types, and exit codes |
41
47
  | `astryx-vue init --features agents` | Creates or refreshes the managed block in `AGENTS.md` |
42
48
 
@@ -49,6 +55,10 @@ Global flags:
49
55
  | `--zh` | Simplified Chinese where the docs have a translation. |
50
56
  | `--cwd <dir>` | Directory `init` writes into. |
51
57
 
58
+ A composable takes `useClipboard` or `use-clipboard`. `component useClipboard` still prints it, and adds a line that points at the `composable` command. `component --list` lists components only. `search --type` accepts `component`, `composable`, or `doc`; composable hits carry `domain: "composable"` and a `command` that points at `composable <Name>`.
59
+
60
+ `docs` takes a topic id, the same id with `themes/` instead of `theme/`, or a bare name that matches one topic, such as `dark-mode`. `--json` returns `docs.list` or `docs.detail`, and `docs.detail` includes the page `body`.
61
+
52
62
  `init` accepts `--agent cursor|claude|codex`. `cursor` and `codex` write `AGENTS.md`. `claude` writes `CLAUDE.md`. The default file is `AGENTS.md`.
53
63
 
54
64
  Exit codes are `0` for success, `1` when the command ran but failed, and `2` for invalid usage. Branch on `code` in the JSON envelope, not on the message text.
@@ -72,18 +82,19 @@ The block tells an agent how to query the CLI. It does not paste the component c
72
82
  The CLI does not keep a second copy of the component docs. `packages/cli/scripts/generate-catalog.mjs` reads:
73
83
 
74
84
  - `apps/docs/components/demos/*/meta.ts` for names, groups, and order
75
- - `apps/docs/docs/{en,zh}/components/<slug>/` for usage, props, slots, and events
85
+ - `apps/docs/docs/{en,zh}/components/<slug>/` for usage, props, slots, events, and example titles
86
+ - `apps/docs/components/demos/<slug>/*.vue` for the example source those pages point at
76
87
  - `apps/docs/components/demo-infra/reference/*.json` for anatomy and accessibility
77
- - `apps/docs/docs/{en,zh}/guide` and `themes` for search topics
88
+ - `apps/docs/docs/{en,zh}/guide` and `themes` for search topics and topic bodies
78
89
  - `packages/core/package.json` exports when a page does not show an import
79
90
 
80
- The result is committed at `packages/cli/src/generated/catalog.json`. After a docs change, regenerate it and commit the diff:
91
+ The result is committed at `packages/cli/src/generated/catalog.json`. `pnpm --filter @astryx-vue/cli build` regenerates it and bundles it into `dist`, which is what the published tarball runs. After a docs change, regenerate it and commit the diff:
81
92
 
82
93
  ```sh
83
94
  pnpm --filter @astryx-vue/cli generate
84
95
  ```
85
96
 
86
- `pnpm check` runs `generate:check` and fails if the file is stale.
97
+ `pnpm check` runs `generate:check`. That fails when `catalog.json` is stale, and when a PascalCase `@astryx-vue/core` export is not imported by any documented component. `./icons`, `./locale`, CSS, and the package root are not component exports.
87
98
 
88
99
  Theme, template, upgrade, doctor, swizzle, and MCP commands are not part of this package.
89
100
 
@@ -99,6 +110,8 @@ Theme, template, upgrade, doctor, swizzle, and MCP commands are not part of this
99
110
  ```sh
100
111
  pnpm --filter @astryx-vue/cli build
101
112
  node packages/cli/bin/astryx-vue.mjs component Button
113
+ node packages/cli/bin/astryx-vue.mjs composable useClipboard
114
+ node packages/cli/bin/astryx-vue.mjs docs guide/dark-mode --dense
102
115
  node packages/cli/bin/astryx-vue.mjs search installation --type doc
103
116
  node packages/cli/bin/astryx-vue.mjs manifest --json
104
117
  ```
package/README.zh-CN.md CHANGED
@@ -26,6 +26,8 @@ pnpm add -D @astryx-vue/cli
26
26
 
27
27
  ```sh
28
28
  npm run astryx-vue -- component Button
29
+ npm run astryx-vue -- composable useClipboard
30
+ npm run astryx-vue -- docs guide/dark-mode
29
31
  npm run astryx-vue -- search dialog --json
30
32
  npm run astryx-vue -- manifest --json
31
33
  ```
@@ -35,8 +37,12 @@ npm run astryx-vue -- manifest --json
35
37
  | 命令 | 输出 |
36
38
  | --- | --- |
37
39
  | `astryx-vue component --list` | 列出文档里的全部组件 |
38
- | `astryx-vue component <Name>` | 打印一个组件的用法、props、插槽、事件和补充说明 |
39
- | `astryx-vue search <query>` | 按相关度搜索组件和指南 |
40
+ | `astryx-vue component <Name>` | 打印一个组件的用法、props、插槽、事件、示例和补充说明 |
41
+ | `astryx-vue composable --list` | 列出文档里的全部组合式函数 |
42
+ | `astryx-vue composable <Name>` | 打印一个组合式函数的参数、返回值、用法和示例 |
43
+ | `astryx-vue docs` | 列出全部指南和主题 |
44
+ | `astryx-vue docs <topic>` | 打印一篇正文,例如 `docs guide/dark-mode` 或 `docs themes/tokens` |
45
+ | `astryx-vue search <query>` | 按相关度搜索组件、组合式函数和文档主题 |
40
46
  | `astryx-vue manifest --json` | 命令、选项、响应类型和退出码 |
41
47
  | `astryx-vue init --features agents` | 创建或刷新 `AGENTS.md` 里的托管区块 |
42
48
 
@@ -49,6 +55,10 @@ npm run astryx-vue -- manifest --json
49
55
  | `--zh` | 文档有简体中文时输出中文。 |
50
56
  | `--cwd <dir>` | `init` 写入的目录。 |
51
57
 
58
+ 组合式函数可以写 `useClipboard`,也可以写 `use-clipboard`。`component useClipboard` 仍然能查到,末尾会多一行提示,让你改用 `composable` 命令。`component --list` 只列组件。`search --type` 接受 `component`、`composable` 或 `doc`;组合式函数的结果 `domain` 是 `composable`,`command` 指向 `composable <Name>`。
59
+
60
+ `docs` 接受主题 id,也接受把 `theme/` 换成 `themes/` 的写法,或能唯一对上的短名字,例如 `dark-mode`。`--json` 返回 `docs.list` 或 `docs.detail`,`docs.detail` 里带正文 `body`。
61
+
52
62
  `init` 可以用 `--agent cursor|claude|codex`。`cursor` 和 `codex` 写 `AGENTS.md`,`claude` 写 `CLAUDE.md`。不传时写 `AGENTS.md`。
53
63
 
54
64
  退出码:`0` 成功,`1` 命令跑了但失败,`2` 用法不对。程序请判断 JSON 里的 `code`,不要依赖 `error` 的句子。
@@ -72,18 +82,19 @@ npm run astryx-vue -- manifest --json
72
82
  CLI 不另写一套组件说明。`packages/cli/scripts/generate-catalog.mjs` 读取:
73
83
 
74
84
  - `apps/docs/components/demos/*/meta.ts`:名称、分组和顺序
75
- - `apps/docs/docs/{en,zh}/components/<slug>/`:用法、props、插槽、事件
85
+ - `apps/docs/docs/{en,zh}/components/<slug>/`:用法、props、插槽、事件和示例标题
86
+ - `apps/docs/components/demos/<slug>/*.vue`:页面对应的示例源码
76
87
  - `apps/docs/components/demo-infra/reference/*.json`:结构和无障碍要求
77
- - `apps/docs/docs/{en,zh}/guide` 与 `themes`:搜索用的主题
88
+ - `apps/docs/docs/{en,zh}/guide` 与 `themes`:搜索用的主题,以及主题正文
78
89
  - 页面里没有 import 时,再用 `packages/core/package.json` 的 exports
79
90
 
80
- 生成结果提交在 `packages/cli/src/generated/catalog.json`。文档改了之后重新生成并提交:
91
+ 生成结果提交在 `packages/cli/src/generated/catalog.json`。`pnpm --filter @astryx-vue/cli build` 会重新生成,并打进 `dist`。发布出去的包跑的就是这份。文档改了之后重新生成并提交:
81
92
 
82
93
  ```sh
83
94
  pnpm --filter @astryx-vue/cli generate
84
95
  ```
85
96
 
86
- `pnpm check` 会跑 `generate:check`,文件过期就失败。
97
+ `pnpm check` 会跑 `generate:check`。`catalog.json` 过期会失败。`@astryx-vue/core` 里大写开头的导出没有被任何已文档化的组件 import,也会失败。`./icons`、`./locale`、CSS 和包根不算组件导出。
87
98
 
88
99
  这个包不做 theme、template、upgrade、doctor、swizzle 和 MCP。
89
100
 
@@ -99,6 +110,8 @@ pnpm --filter @astryx-vue/cli generate
99
110
  ```sh
100
111
  pnpm --filter @astryx-vue/cli build
101
112
  node packages/cli/bin/astryx-vue.mjs component Button
113
+ node packages/cli/bin/astryx-vue.mjs composable useClipboard
114
+ node packages/cli/bin/astryx-vue.mjs docs guide/dark-mode --dense
102
115
  node packages/cli/bin/astryx-vue.mjs search installation --type doc
103
116
  node packages/cli/bin/astryx-vue.mjs manifest --json
104
117
  ```