mvframe 1.0.81 → 1.0.83
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/.cursor/rules/style-system.mdc +45 -0
- package/README.cn.md +25 -0
- package/README.md +25 -0
- package/dist/css/cpt.css +1 -1
- package/dist/css/style.css +1 -1
- package/dist/vendor.js +1920 -1743
- package/package.json +1 -1
- package/scripts/install-codex-agents.js +0 -0
- package/scripts/scaffold-app.js +32 -7
package/package.json
CHANGED
|
File without changes
|
package/scripts/scaffold-app.js
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* 在目标工程生成 MVFrame 推荐目录与雏形文件(views / component / api / pinia / router / config / assets)。
|
|
4
4
|
*
|
|
5
5
|
* 用法:
|
|
6
|
-
* node path/to/mvframe/scripts/scaffold-app.js [项目根] [--force]
|
|
6
|
+
* node path/to/mvframe/scripts/scaffold-app.js [项目根] [--force|-f]
|
|
7
7
|
* yarn exec mvframe-init-app
|
|
8
8
|
*
|
|
9
9
|
* 环境变量:MVFRAME_SCAFFOLD_TARGET=/path/to/project
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* 选项:
|
|
12
|
+
* --force, -f 覆盖已存在的脚手架文件
|
|
13
|
+
* --no-package-json, -n 不读不写 package.json(仅生成源码与 Vite 配置)
|
|
12
14
|
*/
|
|
13
15
|
|
|
14
16
|
const fs = require("fs");
|
|
@@ -16,10 +18,10 @@ const path = require("path");
|
|
|
16
18
|
const { execFileSync } = require("child_process");
|
|
17
19
|
const { upsertCodexAgents } = require("./install-codex-agents.js");
|
|
18
20
|
|
|
19
|
-
const FORCE = process.argv.includes("--force");
|
|
20
|
-
const NO_PKG = process.argv.includes("--no-package-json");
|
|
21
|
+
const FORCE = process.argv.includes("--force") || process.argv.includes("-f");
|
|
22
|
+
const NO_PKG = process.argv.includes("--no-package-json") || process.argv.includes("-n");
|
|
21
23
|
const argPath = process.argv.find(
|
|
22
|
-
(a, i) => i >= 2 &&
|
|
24
|
+
(a, i) => i >= 2 && !a.startsWith("-"),
|
|
23
25
|
);
|
|
24
26
|
const target = path.resolve(
|
|
25
27
|
process.env.MVFRAME_SCAFFOLD_TARGET || argPath || process.cwd(),
|
|
@@ -831,7 +833,7 @@ yarn dev
|
|
|
831
833
|
yarn exec mvframe-d
|
|
832
834
|
\`\`\`
|
|
833
835
|
|
|
834
|
-
若需跳过对 \`package.json\` 的修改:\`node scripts/scaffold-app.js --no-package-json\`。
|
|
836
|
+
若需跳过对 \`package.json\` 的修改:\`node scripts/scaffold-app.js --no-package-json\` 或 \`node scripts/scaffold-app.js -n\`。
|
|
835
837
|
|
|
836
838
|
自动生成的 \`vite.config.js\` 已包含 \`unplugin-auto-import\`;\`dts: true\` 时类型默认写在项目根 \`auto-imports.d.ts\`。
|
|
837
839
|
|
|
@@ -865,6 +867,29 @@ yarn exec mvframe-d
|
|
|
865
867
|
|
|
866
868
|
\`src/main.js\` 已包含 \`import "mvframe/style"\` 与 \`import "mvframe/style/cpt"\`(分别对应工具类/变量与 **Mvc\*** 组件 scoped 等样式),一般 **无需** 在 \`index.scss\` 再引一遍 mvframe 的 dist CSS,以免重复。项目级覆盖写在 \`src/assets/style/index.scss\` 即可。
|
|
867
869
|
|
|
870
|
+
## 表单 Label
|
|
871
|
+
|
|
872
|
+
\`Input\`、\`Textarea\`、\`Select\`、\`SelectV2\` 支持统一的 label 接口:
|
|
873
|
+
|
|
874
|
+
\`\`\`vue
|
|
875
|
+
<Input v-model="form.name" label="Name" />
|
|
876
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
877
|
+
|
|
878
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
879
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
880
|
+
|
|
881
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
882
|
+
<Select v-model="form.type" :options="options" label="Material Type" material-label />
|
|
883
|
+
\`\`\`
|
|
884
|
+
|
|
885
|
+
规则:
|
|
886
|
+
|
|
887
|
+
- 只传 \`label\`:渲染普通上方标题
|
|
888
|
+
- 传 \`label\` + \`material-label\`:渲染 Material 风格浮动标签
|
|
889
|
+
- 不传 \`label\`:保持组件默认外观
|
|
890
|
+
|
|
891
|
+
Material 风格 label 的公共壳样式统一在 \`src/style/chip/element.scss\`。如果你要做 Material 风格表单,优先直接使用 \`label\` + \`material-label\`,不要在业务侧再重复写一套浮动标题。
|
|
892
|
+
|
|
868
893
|
## 子路径(按需)
|
|
869
894
|
|
|
870
895
|
发布包 \`exports\` 还提供 \`mvframe/composition\`、\`mvframe/util\`、\`mvframe/store\`、\`mvframe/notify\` 等,业务侧可 \`import { ... } from "mvframe/composition"\` 等,参见包内 \`package.json\` 的 \`exports\`。
|
|
@@ -934,7 +959,7 @@ yarn exec mvframe-install-codex-rules
|
|
|
934
959
|
|
|
935
960
|
## Cursor 规则(\`.cursor/rules\`)
|
|
936
961
|
|
|
937
|
-
初始化脚本会把 **mvframe 包内**与仓库一致的 **\`*.mdc\`** 写入目标项目 **\`/.cursor/rules/\`**(\`component-hierarchy\`、\`script-setup\`、\`style-system\`、\`views\`、\`router\`、\`global-components\`、\`data\`、\`util\`)。若目录或文件已存在且未加 \`--force\`,则跳过对应文件。
|
|
962
|
+
初始化脚本会把 **mvframe 包内**与仓库一致的 **\`*.mdc\`** 写入目标项目 **\`/.cursor/rules/\`**(\`component-hierarchy\`、\`script-setup\`、\`style-system\`、\`views\`、\`router\`、\`global-components\`、\`data\`、\`util\`)。若目录或文件已存在且未加 \`--force\` / \`-f\`,则跳过对应文件。
|
|
938
963
|
|
|
939
964
|
npm 包需在 \`files\` 中包含 \`.cursor/rules\`;使用本地 \`file:\` / 源码链接时同样可用。
|
|
940
965
|
|