@coze-arch/cli 0.0.1-alpha.912cd5 → 0.0.1-alpha.934b8f

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 (134) hide show
  1. package/lib/__templates__/expo/.coze +7 -2
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +46 -0
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +229 -0
  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/.cozeproj/scripts/server_dev_run.sh +46 -0
  7. package/lib/__templates__/expo/README.md +68 -7
  8. package/lib/__templates__/expo/_gitignore +1 -1
  9. package/lib/__templates__/expo/_npmrc +3 -5
  10. package/lib/__templates__/expo/client/app/+not-found.tsx +15 -64
  11. package/lib/__templates__/expo/client/app/_layout.tsx +15 -12
  12. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  13. package/lib/__templates__/expo/client/app.config.ts +76 -0
  14. package/lib/__templates__/expo/client/components/Screen.tsx +1 -17
  15. package/lib/__templates__/expo/client/components/ThemedText.tsx +33 -0
  16. package/lib/__templates__/expo/client/components/ThemedView.tsx +37 -0
  17. package/lib/__templates__/expo/client/constants/theme.ts +117 -58
  18. package/lib/__templates__/expo/client/contexts/AuthContext.tsx +14 -107
  19. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  20. package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +33 -10
  21. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  22. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  23. package/lib/__templates__/expo/client/hooks/useTheme.ts +26 -6
  24. package/lib/__templates__/expo/client/metro.config.js +121 -0
  25. package/lib/__templates__/expo/client/package.json +95 -0
  26. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  27. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  28. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
  29. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  30. package/lib/__templates__/expo/client/utils/index.ts +23 -2
  31. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  32. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  33. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  34. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  35. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  36. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
  37. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  38. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  39. package/lib/__templates__/expo/package.json +16 -101
  40. package/lib/__templates__/expo/patches/expo@54.0.32.patch +45 -0
  41. package/lib/__templates__/expo/pnpm-lock.yaml +1534 -3359
  42. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  43. package/lib/__templates__/expo/server/build.js +21 -0
  44. package/lib/__templates__/expo/server/package.json +32 -0
  45. package/lib/__templates__/expo/server/src/index.ts +19 -0
  46. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  47. package/lib/__templates__/expo/template.config.js +2 -1
  48. package/lib/__templates__/expo/tsconfig.json +1 -24
  49. package/lib/__templates__/nextjs/.coze +4 -3
  50. package/lib/__templates__/nextjs/_npmrc +2 -1
  51. package/lib/__templates__/nextjs/next.config.ts +12 -0
  52. package/lib/__templates__/nextjs/package.json +16 -1
  53. package/lib/__templates__/nextjs/pnpm-lock.yaml +3294 -1030
  54. package/lib/__templates__/nextjs/scripts/dev.sh +8 -27
  55. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  56. package/lib/__templates__/nextjs/src/app/globals.css +109 -89
  57. package/lib/__templates__/nextjs/src/app/layout.tsx +19 -32
  58. package/lib/__templates__/nextjs/src/app/page.tsx +16 -48
  59. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  60. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  61. package/lib/__templates__/nextjs/template.config.js +31 -1
  62. package/lib/__templates__/taro/.coze +14 -0
  63. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  64. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +13 -0
  65. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +16 -0
  66. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +74 -0
  67. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  68. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +1 -0
  69. package/lib/__templates__/taro/README.md +687 -0
  70. package/lib/__templates__/taro/_gitignore +40 -0
  71. package/lib/__templates__/taro/_npmrc +18 -0
  72. package/lib/__templates__/taro/babel.config.js +12 -0
  73. package/lib/__templates__/taro/config/dev.ts +9 -0
  74. package/lib/__templates__/taro/config/index.ts +173 -0
  75. package/lib/__templates__/taro/config/prod.ts +35 -0
  76. package/lib/__templates__/taro/eslint.config.mjs +57 -0
  77. package/lib/__templates__/taro/key/private.appid.key +0 -0
  78. package/lib/__templates__/taro/package.json +95 -0
  79. package/lib/__templates__/taro/pnpm-lock.yaml +22430 -0
  80. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  81. package/lib/__templates__/taro/project.config.json +15 -0
  82. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  83. package/lib/__templates__/taro/server/package.json +38 -0
  84. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  85. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  86. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  87. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  88. package/lib/__templates__/taro/server/src/main.ts +37 -0
  89. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  90. package/lib/__templates__/taro/src/app.config.ts +11 -0
  91. package/lib/__templates__/taro/src/app.css +52 -0
  92. package/lib/__templates__/taro/src/app.ts +14 -0
  93. package/lib/__templates__/taro/src/index.html +50 -0
  94. package/lib/__templates__/taro/src/network.ts +39 -0
  95. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  96. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  97. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  98. package/lib/__templates__/taro/src/utils/h5-styles.ts +22 -0
  99. package/lib/__templates__/taro/src/utils/wx-debug.ts +23 -0
  100. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  101. package/lib/__templates__/taro/template.config.js +68 -0
  102. package/lib/__templates__/taro/tsconfig.json +29 -0
  103. package/lib/__templates__/taro/types/global.d.ts +32 -0
  104. package/lib/__templates__/templates.json +93 -36
  105. package/lib/__templates__/vite/.coze +4 -3
  106. package/lib/__templates__/vite/README.md +204 -26
  107. package/lib/__templates__/vite/_npmrc +2 -1
  108. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  109. package/lib/__templates__/vite/package.json +11 -2
  110. package/lib/__templates__/vite/pnpm-lock.yaml +3232 -243
  111. package/lib/__templates__/vite/scripts/dev.sh +7 -26
  112. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  113. package/lib/__templates__/vite/src/main.ts +17 -48
  114. package/lib/__templates__/vite/template.config.js +40 -5
  115. package/lib/__templates__/vite/vite.config.ts +3 -3
  116. package/lib/cli.js +1479 -461
  117. package/package.json +10 -4
  118. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -109
  119. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -257
  120. package/lib/__templates__/expo/app.json +0 -63
  121. package/lib/__templates__/expo/babel.config.js +0 -9
  122. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  123. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  124. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  125. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +0 -1
  126. package/lib/__templates__/expo/client/index.js +0 -12
  127. package/lib/__templates__/expo/client/screens/home/index.tsx +0 -54
  128. package/lib/__templates__/expo/client/screens/home/styles.ts +0 -332
  129. package/lib/__templates__/expo/metro.config.js +0 -53
  130. package/lib/__templates__/expo/src/index.ts +0 -12
  131. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  132. package/lib/__templates__/nextjs/server.mjs +0 -50
  133. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  134. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
@@ -0,0 +1,3 @@
1
+ packages:
2
+ - client
3
+ - server
@@ -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
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "server",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "preinstall": "npx only-allow pnpm",
7
+ "dev": "bash ../.cozeproj/scripts/server_dev_run.sh",
8
+ "build": "node build.js",
9
+ "start": "NODE_ENV=production PORT=${PORT:-5000} node dist/index.js"
10
+ },
11
+ "dependencies": {
12
+ "express": "^4.22.1",
13
+ "cors": "^2.8.5",
14
+ "coze-coding-dev-sdk": "^0.7.10",
15
+ "dayjs": "^1.11.19",
16
+ "drizzle-orm": "^0.45.1",
17
+ "drizzle-zod": "^0.8.3",
18
+ "multer": "^2.0.2",
19
+ "pg": "^8.16.3",
20
+ "zod": "^4.2.1"
21
+ },
22
+ "devDependencies": {
23
+ "@types/cors": "^2.8.19",
24
+ "@types/express": "^5.0.6",
25
+ "tsx": "^4.21.0",
26
+ "@types/multer": "^2.0.0",
27
+ "@types/pg": "^8.16.0",
28
+ "esbuild": "0.27.2",
29
+ "typescript": "^5.8.3",
30
+ "drizzle-kit": "^0.31.8"
31
+ }
32
+ }
@@ -0,0 +1,19 @@
1
+ import express from "express";
2
+ import cors from "cors";
3
+
4
+ const app = express();
5
+ const port = process.env.PORT || 9091;
6
+
7
+ // Middleware
8
+ app.use(cors());
9
+ app.use(express.json({ limit: '50mb' }));
10
+ app.use(express.urlencoded({ limit: '50mb', extended: true }));
11
+
12
+ app.get('/api/v1/health', (req, res) => {
13
+ res.status(200).json({ status: 'ok' });
14
+ });
15
+
16
+
17
+ app.listen(port, () => {
18
+ console.log(`Server listening at http://localhost:${port}/`);
19
+ });
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://www.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "lib": [
5
+ "es2024",
6
+ "ESNext.Array",
7
+ "ESNext.Collection",
8
+ "ESNext.Iterator",
9
+ "ESNext.Promise"
10
+ ],
11
+ "module": "preserve",
12
+ "target": "es2024",
13
+
14
+ "strict": true,
15
+ "esModuleInterop": true,
16
+ "skipLibCheck": true,
17
+ "moduleResolution": "bundler",
18
+
19
+ "rewriteRelativeImportExtensions": true,
20
+ "erasableSyntaxOnly": true,
21
+ "verbatimModuleSyntax": true
22
+ },
23
+ "include": ["src"]
24
+ }
@@ -29,9 +29,10 @@ export const paramsSchema = {
29
29
  };
30
30
 
31
31
  const config = {
32
+ description: 'Expo template for React Native applications',
32
33
  paramsSchema,
33
34
  defaultParams: {
34
- port: 8081,
35
+ port: 9090,
35
36
  appName: 'my-expo-app',
36
37
  },
37
38
  onBeforeRender: async context => {
@@ -1,24 +1 @@
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
- "@/*": ["./client/*"]
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
- "client/.expo"
23
- ]
24
- }
1
+ {}
@@ -2,10 +2,11 @@
2
2
  requires = ["nodejs-24"]
3
3
 
4
4
  [dev]
5
- run = ["npm", "run", "dev"]
5
+ build = ["bash", "./scripts/prepare.sh"]
6
+ run = ["bash", "./scripts/dev.sh"]
6
7
  deps = ["git"] # -> apt install git
7
8
 
8
9
  [deploy]
9
- build = ["npm", "run", "build"]
10
- run = ["npm", "run", "start"]
10
+ build = ["bash","./scripts/build.sh"]
11
+ run = ["bash","./scripts/start.sh"]
11
12
  deps = ["git"] # -> apt install git
@@ -1,4 +1,5 @@
1
- registry=https://registry.npmjs.org
1
+ loglevel=error
2
+ registry=https://registry.npmmirror.com
2
3
 
3
4
  strictStorePkgContentCheck=false
4
5
  verifyStoreIntegrity=false
@@ -1,7 +1,19 @@
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 */
7
+ allowedDevOrigins: ['*.dev.coze.site'],
8
+ images: {
9
+ remotePatterns: [
10
+ {
11
+ protocol: 'https',
12
+ hostname: 'lf-coze-web-cdn.coze.cn',
13
+ pathname: '/**',
14
+ },
15
+ ],
16
+ },
5
17
  };
6
18
 
7
19
  export default nextConfig;
@@ -7,9 +7,12 @@
7
7
  "dev": "bash ./scripts/dev.sh",
8
8
  "preinstall": "npx only-allow pnpm",
9
9
  "lint": "eslint",
10
- "start": "bash ./scripts/start.sh"
10
+ "start": "bash ./scripts/start.sh",
11
+ "ts-check": "tsc -p tsconfig.json"
11
12
  },
12
13
  "dependencies": {
14
+ "@aws-sdk/client-s3": "^3.958.0",
15
+ "@aws-sdk/lib-storage": "^3.958.0",
13
16
  "@hookform/resolvers": "^5.2.2",
14
17
  "@radix-ui/react-accordion": "^1.2.12",
15
18
  "@radix-ui/react-alert-dialog": "^1.1.15",
@@ -40,12 +43,17 @@
40
43
  "class-variance-authority": "^0.7.1",
41
44
  "clsx": "^2.1.1",
42
45
  "cmdk": "^1.1.1",
46
+ "coze-coding-dev-sdk": "^0.7.3",
43
47
  "date-fns": "^4.1.0",
48
+ "drizzle-kit": "^0.31.8",
49
+ "drizzle-orm": "^0.45.1",
50
+ "drizzle-zod": "^0.8.3",
44
51
  "embla-carousel-react": "^8.6.0",
45
52
  "input-otp": "^1.4.2",
46
53
  "lucide-react": "^0.468.0",
47
54
  "next": "16.1.1",
48
55
  "next-themes": "^0.4.6",
56
+ "pg": "^8.16.3",
49
57
  "react": "19.2.3",
50
58
  "react-day-picker": "^9.13.0",
51
59
  "react-dom": "19.2.3",
@@ -54,6 +62,7 @@
54
62
  "recharts": "2.15.4",
55
63
  "sonner": "^2.0.7",
56
64
  "tailwind-merge": "^2.6.0",
65
+ "tw-animate-css": "^1.4.0",
57
66
  "vaul": "^1.1.2",
58
67
  "zod": "^4.3.5"
59
68
  },
@@ -62,6 +71,7 @@
62
71
  "@react-dev-inspector/middleware": "^2.0.1",
63
72
  "@tailwindcss/postcss": "^4",
64
73
  "@types/node": "^20",
74
+ "@types/pg": "^8.16.0",
65
75
  "@types/react": "^19",
66
76
  "@types/react-dom": "^19",
67
77
  "eslint": "^9",
@@ -75,5 +85,10 @@
75
85
  "packageManager": "pnpm@9.0.0",
76
86
  "engines": {
77
87
  "pnpm": ">=9.0.0"
88
+ },
89
+ "pnpm": {
90
+ "overrides": {
91
+ "esbuild": "^0.25.12"
92
+ }
78
93
  }
79
94
  }