@coze-arch/cli 0.0.1-alpha.ccd993 → 0.0.1-alpha.cf9a3b

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 (85) hide show
  1. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +25 -16
  2. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +9 -8
  3. package/lib/__templates__/expo/README.md +2 -2
  4. package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
  5. package/lib/__templates__/expo/client/app/_layout.tsx +11 -8
  6. package/lib/__templates__/expo/client/app.config.ts +2 -2
  7. package/lib/__templates__/expo/client/components/Screen.tsx +1 -17
  8. package/lib/__templates__/expo/client/components/ThemedView.tsx +1 -2
  9. package/lib/__templates__/expo/client/constants/theme.ts +21 -698
  10. package/lib/__templates__/expo/client/eslint.config.mjs +20 -0
  11. package/lib/__templates__/expo/client/hooks/{useColorScheme.ts → useColorScheme.tsx} +20 -6
  12. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  13. package/lib/__templates__/expo/client/metro.config.js +3 -0
  14. package/lib/__templates__/expo/client/package.json +36 -34
  15. package/lib/__templates__/expo/client/screens/demo/index.tsx +3 -3
  16. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1886 -2483
  17. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +20 -1
  18. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  19. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  20. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
  21. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  22. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  23. package/lib/__templates__/expo/package.json +3 -0
  24. package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
  25. package/lib/__templates__/expo/pnpm-lock.yaml +1318 -2636
  26. package/lib/__templates__/expo/server/package.json +9 -7
  27. package/lib/__templates__/expo/server/src/index.ts +1 -0
  28. package/lib/__templates__/expo/template.config.js +56 -0
  29. package/lib/__templates__/nextjs/.babelrc +15 -0
  30. package/lib/__templates__/nextjs/package.json +11 -1
  31. package/lib/__templates__/nextjs/pnpm-lock.yaml +2701 -1813
  32. package/lib/__templates__/nextjs/src/app/layout.tsx +5 -3
  33. package/lib/__templates__/nextjs/src/app/page.tsx +18 -60
  34. package/lib/__templates__/nextjs/template.config.js +47 -12
  35. package/lib/__templates__/taro/.coze +14 -0
  36. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  37. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
  38. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
  39. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
  40. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  41. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
  42. package/lib/__templates__/taro/README.md +749 -0
  43. package/lib/__templates__/taro/_gitignore +40 -0
  44. package/lib/__templates__/taro/_npmrc +18 -0
  45. package/lib/__templates__/taro/babel.config.js +12 -0
  46. package/lib/__templates__/taro/config/dev.ts +9 -0
  47. package/lib/__templates__/taro/config/index.ts +173 -0
  48. package/lib/__templates__/taro/config/prod.ts +35 -0
  49. package/lib/__templates__/taro/eslint.config.mjs +79 -0
  50. package/lib/__templates__/taro/key/private.appid.key +0 -0
  51. package/lib/__templates__/taro/package.json +97 -0
  52. package/lib/__templates__/taro/pnpm-lock.yaml +22694 -0
  53. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  54. package/lib/__templates__/taro/project.config.json +15 -0
  55. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  56. package/lib/__templates__/taro/server/package.json +40 -0
  57. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  58. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  59. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  60. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  61. package/lib/__templates__/taro/server/src/main.ts +49 -0
  62. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  63. package/lib/__templates__/taro/src/app.config.ts +11 -0
  64. package/lib/__templates__/taro/src/app.css +52 -0
  65. package/lib/__templates__/taro/src/app.tsx +9 -0
  66. package/lib/__templates__/taro/src/index.html +39 -0
  67. package/lib/__templates__/taro/src/network.ts +39 -0
  68. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  69. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  70. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  71. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +171 -0
  72. package/lib/__templates__/taro/src/presets/h5-styles.ts +33 -0
  73. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  74. package/lib/__templates__/taro/src/presets/wx-debug.ts +23 -0
  75. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  76. package/lib/__templates__/taro/template.config.js +68 -0
  77. package/lib/__templates__/taro/tsconfig.json +29 -0
  78. package/lib/__templates__/taro/types/global.d.ts +32 -0
  79. package/lib/__templates__/templates.json +32 -0
  80. package/lib/__templates__/vite/package.json +10 -1
  81. package/lib/__templates__/vite/pnpm-lock.yaml +350 -2341
  82. package/lib/__templates__/vite/src/main.ts +17 -47
  83. package/lib/__templates__/vite/template.config.js +47 -10
  84. package/lib/cli.js +818 -124
  85. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ const description = `Taro(小程序 + H5):\`coze init \${COZE_WORKSPACE_PATH} --template taro\`
11
+ - 适用:微信小程序、H5 跨端应用
12
+ - 前后端分离架构:Taro 4 + NestJS
13
+ - 支持微信小程序和 H5 双端构建
14
+ - 使用 TailwindCSS + weapp-tailwindcss 实现跨端样式`;
15
+
16
+ export const paramsSchema = {
17
+ type: 'object',
18
+ properties: {
19
+ appName: {
20
+ type: 'string',
21
+ minLength: 1,
22
+ pattern: '^[a-z0-9-]+$',
23
+ description:
24
+ 'Application name (lowercase, alphanumeric and hyphens only)',
25
+ },
26
+ port: {
27
+ type: 'number',
28
+ default: 5000,
29
+ minimum: 1024,
30
+ maximum: 65535,
31
+ description: 'H5 development server port',
32
+ },
33
+ serverPort: {
34
+ type: 'number',
35
+ default: 3000,
36
+ minimum: 1024,
37
+ maximum: 65535,
38
+ description: 'NestJS backend server port',
39
+ },
40
+ },
41
+ required: [],
42
+ additionalProperties: false,
43
+ };
44
+
45
+ const config = {
46
+ description: description,
47
+ paramsSchema,
48
+ defaultParams: {
49
+ port: 5000,
50
+ serverPort: 3000,
51
+ appName: 'coze-mini-program',
52
+ },
53
+ onBeforeRender: async context => {
54
+ console.log(`Creating Taro project: ${context.appName}`);
55
+ return context;
56
+ },
57
+ onAfterRender: async (context, outputPath) => {
58
+ console.log(`\nProject created at: ${outputPath}`);
59
+ console.log('\nConfiguration:');
60
+ console.log(' - Framework: Taro 4 + NestJS');
61
+ console.log(' - TypeScript: enabled');
62
+ console.log(' - Platforms: H5, WeChat Mini Program');
63
+ console.log(` - H5 Port: ${context.port}`);
64
+ console.log(` - Server Port: ${context.serverPort}`);
65
+ },
66
+ };
67
+
68
+ export default config;
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2017",
4
+ "module": "ESNext",
5
+ "removeComments": false,
6
+ "preserveConstEnums": true,
7
+ "moduleResolution": "bundler",
8
+ "experimentalDecorators": true,
9
+ "noImplicitAny": false,
10
+ "allowSyntheticDefaultImports": true,
11
+ "outDir": "lib",
12
+ "noUnusedLocals": true,
13
+ "noUnusedParameters": true,
14
+ "strictNullChecks": true,
15
+ "sourceMap": true,
16
+ "rootDir": ".",
17
+ "jsx": "react-jsx",
18
+ "allowJs": true,
19
+ "resolveJsonModule": true,
20
+ "typeRoots": [
21
+ "node_modules/@types"
22
+ ],
23
+ "paths": {
24
+ "@/*": ["./src/*"]
25
+ }
26
+ },
27
+ "include": ["./src", "./types", "./config"],
28
+ "compileOnSave": false
29
+ }
@@ -0,0 +1,32 @@
1
+ /// <reference types="@tarojs/taro" />
2
+
3
+ declare const PROJECT_DOMAIN: string | undefined;
4
+ declare const TARO_ENV: "weapp" | "h5" | undefined;
5
+
6
+ declare module '*.png';
7
+ declare module '*.gif';
8
+ declare module '*.jpg';
9
+ declare module '*.jpeg';
10
+ declare module '*.svg';
11
+ declare module '*.css';
12
+ declare module '*.less';
13
+ declare module '*.scss';
14
+ declare module '*.sass';
15
+ declare module '*.styl';
16
+
17
+ declare namespace NodeJS {
18
+ interface ProcessEnv {
19
+ /** NODE 内置环境变量, 会影响到最终构建生成产物 */
20
+ NODE_ENV: 'development' | 'production',
21
+ /** 当前构建的平台 */
22
+ TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'qq' | 'jd' | 'harmony' | 'jdrn'
23
+ /**
24
+ * 当前构建的小程序 appid
25
+ * @description 若不同环境有不同的小程序,可通过在 env 文件中配置环境变量`TARO_APP_ID`来方便快速切换 appid, 而不必手动去修改 dist/project.config.json 文件
26
+ * @see https://taro-docs.jd.com/docs/next/env-mode-config#特殊环境变量-taro_app_id
27
+ */
28
+ TARO_APP_ID: string
29
+ }
30
+ }
31
+
32
+
@@ -51,6 +51,38 @@
51
51
  "additionalProperties": false
52
52
  }
53
53
  },
54
+ {
55
+ "name": "taro",
56
+ "description": "Taro(小程序 + H5):`coze init ${COZE_WORKSPACE_PATH} --template taro`\n- 适用:微信小程序、H5 跨端应用\n- 前后端分离架构:Taro 4 + NestJS\n- 支持微信小程序和 H5 双端构建\n- 使用 TailwindCSS + weapp-tailwindcss 实现跨端样式",
57
+ "location": "./taro",
58
+ "paramsSchema": {
59
+ "type": "object",
60
+ "properties": {
61
+ "appName": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "pattern": "^[a-z0-9-]+$",
65
+ "description": "Application name (lowercase, alphanumeric and hyphens only)"
66
+ },
67
+ "port": {
68
+ "type": "number",
69
+ "default": 5000,
70
+ "minimum": 1024,
71
+ "maximum": 65535,
72
+ "description": "H5 development server port"
73
+ },
74
+ "serverPort": {
75
+ "type": "number",
76
+ "default": 3000,
77
+ "minimum": 1024,
78
+ "maximum": 65535,
79
+ "description": "NestJS backend server port"
80
+ }
81
+ },
82
+ "required": [],
83
+ "additionalProperties": false
84
+ }
85
+ },
54
86
  {
55
87
  "name": "vite",
56
88
  "description": "Vite(简单项目):`coze init ${COZE_WORKSPACE_PATH} --template vite`\n- 适用:轻量级 SPA、纯前端交互、仪表盘等轻量级项目。",
@@ -10,9 +10,13 @@
10
10
  "start": "bash ./scripts/start.sh",
11
11
  "ts-check": "tsc -p tsconfig.json"
12
12
  },
13
+ "dependencies": {
14
+ "@supabase/supabase-js": "2.95.3",
15
+ "dotenv": "^17.2.3"
16
+ },
13
17
  "devDependencies": {
14
18
  "autoprefixer": "^10.4.20",
15
- "coze-coding-dev-sdk": "^0.7.0",
19
+ "coze-coding-dev-sdk": "^0.7.16",
16
20
  "eslint": "^9",
17
21
  "only-allow": "^1.2.2",
18
22
  "postcss": "^8.4.49",
@@ -24,5 +28,10 @@
24
28
  "packageManager": "pnpm@9.0.0",
25
29
  "engines": {
26
30
  "pnpm": ">=9.0.0"
31
+ },
32
+ "pnpm": {
33
+ "overrides": {
34
+ "esbuild": "^0.27.2"
35
+ }
27
36
  }
28
37
  }