cloudcc-cli 2.2.2 → 2.2.4

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.
Files changed (174) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/README.md +47 -0
  3. package/bin/cc.js +11 -35
  4. package/bin/index.js +33 -0
  5. package/bin/mcp-svc.js +13 -0
  6. package/bin/mcp.js +18 -0
  7. package/java/com/cloudcc/core/TriggerInvoker.java +17 -1
  8. package/package.json +16 -7
  9. package/pom.xml +1 -0
  10. package/prompt/DevelopmentEnvironmentConstruction.ts +133 -0
  11. package/prompt/ccdk.ts +1190 -0
  12. package/prompt/ccprompt.ts +8 -0
  13. package/prompt/cloudccdev.ts +109 -0
  14. package/prompt/index.ts +52 -0
  15. package/prompt/objectInfo.ts +94 -0
  16. package/prompt/objectList.ts +25 -0
  17. package/prompt/openapi.ts +310 -0
  18. package/prompt/system.ts +14 -0
  19. package/prompt/vscodeExtension.ts +27 -0
  20. package/src/approval/approve.js +105 -0
  21. package/src/approval/get.js +245 -0
  22. package/src/approval/index.js +11 -0
  23. package/src/approval/reject.js +105 -0
  24. package/src/brief/get.js +51 -0
  25. package/src/brief/index.js +7 -0
  26. package/src/config/get.js +1 -1
  27. package/src/fields/create.js +204 -0
  28. package/src/fields/fields/A.js +23 -0
  29. package/src/fields/fields/AD.js +25 -0
  30. package/src/fields/fields/B.js +28 -0
  31. package/src/fields/fields/C.js +28 -0
  32. package/src/fields/fields/D.js +27 -0
  33. package/src/fields/fields/E.js +28 -0
  34. package/src/fields/fields/ENC.js +28 -0
  35. package/src/fields/fields/ENCD.js +28 -0
  36. package/src/fields/fields/F.js +27 -0
  37. package/src/fields/fields/FL.js +25 -0
  38. package/src/fields/fields/H.js +27 -0
  39. package/src/fields/fields/IMG.js +27 -0
  40. package/src/fields/fields/J.js +26 -0
  41. package/src/fields/fields/L.js +32 -0
  42. package/src/fields/fields/LT.js +28 -0
  43. package/src/fields/fields/M.js +29 -0
  44. package/src/fields/fields/MR.js +24 -0
  45. package/src/fields/fields/N.js +30 -0
  46. package/src/fields/fields/P.js +28 -0
  47. package/src/fields/fields/Q.js +35 -0
  48. package/src/fields/fields/S.js +30 -0
  49. package/src/fields/fields/SCORE.js +24 -0
  50. package/src/fields/fields/T.js +27 -0
  51. package/src/fields/fields/U.js +28 -0
  52. package/src/fields/fields/X.js +28 -0
  53. package/src/fields/fields/Y.js +33 -0
  54. package/src/fields/get.js +36 -0
  55. package/src/fields/index.js +9 -0
  56. package/src/mcp/MCP/345/234/272/346/231/257/346/250/241/346/213/237.md +8 -0
  57. package/src/mcp/index-sse-svc.js +126 -0
  58. package/src/mcp/index-streamable-svc.js +180 -0
  59. package/src/mcp/index.js +631 -0
  60. package/src/mcp/readme.md +137 -0
  61. package/src/mcp/tools/Approval/handler.js +349 -0
  62. package/src/mcp/tools/Class Creator/handler.js +37 -0
  63. package/src/mcp/tools/Class Detail Retriever/handler.js +33 -0
  64. package/src/mcp/tools/Class Detail Retriever/prompt.js +37 -0
  65. package/src/mcp/tools/Class Editor Guide/handler.js +72 -0
  66. package/src/mcp/tools/Class Editor Guide/prompt.js +468 -0
  67. package/src/mcp/tools/Class List Retriever/handler.js +36 -0
  68. package/src/mcp/tools/Class Publisher/handler.js +29 -0
  69. package/src/mcp/tools/Class Publisher/prompt.js +40 -0
  70. package/src/mcp/tools/Class Puller/handler.js +86 -0
  71. package/src/mcp/tools/Class Puller/prompt.js +49 -0
  72. package/src/mcp/tools/Client Script Creator/handler.js +179 -0
  73. package/src/mcp/tools/Client Script Detail Retriever/handler.js +53 -0
  74. package/src/mcp/tools/Client Script Editor Guide/handler.js +633 -0
  75. package/src/mcp/tools/Client Script List Retriever/handler.js +68 -0
  76. package/src/mcp/tools/Client Script Publisher/handler.js +54 -0
  77. package/src/mcp/tools/Client Script Puller/handler.js +73 -0
  78. package/src/mcp/tools/CloudCC Development Overview/handler.js +48 -0
  79. package/src/mcp/tools/CloudCC Development Overview/prompt.js +870 -0
  80. package/src/mcp/tools/Component Creator/handler.js +44 -0
  81. package/src/mcp/tools/Component Detail Retriever/handler.js +38 -0
  82. package/src/mcp/tools/Component Editor Guide/handler.js +76 -0
  83. package/src/mcp/tools/Component Editor Guide/prompt.js +519 -0
  84. package/src/mcp/tools/Component List Retriever/handler.js +43 -0
  85. package/src/mcp/tools/Component Publisher/handler.js +18 -0
  86. package/src/mcp/tools/Component Publisher/prompt.js +659 -0
  87. package/src/mcp/tools/Component Puller/handler.js +63 -0
  88. package/src/mcp/tools/Dev Environment Creator/fetcher.js +500 -0
  89. package/src/mcp/tools/Dev Environment Creator/handler.js +92 -0
  90. package/src/mcp/tools/Dev Environment Creator/prompt.js +273 -0
  91. package/src/mcp/tools/Dev Environment Validator/handler.js +88 -0
  92. package/src/mcp/tools/Dev Environment Validator/prompt.js +193 -0
  93. package/src/mcp/tools/Developer Key Setup Guide/fetcher.js +278 -0
  94. package/src/mcp/tools/Developer Key Setup Guide/handler.js +43 -0
  95. package/src/mcp/tools/Developer Key Setup Guide/prompt.js +71 -0
  96. package/src/mcp/tools/Object Creator/handler.js +34 -0
  97. package/src/mcp/tools/Object Fields Creator/handler.js +64 -0
  98. package/src/mcp/tools/Object Fields Retriever/handler.js +37 -0
  99. package/src/mcp/tools/Object Fields Retriever/prompt.js +10 -0
  100. package/src/mcp/tools/Object List Retriever/handler.js +43 -0
  101. package/src/mcp/tools/Object List Retriever/prompt.js +10 -0
  102. package/src/mcp/tools/Scheduled Class Creator/handler.js +37 -0
  103. package/src/mcp/tools/Scheduled Class Detail Retriever/handler.js +34 -0
  104. package/src/mcp/tools/Scheduled Class List Retriever/handler.js +52 -0
  105. package/src/mcp/tools/Scheduled Class Publisher/handler.js +30 -0
  106. package/src/mcp/tools/Scheduled Class Puller/handler.js +92 -0
  107. package/src/mcp/tools/Trigger Creator/handler.js +53 -0
  108. package/src/mcp/tools/Trigger Detail Retriever/handler.js +33 -0
  109. package/src/mcp/tools/Trigger Editor Guide/handler.js +58 -0
  110. package/src/mcp/tools/Trigger List Retriever/handler.js +49 -0
  111. package/src/mcp/tools/Trigger Publisher/handler.js +34 -0
  112. package/src/mcp/tools/Trigger Puller/handler.js +40 -0
  113. package/src/mcp/tools/ccdk/fetcher.js +18 -0
  114. package/src/mcp/tools/ccdk/handler.js +98 -0
  115. package/src/mcp/tools/ccdk/prompt.js +453 -0
  116. package/src/mcp/tools/index.js +23 -0
  117. package/src/object/create.js +105 -0
  118. package/src/object/get.js +43 -4
  119. package/src/object/index.js +2 -1
  120. package/src/plugin/create.js +1 -2
  121. package/src/plugin/create1.js +9 -9
  122. package/src/plugin/detail.js +91 -0
  123. package/src/plugin/get.js +79 -0
  124. package/src/plugin/index.js +4 -1
  125. package/src/plugin/publish.js +13 -13
  126. package/src/plugin/publish1.js +33 -24
  127. package/src/plugin/pull.js +173 -0
  128. package/src/project/create.js +9 -9
  129. package/src/project/create1.js +31 -17
  130. package/src/recordType/get.js +4 -2
  131. package/src/script/create.js +7 -7
  132. package/src/script/detail.js +95 -0
  133. package/src/script/get.js +4 -2
  134. package/src/script/index.js +1 -0
  135. package/src/script/publish.js +14 -14
  136. package/src/script/pull.js +12 -12
  137. package/src/script/pullList.js +5 -3
  138. package/src/timer/create.js +7 -7
  139. package/src/timer/detail.js +84 -0
  140. package/src/timer/get.js +6 -3
  141. package/src/timer/publish.js +7 -7
  142. package/src/timer/pull.js +8 -8
  143. package/src/timer/pullList.js +5 -3
  144. package/src/token/get.js +1 -1
  145. package/src/triggers/create.js +7 -7
  146. package/src/triggers/detail.js +90 -0
  147. package/src/triggers/get.js +4 -2
  148. package/src/triggers/index.js +1 -0
  149. package/src/triggers/publish.js +7 -7
  150. package/src/triggers/pull.js +8 -8
  151. package/src/triggers/pullList.js +5 -3
  152. package/src/version/get.js +3 -3
  153. package/target/ccopenapi-0.0.3-classes.jar +0 -0
  154. package/target/ccopenapi-0.0.3.jar +0 -0
  155. package/target/maven-archiver/pom.properties +3 -0
  156. package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +18 -0
  157. package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +19 -0
  158. package/template/Appvue +452 -12
  159. package/template/index.js +30 -19
  160. package/tool/branch/index.js +1 -1
  161. package/tool/checkLange/checkLang.js +6 -6
  162. package/tool/checkLange/clearLang.js +1 -1
  163. package/utils/accessClass.js +23 -0
  164. package/utils/checkVersion.js +22 -20
  165. package/utils/config.js +18 -3
  166. package/utils/http.js +10 -10
  167. package/utils/utils.js +128 -40
  168. package/java/com/cloudcc/core/CCTriggerDemo.java +0 -25
  169. package/src/classes/create.js +0 -65
  170. package/src/classes/get.js +0 -21
  171. package/src/classes/index.js +0 -11
  172. package/src/classes/publish.js +0 -50
  173. package/src/classes/pull.js +0 -54
  174. package/src/classes/pullList.js +0 -44
package/template/Appvue CHANGED
@@ -1,25 +1,465 @@
1
1
  <template>
2
- <div class="cc-container">
3
- <div>hello World</div>
2
+ <div class="welcome-container">
3
+ <!-- 渐变背景线条 -->
4
+ <div class="bg-lines">
5
+ <div class="line line-1"></div>
6
+ <div class="line line-2"></div>
7
+ <div class="line line-3"></div>
8
+ </div>
9
+
10
+ <!-- 主要内容 -->
11
+ <div class="welcome-content">
12
+ <div class="header">
13
+ <div class="logo-mark"></div>
14
+ <span class="tag">Welcome</span>
15
+ </div>
16
+
17
+ <div class="title-section">
18
+ <h1 class="main-title">{{ mainTitle }}</h1>
19
+ <div class="title-underline"></div>
20
+ </div>
21
+
22
+ <p class="description">{{ description }}</p>
23
+
24
+ <div class="stats">
25
+ <div class="stat-item" v-for="(stat, index) in stats" :key="index">
26
+ <div class="stat-number">{{ stat.number }}</div>
27
+ <div class="stat-label">{{ stat.label }}</div>
28
+ </div>
29
+ </div>
30
+
31
+ <button class="cta-button" @click="handleClick">
32
+ <span class="button-text">探索更多</span>
33
+ <span class="button-arrow">→</span>
34
+ </button>
35
+ </div>
36
+
37
+ <!-- 装饰线 -->
38
+ <div class="decorative-line"></div>
4
39
  </div>
5
40
  </template>
6
41
 
7
42
  <script>
8
- export default {
9
- name: "App",
10
- };
43
+ export default {
44
+ name: "App",
45
+ data() {
46
+ return {
47
+ mainTitle: "CloudCC开发者,您好",
48
+ description: "开发文档:https://help.cloudcc.cn/",
49
+ stats: [
50
+ { number: "∞", label: "可能性" },
51
+ { number: "⚡", label: "高效开发" },
52
+ { number: "🚀", label: "快速上手" },
53
+ ],
54
+ };
55
+ },
56
+ methods: {
57
+ handleClick() {
58
+ console.error("探索开始");
59
+ },
60
+ },
61
+ };
11
62
  </script>
12
63
 
13
64
  <style lang="scss" scoped>
14
- html body {
15
- padding: 0;
16
- margin: 0;
17
- height: 100vh;
65
+ * {
66
+ margin: 0;
67
+ padding: 0;
68
+ box-sizing: border-box;
69
+ }
70
+
71
+ .welcome-container {
72
+ position: relative;
73
+ width: 100%;
74
+ height: 100vh;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ overflow: hidden;
79
+ background: #fafafa;
80
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
81
+ "Ubuntu", "Cantarell", sans-serif;
82
+ }
83
+
84
+ // 背景线条
85
+ .bg-lines {
86
+ position: absolute;
87
+ top: 0;
88
+ left: 0;
89
+ width: 100%;
90
+ height: 100%;
91
+ z-index: 0;
92
+ opacity: 0.3;
93
+ }
94
+
95
+ .line {
96
+ position: absolute;
97
+ background: linear-gradient(90deg, transparent, #000, transparent);
98
+ opacity: 0.05;
99
+
100
+ &-1 {
101
+ width: 200%;
102
+ height: 1px;
103
+ top: 20%;
104
+ left: -50%;
105
+ animation: moveLine 8s linear infinite;
106
+ }
107
+
108
+ &-2 {
109
+ width: 200%;
110
+ height: 1px;
111
+ top: 50%;
112
+ right: -50%;
113
+ animation: moveLine 10s linear infinite reverse;
114
+ }
115
+
116
+ &-3 {
117
+ width: 200%;
118
+ height: 1px;
119
+ bottom: 20%;
120
+ left: -50%;
121
+ animation: moveLine 12s linear infinite;
122
+ }
123
+ }
124
+
125
+ @keyframes moveLine {
126
+ 0% {
127
+ transform: translateX(0);
128
+ }
129
+ 100% {
130
+ transform: translateX(50%);
131
+ }
132
+ }
133
+
134
+ // 主要内容
135
+ .welcome-content {
136
+ position: relative;
137
+ z-index: 10;
138
+ max-width: 600px;
139
+ margin: 0 auto;
140
+ padding: 0 40px;
141
+ text-align: center;
142
+ animation: fadeInContent 0.8s ease-out;
143
+ }
144
+
145
+ @keyframes fadeInContent {
146
+ 0% {
147
+ opacity: 0;
148
+ transform: translateY(20px);
149
+ }
150
+ 100% {
151
+ opacity: 1;
152
+ transform: translateY(0);
153
+ }
154
+ }
155
+
156
+ // 头部
157
+ .header {
158
+ display: flex;
159
+ align-items: center;
160
+ justify-content: center;
161
+ gap: 12px;
162
+ margin-bottom: 40px;
163
+ }
164
+
165
+ .logo-mark {
166
+ width: 24px;
167
+ height: 24px;
168
+ border: 2px solid #000;
169
+ border-radius: 4px;
170
+ position: relative;
171
+ animation: logoRotate 2s ease-in-out infinite;
172
+
173
+ &::after {
174
+ content: "";
175
+ position: absolute;
176
+ width: 8px;
177
+ height: 8px;
178
+ background: #000;
179
+ border-radius: 50%;
180
+ top: 50%;
181
+ left: 50%;
182
+ transform: translate(-50%, -50%);
183
+ }
184
+ }
185
+
186
+ @keyframes logoRotate {
187
+ 0%,
188
+ 100% {
189
+ transform: rotate(0deg);
190
+ }
191
+ 50% {
192
+ transform: rotate(90deg);
193
+ }
194
+ }
195
+
196
+ .tag {
197
+ font-size: 12px;
198
+ font-weight: 600;
199
+ letter-spacing: 1.2px;
200
+ color: #666;
201
+ text-transform: uppercase;
202
+ padding: 4px 12px;
203
+ border: 1px solid #ddd;
204
+ border-radius: 20px;
205
+ background: rgba(255, 255, 255, 0.8);
206
+ }
207
+
208
+ // 标题部分
209
+ .title-section {
210
+ margin-bottom: 30px;
211
+ position: relative;
212
+ }
213
+
214
+ .main-title {
215
+ font-size: 48px;
216
+ font-weight: 700;
217
+ line-height: 1.3;
218
+ color: #000;
219
+ margin-bottom: 16px;
220
+ letter-spacing: -0.5px;
221
+ }
222
+
223
+ .title-underline {
224
+ width: 60px;
225
+ height: 3px;
226
+ background: linear-gradient(90deg, #000, transparent);
227
+ margin: 0 auto;
228
+ border-radius: 2px;
229
+ animation: expandWidth 0.8s ease-out 0.3s backwards;
230
+ }
231
+
232
+ @keyframes expandWidth {
233
+ 0% {
234
+ width: 0;
235
+ }
236
+ 100% {
237
+ width: 60px;
238
+ }
239
+ }
240
+
241
+ // 描述文本
242
+ .description {
243
+ font-size: 16px;
244
+ color: #666;
245
+ line-height: 1.6;
246
+ margin-bottom: 50px;
247
+ font-weight: 400;
248
+ letter-spacing: 0.3px;
249
+ }
250
+
251
+ // 统计数据
252
+ .stats {
253
+ display: flex;
254
+ justify-content: center;
255
+ gap: 60px;
256
+ margin-bottom: 50px;
257
+ }
258
+
259
+ .stat-item {
260
+ text-align: center;
261
+ opacity: 0;
262
+ animation: slideInStats 0.6s ease-out forwards;
263
+
264
+ &:nth-child(1) {
265
+ animation-delay: 0.2s;
266
+ }
267
+
268
+ &:nth-child(2) {
269
+ animation-delay: 0.3s;
270
+ }
271
+
272
+ &:nth-child(3) {
273
+ animation-delay: 0.4s;
274
+ }
275
+ }
276
+
277
+ @keyframes slideInStats {
278
+ 0% {
279
+ opacity: 0;
280
+ transform: translateY(10px);
281
+ }
282
+ 100% {
283
+ opacity: 1;
284
+ transform: translateY(0);
285
+ }
286
+ }
287
+
288
+ .stat-number {
289
+ font-size: 28px;
290
+ font-weight: 700;
291
+ color: #000;
292
+ margin-bottom: 4px;
293
+ }
294
+
295
+ .stat-label {
296
+ font-size: 12px;
297
+ color: #999;
298
+ font-weight: 500;
299
+ letter-spacing: 0.5px;
300
+ }
301
+
302
+ // 按钮
303
+ .cta-button {
304
+ padding: 14px 32px;
305
+ font-size: 16px;
306
+ font-weight: 600;
307
+ color: #fff;
308
+ background: #000;
309
+ border: 2px solid #000;
310
+ border-radius: 4px;
311
+ cursor: pointer;
312
+ transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
313
+ display: inline-flex;
314
+ align-items: center;
315
+ gap: 8px;
316
+ position: relative;
317
+ overflow: hidden;
318
+ animation: fadeInUp 0.8s ease-out 0.5s backwards;
319
+
320
+ &::before {
321
+ content: "";
322
+ position: absolute;
323
+ top: 0;
324
+ left: -100%;
325
+ width: 100%;
326
+ height: 100%;
327
+ background: #333;
328
+ z-index: -1;
329
+ transition: left 0.3s ease;
330
+ }
331
+
332
+ &:hover {
333
+ background: #333;
334
+ border-color: #333;
335
+ transform: translateX(4px);
336
+
337
+ .button-arrow {
338
+ animation: arrowMove 0.3s ease;
339
+ }
340
+ }
341
+
342
+ &:active {
343
+ transform: translateX(2px);
344
+ }
345
+ }
346
+
347
+ .button-text {
348
+ position: relative;
349
+ }
350
+
351
+ .button-arrow {
352
+ display: inline-block;
353
+ transition: transform 0.3s ease;
354
+ }
355
+
356
+ @keyframes arrowMove {
357
+ 0%,
358
+ 100% {
359
+ transform: translateX(0);
360
+ }
361
+ 50% {
362
+ transform: translateX(4px);
363
+ }
364
+ }
365
+
366
+ @keyframes fadeInUp {
367
+ 0% {
368
+ opacity: 0;
369
+ transform: translateY(10px);
370
+ }
371
+ 100% {
372
+ opacity: 1;
373
+ transform: translateY(0);
374
+ }
375
+ }
376
+
377
+ // 装饰线
378
+ .decorative-line {
379
+ position: absolute;
380
+ bottom: 40px;
381
+ left: 50%;
382
+ width: 40px;
383
+ height: 2px;
384
+ background: #000;
385
+ transform: translateX(-50%);
386
+ opacity: 0.2;
387
+ animation: pulse 2s ease-in-out infinite;
388
+ }
389
+
390
+ @keyframes pulse {
391
+ 0%,
392
+ 100% {
393
+ opacity: 0.2;
394
+ width: 40px;
395
+ }
396
+ 50% {
397
+ opacity: 0.5;
398
+ width: 50px;
399
+ }
400
+ }
401
+
402
+ // 响应式
403
+ @media (max-width: 768px) {
404
+ .welcome-content {
405
+ padding: 0 30px;
406
+ }
407
+
408
+ .main-title {
409
+ font-size: 36px;
410
+ }
411
+
412
+ .description {
413
+ font-size: 14px;
414
+ margin-bottom: 40px;
415
+ }
416
+
417
+ .stats {
418
+ gap: 40px;
419
+ margin-bottom: 40px;
420
+ }
421
+
422
+ .stat-number {
423
+ font-size: 24px;
424
+ }
425
+
426
+ .cta-button {
427
+ padding: 12px 28px;
428
+ font-size: 14px;
429
+ }
430
+
431
+ .header {
432
+ margin-bottom: 30px;
433
+ }
434
+
435
+ .title-section {
436
+ margin-bottom: 25px;
437
+ }
438
+ }
439
+
440
+ @media (max-width: 480px) {
441
+ .main-title {
442
+ font-size: 28px;
443
+ }
444
+
445
+ .description {
446
+ font-size: 13px;
447
+ }
448
+
449
+ .stats {
450
+ gap: 30px;
451
+ }
452
+
453
+ .stat-number {
454
+ font-size: 20px;
455
+ }
456
+
457
+ .cta-button {
18
458
  width: 100%;
19
459
  }
20
460
 
21
- .cc-container {
22
- text-align: center;
23
- padding: 8px;
461
+ .bg-lines {
462
+ display: none;
24
463
  }
464
+ }
25
465
  </style>
package/template/index.js CHANGED
@@ -33,8 +33,13 @@ module.exports = function (creator, options, callback) {
33
33
 
34
34
  const cwd = process.cwd();
35
35
 
36
- const projectPath = path.join(cwd, name);
37
- fs.mkdirSync(projectPath)
36
+ // name 是 '.' 或 '' 时,直接使用当前目录
37
+ const projectPath = (name === '.' || name === '') ? cwd : path.join(cwd, name);
38
+
39
+ // 只有当 name 不是 '.' 或 '' 时才创建新目录
40
+ if (name !== '.' && name !== '') {
41
+ fs.mkdirSync(projectPath)
42
+ }
38
43
 
39
44
  const src = path.join(projectPath, "src");
40
45
  fs.mkdirSync(src)
@@ -48,15 +53,18 @@ module.exports = function (creator, options, callback) {
48
53
  const templateLibPath = path.join(__dirname, "lib");
49
54
  if (fs.existsSync(templateLibPath)) {
50
55
  copyFolderSync(templateLibPath, libPath);
51
- console.log(`${chalk.grey(`Copy lib folder to ${name}/lib`)} ${chalk.green(' ')}`);
56
+ const displayPath = (name === '.' || name === '') ? '.' : `${name}/lib`;
57
+ console.error(`${chalk.grey(`Copy lib folder to ${displayPath}`)} ${chalk.green('✔ ')}`);
52
58
  }
53
59
 
54
60
  creator.copyTpl('cloudcc-cli.configjs', path.join(projectPath, "cloudcc-cli.config.js"))
55
61
 
56
62
  creator.copyTpl('gitignore', path.join(projectPath, ".gitignore"))
57
63
 
64
+ // 当 name 是 '.' 或 '' 时,使用当前目录名作为 package.json 的 name
65
+ const packageName = (name === '.' || name === '') ? path.basename(cwd) : name;
58
66
  creator.copyTpl('packagejson', path.join(projectPath, "package.json"), {
59
- name, description
67
+ name: packageName, description
60
68
  })
61
69
 
62
70
  creator.copyTpl('vueconfigjs', path.join(projectPath, "vue.config.js"))
@@ -71,21 +79,24 @@ module.exports = function (creator, options, callback) {
71
79
 
72
80
 
73
81
  creator.fs.commit(() => {
74
- console.log();
75
- console.log(`${chalk.grey(`Create project: ${name}`)} ${chalk.green(' ')}`);
76
-
77
- console.log(`${chalk.grey(`Create directory: ${name}/public`)} ${chalk.green('✔ ')}`);
78
- console.log(`${chalk.grey(`Create file: ${name}/public/index.html`)} ${chalk.green('✔ ')}`);
79
-
80
- console.log(`${chalk.grey(`Create directory: ${name}/lib`)} ${chalk.green('✔ ')}`);
81
- console.log(`${chalk.grey(`Create directory: ${name}/src`)} ${chalk.green('✔ ')}`);
82
- console.log(`${chalk.grey(`Create file: ${name}/src/App.vue`)} ${chalk.green('✔ ')}`);
83
- console.log(`${chalk.grey(`Create file: ${name}/src/main.js`)} ${chalk.green('✔ ')}`);
84
-
85
- console.log(`${chalk.grey(`Create file: ${name}/babel.config.js`)} ${chalk.green('✔ ')}`);
86
- console.log(`${chalk.grey(`Create file: ${name}/package.json`)} ${chalk.green('✔ ')}`);
87
- console.log(`${chalk.grey(`Create file: ${name}/vue.config.js`)} ${chalk.green('✔ ')}`);
88
- console.log(`${chalk.grey(`Create file: ${name}/cloudcc-cli.config.js`)} ${chalk.green('✔ ')}`);
82
+ console.error();
83
+ const displayName = (name === '.' || name === '') ? '.' : name;
84
+ const prefix = (name === '.' || name === '') ? '' : `${name}/`;
85
+
86
+ console.error(`${chalk.grey(`Create project: ${displayName}`)} ${chalk.green('✔ ')}`);
87
+
88
+ console.error(`${chalk.grey(`Create directory: ${prefix}public`)} ${chalk.green('✔ ')}`);
89
+ console.error(`${chalk.grey(`Create file: ${prefix}public/index.html`)} ${chalk.green('✔ ')}`);
90
+
91
+ console.error(`${chalk.grey(`Create directory: ${prefix}lib`)} ${chalk.green('✔ ')}`);
92
+ console.error(`${chalk.grey(`Create directory: ${prefix}src`)} ${chalk.green('✔ ')}`);
93
+ console.error(`${chalk.grey(`Create file: ${prefix}src/App.vue`)} ${chalk.green('✔ ')}`);
94
+ console.error(`${chalk.grey(`Create file: ${prefix}src/main.js`)} ${chalk.green('✔ ')}`);
95
+
96
+ console.error(`${chalk.grey(`Create file: ${prefix}babel.config.js`)} ${chalk.green('✔ ')}`);
97
+ console.error(`${chalk.grey(`Create file: ${prefix}package.json`)} ${chalk.green('✔ ')}`);
98
+ console.error(`${chalk.grey(`Create file: ${prefix}vue.config.js`)} ${chalk.green('✔ ')}`);
99
+ console.error(`${chalk.grey(`Create file: ${prefix}cloudcc-cli.config.js`)} ${chalk.green('✔ ')}`);
89
100
  callback();
90
101
  });
91
102
  }
@@ -14,7 +14,7 @@ function checkBranch(inBranch, notInBranch, condition = '') {
14
14
  guolv.push(branch)
15
15
  }
16
16
  } catch (error) {
17
- console.log(error)
17
+ console.error(error)
18
18
  }
19
19
 
20
20
  })
@@ -36,17 +36,17 @@ function checkFilesInFolder(folderPath) {
36
36
 
37
37
  if (chineseRegex.test(data)) {
38
38
  length++;
39
- console.log(`have "${filePath}"`);
39
+ console.error(`have "${filePath}"`);
40
40
  }
41
41
  });
42
42
  } else {
43
- // console.log(`jump filePath"${filePath}"`);
43
+ // console.error(`jump filePath"${filePath}"`);
44
44
  }
45
45
  } else if (stats.isDirectory()) {
46
46
  if (!excludeFolders.includes(file)) {
47
47
  checkFilesInFolder(filePath);
48
48
  } else {
49
- // console.log(`jump filePath"${filePath}"`);
49
+ // console.error(`jump filePath"${filePath}"`);
50
50
  }
51
51
  }
52
52
  });
@@ -59,9 +59,9 @@ checkFilesInFolder(folderPath);
59
59
 
60
60
  function getLength() {
61
61
  setTimeout(() => {
62
- console.log(`==============================================================`)
63
- console.log(`total ${length} files have chinese`);
64
- console.log(`==============================================================`)
62
+ console.error(`==============================================================`)
63
+ console.error(`total ${length} files have chinese`);
64
+ console.error(`==============================================================`)
65
65
  }, 1000);
66
66
  }
67
67
 
@@ -67,7 +67,7 @@ function removeChineseComments(filePath) {
67
67
  return;
68
68
  }
69
69
 
70
- console.log(`done: ${filePath}`);
70
+ console.error(`done: ${filePath}`);
71
71
  });
72
72
  });
73
73
  }
@@ -0,0 +1,23 @@
1
+ const postClass = require('./http').postClass;
2
+ const { getPackageJson } = require("./config")
3
+
4
+
5
+
6
+
7
+ async function test() {
8
+ let config = await getPackageJson();
9
+ console.log('Using config:', config);
10
+ // 自定义类名
11
+ let className = "TestDtt"
12
+ // 类中的方法名
13
+ let methodName = "sendEm"
14
+ // 方法入参
15
+ let params = []
16
+ postClass(config.setupSvc + "/api/openCall/common", { className, methodName, params }, config.accessToken).then(res => {
17
+ console.log('Delete success:', res);
18
+ }).catch(err => {
19
+ console.error('Error deleting object:', err);
20
+ });
21
+ }
22
+
23
+ test()