mvframe 1.0.18 → 1.0.58

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mvframe",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.0.18",
4
+ "version": "1.0.58",
5
5
  "author": "matt avis",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -49,7 +49,8 @@
49
49
  "dist/*",
50
50
  "scripts/install-cursor-skill.js",
51
51
  "scripts/scaffold-app.js",
52
- ".cursor/skills/mvframe-app-init"
52
+ ".cursor/skills/mvframe-app-init",
53
+ ".cursor/rules"
53
54
  ],
54
55
  "peerDependencies": {
55
56
  "element-plus": "^2.2.0"
@@ -57,7 +58,9 @@
57
58
  "dependencies": {
58
59
  "@visactor/vtable": "^1.26.0",
59
60
  "@visactor/vtable-editors": "^1.26.0",
61
+ "axios": "^1.7.9",
60
62
  "dayjs": "^1.11.20",
63
+ "flag-icons": "^7.2.3",
61
64
  "pinia": "^3.0.0",
62
65
  "vue": "^3.3.4",
63
66
  "vue-router": "^4.6.3",
@@ -66,6 +69,7 @@
66
69
  "devDependencies": {
67
70
  "@vitejs/plugin-vue": "^5.2.1",
68
71
  "@vue/shared": "^3.5.25",
72
+ "devrq": "file:../devrq",
69
73
  "element-plus": "^2.13.6",
70
74
  "rollup-plugin-terser": "^7.0.2",
71
75
  "sass-embedded": "^1.97.3",
File without changes
@@ -34,6 +34,27 @@ function write(rel, content) {
34
34
  console.log("[mvframe-init] 写入", rel);
35
35
  }
36
36
 
37
+ /**
38
+ * 将本包 `.cursor/rules/*.mdc` 复制到目标工程,与 mvframe 仓库内 Cursor 规则保持一致。
39
+ * 发布包需在 `package.json` 的 `files` 中包含 `.cursor/rules`。
40
+ */
41
+ function copyCursorRulesFromPackage() {
42
+ const rulesSrc = path.join(__dirname, "..", ".cursor", "rules");
43
+ if (!fs.existsSync(rulesSrc)) {
44
+ console.warn(
45
+ "[mvframe-init] 未找到包内 .cursor/rules(请使用含该目录的 mvframe 版本),跳过 Cursor 规则复制",
46
+ );
47
+ return;
48
+ }
49
+ const entries = fs.readdirSync(rulesSrc, { withFileTypes: true });
50
+ for (const ent of entries) {
51
+ if (!ent.isFile() || !ent.name.endsWith(".mdc")) continue;
52
+ const content = fs.readFileSync(path.join(rulesSrc, ent.name), "utf8");
53
+ const rel = path.join(".cursor", "rules", ent.name);
54
+ write(rel.replace(/\\/g, "/"), content);
55
+ }
56
+ }
57
+
37
58
  /** 与 main.js / vite.config 模板一致;版本号与 mvframe 本仓库对齐思路,可随发布调整 */
38
59
  // @vue/shared 为 Vue 3 内部包,传递依赖在部分包管理器下未提升时 Vite 解析失败,故写入直连依赖
39
60
  const SCAFFOLD_DEPENDENCIES = {
@@ -124,6 +145,8 @@ function main() {
124
145
  fs.mkdirSync(path.join(target, d), { recursive: true });
125
146
  }
126
147
 
148
+ copyCursorRulesFromPackage();
149
+
127
150
  write(
128
151
  "src/main.js",
129
152
  `import { createApp } from "vue";
@@ -754,6 +777,12 @@ yarn install
754
777
  | \`src/maps/index.js\` | 与库内置 \`maps/chip\` 深度合并(模块内);\`useMap().$l()\` / \`mapLangPath\` / \`mapLang\` 可由 auto-import 从 \`mvframe/maps\` 引入 |
755
778
  | \`src/composition\` | 可选,与 Vite 别名 \`@cps\` 对应 |
756
779
 
780
+ ## Cursor 规则(\`.cursor/rules\`)
781
+
782
+ 初始化脚本会把 **mvframe 包内**与仓库一致的 **\`*.mdc\`** 写入目标项目 **\`/.cursor/rules/\`**(\`component-hierarchy\`、\`script-setup\`、\`style-system\`、\`views\`、\`router\`、\`global-components\`、\`data\`、\`util\`)。若目录或文件已存在且未加 \`--force\`,则跳过对应文件。
783
+
784
+ npm 包需在 \`files\` 中包含 \`.cursor/rules\`;使用本地 \`file:\` / 源码链接时同样可用。
785
+
757
786
  ## Cursor Skill(可选)
758
787
 
759
788
  \`\`\`bash