@coze-arch/cli 0.0.1-alpha.a8e799 → 0.0.1-alpha.aea179

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 (42) 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 +62 -81
  4. package/lib/__templates__/expo/README.md +25 -16
  5. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  6. package/lib/__templates__/expo/client/app.config.ts +64 -60
  7. package/lib/__templates__/expo/client/assets/images/coze-logo.png +0 -0
  8. package/lib/__templates__/expo/client/constants/theme.ts +20 -16
  9. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +34 -1
  10. package/lib/__templates__/expo/client/package.json +3 -2
  11. package/lib/__templates__/expo/client/screens/home/index.tsx +8 -37
  12. package/lib/__templates__/expo/client/screens/home/styles.ts +16 -52
  13. package/lib/__templates__/expo/pnpm-lock.yaml +2125 -107
  14. package/lib/__templates__/expo/server/package.json +16 -2
  15. package/lib/__templates__/expo/server/src/index.ts +8 -2
  16. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  17. package/lib/__templates__/expo/template.config.js +1 -0
  18. package/lib/__templates__/nextjs/.coze +1 -0
  19. package/lib/__templates__/nextjs/_npmrc +1 -0
  20. package/lib/__templates__/nextjs/next.config.ts +12 -0
  21. package/lib/__templates__/nextjs/package.json +3 -2
  22. package/lib/__templates__/nextjs/pnpm-lock.yaml +13 -5
  23. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  24. package/lib/__templates__/nextjs/src/app/globals.css +10 -2
  25. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -12
  26. package/lib/__templates__/nextjs/src/app/page.tsx +33 -21
  27. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  28. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  29. package/lib/__templates__/nextjs/template.config.js +30 -0
  30. package/lib/__templates__/templates.json +61 -43
  31. package/lib/__templates__/vite/.coze +1 -0
  32. package/lib/__templates__/vite/_npmrc +1 -0
  33. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  34. package/lib/__templates__/vite/package.json +5 -1
  35. package/lib/__templates__/vite/pnpm-lock.yaml +3481 -14
  36. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  37. package/lib/__templates__/vite/template.config.js +28 -4
  38. package/lib/cli.js +189 -52
  39. package/package.json +5 -3
  40. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  41. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  42. /package/lib/__templates__/expo/client/app/{index.ts → home.tsx} +0 -0
@@ -2,23 +2,21 @@ import { Platform, StyleSheet } from "react-native";
2
2
 
3
3
  export const Colors = {
4
4
  light: {
5
- text: "#111827",
6
- textPrimary: "#111827",
5
+ textPrimary: "#1C1917",
7
6
  textSecondary: "#374151",
8
7
  textMuted: "#9CA3AF",
9
8
  textDisabled: "#D1D5DB",
10
9
  placeholder: "#9CA3AF",
11
- buttonText: "#FFFFFF",
12
10
  tabIconDefault: "#9CA3AF",
13
- tabIconSelected: "#111827",
14
- primary: "#111827",
11
+ tabIconSelected: "#1C1917",
12
+ primary: "#1C1917",
15
13
  accent: "#000000",
16
- link: "#111827",
14
+ link: "#1C1917",
17
15
  success: "#16A34A",
18
16
  warning: "#F59E0B",
19
17
  error: "#DC2626",
20
18
  info: "#2563EB",
21
- backgroundRoot: "#FFFFFF",
19
+ backgroundRoot: "#FAFAF9",
22
20
  backgroundDefault: "#F9FAFB",
23
21
  backgroundSecondary: "#F3F4F6",
24
22
  backgroundTertiary: "#E5E7EB",
@@ -27,25 +25,27 @@ export const Colors = {
27
25
  divider: "#F3F4F6",
28
26
  overlay: "rgba(0, 0, 0, 0.4)",
29
27
  chartBackground: "rgba(249, 250, 251, 0.5)",
28
+ buttonPrimaryBackground: "#1C1917",
29
+ buttonPrimaryText: "#FFFFFF",
30
+ buttonSecondaryBackground: "#F3F4F6",
31
+ buttonSecondaryText: "#1C1917",
30
32
  },
31
33
  dark: {
32
- text: "#ECEDEE",
33
- textPrimary: "#ECEDEE",
34
+ textPrimary: "#FAFAF9",
34
35
  textSecondary: "#9BA1A6",
35
36
  textMuted: "#6F767E",
36
37
  textDisabled: "#4A4D50",
37
38
  placeholder: "#6F767E",
38
- buttonText: "#FFFFFF",
39
39
  tabIconDefault: "#6F767E",
40
- tabIconSelected: "#ECEDEE",
41
- primary: "#ECEDEE",
40
+ tabIconSelected: "#FAFAF9",
41
+ primary: "#FAFAF9",
42
42
  accent: "#FFFFFF",
43
- link: "#ECEDEE",
43
+ link: "#FAFAF9",
44
44
  success: "#30D158",
45
45
  warning: "#FF9F0A",
46
46
  error: "#FF453A",
47
47
  info: "#64D2FF",
48
- backgroundRoot: "#000000",
48
+ backgroundRoot: "#1C1917",
49
49
  backgroundDefault: "#1C1C1E",
50
50
  backgroundSecondary: "#2C2C2E",
51
51
  backgroundTertiary: "#3A3A3C",
@@ -54,6 +54,10 @@ export const Colors = {
54
54
  divider: "#2C2C2E",
55
55
  overlay: "rgba(0, 0, 0, 0.6)",
56
56
  chartBackground: "rgba(28, 28, 30, 0.5)",
57
+ buttonPrimaryBackground: "#FAFAF9",
58
+ buttonPrimaryText: "#1C1917",
59
+ buttonSecondaryBackground: "#2C2C2E",
60
+ buttonSecondaryText: "#FAFAF9",
57
61
  },
58
62
  };
59
63
 
@@ -509,7 +513,7 @@ export const createThemedStyles = (theme: Theme) => {
509
513
  ...CommonStyles.scrollContent,
510
514
  },
511
515
  text: {
512
- color: theme.text,
516
+ color: theme.textPrimary,
513
517
  },
514
518
  textPrimary: {
515
519
  color: theme.textPrimary,
@@ -533,7 +537,7 @@ export const createThemedStyles = (theme: Theme) => {
533
537
  color: theme.info,
534
538
  },
535
539
  textButton: {
536
- color: theme.buttonText,
540
+ color: theme.buttonPrimaryText,
537
541
  },
538
542
  avatar: {
539
543
  ...CommonStyles.avatar,
@@ -1 +1,34 @@
1
- export { useColorScheme } from "react-native";
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
+ }
@@ -24,8 +24,6 @@
24
24
  "@react-native-picker/picker": "^2.11.0",
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
28
  "expo": "^54.0.7",
31
29
  "expo-auth-session": "^7.0.9",
@@ -40,6 +38,7 @@
40
38
  "expo-linear-gradient": "~15.0.6",
41
39
  "expo-linking": "~8.0.7",
42
40
  "expo-location": "~19.0.7",
41
+ "expo-image": "^3.0.11",
43
42
  "expo-router": "~6.0.0",
44
43
  "expo-splash-screen": "~31.0.8",
45
44
  "expo-status-bar": "~3.0.7",
@@ -65,6 +64,8 @@
65
64
  },
66
65
  "devDependencies": {
67
66
  "@babel/core": "^7.25.2",
67
+ "babel-plugin-module-resolver": "^5.0.2",
68
+ "babel-preset-expo": "^54.0.9",
68
69
  "@eslint/js": "^9.27.0",
69
70
  "@types/jest": "^29.5.12",
70
71
  "@types/react": "~19.1.0",
@@ -1,50 +1,21 @@
1
- import React, { useState, useCallback } from 'react';
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
- <ScrollView
39
- showsVerticalScrollIndicator={false}
40
- contentContainerStyle={{}}
41
- refreshControl={
42
- <RefreshControl refreshing={isRefreshing} onRefresh={handleRefresh} colors={['#2563EB']} />
43
- }
13
+ <View
14
+ style={styles.container}
44
15
  >
45
- <View style={[styles.header]}>
46
- </View>
47
- </ScrollView>
16
+ <Image style={styles.logo} source={require('@/assets/images/coze-logo.png')}></Image>
17
+ <Text style={{...styles.text, color: theme.textPrimary}}>即将完成开发,请稍后...</Text>
18
+ </View>
48
19
  </Screen>
49
20
  );
50
21
  }
@@ -1,60 +1,24 @@
1
- import { StyleSheet, Platform } from 'react-native';
1
+ import { StyleSheet } from 'react-native';
2
2
 
3
3
  export const styles = StyleSheet.create({
4
- loadingContainer: {
5
- flex: 1,
6
- justifyContent: 'center',
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
- header: {
26
- flexDirection: 'row',
27
- justifyContent: 'space-between',
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
- logoText: {
55
- fontSize: 18,
56
- fontWeight: '700',
57
- color: '#1E293B',
58
- letterSpacing: -0.5,
19
+ logo: {
20
+ width: 64,
21
+ height: 64,
22
+ marginBottom: 32,
59
23
  },
60
24
  });