@coze-arch/cli 0.0.1-alpha.77c1b0 → 0.0.1-alpha.77c276
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} +25 -25
- package/lib/__templates__/expo/.cozeproj/scripts/{deploy_run.sh → dev_run.sh} +45 -63
- 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/_gitignore +1 -1
- package/lib/__templates__/expo/_npmrc +3 -5
- package/lib/__templates__/expo/client/app.config.ts +71 -0
- package/lib/__templates__/expo/client/metro.config.js +51 -0
- package/lib/__templates__/expo/client/package.json +92 -0
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +36 -12
- 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/src/contexts/AuthContext.tsx +49 -0
- package/lib/__templates__/expo/client/{hooks → src/hooks}/useTheme.ts +1 -1
- package/lib/__templates__/expo/client/{screens → src/screens}/home/index.tsx +1 -5
- package/lib/__templates__/expo/client/src/screens/home/styles.ts +60 -0
- package/lib/__templates__/expo/client/{utils → src/utils}/index.ts +1 -2
- package/lib/__templates__/expo/client/tsconfig.json +24 -0
- package/lib/__templates__/expo/package.json +27 -13
- package/lib/__templates__/expo/pnpm-lock.yaml +426 -514
- package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
- package/lib/__templates__/expo/server/package.json +17 -0
- package/lib/__templates__/expo/{src → server/src}/index.ts +2 -2
- package/lib/__templates__/expo/template.config.js +1 -1
- package/lib/__templates__/expo/tsconfig.json +1 -24
- package/lib/__templates__/nextjs/.coze +3 -3
- package/lib/__templates__/nextjs/README.md +341 -19
- package/lib/__templates__/nextjs/_npmrc +1 -1
- package/lib/__templates__/nextjs/components.json +21 -0
- package/lib/__templates__/nextjs/package.json +54 -1
- package/lib/__templates__/nextjs/pnpm-lock.yaml +7947 -1523
- package/lib/__templates__/nextjs/scripts/dev.sh +9 -27
- package/lib/__templates__/nextjs/src/app/globals.css +114 -11
- package/lib/__templates__/nextjs/src/app/layout.tsx +18 -18
- package/lib/__templates__/nextjs/src/components/ui/accordion.tsx +66 -0
- package/lib/__templates__/nextjs/src/components/ui/alert-dialog.tsx +157 -0
- package/lib/__templates__/nextjs/src/components/ui/alert.tsx +66 -0
- package/lib/__templates__/nextjs/src/components/ui/aspect-ratio.tsx +11 -0
- package/lib/__templates__/nextjs/src/components/ui/avatar.tsx +53 -0
- package/lib/__templates__/nextjs/src/components/ui/badge.tsx +46 -0
- package/lib/__templates__/nextjs/src/components/ui/breadcrumb.tsx +109 -0
- package/lib/__templates__/nextjs/src/components/ui/button-group.tsx +83 -0
- package/lib/__templates__/nextjs/src/components/ui/button.tsx +62 -0
- package/lib/__templates__/nextjs/src/components/ui/calendar.tsx +220 -0
- package/lib/__templates__/nextjs/src/components/ui/card.tsx +92 -0
- package/lib/__templates__/nextjs/src/components/ui/carousel.tsx +241 -0
- package/lib/__templates__/nextjs/src/components/ui/chart.tsx +357 -0
- package/lib/__templates__/nextjs/src/components/ui/checkbox.tsx +32 -0
- package/lib/__templates__/nextjs/src/components/ui/collapsible.tsx +33 -0
- package/lib/__templates__/nextjs/src/components/ui/command.tsx +184 -0
- package/lib/__templates__/nextjs/src/components/ui/context-menu.tsx +252 -0
- package/lib/__templates__/nextjs/src/components/ui/dialog.tsx +143 -0
- package/lib/__templates__/nextjs/src/components/ui/drawer.tsx +135 -0
- package/lib/__templates__/nextjs/src/components/ui/dropdown-menu.tsx +257 -0
- package/lib/__templates__/nextjs/src/components/ui/empty.tsx +104 -0
- package/lib/__templates__/nextjs/src/components/ui/field.tsx +248 -0
- package/lib/__templates__/nextjs/src/components/ui/form.tsx +167 -0
- package/lib/__templates__/nextjs/src/components/ui/hover-card.tsx +44 -0
- package/lib/__templates__/nextjs/src/components/ui/input-group.tsx +170 -0
- package/lib/__templates__/nextjs/src/components/ui/input-otp.tsx +77 -0
- package/lib/__templates__/nextjs/src/components/ui/input.tsx +21 -0
- package/lib/__templates__/nextjs/src/components/ui/item.tsx +193 -0
- package/lib/__templates__/nextjs/src/components/ui/kbd.tsx +28 -0
- package/lib/__templates__/nextjs/src/components/ui/label.tsx +24 -0
- package/lib/__templates__/nextjs/src/components/ui/menubar.tsx +276 -0
- package/lib/__templates__/nextjs/src/components/ui/navigation-menu.tsx +168 -0
- package/lib/__templates__/nextjs/src/components/ui/pagination.tsx +127 -0
- package/lib/__templates__/nextjs/src/components/ui/popover.tsx +48 -0
- package/lib/__templates__/nextjs/src/components/ui/progress.tsx +31 -0
- package/lib/__templates__/nextjs/src/components/ui/radio-group.tsx +45 -0
- package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +56 -0
- package/lib/__templates__/nextjs/src/components/ui/scroll-area.tsx +58 -0
- package/lib/__templates__/nextjs/src/components/ui/select.tsx +190 -0
- package/lib/__templates__/nextjs/src/components/ui/separator.tsx +28 -0
- package/lib/__templates__/nextjs/src/components/ui/sheet.tsx +139 -0
- package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +726 -0
- package/lib/__templates__/nextjs/src/components/ui/skeleton.tsx +13 -0
- package/lib/__templates__/nextjs/src/components/ui/slider.tsx +63 -0
- package/lib/__templates__/nextjs/src/components/ui/sonner.tsx +40 -0
- package/lib/__templates__/nextjs/src/components/ui/spinner.tsx +16 -0
- package/lib/__templates__/nextjs/src/components/ui/switch.tsx +31 -0
- package/lib/__templates__/nextjs/src/components/ui/table.tsx +116 -0
- package/lib/__templates__/nextjs/src/components/ui/tabs.tsx +66 -0
- package/lib/__templates__/nextjs/src/components/ui/textarea.tsx +18 -0
- package/lib/__templates__/nextjs/src/components/ui/toggle-group.tsx +83 -0
- package/lib/__templates__/nextjs/src/components/ui/toggle.tsx +47 -0
- package/lib/__templates__/nextjs/src/components/ui/tooltip.tsx +61 -0
- package/lib/__templates__/nextjs/src/hooks/use-mobile.ts +19 -0
- package/lib/__templates__/nextjs/src/lib/utils.ts +6 -0
- package/lib/__templates__/nextjs/template.config.js +2 -2
- package/lib/__templates__/templates.json +6 -37
- package/lib/__templates__/vite/.coze +3 -3
- package/lib/__templates__/vite/README.md +204 -26
- package/lib/__templates__/vite/_npmrc +1 -1
- package/lib/__templates__/vite/package.json +1 -1
- package/lib/__templates__/vite/pnpm-lock.yaml +120 -120
- package/lib/__templates__/vite/scripts/dev.sh +7 -26
- package/lib/__templates__/vite/template.config.js +11 -2
- package/lib/__templates__/vite/vite.config.ts +3 -3
- package/lib/cli.js +426 -249
- package/package.json +7 -4
- 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/app/+not-found.tsx +0 -79
- package/lib/__templates__/expo/client/contexts/AuthContext.tsx +0 -142
- package/lib/__templates__/expo/client/index.js +0 -12
- package/lib/__templates__/expo/client/screens/home/styles.ts +0 -332
- package/lib/__templates__/expo/metro.config.js +0 -53
- package/lib/__templates__/react-rsbuild/.coze +0 -11
- package/lib/__templates__/react-rsbuild/.vscode/settings.json +0 -121
- package/lib/__templates__/react-rsbuild/README.md +0 -61
- package/lib/__templates__/react-rsbuild/_gitignore +0 -97
- package/lib/__templates__/react-rsbuild/_npmrc +0 -22
- package/lib/__templates__/react-rsbuild/package.json +0 -31
- package/lib/__templates__/react-rsbuild/pnpm-lock.yaml +0 -997
- package/lib/__templates__/react-rsbuild/rsbuild.config.ts +0 -13
- package/lib/__templates__/react-rsbuild/scripts/build.sh +0 -14
- package/lib/__templates__/react-rsbuild/scripts/dev.sh +0 -51
- package/lib/__templates__/react-rsbuild/scripts/start.sh +0 -15
- package/lib/__templates__/react-rsbuild/src/App.tsx +0 -60
- package/lib/__templates__/react-rsbuild/src/index.css +0 -21
- package/lib/__templates__/react-rsbuild/src/index.html +0 -12
- package/lib/__templates__/react-rsbuild/src/index.tsx +0 -16
- package/lib/__templates__/react-rsbuild/tailwind.config.js +0 -9
- package/lib/__templates__/react-rsbuild/template.config.js +0 -54
- package/lib/__templates__/react-rsbuild/tsconfig.json +0 -17
- package/lib/__templates__/rsbuild/.coze +0 -11
- package/lib/__templates__/rsbuild/.vscode/settings.json +0 -7
- package/lib/__templates__/rsbuild/README.md +0 -61
- package/lib/__templates__/rsbuild/_gitignore +0 -97
- package/lib/__templates__/rsbuild/_npmrc +0 -22
- package/lib/__templates__/rsbuild/package.json +0 -24
- package/lib/__templates__/rsbuild/pnpm-lock.yaml +0 -888
- package/lib/__templates__/rsbuild/rsbuild.config.ts +0 -12
- package/lib/__templates__/rsbuild/scripts/build.sh +0 -14
- package/lib/__templates__/rsbuild/scripts/dev.sh +0 -51
- package/lib/__templates__/rsbuild/scripts/start.sh +0 -15
- package/lib/__templates__/rsbuild/src/index.css +0 -21
- package/lib/__templates__/rsbuild/src/index.html +0 -12
- package/lib/__templates__/rsbuild/src/index.ts +0 -5
- package/lib/__templates__/rsbuild/src/main.ts +0 -65
- package/lib/__templates__/rsbuild/tailwind.config.js +0 -9
- package/lib/__templates__/rsbuild/template.config.js +0 -56
- package/lib/__templates__/rsbuild/tsconfig.json +0 -16
- /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/{hooks → src/hooks}/useColorScheme.ts +0 -0
|
@@ -18,7 +18,7 @@ try {
|
|
|
18
18
|
try {
|
|
19
19
|
depcheckOutput = execSync('npx depcheck --json', {
|
|
20
20
|
encoding: 'utf-8',
|
|
21
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
21
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
22
22
|
});
|
|
23
23
|
} catch (execError) {
|
|
24
24
|
// depcheck 返回非零退出码时仍然有输出
|
|
@@ -30,10 +30,34 @@ try {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const result = JSON.parse(depcheckOutput);
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
// 获取缺失的依赖
|
|
35
35
|
const missing = result.missing || {};
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
// 需要忽略的文件模式
|
|
38
|
+
const ignoreFilePatterns = [
|
|
39
|
+
/template\.config\.(ts|js)$/, // 模板配置文件
|
|
40
|
+
/\.template\./, // 其他模板文件
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
// 过滤包:排除内部别名和只被模板文件引用的包
|
|
44
|
+
const missingPackages = Object.keys(missing).filter(pkg => {
|
|
45
|
+
// 排除内部路径别名
|
|
46
|
+
if (pkg.startsWith('@api/') || pkg.startsWith('@/') || pkg === '@api') {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 获取引用该包的文件列表
|
|
51
|
+
const referencingFiles = missing[pkg] || [];
|
|
52
|
+
|
|
53
|
+
// 过滤掉模板配置文件
|
|
54
|
+
const nonTemplateFiles = referencingFiles.filter(file => {
|
|
55
|
+
return !ignoreFilePatterns.some(pattern => pattern.test(file));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// 只有当存在非模板文件引用时才保留该包
|
|
59
|
+
return nonTemplateFiles.length > 0;
|
|
60
|
+
});
|
|
37
61
|
|
|
38
62
|
if (missingPackages.length === 0) {
|
|
39
63
|
console.log('✅ 没有发现缺失的依赖!');
|
|
@@ -44,30 +68,31 @@ try {
|
|
|
44
68
|
missingPackages.forEach((pkg, index) => {
|
|
45
69
|
const files = missing[pkg];
|
|
46
70
|
console.log(` ${index + 1}. ${pkg}`);
|
|
47
|
-
console.log(
|
|
71
|
+
console.log(
|
|
72
|
+
` 被引用于: ${files.slice(0, 2).join(', ')}${files.length > 2 ? ' ...' : ''}`,
|
|
73
|
+
);
|
|
48
74
|
});
|
|
49
75
|
|
|
50
76
|
console.log('\n🚀 开始安装...\n');
|
|
51
77
|
|
|
52
78
|
// 使用 expo install 安装所有缺失的包
|
|
53
79
|
const packagesToInstall = missingPackages.join(' ');
|
|
54
|
-
|
|
80
|
+
|
|
55
81
|
try {
|
|
56
82
|
execSync(`pnpm expo install ${packagesToInstall}`, {
|
|
57
|
-
stdio: 'inherit'
|
|
83
|
+
stdio: 'inherit',
|
|
58
84
|
});
|
|
59
|
-
|
|
85
|
+
|
|
60
86
|
console.log('\n✅ 所有缺失的依赖已安装完成!');
|
|
61
87
|
} catch (installError) {
|
|
62
88
|
console.log('\n⚠️ expo install 失败,尝试使用 npm install...\n');
|
|
63
|
-
|
|
89
|
+
|
|
64
90
|
execSync(`npm install ${packagesToInstall}`, {
|
|
65
|
-
stdio: 'inherit'
|
|
91
|
+
stdio: 'inherit',
|
|
66
92
|
});
|
|
67
|
-
|
|
93
|
+
|
|
68
94
|
console.log('\n✅ 所有缺失的依赖已通过 npm 安装完成!');
|
|
69
95
|
}
|
|
70
|
-
|
|
71
96
|
} catch (error) {
|
|
72
97
|
if (error.message.includes('depcheck')) {
|
|
73
98
|
console.error('❌ depcheck 未安装或运行失败');
|
|
@@ -77,4 +102,3 @@ try {
|
|
|
77
102
|
}
|
|
78
103
|
process.exit(1);
|
|
79
104
|
}
|
|
80
|
-
|
|
@@ -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
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* 通用认证上下文
|
|
4
|
+
*
|
|
5
|
+
* 基于固定的 API 接口实现,可复用到其他项目
|
|
6
|
+
* 其他项目使用时,只需修改 @api 的导入路径指向项目的 api 模块
|
|
7
|
+
*
|
|
8
|
+
* 注意:
|
|
9
|
+
* - 如果需要登录/鉴权场景,请扩展本文件,完善 login/logout、token 管理、用户信息获取与刷新等逻辑
|
|
10
|
+
* - 将示例中的占位实现替换为项目实际的接口调用与状态管理
|
|
11
|
+
*/
|
|
12
|
+
import React, { createContext, useContext, ReactNode } from "react";
|
|
13
|
+
|
|
14
|
+
interface UserOut {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface AuthContextType {
|
|
19
|
+
user: UserOut | null;
|
|
20
|
+
token: string | null;
|
|
21
|
+
isAuthenticated: boolean;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
login: (token: string) => Promise<void>;
|
|
24
|
+
logout: () => Promise<void>;
|
|
25
|
+
updateUser: (userData: Partial<UserOut>) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
|
29
|
+
|
|
30
|
+
export const AuthProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
|
|
31
|
+
const value: AuthContextType = {
|
|
32
|
+
user: null,
|
|
33
|
+
token: null,
|
|
34
|
+
isAuthenticated: false,
|
|
35
|
+
isLoading: false,
|
|
36
|
+
login: async (token: string) => {},
|
|
37
|
+
logout: async () => {},
|
|
38
|
+
updateUser: () => {},
|
|
39
|
+
};
|
|
40
|
+
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const useAuth = (): AuthContextType => {
|
|
44
|
+
const context = useContext(AuthContext);
|
|
45
|
+
if (context === undefined) {
|
|
46
|
+
throw new Error("useAuth must be used within an AuthProvider");
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
};
|
|
@@ -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,
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
5
5
|
ScrollView,
|
|
6
|
-
TouchableOpacity,
|
|
7
6
|
RefreshControl,
|
|
8
|
-
Image,
|
|
9
|
-
ActivityIndicator,
|
|
10
7
|
} from 'react-native';
|
|
11
8
|
import { useRouter, useFocusEffect } from 'expo-router';
|
|
12
9
|
import { FontAwesome6 } from '@expo/vector-icons';
|
|
@@ -15,8 +12,7 @@ import { useTheme } from "@/hooks/useTheme";
|
|
|
15
12
|
|
|
16
13
|
import { Screen } from '@/components/Screen';
|
|
17
14
|
|
|
18
|
-
import styles from './styles';
|
|
19
|
-
|
|
15
|
+
import { styles } from './styles';
|
|
20
16
|
|
|
21
17
|
export default function HomeScreen() {
|
|
22
18
|
const insets = useSafeAreaInsets();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { StyleSheet, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const styles = StyleSheet.create({
|
|
4
|
+
loadingContainer: {
|
|
5
|
+
flex: 1,
|
|
6
|
+
justifyContent: 'center',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
},
|
|
9
|
+
loadingText: {
|
|
10
|
+
marginTop: 12,
|
|
11
|
+
fontSize: 14,
|
|
12
|
+
color: '#64748B',
|
|
13
|
+
},
|
|
14
|
+
errorContainer: {
|
|
15
|
+
flex: 1,
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
paddingHorizontal: 24,
|
|
19
|
+
},
|
|
20
|
+
errorText: {
|
|
21
|
+
marginTop: 16,
|
|
22
|
+
fontSize: 16,
|
|
23
|
+
color: '#64748B',
|
|
24
|
+
},
|
|
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
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
logoText: {
|
|
55
|
+
fontSize: 18,
|
|
56
|
+
fontWeight: '700',
|
|
57
|
+
color: '#1E293B',
|
|
58
|
+
letterSpacing: -0.5,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// import { OpenAPI } from '@api'; // 如果使用 openapi 客户端,请取消注释并确保安装
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
2
|
import utc from 'dayjs/plugin/utc';
|
|
4
3
|
dayjs.extend(utc);
|
|
@@ -26,7 +25,7 @@ export const buildAssetUrl = (url?: string | null, w?: number, h?: number): stri
|
|
|
26
25
|
// 3. 构造参数,保留原有 Query (如有)
|
|
27
26
|
const separator = abs.includes('?') ? '&' : '?';
|
|
28
27
|
const query = [
|
|
29
|
-
w ? `w=${Math.floor(w)}` : '',
|
|
28
|
+
w ? `w=${Math.floor(w)}` : '',
|
|
30
29
|
h ? `h=${Math.floor(h)}` : ''
|
|
31
30
|
].filter(Boolean).join('&');
|
|
32
31
|
return `${abs}${separator}${query}`;
|
|
@@ -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,24 +1,23 @@
|
|
|
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
|
-
"
|
|
7
|
+
"dev": "bash .cozeproj/scripts/dev_run.sh",
|
|
8
|
+
"build": "bash .cozeproj/scripts/prod_build.sh",
|
|
9
|
+
"start": "bash .cozeproj/scripts/prod_run.sh",
|
|
8
10
|
"check-deps": "npx depcheck",
|
|
9
|
-
"dev": "bash .cozeproj/scripts/deploy_run.sh",
|
|
10
|
-
"install-missing": "node ./client/scripts/install-missing-deps.js",
|
|
11
|
-
"lint": "expo lint",
|
|
12
11
|
"preinstall": "npx only-allow pnpm",
|
|
13
|
-
"
|
|
14
|
-
"server": "NODE_ENV=development tsx ./src/index.ts",
|
|
15
|
-
"start": "expo start --web",
|
|
12
|
+
"lint": "expo lint",
|
|
16
13
|
"test": "jest --watchAll"
|
|
17
14
|
},
|
|
18
15
|
"jest": {
|
|
19
16
|
"preset": "jest-expo"
|
|
20
17
|
},
|
|
21
18
|
"dependencies": {
|
|
19
|
+
"@aws-sdk/client-s3": "^3.958.0",
|
|
20
|
+
"@aws-sdk/lib-storage": "^3.958.0",
|
|
22
21
|
"@expo/metro-runtime": "^6.1.2",
|
|
23
22
|
"@expo/vector-icons": "^15.0.0",
|
|
24
23
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
@@ -30,8 +29,14 @@
|
|
|
30
29
|
"@react-navigation/native": "^7.0.14",
|
|
31
30
|
"ajv": "^8.17.1",
|
|
32
31
|
"ajv-formats": "^3.0.1",
|
|
33
|
-
"
|
|
32
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
33
|
+
"babel-preset-expo": "^54.0.9",
|
|
34
|
+
"connect": "^3.7.0",
|
|
35
|
+
"coze-coding-dev-sdk": "^0.5.5",
|
|
34
36
|
"dayjs": "^1.11.19",
|
|
37
|
+
"drizzle-kit": "^0.31.8",
|
|
38
|
+
"drizzle-orm": "^0.45.1",
|
|
39
|
+
"drizzle-zod": "^0.8.3",
|
|
35
40
|
"expo": "^54.0.7",
|
|
36
41
|
"expo-auth-session": "^7.0.9",
|
|
37
42
|
"expo-av": "~16.0.6",
|
|
@@ -52,6 +57,9 @@
|
|
|
52
57
|
"expo-system-ui": "~6.0.9",
|
|
53
58
|
"expo-web-browser": "~15.0.10",
|
|
54
59
|
"express": "^4.22.1",
|
|
60
|
+
"http-proxy-middleware": "^3.0.5",
|
|
61
|
+
"multer": "^2.0.2",
|
|
62
|
+
"pg": "^8.16.3",
|
|
55
63
|
"react": "19.1.0",
|
|
56
64
|
"react-dom": "19.1.0",
|
|
57
65
|
"react-native": "0.81.5",
|
|
@@ -74,13 +82,14 @@
|
|
|
74
82
|
"@eslint/js": "^9.27.0",
|
|
75
83
|
"@types/express": "^5.0.6",
|
|
76
84
|
"@types/jest": "^29.5.12",
|
|
85
|
+
"@types/multer": "^2.0.0",
|
|
86
|
+
"@types/pg": "^8.16.0",
|
|
77
87
|
"@types/react": "~19.1.0",
|
|
78
88
|
"@types/react-test-renderer": "19.1.0",
|
|
79
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
80
|
-
"babel-preset-expo": "^54.0.9",
|
|
81
89
|
"chalk": "^4.1.2",
|
|
82
90
|
"depcheck": "^1.4.7",
|
|
83
|
-
"
|
|
91
|
+
"esbuild": "0.27.2",
|
|
92
|
+
"eslint": "^9.39.2",
|
|
84
93
|
"eslint-formatter-compact": "^9.0.1",
|
|
85
94
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
86
95
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -98,5 +107,10 @@
|
|
|
98
107
|
"packageManager": "pnpm@9.0.0",
|
|
99
108
|
"engines": {
|
|
100
109
|
"pnpm": ">=9.0.0"
|
|
110
|
+
},
|
|
111
|
+
"pnpm": {
|
|
112
|
+
"overrides": {
|
|
113
|
+
"esbuild": "0.27.2"
|
|
114
|
+
}
|
|
101
115
|
}
|
|
102
116
|
}
|