@coze-arch/cli 0.0.1-alpha.77c1b0 → 0.0.1-alpha.7ccf88

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 (163) hide show
  1. package/lib/__templates__/expo/.coze +7 -2
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +220 -0
  4. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +34 -0
  6. package/lib/__templates__/expo/README.md +66 -7
  7. package/lib/__templates__/expo/_gitignore +1 -1
  8. package/lib/__templates__/expo/_npmrc +3 -5
  9. package/lib/__templates__/expo/client/app/_layout.tsx +1 -1
  10. package/lib/__templates__/expo/client/app/home.tsx +1 -0
  11. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  12. package/lib/__templates__/expo/client/app.config.ts +75 -0
  13. package/lib/__templates__/expo/client/assets/images/coze-logo.png +0 -0
  14. package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
  15. package/lib/__templates__/expo/client/components/ThemedView.tsx +38 -0
  16. package/lib/__templates__/expo/client/constants/theme.ts +780 -48
  17. package/lib/__templates__/expo/client/contexts/AuthContext.tsx +14 -107
  18. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +34 -1
  19. package/lib/__templates__/expo/client/hooks/useTheme.ts +1 -1
  20. package/lib/__templates__/expo/client/metro.config.js +121 -0
  21. package/lib/__templates__/expo/client/package.json +93 -0
  22. package/lib/__templates__/expo/client/screens/home/index.tsx +9 -42
  23. package/lib/__templates__/expo/client/screens/home/styles.ts +16 -324
  24. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +36 -12
  25. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  26. package/lib/__templates__/expo/client/utils/index.ts +1 -2
  27. package/lib/__templates__/expo/package.json +13 -93
  28. package/lib/__templates__/expo/pnpm-lock.yaml +520 -839
  29. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  30. package/lib/__templates__/expo/server/package.json +30 -0
  31. package/lib/__templates__/expo/{src → server/src}/index.ts +2 -2
  32. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  33. package/lib/__templates__/expo/template.config.js +1 -1
  34. package/lib/__templates__/expo/tsconfig.json +1 -24
  35. package/lib/__templates__/nextjs/.coze +4 -3
  36. package/lib/__templates__/nextjs/README.md +341 -19
  37. package/lib/__templates__/nextjs/_npmrc +1 -1
  38. package/lib/__templates__/nextjs/components.json +21 -0
  39. package/lib/__templates__/nextjs/next.config.ts +10 -0
  40. package/lib/__templates__/nextjs/package.json +56 -2
  41. package/lib/__templates__/nextjs/pnpm-lock.yaml +7947 -1523
  42. package/lib/__templates__/nextjs/scripts/dev.sh +9 -27
  43. package/lib/__templates__/{react-rsbuild/scripts/build.sh → nextjs/scripts/prepare.sh} +0 -5
  44. package/lib/__templates__/nextjs/src/app/globals.css +114 -11
  45. package/lib/__templates__/nextjs/src/app/layout.tsx +18 -18
  46. package/lib/__templates__/nextjs/src/app/page.tsx +2 -3
  47. package/lib/__templates__/nextjs/src/components/ui/accordion.tsx +66 -0
  48. package/lib/__templates__/nextjs/src/components/ui/alert-dialog.tsx +157 -0
  49. package/lib/__templates__/nextjs/src/components/ui/alert.tsx +66 -0
  50. package/lib/__templates__/nextjs/src/components/ui/aspect-ratio.tsx +11 -0
  51. package/lib/__templates__/nextjs/src/components/ui/avatar.tsx +53 -0
  52. package/lib/__templates__/nextjs/src/components/ui/badge.tsx +46 -0
  53. package/lib/__templates__/nextjs/src/components/ui/breadcrumb.tsx +109 -0
  54. package/lib/__templates__/nextjs/src/components/ui/button-group.tsx +83 -0
  55. package/lib/__templates__/nextjs/src/components/ui/button.tsx +62 -0
  56. package/lib/__templates__/nextjs/src/components/ui/calendar.tsx +220 -0
  57. package/lib/__templates__/nextjs/src/components/ui/card.tsx +92 -0
  58. package/lib/__templates__/nextjs/src/components/ui/carousel.tsx +241 -0
  59. package/lib/__templates__/nextjs/src/components/ui/chart.tsx +357 -0
  60. package/lib/__templates__/nextjs/src/components/ui/checkbox.tsx +32 -0
  61. package/lib/__templates__/nextjs/src/components/ui/collapsible.tsx +33 -0
  62. package/lib/__templates__/nextjs/src/components/ui/command.tsx +184 -0
  63. package/lib/__templates__/nextjs/src/components/ui/context-menu.tsx +252 -0
  64. package/lib/__templates__/nextjs/src/components/ui/dialog.tsx +143 -0
  65. package/lib/__templates__/nextjs/src/components/ui/drawer.tsx +135 -0
  66. package/lib/__templates__/nextjs/src/components/ui/dropdown-menu.tsx +257 -0
  67. package/lib/__templates__/nextjs/src/components/ui/empty.tsx +104 -0
  68. package/lib/__templates__/nextjs/src/components/ui/field.tsx +248 -0
  69. package/lib/__templates__/nextjs/src/components/ui/form.tsx +167 -0
  70. package/lib/__templates__/nextjs/src/components/ui/hover-card.tsx +44 -0
  71. package/lib/__templates__/nextjs/src/components/ui/input-group.tsx +170 -0
  72. package/lib/__templates__/nextjs/src/components/ui/input-otp.tsx +77 -0
  73. package/lib/__templates__/nextjs/src/components/ui/input.tsx +21 -0
  74. package/lib/__templates__/nextjs/src/components/ui/item.tsx +193 -0
  75. package/lib/__templates__/nextjs/src/components/ui/kbd.tsx +28 -0
  76. package/lib/__templates__/nextjs/src/components/ui/label.tsx +24 -0
  77. package/lib/__templates__/nextjs/src/components/ui/menubar.tsx +276 -0
  78. package/lib/__templates__/nextjs/src/components/ui/navigation-menu.tsx +168 -0
  79. package/lib/__templates__/nextjs/src/components/ui/pagination.tsx +127 -0
  80. package/lib/__templates__/nextjs/src/components/ui/popover.tsx +48 -0
  81. package/lib/__templates__/nextjs/src/components/ui/progress.tsx +31 -0
  82. package/lib/__templates__/nextjs/src/components/ui/radio-group.tsx +45 -0
  83. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +63 -0
  84. package/lib/__templates__/nextjs/src/components/ui/scroll-area.tsx +58 -0
  85. package/lib/__templates__/nextjs/src/components/ui/select.tsx +190 -0
  86. package/lib/__templates__/nextjs/src/components/ui/separator.tsx +28 -0
  87. package/lib/__templates__/nextjs/src/components/ui/sheet.tsx +139 -0
  88. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +724 -0
  89. package/lib/__templates__/nextjs/src/components/ui/skeleton.tsx +13 -0
  90. package/lib/__templates__/nextjs/src/components/ui/slider.tsx +63 -0
  91. package/lib/__templates__/nextjs/src/components/ui/sonner.tsx +40 -0
  92. package/lib/__templates__/nextjs/src/components/ui/spinner.tsx +16 -0
  93. package/lib/__templates__/nextjs/src/components/ui/switch.tsx +31 -0
  94. package/lib/__templates__/nextjs/src/components/ui/table.tsx +116 -0
  95. package/lib/__templates__/nextjs/src/components/ui/tabs.tsx +66 -0
  96. package/lib/__templates__/nextjs/src/components/ui/textarea.tsx +18 -0
  97. package/lib/__templates__/nextjs/src/components/ui/toggle-group.tsx +83 -0
  98. package/lib/__templates__/nextjs/src/components/ui/toggle.tsx +47 -0
  99. package/lib/__templates__/nextjs/src/components/ui/tooltip.tsx +61 -0
  100. package/lib/__templates__/nextjs/src/hooks/use-mobile.ts +19 -0
  101. package/lib/__templates__/nextjs/src/lib/utils.ts +6 -0
  102. package/lib/__templates__/nextjs/template.config.js +2 -2
  103. package/lib/__templates__/templates.json +6 -37
  104. package/lib/__templates__/vite/.coze +4 -3
  105. package/lib/__templates__/vite/README.md +204 -26
  106. package/lib/__templates__/vite/_npmrc +1 -1
  107. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  108. package/lib/__templates__/vite/package.json +6 -3
  109. package/lib/__templates__/vite/pnpm-lock.yaml +961 -120
  110. package/lib/__templates__/vite/scripts/dev.sh +7 -26
  111. package/lib/__templates__/{rsbuild/scripts/build.sh → vite/scripts/prepare.sh} +0 -5
  112. package/lib/__templates__/vite/template.config.js +11 -2
  113. package/lib/__templates__/vite/vite.config.ts +3 -3
  114. package/lib/cli.js +581 -291
  115. package/package.json +11 -4
  116. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -109
  117. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -257
  118. package/lib/__templates__/expo/app.json +0 -63
  119. package/lib/__templates__/expo/babel.config.js +0 -9
  120. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  121. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  122. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  123. package/lib/__templates__/expo/client/app/+not-found.tsx +0 -79
  124. package/lib/__templates__/expo/client/index.js +0 -12
  125. package/lib/__templates__/expo/metro.config.js +0 -53
  126. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  127. package/lib/__templates__/react-rsbuild/.coze +0 -11
  128. package/lib/__templates__/react-rsbuild/.vscode/settings.json +0 -121
  129. package/lib/__templates__/react-rsbuild/README.md +0 -61
  130. package/lib/__templates__/react-rsbuild/_gitignore +0 -97
  131. package/lib/__templates__/react-rsbuild/_npmrc +0 -22
  132. package/lib/__templates__/react-rsbuild/package.json +0 -31
  133. package/lib/__templates__/react-rsbuild/pnpm-lock.yaml +0 -997
  134. package/lib/__templates__/react-rsbuild/rsbuild.config.ts +0 -13
  135. package/lib/__templates__/react-rsbuild/scripts/dev.sh +0 -51
  136. package/lib/__templates__/react-rsbuild/scripts/start.sh +0 -15
  137. package/lib/__templates__/react-rsbuild/src/App.tsx +0 -60
  138. package/lib/__templates__/react-rsbuild/src/index.css +0 -21
  139. package/lib/__templates__/react-rsbuild/src/index.html +0 -12
  140. package/lib/__templates__/react-rsbuild/src/index.tsx +0 -16
  141. package/lib/__templates__/react-rsbuild/tailwind.config.js +0 -9
  142. package/lib/__templates__/react-rsbuild/template.config.js +0 -54
  143. package/lib/__templates__/react-rsbuild/tsconfig.json +0 -17
  144. package/lib/__templates__/rsbuild/.coze +0 -11
  145. package/lib/__templates__/rsbuild/.vscode/settings.json +0 -7
  146. package/lib/__templates__/rsbuild/README.md +0 -61
  147. package/lib/__templates__/rsbuild/_gitignore +0 -97
  148. package/lib/__templates__/rsbuild/_npmrc +0 -22
  149. package/lib/__templates__/rsbuild/package.json +0 -24
  150. package/lib/__templates__/rsbuild/pnpm-lock.yaml +0 -888
  151. package/lib/__templates__/rsbuild/rsbuild.config.ts +0 -12
  152. package/lib/__templates__/rsbuild/scripts/dev.sh +0 -51
  153. package/lib/__templates__/rsbuild/scripts/start.sh +0 -15
  154. package/lib/__templates__/rsbuild/src/index.css +0 -21
  155. package/lib/__templates__/rsbuild/src/index.html +0 -12
  156. package/lib/__templates__/rsbuild/src/index.ts +0 -5
  157. package/lib/__templates__/rsbuild/src/main.ts +0 -65
  158. package/lib/__templates__/rsbuild/tailwind.config.js +0 -9
  159. package/lib/__templates__/rsbuild/template.config.js +0 -56
  160. package/lib/__templates__/rsbuild/tsconfig.json +0 -16
  161. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  162. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
  163. /package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +0 -0
@@ -1,332 +1,24 @@
1
- import { StyleSheet, Platform } from 'react-native';
1
+ import { StyleSheet } from 'react-native';
2
2
 
3
- const styles = StyleSheet.create({
4
- loadingContainer: {
5
- flex: 1,
6
- justifyContent: 'center',
7
- alignItems: 'center',
8
- },
9
- loadingText: {
10
- marginTop: 12,
11
- fontSize: 14,
12
- color: '#64748B',
13
- },
14
- errorContainer: {
15
- flex: 1,
16
- justifyContent: 'center',
17
- alignItems: 'center',
18
- paddingHorizontal: 24,
19
- },
20
- errorText: {
21
- marginTop: 16,
22
- fontSize: 16,
23
- color: '#64748B',
24
- },
25
- retryButton: {
26
- marginTop: 20,
27
- paddingHorizontal: 24,
28
- paddingVertical: 12,
29
- backgroundColor: '#2563EB',
30
- borderRadius: 8,
31
- },
32
- retryButtonText: {
33
- color: '#FFFFFF',
34
- fontSize: 14,
35
- fontWeight: '600',
36
- },
37
- header: {
38
- flexDirection: 'row',
39
- justifyContent: 'space-between',
40
- alignItems: 'center',
41
- paddingHorizontal: 16,
42
- // paddingBottom: 16,
43
- backgroundColor: '#FFFFFF',
44
- // borderBottomWidth: 1,
45
- borderBottomColor: '#E2E8F0',
46
- },
47
- headerLeft: {
48
- flexDirection: 'row',
49
- alignItems: 'center',
50
- gap: 10,
51
- },
52
- logoContainer: {
53
- width: 32,
54
- height: 32,
55
- backgroundColor: '#2563EB',
56
- borderRadius: 8,
57
- justifyContent: 'center',
3
+ export const styles = StyleSheet.create({
4
+ container: {
5
+ position: 'absolute',
6
+ top: 0,
7
+ left: 0,
8
+ width: '100%',
9
+ height: '100%',
10
+ display: 'flex',
11
+ flexDirection: 'column',
58
12
  alignItems: 'center',
59
- ...Platform.select({
60
- ios: {
61
- shadowColor: '#000',
62
- shadowOffset: { width: 0, height: 1 },
63
- shadowOpacity: 0.1,
64
- shadowRadius: 2,
65
- },
66
- android: {
67
- elevation: 2,
68
- },
69
- }),
70
- },
71
- logoText: {
72
- fontSize: 18,
73
- fontWeight: '700',
74
- color: '#1E293B',
75
- letterSpacing: -0.5,
76
- },
77
- userMenuContainer: {
78
- flexDirection: 'row',
79
- alignItems: 'center',
80
- gap: 10,
81
- paddingLeft: 16,
82
- borderLeftWidth: 1,
83
- borderLeftColor: '#E2E8F0',
84
- },
85
- userInfo: {
86
- alignItems: 'flex-end',
87
- },
88
- userName: {
89
- fontSize: 14,
90
- fontWeight: '500',
91
- color: '#1E293B',
92
- },
93
- userRole: {
94
- fontSize: 12,
95
- color: '#64748B',
96
- },
97
- avatar: {
98
- width: 36,
99
- height: 36,
100
- borderRadius: 18,
101
- borderWidth: 2,
102
- borderColor: '#FFFFFF',
103
- ...Platform.select({
104
- ios: {
105
- shadowColor: '#000',
106
- shadowOffset: { width: 0, height: 1 },
107
- shadowOpacity: 0.1,
108
- shadowRadius: 2,
109
- },
110
- android: {
111
- elevation: 2,
112
- },
113
- }),
114
- },
115
- avatarPlaceholder: {
116
- width: 36,
117
- height: 36,
118
- borderRadius: 18,
119
13
  justifyContent: 'center',
120
- alignItems: 'center',
121
- borderWidth: 2,
122
- borderColor: '#FFFFFF',
123
- backgroundColor: '#3B82F6',
124
- ...Platform.select({
125
- ios: {
126
- shadowColor: '#000',
127
- shadowOffset: { width: 0, height: 1 },
128
- shadowOpacity: 0.1,
129
- shadowRadius: 2,
130
- },
131
- android: {
132
- elevation: 2,
133
- },
134
- }),
135
- },
136
- avatarInitial: {
137
- fontSize: 14,
138
- fontWeight: '700',
139
- color: '#FFFFFF',
140
- },
141
- content: {
142
- paddingHorizontal: 16,
143
- paddingTop: 24,
144
14
  },
145
- welcomeSection: {
146
- marginBottom: 24,
147
- },
148
- welcomeTitle: {
149
- fontSize: 22,
150
- fontWeight: '700',
151
- color: '#1E293B',
152
- marginBottom: 4,
153
- },
154
- welcomeSubtitle: {
15
+ text: {
155
16
  fontSize: 14,
156
- color: '#64748B',
157
- },
158
- statsGrid: {
159
- flexDirection: 'row',
160
- gap: 12,
161
- marginBottom: 24,
162
- },
163
- statCard: {
164
- flex: 1,
165
- backgroundColor: '#FFFFFF',
166
- borderRadius: 12,
167
- padding: 16,
168
- ...Platform.select({
169
- ios: {
170
- shadowColor: '#000',
171
- shadowOffset: { width: 0, height: 1 },
172
- shadowOpacity: 0.05,
173
- shadowRadius: 3,
174
- },
175
- android: {
176
- elevation: 2,
177
- },
178
- }),
17
+ fontWeight: 'bold',
179
18
  },
180
- statCardHeader: {
181
- flexDirection: 'row',
182
- justifyContent: 'space-between',
183
- alignItems: 'flex-start',
184
- marginBottom: 12,
185
- },
186
- statIconContainer: {
187
- width: 40,
188
- height: 40,
189
- borderRadius: 10,
190
- justifyContent: 'center',
191
- alignItems: 'center',
192
- },
193
- statIconBlue: {
194
- backgroundColor: '#EFF6FF',
195
- },
196
- statIconRed: {
197
- backgroundColor: '#FEF2F2',
198
- },
199
- statIconGreen: {
200
- backgroundColor: '#ECFDF5',
201
- },
202
- attentionBadge: {
203
- backgroundColor: '#FEF2F2',
204
- paddingHorizontal: 6,
205
- paddingVertical: 2,
206
- borderRadius: 10,
207
- },
208
- attentionBadgeText: {
209
- fontSize: 10,
210
- fontWeight: '500',
211
- color: '#EF4444',
212
- },
213
- rateBadge: {
214
- backgroundColor: '#ECFDF5',
215
- paddingHorizontal: 6,
216
- paddingVertical: 2,
217
- borderRadius: 10,
218
- },
219
- rateBadgeText: {
220
- fontSize: 10,
221
- fontWeight: '500',
222
- color: '#10B981',
223
- },
224
- statValue: {
225
- fontSize: 28,
226
- fontWeight: '700',
227
- color: '#1E293B',
228
- marginBottom: 2,
229
- },
230
- statLabel: {
231
- fontSize: 13,
232
- color: '#64748B',
233
- },
234
- shortcutsSection: {
235
- gap: 12,
236
- marginBottom: 24,
237
- },
238
- shortcutCard: {
239
- flexDirection: 'row',
240
- justifyContent: 'space-between',
241
- alignItems: 'center',
242
- backgroundColor: '#FFFFFF',
243
- borderRadius: 12,
244
- padding: 16,
245
- ...Platform.select({
246
- ios: {
247
- shadowColor: '#000',
248
- shadowOffset: { width: 0, height: 1 },
249
- shadowOpacity: 0.05,
250
- shadowRadius: 3,
251
- },
252
- android: {
253
- elevation: 2,
254
- },
255
- }),
256
- },
257
- shortcutContent: {
258
- flex: 1,
259
- marginRight: 16,
260
- },
261
- shortcutTitle: {
262
- fontSize: 16,
263
- fontWeight: '600',
264
- color: '#1E293B',
265
- marginBottom: 6,
266
- },
267
- shortcutDescription: {
268
- fontSize: 13,
269
- color: '#64748B',
270
- marginBottom: 10,
271
- lineHeight: 18,
272
- },
273
- shortcutAction: {
274
- flexDirection: 'row',
275
- alignItems: 'center',
276
- gap: 6,
277
- },
278
- shortcutActionText: {
279
- fontSize: 13,
280
- fontWeight: '500',
281
- color: '#2563EB',
282
- },
283
- shortcutIconContainer: {
284
- width: 56,
285
- height: 56,
286
- borderRadius: 28,
287
- justifyContent: 'center',
288
- alignItems: 'center',
289
- },
290
- shortcutIconBlue: {
291
- backgroundColor: '#EFF6FF',
292
- },
293
- shortcutIconGreen: {
294
- backgroundColor: '#ECFDF5',
295
- },
296
- bannerContainer: {
297
- height: 160,
298
- borderRadius: 12,
299
- overflow: 'hidden',
300
- backgroundColor: '#1E3A8A',
301
- },
302
- bannerOverlay: {
303
- flex: 1,
304
- justifyContent: 'center',
305
- paddingHorizontal: 20,
306
- },
307
- bannerTitle: {
308
- fontSize: 18,
309
- fontWeight: '700',
310
- color: '#FFFFFF',
311
- marginBottom: 6,
312
- },
313
- bannerSubtitle: {
314
- fontSize: 13,
315
- color: '#BFDBFE',
316
- marginBottom: 16,
317
- },
318
- bannerButton: {
319
- alignSelf: 'flex-start',
320
- backgroundColor: '#FFFFFF',
321
- paddingHorizontal: 20,
322
- paddingVertical: 10,
323
- borderRadius: 8,
324
- },
325
- bannerButtonText: {
326
- fontSize: 13,
327
- fontWeight: '500',
328
- color: '#2563EB',
19
+ logo: {
20
+ width: 64,
21
+ height: 64,
22
+ marginBottom: 32,
329
23
  },
330
24
  });
331
-
332
- export default styles;
@@ -18,7 +18,7 @@ try {
18
18
  try {
19
19
  depcheckOutput = execSync('npx depcheck --json', {
20
20
  encoding: 'utf-8',
21
- stdio: ['pipe', 'pipe', 'pipe']
21
+ stdio: ['pipe', 'pipe', 'pipe'],
22
22
  });
23
23
  } catch (execError) {
24
24
  // depcheck 返回非零退出码时仍然有输出
@@ -30,10 +30,34 @@ try {
30
30
  }
31
31
 
32
32
  const result = JSON.parse(depcheckOutput);
33
-
33
+
34
34
  // 获取缺失的依赖
35
35
  const missing = result.missing || {};
36
- const missingPackages = Object.keys(missing).filter(pkg => !pkg.startsWith('@api/') && !pkg.startsWith('@/') && pkg !== '@api');
36
+
37
+ // 需要忽略的文件模式
38
+ const ignoreFilePatterns = [
39
+ /template\.config\.(ts|js)$/, // 模板配置文件
40
+ /\.template\./, // 其他模板文件
41
+ ];
42
+
43
+ // 过滤包:排除内部别名和只被模板文件引用的包
44
+ const missingPackages = Object.keys(missing).filter(pkg => {
45
+ // 排除内部路径别名
46
+ if (pkg.startsWith('@api/') || pkg.startsWith('@/') || pkg === '@api') {
47
+ return false;
48
+ }
49
+
50
+ // 获取引用该包的文件列表
51
+ const referencingFiles = missing[pkg] || [];
52
+
53
+ // 过滤掉模板配置文件
54
+ const nonTemplateFiles = referencingFiles.filter(file => {
55
+ return !ignoreFilePatterns.some(pattern => pattern.test(file));
56
+ });
57
+
58
+ // 只有当存在非模板文件引用时才保留该包
59
+ return nonTemplateFiles.length > 0;
60
+ });
37
61
 
38
62
  if (missingPackages.length === 0) {
39
63
  console.log('✅ 没有发现缺失的依赖!');
@@ -44,30 +68,31 @@ try {
44
68
  missingPackages.forEach((pkg, index) => {
45
69
  const files = missing[pkg];
46
70
  console.log(` ${index + 1}. ${pkg}`);
47
- console.log(` 被引用于: ${files.slice(0, 2).join(', ')}${files.length > 2 ? ' ...' : ''}`);
71
+ console.log(
72
+ ` 被引用于: ${files.slice(0, 2).join(', ')}${files.length > 2 ? ' ...' : ''}`,
73
+ );
48
74
  });
49
75
 
50
76
  console.log('\n🚀 开始安装...\n');
51
77
 
52
78
  // 使用 expo install 安装所有缺失的包
53
79
  const packagesToInstall = missingPackages.join(' ');
54
-
80
+
55
81
  try {
56
82
  execSync(`pnpm expo install ${packagesToInstall}`, {
57
- stdio: 'inherit'
83
+ stdio: 'inherit',
58
84
  });
59
-
85
+
60
86
  console.log('\n✅ 所有缺失的依赖已安装完成!');
61
87
  } catch (installError) {
62
88
  console.log('\n⚠️ expo install 失败,尝试使用 npm install...\n');
63
-
89
+
64
90
  execSync(`npm install ${packagesToInstall}`, {
65
- stdio: 'inherit'
91
+ stdio: 'inherit',
66
92
  });
67
-
93
+
68
94
  console.log('\n✅ 所有缺失的依赖已通过 npm 安装完成!');
69
95
  }
70
-
71
96
  } catch (error) {
72
97
  if (error.message.includes('depcheck')) {
73
98
  console.error('❌ depcheck 未安装或运行失败');
@@ -77,4 +102,3 @@ try {
77
102
  }
78
103
  process.exit(1);
79
104
  }
80
-
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "expo/tsconfig.base",
3
+ "compilerOptions": {
4
+ "skipLibCheck": true,
5
+ "jsx": "react-jsx",
6
+ "baseUrl": ".",
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "paths": {
10
+ "@/*": ["./*"]
11
+ }
12
+ },
13
+ "include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"],
14
+ "exclude": [
15
+ "node_modules",
16
+ "**/*.spec.ts",
17
+ "**/*.test.ts",
18
+ "**/*.spec.tsx",
19
+ "**/*.test.tsx",
20
+ "dist",
21
+ "build",
22
+ ".expo"
23
+ ]
24
+ }
@@ -1,4 +1,3 @@
1
- // import { OpenAPI } from '@api'; // 如果使用 openapi 客户端,请取消注释并确保安装
2
1
  import dayjs from 'dayjs';
3
2
  import utc from 'dayjs/plugin/utc';
4
3
  dayjs.extend(utc);
@@ -26,7 +25,7 @@ export const buildAssetUrl = (url?: string | null, w?: number, h?: number): stri
26
25
  // 3. 构造参数,保留原有 Query (如有)
27
26
  const separator = abs.includes('?') ? '&' : '?';
28
27
  const query = [
29
- w ? `w=${Math.floor(w)}` : '',
28
+ w ? `w=${Math.floor(w)}` : '',
30
29
  h ? `h=${Math.floor(h)}` : ''
31
30
  ].filter(Boolean).join('&');
32
31
  return `${abs}${separator}${query}`;
@@ -1,102 +1,22 @@
1
1
  {
2
- "name": "<%= appName %>",
3
- "version": "1.0.0",
2
+ "name": "expo-express-monorepo",
4
3
  "private": true,
5
- "main": "client/index.js",
4
+ "version": "0.0.0",
6
5
  "scripts": {
7
- "build": "bash .cozeproj/scripts/deploy_build.sh",
8
- "check-deps": "npx depcheck",
9
- "dev": "bash .cozeproj/scripts/deploy_run.sh",
10
- "install-missing": "node ./client/scripts/install-missing-deps.js",
11
- "lint": "expo lint",
12
- "preinstall": "npx only-allow pnpm",
13
- "postinstall": "node ./client/scripts/install-missing-deps.js",
14
- "server": "NODE_ENV=development tsx ./src/index.ts",
15
- "start": "expo start --web",
16
- "test": "jest --watchAll"
17
- },
18
- "jest": {
19
- "preset": "jest-expo"
20
- },
21
- "dependencies": {
22
- "@expo/metro-runtime": "^6.1.2",
23
- "@expo/vector-icons": "^15.0.0",
24
- "@react-native-async-storage/async-storage": "^2.2.0",
25
- "@react-native-community/datetimepicker": "^8.5.0",
26
- "@react-native-community/slider": "^5.0.1",
27
- "@react-native-masked-view/masked-view": "^0.3.2",
28
- "@react-native-picker/picker": "^2.11.0",
29
- "@react-navigation/bottom-tabs": "^7.2.0",
30
- "@react-navigation/native": "^7.0.14",
31
- "ajv": "^8.17.1",
32
- "ajv-formats": "^3.0.1",
33
- "coze-coding-dev-sdk": "0.5.0",
34
- "dayjs": "^1.11.19",
35
- "expo": "^54.0.7",
36
- "expo-auth-session": "^7.0.9",
37
- "expo-av": "~16.0.6",
38
- "expo-blur": "~15.0.6",
39
- "expo-camera": "~17.0.10",
40
- "expo-constants": "~18.0.8",
41
- "expo-crypto": "^15.0.7",
42
- "expo-font": "~14.0.7",
43
- "expo-haptics": "~15.0.6",
44
- "expo-image-picker": "~17.0.7",
45
- "expo-linear-gradient": "~15.0.6",
46
- "expo-linking": "~8.0.7",
47
- "expo-location": "~19.0.7",
48
- "expo-router": "~6.0.0",
49
- "expo-splash-screen": "~31.0.8",
50
- "expo-status-bar": "~3.0.7",
51
- "expo-symbols": "~1.0.6",
52
- "expo-system-ui": "~6.0.9",
53
- "expo-web-browser": "~15.0.10",
54
- "express": "^4.22.1",
55
- "react": "19.1.0",
56
- "react-dom": "19.1.0",
57
- "react-native": "0.81.5",
58
- "react-native-chart-kit": "^6.12.0",
59
- "react-native-gesture-handler": "~2.28.0",
60
- "react-native-keyboard-aware-scroll-view": "^0.9.5",
61
- "react-native-modal-datetime-picker": "18.0.0",
62
- "react-native-reanimated": "~4.1.0",
63
- "react-native-safe-area-context": "~5.6.0",
64
- "react-native-screens": "~4.16.0",
65
- "react-native-svg": "15.15.0",
66
- "react-native-toast-message": "^2.3.3",
67
- "react-native-web": "^0.21.2",
68
- "react-native-webview": "~13.15.0",
69
- "react-native-worklets": "0.5.1",
70
- "zod": "^4.2.1"
71
- },
72
- "devDependencies": {
73
- "@babel/core": "^7.25.2",
74
- "@eslint/js": "^9.27.0",
75
- "@types/express": "^5.0.6",
76
- "@types/jest": "^29.5.12",
77
- "@types/react": "~19.1.0",
78
- "@types/react-test-renderer": "19.1.0",
79
- "babel-plugin-module-resolver": "^5.0.2",
80
- "babel-preset-expo": "^54.0.9",
81
- "chalk": "^4.1.2",
82
- "depcheck": "^1.4.7",
83
- "eslint": "^9.27.0",
84
- "eslint-formatter-compact": "^9.0.1",
85
- "eslint-import-resolver-typescript": "^4.4.4",
86
- "eslint-plugin-import": "^2.32.0",
87
- "eslint-plugin-react": "^7.37.5",
88
- "eslint-plugin-react-hooks": "^7.0.1",
89
- "eslint-plugin-regexp": "^2.10.0",
90
- "globals": "^16.1.0",
91
- "jest": "^29.2.1",
92
- "jest-expo": "~54.0.10",
93
- "react-test-renderer": "19.1.0",
94
- "tsx": "^4.21.0",
95
- "typescript": "^5.8.3",
96
- "typescript-eslint": "^8.32.1"
6
+ "dev": "bash .cozeproj/scripts/dev_run.sh",
7
+ "build": "bash .cozeproj/scripts/prod_build.sh",
8
+ "start": "bash .cozeproj/scripts/prod_run.sh",
9
+ "preinstall": "npx only-allow pnpm"
97
10
  },
11
+ "dependencies": {},
12
+ "devDependencies": {},
98
13
  "packageManager": "pnpm@9.0.0",
99
14
  "engines": {
100
15
  "pnpm": ">=9.0.0"
16
+ },
17
+ "pnpm": {
18
+ "overrides": {
19
+ "esbuild": "0.27.2"
20
+ }
101
21
  }
102
22
  }