@coze-arch/cli 0.0.1-alpha.f9be02 → 0.0.1-alpha.fd3d56

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/lib/__templates__/expo/.coze +1 -1
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +19 -82
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +75 -86
  4. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +2 -2
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +2 -2
  6. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +45 -0
  7. package/lib/__templates__/expo/README.md +68 -7
  8. package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
  9. package/lib/__templates__/expo/client/{src/app → app}/_layout.tsx +15 -12
  10. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  11. package/lib/__templates__/expo/client/app.config.ts +65 -60
  12. package/lib/__templates__/expo/client/{src/components → components}/Screen.tsx +1 -17
  13. package/lib/__templates__/expo/client/{src/components → components}/ThemedView.tsx +1 -2
  14. package/lib/__templates__/expo/client/constants/theme.ts +177 -0
  15. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  16. package/lib/__templates__/expo/client/eslint.config.mjs +30 -10
  17. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  18. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  19. package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
  20. package/lib/__templates__/expo/client/package.json +6 -3
  21. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  22. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  23. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
  24. package/lib/__templates__/expo/client/tsconfig.json +1 -1
  25. package/lib/__templates__/expo/client/{src/utils → utils}/index.ts +22 -0
  26. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  27. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  28. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  29. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  30. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  31. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  32. package/lib/__templates__/expo/package.json +7 -98
  33. package/lib/__templates__/expo/patches/expo@54.0.32.patch +44 -0
  34. package/lib/__templates__/expo/pnpm-lock.yaml +2001 -2124
  35. package/lib/__templates__/expo/server/build.js +21 -0
  36. package/lib/__templates__/expo/server/package.json +19 -4
  37. package/lib/__templates__/expo/server/src/index.ts +9 -2
  38. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  39. package/lib/__templates__/expo/template.config.js +1 -0
  40. package/lib/__templates__/nextjs/.babelrc +15 -0
  41. package/lib/__templates__/nextjs/.coze +1 -0
  42. package/lib/__templates__/nextjs/_npmrc +1 -0
  43. package/lib/__templates__/nextjs/next.config.ts +12 -0
  44. package/lib/__templates__/nextjs/package.json +10 -11
  45. package/lib/__templates__/nextjs/pnpm-lock.yaml +2543 -1747
  46. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  47. package/lib/__templates__/nextjs/src/app/globals.css +10 -2
  48. package/lib/__templates__/nextjs/src/app/layout.tsx +5 -14
  49. package/lib/__templates__/nextjs/src/app/page.tsx +35 -23
  50. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  51. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  52. package/lib/__templates__/nextjs/template.config.js +30 -0
  53. package/lib/__templates__/templates.json +61 -43
  54. package/lib/__templates__/vite/.coze +1 -0
  55. package/lib/__templates__/vite/_npmrc +1 -0
  56. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  57. package/lib/__templates__/vite/package.json +10 -1
  58. package/lib/__templates__/vite/pnpm-lock.yaml +3115 -126
  59. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  60. package/lib/__templates__/vite/src/main.ts +1 -2
  61. package/lib/__templates__/vite/template.config.js +30 -4
  62. package/lib/cli.js +691 -130
  63. package/package.json +5 -3
  64. package/lib/__templates__/expo/client/src/app/index.ts +0 -1
  65. package/lib/__templates__/expo/client/src/constants/theme.ts +0 -850
  66. package/lib/__templates__/expo/client/src/hooks/useColorScheme.ts +0 -1
  67. package/lib/__templates__/expo/client/src/hooks/useTheme.ts +0 -13
  68. package/lib/__templates__/expo/client/src/screens/home/index.tsx +0 -50
  69. package/lib/__templates__/expo/client/src/screens/home/styles.ts +0 -60
  70. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  71. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  72. /package/lib/__templates__/expo/client/{src/assets → assets}/fonts/SpaceMono-Regular.ttf +0 -0
  73. /package/lib/__templates__/expo/client/{src/assets → assets}/images/adaptive-icon.png +0 -0
  74. /package/lib/__templates__/expo/client/{src/assets → assets}/images/default-avatar.png +0 -0
  75. /package/lib/__templates__/expo/client/{src/assets → assets}/images/favicon.png +0 -0
  76. /package/lib/__templates__/expo/client/{src/assets → assets}/images/icon.png +0 -0
  77. /package/lib/__templates__/expo/client/{src/assets → assets}/images/partial-react-logo.png +0 -0
  78. /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo.png +0 -0
  79. /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@2x.png +0 -0
  80. /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@3x.png +0 -0
  81. /package/lib/__templates__/expo/client/{src/assets → assets}/images/splash-icon.png +0 -0
  82. /package/lib/__templates__/expo/client/{src/components → components}/SmartDateInput.tsx +0 -0
  83. /package/lib/__templates__/expo/client/{src/components → components}/ThemedText.tsx +0 -0
  84. /package/lib/__templates__/expo/client/{src/contexts → contexts}/AuthContext.tsx +0 -0
@@ -1,109 +1,15 @@
1
1
  {
2
- "name": "<%= appName %>",
2
+ "name": "expo-express-monorepo",
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
- "main": "expo-router/entry",
6
5
  "scripts": {
7
6
  "dev": "bash .cozeproj/scripts/dev_run.sh",
8
7
  "build": "bash .cozeproj/scripts/prod_build.sh",
9
8
  "start": "bash .cozeproj/scripts/prod_run.sh",
10
- "check-deps": "npx depcheck",
11
- "preinstall": "npx only-allow pnpm",
12
- "lint": "expo lint",
13
- "test": "jest --watchAll"
14
- },
15
- "jest": {
16
- "preset": "jest-expo"
17
- },
18
- "dependencies": {
19
- "@aws-sdk/client-s3": "^3.958.0",
20
- "@aws-sdk/lib-storage": "^3.958.0",
21
- "@expo/metro-runtime": "^6.1.2",
22
- "@expo/vector-icons": "^15.0.0",
23
- "@react-native-async-storage/async-storage": "^2.2.0",
24
- "@react-native-community/datetimepicker": "^8.5.0",
25
- "@react-native-community/slider": "^5.0.1",
26
- "@react-native-masked-view/masked-view": "^0.3.2",
27
- "@react-native-picker/picker": "^2.11.0",
28
- "@react-navigation/bottom-tabs": "^7.2.0",
29
- "@react-navigation/native": "^7.0.14",
30
- "ajv": "^8.17.1",
31
- "ajv-formats": "^3.0.1",
32
- "babel-plugin-module-resolver": "^5.0.2",
33
- "babel-preset-expo": "^54.0.9",
34
- "connect": "^3.7.0",
35
- "coze-coding-dev-sdk": "^0.5.5",
36
- "dayjs": "^1.11.19",
37
- "drizzle-kit": "^0.31.8",
38
- "drizzle-orm": "^0.45.1",
39
- "drizzle-zod": "^0.8.3",
40
- "expo": "^54.0.7",
41
- "expo-auth-session": "^7.0.9",
42
- "expo-av": "~16.0.6",
43
- "expo-blur": "~15.0.6",
44
- "expo-camera": "~17.0.10",
45
- "expo-constants": "~18.0.8",
46
- "expo-crypto": "^15.0.7",
47
- "expo-font": "~14.0.7",
48
- "expo-haptics": "~15.0.6",
49
- "expo-image-picker": "~17.0.7",
50
- "expo-linear-gradient": "~15.0.6",
51
- "expo-linking": "~8.0.7",
52
- "expo-location": "~19.0.7",
53
- "expo-router": "~6.0.0",
54
- "expo-splash-screen": "~31.0.8",
55
- "expo-status-bar": "~3.0.7",
56
- "expo-symbols": "~1.0.6",
57
- "expo-system-ui": "~6.0.9",
58
- "expo-web-browser": "~15.0.10",
59
- "express": "^4.22.1",
60
- "http-proxy-middleware": "^3.0.5",
61
- "multer": "^2.0.2",
62
- "pg": "^8.16.3",
63
- "react": "19.1.0",
64
- "react-dom": "19.1.0",
65
- "react-native": "0.81.5",
66
- "react-native-chart-kit": "^6.12.0",
67
- "react-native-gesture-handler": "~2.28.0",
68
- "react-native-keyboard-aware-scroll-view": "^0.9.5",
69
- "react-native-modal-datetime-picker": "18.0.0",
70
- "react-native-reanimated": "~4.1.0",
71
- "react-native-safe-area-context": "~5.6.0",
72
- "react-native-screens": "~4.16.0",
73
- "react-native-svg": "15.15.0",
74
- "react-native-toast-message": "^2.3.3",
75
- "react-native-web": "^0.21.2",
76
- "react-native-webview": "~13.15.0",
77
- "react-native-worklets": "0.5.1",
78
- "zod": "^4.2.1"
79
- },
80
- "devDependencies": {
81
- "@babel/core": "^7.25.2",
82
- "@eslint/js": "^9.27.0",
83
- "@types/express": "^5.0.6",
84
- "@types/jest": "^29.5.12",
85
- "@types/multer": "^2.0.0",
86
- "@types/pg": "^8.16.0",
87
- "@types/react": "~19.1.0",
88
- "@types/react-test-renderer": "19.1.0",
89
- "chalk": "^4.1.2",
90
- "depcheck": "^1.4.7",
91
- "esbuild": "0.27.2",
92
- "eslint": "^9.39.2",
93
- "eslint-formatter-compact": "^9.0.1",
94
- "eslint-import-resolver-typescript": "^4.4.4",
95
- "eslint-plugin-import": "^2.32.0",
96
- "eslint-plugin-react": "^7.37.5",
97
- "eslint-plugin-react-hooks": "^7.0.1",
98
- "eslint-plugin-regexp": "^2.10.0",
99
- "globals": "^16.1.0",
100
- "jest": "^29.2.1",
101
- "jest-expo": "~54.0.10",
102
- "react-test-renderer": "19.1.0",
103
- "tsx": "^4.21.0",
104
- "typescript": "^5.8.3",
105
- "typescript-eslint": "^8.32.1"
9
+ "preinstall": "npx only-allow pnpm"
106
10
  },
11
+ "dependencies": {},
12
+ "devDependencies": {},
107
13
  "packageManager": "pnpm@9.0.0",
108
14
  "engines": {
109
15
  "pnpm": ">=9.0.0"
@@ -111,6 +17,9 @@
111
17
  "pnpm": {
112
18
  "overrides": {
113
19
  "esbuild": "0.27.2"
20
+ },
21
+ "patchedDependencies": {
22
+ "expo@54.0.32": "patches/expo@54.0.32.patch"
114
23
  }
115
24
  }
116
25
  }
@@ -0,0 +1,44 @@
1
+ diff --git a/src/async-require/hmr.ts b/src/async-require/hmr.ts
2
+ index 33ce50ee2950c40d2b0553b148710f1e24e44f3d..a13d6f2da10dea858019cc991c21753f64f01fd0 100644
3
+ --- a/src/async-require/hmr.ts
4
+ +++ b/src/async-require/hmr.ts
5
+ @@ -216,6 +216,39 @@ const HMRClient: HMRClientNativeInterface = {
6
+
7
+ client.on('update-done', () => {
8
+ hideLoading();
9
+ + if (process.env.EXPO_PUBLIC_COZE_PROJECT_ID && typeof window !== 'undefined' && window.location) {
10
+ + if((window as any).__updateTimeoutId) {
11
+ + clearTimeout((window as any).__updateTimeoutId);
12
+ + }
13
+ + const updateDoneTime = Date.now();
14
+ + (window as any).__updateDoneTime = updateDoneTime;
15
+ + (window as any).__updateTimeoutId = setTimeout(() => {
16
+ + const lastUpdateTime = (window as any).__updateDoneTime;
17
+ + if (lastUpdateTime !== updateDoneTime) return;
18
+ + const checkServerAndReload = (retriesLeft: number) => {
19
+ + if ((window as any).__updateDoneTime !== updateDoneTime) return;
20
+ + fetch(`/favicon.ico?_t=${Date.now()}`)
21
+ + .then((response) => {
22
+ + if (response.status === 200) {
23
+ + console.warn('[HMR] Server is ready (200), reloading now.');
24
+ + window.location.reload();
25
+ + } else {
26
+ + throw new Error(`Server status: ${response.status}`);
27
+ + }
28
+ + }).catch((error) => {
29
+ + console.warn(`[HMR] Check failed (${error.message}). Retries left: ${retriesLeft}`);
30
+ + if (retriesLeft > 0) {
31
+ + setTimeout(() => {
32
+ + checkServerAndReload(retriesLeft - 1);
33
+ + }, 5000);
34
+ + } else {
35
+ + console.error('[HMR] Server unreachable after 6 attempts. Abort reload.');
36
+ + }
37
+ + });
38
+ + };
39
+ + checkServerAndReload(6);
40
+ + }, 35_000);
41
+ + }
42
+ });
43
+
44
+ client.on('error', (data: { type: string; message: string }) => {