@coze-arch/cli 0.0.1-alpha.dffbaa → 0.0.1-alpha.f9be02

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 (56) hide show
  1. package/lib/__templates__/expo/.coze +7 -2
  2. package/lib/__templates__/expo/.cozeproj/scripts/{deploy_build.sh → dev_build.sh} +0 -7
  3. package/lib/__templates__/expo/.cozeproj/scripts/{deploy_run.sh → dev_run.sh} +22 -22
  4. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +47 -0
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +34 -0
  6. package/lib/__templates__/expo/_gitignore +1 -1
  7. package/lib/__templates__/expo/_npmrc +2 -4
  8. package/lib/__templates__/expo/client/app.config.ts +71 -0
  9. package/lib/__templates__/expo/client/metro.config.js +121 -0
  10. package/lib/__templates__/expo/client/package.json +92 -0
  11. package/lib/__templates__/expo/client/src/app/index.ts +1 -0
  12. package/lib/__templates__/expo/client/src/components/ThemedText.tsx +33 -0
  13. package/lib/__templates__/expo/client/src/components/ThemedView.tsx +38 -0
  14. package/lib/__templates__/expo/client/src/constants/theme.ts +850 -0
  15. package/lib/__templates__/expo/client/{hooks → src/hooks}/useTheme.ts +1 -1
  16. package/lib/__templates__/expo/client/{screens → src/screens}/home/index.tsx +0 -1
  17. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  18. package/lib/__templates__/expo/package.json +16 -12
  19. package/lib/__templates__/expo/pnpm-lock.yaml +299 -514
  20. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  21. package/lib/__templates__/expo/server/package.json +17 -0
  22. package/lib/__templates__/expo/tsconfig.json +1 -24
  23. package/lib/__templates__/nextjs/src/app/globals.css +99 -87
  24. package/lib/__templates__/vite/package.json +1 -1
  25. package/lib/__templates__/vite/pnpm-lock.yaml +120 -120
  26. package/lib/cli.js +1 -1
  27. package/package.json +5 -2
  28. package/lib/__templates__/expo/app.json +0 -63
  29. package/lib/__templates__/expo/babel.config.js +0 -9
  30. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  31. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  32. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  33. package/lib/__templates__/expo/client/app/+not-found.tsx +0 -79
  34. package/lib/__templates__/expo/client/constants/theme.ts +0 -118
  35. package/lib/__templates__/expo/client/index.js +0 -12
  36. package/lib/__templates__/expo/metro.config.js +0 -53
  37. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
  38. /package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +0 -0
  39. /package/lib/__templates__/expo/client/{app → src/app}/_layout.tsx +0 -0
  40. /package/lib/__templates__/expo/client/{assets → src/assets}/fonts/SpaceMono-Regular.ttf +0 -0
  41. /package/lib/__templates__/expo/client/{assets → src/assets}/images/adaptive-icon.png +0 -0
  42. /package/lib/__templates__/expo/client/{assets → src/assets}/images/default-avatar.png +0 -0
  43. /package/lib/__templates__/expo/client/{assets → src/assets}/images/favicon.png +0 -0
  44. /package/lib/__templates__/expo/client/{assets → src/assets}/images/icon.png +0 -0
  45. /package/lib/__templates__/expo/client/{assets → src/assets}/images/partial-react-logo.png +0 -0
  46. /package/lib/__templates__/expo/client/{assets → src/assets}/images/react-logo.png +0 -0
  47. /package/lib/__templates__/expo/client/{assets → src/assets}/images/react-logo@2x.png +0 -0
  48. /package/lib/__templates__/expo/client/{assets → src/assets}/images/react-logo@3x.png +0 -0
  49. /package/lib/__templates__/expo/client/{assets → src/assets}/images/splash-icon.png +0 -0
  50. /package/lib/__templates__/expo/client/{components → src/components}/Screen.tsx +0 -0
  51. /package/lib/__templates__/expo/client/{components → src/components}/SmartDateInput.tsx +0 -0
  52. /package/lib/__templates__/expo/client/{contexts → src/contexts}/AuthContext.tsx +0 -0
  53. /package/lib/__templates__/expo/client/{hooks → src/hooks}/useColorScheme.ts +0 -0
  54. /package/lib/__templates__/expo/client/{screens → src/screens}/home/styles.ts +0 -0
  55. /package/lib/__templates__/expo/client/{utils → src/utils}/index.ts +0 -0
  56. /package/lib/__templates__/expo/{src → server/src}/index.ts +0 -0
@@ -1,79 +0,0 @@
1
- import { useRouter } from 'expo-router';
2
- import { StyleSheet, View, Text, Pressable, Platform } from 'react-native';
3
-
4
- export default function NotFoundScreen() {
5
- const router = useRouter();
6
-
7
- const goBack = () => {
8
- if (router.canGoBack()) {
9
- router.back();
10
- }
11
- };
12
-
13
- return (
14
- <View style={styles.container}>
15
- <Text style={styles.heading}>404</Text>
16
- <Text style={styles.textStyle}>页面未找到</Text>
17
- <Text style={styles.subTextStyle}>
18
- 抱歉!您访问的页面不存在,当前页面功能待完善。
19
- </Text>
20
- <Pressable onPress={goBack} style={styles.button}>
21
- <Text style={styles.buttonText}>返回上一页</Text>
22
- </Pressable>
23
- </View>
24
- );
25
- }
26
-
27
- const styles = StyleSheet.create({
28
- container: {
29
- flex: 1,
30
- alignItems: 'center',
31
- justifyContent: 'center',
32
- backgroundColor: '#f3f5ff',
33
- padding: 16,
34
- },
35
- heading: {
36
- fontSize: 120,
37
- fontWeight: '900',
38
- color: '#4a5568',
39
- textShadowColor: 'rgba(0, 0, 0, 0.05)',
40
- textShadowOffset: { width: 0, height: 4 },
41
- textShadowRadius: 8,
42
- },
43
- textStyle: {
44
- fontSize: 24,
45
- fontWeight: '500',
46
- marginTop: -16,
47
- marginBottom: 16,
48
- color: '#4a5568',
49
- },
50
- subTextStyle: {
51
- fontSize: 16,
52
- color: '#718096',
53
- marginBottom: 32,
54
- maxWidth: 400,
55
- textAlign: 'center',
56
- },
57
- button: {
58
- paddingVertical: 12,
59
- paddingHorizontal: 24,
60
- backgroundColor: '#6366f1',
61
- borderRadius: 9999,
62
- ...Platform.select({
63
- ios: {
64
- shadowColor: 'rgba(0, 0, 0, 0.1)',
65
- shadowOffset: { width: 0, height: 10 },
66
- shadowOpacity: 1,
67
- shadowRadius: 15,
68
- },
69
- android: {
70
- elevation: 5,
71
- },
72
- }),
73
- },
74
- buttonText: {
75
- fontSize: 16,
76
- fontWeight: '600',
77
- color: '#ffffff',
78
- },
79
- });
@@ -1,118 +0,0 @@
1
- import { Platform } from "react-native";
2
-
3
- const tintColorLight = "#007AFF";
4
- const tintColorDark = "#0A84FF";
5
-
6
- export const Colors = {
7
- light: {
8
- text: "#11181C",
9
- buttonText: "#FFFFFF",
10
- tabIconDefault: "#687076",
11
- tabIconSelected: tintColorLight,
12
- link: "#007AFF",
13
- backgroundRoot: "#FFFFFF", // Elevation 0
14
- backgroundDefault: "#F2F2F2", // Elevation 1
15
- backgroundSecondary: "#E6E6E6", // Elevation 2
16
- backgroundTertiary: "#D9D9D9", // Elevation 3
17
- },
18
- dark: {
19
- text: "#ECEDEE",
20
- buttonText: "#FFFFFF",
21
- tabIconDefault: "#9BA1A6",
22
- tabIconSelected: tintColorDark,
23
- link: "#0A84FF",
24
- backgroundRoot: "#1F2123", // Elevation 0
25
- backgroundDefault: "#2A2C2E", // Elevation 1
26
- backgroundSecondary: "#353739", // Elevation 2
27
- backgroundTertiary: "#404244", // Elevation 3
28
- },
29
- };
30
-
31
- export const Spacing = {
32
- xs: 4,
33
- sm: 8,
34
- md: 12,
35
- lg: 16,
36
- xl: 20,
37
- "2xl": 24,
38
- "3xl": 32,
39
- "4xl": 40,
40
- "5xl": 48,
41
- inputHeight: 48,
42
- buttonHeight: 52,
43
- };
44
-
45
- export const BorderRadius = {
46
- xs: 8,
47
- sm: 12,
48
- md: 18,
49
- lg: 24,
50
- xl: 30,
51
- "2xl": 40,
52
- "3xl": 50,
53
- full: 9999,
54
- };
55
-
56
- export const Typography = {
57
- h1: {
58
- fontSize: 32,
59
- lineHeight: 40,
60
- fontWeight: "700" as const,
61
- },
62
- h2: {
63
- fontSize: 28,
64
- lineHeight: 36,
65
- fontWeight: "700" as const,
66
- },
67
- h3: {
68
- fontSize: 24,
69
- lineHeight: 32,
70
- fontWeight: "600" as const,
71
- },
72
- h4: {
73
- fontSize: 20,
74
- lineHeight: 28,
75
- fontWeight: "600" as const,
76
- },
77
- body: {
78
- fontSize: 16,
79
- lineHeight: 24,
80
- fontWeight: "400" as const,
81
- },
82
- small: {
83
- fontSize: 14,
84
- lineHeight: 20,
85
- fontWeight: "400" as const,
86
- },
87
- link: {
88
- fontSize: 16,
89
- lineHeight: 24,
90
- fontWeight: "400" as const,
91
- },
92
- };
93
-
94
- export const Fonts = Platform.select({
95
- ios: {
96
- /** iOS `UIFontDescriptorSystemDesignDefault` */
97
- sans: "system-ui",
98
- /** iOS `UIFontDescriptorSystemDesignSerif` */
99
- serif: "ui-serif",
100
- /** iOS `UIFontDescriptorSystemDesignRounded` */
101
- rounded: "ui-rounded",
102
- /** iOS `UIFontDescriptorSystemDesignMonospaced` */
103
- mono: "ui-monospace",
104
- },
105
- default: {
106
- sans: "normal",
107
- serif: "serif",
108
- rounded: "normal",
109
- mono: "monospace",
110
- },
111
- web: {
112
- sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
113
- serif: "Georgia, 'Times New Roman', serif",
114
- rounded:
115
- "'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif",
116
- mono: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
117
- },
118
- });
@@ -1,12 +0,0 @@
1
- import '@expo/metro-runtime';
2
- import { registerRootComponent } from 'expo';
3
- import { ExpoRoot } from 'expo-router';
4
-
5
- // 显式定义 App 组件
6
- export function App() {
7
- // eslint-disable-next-line no-undef
8
- const ctx = require.context('./app');
9
- return <ExpoRoot context={ctx} />;
10
- }
11
-
12
- registerRootComponent(App);
@@ -1,53 +0,0 @@
1
- const { getDefaultConfig } = require('expo/metro-config');
2
- // const { createProxyMiddleware } = require('http-proxy-middleware');
3
- const connect = require('connect');
4
-
5
- const config = getDefaultConfig(__dirname);
6
-
7
- // 安全地获取 Expo 的默认排除列表
8
- const existingBlockList = [].concat(config.resolver.blockList || []);
9
-
10
- config.resolver.blockList = [
11
- ...existingBlockList,
12
- /.*\/\.expo\/.*/, // Expo 的缓存和构建产物目录
13
-
14
- // 1. 原生代码 (Java/C++/Objective-C)
15
- /.*\/react-native\/ReactAndroid\/.*/,
16
- /.*\/react-native\/ReactCommon\/.*/,
17
-
18
- // 2. 纯开发和调试工具
19
- // 这些工具只在开发电脑上运行,不会被打包到应用中
20
- /.*\/@typescript-eslint\/eslint-plugin\/.*/,
21
-
22
- // 3. 构建时数据
23
- // 这个数据库只在打包过程中使用,应用运行时不需要
24
- /.*\/caniuse-lite\/data\/.*/,
25
-
26
- // 4. 通用规则
27
- /.*\/__tests__\/.*/, // 排除所有测试目录
28
- /.*\.git\/.*/, // 排除 Git 目录
29
- ];
30
-
31
- /*
32
- const apiProxy = createProxyMiddleware({
33
- target: 'http://localhost:5000',
34
- logLevel: 'debug',
35
- });
36
-
37
- config.server = {
38
- ...config.server,
39
- enhanceMiddleware: (metroMiddleware, metroServer) => {
40
- return connect()
41
- .use((req, res, next) => {
42
- if (req.url && req.url.startsWith('/api')) {
43
- console.log(`[Metro Proxy] Forwarding ${req.method} ${req.url}`);
44
- return apiProxy(req, res, next);
45
- }
46
- next();
47
- })
48
- .use(metroMiddleware);
49
- },
50
- }
51
- */
52
-
53
- module.exports = config;