@coze-arch/cli 0.0.1-alpha.f9be02 → 0.0.1-alpha.fc5c04
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/lib/__templates__/expo/.coze +1 -1
- package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +19 -82
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +78 -88
- package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +2 -2
- package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +2 -2
- package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +46 -0
- package/lib/__templates__/expo/README.md +68 -7
- package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
- package/lib/__templates__/expo/client/{src/app → app}/_layout.tsx +15 -12
- package/lib/__templates__/expo/client/app/index.tsx +1 -0
- package/lib/__templates__/expo/client/app.config.ts +65 -60
- package/lib/__templates__/expo/client/{src/components → components}/Screen.tsx +1 -17
- package/lib/__templates__/expo/client/{src/components → components}/ThemedView.tsx +1 -2
- package/lib/__templates__/expo/client/constants/theme.ts +177 -0
- package/lib/__templates__/expo/client/declarations.d.ts +5 -0
- package/lib/__templates__/expo/client/eslint.config.mjs +33 -10
- package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
- package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
- package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
- package/lib/__templates__/expo/client/metro.config.js +3 -0
- package/lib/__templates__/expo/client/package.json +36 -33
- package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
- package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
- package/lib/__templates__/expo/client/tsconfig.json +1 -1
- package/lib/__templates__/expo/client/{src/utils → utils}/index.ts +22 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
- package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
- package/lib/__templates__/expo/package.json +7 -98
- package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
- package/lib/__templates__/expo/pnpm-lock.yaml +1420 -2939
- package/lib/__templates__/expo/server/build.js +21 -0
- package/lib/__templates__/expo/server/package.json +21 -4
- package/lib/__templates__/expo/server/src/index.ts +10 -2
- package/lib/__templates__/expo/server/tsconfig.json +24 -0
- package/lib/__templates__/expo/template.config.js +57 -0
- package/lib/__templates__/native-static/.coze +11 -0
- package/lib/__templates__/native-static/index.html +33 -0
- package/lib/__templates__/native-static/styles/main.css +136 -0
- package/lib/__templates__/native-static/template.config.js +22 -0
- package/lib/__templates__/nextjs/.babelrc +15 -0
- package/lib/__templates__/nextjs/.coze +1 -0
- package/lib/__templates__/nextjs/_npmrc +1 -0
- package/lib/__templates__/nextjs/next.config.ts +12 -0
- package/lib/__templates__/nextjs/package.json +13 -2
- package/lib/__templates__/nextjs/pnpm-lock.yaml +2682 -1786
- package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
- package/lib/__templates__/nextjs/src/app/globals.css +10 -2
- package/lib/__templates__/nextjs/src/app/layout.tsx +5 -14
- package/lib/__templates__/nextjs/src/app/page.tsx +18 -48
- package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
- package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
- package/lib/__templates__/nextjs/template.config.js +67 -2
- package/lib/__templates__/taro/.coze +14 -0
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
- package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
- package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
- package/lib/__templates__/taro/README.md +751 -0
- package/lib/__templates__/taro/_gitignore +40 -0
- package/lib/__templates__/taro/_npmrc +18 -0
- package/lib/__templates__/taro/babel.config.js +12 -0
- package/lib/__templates__/taro/config/dev.ts +9 -0
- package/lib/__templates__/taro/config/index.ts +223 -0
- package/lib/__templates__/taro/config/prod.ts +34 -0
- package/lib/__templates__/taro/eslint.config.mjs +80 -0
- package/lib/__templates__/taro/key/private.appid.key +0 -0
- package/lib/__templates__/taro/package.json +107 -0
- package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
- package/lib/__templates__/taro/pnpm-lock.yaml +23100 -0
- package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
- package/lib/__templates__/taro/project.config.json +15 -0
- package/lib/__templates__/taro/server/nest-cli.json +10 -0
- package/lib/__templates__/taro/server/package.json +40 -0
- package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
- package/lib/__templates__/taro/server/src/app.module.ts +10 -0
- package/lib/__templates__/taro/server/src/app.service.ts +8 -0
- package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
- package/lib/__templates__/taro/server/src/main.ts +49 -0
- package/lib/__templates__/taro/server/tsconfig.json +24 -0
- package/lib/__templates__/taro/src/app.config.ts +11 -0
- package/lib/__templates__/taro/src/app.css +52 -0
- package/lib/__templates__/taro/src/app.tsx +9 -0
- package/lib/__templates__/taro/src/index.html +39 -0
- package/lib/__templates__/taro/src/network.ts +39 -0
- package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
- package/lib/__templates__/taro/src/pages/index/index.css +1 -0
- package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
- package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
- package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
- package/lib/__templates__/taro/src/presets/h5-navbar.tsx +201 -0
- package/lib/__templates__/taro/src/presets/h5-styles.ts +142 -0
- package/lib/__templates__/taro/src/presets/index.tsx +18 -0
- package/lib/__templates__/taro/stylelint.config.mjs +4 -0
- package/lib/__templates__/taro/template.config.js +68 -0
- package/lib/__templates__/taro/tsconfig.json +29 -0
- package/lib/__templates__/taro/types/global.d.ts +32 -0
- package/lib/__templates__/templates.json +135 -42
- package/lib/__templates__/vite/.coze +1 -0
- package/lib/__templates__/vite/_npmrc +1 -0
- package/lib/__templates__/vite/eslint.config.mjs +9 -0
- package/lib/__templates__/vite/package.json +14 -1
- package/lib/__templates__/vite/pnpm-lock.yaml +1581 -105
- package/lib/__templates__/vite/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite/src/main.ts +17 -48
- package/lib/__templates__/vite/template.config.js +67 -6
- package/lib/__templates__/vite/vite.config.ts +1 -0
- package/lib/__templates__/vite-vue/.coze +12 -0
- package/lib/__templates__/vite-vue/README.md +451 -0
- package/lib/__templates__/vite-vue/_gitignore +66 -0
- package/lib/__templates__/vite-vue/_npmrc +23 -0
- package/lib/__templates__/vite-vue/eslint.config.mjs +9 -0
- package/lib/__templates__/vite-vue/index.html +13 -0
- package/lib/__templates__/vite-vue/package.json +38 -0
- package/lib/__templates__/vite-vue/pnpm-lock.yaml +3132 -0
- package/lib/__templates__/vite-vue/postcss.config.mjs +6 -0
- package/lib/__templates__/vite-vue/scripts/build.sh +14 -0
- package/lib/__templates__/vite-vue/scripts/dev.sh +32 -0
- package/lib/__templates__/vite-vue/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite-vue/scripts/start.sh +15 -0
- package/lib/__templates__/vite-vue/src/App.vue +6 -0
- package/lib/__templates__/vite-vue/src/index.css +29 -0
- package/lib/__templates__/vite-vue/src/main.ts +8 -0
- package/lib/__templates__/vite-vue/src/router/index.ts +17 -0
- package/lib/__templates__/vite-vue/src/views/Home.vue +38 -0
- package/lib/__templates__/vite-vue/src/vite-env.d.ts +8 -0
- package/lib/__templates__/vite-vue/tailwind.config.js +9 -0
- package/lib/__templates__/vite-vue/template.config.js +127 -0
- package/lib/__templates__/vite-vue/tsconfig.json +17 -0
- package/lib/__templates__/vite-vue/vite.config.ts +28 -0
- package/lib/cli.js +1006 -154
- package/package.json +6 -3
- package/lib/__templates__/expo/client/src/app/index.ts +0 -1
- package/lib/__templates__/expo/client/src/constants/theme.ts +0 -850
- package/lib/__templates__/expo/client/src/hooks/useColorScheme.ts +0 -1
- package/lib/__templates__/expo/client/src/hooks/useTheme.ts +0 -13
- package/lib/__templates__/expo/client/src/screens/home/index.tsx +0 -50
- package/lib/__templates__/expo/client/src/screens/home/styles.ts +0 -60
- package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
- package/lib/__templates__/vite/.vscode/settings.json +0 -7
- /package/lib/__templates__/expo/client/{src/assets → assets}/fonts/SpaceMono-Regular.ttf +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/adaptive-icon.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/default-avatar.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/favicon.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/icon.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/partial-react-logo.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@2x.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@3x.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/splash-icon.png +0 -0
- /package/lib/__templates__/expo/client/{src/components → components}/SmartDateInput.tsx +0 -0
- /package/lib/__templates__/expo/client/{src/components → components}/ThemedText.tsx +0 -0
- /package/lib/__templates__/expo/client/{src/contexts → contexts}/AuthContext.tsx +0 -0
|
@@ -15,37 +15,38 @@
|
|
|
15
15
|
"preset": "jest-expo"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@expo/metro-runtime": "
|
|
19
|
-
"@expo/vector-icons": "^15.0.
|
|
20
|
-
"@react-native-async-storage/async-storage": "
|
|
21
|
-
"@react-native-community/datetimepicker": "
|
|
22
|
-
"@react-native-community/slider": "
|
|
23
|
-
"@react-native-masked-view/masked-view": "
|
|
24
|
-
"@react-native-picker/picker": "
|
|
18
|
+
"@expo/metro-runtime": "~6.1.2",
|
|
19
|
+
"@expo/vector-icons": "^15.0.3",
|
|
20
|
+
"@react-native-async-storage/async-storage": "2.2.0",
|
|
21
|
+
"@react-native-community/datetimepicker": "8.4.4",
|
|
22
|
+
"@react-native-community/slider": "5.0.1",
|
|
23
|
+
"@react-native-masked-view/masked-view": "0.3.2",
|
|
24
|
+
"@react-native-picker/picker": "2.11.1",
|
|
25
25
|
"@react-navigation/bottom-tabs": "^7.2.0",
|
|
26
26
|
"@react-navigation/native": "^7.0.14",
|
|
27
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
28
|
-
"babel-preset-expo": "^54.0.9",
|
|
29
27
|
"dayjs": "^1.11.19",
|
|
30
|
-
"expo": "
|
|
31
|
-
"expo-auth-session": "
|
|
32
|
-
"expo-av": "~16.0.
|
|
33
|
-
"expo-blur": "~15.0.
|
|
28
|
+
"expo": "54.0.33",
|
|
29
|
+
"expo-auth-session": "~7.0.10",
|
|
30
|
+
"expo-av": "~16.0.8",
|
|
31
|
+
"expo-blur": "~15.0.8",
|
|
34
32
|
"expo-camera": "~17.0.10",
|
|
35
|
-
"expo-constants": "~18.0.
|
|
36
|
-
"expo-crypto": "
|
|
37
|
-
"expo-
|
|
38
|
-
"expo-
|
|
39
|
-
"expo-
|
|
40
|
-
"expo-
|
|
41
|
-
"expo-
|
|
42
|
-
"expo-
|
|
43
|
-
"expo-
|
|
44
|
-
"expo-
|
|
45
|
-
"expo-
|
|
46
|
-
"expo-
|
|
33
|
+
"expo-constants": "~18.0.13",
|
|
34
|
+
"expo-crypto": "~15.0.8",
|
|
35
|
+
"expo-file-system": "~19.0.21",
|
|
36
|
+
"expo-font": "~14.0.11",
|
|
37
|
+
"expo-haptics": "~15.0.8",
|
|
38
|
+
"expo-image": "~3.0.11",
|
|
39
|
+
"expo-image-picker": "~17.0.10",
|
|
40
|
+
"expo-linear-gradient": "~15.0.8",
|
|
41
|
+
"expo-linking": "~8.0.11",
|
|
42
|
+
"expo-location": "~19.0.8",
|
|
43
|
+
"expo-router": "~6.0.23",
|
|
44
|
+
"expo-splash-screen": "~31.0.13",
|
|
45
|
+
"expo-status-bar": "~3.0.9",
|
|
46
|
+
"expo-symbols": "~1.0.8",
|
|
47
47
|
"expo-system-ui": "~6.0.9",
|
|
48
48
|
"expo-web-browser": "~15.0.10",
|
|
49
|
+
"js-base64": "^3.7.7",
|
|
49
50
|
"react": "19.1.0",
|
|
50
51
|
"react-dom": "19.1.0",
|
|
51
52
|
"react-native": "0.81.5",
|
|
@@ -53,13 +54,13 @@
|
|
|
53
54
|
"react-native-gesture-handler": "~2.28.0",
|
|
54
55
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
55
56
|
"react-native-modal-datetime-picker": "18.0.0",
|
|
56
|
-
"react-native-reanimated": "~4.1.
|
|
57
|
+
"react-native-reanimated": "~4.1.1",
|
|
57
58
|
"react-native-safe-area-context": "~5.6.0",
|
|
58
59
|
"react-native-screens": "~4.16.0",
|
|
59
|
-
"react-native-svg": "15.
|
|
60
|
+
"react-native-svg": "15.12.1",
|
|
60
61
|
"react-native-toast-message": "^2.3.3",
|
|
61
|
-
"react-native-web": "
|
|
62
|
-
"react-native-webview": "
|
|
62
|
+
"react-native-web": "~0.21.0",
|
|
63
|
+
"react-native-webview": "13.15.0",
|
|
63
64
|
"react-native-worklets": "0.5.1",
|
|
64
65
|
"zod": "^4.2.1"
|
|
65
66
|
},
|
|
@@ -69,7 +70,10 @@
|
|
|
69
70
|
"@types/jest": "^29.5.12",
|
|
70
71
|
"@types/react": "~19.1.0",
|
|
71
72
|
"@types/react-test-renderer": "19.1.0",
|
|
73
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
74
|
+
"babel-preset-expo": "^54.0.9",
|
|
72
75
|
"chalk": "^4.1.2",
|
|
76
|
+
"connect": "^3.7.0",
|
|
73
77
|
"depcheck": "^1.4.7",
|
|
74
78
|
"esbuild": "0.27.2",
|
|
75
79
|
"eslint": "^9.39.2",
|
|
@@ -80,13 +84,12 @@
|
|
|
80
84
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
81
85
|
"eslint-plugin-regexp": "^2.10.0",
|
|
82
86
|
"globals": "^16.1.0",
|
|
87
|
+
"http-proxy-middleware": "^3.0.5",
|
|
83
88
|
"jest": "^29.2.1",
|
|
84
|
-
"jest-expo": "~54.0.
|
|
89
|
+
"jest-expo": "~54.0.17",
|
|
85
90
|
"react-test-renderer": "19.1.0",
|
|
86
91
|
"tsx": "^4.21.0",
|
|
87
92
|
"typescript": "^5.8.3",
|
|
88
|
-
"typescript-eslint": "^8.32.1"
|
|
89
|
-
"connect": "^3.7.0",
|
|
90
|
-
"http-proxy-middleware": "^3.0.5"
|
|
93
|
+
"typescript-eslint": "^8.32.1"
|
|
91
94
|
}
|
|
92
95
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { View, Text } from 'react-native';
|
|
2
|
+
import { Image } from 'expo-image';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '@/hooks/useTheme';
|
|
5
|
+
import { Screen } from '@/components/Screen';
|
|
6
|
+
import { styles } from './styles';
|
|
7
|
+
|
|
8
|
+
export default function DemoPage() {
|
|
9
|
+
const { theme, isDark } = useTheme();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Screen backgroundColor={theme.backgroundRoot} statusBarStyle={isDark ? 'light' : 'dark'}>
|
|
13
|
+
<View
|
|
14
|
+
style={styles.container}
|
|
15
|
+
>
|
|
16
|
+
<Image
|
|
17
|
+
style={styles.logo}
|
|
18
|
+
source="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/icon/coze-coding.gif"
|
|
19
|
+
></Image>
|
|
20
|
+
<Text style={{...styles.title, color: theme.textPrimary}}>应用开发中</Text>
|
|
21
|
+
<Text style={{...styles.description, color: theme.textSecondary}}>请稍候,界面即将呈现</Text>
|
|
22
|
+
</View>
|
|
23
|
+
</Screen>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Spacing } from '@/constants/theme';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export const styles = StyleSheet.create({
|
|
5
|
+
container: {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
top: 0,
|
|
8
|
+
left: 0,
|
|
9
|
+
width: '100%',
|
|
10
|
+
height: '100%',
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
},
|
|
16
|
+
logo: {
|
|
17
|
+
width: 130,
|
|
18
|
+
height: 109,
|
|
19
|
+
},
|
|
20
|
+
title: {
|
|
21
|
+
fontSize: 16,
|
|
22
|
+
fontWeight: 'bold',
|
|
23
|
+
},
|
|
24
|
+
description: {
|
|
25
|
+
fontSize: 14,
|
|
26
|
+
marginTop: Spacing.sm,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
1
2
|
import dayjs from 'dayjs';
|
|
2
3
|
import utc from 'dayjs/plugin/utc';
|
|
3
4
|
dayjs.extend(utc);
|
|
4
5
|
|
|
5
6
|
const API_BASE = (process.env.EXPO_PUBLIC_API_BASE ?? '').replace(/\/$/, '');
|
|
6
7
|
|
|
8
|
+
/**
|
|
9
|
+
* 创建跨平台兼容的文件对象,用于 FormData.append()
|
|
10
|
+
* - Web 端返回 File 对象
|
|
11
|
+
* - 移动端返回 { uri, type, name } 对象(RN fetch 会自动处理)
|
|
12
|
+
* @param fileUri Expo 媒体库(如 expo-image-picker、expo-camera)返回的 uri
|
|
13
|
+
* @param fileName 上传时的文件名,如 'photo.jpg'
|
|
14
|
+
* @param mimeType 文件 MIME 类型,如 'image/jpeg'、'audio/mpeg'
|
|
15
|
+
*/
|
|
16
|
+
export async function createFormDataFile(
|
|
17
|
+
fileUri: string,
|
|
18
|
+
fileName: string,
|
|
19
|
+
mimeType: string
|
|
20
|
+
): Promise<File | { uri: string; type: string; name: string }> {
|
|
21
|
+
if (Platform.OS === 'web') {
|
|
22
|
+
const response = await fetch(fileUri);
|
|
23
|
+
const blob = await response.blob();
|
|
24
|
+
return new File([blob], fileName, { type: mimeType });
|
|
25
|
+
}
|
|
26
|
+
return { uri: fileUri, type: mimeType, name: fileName };
|
|
27
|
+
}
|
|
28
|
+
|
|
7
29
|
/**
|
|
8
30
|
* 构建文件或图片完整的URL
|
|
9
31
|
* @param url 相对或绝对路径
|