@blocklet/component-studio-cli 0.4.134

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 (84) hide show
  1. package/README.md +84 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +11 -0
  4. package/dist/commands/add.d.ts +2 -0
  5. package/dist/commands/add.js +140 -0
  6. package/dist/commands/component-studio.d.ts +2 -0
  7. package/dist/commands/component-studio.js +70 -0
  8. package/dist/commands/dev.d.ts +2 -0
  9. package/dist/commands/dev.js +87 -0
  10. package/dist/commands/init.d.ts +2 -0
  11. package/dist/commands/init.js +114 -0
  12. package/dist/commands/migrate.d.ts +2 -0
  13. package/dist/commands/migrate.js +177 -0
  14. package/dist/commands/update.d.ts +2 -0
  15. package/dist/commands/update.js +22 -0
  16. package/dist/utils/display-logo.d.ts +2 -0
  17. package/dist/utils/display-logo.js +24 -0
  18. package/dist/utils/helper.d.ts +97 -0
  19. package/dist/utils/helper.js +479 -0
  20. package/package.json +58 -0
  21. package/templates/add/components/HelloWorld/@metadata.json +433 -0
  22. package/templates/add/components/HelloWorld/@template.json +4 -0
  23. package/templates/add/components/HelloWorld/index.tsx +560 -0
  24. package/templates/add/tools/cursor-rules/.cursor/rules/@metadata-json.mdc +549 -0
  25. package/templates/add/tools/cursor-rules/.cursor/rules/component-studio.mdc +138 -0
  26. package/templates/add/tools/cursor-rules/.cursor/rules/index-tsx.mdc +192 -0
  27. package/templates/add/tools/cursor-rules/@template.json +4 -0
  28. package/templates/init/0-basic/@template.json +4 -0
  29. package/templates/init/0-basic/README.md +30 -0
  30. package/templates/init/0-basic/package.json +26 -0
  31. package/templates/init/0-basic/src/HelloWorld/@metadata.json +433 -0
  32. package/templates/init/0-basic/src/HelloWorld/index.tsx +560 -0
  33. package/templates/init/1-professional/@template.json +4 -0
  34. package/templates/init/1-professional/README.md +75 -0
  35. package/templates/init/1-professional/biome.json +36 -0
  36. package/templates/init/1-professional/global.d.ts +131 -0
  37. package/templates/init/1-professional/package.json +73 -0
  38. package/templates/init/1-professional/scripts/bump-version.mjs +35 -0
  39. package/templates/init/1-professional/src/atoms/AnimationWrapper.tsx +95 -0
  40. package/templates/init/1-professional/src/atoms/ArrayTable.tsx +114 -0
  41. package/templates/init/1-professional/src/atoms/Card.tsx +52 -0
  42. package/templates/init/1-professional/src/atoms/ContentWrapper.tsx +72 -0
  43. package/templates/init/1-professional/src/atoms/CopyrightFooter.tsx +31 -0
  44. package/templates/init/1-professional/src/atoms/DataDisplays.tsx +157 -0
  45. package/templates/init/1-professional/src/atoms/GradientTitle.tsx +64 -0
  46. package/templates/init/1-professional/src/atoms/Logo.tsx +58 -0
  47. package/templates/init/1-professional/src/atoms/index.ts +27 -0
  48. package/templates/init/1-professional/src/components/HelloWorld/@metadata.json +433 -0
  49. package/templates/init/1-professional/src/components/HelloWorld/index.tsx +224 -0
  50. package/templates/init/1-professional/src/type.d.ts +42 -0
  51. package/templates/init/1-professional/src/utils/index.ts +1 -0
  52. package/templates/init/1-professional/tsconfig.json +102 -0
  53. package/templates/init/1-professional/version +1 -0
  54. package/templates/init/2-blank/@template.json +4 -0
  55. package/templates/init/2-blank/README.md +27 -0
  56. package/templates/init/2-blank/package.json +26 -0
  57. package/templates/workspace/.component-studio-runtime/_theme.tsx +4 -0
  58. package/templates/workspace/.editorconfig +23 -0
  59. package/templates/workspace/.env +1 -0
  60. package/templates/workspace/.init-component-studio +0 -0
  61. package/templates/workspace/LICENSE +13 -0
  62. package/templates/workspace/README.md +127 -0
  63. package/templates/workspace/api/dev.ts +21 -0
  64. package/templates/workspace/api/src/index.ts +50 -0
  65. package/templates/workspace/api/src/libs/auth.ts +17 -0
  66. package/templates/workspace/api/src/libs/env.ts +6 -0
  67. package/templates/workspace/api/src/libs/logger.ts +3 -0
  68. package/templates/workspace/api/src/routes/index.ts +12 -0
  69. package/templates/workspace/api/third.d.ts +17 -0
  70. package/templates/workspace/biome.json +36 -0
  71. package/templates/workspace/blocklet.md +8 -0
  72. package/templates/workspace/blocklet.yml +58 -0
  73. package/templates/workspace/index.html +15 -0
  74. package/templates/workspace/logo.png +0 -0
  75. package/templates/workspace/package.json +125 -0
  76. package/templates/workspace/pnpm-workspace.yaml +3 -0
  77. package/templates/workspace/scripts/build-clean.mjs +6 -0
  78. package/templates/workspace/scripts/bump-version.mjs +39 -0
  79. package/templates/workspace/scripts/init-component-studio.mjs +36 -0
  80. package/templates/workspace/tsconfig.api.json +12 -0
  81. package/templates/workspace/tsconfig.json +102 -0
  82. package/templates/workspace/version +1 -0
  83. package/templates/workspace/vite-server.config.ts +39 -0
  84. package/templates/workspace/vite.config.ts +68 -0
@@ -0,0 +1,433 @@
1
+ {
2
+ "id": "KEHGy3vdflE8JGrV",
3
+ "createdAt": "2025-03-20T16:01:56.655Z",
4
+ "updatedAt": "2025-03-21T01:24:04.008Z",
5
+ "name": "HelloWorld",
6
+ "description": "",
7
+ "properties": {
8
+ "gs1rn5jmxfvpxptx": {
9
+ "index": 0,
10
+ "data": {
11
+ "id": "gs1rn5jmxfvpxptx",
12
+ "key": "title",
13
+ "type": "string",
14
+ "visible": true,
15
+ "locales": {
16
+ "zh": {
17
+ "name": "标题",
18
+ "defaultValue": "Hello World"
19
+ },
20
+ "en": {
21
+ "name": "Title",
22
+ "defaultValue": "Hello World"
23
+ }
24
+ }
25
+ }
26
+ },
27
+ "9ajrz12ik7esfk1z": {
28
+ "index": 1,
29
+ "data": {
30
+ "id": "9ajrz12ik7esfk1z",
31
+ "key": "description",
32
+ "type": "string",
33
+ "visible": true,
34
+ "locales": {
35
+ "zh": {
36
+ "name": "描述",
37
+ "defaultValue": "这是你的创意实验室,在这里可以:\n- 设计和构建各类强大组件\n- 将创意转化为可复用代码\n- 打造专属于您的组件库\n释放你的开发潜能,开始创作吧!"
38
+ },
39
+ "en": {
40
+ "name": "Description",
41
+ "defaultValue": "This is your creative lab, where you can:\n- Design and build powerful components\n- Transform ideas into reusable code\n- Create your own component library\nUnleash your development potential and start creating!"
42
+ }
43
+ }
44
+ }
45
+ },
46
+ "3ckcfvf6b7zyskk8": {
47
+ "index": 2,
48
+ "data": {
49
+ "id": "3ckcfvf6b7zyskk8",
50
+ "key": "logo",
51
+ "type": "url",
52
+ "visible": true,
53
+ "locales": {
54
+ "zh": {
55
+ "defaultValue": {
56
+ "url": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80",
57
+ "mediaKitUrl": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80"
58
+ },
59
+ "name": "Logo"
60
+ },
61
+ "en": {
62
+ "defaultValue": {
63
+ "url": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80",
64
+ "mediaKitUrl": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80"
65
+ },
66
+ "name": "Logo"
67
+ }
68
+ },
69
+ "subProperties": {
70
+ "ML-CDw7LvtlhM_cl": {
71
+ "index": 0,
72
+ "data": {
73
+ "id": "ML-CDw7LvtlhM_cl",
74
+ "key": "url",
75
+ "locales": {
76
+ "en": {
77
+ "name": "url"
78
+ },
79
+ "zh": {
80
+ "name": "url"
81
+ }
82
+ }
83
+ }
84
+ },
85
+ "K-HYgPHtAsmO_mer": {
86
+ "index": 1,
87
+ "data": {
88
+ "id": "K-HYgPHtAsmO_mer",
89
+ "key": "mediaKitUrl",
90
+ "locales": {
91
+ "en": {
92
+ "name": "mediaKitUrl"
93
+ },
94
+ "zh": {
95
+ "name": "mediaKitUrl"
96
+ }
97
+ }
98
+ }
99
+ },
100
+ "evequmAWgWEWZLex": {
101
+ "index": 2,
102
+ "data": {
103
+ "id": "evequmAWgWEWZLex",
104
+ "key": "width",
105
+ "locales": {
106
+ "en": {
107
+ "name": "width"
108
+ },
109
+ "zh": {
110
+ "name": "width"
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "poeAwflRHJeUmfLa": {
116
+ "index": 3,
117
+ "data": {
118
+ "id": "poeAwflRHJeUmfLa",
119
+ "key": "height",
120
+ "locales": {
121
+ "en": {
122
+ "name": "height"
123
+ },
124
+ "zh": {
125
+ "name": "height"
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ "x3lqht8ikble1itx": {
134
+ "index": 3,
135
+ "data": {
136
+ "id": "x3lqht8ikble1itx",
137
+ "key": "copyright",
138
+ "type": "string",
139
+ "visible": false,
140
+ "locales": {
141
+ "zh": {
142
+ "name": "版权信息",
143
+ "defaultValue": "由 Component Studio 提供支持"
144
+ },
145
+ "en": {
146
+ "name": "Copyright",
147
+ "defaultValue": "Powered by Component Studio"
148
+ }
149
+ }
150
+ }
151
+ },
152
+ "q0ezdj81v0m14y5m": {
153
+ "index": 4,
154
+ "data": {
155
+ "id": "q0ezdj81v0m14y5m",
156
+ "key": "number",
157
+ "type": "number",
158
+ "visible": true,
159
+ "locales": {
160
+ "zh": {
161
+ "name": "整数",
162
+ "defaultValue": 42
163
+ },
164
+ "en": {
165
+ "name": "Integer",
166
+ "defaultValue": 42
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "bl0rimfebwbencoj": {
172
+ "index": 5,
173
+ "data": {
174
+ "id": "bl0rimfebwbencoj",
175
+ "key": "decimal",
176
+ "type": "decimal",
177
+ "visible": true,
178
+ "locales": {
179
+ "zh": {
180
+ "name": "小数",
181
+ "defaultValue": 3.14
182
+ },
183
+ "en": {
184
+ "name": "Decimal",
185
+ "defaultValue": 3.14
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "gioetxz8d13jabz6": {
191
+ "index": 6,
192
+ "data": {
193
+ "id": "gioetxz8d13jabz6",
194
+ "key": "showCopyright",
195
+ "type": "boolean",
196
+ "visible": true,
197
+ "locales": {
198
+ "zh": {
199
+ "name": "是否展示 Copyright",
200
+ "defaultValue": true
201
+ },
202
+ "en": {
203
+ "name": "Show Description",
204
+ "defaultValue": true
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "yi1oj4rq1eziup1d": {
210
+ "index": 7,
211
+ "data": {
212
+ "id": "yi1oj4rq1eziup1d",
213
+ "key": "titleColor",
214
+ "type": "color",
215
+ "visible": true,
216
+ "locales": {
217
+ "zh": {
218
+ "defaultValue": "rgb(45, 36, 45)",
219
+ "name": "标题颜色"
220
+ },
221
+ "en": {
222
+ "defaultValue": "rgb(44, 39, 44)",
223
+ "name": "Title Color"
224
+ }
225
+ }
226
+ }
227
+ },
228
+ "4f49q5uidkcp5ak4": {
229
+ "index": 8,
230
+ "data": {
231
+ "id": "4f49q5uidkcp5ak4",
232
+ "key": "json",
233
+ "type": "json",
234
+ "visible": true,
235
+ "locales": {
236
+ "zh": {
237
+ "name": "JSON 数据",
238
+ "defaultValue": {
239
+ "foo": "-",
240
+ "bar": "-"
241
+ }
242
+ },
243
+ "en": {
244
+ "name": "JSON Data",
245
+ "defaultValue": {
246
+ "foo": "foo",
247
+ "bar": "bar"
248
+ }
249
+ }
250
+ },
251
+ "subProperties": {
252
+ "gpy89bsxc6ovvlsp": {
253
+ "index": 0,
254
+ "data": {
255
+ "id": "gpy89bsxc6ovvlsp",
256
+ "key": "foo",
257
+ "type": "string",
258
+ "visible": true,
259
+ "locales": {
260
+ "zh": {
261
+ "name": "名称",
262
+ "defaultValue": "-"
263
+ },
264
+ "en": {
265
+ "name": "Foo",
266
+ "defaultValue": "foo"
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "1j34jdhdptp2xm5e": {
272
+ "index": 1,
273
+ "data": {
274
+ "id": "1j34jdhdptp2xm5e",
275
+ "key": "bar",
276
+ "type": "string",
277
+ "visible": true,
278
+ "locales": {
279
+ "zh": {
280
+ "name": "属性",
281
+ "defaultValue": "-"
282
+ },
283
+ "en": {
284
+ "name": "Bar",
285
+ "defaultValue": "bar"
286
+ }
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
292
+ },
293
+ "lbclpm6mxrp10w2k": {
294
+ "index": 9,
295
+ "data": {
296
+ "id": "lbclpm6mxrp10w2k",
297
+ "key": "array",
298
+ "type": "array",
299
+ "visible": true,
300
+ "locales": {
301
+ "zh": {
302
+ "name": "数组数据",
303
+ "defaultValue": [
304
+ {
305
+ "name": "示例用户",
306
+ "bio": "这是一个示例用户"
307
+ }
308
+ ]
309
+ },
310
+ "en": {
311
+ "name": "Array Data",
312
+ "defaultValue": [
313
+ {
314
+ "name": "Example User",
315
+ "bio": "This is an example user"
316
+ }
317
+ ]
318
+ }
319
+ },
320
+ "subProperties": {
321
+ "1c5vl2p9cn9ryvgh": {
322
+ "index": 0,
323
+ "data": {
324
+ "id": "1c5vl2p9cn9ryvgh",
325
+ "key": "name",
326
+ "type": "string",
327
+ "visible": true,
328
+ "locales": {
329
+ "zh": {
330
+ "name": "姓名",
331
+ "defaultValue": ""
332
+ },
333
+ "en": {
334
+ "name": "Name",
335
+ "defaultValue": ""
336
+ }
337
+ }
338
+ }
339
+ },
340
+ "c5whnccwzqqzaa0w": {
341
+ "index": 1,
342
+ "data": {
343
+ "id": "c5whnccwzqqzaa0w",
344
+ "key": "bio",
345
+ "type": "multiline",
346
+ "visible": true,
347
+ "locales": {
348
+ "zh": {
349
+ "name": "简介",
350
+ "defaultValue": ""
351
+ },
352
+ "en": {
353
+ "name": "Bio",
354
+ "defaultValue": ""
355
+ }
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+ },
362
+ "s0tund4p07bzizgv": {
363
+ "index": 10,
364
+ "data": {
365
+ "id": "s0tund4p07bzizgv",
366
+ "key": "yaml",
367
+ "type": "yaml",
368
+ "visible": true,
369
+ "locales": {
370
+ "zh": {
371
+ "name": "YAML 配置",
372
+ "defaultValue": ""
373
+ },
374
+ "en": {
375
+ "name": "YAML Configuration",
376
+ "defaultValue": "ya: ya\nml: ml\n"
377
+ }
378
+ },
379
+ "subProperties": {
380
+ "1q8tsreh4k2mhbgs": {
381
+ "index": 0,
382
+ "data": {
383
+ "id": "1q8tsreh4k2mhbgs",
384
+ "key": "ya",
385
+ "type": "string",
386
+ "visible": true,
387
+ "locales": {
388
+ "en": {
389
+ "name": "Ya",
390
+ "defaultValue": "ya"
391
+ }
392
+ }
393
+ }
394
+ },
395
+ "09w8sncxwrj6tldi": {
396
+ "index": 1,
397
+ "data": {
398
+ "id": "09w8sncxwrj6tldi",
399
+ "key": "ml",
400
+ "type": "string",
401
+ "visible": true,
402
+ "locales": {
403
+ "en": {
404
+ "name": "Ml",
405
+ "defaultValue": "ml"
406
+ }
407
+ }
408
+ }
409
+ }
410
+ }
411
+ }
412
+ },
413
+ "8e7g6c61pxcy0q4w": {
414
+ "index": 11,
415
+ "data": {
416
+ "id": "8e7g6c61pxcy0q4w",
417
+ "key": "children",
418
+ "type": "component",
419
+ "visible": true,
420
+ "locales": {
421
+ "zh": {
422
+ "name": "子组件",
423
+ "defaultValue": {}
424
+ },
425
+ "en": {
426
+ "name": "Children Components",
427
+ "defaultValue": {}
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "Hello World",
3
+ "description": "A simple `HelloWorld` component example"
4
+ }