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

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 (84) hide show
  1. package/lib/__templates__/expo/.coze +1 -1
  2. package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +19 -82
  3. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +75 -86
  4. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +2 -2
  5. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +2 -2
  6. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +45 -0
  7. package/lib/__templates__/expo/README.md +68 -7
  8. package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
  9. package/lib/__templates__/expo/client/{src/app → app}/_layout.tsx +15 -12
  10. package/lib/__templates__/expo/client/app/index.tsx +1 -0
  11. package/lib/__templates__/expo/client/app.config.ts +65 -60
  12. package/lib/__templates__/expo/client/{src/components → components}/Screen.tsx +1 -17
  13. package/lib/__templates__/expo/client/{src/components → components}/ThemedView.tsx +1 -2
  14. package/lib/__templates__/expo/client/constants/theme.ts +177 -0
  15. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  16. package/lib/__templates__/expo/client/eslint.config.mjs +30 -10
  17. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  18. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  19. package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
  20. package/lib/__templates__/expo/client/package.json +6 -3
  21. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  22. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  23. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
  24. package/lib/__templates__/expo/client/tsconfig.json +1 -1
  25. package/lib/__templates__/expo/client/{src/utils → utils}/index.ts +22 -0
  26. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  27. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  28. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  29. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  30. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  31. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  32. package/lib/__templates__/expo/package.json +7 -98
  33. package/lib/__templates__/expo/patches/expo@54.0.32.patch +44 -0
  34. package/lib/__templates__/expo/pnpm-lock.yaml +2001 -2124
  35. package/lib/__templates__/expo/server/build.js +21 -0
  36. package/lib/__templates__/expo/server/package.json +19 -4
  37. package/lib/__templates__/expo/server/src/index.ts +9 -2
  38. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  39. package/lib/__templates__/expo/template.config.js +1 -0
  40. package/lib/__templates__/nextjs/.babelrc +15 -0
  41. package/lib/__templates__/nextjs/.coze +1 -0
  42. package/lib/__templates__/nextjs/_npmrc +1 -0
  43. package/lib/__templates__/nextjs/next.config.ts +12 -0
  44. package/lib/__templates__/nextjs/package.json +10 -11
  45. package/lib/__templates__/nextjs/pnpm-lock.yaml +2543 -1747
  46. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  47. package/lib/__templates__/nextjs/src/app/globals.css +10 -2
  48. package/lib/__templates__/nextjs/src/app/layout.tsx +5 -14
  49. package/lib/__templates__/nextjs/src/app/page.tsx +35 -23
  50. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  51. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  52. package/lib/__templates__/nextjs/template.config.js +30 -0
  53. package/lib/__templates__/templates.json +61 -43
  54. package/lib/__templates__/vite/.coze +1 -0
  55. package/lib/__templates__/vite/_npmrc +1 -0
  56. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  57. package/lib/__templates__/vite/package.json +10 -1
  58. package/lib/__templates__/vite/pnpm-lock.yaml +3115 -126
  59. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  60. package/lib/__templates__/vite/src/main.ts +1 -2
  61. package/lib/__templates__/vite/template.config.js +30 -4
  62. package/lib/cli.js +691 -130
  63. package/package.json +5 -3
  64. package/lib/__templates__/expo/client/src/app/index.ts +0 -1
  65. package/lib/__templates__/expo/client/src/constants/theme.ts +0 -850
  66. package/lib/__templates__/expo/client/src/hooks/useColorScheme.ts +0 -1
  67. package/lib/__templates__/expo/client/src/hooks/useTheme.ts +0 -13
  68. package/lib/__templates__/expo/client/src/screens/home/index.tsx +0 -50
  69. package/lib/__templates__/expo/client/src/screens/home/styles.ts +0 -60
  70. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  71. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  72. /package/lib/__templates__/expo/client/{src/assets → assets}/fonts/SpaceMono-Regular.ttf +0 -0
  73. /package/lib/__templates__/expo/client/{src/assets → assets}/images/adaptive-icon.png +0 -0
  74. /package/lib/__templates__/expo/client/{src/assets → assets}/images/default-avatar.png +0 -0
  75. /package/lib/__templates__/expo/client/{src/assets → assets}/images/favicon.png +0 -0
  76. /package/lib/__templates__/expo/client/{src/assets → assets}/images/icon.png +0 -0
  77. /package/lib/__templates__/expo/client/{src/assets → assets}/images/partial-react-logo.png +0 -0
  78. /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo.png +0 -0
  79. /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@2x.png +0 -0
  80. /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@3x.png +0 -0
  81. /package/lib/__templates__/expo/client/{src/assets → assets}/images/splash-icon.png +0 -0
  82. /package/lib/__templates__/expo/client/{src/components → components}/SmartDateInput.tsx +0 -0
  83. /package/lib/__templates__/expo/client/{src/components → components}/ThemedText.tsx +0 -0
  84. /package/lib/__templates__/expo/client/{src/contexts → contexts}/AuthContext.tsx +0 -0
@@ -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
+ }
@@ -1,17 +1,32 @@
1
1
  {
2
2
  "name": "server",
3
3
  "private": true,
4
+ "type": "module",
4
5
  "scripts": {
5
6
  "preinstall": "npx only-allow pnpm",
6
- "dev": "NODE_ENV=development tsx ./src/index.ts",
7
- "build": "pnpm exec esbuild src/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist",
7
+ "dev": "bash ../.cozeproj/scripts/server_dev_run.sh",
8
+ "build": "node build.js",
8
9
  "start": "NODE_ENV=production PORT=${PORT:-5000} node dist/index.js"
9
10
  },
10
11
  "dependencies": {
11
- "express": "^4.22.1"
12
+ "express": "^4.22.1",
13
+ "cors": "^2.8.5",
14
+ "coze-coding-dev-sdk": "^0.7.2",
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"
12
21
  },
13
22
  "devDependencies": {
23
+ "@types/cors": "^2.8.19",
14
24
  "@types/express": "^5.0.6",
15
- "tsx": "^4.21.0"
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"
16
31
  }
17
32
  }
@@ -1,12 +1,19 @@
1
1
  import express from "express";
2
+ import cors from "cors";
2
3
 
3
4
  const app = express();
4
5
  const port = process.env.PORT || 9091;
5
6
 
6
- app.get('/api/v1/ping', (req, res) => {
7
- res.status(200).json({ message: 'connected' });
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' });
8
14
  });
9
15
 
16
+
10
17
  app.listen(port, () => {
11
18
  console.log(`Server listening at http://localhost:${port}/`);
12
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,6 +29,7 @@ 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
35
  port: 9090,
@@ -0,0 +1,15 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "next/babel",
5
+ {
6
+ "preset-react": {
7
+ "development": true
8
+ }
9
+ }
10
+ ]
11
+ ],
12
+ "plugins": [
13
+ "@react-dev-inspector/babel-plugin"
14
+ ]
15
+ }
@@ -2,6 +2,7 @@
2
2
  requires = ["nodejs-24"]
3
3
 
4
4
  [dev]
5
+ build = ["bash", "./scripts/prepare.sh"]
5
6
  run = ["bash", "./scripts/dev.sh"]
6
7
  deps = ["git"] # -> apt install git
7
8
 
@@ -1,3 +1,4 @@
1
+ loglevel=error
1
2
  registry=https://registry.npmmirror.com
2
3
 
3
4
  strictStorePkgContentCheck=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,11 +7,10 @@
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": {
13
- "@aws-sdk/client-s3": "^3.958.0",
14
- "@aws-sdk/lib-storage": "^3.958.0",
15
14
  "@hookform/resolvers": "^5.2.2",
16
15
  "@radix-ui/react-accordion": "^1.2.12",
17
16
  "@radix-ui/react-alert-dialog": "^1.1.15",
@@ -40,19 +39,13 @@
40
39
  "@radix-ui/react-toggle-group": "^1.1.11",
41
40
  "@radix-ui/react-tooltip": "^1.2.8",
42
41
  "class-variance-authority": "^0.7.1",
43
- "clsx": "^2.1.1",
44
42
  "cmdk": "^1.1.1",
45
- "coze-coding-dev-sdk": "^0.5.2",
46
- "date-fns": "^4.1.0",
47
- "drizzle-kit": "^0.31.8",
48
- "drizzle-orm": "^0.45.1",
49
- "drizzle-zod": "^0.8.3",
43
+ "coze-coding-dev-sdk": "^0.7.4",
50
44
  "embla-carousel-react": "^8.6.0",
51
45
  "input-otp": "^1.4.2",
52
46
  "lucide-react": "^0.468.0",
53
47
  "next": "16.1.1",
54
48
  "next-themes": "^0.4.6",
55
- "pg": "^8.16.3",
56
49
  "react": "19.2.3",
57
50
  "react-day-picker": "^9.13.0",
58
51
  "react-dom": "19.2.3",
@@ -66,14 +59,15 @@
66
59
  "zod": "^4.3.5"
67
60
  },
68
61
  "devDependencies": {
62
+ "@react-dev-inspector/babel-plugin": "^2.0.1",
69
63
  "@tailwindcss/postcss": "^4",
70
64
  "@types/node": "^20",
71
- "@types/pg": "^8.16.0",
72
65
  "@types/react": "^19",
73
66
  "@types/react-dom": "^19",
74
67
  "eslint": "^9",
75
68
  "eslint-config-next": "16.1.1",
76
69
  "only-allow": "^1.2.2",
70
+ "react-dev-inspector": "^2.0.1",
77
71
  "shadcn": "latest",
78
72
  "tailwindcss": "^4",
79
73
  "typescript": "^5"
@@ -81,5 +75,10 @@
81
75
  "packageManager": "pnpm@9.0.0",
82
76
  "engines": {
83
77
  "pnpm": ">=9.0.0"
78
+ },
79
+ "pnpm": {
80
+ "overrides": {
81
+ "esbuild": "^0.25.12"
82
+ }
84
83
  }
85
84
  }