@coze-arch/cli 0.0.1-alpha.f37dff → 0.0.1-alpha.f626fa
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/.cozeproj/scripts/dev_run.sh +10 -10
- 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 +45 -0
- package/lib/__templates__/expo/client/app/_layout.tsx +14 -14
- package/lib/__templates__/expo/client/app/index.tsx +1 -1
- package/lib/__templates__/expo/client/app.config.ts +4 -3
- package/lib/__templates__/expo/client/constants/theme.ts +14 -10
- package/lib/__templates__/expo/client/declarations.d.ts +5 -0
- package/lib/__templates__/expo/client/screens/{home → demo}/index.tsx +7 -3
- package/lib/__templates__/expo/client/screens/{home → demo}/styles.ts +10 -6
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
- package/lib/__templates__/expo/client/utils/index.ts +22 -0
- package/lib/__templates__/expo/pnpm-lock.yaml +35 -5
- package/lib/__templates__/expo/server/build.js +21 -0
- package/lib/__templates__/expo/server/package.json +4 -3
- package/lib/__templates__/nextjs/_npmrc +1 -0
- package/lib/__templates__/nextjs/next.config.ts +3 -1
- package/lib/__templates__/nextjs/package.json +1 -1
- package/lib/__templates__/nextjs/pnpm-lock.yaml +13 -5
- package/lib/__templates__/nextjs/src/app/globals.css +10 -2
- package/lib/__templates__/nextjs/src/app/layout.tsx +1 -12
- package/lib/__templates__/nextjs/src/app/page.tsx +33 -20
- package/lib/__templates__/nextjs/template.config.js +9 -3
- package/lib/__templates__/vite/_npmrc +1 -0
- package/lib/__templates__/vite/package.json +2 -1
- package/lib/__templates__/vite/pnpm-lock.yaml +2628 -2
- package/lib/__templates__/vite/src/main.ts +1 -2
- package/lib/__templates__/vite/template.config.js +24 -4
- package/lib/cli.js +58 -27
- package/package.json +1 -1
- package/lib/__templates__/expo/client/app/home.tsx +0 -1
- package/lib/__templates__/expo/client/assets/images/coze-logo.png +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
1
|
+
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
2
2
|
PREVIEW_DIR="${COZE_PREVIEW_DIR:-/source/preview}"
|
|
3
3
|
LOG_DIR="${COZE_LOG_DIR:-$ROOT_DIR/logs}"
|
|
4
4
|
LOG_FILE="$LOG_DIR/app.log"
|
|
@@ -111,14 +111,14 @@ wait_port_connectable() {
|
|
|
111
111
|
start_expo() {
|
|
112
112
|
local offline="${1:-0}"
|
|
113
113
|
|
|
114
|
-
pushd
|
|
114
|
+
pushd "$ROOT_DIR/client"
|
|
115
115
|
|
|
116
116
|
if [ "$offline" = "1" ]; then
|
|
117
117
|
( EXPO_OFFLINE=1 EXPO_NO_DOCTOR=1 EXPO_PUBLIC_BACKEND_BASE_URL="$EXPO_PUBLIC_BACKEND_BASE_URL" EXPO_PACKAGER_PROXY_URL="$EXPO_PACKAGER_PROXY_URL" \
|
|
118
|
-
nohup npx expo start --clear --port "$EXPO_PORT" 2>&1 | pipe_to_log "CLIENT" "
|
|
118
|
+
nohup npx expo start --clear --port "$EXPO_PORT" 2>&1 | pipe_to_log "CLIENT" "$ROOT_DIR/logs/client.log" ) &
|
|
119
119
|
else
|
|
120
120
|
( EXPO_NO_DOCTOR=1 EXPO_PUBLIC_BACKEND_BASE_URL="$EXPO_PUBLIC_BACKEND_BASE_URL" EXPO_PACKAGER_PROXY_URL="$EXPO_PACKAGER_PROXY_URL" \
|
|
121
|
-
nohup npx expo start --clear --port "$EXPO_PORT" 2>&1 | pipe_to_log "CLIENT" "
|
|
121
|
+
nohup npx expo start --clear --port "$EXPO_PORT" 2>&1 | pipe_to_log "CLIENT" "$ROOT_DIR/logs/client.log" ) &
|
|
122
122
|
fi
|
|
123
123
|
EXPO_PID=$!
|
|
124
124
|
disown $EXPO_PID 2>/dev/null || true
|
|
@@ -129,7 +129,7 @@ start_expo() {
|
|
|
129
129
|
detect_expo_fetch_failed() {
|
|
130
130
|
local timeout="${1:-8}"
|
|
131
131
|
local waited=0
|
|
132
|
-
local log_file="logs/client.log"
|
|
132
|
+
local log_file="$ROOT_DIR/logs/client.log"
|
|
133
133
|
while [ "$waited" -lt "$timeout" ]; do
|
|
134
134
|
if [ -f "$log_file" ] && grep -q "TypeError: fetch failed" "$log_file" 2>/dev/null; then
|
|
135
135
|
return 0
|
|
@@ -159,15 +159,15 @@ check_command "pnpm"
|
|
|
159
159
|
check_command "lsof"
|
|
160
160
|
check_command "bash"
|
|
161
161
|
|
|
162
|
-
echo "
|
|
163
|
-
mkdir -p logs
|
|
162
|
+
echo "准备日志目录:$ROOT_DIR/logs"
|
|
163
|
+
mkdir -p "$ROOT_DIR/logs"
|
|
164
164
|
# 端口占用预检查与处理
|
|
165
165
|
ensure_port SERVER_PORT "$SERVER_PORT"
|
|
166
166
|
ensure_port EXPO_PORT "$EXPO_PORT"
|
|
167
167
|
|
|
168
168
|
echo "==================== 启动 server 服务 ===================="
|
|
169
|
-
echo "正在执行:
|
|
170
|
-
(
|
|
169
|
+
echo "正在执行:pnpm run dev (server)"
|
|
170
|
+
( pushd "$ROOT_DIR/server" > /dev/null && SERVER_PORT="$SERVER_PORT" nohup pnpm run dev; popd > /dev/null ) &
|
|
171
171
|
SERVER_PID=$!
|
|
172
172
|
disown $SERVER_PID 2>/dev/null || true
|
|
173
173
|
if [ -z "${SERVER_PID}" ]; then
|
|
@@ -181,7 +181,7 @@ start_expo 0
|
|
|
181
181
|
if detect_expo_fetch_failed 8; then
|
|
182
182
|
echo "Expo 启动检测到网络错误:TypeError: fetch failed,启用离线模式重试"
|
|
183
183
|
if [ -n "${EXPO_PID}" ]; then kill -9 "$EXPO_PID" 2>/dev/null || true; fi
|
|
184
|
-
: > logs/client.log
|
|
184
|
+
: > "$ROOT_DIR/logs/client.log"
|
|
185
185
|
start_expo 1
|
|
186
186
|
fi
|
|
187
187
|
# 输出以下环境变量,确保 Expo 项目能正确连接到 Server 服务
|
|
@@ -40,8 +40,8 @@ fi
|
|
|
40
40
|
info "==================== 依赖安装完成!====================\n"
|
|
41
41
|
|
|
42
42
|
info "==================== dist打包 ===================="
|
|
43
|
-
info "开始执行:
|
|
44
|
-
(
|
|
43
|
+
info "开始执行:pnpm run build (server)"
|
|
44
|
+
(pushd "$ROOT_DIR/server" > /dev/null && pnpm run build; popd > /dev/null) || error "dist打包失败"
|
|
45
45
|
info "==================== dist打包完成!====================\n"
|
|
46
46
|
|
|
47
47
|
info "下一步:执行 ./prod_run.sh 启动服务"
|
|
@@ -29,6 +29,6 @@ check_command() {
|
|
|
29
29
|
check_command "pnpm"
|
|
30
30
|
check_command "npm"
|
|
31
31
|
|
|
32
|
-
info "开始执行:
|
|
33
|
-
(
|
|
32
|
+
info "开始执行:pnpm run start (server)"
|
|
33
|
+
(pushd "$ROOT_DIR/server" > /dev/null && PORT="$PORT" pnpm run start; popd > /dev/null) || error "服务启动失败"
|
|
34
34
|
info "服务启动完成!\n"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
4
|
+
SERVER_DIR="$ROOT_DIR/server"
|
|
5
|
+
LOG_DIR="$ROOT_DIR/logs"
|
|
6
|
+
LOG_FILE="$LOG_DIR/server.log"
|
|
7
|
+
SERVER_PORT="${SERVER_PORT:-9091}"
|
|
8
|
+
|
|
9
|
+
mkdir -p "$LOG_DIR"
|
|
10
|
+
|
|
11
|
+
pipe_to_log() {
|
|
12
|
+
local source="${1:-SERVER}"
|
|
13
|
+
local raw_log="${2:-}"
|
|
14
|
+
local line
|
|
15
|
+
while IFS= read -r line || [ -n "$line" ]; do
|
|
16
|
+
if [ -n "$raw_log" ]; then
|
|
17
|
+
echo "$line" >> "$raw_log"
|
|
18
|
+
fi
|
|
19
|
+
line=$(echo "[$source] $line" | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g; s/\x1b\[[0-9;]*m//g')
|
|
20
|
+
echo "$line"
|
|
21
|
+
done
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
kill_old_server() {
|
|
25
|
+
if command -v lsof &> /dev/null; then
|
|
26
|
+
local pids
|
|
27
|
+
pids=$(lsof -t -i tcp:"$SERVER_PORT" -sTCP:LISTEN 2>/dev/null || true)
|
|
28
|
+
if [ -n "$pids" ]; then
|
|
29
|
+
echo "正在关闭旧的 server 进程:$pids"
|
|
30
|
+
kill -9 $pids 2>/dev/null || echo "关闭进程失败:$pids"
|
|
31
|
+
sleep 1
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
echo "==================== Server Dev Run ===================="
|
|
37
|
+
echo "Server 目录:$SERVER_DIR"
|
|
38
|
+
echo "Server 端口:$SERVER_PORT"
|
|
39
|
+
echo "日志文件:$LOG_FILE"
|
|
40
|
+
|
|
41
|
+
kill_old_server
|
|
42
|
+
|
|
43
|
+
echo "启动 server 服务..."
|
|
44
|
+
cd "$SERVER_DIR"
|
|
45
|
+
NODE_ENV=development PORT="$SERVER_PORT" npx tsx ./src/index.ts 2>&1 | pipe_to_log "SERVER" "$LOG_FILE"
|
|
@@ -14,20 +14,20 @@ LogBox.ignoreLogs([
|
|
|
14
14
|
export default function RootLayout() {
|
|
15
15
|
return (
|
|
16
16
|
<AuthProvider>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
18
|
+
<StatusBar style="dark"></StatusBar>
|
|
19
|
+
<Stack screenOptions={{
|
|
20
|
+
// 设置所有页面的切换动画为从右侧滑入,适用于iOS 和 Android
|
|
21
|
+
animation: 'slide_from_right',
|
|
22
|
+
gestureEnabled: true,
|
|
23
|
+
gestureDirection: 'horizontal',
|
|
24
|
+
// 隐藏自带的头部
|
|
25
|
+
headerShown: false
|
|
26
|
+
}}>
|
|
27
|
+
<Stack.Screen name="index" options={{ title: "" }} />
|
|
28
|
+
</Stack>
|
|
29
|
+
<Toast />
|
|
30
|
+
</GestureHandlerRootView>
|
|
31
31
|
</AuthProvider>
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from '@/screens/demo';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ExpoConfig, ConfigContext } from 'expo/config';
|
|
2
2
|
|
|
3
|
-
const appName =
|
|
4
|
-
const
|
|
3
|
+
const appName = process.env.EXPO_PUBLIC_COZE_PROJECT_NAME || '应用';
|
|
4
|
+
const projectId = process.env.EXPO_PUBLIC_COZE_PROJECT_ID;
|
|
5
|
+
const slugAppName = projectId ? `app${projectId}` : 'myapp';
|
|
5
6
|
|
|
6
7
|
export default ({ config }: ConfigContext): ExpoConfig => {
|
|
7
8
|
return {
|
|
@@ -22,7 +23,7 @@ export default ({ config }: ConfigContext): ExpoConfig => {
|
|
|
22
23
|
"foregroundImage": "./assets/images/adaptive-icon.png",
|
|
23
24
|
"backgroundColor": "#ffffff"
|
|
24
25
|
},
|
|
25
|
-
"package":
|
|
26
|
+
"package": `com.anonymous.x${projectId || '0'}`
|
|
26
27
|
},
|
|
27
28
|
"web": {
|
|
28
29
|
"bundler": "metro",
|
|
@@ -2,13 +2,11 @@ import { Platform, StyleSheet } from "react-native";
|
|
|
2
2
|
|
|
3
3
|
export const Colors = {
|
|
4
4
|
light: {
|
|
5
|
-
text: "#1C1917",
|
|
6
5
|
textPrimary: "#1C1917",
|
|
7
|
-
textSecondary: "#
|
|
6
|
+
textSecondary: "#78716c",
|
|
8
7
|
textMuted: "#9CA3AF",
|
|
9
8
|
textDisabled: "#D1D5DB",
|
|
10
9
|
placeholder: "#9CA3AF",
|
|
11
|
-
buttonText: "#FFFFFF",
|
|
12
10
|
tabIconDefault: "#9CA3AF",
|
|
13
11
|
tabIconSelected: "#1C1917",
|
|
14
12
|
primary: "#1C1917",
|
|
@@ -18,7 +16,7 @@ export const Colors = {
|
|
|
18
16
|
warning: "#F59E0B",
|
|
19
17
|
error: "#DC2626",
|
|
20
18
|
info: "#2563EB",
|
|
21
|
-
backgroundRoot: "#
|
|
19
|
+
backgroundRoot: "#FFF",
|
|
22
20
|
backgroundDefault: "#F9FAFB",
|
|
23
21
|
backgroundSecondary: "#F3F4F6",
|
|
24
22
|
backgroundTertiary: "#E5E7EB",
|
|
@@ -27,15 +25,17 @@ 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: "#FAFAF9",
|
|
33
34
|
textPrimary: "#FAFAF9",
|
|
34
|
-
textSecondary: "#
|
|
35
|
+
textSecondary: "#A8A29E",
|
|
35
36
|
textMuted: "#6F767E",
|
|
36
37
|
textDisabled: "#4A4D50",
|
|
37
38
|
placeholder: "#6F767E",
|
|
38
|
-
buttonText: "#FFFFFF",
|
|
39
39
|
tabIconDefault: "#6F767E",
|
|
40
40
|
tabIconSelected: "#FAFAF9",
|
|
41
41
|
primary: "#FAFAF9",
|
|
@@ -45,7 +45,7 @@ export const Colors = {
|
|
|
45
45
|
warning: "#FF9F0A",
|
|
46
46
|
error: "#FF453A",
|
|
47
47
|
info: "#64D2FF",
|
|
48
|
-
backgroundRoot: "#
|
|
48
|
+
backgroundRoot: "#0C0A09",
|
|
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: "#0C0A09",
|
|
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.
|
|
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.
|
|
540
|
+
color: theme.buttonPrimaryText,
|
|
537
541
|
},
|
|
538
542
|
avatar: {
|
|
539
543
|
...CommonStyles.avatar,
|
|
@@ -5,7 +5,7 @@ import { useTheme } from '@/hooks/useTheme';
|
|
|
5
5
|
import { Screen } from '@/components/Screen';
|
|
6
6
|
import { styles } from './styles';
|
|
7
7
|
|
|
8
|
-
export default function
|
|
8
|
+
export default function DemoPage() {
|
|
9
9
|
const { theme, isDark } = useTheme();
|
|
10
10
|
|
|
11
11
|
return (
|
|
@@ -13,8 +13,12 @@ export default function HomeScreen() {
|
|
|
13
13
|
<View
|
|
14
14
|
style={styles.container}
|
|
15
15
|
>
|
|
16
|
-
<Image
|
|
17
|
-
|
|
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>
|
|
18
22
|
</View>
|
|
19
23
|
</Screen>
|
|
20
24
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Spacing } from '@/constants/theme';
|
|
1
2
|
import { StyleSheet } from 'react-native';
|
|
2
3
|
|
|
3
4
|
export const styles = StyleSheet.create({
|
|
@@ -12,13 +13,16 @@ export const styles = StyleSheet.create({
|
|
|
12
13
|
alignItems: 'center',
|
|
13
14
|
justifyContent: 'center',
|
|
14
15
|
},
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
logo: {
|
|
17
|
+
width: 130,
|
|
18
|
+
height: 109,
|
|
19
|
+
},
|
|
20
|
+
title: {
|
|
21
|
+
fontSize: 16,
|
|
17
22
|
fontWeight: 'bold',
|
|
18
23
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
marginBottom: 32,
|
|
24
|
+
description: {
|
|
25
|
+
fontSize: 14,
|
|
26
|
+
marginTop: Spacing.sm,
|
|
23
27
|
},
|
|
24
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 相对或绝对路径
|
|
@@ -233,9 +233,12 @@ importers:
|
|
|
233
233
|
|
|
234
234
|
server:
|
|
235
235
|
dependencies:
|
|
236
|
+
cors:
|
|
237
|
+
specifier: ^2.8.5
|
|
238
|
+
version: 2.8.5
|
|
236
239
|
coze-coding-dev-sdk:
|
|
237
|
-
specifier: ^0.
|
|
238
|
-
version: 0.
|
|
240
|
+
specifier: ^0.7.2
|
|
241
|
+
version: 0.7.2(@types/pg@8.16.0)(openai@6.15.0(ws@8.18.3)(zod@4.3.2))(ws@8.18.3)
|
|
239
242
|
dayjs:
|
|
240
243
|
specifier: ^1.11.19
|
|
241
244
|
version: 1.11.19
|
|
@@ -258,6 +261,9 @@ importers:
|
|
|
258
261
|
specifier: ^4.2.1
|
|
259
262
|
version: 4.3.2
|
|
260
263
|
devDependencies:
|
|
264
|
+
'@types/cors':
|
|
265
|
+
specifier: ^2.8.19
|
|
266
|
+
version: 2.8.19
|
|
261
267
|
'@types/express':
|
|
262
268
|
specifier: ^5.0.6
|
|
263
269
|
version: 5.0.6
|
|
@@ -2067,6 +2073,9 @@ packages:
|
|
|
2067
2073
|
'@types/connect@3.4.38':
|
|
2068
2074
|
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
|
|
2069
2075
|
|
|
2076
|
+
'@types/cors@2.8.19':
|
|
2077
|
+
resolution: {integrity: sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==}
|
|
2078
|
+
|
|
2070
2079
|
'@types/estree@1.0.8':
|
|
2071
2080
|
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
|
2072
2081
|
|
|
@@ -2858,12 +2867,16 @@ packages:
|
|
|
2858
2867
|
core-js-compat@3.47.0:
|
|
2859
2868
|
resolution: {integrity: sha512-IGfuznZ/n7Kp9+nypamBhvwdwLsW6KC8IOaURw2doAK5e98AG3acVLdh0woOnEqCfUtS+Vu882JE4k/DAm3ItQ==}
|
|
2860
2869
|
|
|
2870
|
+
cors@2.8.5:
|
|
2871
|
+
resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==}
|
|
2872
|
+
engines: {node: '>= 0.10'}
|
|
2873
|
+
|
|
2861
2874
|
cosmiconfig@7.1.0:
|
|
2862
2875
|
resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==}
|
|
2863
2876
|
engines: {node: '>=10'}
|
|
2864
2877
|
|
|
2865
|
-
coze-coding-dev-sdk@0.
|
|
2866
|
-
resolution: {integrity: sha512-
|
|
2878
|
+
coze-coding-dev-sdk@0.7.2:
|
|
2879
|
+
resolution: {integrity: sha512-IAAbI8W6MHL95BV/OmiacM2aMzkruyBwUMsvzJk/9jBT9vra2xiUC5ggS5xFi7V7MrL5VqfLv9ZlWSjcOAVRpw==}
|
|
2867
2880
|
engines: {node: '>=18.0.0'}
|
|
2868
2881
|
hasBin: true
|
|
2869
2882
|
|
|
@@ -5961,6 +5974,11 @@ packages:
|
|
|
5961
5974
|
resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==}
|
|
5962
5975
|
engines: {node: '>=12'}
|
|
5963
5976
|
|
|
5977
|
+
transliteration@2.6.0:
|
|
5978
|
+
resolution: {integrity: sha512-T6frfMj7N5xNK0l+duIzIWKxkc9ewG72uv7NeOs4dIoysqTnYpwxeVEE5qYdKKmy7hby55ah0wNUoMaLsB2Zjw==}
|
|
5979
|
+
engines: {node: '>=20.0.0'}
|
|
5980
|
+
hasBin: true
|
|
5981
|
+
|
|
5964
5982
|
ts-api-utils@2.3.0:
|
|
5965
5983
|
resolution: {integrity: sha512-6eg3Y9SF7SsAvGzRHQvvc1skDAhwI4YQ32ui1scxD1Ccr0G5qIIbUBT3pFTKX8kmWIQClHobtUdNuaBgwdfdWg==}
|
|
5966
5984
|
engines: {node: '>=18.12'}
|
|
@@ -8979,6 +8997,10 @@ snapshots:
|
|
|
8979
8997
|
dependencies:
|
|
8980
8998
|
'@types/node': 25.0.3
|
|
8981
8999
|
|
|
9000
|
+
'@types/cors@2.8.19':
|
|
9001
|
+
dependencies:
|
|
9002
|
+
'@types/node': 25.0.3
|
|
9003
|
+
|
|
8982
9004
|
'@types/estree@1.0.8': {}
|
|
8983
9005
|
|
|
8984
9006
|
'@types/express-serve-static-core@5.1.0':
|
|
@@ -9885,6 +9907,11 @@ snapshots:
|
|
|
9885
9907
|
dependencies:
|
|
9886
9908
|
browserslist: 4.28.1
|
|
9887
9909
|
|
|
9910
|
+
cors@2.8.5:
|
|
9911
|
+
dependencies:
|
|
9912
|
+
object-assign: 4.1.1
|
|
9913
|
+
vary: 1.1.2
|
|
9914
|
+
|
|
9888
9915
|
cosmiconfig@7.1.0:
|
|
9889
9916
|
dependencies:
|
|
9890
9917
|
'@types/parse-json': 4.0.2
|
|
@@ -9893,7 +9920,7 @@ snapshots:
|
|
|
9893
9920
|
path-type: 4.0.0
|
|
9894
9921
|
yaml: 1.10.2
|
|
9895
9922
|
|
|
9896
|
-
coze-coding-dev-sdk@0.
|
|
9923
|
+
coze-coding-dev-sdk@0.7.2(@types/pg@8.16.0)(openai@6.15.0(ws@8.18.3)(zod@4.3.2))(ws@8.18.3):
|
|
9897
9924
|
dependencies:
|
|
9898
9925
|
'@aws-sdk/client-s3': 3.965.0
|
|
9899
9926
|
'@aws-sdk/lib-storage': 3.965.0(@aws-sdk/client-s3@3.965.0)
|
|
@@ -9906,6 +9933,7 @@ snapshots:
|
|
|
9906
9933
|
drizzle-orm: 0.45.1(@types/pg@8.16.0)(pg@8.16.3)
|
|
9907
9934
|
ora: 9.0.0
|
|
9908
9935
|
pg: 8.16.3
|
|
9936
|
+
transliteration: 2.6.0
|
|
9909
9937
|
transitivePeerDependencies:
|
|
9910
9938
|
- '@aws-sdk/client-rds-data'
|
|
9911
9939
|
- '@cloudflare/workers-types'
|
|
@@ -13554,6 +13582,8 @@ snapshots:
|
|
|
13554
13582
|
dependencies:
|
|
13555
13583
|
punycode: 2.3.1
|
|
13556
13584
|
|
|
13585
|
+
transliteration@2.6.0: {}
|
|
13586
|
+
|
|
13557
13587
|
ts-api-utils@2.3.0(typescript@5.9.3):
|
|
13558
13588
|
dependencies:
|
|
13559
13589
|
typescript: 5.9.3
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const pkg = require('./package.json');
|
|
6
|
+
const dependencies = pkg.dependencies || {};
|
|
7
|
+
const externalList = Object.keys(dependencies).filter(dep => dep !== 'dayjs');
|
|
8
|
+
try {
|
|
9
|
+
await esbuild.build({
|
|
10
|
+
entryPoints: ['src/index.ts'],
|
|
11
|
+
bundle: true,
|
|
12
|
+
platform: 'node',
|
|
13
|
+
format: 'esm',
|
|
14
|
+
outdir: 'dist',
|
|
15
|
+
external: externalList,
|
|
16
|
+
});
|
|
17
|
+
console.log('⚡ Build complete!');
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.error(e);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"preinstall": "npx only-allow pnpm",
|
|
7
|
-
"dev": "
|
|
8
|
-
"build": "
|
|
7
|
+
"dev": "bash ../.cozeproj/scripts/server_dev_run.sh",
|
|
8
|
+
"build": "node build.js",
|
|
9
9
|
"start": "NODE_ENV=production PORT=${PORT:-5000} node dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"express": "^4.22.1",
|
|
13
13
|
"cors": "^2.8.5",
|
|
14
|
-
"coze-coding-dev-sdk": "^0.
|
|
14
|
+
"coze-coding-dev-sdk": "^0.7.2",
|
|
15
15
|
"dayjs": "^1.11.19",
|
|
16
16
|
"drizzle-orm": "^0.45.1",
|
|
17
17
|
"drizzle-zod": "^0.8.3",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"zod": "^4.2.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"@types/cors": "^2.8.19",
|
|
23
24
|
"@types/express": "^5.0.6",
|
|
24
25
|
"tsx": "^4.21.0",
|
|
25
26
|
"@types/multer": "^2.0.0",
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from 'next';
|
|
2
|
+
import path from 'path';
|
|
2
3
|
|
|
3
4
|
const nextConfig: NextConfig = {
|
|
5
|
+
// outputFileTracingRoot: path.resolve(__dirname, '../../'),
|
|
4
6
|
/* config options here */
|
|
5
7
|
allowedDevOrigins: ['*.dev.coze.site'],
|
|
6
8
|
images: {
|
|
7
9
|
remotePatterns: [
|
|
8
10
|
{
|
|
9
11
|
protocol: 'https',
|
|
10
|
-
hostname: '
|
|
12
|
+
hostname: 'lf-coze-web-cdn.coze.cn',
|
|
11
13
|
pathname: '/**',
|
|
12
14
|
},
|
|
13
15
|
],
|
|
@@ -105,8 +105,8 @@ importers:
|
|
|
105
105
|
specifier: ^1.1.1
|
|
106
106
|
version: 1.1.1(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
|
107
107
|
coze-coding-dev-sdk:
|
|
108
|
-
specifier: ^0.
|
|
109
|
-
version: 0.
|
|
108
|
+
specifier: ^0.7.0
|
|
109
|
+
version: 0.7.2(@types/pg@8.16.0)(openai@6.15.0(zod@4.3.5))
|
|
110
110
|
date-fns:
|
|
111
111
|
specifier: ^4.1.0
|
|
112
112
|
version: 4.1.0
|
|
@@ -2747,8 +2747,8 @@ packages:
|
|
|
2747
2747
|
typescript:
|
|
2748
2748
|
optional: true
|
|
2749
2749
|
|
|
2750
|
-
coze-coding-dev-sdk@0.
|
|
2751
|
-
resolution: {integrity: sha512-
|
|
2750
|
+
coze-coding-dev-sdk@0.7.2:
|
|
2751
|
+
resolution: {integrity: sha512-IAAbI8W6MHL95BV/OmiacM2aMzkruyBwUMsvzJk/9jBT9vra2xiUC5ggS5xFi7V7MrL5VqfLv9ZlWSjcOAVRpw==}
|
|
2752
2752
|
engines: {node: '>=18.0.0'}
|
|
2753
2753
|
hasBin: true
|
|
2754
2754
|
|
|
@@ -4820,6 +4820,11 @@ packages:
|
|
|
4820
4820
|
resolution: {integrity: sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==}
|
|
4821
4821
|
engines: {node: '>=16'}
|
|
4822
4822
|
|
|
4823
|
+
transliteration@2.6.0:
|
|
4824
|
+
resolution: {integrity: sha512-T6frfMj7N5xNK0l+duIzIWKxkc9ewG72uv7NeOs4dIoysqTnYpwxeVEE5qYdKKmy7hby55ah0wNUoMaLsB2Zjw==}
|
|
4825
|
+
engines: {node: '>=20.0.0'}
|
|
4826
|
+
hasBin: true
|
|
4827
|
+
|
|
4823
4828
|
ts-api-utils@2.3.0:
|
|
4824
4829
|
resolution: {integrity: sha512-6eg3Y9SF7SsAvGzRHQvvc1skDAhwI4YQ32ui1scxD1Ccr0G5qIIbUBT3pFTKX8kmWIQClHobtUdNuaBgwdfdWg==}
|
|
4825
4830
|
engines: {node: '>=18.12'}
|
|
@@ -7931,7 +7936,7 @@ snapshots:
|
|
|
7931
7936
|
optionalDependencies:
|
|
7932
7937
|
typescript: 5.9.3
|
|
7933
7938
|
|
|
7934
|
-
coze-coding-dev-sdk@0.
|
|
7939
|
+
coze-coding-dev-sdk@0.7.2(@types/pg@8.16.0)(openai@6.15.0(zod@4.3.5)):
|
|
7935
7940
|
dependencies:
|
|
7936
7941
|
'@aws-sdk/client-s3': 3.962.0
|
|
7937
7942
|
'@aws-sdk/lib-storage': 3.962.0(@aws-sdk/client-s3@3.962.0)
|
|
@@ -7944,6 +7949,7 @@ snapshots:
|
|
|
7944
7949
|
drizzle-orm: 0.45.1(@types/pg@8.16.0)(pg@8.16.3)
|
|
7945
7950
|
ora: 9.0.0
|
|
7946
7951
|
pg: 8.16.3
|
|
7952
|
+
transliteration: 2.6.0
|
|
7947
7953
|
transitivePeerDependencies:
|
|
7948
7954
|
- '@aws-sdk/client-rds-data'
|
|
7949
7955
|
- '@cloudflare/workers-types'
|
|
@@ -10186,6 +10192,8 @@ snapshots:
|
|
|
10186
10192
|
dependencies:
|
|
10187
10193
|
tldts: 7.0.19
|
|
10188
10194
|
|
|
10195
|
+
transliteration@2.6.0: {}
|
|
10196
|
+
|
|
10189
10197
|
ts-api-utils@2.3.0(typescript@5.9.3):
|
|
10190
10198
|
dependencies:
|
|
10191
10199
|
typescript: 5.9.3
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
@theme inline {
|
|
7
7
|
--color-background: var(--background);
|
|
8
8
|
--color-foreground: var(--foreground);
|
|
9
|
-
--font-sans: var(--font-geist-sans);
|
|
10
|
-
--font-mono: var(--font-geist-mono);
|
|
11
9
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
12
10
|
--color-sidebar-border: var(--sidebar-border);
|
|
13
11
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
@@ -44,6 +42,16 @@
|
|
|
44
42
|
--radius-2xl: calc(var(--radius) + 8px);
|
|
45
43
|
--radius-3xl: calc(var(--radius) + 12px);
|
|
46
44
|
--radius-4xl: calc(var(--radius) + 16px);
|
|
45
|
+
--font-sans:
|
|
46
|
+
'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', ui-sans-serif,
|
|
47
|
+
system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
48
|
+
'Helvetica Neue', Arial, sans-serif;
|
|
49
|
+
--font-mono:
|
|
50
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
|
|
51
|
+
'Courier New', monospace;
|
|
52
|
+
--font-serif:
|
|
53
|
+
'Noto Serif SC', 'Songti SC', 'SimSun', ui-serif, Georgia, Cambria,
|
|
54
|
+
'Times New Roman', Times, serif;
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
:root {
|