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

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 (129) 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 +2 -4
  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/declarations.d.ts +5 -0
  19. package/lib/__templates__/expo/{eslint.config.mjs → client/eslint.config.mjs} +33 -10
  20. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  21. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  22. package/lib/__templates__/expo/client/hooks/useTheme.ts +26 -6
  23. package/lib/__templates__/expo/client/metro.config.js +121 -0
  24. package/lib/__templates__/expo/client/package.json +95 -0
  25. package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
  26. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  27. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
  28. package/lib/__templates__/expo/client/tsconfig.json +24 -0
  29. package/lib/__templates__/expo/client/utils/index.ts +22 -0
  30. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  31. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  32. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  33. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  34. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  35. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
  36. package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
  37. package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
  38. package/lib/__templates__/expo/package.json +16 -103
  39. package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
  40. package/lib/__templates__/expo/pnpm-lock.yaml +1375 -3165
  41. package/lib/__templates__/expo/pnpm-workspace.yaml +3 -0
  42. package/lib/__templates__/expo/server/build.js +21 -0
  43. package/lib/__templates__/expo/server/package.json +32 -0
  44. package/lib/__templates__/expo/server/src/index.ts +20 -0
  45. package/lib/__templates__/expo/server/tsconfig.json +24 -0
  46. package/lib/__templates__/expo/template.config.js +57 -0
  47. package/lib/__templates__/expo/tsconfig.json +1 -24
  48. package/lib/__templates__/nextjs/.babelrc +15 -0
  49. package/lib/__templates__/nextjs/.coze +1 -0
  50. package/lib/__templates__/nextjs/_npmrc +1 -0
  51. package/lib/__templates__/nextjs/next.config.ts +12 -0
  52. package/lib/__templates__/nextjs/package.json +11 -2
  53. package/lib/__templates__/nextjs/pnpm-lock.yaml +2606 -1723
  54. package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
  55. package/lib/__templates__/nextjs/src/app/globals.css +109 -89
  56. package/lib/__templates__/nextjs/src/app/layout.tsx +5 -14
  57. package/lib/__templates__/nextjs/src/app/page.tsx +18 -48
  58. package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
  59. package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
  60. package/lib/__templates__/nextjs/template.config.js +67 -2
  61. package/lib/__templates__/taro/.coze +14 -0
  62. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  63. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +13 -0
  64. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +17 -0
  65. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +58 -0
  66. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  67. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +1 -0
  68. package/lib/__templates__/taro/README.md +687 -0
  69. package/lib/__templates__/taro/_gitignore +40 -0
  70. package/lib/__templates__/taro/_npmrc +18 -0
  71. package/lib/__templates__/taro/babel.config.js +12 -0
  72. package/lib/__templates__/taro/config/dev.ts +9 -0
  73. package/lib/__templates__/taro/config/index.ts +173 -0
  74. package/lib/__templates__/taro/config/prod.ts +35 -0
  75. package/lib/__templates__/taro/eslint.config.mjs +57 -0
  76. package/lib/__templates__/taro/key/private.appid.key +0 -0
  77. package/lib/__templates__/taro/package.json +95 -0
  78. package/lib/__templates__/taro/pnpm-lock.yaml +22430 -0
  79. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  80. package/lib/__templates__/taro/project.config.json +15 -0
  81. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  82. package/lib/__templates__/taro/server/package.json +38 -0
  83. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  84. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  85. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  86. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  87. package/lib/__templates__/taro/server/src/main.ts +37 -0
  88. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  89. package/lib/__templates__/taro/src/app.config.ts +11 -0
  90. package/lib/__templates__/taro/src/app.css +52 -0
  91. package/lib/__templates__/taro/src/app.ts +14 -0
  92. package/lib/__templates__/taro/src/index.html +20 -0
  93. package/lib/__templates__/taro/src/network.ts +39 -0
  94. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  95. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  96. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  97. package/lib/__templates__/taro/src/utils/h5-styles.ts +22 -0
  98. package/lib/__templates__/taro/src/utils/wx-debug.ts +23 -0
  99. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  100. package/lib/__templates__/taro/template.config.js +68 -0
  101. package/lib/__templates__/taro/tsconfig.json +29 -0
  102. package/lib/__templates__/taro/types/global.d.ts +32 -0
  103. package/lib/__templates__/templates.json +93 -43
  104. package/lib/__templates__/vite/.coze +1 -0
  105. package/lib/__templates__/vite/_npmrc +1 -0
  106. package/lib/__templates__/vite/eslint.config.mjs +9 -0
  107. package/lib/__templates__/vite/package.json +11 -2
  108. package/lib/__templates__/vite/pnpm-lock.yaml +3232 -243
  109. package/lib/__templates__/vite/scripts/prepare.sh +9 -0
  110. package/lib/__templates__/vite/src/main.ts +17 -48
  111. package/lib/__templates__/vite/template.config.js +67 -6
  112. package/lib/cli.js +1026 -134
  113. package/package.json +8 -3
  114. package/lib/__templates__/expo/.cozeproj/scripts/deploy_build.sh +0 -116
  115. package/lib/__templates__/expo/.cozeproj/scripts/deploy_run.sh +0 -239
  116. package/lib/__templates__/expo/app.json +0 -63
  117. package/lib/__templates__/expo/babel.config.js +0 -9
  118. package/lib/__templates__/expo/client/app/(tabs)/_layout.tsx +0 -43
  119. package/lib/__templates__/expo/client/app/(tabs)/home.tsx +0 -1
  120. package/lib/__templates__/expo/client/app/(tabs)/index.tsx +0 -7
  121. package/lib/__templates__/expo/client/hooks/useColorScheme.ts +0 -1
  122. package/lib/__templates__/expo/client/index.js +0 -12
  123. package/lib/__templates__/expo/client/screens/home/index.tsx +0 -51
  124. package/lib/__templates__/expo/client/screens/home/styles.ts +0 -60
  125. package/lib/__templates__/expo/metro.config.js +0 -53
  126. package/lib/__templates__/expo/src/index.ts +0 -12
  127. package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
  128. package/lib/__templates__/vite/.vscode/settings.json +0 -7
  129. /package/lib/__templates__/expo/{eslint-formatter-simple.mjs → client/eslint-formatter-simple.mjs} +0 -0
@@ -3,66 +3,116 @@
3
3
  "templates": [
4
4
  {
5
5
  "name": "expo",
6
- "description": "expo template",
6
+ "description": "Expo template for React Native applications",
7
7
  "location": "./expo",
8
8
  "paramsSchema": {
9
- "appName": {
10
- "type": "string",
11
- "description": "Application name (lowercase, alphanumeric and hyphens only)",
12
- "pattern": "^[a-z0-9-]+$"
9
+ "type": "object",
10
+ "properties": {
11
+ "appName": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "pattern": "^[a-z0-9-]+$",
15
+ "description": "Application name (lowercase, alphanumeric and hyphens only)"
16
+ },
17
+ "port": {
18
+ "type": "number",
19
+ "default": 8081,
20
+ "minimum": 1024,
21
+ "maximum": 65535,
22
+ "description": "Metro bundler port"
23
+ }
13
24
  },
14
- "port": {
15
- "type": "number",
16
- "description": "Metro bundler port",
17
- "default": 8081,
18
- "minimum": 1024,
19
- "maximum": 65535
20
- }
25
+ "required": [],
26
+ "additionalProperties": false
21
27
  }
22
28
  },
23
29
  {
24
30
  "name": "nextjs",
25
- "description": "nextjs template",
31
+ "description": "Next.js(复杂项目):`coze init ${COZE_WORKSPACE_PATH} --template nextjs`\n- 适用:全栈应用、复杂多页面等复杂项目\n- 使用默认nextjs项目规范\n - **目录规范**: 默认开启src目录(打开--src-dir选项):项目文件(如 app 目录、pages 目录、components 等)初始化到 src/ 目录下。\n - **项目理解加速**:初始可以依赖项目下 `package.json` 文件理解项目类型,如果没有或无法理解退化成阅读其他文件。\n - **UI设计与组件规范**:Next.js项目**必须默认**采用 shadcn/ui 风格和规范,`shadcn/ui`组件默认完整的预装在`src/components/ui/`目录下",
26
32
  "location": "./nextjs",
27
33
  "paramsSchema": {
28
- "appName": {
29
- "type": "string",
30
- "description": "Application name (lowercase, alphanumeric and hyphens only)",
31
- "pattern": "^[a-z0-9-]+$"
34
+ "type": "object",
35
+ "properties": {
36
+ "appName": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "pattern": "^[a-z0-9-]+$",
40
+ "description": "Application name (lowercase, alphanumeric and hyphens only)"
41
+ },
42
+ "port": {
43
+ "type": "number",
44
+ "default": 5000,
45
+ "minimum": 1024,
46
+ "maximum": 65535,
47
+ "description": "Development server port (for Next.js dev server)"
48
+ }
32
49
  },
33
- "port": {
34
- "type": "number",
35
- "description": "Development server port (for Next.js dev server)",
36
- "default": 5000,
37
- "minimum": 1024,
38
- "maximum": 65535
39
- }
50
+ "required": [],
51
+ "additionalProperties": false
52
+ }
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
40
84
  }
41
85
  },
42
86
  {
43
87
  "name": "vite",
44
- "description": "vite template",
88
+ "description": "Vite(简单项目):`coze init ${COZE_WORKSPACE_PATH} --template vite`\n- 适用:轻量级 SPA、纯前端交互、仪表盘等轻量级项目。",
45
89
  "location": "./vite",
46
90
  "paramsSchema": {
47
- "appName": {
48
- "type": "string",
49
- "description": "Application name (lowercase, alphanumeric and hyphens only)",
50
- "pattern": "^[a-z0-9-]+$"
51
- },
52
- "port": {
53
- "type": "number",
54
- "description": "Development server port",
55
- "default": 5000,
56
- "minimum": 1024,
57
- "maximum": 65535
91
+ "type": "object",
92
+ "properties": {
93
+ "appName": {
94
+ "type": "string",
95
+ "minLength": 1,
96
+ "pattern": "^[a-z0-9-]+$",
97
+ "description": "Application name (lowercase, alphanumeric and hyphens only)"
98
+ },
99
+ "port": {
100
+ "type": "number",
101
+ "default": 5000,
102
+ "minimum": 1024,
103
+ "maximum": 65535,
104
+ "description": "Development server port"
105
+ },
106
+ "hmrPort": {
107
+ "type": "number",
108
+ "default": 6000,
109
+ "minimum": 1024,
110
+ "maximum": 65535,
111
+ "description": "Development HMR server port"
112
+ }
58
113
  },
59
- "hmrPort": {
60
- "type": "number",
61
- "description": "Development HMR server port",
62
- "default": 6000,
63
- "minimum": 1024,
64
- "maximum": 65535
65
- }
114
+ "required": [],
115
+ "additionalProperties": false
66
116
  }
67
117
  }
68
118
  ]
@@ -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
@@ -0,0 +1,9 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import { defineConfig, globalIgnores } from 'eslint/config';
4
+
5
+ export default defineConfig([
6
+ eslint.configs.recommended,
7
+ ...tseslint.configs.recommended,
8
+ globalIgnores(['dist/**', 'node_modules/**']),
9
+ ]);
@@ -7,18 +7,27 @@
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
  "devDependencies": {
13
14
  "autoprefixer": "^10.4.20",
15
+ "coze-coding-dev-sdk": "^0.7.3",
16
+ "eslint": "^9",
14
17
  "only-allow": "^1.2.2",
15
18
  "postcss": "^8.4.49",
16
19
  "tailwindcss": "^3.4.17",
17
20
  "typescript": "^5.6.0",
18
- "vite": "^6.0.0"
21
+ "typescript-eslint": "^8",
22
+ "vite": "^7.2.4"
19
23
  },
20
24
  "packageManager": "pnpm@9.0.0",
21
25
  "engines": {
22
26
  "pnpm": ">=9.0.0"
27
+ },
28
+ "pnpm": {
29
+ "overrides": {
30
+ "esbuild": "^0.27.2"
31
+ }
23
32
  }
24
33
  }