uniky 1.0.23 → 1.0.24

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,6 +1,6 @@
1
1
  {
2
2
  "name": "uniky",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "uni-app 开发工具库,包含 hooks、http 请求和 vite 插件",
5
5
  "type": "module",
6
6
  "main": "./src/lib/index.ts",
@@ -36,6 +36,30 @@ function findProjectRoot() {
36
36
  return process.cwd();
37
37
  }
38
38
 
39
+ function copyDirectorySkipExisting(source, target) {
40
+ if (!existsSync(target)) {
41
+ mkdirSync(target, { recursive: true });
42
+ }
43
+
44
+ const files = readdirSync(source);
45
+ let count = 0;
46
+
47
+ files.forEach(file => {
48
+ const sourcePath = join(source, file);
49
+ const targetPath = join(target, file);
50
+ const stat = statSync(sourcePath);
51
+
52
+ if (stat.isDirectory()) {
53
+ count += copyDirectorySkipExisting(sourcePath, targetPath);
54
+ } else if (!existsSync(targetPath)) {
55
+ copyFileSync(sourcePath, targetPath);
56
+ count++;
57
+ }
58
+ });
59
+
60
+ return count;
61
+ }
62
+
39
63
  function copyDirectoryRecursive(source, target) {
40
64
  if (!existsSync(target)) {
41
65
  mkdirSync(target, { recursive: true });
@@ -96,6 +120,17 @@ export * from './plugin/index.js';
96
120
  console.log(`[uniky] 创建索引文件: ${join(unikyDir, 'index.ts')}`);
97
121
 
98
122
  console.log(`[uniky] ✅ 插件文件已成功安装到 ${unikyDir} (${copiedCount} 个文件)`);
123
+
124
+ const skillsSourceDir = join(__dirname, '..', 'src', 'plugin', '.skills');
125
+ const skillsTargetDir = join(projectRoot, '.skills');
126
+ if (existsSync(skillsSourceDir)) {
127
+ const skillsCopied = copyDirectorySkipExisting(skillsSourceDir, skillsTargetDir);
128
+ if (skillsCopied > 0) {
129
+ console.log(`[uniky] ✅ .skills 拷贝了 ${skillsCopied} 个新文件到 ${skillsTargetDir}`);
130
+ } else {
131
+ console.log(`[uniky] .skills 文件已存在,跳过拷贝`);
132
+ }
133
+ }
99
134
  } catch (error) {
100
135
  console.error('[uniky] ❌ 插件文件安装失败:', error);
101
136
  console.error('[uniky] 错误堆栈:', error.stack);
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: create-page
3
+ description: 根据给出路径去创建一个uni-app 的页面
4
+ ---
5
+
6
+ # 创建页面流程逻辑说明
7
+
8
+ ## 项目基础
9
+ 该项目是uni-app的项目
10
+
11
+ ## 什么时候创建页面
12
+ 当给出页面路径时使用改路径去创建页面的vue文件,同时在src/pages.json文件中添加页面路由配置
13
+ 例如给我给出 pages/demo/index 时
14
+ (1)为我在 src/pages/demo 路径下创建 index.vue 作为页面文件
15
+ (2)在src/pages.json 中添加页面信息,
16
+
17
+ ```jsonc
18
+ {
19
+ "pages":[
20
+ {
21
+ "path": "pages/demo/index",
22
+ "style": "style": {
23
+ "navigationBarTitleText": "示例首页",
24
+ "navigationStyle": "default",
25
+ "backgroundColor": "#f8f8f8",
26
+ "navigationBarBackgroundColor": "#f8f8f8"
27
+ }
28
+ }
29
+ ]
30
+ }
31
+ ```
32
+
33
+ 如果路径以`pages-`开头 例如pages-order/list/query则作为子报添加到 subPackages 子模块中
34
+
35
+ ```jsonc
36
+ {
37
+ "subPackages":[
38
+ {
39
+ "root": "pages-order",
40
+ "pages": [
41
+ {
42
+ "path": "list/query",
43
+ "style": {
44
+ "navigationBarTitleText": "订单查询",
45
+ "navigationStyle": "default",
46
+ "backgroundColor": "#FFFFFF"
47
+ }
48
+ }
49
+ ]
50
+ }
51
+ ],
52
+ ]
53
+ }
54
+ ```
File without changes