@coze-arch/cli 0.0.1-alpha.89faa2 → 0.0.1-alpha.8a7e7e

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 (130) hide show
  1. package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +30 -21
  2. package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +2 -2
  3. package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +2 -2
  4. package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +46 -0
  5. package/lib/__templates__/expo/README.md +4 -2
  6. package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
  7. package/lib/__templates__/expo/client/app/_layout.tsx +15 -12
  8. package/lib/__templates__/expo/client/app/index.tsx +1 -1
  9. package/lib/__templates__/expo/client/app.config.ts +4 -3
  10. package/lib/__templates__/expo/client/components/Screen.tsx +1 -17
  11. package/lib/__templates__/expo/client/components/ThemedView.tsx +1 -2
  12. package/lib/__templates__/expo/client/constants/theme.ts +23 -700
  13. package/lib/__templates__/expo/client/declarations.d.ts +5 -0
  14. package/lib/__templates__/expo/client/eslint.config.mjs +33 -10
  15. package/lib/__templates__/expo/client/hooks/{useColorScheme.ts → useColorScheme.tsx} +20 -6
  16. package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
  17. package/lib/__templates__/expo/client/hooks/useTheme.ts +26 -6
  18. package/lib/__templates__/expo/client/metro.config.js +3 -0
  19. package/lib/__templates__/expo/client/package.json +36 -34
  20. package/lib/__templates__/expo/client/screens/{home → demo}/index.tsx +7 -3
  21. package/lib/__templates__/expo/client/screens/{home → demo}/styles.ts +10 -6
  22. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
  23. package/lib/__templates__/expo/client/utils/index.ts +22 -0
  24. package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
  25. package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
  26. package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
  27. package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
  28. package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
  29. package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -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 +3 -0
  33. package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
  34. package/lib/__templates__/expo/pnpm-lock.yaml +1332 -2620
  35. package/lib/__templates__/expo/server/build.js +21 -0
  36. package/lib/__templates__/expo/server/package.json +10 -7
  37. package/lib/__templates__/expo/server/src/index.ts +3 -1
  38. package/lib/__templates__/expo/template.config.js +56 -0
  39. package/lib/__templates__/native-static/.coze +11 -0
  40. package/lib/__templates__/native-static/index.html +33 -0
  41. package/lib/__templates__/native-static/styles/main.css +136 -0
  42. package/lib/__templates__/native-static/template.config.js +22 -0
  43. package/lib/__templates__/nextjs/.babelrc +15 -0
  44. package/lib/__templates__/nextjs/_npmrc +1 -0
  45. package/lib/__templates__/nextjs/next.config.ts +3 -1
  46. package/lib/__templates__/nextjs/package.json +11 -1
  47. package/lib/__templates__/nextjs/pnpm-lock.yaml +2682 -1786
  48. package/lib/__templates__/nextjs/src/app/layout.tsx +5 -3
  49. package/lib/__templates__/nextjs/src/app/page.tsx +17 -59
  50. package/lib/__templates__/nextjs/template.config.js +52 -11
  51. package/lib/__templates__/taro/.coze +14 -0
  52. package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
  53. package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
  54. package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
  55. package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
  56. package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
  57. package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
  58. package/lib/__templates__/taro/README.md +751 -0
  59. package/lib/__templates__/taro/_gitignore +40 -0
  60. package/lib/__templates__/taro/_npmrc +18 -0
  61. package/lib/__templates__/taro/babel.config.js +12 -0
  62. package/lib/__templates__/taro/config/dev.ts +9 -0
  63. package/lib/__templates__/taro/config/index.ts +223 -0
  64. package/lib/__templates__/taro/config/prod.ts +34 -0
  65. package/lib/__templates__/taro/eslint.config.mjs +80 -0
  66. package/lib/__templates__/taro/key/private.appid.key +0 -0
  67. package/lib/__templates__/taro/package.json +107 -0
  68. package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
  69. package/lib/__templates__/taro/pnpm-lock.yaml +23100 -0
  70. package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
  71. package/lib/__templates__/taro/project.config.json +15 -0
  72. package/lib/__templates__/taro/server/nest-cli.json +10 -0
  73. package/lib/__templates__/taro/server/package.json +40 -0
  74. package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
  75. package/lib/__templates__/taro/server/src/app.module.ts +10 -0
  76. package/lib/__templates__/taro/server/src/app.service.ts +8 -0
  77. package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
  78. package/lib/__templates__/taro/server/src/main.ts +49 -0
  79. package/lib/__templates__/taro/server/tsconfig.json +24 -0
  80. package/lib/__templates__/taro/src/app.config.ts +11 -0
  81. package/lib/__templates__/taro/src/app.css +52 -0
  82. package/lib/__templates__/taro/src/app.tsx +9 -0
  83. package/lib/__templates__/taro/src/index.html +39 -0
  84. package/lib/__templates__/taro/src/network.ts +39 -0
  85. package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
  86. package/lib/__templates__/taro/src/pages/index/index.css +1 -0
  87. package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
  88. package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
  89. package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
  90. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +201 -0
  91. package/lib/__templates__/taro/src/presets/h5-styles.ts +142 -0
  92. package/lib/__templates__/taro/src/presets/index.tsx +18 -0
  93. package/lib/__templates__/taro/stylelint.config.mjs +4 -0
  94. package/lib/__templates__/taro/template.config.js +68 -0
  95. package/lib/__templates__/taro/tsconfig.json +29 -0
  96. package/lib/__templates__/taro/types/global.d.ts +32 -0
  97. package/lib/__templates__/templates.json +75 -0
  98. package/lib/__templates__/vite/_npmrc +1 -0
  99. package/lib/__templates__/vite/package.json +11 -1
  100. package/lib/__templates__/vite/pnpm-lock.yaml +803 -168
  101. package/lib/__templates__/vite/src/main.ts +17 -48
  102. package/lib/__templates__/vite/template.config.js +63 -6
  103. package/lib/__templates__/vite/vite.config.ts +1 -0
  104. package/lib/__templates__/vite-vue/.coze +12 -0
  105. package/lib/__templates__/vite-vue/README.md +451 -0
  106. package/lib/__templates__/vite-vue/_gitignore +66 -0
  107. package/lib/__templates__/vite-vue/_npmrc +23 -0
  108. package/lib/__templates__/vite-vue/eslint.config.mjs +9 -0
  109. package/lib/__templates__/vite-vue/index.html +13 -0
  110. package/lib/__templates__/vite-vue/package.json +38 -0
  111. package/lib/__templates__/vite-vue/pnpm-lock.yaml +3132 -0
  112. package/lib/__templates__/vite-vue/postcss.config.mjs +6 -0
  113. package/lib/__templates__/vite-vue/scripts/build.sh +14 -0
  114. package/lib/__templates__/vite-vue/scripts/dev.sh +32 -0
  115. package/lib/__templates__/vite-vue/scripts/prepare.sh +9 -0
  116. package/lib/__templates__/vite-vue/scripts/start.sh +15 -0
  117. package/lib/__templates__/vite-vue/src/App.vue +6 -0
  118. package/lib/__templates__/vite-vue/src/index.css +29 -0
  119. package/lib/__templates__/vite-vue/src/main.ts +8 -0
  120. package/lib/__templates__/vite-vue/src/router/index.ts +17 -0
  121. package/lib/__templates__/vite-vue/src/views/Home.vue +38 -0
  122. package/lib/__templates__/vite-vue/src/vite-env.d.ts +8 -0
  123. package/lib/__templates__/vite-vue/tailwind.config.js +9 -0
  124. package/lib/__templates__/vite-vue/template.config.js +127 -0
  125. package/lib/__templates__/vite-vue/tsconfig.json +17 -0
  126. package/lib/__templates__/vite-vue/vite.config.ts +28 -0
  127. package/lib/cli.js +884 -145
  128. package/package.json +2 -1
  129. package/lib/__templates__/expo/client/app/home.tsx +0 -1
  130. package/lib/__templates__/expo/client/assets/images/coze-logo.png +0 -0
@@ -0,0 +1,40 @@
1
+ # Dependencies
2
+ node_modules/
3
+ .pnpm-store/
4
+
5
+ # Production
6
+ dist/
7
+ build/
8
+ dist-*/
9
+
10
+ # Misc
11
+ .DS_Store
12
+ .env
13
+ # .env.local
14
+ .env.development.local
15
+ .env.test.local
16
+ .env.production.local
17
+
18
+ # Logs
19
+ npm-debug.log*
20
+ yarn-debug.log*
21
+ yarn-error.log*
22
+ pnpm-debug.log*
23
+
24
+ # Editor directories and files
25
+ .idea/
26
+ .vscode/
27
+ *.suo
28
+ *.ntvs*
29
+ *.njsproj
30
+ *.sln
31
+ *.sw?
32
+
33
+ # Taro specific
34
+ .taro/
35
+
36
+ # OS X
37
+ .DS_Store
38
+
39
+ # Key
40
+ # key/
@@ -0,0 +1,18 @@
1
+ loglevel=error
2
+ registry=https://registry.npmmirror.com
3
+
4
+ strictStorePkgContentCheck=false
5
+ verifyStoreIntegrity=false
6
+
7
+ network-concurrency=16
8
+ fetch-retries=3
9
+ fetch-timeout=60000
10
+
11
+ strict-peer-dependencies=false
12
+
13
+ auto-install-peers=true
14
+
15
+ lockfile=true
16
+ prefer-frozen-lockfile=true
17
+
18
+ resolution-mode=highest
@@ -0,0 +1,12 @@
1
+ // babel-preset-taro 更多选项和默认值:
2
+ // https://docs.taro.zone/docs/next/babel-config
3
+ module.exports = {
4
+ presets: [
5
+ ['taro', {
6
+ framework: 'react',
7
+ ts: true,
8
+ compiler: 'vite',
9
+ useBuiltIns: false
10
+ }]
11
+ ]
12
+ }
@@ -0,0 +1,9 @@
1
+ import type { UserConfigExport } from "@tarojs/cli"
2
+
3
+ export default {
4
+
5
+ mini: {
6
+ debugReact: true,
7
+ },
8
+ h5: {}
9
+ } satisfies UserConfigExport<'vite'>
@@ -0,0 +1,223 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ import tailwindcss from '@tailwindcss/postcss';
5
+ import { UnifiedViteWeappTailwindcssPlugin } from 'weapp-tailwindcss/vite';
6
+ import { defineConfig, type UserConfigExport } from '@tarojs/cli';
7
+ import type { PluginItem } from '@tarojs/taro/types/compile/config/project';
8
+ import dotenv from 'dotenv';
9
+ import devConfig from './dev';
10
+ import prodConfig from './prod';
11
+ import pkg from '../package.json';
12
+
13
+ dotenv.config({ path: path.resolve(__dirname, '../.env.local') });
14
+
15
+ const generateTTProjectConfig = () => {
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, '../dist-tt');
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
+
37
+ // https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
38
+ export default defineConfig<'vite'>(async (merge, _env) => {
39
+ const outputRootMap: Record<string, string> = {
40
+ weapp: 'dist',
41
+ tt: 'dist-tt',
42
+ h5: 'dist-web',
43
+ };
44
+ const outputRoot = outputRootMap[process.env.TARO_ENV || ''] || 'dist-web';
45
+
46
+ const buildMiniCIPluginConfig = () => {
47
+ const hasWeappConfig = !!process.env.TARO_APP_WEAPP_APPID
48
+ const hasTTConfig = !!process.env.TARO_APP_TT_EMAIL
49
+ if (!hasWeappConfig && !hasTTConfig) {
50
+ return []
51
+ }
52
+ const miniCIConfig: Record<string, any> = {
53
+ version: pkg.version,
54
+ desc: pkg.description,
55
+ }
56
+ if (hasWeappConfig) {
57
+ miniCIConfig.weapp = {
58
+ appid: process.env.TARO_APP_WEAPP_APPID,
59
+ privateKeyPath: 'key/private.appid.key',
60
+ }
61
+ }
62
+ if (hasTTConfig) {
63
+ miniCIConfig.tt = {
64
+ email: process.env.TARO_APP_TT_EMAIL,
65
+ password: process.env.TARO_APP_TT_PASSWORD,
66
+ setting: {
67
+ skipDomainCheck: true,
68
+ },
69
+ }
70
+ }
71
+ return [['@tarojs/plugin-mini-ci', miniCIConfig]] as PluginItem[]
72
+ }
73
+
74
+ const baseConfig: UserConfigExport<'vite'> = {
75
+ projectName: '<%= appName %>',
76
+ date: '2026-1-13',
77
+ alias: {
78
+ '@': path.resolve(__dirname, '..', 'src'),
79
+ },
80
+ designWidth: 750,
81
+ deviceRatio: {
82
+ 640: 2.34 / 2,
83
+ 750: 1,
84
+ 375: 2,
85
+ 828: 1.81 / 2,
86
+ },
87
+ sourceRoot: 'src',
88
+ outputRoot,
89
+ plugins: ['@tarojs/plugin-generator', ...buildMiniCIPluginConfig()],
90
+ defineConstants: {
91
+ PROJECT_DOMAIN: JSON.stringify(
92
+ process.env.PROJECT_DOMAIN ||
93
+ process.env.COZE_PROJECT_DOMAIN_DEFAULT ||
94
+ '',
95
+ ),
96
+ TARO_ENV: JSON.stringify(process.env.TARO_ENV),
97
+ },
98
+ copy: {
99
+ patterns: [],
100
+ options: {},
101
+ },
102
+ ...(process.env.TARO_ENV === 'tt' && {
103
+ tt: {
104
+ appid: process.env.TARO_APP_TT_APPID,
105
+ projectName: '<%= appName %>',
106
+ },
107
+ }),
108
+ jsMinimizer: 'esbuild',
109
+ framework: 'react',
110
+ compiler: {
111
+ type: 'vite',
112
+ vitePlugins: [
113
+ {
114
+ name: 'postcss-config-loader-plugin',
115
+ config(config) {
116
+ // 通过 postcss 配置注册 tailwindcss 插件
117
+ if (typeof config.css?.postcss === 'object') {
118
+ config.css?.postcss.plugins?.unshift(tailwindcss());
119
+ }
120
+ },
121
+ },
122
+ {
123
+ name: 'hmr-config-plugin',
124
+ config() {
125
+ if (!process.env.PROJECT_DOMAIN) {
126
+ return;
127
+ }
128
+ return {
129
+ server: {
130
+ hmr: {
131
+ overlay: true,
132
+ path: '/hot/vite-hmr',
133
+ port: 6000,
134
+ clientPort: 443,
135
+ timeout: 30000,
136
+ },
137
+ },
138
+ };
139
+ },
140
+ },
141
+ UnifiedViteWeappTailwindcssPlugin({
142
+ rem2rpx: true,
143
+ cssEntries: [path.resolve(__dirname, '../src/app.css')],
144
+ }),
145
+ ...(process.env.TARO_ENV === 'tt'
146
+ ? [
147
+ {
148
+ name: 'generate-tt-project-config',
149
+ closeBundle() {
150
+ generateTTProjectConfig();
151
+ },
152
+ },
153
+ ]
154
+ : []),
155
+ ],
156
+ },
157
+ mini: {
158
+ postcss: {
159
+ pxtransform: {
160
+ enable: true,
161
+ config: {},
162
+ },
163
+ cssModules: {
164
+ enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
165
+ config: {
166
+ namingPattern: 'module', // 转换模式,取值为 global/module
167
+ generateScopedName: '[name]__[local]___[hash:base64:5]',
168
+ },
169
+ },
170
+ },
171
+ },
172
+ h5: {
173
+ publicPath: '/',
174
+ staticDirectory: 'static',
175
+ devServer: {
176
+ port: <%= port %>,
177
+ host: '0.0.0.0',
178
+ open: false,
179
+ proxy: {
180
+ '/api': {
181
+ target: 'http://localhost:<%= serverPort %>',
182
+ changeOrigin: true,
183
+ },
184
+ },
185
+ },
186
+ miniCssExtractPluginOption: {
187
+ ignoreOrder: true,
188
+ filename: 'css/[name].[hash].css',
189
+ chunkFilename: 'css/[name].[chunkhash].css',
190
+ },
191
+ postcss: {
192
+ autoprefixer: {
193
+ enable: true,
194
+ config: {},
195
+ },
196
+ cssModules: {
197
+ enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
198
+ config: {
199
+ namingPattern: 'module', // 转换模式,取值为 global/module
200
+ generateScopedName: '[name]__[local]___[hash:base64:5]',
201
+ },
202
+ },
203
+ },
204
+ },
205
+ rn: {
206
+ appName: '<%= appName %>',
207
+ postcss: {
208
+ cssModules: {
209
+ enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
210
+ },
211
+ },
212
+ },
213
+ };
214
+
215
+ process.env.BROWSERSLIST_ENV = process.env.NODE_ENV;
216
+
217
+ if (process.env.NODE_ENV === 'development') {
218
+ // 本地开发构建配置(不混淆压缩)
219
+ return merge({}, baseConfig, devConfig);
220
+ }
221
+ // 生产构建配置(默认开启压缩混淆等)
222
+ return merge({}, baseConfig, prodConfig);
223
+ });
@@ -0,0 +1,34 @@
1
+ import type { UserConfigExport } from '@tarojs/cli';
2
+
3
+ export default {
4
+ mini: {},
5
+ h5: {
6
+ legacy: false,
7
+ /**
8
+ * WebpackChain 插件配置
9
+ * @docs https://github.com/neutrinojs/webpack-chain
10
+ */
11
+ // webpackChain (chain) {
12
+ // /**
13
+ // * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
14
+ // * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
15
+ // */
16
+ // chain.plugin('analyzer')
17
+ // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
18
+ // /**
19
+ // * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
20
+ // * @docs https://github.com/chrisvfritz/prerender-spa-plugin
21
+ // */
22
+ // const path = require('path')
23
+ // const Prerender = require('prerender-spa-plugin')
24
+ // const staticDir = path.join(__dirname, '..', 'dist')
25
+ // chain
26
+ // .plugin('prerender')
27
+ // .use(new Prerender({
28
+ // staticDir,
29
+ // routes: [ '/pages/index/index' ],
30
+ // postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
31
+ // }))
32
+ // }
33
+ },
34
+ } satisfies UserConfigExport<'vite'>;
@@ -0,0 +1,80 @@
1
+ import { FlatCompat } from '@eslint/eslintrc';
2
+ import { fileURLToPath } from 'node:url';
3
+ import path from 'node:path';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+
8
+ const compat = new FlatCompat({
9
+ baseDirectory: __dirname,
10
+ });
11
+
12
+ export default [
13
+ ...compat.extends('taro/react'),
14
+ {
15
+ rules: {
16
+ 'react/jsx-uses-react': 'off',
17
+ 'react/react-in-jsx-scope': 'off',
18
+ 'jsx-quotes': ['error', 'prefer-double'],
19
+ 'react-hooks/exhaustive-deps': 'off',
20
+ },
21
+ },
22
+ {
23
+ files: ['src/**/*.{js,jsx,ts,tsx}'],
24
+ ignores: ['src/network.ts'],
25
+ rules: {
26
+ 'no-restricted-syntax': [
27
+ 'error',
28
+ {
29
+ selector:
30
+ "MemberExpression[object.name='process'][property.name='env']",
31
+ message:
32
+ '请勿在 src 目录下直接使用 process.env\n如需获取 URL 请求前缀,请使用已经注入全局的 PROJECT_DOMAIN',
33
+ },
34
+ {
35
+ selector:
36
+ ":matches(ExportNamedDeclaration, ExportDefaultDeclaration) :matches([id.name='Network'], [declaration.id.name='Network'])",
37
+ message:
38
+ "禁止自行定义 Network,项目已提供 src/network.ts,请直接使用: import { Network } from '@/network'",
39
+ },
40
+ ],
41
+ 'no-restricted-properties': [
42
+ 'error',
43
+ {
44
+ object: 'Taro',
45
+ property: 'request',
46
+ message:
47
+ "请使用 Network.request 替代 Taro.request,导入方式: import { Network } from '@/network'",
48
+ },
49
+ {
50
+ object: 'Taro',
51
+ property: 'uploadFile',
52
+ message:
53
+ "请使用 Network.uploadFile 替代 Taro.uploadFile,导入方式: import { Network } from '@/network'",
54
+ },
55
+ {
56
+ object: 'Taro',
57
+ property: 'downloadFile',
58
+ message:
59
+ "请使用 Network.downloadFile 替代 Taro.downloadFile,导入方式: import { Network } from '@/network'",
60
+ },
61
+ ],
62
+ },
63
+ },
64
+ {
65
+ files: ['src/pages/index/index.tsx'],
66
+ rules: {
67
+ 'no-restricted-syntax': [
68
+ 'error',
69
+ {
70
+ selector: 'JSXText[value=/应用开发中/]',
71
+ message:
72
+ '检测到首页 (src/pages/index/index) 仍为默认占位页面,这会导致用户无法进入新增页面,请根据用户需求开发实际的首页功能和界面。如果已经开发了新的首页,也需要删除旧首页,并更新 src/app.config.ts 文件',
73
+ },
74
+ ],
75
+ },
76
+ },
77
+ {
78
+ ignores: ['dist/**', 'dist-*/**', 'node_modules/**'],
79
+ },
80
+ ];
File without changes
@@ -0,0 +1,107 @@
1
+ {
2
+ "name": "<%= appName %>",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "description": "Coze Mini Program Application",
6
+ "scripts": {
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
+ "build:server": "pnpm --filter server build",
9
+ "build:tt": "taro build --type tt",
10
+ "build:weapp": "taro build --type weapp",
11
+ "build:web": "taro build --type h5",
12
+ "dev": "pnpm exec concurrently --kill-others --kill-signal SIGKILL -n web,server -c blue,green \"pnpm dev:web\" \"pnpm dev:server\"",
13
+ "dev:server": "pnpm --filter server dev",
14
+ "dev:tt": "taro build --type tt --watch",
15
+ "dev:weapp": "taro build --type weapp --watch",
16
+ "dev:web": "taro build --type h5 --watch",
17
+ "preinstall": "npx only-allow pnpm",
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'",
20
+ "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
21
+ "lint:build": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --max-warnings=0",
22
+ "lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
23
+ "new": "taro new",
24
+ "preview:tt": "taro build --type tt --preview",
25
+ "preview:weapp": "taro build --type weapp --preview",
26
+ "tsc": "npx tsc --noEmit --skipLibCheck",
27
+ "validate": "pnpm exec concurrently --kill-others-on-fail --kill-signal SIGKILL -n lint,tsc -c red,blue \"pnpm lint:build\" \"pnpm tsc\""
28
+ },
29
+ "lint-staged": {
30
+ "src/**/*.{js,jsx,ts,tsx}": [
31
+ "eslint"
32
+ ]
33
+ },
34
+ "browserslist": [
35
+ "last 3 versions",
36
+ "Android >= 4.1",
37
+ "ios >= 8"
38
+ ],
39
+ "dependencies": {
40
+ "@babel/runtime": "^7.24.4",
41
+ "@tarojs/components": "4.1.9",
42
+ "@tarojs/helper": "4.1.9",
43
+ "@tarojs/plugin-framework-react": "4.1.9",
44
+ "@tarojs/plugin-platform-h5": "4.1.9",
45
+ "@tarojs/plugin-platform-tt": "4.1.9",
46
+ "@tarojs/plugin-platform-weapp": "4.1.9",
47
+ "@tarojs/react": "4.1.9",
48
+ "@tarojs/runtime": "4.1.9",
49
+ "@tarojs/shared": "4.1.9",
50
+ "@tarojs/taro": "4.1.9",
51
+ "drizzle-kit": "^0.31.8",
52
+ "lucide-react-taro": "^1.2.0",
53
+ "react": "^18.0.0",
54
+ "react-dom": "^18.0.0",
55
+ "zustand": "^5.0.9"
56
+ },
57
+ "devDependencies": {
58
+ "@babel/core": "^7.24.4",
59
+ "@babel/plugin-transform-class-properties": "7.25.9",
60
+ "@babel/preset-react": "^7.24.1",
61
+ "@eslint/eslintrc": "^3.3.1",
62
+ "@tailwindcss/postcss": "^4.1.18",
63
+ "@tarojs/cli": "4.1.9",
64
+ "@tarojs/plugin-generator": "4.1.9",
65
+ "@tarojs/plugin-mini-ci": "^4.1.9",
66
+ "@tarojs/vite-runner": "4.1.9",
67
+ "@types/minimatch": "^5",
68
+ "@types/react": "^18.0.0",
69
+ "@vitejs/plugin-react": "^4.3.0",
70
+ "babel-preset-taro": "4.1.9",
71
+ "concurrently": "^9.2.1",
72
+ "dotenv": "^17.2.3",
73
+ "eslint": "^8.57.0",
74
+ "eslint-config-taro": "4.1.9",
75
+ "eslint-plugin-react": "^7.34.1",
76
+ "eslint-plugin-react-hooks": "^4.4.0",
77
+ "less": "^4.2.0",
78
+ "lint-staged": "^16.1.2",
79
+ "miniprogram-ci": "^2.1.26",
80
+ "only-allow": "^1.2.2",
81
+ "postcss": "^8.5.6",
82
+ "react-refresh": "^0.14.0",
83
+ "stylelint": "^16.4.0",
84
+ "stylelint-config-standard": "^38.0.0",
85
+ "tailwindcss": "^4.1.18",
86
+ "terser": "^5.30.4",
87
+ "tt-ide-cli": "^0.1.31",
88
+ "typescript": "^5.4.5",
89
+ "vite": "^4.2.0",
90
+ "weapp-tailwindcss": "^4.9.2"
91
+ },
92
+ "packageManager": "pnpm@9.0.0",
93
+ "engines": {
94
+ "pnpm": ">=9.0.0"
95
+ },
96
+ "pnpm": {
97
+ "patchedDependencies": {
98
+ "@tarojs/plugin-mini-ci@4.1.9": "patches/@tarojs__plugin-mini-ci@4.1.9.patch"
99
+ }
100
+ },
101
+ "templateInfo": {
102
+ "name": "default",
103
+ "typescript": true,
104
+ "css": "Less",
105
+ "framework": "React"
106
+ }
107
+ }
@@ -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({