@coze-arch/cli 0.0.1-alpha.bd5b49 → 0.0.1-alpha.c199b3

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 (155) hide show
  1. package/README.md +1 -0
  2. package/lib/__templates__/expo/README.md +16 -13
  3. package/lib/__templates__/expo/_npmrc +1 -0
  4. package/lib/__templates__/expo/client/app/+not-found.tsx +19 -4
  5. package/lib/__templates__/expo/client/app/_layout.tsx +17 -16
  6. package/lib/__templates__/expo/client/components/Screen.tsx +2 -2
  7. package/lib/__templates__/expo/client/constants/theme.ts +177 -0
  8. package/lib/__templates__/expo/client/eslint.config.mjs +7 -0
  9. package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
  10. package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
  11. package/lib/__templates__/expo/client/metro.config.js +4 -8
  12. package/lib/__templates__/expo/client/package.json +1 -3
  13. package/lib/__templates__/expo/client/screens/demo/index.tsx +13 -7
  14. package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
  15. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
  16. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  17. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  18. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  19. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
  20. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
  21. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
  22. package/lib/__templates__/native-static/.coze +11 -0
  23. package/lib/__templates__/native-static/index.html +33 -0
  24. package/lib/__templates__/native-static/styles/main.css +136 -0
  25. package/lib/__templates__/native-static/template.config.js +22 -0
  26. package/lib/__templates__/nextjs/AGENTS.md +54 -0
  27. package/lib/__templates__/nextjs/README.md +5 -0
  28. package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
  29. package/lib/__templates__/nextjs/next.config.ts +1 -2
  30. package/lib/__templates__/nextjs/package.json +2 -5
  31. package/lib/__templates__/nextjs/pnpm-lock.yaml +1028 -5
  32. package/lib/__templates__/nextjs/scripts/build.sh +4 -1
  33. package/lib/__templates__/nextjs/scripts/dev.sh +8 -2
  34. package/lib/__templates__/nextjs/scripts/start.sh +7 -1
  35. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
  36. package/lib/__templates__/nextjs/src/app/page.tsx +1 -2
  37. package/lib/__templates__/nextjs/src/server.ts +35 -0
  38. package/lib/__templates__/nextjs/tsconfig.json +1 -1
  39. package/lib/__templates__/nuxt-vue/.coze +12 -0
  40. package/lib/__templates__/nuxt-vue/AGENTS.md +42 -0
  41. package/lib/__templates__/nuxt-vue/README.md +73 -0
  42. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  43. package/lib/__templates__/nuxt-vue/_npmrc +23 -0
  44. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  45. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  46. package/lib/__templates__/nuxt-vue/assets/css/main.css +24 -0
  47. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  48. package/lib/__templates__/nuxt-vue/package.json +35 -0
  49. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  50. package/lib/__templates__/nuxt-vue/postcss.config.mjs +8 -0
  51. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  52. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  53. package/lib/__templates__/nuxt-vue/scripts/build.sh +14 -0
  54. package/lib/__templates__/nuxt-vue/scripts/dev.sh +39 -0
  55. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  56. package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
  57. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  58. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  59. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  60. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  61. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  62. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  63. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +107 -36
  64. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -1
  65. package/lib/__templates__/taro/README.md +61 -45
  66. package/lib/__templates__/taro/config/index.ts +106 -41
  67. package/lib/__templates__/taro/config/prod.ts +4 -5
  68. package/lib/__templates__/taro/eslint.config.mjs +82 -4
  69. package/lib/__templates__/taro/package.json +22 -7
  70. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  71. package/lib/__templates__/taro/pnpm-lock.yaml +924 -220
  72. package/lib/__templates__/taro/server/package.json +0 -1
  73. package/lib/__templates__/taro/src/app.css +140 -36
  74. package/lib/__templates__/taro/src/app.tsx +9 -0
  75. package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
  76. package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
  77. package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
  78. package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
  79. package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
  80. package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
  81. package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
  82. package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
  83. package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
  84. package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
  85. package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
  86. package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
  87. package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
  88. package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
  89. package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
  90. package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
  91. package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
  92. package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
  93. package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
  94. package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
  95. package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
  96. package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
  97. package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
  98. package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
  99. package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
  100. package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
  101. package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
  102. package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
  103. package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
  104. package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
  105. package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
  106. package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
  107. package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
  108. package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
  109. package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
  110. package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
  111. package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
  112. package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
  113. package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
  114. package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
  115. package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
  116. package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
  117. package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
  118. package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
  119. package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
  120. package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
  121. package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
  122. package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
  123. package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
  124. package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
  125. package/lib/__templates__/taro/src/lib/measure.ts +115 -0
  126. package/lib/__templates__/taro/src/lib/platform.ts +12 -0
  127. package/lib/__templates__/taro/src/lib/utils.ts +6 -0
  128. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  129. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  130. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +238 -0
  131. package/lib/__templates__/taro/src/presets/h5-styles.ts +220 -0
  132. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  133. package/lib/__templates__/templates.json +43 -0
  134. package/lib/__templates__/vite/AGENTS.md +41 -0
  135. package/lib/__templates__/vite/README.md +190 -11
  136. package/lib/__templates__/vite/_gitignore +1 -0
  137. package/lib/__templates__/vite/eslint.config.mjs +6 -1
  138. package/lib/__templates__/vite/package.json +10 -3
  139. package/lib/__templates__/vite/pnpm-lock.yaml +755 -15
  140. package/lib/__templates__/vite/scripts/build.sh +4 -1
  141. package/lib/__templates__/vite/scripts/dev.sh +9 -2
  142. package/lib/__templates__/vite/scripts/start.sh +9 -3
  143. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  144. package/lib/__templates__/vite/server/server.ts +65 -0
  145. package/lib/__templates__/vite/server/vite.ts +67 -0
  146. package/lib/__templates__/vite/tsconfig.json +4 -3
  147. package/lib/__templates__/vite/vite.config.ts +5 -0
  148. package/lib/cli.js +3037 -535
  149. package/package.json +10 -3
  150. package/lib/__templates__/expo/client/global.css +0 -78
  151. package/lib/__templates__/expo/client/styles.css +0 -263
  152. package/lib/__templates__/expo/client/uniwind-types.d.ts +0 -10
  153. package/lib/__templates__/taro/src/app.ts +0 -14
  154. package/lib/__templates__/taro/src/utils/h5-styles.ts +0 -33
  155. package/lib/__templates__/taro/src/utils/wx-debug.ts +0 -23
@@ -1,22 +1,77 @@
1
+ import fs from 'node:fs';
1
2
  import path from 'node:path';
2
- import dotenv from 'dotenv';
3
3
 
4
4
  import tailwindcss from '@tailwindcss/postcss';
5
5
  import { UnifiedViteWeappTailwindcssPlugin } from 'weapp-tailwindcss/vite';
6
6
  import { defineConfig, type UserConfigExport } from '@tarojs/cli';
7
7
  import type { PluginItem } from '@tarojs/taro/types/compile/config/project';
8
-
9
- // 加载环境变量
10
- dotenv.config({ path: path.resolve(__dirname, '../.env.local') });
11
-
8
+ import dotenv from 'dotenv';
12
9
  import devConfig from './dev';
13
10
  import prodConfig from './prod';
14
11
  import pkg from '../package.json';
15
12
 
13
+ dotenv.config({ path: path.resolve(__dirname, '../.env.local') });
14
+
15
+ const generateTTProjectConfig = (outputRoot: string) => {
16
+ const config = {
17
+ miniprogramRoot: './',
18
+ projectname: '<%= appName %>',
19
+ appid: process.env.TARO_APP_TT_APPID || '',
20
+ setting: {
21
+ urlCheck: false,
22
+ es6: false,
23
+ postcss: false,
24
+ minified: false,
25
+ },
26
+ };
27
+ const outputDir = path.resolve(__dirname, '..', outputRoot);
28
+ if (!fs.existsSync(outputDir)) {
29
+ fs.mkdirSync(outputDir, { recursive: true });
30
+ }
31
+ fs.writeFileSync(
32
+ path.resolve(outputDir, 'project.config.json'),
33
+ JSON.stringify(config, null, 2),
34
+ );
35
+ };
36
+
16
37
  // https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
17
38
  export default defineConfig<'vite'>(async (merge, _env) => {
18
- const isWeChatApp = process.env.TARO_ENV === 'weapp';
19
- const outputRoot = isWeChatApp ? 'dist' : 'dist-web';
39
+ const outputRootMap: Record<string, string> = {
40
+ weapp: 'dist-weapp',
41
+ tt: 'dist-tt',
42
+ h5: 'dist-web',
43
+ };
44
+ const defaultOutputRoot = outputRootMap[process.env.TARO_ENV || ''] || 'dist';
45
+ const outputRoot = process.env.OUTPUT_ROOT?.trim() || defaultOutputRoot;
46
+ const isH5 = process.env.TARO_ENV === 'h5';
47
+
48
+ const buildMiniCIPluginConfig = () => {
49
+ const hasWeappConfig = !!process.env.TARO_APP_WEAPP_APPID;
50
+ const hasTTConfig = !!process.env.TARO_APP_TT_EMAIL;
51
+ if (!hasWeappConfig && !hasTTConfig) {
52
+ return [];
53
+ }
54
+ const miniCIConfig: Record<string, any> = {
55
+ version: pkg.version,
56
+ desc: pkg.description,
57
+ };
58
+ if (hasWeappConfig) {
59
+ miniCIConfig.weapp = {
60
+ appid: process.env.TARO_APP_WEAPP_APPID,
61
+ privateKeyPath: 'key/private.appid.key',
62
+ };
63
+ }
64
+ if (hasTTConfig) {
65
+ miniCIConfig.tt = {
66
+ email: process.env.TARO_APP_TT_EMAIL,
67
+ password: process.env.TARO_APP_TT_PASSWORD,
68
+ setting: {
69
+ skipDomainCheck: true,
70
+ },
71
+ };
72
+ }
73
+ return [['@tarojs/plugin-mini-ci', miniCIConfig]] as PluginItem[];
74
+ };
20
75
 
21
76
  const baseConfig: UserConfigExport<'vite'> = {
22
77
  projectName: '<%= appName %>',
@@ -33,24 +88,7 @@ export default defineConfig<'vite'>(async (merge, _env) => {
33
88
  },
34
89
  sourceRoot: 'src',
35
90
  outputRoot,
36
- plugins: [
37
- '@tarojs/plugin-generator',
38
- ...(process.env.TARO_APP_WEAPP_APPID
39
- ? ([
40
- [
41
- '@tarojs/plugin-mini-ci',
42
- {
43
- version: pkg.version,
44
- desc: pkg.description,
45
- weapp: {
46
- appid: process.env.TARO_APP_WEAPP_APPID,
47
- privateKeyPath: 'key/private.appid.key',
48
- },
49
- },
50
- ],
51
- ] as PluginItem[])
52
- : []),
53
- ],
91
+ plugins: ['@tarojs/plugin-generator', ...buildMiniCIPluginConfig()],
54
92
  defineConstants: {
55
93
  PROJECT_DOMAIN: JSON.stringify(
56
94
  process.env.PROJECT_DOMAIN ||
@@ -63,6 +101,13 @@ export default defineConfig<'vite'>(async (merge, _env) => {
63
101
  patterns: [],
64
102
  options: {},
65
103
  },
104
+ ...(process.env.TARO_ENV === 'tt' && {
105
+ tt: {
106
+ appid: process.env.TARO_APP_TT_APPID,
107
+ projectName: '<%= appName %>',
108
+ },
109
+ }),
110
+ jsMinimizer: 'esbuild',
66
111
  framework: 'react',
67
112
  compiler: {
68
113
  type: 'vite',
@@ -95,13 +140,24 @@ export default defineConfig<'vite'>(async (merge, _env) => {
95
140
  };
96
141
  },
97
142
  },
98
- UnifiedViteWeappTailwindcssPlugin({
99
- rem2rpx: true,
100
- cssEntries: [
101
- // 你 @import "tailwindcss"; 那个文件的绝对路径
102
- path.resolve(__dirname, '../src/app.css'),
103
- ],
104
- }),
143
+ ...(isH5
144
+ ? []
145
+ : [
146
+ UnifiedViteWeappTailwindcssPlugin({
147
+ rem2rpx: true,
148
+ cssEntries: [path.resolve(__dirname, '../src/app.css')],
149
+ }),
150
+ ]),
151
+ ...(process.env.TARO_ENV === 'tt'
152
+ ? [
153
+ {
154
+ name: 'generate-tt-project-config',
155
+ closeBundle() {
156
+ generateTTProjectConfig(outputRoot);
157
+ },
158
+ },
159
+ ]
160
+ : []),
105
161
  ],
106
162
  },
107
163
  mini: {
@@ -120,18 +176,21 @@ export default defineConfig<'vite'>(async (merge, _env) => {
120
176
  },
121
177
  },
122
178
  h5: {
123
- publicPath: '/',
179
+ publicPath: './',
124
180
  staticDirectory: 'static',
181
+ router: {
182
+ mode: 'hash',
183
+ },
125
184
  devServer: {
126
- port: <%= port %>,
127
- host: '0.0.0.0',
128
- open: false,
129
- proxy: {
130
- '/api': {
131
- target: 'http://localhost:<%= serverPort %>',
132
- changeOrigin: true,
133
- },
185
+ port: <%= port %>,
186
+ host: '0.0.0.0',
187
+ open: false,
188
+ proxy: {
189
+ '/api': {
190
+ target: 'http://localhost:<%= serverPort %>',
191
+ changeOrigin: true,
134
192
  },
193
+ },
135
194
  },
136
195
  miniCssExtractPluginOption: {
137
196
  ignoreOrder: true,
@@ -143,6 +202,12 @@ export default defineConfig<'vite'>(async (merge, _env) => {
143
202
  enable: true,
144
203
  config: {},
145
204
  },
205
+ pxtransform: {
206
+ enable: true,
207
+ config: {
208
+ platform: 'h5',
209
+ },
210
+ },
146
211
  cssModules: {
147
212
  enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
148
213
  config: {
@@ -1,10 +1,9 @@
1
- import type { UserConfigExport } from "@tarojs/cli"
1
+ import type { UserConfigExport } from '@tarojs/cli';
2
2
 
3
3
  export default {
4
4
  mini: {},
5
5
  h5: {
6
- // 确保产物为 es5
7
- legacy: true,
6
+ legacy: false,
8
7
  /**
9
8
  * WebpackChain 插件配置
10
9
  * @docs https://github.com/neutrinojs/webpack-chain
@@ -31,5 +30,5 @@ export default {
31
30
  // postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
32
31
  // }))
33
32
  // }
34
- }
35
- } satisfies UserConfigExport<'vite'>
33
+ },
34
+ } satisfies UserConfigExport<'vite'>;
@@ -16,6 +16,9 @@ export default [
16
16
  'react/jsx-uses-react': 'off',
17
17
  'react/react-in-jsx-scope': 'off',
18
18
  'jsx-quotes': ['error', 'prefer-double'],
19
+ 'react-hooks/exhaustive-deps': 'off',
20
+ 'tailwindcss/classnames-order': 'off',
21
+ 'tailwindcss/no-custom-classname': 'off',
19
22
  },
20
23
  },
21
24
  {
@@ -28,7 +31,66 @@ export default [
28
31
  selector:
29
32
  "MemberExpression[object.name='process'][property.name='env']",
30
33
  message:
31
- '请勿在 src 目录下直接使用 process.env\n如需获取 URL 请求前缀,请使用已经注入全局的 PROJECT_DOMAIN()',
34
+ '工程规范:请勿在 src 目录下直接使用 process.env\n如需获取 URL 请求前缀,请使用已经注入全局的 PROJECT_DOMAIN',
35
+ },
36
+ {
37
+ selector:
38
+ ":matches(ExportNamedDeclaration, ExportDefaultDeclaration) :matches([id.name='Network'], [declaration.id.name='Network'])",
39
+ message:
40
+ "工程规范:禁止自行定义 Network,项目已提供 src/network.ts,请直接使用: import { Network } from '@/network'",
41
+ },
42
+ {
43
+ selector:
44
+ 'Literal[value=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/], TemplateElement[value.raw=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/]',
45
+ message:
46
+ '微信小程序兼容性:禁用 Tailwind 颜色不透明度简写(如 bg-primary/10),该语法在微信小程序下 opacity 会丢失。请拆分写(如 bg-primary bg-opacity-10)。',
47
+ },
48
+ {
49
+ selector:
50
+ 'Literal[value=/(^|\\s)peer-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)peer-[a-z0-9-]+\\b/]',
51
+ message:
52
+ '微信小程序兼容性:不支持 Tailwind 的 peer-*(如 peer-checked、peer-disabled)。',
53
+ },
54
+ {
55
+ selector:
56
+ 'Literal[value=/(^|\\s)group-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)group-[a-z0-9-]+\\b/]',
57
+ message:
58
+ '微信小程序兼容性:不支持 Tailwind 的 group-*(如 group-hover)。',
59
+ },
60
+ {
61
+ selector:
62
+ 'Literal[value=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/], TemplateElement[value.raw=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/]',
63
+ message:
64
+ '微信小程序兼容性:禁用 Tailwind 小数值类名(如 space-y-1.5、w-0.5),请用整数替代(如 space-y-2、w-1)。',
65
+ },
66
+ {
67
+ selector:
68
+ ":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\:has\\(/], TemplateElement[value.raw=/\\:has\\(/])",
69
+ message:
70
+ '微信小程序兼容性:WXSS 不支持 :has(...)(会导致预览上传失败)。',
71
+ },
72
+ {
73
+ selector:
74
+ ":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/(^|\\s)has-[^\\s]+/], TemplateElement[value.raw=/(^|\\s)has-[^\\s]+/])",
75
+ message:
76
+ '微信小程序兼容性:禁用 Tailwind 的 has-* 变体(会生成 :has,导致预览上传失败)。',
77
+ },
78
+ {
79
+ selector:
80
+ ":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&>\\*/], TemplateElement[value.raw=/\\[&>\\*/])",
81
+ message:
82
+ '微信小程序兼容性:禁用 [&>*...](可能生成非法 WXSS,如 >:last-child)。请改为 [&>view] 等明确标签。',
83
+ },
84
+ {
85
+ selector:
86
+ ":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&[^\\]]*\\[data-/], TemplateElement[value.raw=/\\[&[^\\]]*\\[data-/])",
87
+ message:
88
+ '微信小程序兼容性:禁用 Tailwind 任意选择器里的属性选择器(如 [&>[data-...]]),可能导致预览上传失败。',
89
+ },
90
+ {
91
+ selector:
92
+ ":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/], TemplateElement[value.raw=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/])",
93
+ message: '微信小程序兼容性:WXSS 不支持 ~(会导致预览上传失败)。',
32
94
  },
33
95
  ],
34
96
  'no-restricted-properties': [
@@ -36,17 +98,33 @@ export default [
36
98
  {
37
99
  object: 'Taro',
38
100
  property: 'request',
39
- message: '请使用 Network.request 替代 Taro.request',
101
+ message:
102
+ "工程规范:请使用 Network.request 替代 Taro.request,导入方式: import { Network } from '@/network'",
40
103
  },
41
104
  {
42
105
  object: 'Taro',
43
106
  property: 'uploadFile',
44
- message: '请使用 Network.uploadFile 替代 Taro.uploadFile',
107
+ message:
108
+ "工程规范:请使用 Network.uploadFile 替代 Taro.uploadFile,导入方式: import { Network } from '@/network'",
45
109
  },
46
110
  {
47
111
  object: 'Taro',
48
112
  property: 'downloadFile',
49
- message: '请使用 Network.downloadFile 替代 Taro.downloadFile',
113
+ message:
114
+ "工程规范:请使用 Network.downloadFile 替代 Taro.downloadFile,导入方式: import { Network } from '@/network'",
115
+ },
116
+ ],
117
+ },
118
+ },
119
+ {
120
+ files: ['src/pages/index/index.tsx'],
121
+ rules: {
122
+ 'no-restricted-syntax': [
123
+ 'error',
124
+ {
125
+ selector: 'JSXText[value=/应用开发中/]',
126
+ message:
127
+ '工程规范:检测到首页 (src/pages/index/index) 仍为默认占位页面,这会导致用户无法进入新增页面,请根据用户需求开发实际的首页功能和界面。如果已经开发了新的首页,也需要删除旧首页,并更新 src/app.config.ts 文件',
50
128
  },
51
129
  ],
52
130
  },
@@ -4,23 +4,27 @@
4
4
  "private": true,
5
5
  "description": "Coze Mini Program Application",
6
6
  "scripts": {
7
- "build": "pnpm exec concurrently -n lint,tsc,web,weapp,server -c red,blue,green,yellow,magenta \"pnpm lint:build\" \"pnpm tsc\" \"pnpm build:web\" \"pnpm build:weapp\" \"pnpm build:server\"",
7
+ "build": "pnpm exec concurrently --kill-others-on-fail --kill-signal SIGKILL -n lint,tsc,web,weapp,tt,server -c red,blue,green,yellow,cyan,magenta \"pnpm lint:build\" \"pnpm tsc\" \"pnpm build:web\" \"pnpm build:weapp\" \"pnpm build:tt\" \"pnpm build:server\"",
8
8
  "build:server": "pnpm --filter server build",
9
+ "build:tt": "taro build --type tt",
9
10
  "build:weapp": "taro build --type weapp",
10
11
  "build:web": "taro build --type h5",
11
- "dev": "pnpm exec concurrently -n web,server -c blue,green \"pnpm dev:web\" \"pnpm dev:server\"",
12
+ "dev": "pnpm exec concurrently --kill-others --kill-signal SIGKILL -n web,server -c blue,green \"pnpm dev:web\" \"pnpm dev:server\"",
12
13
  "dev:server": "pnpm --filter server dev",
14
+ "dev:tt": "taro build --type tt --watch",
13
15
  "dev:weapp": "taro build --type weapp --watch",
14
16
  "dev:web": "taro build --type h5 --watch",
15
17
  "preinstall": "npx only-allow pnpm",
16
18
  "postinstall": "weapp-tw patch",
19
+ "kill:all": "pkill -9 -f 'concurrently' 2>/dev/null || true; pkill -9 -f 'nest start' 2>/dev/null || true; pkill -9 -f 'taro build' 2>/dev/null || true; pkill -9 -f 'node.*dev' 2>/dev/null || true; echo 'All dev processes cleaned'",
17
20
  "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
18
21
  "lint:build": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --max-warnings=0",
19
22
  "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
20
23
  "new": "taro new",
24
+ "preview:tt": "taro build --type tt --preview",
21
25
  "preview:weapp": "taro build --type weapp --preview",
22
26
  "tsc": "npx tsc --noEmit --skipLibCheck",
23
- "validate": "pnpm exec concurrently -n lint,tsc -c red,blue \"pnpm lint:build\" \"pnpm tsc\""
27
+ "validate": "pnpm exec concurrently --kill-others-on-fail --kill-signal SIGKILL -n lint,tsc -c red,blue \"pnpm lint:build\" \"pnpm tsc\""
24
28
  },
25
29
  "lint-staged": {
26
30
  "src/**/*.{js,jsx,ts,tsx}": [
@@ -38,15 +42,20 @@
38
42
  "@tarojs/helper": "4.1.9",
39
43
  "@tarojs/plugin-framework-react": "4.1.9",
40
44
  "@tarojs/plugin-platform-h5": "4.1.9",
45
+ "@tarojs/plugin-platform-tt": "4.1.9",
41
46
  "@tarojs/plugin-platform-weapp": "4.1.9",
42
47
  "@tarojs/react": "4.1.9",
43
48
  "@tarojs/runtime": "4.1.9",
44
49
  "@tarojs/shared": "4.1.9",
45
50
  "@tarojs/taro": "4.1.9",
46
- "drizzle-kit": "^0.31.8",
47
- "lucide-react-taro": "^1.1.1",
51
+ "class-variance-authority": "^0.7.1",
52
+ "clsx": "^2.1.1",
53
+ "date-fns": "^4.1.0",
54
+ "lucide-react-taro": "^1.3.0",
48
55
  "react": "^18.0.0",
49
56
  "react-dom": "^18.0.0",
57
+ "tailwind-merge": "^3.5.0",
58
+ "tailwindcss-animate": "^1.0.7",
50
59
  "zustand": "^5.0.9"
51
60
  },
52
61
  "devDependencies": {
@@ -59,7 +68,6 @@
59
68
  "@tarojs/plugin-generator": "4.1.9",
60
69
  "@tarojs/plugin-mini-ci": "^4.1.9",
61
70
  "@tarojs/vite-runner": "4.1.9",
62
- "@types/dotenv": "^8.2.3",
63
71
  "@types/minimatch": "^5",
64
72
  "@types/react": "^18.0.0",
65
73
  "@vitejs/plugin-react": "^4.3.0",
@@ -70,6 +78,7 @@
70
78
  "eslint-config-taro": "4.1.9",
71
79
  "eslint-plugin-react": "^7.34.1",
72
80
  "eslint-plugin-react-hooks": "^4.4.0",
81
+ "eslint-plugin-tailwindcss": "^3.18.2",
73
82
  "less": "^4.2.0",
74
83
  "lint-staged": "^16.1.2",
75
84
  "miniprogram-ci": "^2.1.26",
@@ -80,14 +89,20 @@
80
89
  "stylelint-config-standard": "^38.0.0",
81
90
  "tailwindcss": "^4.1.18",
82
91
  "terser": "^5.30.4",
92
+ "tt-ide-cli": "^0.1.31",
83
93
  "typescript": "^5.4.5",
84
94
  "vite": "^4.2.0",
85
- "weapp-tailwindcss": "^4.9.2"
95
+ "weapp-tailwindcss": "^4.10.3"
86
96
  },
87
97
  "packageManager": "pnpm@9.0.0",
88
98
  "engines": {
89
99
  "pnpm": ">=9.0.0"
90
100
  },
101
+ "pnpm": {
102
+ "patchedDependencies": {
103
+ "@tarojs/plugin-mini-ci@4.1.9": "patches/@tarojs__plugin-mini-ci@4.1.9.patch"
104
+ }
105
+ },
91
106
  "templateInfo": {
92
107
  "name": "default",
93
108
  "typescript": true,
@@ -0,0 +1,30 @@
1
+ diff --git a/dist/TTCI.js b/dist/TTCI.js
2
+ index e5fe6a5f9a0ca8670ffa2b7e14cdfd8d49d0d792..6f24020a3388ea8fc7d1cbc41c1df104a8c37cb8 100644
3
+ --- a/dist/TTCI.js
4
+ +++ b/dist/TTCI.js
5
+ @@ -63,7 +63,10 @@ class TTCI extends BaseCi_1.default {
6
+ output: previewQrcodePath,
7
+ },
8
+ copyToClipboard: true,
9
+ - cache: true
10
+ + cache: true,
11
+ + ideConfig: {
12
+ + skipDomainCheck: this.pluginOpts.tt && this.pluginOpts.tt.setting && this.pluginOpts.tt.setting.skipDomainCheck
13
+ + }
14
+ });
15
+ console.log(chalk.green(`开发版上传成功 ${new Date().toLocaleString()}\n`));
16
+ const qrContent = previewResult.shortUrl;
17
+ diff --git a/dist/index.js b/dist/index.js
18
+ index bb245e34a477bcd738b18fdd754b252a456efe4f..588fe56131be52de2d798ee959ef257b4fa53313 100644
19
+ --- a/dist/index.js
20
+ +++ b/dist/index.js
21
+ @@ -43,7 +43,8 @@ exports.default = (ctx, _pluginOpts) => {
22
+ /** 字节跳动小程序上传配置 */
23
+ tt: joi.object({
24
+ email: joi.string().required(),
25
+ - password: joi.string().required()
26
+ + password: joi.string().required(),
27
+ + setting: joi.object()
28
+ }),
29
+ /** 阿里小程序上传配置 */
30
+ alipay: joi.alternatives().try(joi.object({