@coze-arch/cli 0.0.1-alpha.14a431 → 0.0.1-alpha.179868
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 +7 -2
- package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +220 -0
- package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
- package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +34 -0
- package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +45 -0
- package/lib/__templates__/expo/README.md +68 -7
- package/lib/__templates__/expo/_gitignore +1 -1
- package/lib/__templates__/expo/_npmrc +2 -4
- package/lib/__templates__/expo/client/app/+not-found.tsx +15 -64
- package/lib/__templates__/expo/client/app/_layout.tsx +15 -12
- package/lib/__templates__/expo/client/app/index.tsx +1 -0
- package/lib/__templates__/expo/client/app.config.ts +76 -0
- package/lib/__templates__/expo/client/components/Screen.tsx +1 -17
- package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
- package/lib/__templates__/expo/client/components/ThemedView.tsx +37 -0
- package/lib/__templates__/expo/client/constants/theme.ts +117 -58
- package/lib/__templates__/expo/client/declarations.d.ts +5 -0
- package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +17 -10
- package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
- package/lib/__templates__/expo/client/hooks/useTheme.ts +26 -6
- package/lib/__templates__/expo/client/metro.config.js +121 -0
- package/lib/__templates__/expo/client/package.json +93 -0
- 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 +24 -0
- package/lib/__templates__/expo/client/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/reanimated/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
- package/lib/__templates__/expo/package.json +13 -103
- package/lib/__templates__/expo/pnpm-lock.yaml +451 -867
- package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
- package/lib/__templates__/expo/server/build.js +21 -0
- package/lib/__templates__/expo/server/package.json +32 -0
- package/lib/__templates__/expo/server/src/index.ts +19 -0
- package/lib/__templates__/expo/server/tsconfig.json +24 -0
- package/lib/__templates__/expo/template.config.js +1 -0
- package/lib/__templates__/expo/tsconfig.json +1 -24
- 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 +11 -2
- package/lib/__templates__/nextjs/pnpm-lock.yaml +2486 -1707
- package/lib/__templates__/nextjs/scripts/dev.sh +7 -26
- package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
- package/lib/__templates__/nextjs/src/app/globals.css +109 -89
- package/lib/__templates__/nextjs/src/app/layout.tsx +5 -14
- package/lib/__templates__/nextjs/src/app/page.tsx +35 -23
- 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 +30 -0
- package/lib/__templates__/templates.json +61 -43
- 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 +11 -2
- package/lib/__templates__/vite/pnpm-lock.yaml +3232 -243
- package/lib/__templates__/vite/scripts/dev.sh +7 -26
- package/lib/__templates__/vite/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite/src/main.ts +1 -2
- package/lib/__templates__/vite/template.config.js +30 -4
- package/lib/__templates__/vite/vite.config.ts +3 -3
- package/lib/cli.js +691 -130
- package/package.json +8 -3
- package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -116
- package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -239
- package/lib/__templates__/expo/app.json +0 -63
- package/lib/__templates__/expo/babel.config.js +0 -9
- package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
- package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
- package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
- package/lib/__templates__/expo/client/hooks/useColorScheme.ts +0 -1
- package/lib/__templates__/expo/client/index.js +0 -12
- package/lib/__templates__/expo/client/screens/home/index.tsx +0 -51
- package/lib/__templates__/expo/client/screens/home/styles.ts +0 -60
- package/lib/__templates__/expo/metro.config.js +0 -53
- package/lib/__templates__/expo/src/index.ts +0 -12
- package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
- package/lib/__templates__/vite/.vscode/settings.json +0 -7
- /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "expo-app",
|
|
3
|
+
"description": "<%= appName %>",
|
|
4
|
+
"main": "expo-router/entry",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"check-deps": "npx depcheck",
|
|
8
|
+
"postinstall": "npm run install-missing",
|
|
9
|
+
"install-missing": "node ./scripts/install-missing-deps.js",
|
|
10
|
+
"lint": "expo lint",
|
|
11
|
+
"start": "expo start --web --clear",
|
|
12
|
+
"test": "jest --watchAll"
|
|
13
|
+
},
|
|
14
|
+
"jest": {
|
|
15
|
+
"preset": "jest-expo"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@expo/metro-runtime": "^6.1.2",
|
|
19
|
+
"@expo/vector-icons": "^15.0.0",
|
|
20
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
21
|
+
"@react-native-community/datetimepicker": "^8.5.0",
|
|
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.0",
|
|
25
|
+
"@react-navigation/bottom-tabs": "^7.2.0",
|
|
26
|
+
"@react-navigation/native": "^7.0.14",
|
|
27
|
+
"dayjs": "^1.11.19",
|
|
28
|
+
"expo": "^54.0.7",
|
|
29
|
+
"expo-auth-session": "^7.0.9",
|
|
30
|
+
"expo-av": "~16.0.6",
|
|
31
|
+
"expo-blur": "~15.0.6",
|
|
32
|
+
"expo-camera": "~17.0.10",
|
|
33
|
+
"expo-constants": "~18.0.8",
|
|
34
|
+
"expo-crypto": "^15.0.7",
|
|
35
|
+
"expo-font": "~14.0.7",
|
|
36
|
+
"expo-haptics": "~15.0.6",
|
|
37
|
+
"expo-image-picker": "~17.0.7",
|
|
38
|
+
"expo-linear-gradient": "~15.0.6",
|
|
39
|
+
"expo-linking": "~8.0.7",
|
|
40
|
+
"expo-location": "~19.0.7",
|
|
41
|
+
"expo-image": "^3.0.11",
|
|
42
|
+
"expo-router": "~6.0.0",
|
|
43
|
+
"expo-splash-screen": "~31.0.8",
|
|
44
|
+
"expo-status-bar": "~3.0.7",
|
|
45
|
+
"expo-symbols": "~1.0.6",
|
|
46
|
+
"expo-system-ui": "~6.0.9",
|
|
47
|
+
"expo-web-browser": "~15.0.10",
|
|
48
|
+
"react": "19.1.0",
|
|
49
|
+
"react-dom": "19.1.0",
|
|
50
|
+
"react-native": "0.81.5",
|
|
51
|
+
"react-native-chart-kit": "^6.12.0",
|
|
52
|
+
"react-native-gesture-handler": "~2.28.0",
|
|
53
|
+
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
54
|
+
"react-native-modal-datetime-picker": "18.0.0",
|
|
55
|
+
"react-native-reanimated": "~4.1.0",
|
|
56
|
+
"react-native-safe-area-context": "~5.6.0",
|
|
57
|
+
"react-native-screens": "~4.16.0",
|
|
58
|
+
"react-native-svg": "15.15.0",
|
|
59
|
+
"react-native-toast-message": "^2.3.3",
|
|
60
|
+
"react-native-web": "^0.21.2",
|
|
61
|
+
"react-native-webview": "~13.15.0",
|
|
62
|
+
"react-native-worklets": "0.5.1",
|
|
63
|
+
"zod": "^4.2.1"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@babel/core": "^7.25.2",
|
|
67
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
68
|
+
"babel-preset-expo": "^54.0.9",
|
|
69
|
+
"@eslint/js": "^9.27.0",
|
|
70
|
+
"@types/jest": "^29.5.12",
|
|
71
|
+
"@types/react": "~19.1.0",
|
|
72
|
+
"@types/react-test-renderer": "19.1.0",
|
|
73
|
+
"chalk": "^4.1.2",
|
|
74
|
+
"depcheck": "^1.4.7",
|
|
75
|
+
"esbuild": "0.27.2",
|
|
76
|
+
"eslint": "^9.39.2",
|
|
77
|
+
"eslint-formatter-compact": "^9.0.1",
|
|
78
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
79
|
+
"eslint-plugin-import": "^2.32.0",
|
|
80
|
+
"eslint-plugin-react": "^7.37.5",
|
|
81
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
82
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
83
|
+
"globals": "^16.1.0",
|
|
84
|
+
"jest": "^29.2.1",
|
|
85
|
+
"jest-expo": "~54.0.10",
|
|
86
|
+
"react-test-renderer": "19.1.0",
|
|
87
|
+
"tsx": "^4.21.0",
|
|
88
|
+
"typescript": "^5.8.3",
|
|
89
|
+
"typescript-eslint": "^8.32.1",
|
|
90
|
+
"connect": "^3.7.0",
|
|
91
|
+
"http-proxy-middleware": "^3.0.5"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -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/expo/coze-loading.gif"
|
|
19
|
+
></Image>
|
|
20
|
+
<Text style={{...styles.title, color: theme.textPrimary}}>APP 开发中</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
|
+
});
|
|
@@ -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,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 相对或绝对路径
|