@coze-arch/cli 0.0.1-alpha.7d92f8 → 0.0.1-alpha.8e1417
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/{deploy_build.sh → dev_build.sh} +0 -7
- package/lib/__templates__/expo/.cozeproj/scripts/{deploy_run.sh → dev_run.sh} +22 -22
- package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
- package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +35 -0
- package/lib/__templates__/expo/_gitignore +1 -1
- package/lib/__templates__/expo/_npmrc +2 -4
- package/lib/__templates__/expo/{app.json → client/app.json} +4 -4
- package/lib/__templates__/expo/{metro.config.js → client/metro.config.js} +3 -5
- package/lib/__templates__/expo/client/package.json +92 -0
- package/lib/__templates__/expo/client/src/app/index.ts +1 -0
- package/lib/__templates__/expo/client/{constants → src/constants}/theme.ts +10 -0
- package/lib/__templates__/expo/client/{hooks → src/hooks}/useTheme.ts +1 -1
- package/lib/__templates__/expo/client/{screens → src/screens}/home/index.tsx +0 -1
- package/lib/__templates__/expo/client/tsconfig.json +24 -0
- package/lib/__templates__/expo/package.json +16 -12
- package/lib/__templates__/expo/pnpm-lock.yaml +299 -514
- package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
- package/lib/__templates__/expo/server/package.json +17 -0
- package/lib/__templates__/expo/tsconfig.json +1 -24
- package/lib/__templates__/nextjs/src/app/globals.css +99 -87
- package/lib/__templates__/vite/vite.config.ts +0 -3
- package/lib/cli.js +1 -1
- package/package.json +3 -2
- 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/app/+not-found.tsx +0 -79
- package/lib/__templates__/expo/client/index.js +0 -12
- /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
- /package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +0 -0
- /package/lib/__templates__/expo/client/{app → src/app}/_layout.tsx +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/fonts/SpaceMono-Regular.ttf +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/adaptive-icon.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/default-avatar.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/favicon.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/icon.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/partial-react-logo.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/react-logo.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/react-logo@2x.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/react-logo@3x.png +0 -0
- /package/lib/__templates__/expo/client/{assets → src/assets}/images/splash-icon.png +0 -0
- /package/lib/__templates__/expo/client/{components → src/components}/Screen.tsx +0 -0
- /package/lib/__templates__/expo/client/{components → src/components}/SmartDateInput.tsx +0 -0
- /package/lib/__templates__/expo/client/{contexts → src/contexts}/AuthContext.tsx +0 -0
- /package/lib/__templates__/expo/client/{hooks → src/hooks}/useColorScheme.ts +0 -0
- /package/lib/__templates__/expo/client/{screens → src/screens}/home/styles.ts +0 -0
- /package/lib/__templates__/expo/client/{utils → src/utils}/index.ts +0 -0
- /package/lib/__templates__/expo/{src → server/src}/index.ts +0 -0
|
@@ -3,5 +3,10 @@ entrypoint = "server.js"
|
|
|
3
3
|
requires = ["nodejs-24"]
|
|
4
4
|
|
|
5
5
|
[dev]
|
|
6
|
-
build = ["bash", ".cozeproj/scripts/
|
|
7
|
-
run = ["bash", ".cozeproj/scripts/
|
|
6
|
+
build = ["bash", ".cozeproj/scripts/dev_build.sh"]
|
|
7
|
+
run = ["bash", ".cozeproj/scripts/dev_run.sh"]
|
|
8
|
+
|
|
9
|
+
[deploy]
|
|
10
|
+
build = ["bash", ".cozeproj/scripts/prod_build.sh"]
|
|
11
|
+
run = ["bash", ".cozeproj/scripts/prod_run.sh"]
|
|
12
|
+
build_app_dir = "."
|
|
@@ -49,13 +49,6 @@ fs.writeSync(fd, record+"\n", null, "utf8");
|
|
|
49
49
|
fs.fsyncSync(fd);
|
|
50
50
|
fs.closeSync(fd);
|
|
51
51
|
' "$LOG_FILE" "$level" "$msg"
|
|
52
|
-
|
|
53
|
-
case "$level" in
|
|
54
|
-
INFO) info "$msg" ;;
|
|
55
|
-
WARN) warn "$msg" ;;
|
|
56
|
-
ERROR) echo -e "\033[31m[ERROR] $msg\033[0m" ;;
|
|
57
|
-
*) info "$msg" ;;
|
|
58
|
-
esac
|
|
59
52
|
}
|
|
60
53
|
|
|
61
54
|
# ==================== 前置检查 ====================
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
2
|
+
PREVIEW_DIR="${COZE_PREVIEW_DIR:-$ROOT_DIR}"
|
|
2
3
|
LOG_DIR="${COZE_LOG_DIR:-$ROOT_DIR/logs}"
|
|
3
4
|
LOG_FILE="$LOG_DIR/app.log"
|
|
4
5
|
mkdir -p "$LOG_DIR"
|
|
@@ -10,7 +11,7 @@ SERVER_PORT="9091"
|
|
|
10
11
|
# Expo 项目配置
|
|
11
12
|
EXPO_HOST="0.0.0.0"
|
|
12
13
|
EXPO_DIR="expo"
|
|
13
|
-
EXPO_PORT="
|
|
14
|
+
EXPO_PORT="5000"
|
|
14
15
|
WEB_URL="${COZE_PROJECT_DOMAIN_DEFAULT:-http://127.0.0.1:${SERVER_PORT}}"
|
|
15
16
|
ASSUME_YES="1"
|
|
16
17
|
EXPO_PUBLIC_BACKEND_BASE_URL="${EXPO_PUBLIC_BACKEND_BASE_URL:-$WEB_URL}"
|
|
@@ -116,18 +117,12 @@ fs.writeSync(fd, record+"\n", null, "utf8");
|
|
|
116
117
|
fs.fsyncSync(fd);
|
|
117
118
|
fs.closeSync(fd);
|
|
118
119
|
' "$LOG_FILE" "$level" "$msg"
|
|
119
|
-
case "$level" in
|
|
120
|
-
INFO) echo -e "\033[32m[INFO] $msg\033[0m" ;;
|
|
121
|
-
WARN) echo -e "\033[33m[WARN] $msg\033[0m" ;;
|
|
122
|
-
ERROR) echo -e "\033[31m[ERROR] $msg\033[0m" ;;
|
|
123
|
-
*) echo -e "\033[32m[INFO] $msg\033[0m" ;;
|
|
124
|
-
esac
|
|
125
120
|
}
|
|
126
121
|
|
|
127
122
|
wait_port_connectable() {
|
|
128
123
|
local host=$1 port=$2 retries=${3:-10}
|
|
129
124
|
for _ in $(seq 1 "$retries"); do
|
|
130
|
-
nc -z "$host" "$port" && return 0
|
|
125
|
+
nc -z -w 1 "$host" "$port" >/dev/null 2>&1 && return 0
|
|
131
126
|
sleep 1
|
|
132
127
|
done
|
|
133
128
|
return 1
|
|
@@ -135,13 +130,18 @@ wait_port_connectable() {
|
|
|
135
130
|
|
|
136
131
|
start_expo() {
|
|
137
132
|
local offline="${1:-0}"
|
|
133
|
+
|
|
134
|
+
pushd ./client
|
|
135
|
+
|
|
138
136
|
if [ "$offline" = "1" ]; then
|
|
139
|
-
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" nohup npx expo start --port "$EXPO_PORT" > logs/expo.log 2>&1 &
|
|
137
|
+
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" nohup npx expo start --port "$EXPO_PORT" > ../logs/expo.log 2>&1 &
|
|
140
138
|
else
|
|
141
|
-
EXPO_NO_DOCTOR=1 EXPO_PUBLIC_BACKEND_BASE_URL="$EXPO_PUBLIC_BACKEND_BASE_URL" EXPO_PACKAGER_PROXY_URL="$EXPO_PACKAGER_PROXY_URL" nohup npx expo start --port "$EXPO_PORT" > logs/expo.log 2>&1 &
|
|
139
|
+
EXPO_NO_DOCTOR=1 EXPO_PUBLIC_BACKEND_BASE_URL="$EXPO_PUBLIC_BACKEND_BASE_URL" EXPO_PACKAGER_PROXY_URL="$EXPO_PACKAGER_PROXY_URL" nohup npx expo start --port "$EXPO_PORT" > ../logs/expo.log 2>&1 &
|
|
142
140
|
fi
|
|
143
141
|
EXPO_PID=$!
|
|
144
142
|
echo "$EXPO_PID"
|
|
143
|
+
|
|
144
|
+
popd
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
detect_expo_fetch_failed() {
|
|
@@ -159,6 +159,15 @@ detect_expo_fetch_failed() {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
# ==================== 前置检查 ====================
|
|
162
|
+
# 关掉nginx进程
|
|
163
|
+
ps -ef | grep nginx | grep -v grep | awk '{print $2}' | xargs -r kill -9
|
|
164
|
+
|
|
165
|
+
write_log "INFO" "检查根目录 pre_install.py"
|
|
166
|
+
if [ -f "$PREVIEW_DIR/pre_install.py" ]; then
|
|
167
|
+
write_log "INFO" "执行:python $PREVIEW_DIR/pre_install.py"
|
|
168
|
+
python "$PREVIEW_DIR/pre_install.py" || write_log "ERROR" "pre_install.py 执行失败"
|
|
169
|
+
fi
|
|
170
|
+
|
|
162
171
|
write_log "INFO" "==================== 开始启动 ===================="
|
|
163
172
|
write_log "INFO" "开始执行服务启动脚本(start_dev.sh)..."
|
|
164
173
|
write_log "INFO" "正在检查依赖命令和目录是否存在..."
|
|
@@ -176,17 +185,9 @@ ensure_port SERVER_PORT "$SERVER_PORT"
|
|
|
176
185
|
ensure_port EXPO_PORT "$EXPO_PORT"
|
|
177
186
|
|
|
178
187
|
# ==================== 启动 Server 服务 ====================
|
|
179
|
-
write_log "INFO" "检查 Nginx 端口 (5000)..."
|
|
180
|
-
if is_port_free 5000; then
|
|
181
|
-
write_log "INFO" "端口 5000 未被占用,正在启动 Nginx..."
|
|
182
|
-
service nginx start
|
|
183
|
-
else
|
|
184
|
-
write_log "INFO" "端口 5000 已被占用,跳过 Nginx 启动"
|
|
185
|
-
fi
|
|
186
|
-
|
|
187
188
|
write_log "INFO" "==================== 启动 server 服务 ===================="
|
|
188
|
-
write_log "INFO" "正在执行:npm run
|
|
189
|
-
PORT="$SERVER_PORT" nohup npm run server > logs/app.log 2>&1 &
|
|
189
|
+
write_log "INFO" "正在执行:npm run dev"
|
|
190
|
+
PORT="$SERVER_PORT" nohup npm run dev --prefix ./server > logs/app.log 2>&1 &
|
|
190
191
|
SERVER_PID=$!
|
|
191
192
|
if [ -z "${SERVER_PID}" ]; then
|
|
192
193
|
write_log "ERROR" "无法获取 server 后台进程 PID"
|
|
@@ -194,8 +195,7 @@ fi
|
|
|
194
195
|
write_log "INFO" "server 服务已启动,进程 ID:${SERVER_PID:-unknown}"
|
|
195
196
|
|
|
196
197
|
write_log "INFO" "==================== 启动 Expo 项目 ===================="
|
|
197
|
-
write_log "INFO" "
|
|
198
|
-
write_log "INFO" "开始启动 Expo 服务"
|
|
198
|
+
write_log "INFO" "开始启动 Expo 服务,端口 ${EXPO_PORT}"
|
|
199
199
|
EXPO_PID=$(start_expo 0)
|
|
200
200
|
if detect_expo_fetch_failed 8; then
|
|
201
201
|
write_log "WARN" "Expo 启动检测到网络错误:TypeError: fetch failed,启用离线模式重试"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
if [ -z "${BASH_VERSION:-}" ]; then exec /usr/bin/env bash "$0" "$@"; fi
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
ROOT_DIR="$(pwd)"
|
|
5
|
+
|
|
6
|
+
# ==================== 工具函数 ====================
|
|
7
|
+
info() {
|
|
8
|
+
echo "[INFO] $1"
|
|
9
|
+
}
|
|
10
|
+
warn() {
|
|
11
|
+
echo "[WARN] $1"
|
|
12
|
+
}
|
|
13
|
+
error() {
|
|
14
|
+
echo "[ERROR] $1"
|
|
15
|
+
exit 1
|
|
16
|
+
}
|
|
17
|
+
check_command() {
|
|
18
|
+
if ! command -v "$1" &> /dev/null; then
|
|
19
|
+
error "命令 $1 未找到,请先安装"
|
|
20
|
+
fi
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
info "==================== 开始构建 ===================="
|
|
24
|
+
info "开始执行构建脚本(build_prod.sh)..."
|
|
25
|
+
info "正在检查依赖命令是否存在..."
|
|
26
|
+
# 检查核心命令
|
|
27
|
+
check_command "pnpm"
|
|
28
|
+
check_command "npm"
|
|
29
|
+
|
|
30
|
+
# ==================== 安装 Node 依赖 ====================
|
|
31
|
+
info "==================== 安装 Node 依赖 ===================="
|
|
32
|
+
info "开始安装 Node 依赖"
|
|
33
|
+
if [ -f "$ROOT_DIR/package.json" ]; then
|
|
34
|
+
info "进入目录:$ROOT_DIR"
|
|
35
|
+
info "正在执行:pnpm install"
|
|
36
|
+
(cd "$ROOT_DIR" && pnpm install --registry=https://registry.npmmirror.com) || error "Node 依赖安装失败"
|
|
37
|
+
else
|
|
38
|
+
warn "未找到 $ROOT_DIR/package.json 文件,请检查路径是否正确"
|
|
39
|
+
fi
|
|
40
|
+
info "==================== 依赖安装完成!====================\n"
|
|
41
|
+
|
|
42
|
+
info "==================== dist打包 ===================="
|
|
43
|
+
info "开始执行:npm run build --prefix server"
|
|
44
|
+
(cd "$ROOT_DIR" && npm run build --prefix ./server) || error "dist打包失败"
|
|
45
|
+
info "==================== dist打包完成!====================\n"
|
|
46
|
+
|
|
47
|
+
info "下一步:执行 ./prod_run.sh 启动服务"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# 产物部署使用
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
HOST="${HOST:-0.0.0.0}"
|
|
9
|
+
PORT="${PORT:-5000}"
|
|
10
|
+
|
|
11
|
+
# ==================== 工具函数 ====================
|
|
12
|
+
info() {
|
|
13
|
+
echo "[INFO] $1"
|
|
14
|
+
}
|
|
15
|
+
warn() {
|
|
16
|
+
echo "[WARN] $1"
|
|
17
|
+
}
|
|
18
|
+
error() {
|
|
19
|
+
echo "[ERROR] $1"
|
|
20
|
+
exit 1
|
|
21
|
+
}
|
|
22
|
+
check_command() {
|
|
23
|
+
if ! command -v "$1" &> /dev/null; then
|
|
24
|
+
error "命令 $1 未找到,请先安装"
|
|
25
|
+
fi
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# ============== 启动服务 ======================
|
|
29
|
+
# 检查核心命令
|
|
30
|
+
check_command "pnpm"
|
|
31
|
+
check_command "npm"
|
|
32
|
+
|
|
33
|
+
info "开始执行:npm run start"
|
|
34
|
+
(cd "$ROOT_DIR" && PORT="$PORT" npm run start --prefix ./server) || error "服务启动失败"
|
|
35
|
+
info "服务启动完成!\n"
|
|
@@ -8,15 +8,13 @@ network-concurrency=16
|
|
|
8
8
|
fetch-retries=3
|
|
9
9
|
fetch-timeout=60000
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# peerDependencies
|
|
12
12
|
strict-peer-dependencies=false
|
|
13
|
-
|
|
14
|
-
# 自动生成 lockfile
|
|
15
13
|
auto-install-peers=true
|
|
16
14
|
|
|
17
15
|
# lockfile 配置
|
|
18
16
|
lockfile=true
|
|
19
17
|
prefer-frozen-lockfile=true
|
|
20
18
|
|
|
21
|
-
#
|
|
19
|
+
# semver 选择最高版本
|
|
22
20
|
resolution-mode=highest
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"slug": "${slug}",
|
|
5
5
|
"version": "1.0.0",
|
|
6
6
|
"orientation": "portrait",
|
|
7
|
-
"icon": "./
|
|
7
|
+
"icon": "./assets/images/icon.png",
|
|
8
8
|
"scheme": "myapp",
|
|
9
9
|
"userInterfaceStyle": "automatic",
|
|
10
10
|
"newArchEnabled": true,
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
},
|
|
14
14
|
"android": {
|
|
15
15
|
"adaptiveIcon": {
|
|
16
|
-
"foregroundImage": "./
|
|
16
|
+
"foregroundImage": "./assets/images/adaptive-icon.png",
|
|
17
17
|
"backgroundColor": "#ffffff"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"web": {
|
|
21
21
|
"bundler": "metro",
|
|
22
22
|
"output": "single",
|
|
23
|
-
"favicon": "./
|
|
23
|
+
"favicon": "./assets/images/favicon.png"
|
|
24
24
|
},
|
|
25
25
|
"plugins": [
|
|
26
26
|
"expo-router",
|
|
27
27
|
[
|
|
28
28
|
"expo-splash-screen",
|
|
29
29
|
{
|
|
30
|
-
"image": "./
|
|
30
|
+
"image": "./assets/images/splash-icon.png",
|
|
31
31
|
"imageWidth": 200,
|
|
32
32
|
"resizeMode": "contain",
|
|
33
33
|
"backgroundColor": "#ffffff"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
|
-
|
|
2
|
+
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
3
3
|
const connect = require('connect');
|
|
4
4
|
|
|
5
5
|
const config = getDefaultConfig(__dirname);
|
|
@@ -28,9 +28,8 @@ config.resolver.blockList = [
|
|
|
28
28
|
/.*\.git\/.*/, // 排除 Git 目录
|
|
29
29
|
];
|
|
30
30
|
|
|
31
|
-
/*
|
|
32
31
|
const apiProxy = createProxyMiddleware({
|
|
33
|
-
target: 'http://localhost:
|
|
32
|
+
target: 'http://localhost:9091',
|
|
34
33
|
logLevel: 'debug',
|
|
35
34
|
});
|
|
36
35
|
|
|
@@ -39,7 +38,7 @@ config.server = {
|
|
|
39
38
|
enhanceMiddleware: (metroMiddleware, metroServer) => {
|
|
40
39
|
return connect()
|
|
41
40
|
.use((req, res, next) => {
|
|
42
|
-
if (req.url && req.url.startsWith('/api')) {
|
|
41
|
+
if (req.url && req.url.startsWith('/api/v')) {
|
|
43
42
|
console.log(`[Metro Proxy] Forwarding ${req.method} ${req.url}`);
|
|
44
43
|
return apiProxy(req, res, next);
|
|
45
44
|
}
|
|
@@ -48,6 +47,5 @@ config.server = {
|
|
|
48
47
|
.use(metroMiddleware);
|
|
49
48
|
},
|
|
50
49
|
}
|
|
51
|
-
*/
|
|
52
50
|
|
|
53
51
|
module.exports = config;
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
28
|
+
"babel-preset-expo": "^54.0.9",
|
|
29
|
+
"dayjs": "^1.11.19",
|
|
30
|
+
"expo": "^54.0.7",
|
|
31
|
+
"expo-auth-session": "^7.0.9",
|
|
32
|
+
"expo-av": "~16.0.6",
|
|
33
|
+
"expo-blur": "~15.0.6",
|
|
34
|
+
"expo-camera": "~17.0.10",
|
|
35
|
+
"expo-constants": "~18.0.8",
|
|
36
|
+
"expo-crypto": "^15.0.7",
|
|
37
|
+
"expo-font": "~14.0.7",
|
|
38
|
+
"expo-haptics": "~15.0.6",
|
|
39
|
+
"expo-image-picker": "~17.0.7",
|
|
40
|
+
"expo-linear-gradient": "~15.0.6",
|
|
41
|
+
"expo-linking": "~8.0.7",
|
|
42
|
+
"expo-location": "~19.0.7",
|
|
43
|
+
"expo-router": "~6.0.0",
|
|
44
|
+
"expo-splash-screen": "~31.0.8",
|
|
45
|
+
"expo-status-bar": "~3.0.7",
|
|
46
|
+
"expo-symbols": "~1.0.6",
|
|
47
|
+
"expo-system-ui": "~6.0.9",
|
|
48
|
+
"expo-web-browser": "~15.0.10",
|
|
49
|
+
"react": "19.1.0",
|
|
50
|
+
"react-dom": "19.1.0",
|
|
51
|
+
"react-native": "0.81.5",
|
|
52
|
+
"react-native-chart-kit": "^6.12.0",
|
|
53
|
+
"react-native-gesture-handler": "~2.28.0",
|
|
54
|
+
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
55
|
+
"react-native-modal-datetime-picker": "18.0.0",
|
|
56
|
+
"react-native-reanimated": "~4.1.0",
|
|
57
|
+
"react-native-safe-area-context": "~5.6.0",
|
|
58
|
+
"react-native-screens": "~4.16.0",
|
|
59
|
+
"react-native-svg": "15.15.0",
|
|
60
|
+
"react-native-toast-message": "^2.3.3",
|
|
61
|
+
"react-native-web": "^0.21.2",
|
|
62
|
+
"react-native-webview": "~13.15.0",
|
|
63
|
+
"react-native-worklets": "0.5.1",
|
|
64
|
+
"zod": "^4.2.1"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@babel/core": "^7.25.2",
|
|
68
|
+
"@eslint/js": "^9.27.0",
|
|
69
|
+
"@types/jest": "^29.5.12",
|
|
70
|
+
"@types/react": "~19.1.0",
|
|
71
|
+
"@types/react-test-renderer": "19.1.0",
|
|
72
|
+
"chalk": "^4.1.2",
|
|
73
|
+
"depcheck": "^1.4.7",
|
|
74
|
+
"esbuild": "0.27.2",
|
|
75
|
+
"eslint": "^9.39.2",
|
|
76
|
+
"eslint-formatter-compact": "^9.0.1",
|
|
77
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
78
|
+
"eslint-plugin-import": "^2.32.0",
|
|
79
|
+
"eslint-plugin-react": "^7.37.5",
|
|
80
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
81
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
82
|
+
"globals": "^16.1.0",
|
|
83
|
+
"jest": "^29.2.1",
|
|
84
|
+
"jest-expo": "~54.0.10",
|
|
85
|
+
"react-test-renderer": "19.1.0",
|
|
86
|
+
"tsx": "^4.21.0",
|
|
87
|
+
"typescript": "^5.8.3",
|
|
88
|
+
"typescript-eslint": "^8.32.1",
|
|
89
|
+
"connect": "^3.7.0",
|
|
90
|
+
"http-proxy-middleware": "^3.0.5"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@/screens/home'
|
|
@@ -6,25 +6,35 @@ const tintColorDark = "#0A84FF";
|
|
|
6
6
|
export const Colors = {
|
|
7
7
|
light: {
|
|
8
8
|
text: "#11181C",
|
|
9
|
+
textPrimary: "#11181C",
|
|
10
|
+
textSecondary: "#687076",
|
|
11
|
+
textMuted: "#9BA1A6",
|
|
9
12
|
buttonText: "#FFFFFF",
|
|
10
13
|
tabIconDefault: "#687076",
|
|
11
14
|
tabIconSelected: tintColorLight,
|
|
15
|
+
primary: tintColorLight,
|
|
12
16
|
link: "#007AFF",
|
|
13
17
|
backgroundRoot: "#FFFFFF", // Elevation 0
|
|
14
18
|
backgroundDefault: "#F2F2F2", // Elevation 1
|
|
15
19
|
backgroundSecondary: "#E6E6E6", // Elevation 2
|
|
16
20
|
backgroundTertiary: "#D9D9D9", // Elevation 3
|
|
21
|
+
border: "#E6E6E6",
|
|
17
22
|
},
|
|
18
23
|
dark: {
|
|
19
24
|
text: "#ECEDEE",
|
|
25
|
+
textPrimary: "#ECEDEE",
|
|
26
|
+
textSecondary: "#9BA1A6",
|
|
27
|
+
textMuted: "#6F767E",
|
|
20
28
|
buttonText: "#FFFFFF",
|
|
21
29
|
tabIconDefault: "#9BA1A6",
|
|
22
30
|
tabIconSelected: tintColorDark,
|
|
31
|
+
primary: tintColorDark,
|
|
23
32
|
link: "#0A84FF",
|
|
24
33
|
backgroundRoot: "#1F2123", // Elevation 0
|
|
25
34
|
backgroundDefault: "#2A2C2E", // Elevation 1
|
|
26
35
|
backgroundSecondary: "#353739", // Elevation 2
|
|
27
36
|
backgroundTertiary: "#404244", // Elevation 3
|
|
37
|
+
border: "#353739",
|
|
28
38
|
},
|
|
29
39
|
};
|
|
30
40
|
|
|
@@ -4,7 +4,7 @@ import { useColorScheme } from "@/hooks/useColorScheme";
|
|
|
4
4
|
export function useTheme() {
|
|
5
5
|
const colorScheme = useColorScheme();
|
|
6
6
|
const isDark = colorScheme === "dark";
|
|
7
|
-
const theme = Colors[colorScheme ?? "light"];
|
|
7
|
+
const theme = Colors[(colorScheme as "light" | "dark") ?? "light"];
|
|
8
8
|
|
|
9
9
|
return {
|
|
10
10
|
theme,
|
|
@@ -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
|
+
"@/*": ["./src/*"]
|
|
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,18 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= appName %>",
|
|
3
|
-
"version": "1.0.0",
|
|
4
3
|
"private": true,
|
|
5
|
-
"
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"main": "expo-router/entry",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "bash .cozeproj/scripts/
|
|
7
|
+
"build": "bash .cozeproj/scripts/dev_build.sh",
|
|
8
|
+
"dev": "bash .cozeproj/scripts/dev_run.sh",
|
|
9
|
+
"start": "bash .cozeproj/scripts/prod_run.sh",
|
|
8
10
|
"check-deps": "npx depcheck",
|
|
9
|
-
"dev": "bash .cozeproj/scripts/deploy_run.sh",
|
|
10
11
|
"preinstall": "npx only-allow pnpm",
|
|
11
|
-
"postinstall": "node ./client/scripts/install-missing-deps.js",
|
|
12
|
-
"install-missing": "node ./client/scripts/install-missing-deps.js",
|
|
13
12
|
"lint": "expo lint",
|
|
14
|
-
"server": "NODE_ENV=development tsx ./src/index.ts",
|
|
15
|
-
"start": "expo start --web",
|
|
16
13
|
"test": "jest --watchAll"
|
|
17
14
|
},
|
|
18
15
|
"jest": {
|
|
@@ -32,8 +29,10 @@
|
|
|
32
29
|
"@react-navigation/native": "^7.0.14",
|
|
33
30
|
"ajv": "^8.17.1",
|
|
34
31
|
"ajv-formats": "^3.0.1",
|
|
32
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
33
|
+
"babel-preset-expo": "^54.0.9",
|
|
35
34
|
"connect": "^3.7.0",
|
|
36
|
-
"coze-coding-dev-sdk": "^0.5.
|
|
35
|
+
"coze-coding-dev-sdk": "^0.5.5",
|
|
37
36
|
"dayjs": "^1.11.19",
|
|
38
37
|
"drizzle-kit": "^0.31.8",
|
|
39
38
|
"drizzle-orm": "^0.45.1",
|
|
@@ -58,6 +57,7 @@
|
|
|
58
57
|
"expo-system-ui": "~6.0.9",
|
|
59
58
|
"expo-web-browser": "~15.0.10",
|
|
60
59
|
"express": "^4.22.1",
|
|
60
|
+
"http-proxy-middleware": "^3.0.5",
|
|
61
61
|
"multer": "^2.0.2",
|
|
62
62
|
"pg": "^8.16.3",
|
|
63
63
|
"react": "19.1.0",
|
|
@@ -86,11 +86,10 @@
|
|
|
86
86
|
"@types/pg": "^8.16.0",
|
|
87
87
|
"@types/react": "~19.1.0",
|
|
88
88
|
"@types/react-test-renderer": "19.1.0",
|
|
89
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
90
|
-
"babel-preset-expo": "^54.0.9",
|
|
91
89
|
"chalk": "^4.1.2",
|
|
92
90
|
"depcheck": "^1.4.7",
|
|
93
|
-
"
|
|
91
|
+
"esbuild": "0.27.2",
|
|
92
|
+
"eslint": "^9.39.2",
|
|
94
93
|
"eslint-formatter-compact": "^9.0.1",
|
|
95
94
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
96
95
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -108,5 +107,10 @@
|
|
|
108
107
|
"packageManager": "pnpm@9.0.0",
|
|
109
108
|
"engines": {
|
|
110
109
|
"pnpm": ">=9.0.0"
|
|
110
|
+
},
|
|
111
|
+
"pnpm": {
|
|
112
|
+
"overrides": {
|
|
113
|
+
"esbuild": "0.27.2"
|
|
114
|
+
}
|
|
111
115
|
}
|
|
112
116
|
}
|