@coze-arch/cli 0.0.1-alpha.ecba20 → 0.0.1-alpha.f37dff
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 +62 -81
- package/lib/__templates__/expo/README.md +22 -14
- package/lib/__templates__/expo/client/app/index.tsx +1 -0
- package/lib/__templates__/expo/client/app.config.ts +64 -60
- package/lib/__templates__/expo/client/assets/images/coze-logo.png +0 -0
- package/lib/__templates__/expo/client/constants/theme.ts +12 -12
- package/lib/__templates__/expo/client/hooks/useColorScheme.ts +34 -1
- package/lib/__templates__/expo/client/package.json +1 -0
- package/lib/__templates__/expo/client/screens/home/index.tsx +8 -37
- package/lib/__templates__/expo/client/screens/home/styles.ts +16 -52
- package/lib/__templates__/expo/pnpm-lock.yaml +22 -0
- package/lib/__templates__/expo/server/package.json +1 -0
- package/lib/__templates__/expo/server/src/index.ts +8 -2
- package/lib/__templates__/expo/template.config.js +1 -0
- package/lib/__templates__/nextjs/.coze +1 -0
- package/lib/__templates__/nextjs/next.config.ts +9 -0
- package/lib/__templates__/nextjs/package.json +2 -4
- package/lib/__templates__/nextjs/pnpm-lock.yaml +0 -1020
- package/lib/__templates__/nextjs/scripts/dev.sh +1 -1
- package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
- package/lib/__templates__/nextjs/src/app/layout.tsx +0 -4
- package/lib/__templates__/nextjs/src/app/page.tsx +2 -3
- 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 +24 -0
- package/lib/__templates__/templates.json +61 -70
- package/lib/__templates__/vite/.coze +1 -0
- package/lib/__templates__/vite/eslint.config.mjs +9 -0
- package/lib/__templates__/vite/package.json +5 -2
- package/lib/__templates__/vite/pnpm-lock.yaml +841 -0
- package/lib/__templates__/vite/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite/template.config.js +4 -0
- package/lib/cli.js +1 -1
- package/package.json +1 -1
- package/lib/__templates__/nextjs/.babelrc +0 -15
- package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
- package/lib/__templates__/nextjs/server.mjs +0 -50
- package/lib/__templates__/vite/.vscode/settings.json +0 -7
- /package/lib/__templates__/expo/client/app/{index.ts → home.tsx} +0 -0
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { ColorSchemeName, useColorScheme as useReactNativeColorScheme, Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export function useColorScheme() {
|
|
5
|
+
const systemColorScheme = useReactNativeColorScheme();
|
|
6
|
+
const [colorScheme, setColorScheme] = useState<ColorSchemeName>(systemColorScheme);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setColorScheme(systemColorScheme);
|
|
10
|
+
}, [systemColorScheme])
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
function handleMessage(e: MessageEvent<{ event: string; colorScheme: ColorSchemeName; } | undefined>) {
|
|
14
|
+
if (e.data?.event === 'coze.workbench.colorScheme') {
|
|
15
|
+
const cs = e.data.colorScheme;
|
|
16
|
+
if (typeof cs === 'string') {
|
|
17
|
+
setColorScheme(cs);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (Platform.OS === 'web') {
|
|
23
|
+
window.addEventListener('message', handleMessage, false);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return () => {
|
|
27
|
+
if (Platform.OS === 'web') {
|
|
28
|
+
window.removeEventListener('message', handleMessage, false);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
33
|
+
return colorScheme;
|
|
34
|
+
}
|
|
@@ -1,50 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
ScrollView,
|
|
6
|
-
RefreshControl,
|
|
7
|
-
} from 'react-native';
|
|
8
|
-
import { useRouter, useFocusEffect } from 'expo-router';
|
|
9
|
-
import { FontAwesome6 } from '@expo/vector-icons';
|
|
10
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
11
|
-
import { useTheme } from "@/hooks/useTheme";
|
|
1
|
+
import { View, Text } from 'react-native';
|
|
2
|
+
import { Image } from 'expo-image';
|
|
12
3
|
|
|
4
|
+
import { useTheme } from '@/hooks/useTheme';
|
|
13
5
|
import { Screen } from '@/components/Screen';
|
|
14
|
-
|
|
15
6
|
import { styles } from './styles';
|
|
16
7
|
|
|
17
8
|
export default function HomeScreen() {
|
|
18
|
-
const insets = useSafeAreaInsets();
|
|
19
9
|
const { theme, isDark } = useTheme();
|
|
20
10
|
|
|
21
|
-
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
22
|
-
|
|
23
|
-
const loadData = useCallback(async () => {
|
|
24
|
-
}, []);
|
|
25
|
-
|
|
26
|
-
useFocusEffect(
|
|
27
|
-
useCallback(() => {
|
|
28
|
-
loadData();
|
|
29
|
-
}, [loadData])
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const handleRefresh = useCallback(() => {
|
|
33
|
-
setIsRefreshing(true);
|
|
34
|
-
loadData();
|
|
35
|
-
}, [loadData]);
|
|
36
11
|
return (
|
|
37
12
|
<Screen backgroundColor={theme.backgroundRoot} statusBarStyle={isDark ? 'light' : 'dark'}>
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
contentContainerStyle={{}}
|
|
41
|
-
refreshControl={
|
|
42
|
-
<RefreshControl refreshing={isRefreshing} onRefresh={handleRefresh} colors={['#2563EB']} />
|
|
43
|
-
}
|
|
13
|
+
<View
|
|
14
|
+
style={styles.container}
|
|
44
15
|
>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
</
|
|
16
|
+
<Image style={styles.logo} source={require('@/assets/images/coze-logo.png')}></Image>
|
|
17
|
+
<Text style={{...styles.text, color: theme.text}}>即将完成开发,请稍后...</Text>
|
|
18
|
+
</View>
|
|
48
19
|
</Screen>
|
|
49
20
|
);
|
|
50
21
|
}
|
|
@@ -1,60 +1,24 @@
|
|
|
1
|
-
import { StyleSheet
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
export const styles = StyleSheet.create({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
container: {
|
|
5
|
+
position: 'absolute',
|
|
6
|
+
top: 0,
|
|
7
|
+
left: 0,
|
|
8
|
+
width: '100%',
|
|
9
|
+
height: '100%',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
7
12
|
alignItems: 'center',
|
|
8
|
-
},
|
|
9
|
-
loadingText: {
|
|
10
|
-
marginTop: 12,
|
|
11
|
-
fontSize: 14,
|
|
12
|
-
color: '#64748B',
|
|
13
|
-
},
|
|
14
|
-
errorContainer: {
|
|
15
|
-
flex: 1,
|
|
16
13
|
justifyContent: 'center',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
paddingHorizontal: 24,
|
|
19
|
-
},
|
|
20
|
-
errorText: {
|
|
21
|
-
marginTop: 16,
|
|
22
|
-
fontSize: 16,
|
|
23
|
-
color: '#64748B',
|
|
24
14
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
alignItems: 'center',
|
|
29
|
-
paddingHorizontal: 16,
|
|
30
|
-
// paddingBottom: 16,
|
|
31
|
-
backgroundColor: '#FFFFFF',
|
|
32
|
-
// borderBottomWidth: 1,
|
|
33
|
-
borderBottomColor: '#E2E8F0',
|
|
34
|
-
},
|
|
35
|
-
logoContainer: {
|
|
36
|
-
width: 32,
|
|
37
|
-
height: 32,
|
|
38
|
-
backgroundColor: '#2563EB',
|
|
39
|
-
borderRadius: 8,
|
|
40
|
-
justifyContent: 'center',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
...Platform.select({
|
|
43
|
-
ios: {
|
|
44
|
-
shadowColor: '#000',
|
|
45
|
-
shadowOffset: { width: 0, height: 1 },
|
|
46
|
-
shadowOpacity: 0.1,
|
|
47
|
-
shadowRadius: 2,
|
|
48
|
-
},
|
|
49
|
-
android: {
|
|
50
|
-
elevation: 2,
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
15
|
+
text: {
|
|
16
|
+
fontSize: 14,
|
|
17
|
+
fontWeight: 'bold',
|
|
53
18
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
letterSpacing: -0.5,
|
|
19
|
+
logo: {
|
|
20
|
+
width: 64,
|
|
21
|
+
height: 64,
|
|
22
|
+
marginBottom: 32,
|
|
59
23
|
},
|
|
60
24
|
});
|
|
@@ -70,6 +70,9 @@ importers:
|
|
|
70
70
|
expo-haptics:
|
|
71
71
|
specifier: ~15.0.6
|
|
72
72
|
version: 15.0.8(expo@54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))
|
|
73
|
+
expo-image:
|
|
74
|
+
specifier: ^3.0.11
|
|
75
|
+
version: 3.0.11(expo@54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native-web@0.21.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
|
73
76
|
expo-image-picker:
|
|
74
77
|
specifier: ~17.0.7
|
|
75
78
|
version: 17.0.10(expo@54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))
|
|
@@ -3528,6 +3531,17 @@ packages:
|
|
|
3528
3531
|
peerDependencies:
|
|
3529
3532
|
expo: '*'
|
|
3530
3533
|
|
|
3534
|
+
expo-image@3.0.11:
|
|
3535
|
+
resolution: {integrity: sha512-4TudfUCLgYgENv+f48omnU8tjS2S0Pd9EaON5/s1ZUBRwZ7K8acEr4NfvLPSaeXvxW24iLAiyQ7sV7BXQH3RoA==}
|
|
3536
|
+
peerDependencies:
|
|
3537
|
+
expo: '*'
|
|
3538
|
+
react: '*'
|
|
3539
|
+
react-native: '*'
|
|
3540
|
+
react-native-web: '*'
|
|
3541
|
+
peerDependenciesMeta:
|
|
3542
|
+
react-native-web:
|
|
3543
|
+
optional: true
|
|
3544
|
+
|
|
3531
3545
|
expo-keep-awake@15.0.8:
|
|
3532
3546
|
resolution: {integrity: sha512-YK9M1VrnoH1vLJiQzChZgzDvVimVoriibiDIFLbQMpjYBnvyfUeHJcin/Gx1a+XgupNXy92EQJLgI/9ZuXajYQ==}
|
|
3533
3547
|
peerDependencies:
|
|
@@ -10656,6 +10670,14 @@ snapshots:
|
|
|
10656
10670
|
expo: 54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
|
10657
10671
|
expo-image-loader: 6.0.0(expo@54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))
|
|
10658
10672
|
|
|
10673
|
+
expo-image@3.0.11(expo@54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native-web@0.21.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0):
|
|
10674
|
+
dependencies:
|
|
10675
|
+
expo: 54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
|
10676
|
+
react: 19.1.0
|
|
10677
|
+
react-native: 0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0)
|
|
10678
|
+
optionalDependencies:
|
|
10679
|
+
react-native-web: 0.21.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
|
|
10680
|
+
|
|
10659
10681
|
expo-keep-awake@15.0.8(expo@54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react@19.1.0):
|
|
10660
10682
|
dependencies:
|
|
10661
10683
|
expo: 54.0.30(@babel/core@7.28.5)(@expo/metro-runtime@6.1.2)(expo-router@6.0.21)(react-native-webview@13.15.0(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0))(react-native@0.81.5(@babel/core@7.28.5)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import express from "express";
|
|
2
|
+
import cors from "cors";
|
|
2
3
|
|
|
3
4
|
const app = express();
|
|
4
5
|
const port = process.env.PORT || 9091;
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
// Middleware
|
|
8
|
+
app.use(cors());
|
|
9
|
+
app.use(express.json());
|
|
10
|
+
|
|
11
|
+
app.get('/api/v1/health', (req, res) => {
|
|
12
|
+
res.status(200).json({ status: 'ok' });
|
|
8
13
|
});
|
|
9
14
|
|
|
15
|
+
|
|
10
16
|
app.listen(port, () => {
|
|
11
17
|
console.log(`Server listening at http://localhost:${port}/`);
|
|
12
18
|
});
|
|
@@ -3,6 +3,15 @@ import type { NextConfig } from 'next';
|
|
|
3
3
|
const nextConfig: NextConfig = {
|
|
4
4
|
/* config options here */
|
|
5
5
|
allowedDevOrigins: ['*.dev.coze.site'],
|
|
6
|
+
images: {
|
|
7
|
+
remotePatterns: [
|
|
8
|
+
{
|
|
9
|
+
protocol: 'https',
|
|
10
|
+
hostname: 'lf3-static.bytednsdoc.com',
|
|
11
|
+
pathname: '/**',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
6
15
|
};
|
|
7
16
|
|
|
8
17
|
export default nextConfig;
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"dev": "bash ./scripts/dev.sh",
|
|
8
8
|
"preinstall": "npx only-allow pnpm",
|
|
9
9
|
"lint": "eslint",
|
|
10
|
-
"start": "bash ./scripts/start.sh"
|
|
10
|
+
"start": "bash ./scripts/start.sh",
|
|
11
|
+
"ts-check": "tsc -p tsconfig.json"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@aws-sdk/client-s3": "^3.958.0",
|
|
@@ -66,8 +67,6 @@
|
|
|
66
67
|
"zod": "^4.3.5"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@react-dev-inspector/babel-plugin": "^2.0.1",
|
|
70
|
-
"@react-dev-inspector/middleware": "^2.0.1",
|
|
71
70
|
"@tailwindcss/postcss": "^4",
|
|
72
71
|
"@types/node": "^20",
|
|
73
72
|
"@types/pg": "^8.16.0",
|
|
@@ -76,7 +75,6 @@
|
|
|
76
75
|
"eslint": "^9",
|
|
77
76
|
"eslint-config-next": "16.1.1",
|
|
78
77
|
"only-allow": "^1.2.2",
|
|
79
|
-
"react-dev-inspector": "^2.0.1",
|
|
80
78
|
"shadcn": "latest",
|
|
81
79
|
"tailwindcss": "^4",
|
|
82
80
|
"typescript": "^5"
|