pandax 0.0.1 → 0.0.2-beta.1
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 +37 -9
- package/bin/pandax.js +1037 -37
- package/package.json +3 -2
- package/skills/pandax-frontend-architecture/SKILL.md +1459 -1239
- package/templates/pandax-monorepo/apps/base/package.json +5 -2
- package/templates/pandax-monorepo/apps/base/src/views/home/index.vue +5 -0
- package/templates/pandax-monorepo/apps/base/uno.config.ts +2 -0
- package/templates/pandax-monorepo/apps/base/vite.config.ts +4 -2
- package/templates/pandax-monorepo/apps/main/package.json +2 -1
- package/templates/pandax-monorepo/apps/main/uno.config.ts +2 -0
- package/templates/pandax-monorepo/apps/main/vite.config.ts +1 -1
- package/templates/pandax-monorepo/package.json +1 -1
- package/templates/pandax-monorepo/packages/components/package.json +58 -5
- package/templates/pandax-monorepo/packages/components/src/button/Prop.ts +8 -0
- package/templates/pandax-monorepo/packages/components/src/button/Type.ts +4 -0
- package/templates/pandax-monorepo/packages/components/src/button/index.module.scss +3 -0
- package/templates/pandax-monorepo/packages/components/src/button/index.ts +11 -0
- package/templates/pandax-monorepo/packages/components/src/button/index.vue +74 -0
- package/templates/pandax-monorepo/packages/components/src/card/Prop.ts +6 -0
- package/templates/pandax-monorepo/packages/components/src/card/Type.ts +3 -0
- package/templates/pandax-monorepo/packages/components/src/card/index.module.scss +7 -0
- package/templates/pandax-monorepo/packages/components/src/card/index.ts +11 -0
- package/templates/pandax-monorepo/packages/components/src/card/index.vue +78 -0
- package/templates/pandax-monorepo/packages/components/src/composables/use-locale/Type.ts +6 -0
- package/templates/pandax-monorepo/packages/components/src/composables/use-locale/index.ts +35 -0
- package/templates/pandax-monorepo/packages/components/src/index.ts +23 -2
- package/templates/pandax-monorepo/packages/components/src/install.ts +23 -0
- package/templates/pandax-monorepo/packages/components/src/locales/en-US.ts +9 -0
- package/templates/pandax-monorepo/packages/components/src/locales/index.ts +10 -0
- package/templates/pandax-monorepo/packages/components/src/locales/zh-CN.ts +9 -0
- package/templates/pandax-monorepo/packages/components/src/resolver.ts +25 -0
- package/templates/pandax-monorepo/packages/components/src/vue-i18n.ts +15 -0
- package/templates/pandax-monorepo/packages/components/tsconfig.json +18 -0
- package/templates/pandax-monorepo/packages/components/vite.config.ts +32 -0
- package/templates/pandax-monorepo/pnpm-lock.yaml +5962 -0
- package/templates/pandax-monorepo/pnpm-workspace.yaml +3 -0
- package/templates/pandax-monorepo/turbo.json +1 -1
- package/templates/ui-lib/.editorconfig +16 -0
- package/templates/ui-lib/.husky/commit-msg +2 -0
- package/templates/ui-lib/.husky/pre-commit +2 -0
- package/templates/ui-lib/.prettierrc.json +28 -0
- package/templates/ui-lib/README.md +49 -0
- package/templates/ui-lib/commitlint.config.js +38 -0
- package/templates/ui-lib/env.d.ts +7 -0
- package/templates/ui-lib/eslint.config.js +60 -0
- package/templates/ui-lib/package.json +73 -0
- package/templates/ui-lib/playground/App.vue +13 -0
- package/templates/ui-lib/playground/index.html +12 -0
- package/templates/ui-lib/playground/main.ts +11 -0
- package/templates/ui-lib/playground/vite.config.ts +12 -0
- package/templates/ui-lib/pnpm-lock.yaml +5660 -0
- package/templates/ui-lib/src/button/Prop.ts +5 -0
- package/templates/ui-lib/src/button/Type.ts +3 -0
- package/templates/ui-lib/src/button/index.module.scss +3 -0
- package/templates/ui-lib/src/button/index.ts +11 -0
- package/templates/ui-lib/src/button/index.vue +34 -0
- package/templates/ui-lib/src/card/Prop.ts +4 -0
- package/templates/ui-lib/src/card/Type.ts +1 -0
- package/templates/ui-lib/src/card/index.module.scss +3 -0
- package/templates/ui-lib/src/card/index.ts +11 -0
- package/templates/ui-lib/src/card/index.vue +21 -0
- package/templates/ui-lib/src/composables/use-locale/Type.ts +6 -0
- package/templates/ui-lib/src/composables/use-locale/index.ts +35 -0
- package/templates/ui-lib/src/index.ts +22 -0
- package/templates/ui-lib/src/install.ts +23 -0
- package/templates/ui-lib/src/locales/en-US.ts +9 -0
- package/templates/ui-lib/src/locales/index.ts +10 -0
- package/templates/ui-lib/src/locales/zh-CN.ts +9 -0
- package/templates/ui-lib/src/resolver.ts +25 -0
- package/templates/ui-lib/src/vue-i18n.ts +15 -0
- package/templates/ui-lib/tsconfig.json +23 -0
- package/templates/ui-lib/tsconfig.node.json +10 -0
- package/templates/ui-lib/uno.config.ts +5 -0
- package/templates/ui-lib/vite.config.ts +27 -0
- package/templates/pandax-monorepo/packages/components/src/PandaButton.vue +0 -15
- package/templates/pandax-monorepo/packages/components/src/PandaCard.vue +0 -16
package/README.md
CHANGED
|
@@ -24,11 +24,47 @@ npx pandax --tool codebuddy
|
|
|
24
24
|
## 初始化项目模板
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npx pandax --init
|
|
27
|
+
npx pandax --init # 交互式选择项目类型
|
|
28
|
+
npx pandax --init ui-lib # 初始化独立组件库(交互式配置)
|
|
29
|
+
npx pandax --init ui-lib --name my-ui --prefix A --no-i18n # 全参数跳过交互
|
|
28
30
|
npx pandax --init pandax-monorepo # 初始化 Monorepo + 微前端模板
|
|
29
31
|
npx pandax --init vue3 --with-skills # 初始化模板并安装 skills
|
|
30
32
|
```
|
|
31
33
|
|
|
34
|
+
## 追加微前端子应用
|
|
35
|
+
|
|
36
|
+
在已通过 `npx pandax --init pandax-monorepo` 初始化的 monorepo 根目录执行:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pandax add-app --name <slug> # 交互式:默认端口(自动分配)+ 全量依赖
|
|
40
|
+
pandax add-app --name order --port 7102 # 显式端口
|
|
41
|
+
pandax add-app --name simple --no-router --no-pinia # 最简依赖:移除 Router/Pinia
|
|
42
|
+
pandax add-app --name report --no-register # 不自动注入主应用,仅输出手动代码片段
|
|
43
|
+
pandax add-app --name finance --pkg-prefix myorg- # 自定义 package name 前缀
|
|
44
|
+
pandax add-app --name order --with-skills # 创建子应用并同步安装 pandax skills
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
完成后自动:
|
|
48
|
+
- 以 `apps/base` 为基线克隆到 `apps/<slug>/`
|
|
49
|
+
- 改写 package.json name / dev / preview 端口
|
|
50
|
+
- 按需移除依赖(`--no-*`)
|
|
51
|
+
- 往 `apps/main/src/router/index.ts` 注入微应用路由条目
|
|
52
|
+
- 往 `apps/main/src/main.ts` 的 `setupApp({...})` 追加注册
|
|
53
|
+
|
|
54
|
+
任何一步注入失败会打印需要手动粘贴的代码框,保证命令零崩溃。
|
|
55
|
+
|
|
56
|
+
### ui-lib 模式 CLI 参数
|
|
57
|
+
|
|
58
|
+
| 参数 | 说明 | 默认值 |
|
|
59
|
+
|------|------|--------|
|
|
60
|
+
| `--name <pkg>` | npm 包名(小写,`^[a-z][a-z0-9-]*$`) | `my-ui-lib` |
|
|
61
|
+
| `--prefix <Pascal>` | 组件前缀(PascalCase) | `My` |
|
|
62
|
+
| `--i18n` / `--no-i18n` | 启用/关闭国际化 | 启用 |
|
|
63
|
+
| `--element-plus` / `--no-element-plus` | 启用/关闭 Element Plus | 启用 |
|
|
64
|
+
| `--pm <pnpm\|npm\|yarn>` | 包管理器 | `pnpm` |
|
|
65
|
+
|
|
66
|
+
初始化后的组件库支持:独立 npm 发布、Monorepo 源码引用、组件与 CSS 按需引入、国际化(详见 [pandax-frontend-architecture](skills/pandax-frontend-architecture/SKILL.md))。
|
|
67
|
+
|
|
32
68
|
## 卸载
|
|
33
69
|
|
|
34
70
|
```bash
|
|
@@ -43,7 +79,6 @@ npx pandax --uninstall
|
|
|
43
79
|
|-------|------|
|
|
44
80
|
| [pandax-frontend-architecture](skills/pandax-frontend-architecture/SKILL.md) | 设计前端项目架构与技术方案 |
|
|
45
81
|
| [pandax-frontend-component-review](skills/pandax-frontend-component-review/SKILL.md) | 审查 Vue/React 组件代码 |
|
|
46
|
-
| [pandax-frontend-chinese-copywriting](skills/pandax-frontend-chinese-copywriting/SKILL.md) | 检查并修正项目中的中文文案排版 |
|
|
47
82
|
| [pandax-frontend-api-mock](skills/pandax-frontend-api-mock/SKILL.md) | 规范 API 对接与 Mock 数据管理 |
|
|
48
83
|
| [pandax-frontend-requirement](skills/pandax-frontend-requirement/SKILL.md) | 梳理前端需求并输出可执行方案 |
|
|
49
84
|
| [pandax-frontend-standards](skills/pandax-frontend-standards/SKILL.md) | 统一引用前端规范文档 |
|
|
@@ -71,13 +106,6 @@ npx pandax --uninstall
|
|
|
71
106
|
node bin/pandax.js --tool trae
|
|
72
107
|
```
|
|
73
108
|
|
|
74
|
-
### 发布到 npm
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
npm login
|
|
78
|
-
npm publish --access public
|
|
79
|
-
```
|
|
80
|
-
|
|
81
109
|
## 参考
|
|
82
110
|
|
|
83
111
|
- [superpowers-zh](https://www.npmjs.com/package/superpowers-zh)
|