@coze-arch/cli 0.0.1-alpha.1fb1dc → 0.0.1-alpha.26ae16

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 (48) 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/README.md +41 -12
  7. package/lib/__templates__/expo/_gitignore +1 -1
  8. package/lib/__templates__/expo/_npmrc +2 -4
  9. package/lib/__templates__/expo/client/app/_layout.tsx +1 -1
  10. package/lib/__templates__/expo/client/app/index.ts +1 -0
  11. package/lib/__templates__/expo/client/app.config.ts +71 -0
  12. package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
  13. package/lib/__templates__/expo/client/components/ThemedView.tsx +38 -0
  14. package/lib/__templates__/expo/client/constants/theme.ts +779 -47
  15. package/lib/__templates__/expo/client/hooks/useTheme.ts +1 -1
  16. package/lib/__templates__/expo/client/metro.config.js +121 -0
  17. package/lib/__templates__/expo/client/package.json +92 -0
  18. package/lib/__templates__/expo/client/screens/home/index.tsx +0 -1
  19. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  20. package/lib/__templates__/expo/package.json +16 -12
  21. package/lib/__templates__/expo/pnpm-lock.yaml +299 -514
  22. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  23. package/lib/__templates__/expo/server/package.json +17 -0
  24. package/lib/__templates__/expo/tsconfig.json +1 -24
  25. package/lib/__templates__/nextjs/package.json +1 -1
  26. package/lib/__templates__/nextjs/pnpm-lock.yaml +5 -5
  27. package/lib/__templates__/nextjs/scripts/dev.sh +7 -26
  28. package/lib/__templates__/nextjs/src/app/globals.css +99 -87
  29. package/lib/__templates__/nextjs/src/app/layout.tsx +18 -18
  30. package/lib/__templates__/templates.json +7 -0
  31. package/lib/__templates__/vite/package.json +1 -1
  32. package/lib/__templates__/vite/pnpm-lock.yaml +120 -120
  33. package/lib/__templates__/vite/scripts/dev.sh +7 -26
  34. package/lib/__templates__/vite/template.config.js +11 -2
  35. package/lib/__templates__/vite/vite.config.ts +3 -3
  36. package/lib/cli.js +1 -1
  37. package/package.json +5 -2
  38. package/lib/__templates__/expo/app.json +0 -63
  39. package/lib/__templates__/expo/babel.config.js +0 -9
  40. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  41. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  42. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  43. package/lib/__templates__/expo/client/app/+not-found.tsx +0 -79
  44. package/lib/__templates__/expo/client/index.js +0 -12
  45. package/lib/__templates__/expo/metro.config.js +0 -53
  46. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
  47. /package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +0 -0
  48. /package/lib/__templates__/expo/{src → server/src}/index.ts +0 -0
@@ -1,9 +0,0 @@
1
- module.exports = function (api) {
2
- api.cache(true);
3
- return {
4
- presets: ["babel-preset-expo"],
5
- plugins: [
6
- "react-native-reanimated/plugin",
7
- ],
8
- };
9
- };
@@ -1,43 +0,0 @@
1
- import { Tabs } from 'expo-router';
2
- import { FontAwesome6 } from '@expo/vector-icons';
3
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
- import { useTheme } from '@/hooks/useTheme';
5
-
6
- export default function TabLayout() {
7
- const insets = useSafeAreaInsets();
8
- const { theme } = useTheme();
9
- const tabBarHeight = 56 + Math.max(insets.bottom, 8);
10
-
11
- return (
12
- <Tabs
13
- backBehavior='history'
14
- screenOptions={{
15
- headerShown: false,
16
- tabBarActiveTintColor: theme.tabIconSelected,
17
- tabBarInactiveTintColor: theme.tabIconDefault,
18
- tabBarStyle: {
19
- backgroundColor: theme.backgroundRoot,
20
- borderTopColor: theme.backgroundSecondary,
21
- borderTopWidth: 1,
22
- height: tabBarHeight,
23
- paddingBottom: Math.max(insets.bottom, 8),
24
- paddingTop: 6,
25
- },
26
- }}
27
- >
28
- <Tabs.Screen
29
- name='index'
30
- options={{ href: null }}
31
- />
32
- <Tabs.Screen
33
- name='home'
34
- options={{
35
- title: '首页',
36
- tabBarIcon: ({ color }) => (
37
- <FontAwesome6 name='house' size={20} color={color} />
38
- ),
39
- }}
40
- />
41
- </Tabs>
42
- );
43
- }
@@ -1 +0,0 @@
1
- export { default } from "@/screens/home";
@@ -1,7 +0,0 @@
1
- import { Redirect } from 'expo-router';
2
-
3
- const Index = () => {
4
- return <Redirect href="./home" relativeToDirectory />;
5
- };
6
-
7
- export default Index;
@@ -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,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;