@coze-arch/cli 0.0.1-alpha.f9be02 → 0.0.1-alpha.fc5c04
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.
- package/lib/__templates__/expo/.coze +1 -1
- package/lib/__templates__/expo/.cozeproj/scripts/dev_build.sh +19 -82
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +78 -88
- package/lib/__templates__/expo/.cozeproj/scripts/prod_build.sh +2 -2
- package/lib/__templates__/expo/.cozeproj/scripts/prod_run.sh +2 -2
- package/lib/__templates__/expo/.cozeproj/scripts/server_dev_run.sh +46 -0
- package/lib/__templates__/expo/README.md +68 -7
- package/lib/__templates__/expo/client/app/+not-found.tsx +30 -0
- package/lib/__templates__/expo/client/{src/app → app}/_layout.tsx +15 -12
- package/lib/__templates__/expo/client/app/index.tsx +1 -0
- package/lib/__templates__/expo/client/app.config.ts +65 -60
- package/lib/__templates__/expo/client/{src/components → components}/Screen.tsx +1 -17
- package/lib/__templates__/expo/client/{src/components → components}/ThemedView.tsx +1 -2
- package/lib/__templates__/expo/client/constants/theme.ts +177 -0
- package/lib/__templates__/expo/client/declarations.d.ts +5 -0
- package/lib/__templates__/expo/client/eslint.config.mjs +33 -10
- package/lib/__templates__/expo/client/hooks/useColorScheme.tsx +48 -0
- package/lib/__templates__/expo/client/hooks/useSafeRouter.ts +152 -0
- package/lib/__templates__/expo/client/hooks/useTheme.ts +33 -0
- package/lib/__templates__/expo/client/metro.config.js +3 -0
- package/lib/__templates__/expo/client/package.json +36 -33
- package/lib/__templates__/expo/client/screens/demo/index.tsx +25 -0
- package/lib/__templates__/expo/client/screens/demo/styles.ts +28 -0
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +1 -0
- package/lib/__templates__/expo/client/tsconfig.json +1 -1
- package/lib/__templates__/expo/client/{src/utils → utils}/index.ts +22 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/names.js +1889 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/rule.js +174 -0
- package/lib/__templates__/expo/eslint-plugins/fontawesome6/v5-only-names.js +388 -0
- package/lib/__templates__/expo/eslint-plugins/react-native/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/react-native/rule.js +64 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/reanimated/rule.js +88 -0
- package/lib/__templates__/expo/package.json +7 -98
- package/lib/__templates__/expo/patches/expo@54.0.33.patch +45 -0
- package/lib/__templates__/expo/pnpm-lock.yaml +1420 -2939
- package/lib/__templates__/expo/server/build.js +21 -0
- package/lib/__templates__/expo/server/package.json +21 -4
- package/lib/__templates__/expo/server/src/index.ts +10 -2
- package/lib/__templates__/expo/server/tsconfig.json +24 -0
- package/lib/__templates__/expo/template.config.js +57 -0
- package/lib/__templates__/native-static/.coze +11 -0
- package/lib/__templates__/native-static/index.html +33 -0
- package/lib/__templates__/native-static/styles/main.css +136 -0
- package/lib/__templates__/native-static/template.config.js +22 -0
- package/lib/__templates__/nextjs/.babelrc +15 -0
- package/lib/__templates__/nextjs/.coze +1 -0
- package/lib/__templates__/nextjs/_npmrc +1 -0
- package/lib/__templates__/nextjs/next.config.ts +12 -0
- package/lib/__templates__/nextjs/package.json +13 -2
- package/lib/__templates__/nextjs/pnpm-lock.yaml +2682 -1786
- package/lib/__templates__/nextjs/scripts/prepare.sh +9 -0
- package/lib/__templates__/nextjs/src/app/globals.css +10 -2
- package/lib/__templates__/nextjs/src/app/layout.tsx +5 -14
- package/lib/__templates__/nextjs/src/app/page.tsx +18 -48
- package/lib/__templates__/nextjs/src/components/ui/resizable.tsx +29 -22
- package/lib/__templates__/nextjs/src/components/ui/sidebar.tsx +228 -230
- package/lib/__templates__/nextjs/template.config.js +67 -2
- package/lib/__templates__/taro/.coze +14 -0
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_build.sh +19 -0
- package/lib/__templates__/taro/.cozeproj/scripts/deploy_run.sh +14 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_build.sh +2 -0
- package/lib/__templates__/taro/.cozeproj/scripts/dev_run.sh +151 -0
- package/lib/__templates__/taro/.cozeproj/scripts/init_env.sh +5 -0
- package/lib/__templates__/taro/.cozeproj/scripts/pack.sh +24 -0
- package/lib/__templates__/taro/README.md +751 -0
- package/lib/__templates__/taro/_gitignore +40 -0
- package/lib/__templates__/taro/_npmrc +18 -0
- package/lib/__templates__/taro/babel.config.js +12 -0
- package/lib/__templates__/taro/config/dev.ts +9 -0
- package/lib/__templates__/taro/config/index.ts +223 -0
- package/lib/__templates__/taro/config/prod.ts +34 -0
- package/lib/__templates__/taro/eslint.config.mjs +80 -0
- package/lib/__templates__/taro/key/private.appid.key +0 -0
- package/lib/__templates__/taro/package.json +107 -0
- package/lib/__templates__/taro/patches/@tarojs__plugin-mini-ci@4.1.9.patch +30 -0
- package/lib/__templates__/taro/pnpm-lock.yaml +23100 -0
- package/lib/__templates__/taro/pnpm-workspace.yaml +2 -0
- package/lib/__templates__/taro/project.config.json +15 -0
- package/lib/__templates__/taro/server/nest-cli.json +10 -0
- package/lib/__templates__/taro/server/package.json +40 -0
- package/lib/__templates__/taro/server/src/app.controller.ts +23 -0
- package/lib/__templates__/taro/server/src/app.module.ts +10 -0
- package/lib/__templates__/taro/server/src/app.service.ts +8 -0
- package/lib/__templates__/taro/server/src/interceptors/http-status.interceptor.ts +23 -0
- package/lib/__templates__/taro/server/src/main.ts +49 -0
- package/lib/__templates__/taro/server/tsconfig.json +24 -0
- package/lib/__templates__/taro/src/app.config.ts +11 -0
- package/lib/__templates__/taro/src/app.css +52 -0
- package/lib/__templates__/taro/src/app.tsx +9 -0
- package/lib/__templates__/taro/src/index.html +39 -0
- package/lib/__templates__/taro/src/network.ts +39 -0
- package/lib/__templates__/taro/src/pages/index/index.config.ts +3 -0
- package/lib/__templates__/taro/src/pages/index/index.css +1 -0
- package/lib/__templates__/taro/src/pages/index/index.tsx +33 -0
- package/lib/__templates__/taro/src/presets/dev-debug.ts +23 -0
- package/lib/__templates__/taro/src/presets/h5-container.tsx +15 -0
- package/lib/__templates__/taro/src/presets/h5-navbar.tsx +201 -0
- package/lib/__templates__/taro/src/presets/h5-styles.ts +142 -0
- package/lib/__templates__/taro/src/presets/index.tsx +18 -0
- package/lib/__templates__/taro/stylelint.config.mjs +4 -0
- package/lib/__templates__/taro/template.config.js +68 -0
- package/lib/__templates__/taro/tsconfig.json +29 -0
- package/lib/__templates__/taro/types/global.d.ts +32 -0
- package/lib/__templates__/templates.json +135 -42
- package/lib/__templates__/vite/.coze +1 -0
- package/lib/__templates__/vite/_npmrc +1 -0
- package/lib/__templates__/vite/eslint.config.mjs +9 -0
- package/lib/__templates__/vite/package.json +14 -1
- package/lib/__templates__/vite/pnpm-lock.yaml +1581 -105
- package/lib/__templates__/vite/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite/src/main.ts +17 -48
- package/lib/__templates__/vite/template.config.js +67 -6
- package/lib/__templates__/vite/vite.config.ts +1 -0
- package/lib/__templates__/vite-vue/.coze +12 -0
- package/lib/__templates__/vite-vue/README.md +451 -0
- package/lib/__templates__/vite-vue/_gitignore +66 -0
- package/lib/__templates__/vite-vue/_npmrc +23 -0
- package/lib/__templates__/vite-vue/eslint.config.mjs +9 -0
- package/lib/__templates__/vite-vue/index.html +13 -0
- package/lib/__templates__/vite-vue/package.json +38 -0
- package/lib/__templates__/vite-vue/pnpm-lock.yaml +3132 -0
- package/lib/__templates__/vite-vue/postcss.config.mjs +6 -0
- package/lib/__templates__/vite-vue/scripts/build.sh +14 -0
- package/lib/__templates__/vite-vue/scripts/dev.sh +32 -0
- package/lib/__templates__/vite-vue/scripts/prepare.sh +9 -0
- package/lib/__templates__/vite-vue/scripts/start.sh +15 -0
- package/lib/__templates__/vite-vue/src/App.vue +6 -0
- package/lib/__templates__/vite-vue/src/index.css +29 -0
- package/lib/__templates__/vite-vue/src/main.ts +8 -0
- package/lib/__templates__/vite-vue/src/router/index.ts +17 -0
- package/lib/__templates__/vite-vue/src/views/Home.vue +38 -0
- package/lib/__templates__/vite-vue/src/vite-env.d.ts +8 -0
- package/lib/__templates__/vite-vue/tailwind.config.js +9 -0
- package/lib/__templates__/vite-vue/template.config.js +127 -0
- package/lib/__templates__/vite-vue/tsconfig.json +17 -0
- package/lib/__templates__/vite-vue/vite.config.ts +28 -0
- package/lib/cli.js +1006 -154
- package/package.json +6 -3
- package/lib/__templates__/expo/client/src/app/index.ts +0 -1
- package/lib/__templates__/expo/client/src/constants/theme.ts +0 -850
- package/lib/__templates__/expo/client/src/hooks/useColorScheme.ts +0 -1
- package/lib/__templates__/expo/client/src/hooks/useTheme.ts +0 -13
- package/lib/__templates__/expo/client/src/screens/home/index.tsx +0 -50
- package/lib/__templates__/expo/client/src/screens/home/styles.ts +0 -60
- package/lib/__templates__/nextjs/.vscode/settings.json +0 -121
- package/lib/__templates__/vite/.vscode/settings.json +0 -7
- /package/lib/__templates__/expo/client/{src/assets → assets}/fonts/SpaceMono-Regular.ttf +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/adaptive-icon.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/default-avatar.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/favicon.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/icon.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/partial-react-logo.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@2x.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/react-logo@3x.png +0 -0
- /package/lib/__templates__/expo/client/{src/assets → assets}/images/splash-icon.png +0 -0
- /package/lib/__templates__/expo/client/{src/components → components}/SmartDateInput.tsx +0 -0
- /package/lib/__templates__/expo/client/{src/components → components}/ThemedText.tsx +0 -0
- /package/lib/__templates__/expo/client/{src/contexts → contexts}/AuthContext.tsx +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* H5 端特殊样式注入
|
|
3
|
+
* 如无必要,请勿修改本文件
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const H5_BASE_STYLES = `
|
|
7
|
+
/* H5 端隐藏 TabBar 空图标(只隐藏没有 src 的图标) */
|
|
8
|
+
.weui-tabbar__icon:not([src]),
|
|
9
|
+
.weui-tabbar__icon[src=''] {
|
|
10
|
+
display: none !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.weui-tabbar__item:has(.weui-tabbar__icon:not([src])) .weui-tabbar__label,
|
|
14
|
+
.weui-tabbar__item:has(.weui-tabbar__icon[src='']) .weui-tabbar__label {
|
|
15
|
+
margin-top: 0 !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Vite 错误覆盖层无法选择文本的问题 */
|
|
19
|
+
vite-error-overlay {
|
|
20
|
+
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
21
|
+
-webkit-user-select: text !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
vite-error-overlay::part(window) {
|
|
25
|
+
max-width: 90vw;
|
|
26
|
+
padding: 10px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.taro_page {
|
|
30
|
+
overflow: auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
::-webkit-scrollbar {
|
|
34
|
+
width: 4px;
|
|
35
|
+
height: 4px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
::-webkit-scrollbar-track {
|
|
39
|
+
background: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
::-webkit-scrollbar-thumb {
|
|
43
|
+
background: rgba(0, 0, 0, 0.2);
|
|
44
|
+
border-radius: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
::-webkit-scrollbar-thumb:hover {
|
|
48
|
+
background: rgba(0, 0, 0, 0.3);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* H5 导航栏页面自动添加顶部间距 */
|
|
52
|
+
body.h5-navbar-visible .taro_page {
|
|
53
|
+
padding-top: 44px;
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const PC_WIDESCREEN_STYLES = `
|
|
58
|
+
/* PC 宽屏适配 - 基础布局 */
|
|
59
|
+
@media (min-width: 769px) {
|
|
60
|
+
html {
|
|
61
|
+
font-size: 15px !important;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
body {
|
|
65
|
+
background-color: #f3f4f6 !important;
|
|
66
|
+
display: flex !important;
|
|
67
|
+
justify-content: center !important;
|
|
68
|
+
align-items: center !important;
|
|
69
|
+
min-height: 100vh !important;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
const PC_WIDESCREEN_PHONE_FRAME = `
|
|
75
|
+
/* PC 宽屏适配 - 手机框样式(有 TabBar 页面) */
|
|
76
|
+
@media (min-width: 769px) {
|
|
77
|
+
.taro-tabbar__container {
|
|
78
|
+
width: 375px !important;
|
|
79
|
+
max-width: 375px !important;
|
|
80
|
+
height: calc(100vh - 40px) !important;
|
|
81
|
+
max-height: 900px !important;
|
|
82
|
+
background-color: #fff !important;
|
|
83
|
+
transform: translateX(0) !important;
|
|
84
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1) !important;
|
|
85
|
+
border-radius: 20px !important;
|
|
86
|
+
overflow: hidden !important;
|
|
87
|
+
position: relative !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.taro-tabbar__panel {
|
|
91
|
+
height: 100% !important;
|
|
92
|
+
overflow: auto !important;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* PC 宽屏适配 - 手机框样式(无 TabBar 页面,通过 JS 添加 no-tabbar 类) */
|
|
97
|
+
@media (min-width: 769px) {
|
|
98
|
+
body.no-tabbar #app {
|
|
99
|
+
width: 375px !important;
|
|
100
|
+
max-width: 375px !important;
|
|
101
|
+
height: calc(100vh - 40px) !important;
|
|
102
|
+
max-height: 900px !important;
|
|
103
|
+
background-color: #fff !important;
|
|
104
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1) !important;
|
|
105
|
+
border-radius: 20px !important;
|
|
106
|
+
overflow: hidden !important;
|
|
107
|
+
position: relative !important;
|
|
108
|
+
transform: translateX(0) !important;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
body.no-tabbar #app .taro_router {
|
|
112
|
+
height: 100% !important;
|
|
113
|
+
overflow: auto !important;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
function injectStyles() {
|
|
119
|
+
const style = document.createElement('style');
|
|
120
|
+
style.innerHTML =
|
|
121
|
+
H5_BASE_STYLES + PC_WIDESCREEN_STYLES + PC_WIDESCREEN_PHONE_FRAME;
|
|
122
|
+
document.head.appendChild(style);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function setupTabbarDetection() {
|
|
126
|
+
const checkTabbar = () => {
|
|
127
|
+
const hasTabbar = !!document.querySelector('.taro-tabbar__container');
|
|
128
|
+
document.body.classList.toggle('no-tabbar', !hasTabbar);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
checkTabbar();
|
|
132
|
+
|
|
133
|
+
const observer = new MutationObserver(checkTabbar);
|
|
134
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function injectH5Styles() {
|
|
138
|
+
if (TARO_ENV !== 'h5') return;
|
|
139
|
+
|
|
140
|
+
injectStyles();
|
|
141
|
+
setupTabbarDetection();
|
|
142
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useLaunch } from '@tarojs/taro';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { injectH5Styles } from './h5-styles';
|
|
4
|
+
import { devDebug } from './dev-debug';
|
|
5
|
+
import { H5Container } from './h5-container';
|
|
6
|
+
|
|
7
|
+
export const Preset = ({ children }: PropsWithChildren) => {
|
|
8
|
+
useLaunch(() => {
|
|
9
|
+
devDebug();
|
|
10
|
+
injectH5Styles();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
if (TARO_ENV === 'h5') {
|
|
14
|
+
return <H5Container>{children}</H5Container>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return <>{children}</>;
|
|
18
|
+
};
|
|
@@ -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
|
+
|
|
@@ -3,66 +3,159 @@
|
|
|
3
3
|
"templates": [
|
|
4
4
|
{
|
|
5
5
|
"name": "expo",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Expo template for React Native applications",
|
|
7
7
|
"location": "./expo",
|
|
8
8
|
"paramsSchema": {
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
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
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
"required": [],
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "native-static",
|
|
31
|
+
"description": "Native Static(纯静态):`coze init ${COZE_WORKSPACE_PATH} --template native-static`\n- 适用:纯静态 HTML/CSS/JS 项目、静态网站\n- 使用 Python http.server 作为开发服务器\n- 不需要 Node.js 环境,适合简单静态内容",
|
|
32
|
+
"location": "./native-static",
|
|
33
|
+
"paramsSchema": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {},
|
|
36
|
+
"required": [],
|
|
37
|
+
"additionalProperties": false
|
|
21
38
|
}
|
|
22
39
|
},
|
|
23
40
|
{
|
|
24
41
|
"name": "nextjs",
|
|
25
|
-
"description": "nextjs
|
|
42
|
+
"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
43
|
"location": "./nextjs",
|
|
27
44
|
"paramsSchema": {
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"appName": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"minLength": 1,
|
|
50
|
+
"pattern": "^[a-z0-9-]+$",
|
|
51
|
+
"description": "Application name (lowercase, alphanumeric and hyphens only)"
|
|
52
|
+
},
|
|
53
|
+
"port": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"default": 5000,
|
|
56
|
+
"minimum": 1024,
|
|
57
|
+
"maximum": 65535,
|
|
58
|
+
"description": "Development server port (for Next.js dev server)"
|
|
59
|
+
}
|
|
32
60
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
61
|
+
"required": [],
|
|
62
|
+
"additionalProperties": false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "taro",
|
|
67
|
+
"description": "Taro(小程序 + H5):`coze init ${COZE_WORKSPACE_PATH} --template taro`\n- 适用:微信小程序、H5 跨端应用\n- 前后端分离架构:Taro 4 + NestJS\n- 支持微信小程序和 H5 双端构建\n- 使用 TailwindCSS + weapp-tailwindcss 实现跨端样式",
|
|
68
|
+
"location": "./taro",
|
|
69
|
+
"paramsSchema": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"appName": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1,
|
|
75
|
+
"pattern": "^[a-z0-9-]+$",
|
|
76
|
+
"description": "Application name (lowercase, alphanumeric and hyphens only)"
|
|
77
|
+
},
|
|
78
|
+
"port": {
|
|
79
|
+
"type": "number",
|
|
80
|
+
"default": 5000,
|
|
81
|
+
"minimum": 1024,
|
|
82
|
+
"maximum": 65535,
|
|
83
|
+
"description": "H5 development server port"
|
|
84
|
+
},
|
|
85
|
+
"serverPort": {
|
|
86
|
+
"type": "number",
|
|
87
|
+
"default": 3000,
|
|
88
|
+
"minimum": 1024,
|
|
89
|
+
"maximum": 65535,
|
|
90
|
+
"description": "NestJS backend server port"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": [],
|
|
94
|
+
"additionalProperties": false
|
|
40
95
|
}
|
|
41
96
|
},
|
|
42
97
|
{
|
|
43
98
|
"name": "vite",
|
|
44
|
-
"description": "vite
|
|
99
|
+
"description": "Vite(简单项目):`coze init ${COZE_WORKSPACE_PATH} --template vite`\n- 适用:轻量级 SPA、纯前端交互、仪表盘等轻量级项目。",
|
|
45
100
|
"location": "./vite",
|
|
46
101
|
"paramsSchema": {
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
102
|
+
"type": "object",
|
|
103
|
+
"properties": {
|
|
104
|
+
"appName": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1,
|
|
107
|
+
"pattern": "^[a-z0-9-]+$",
|
|
108
|
+
"description": "Application name (lowercase, alphanumeric and hyphens only)"
|
|
109
|
+
},
|
|
110
|
+
"port": {
|
|
111
|
+
"type": "number",
|
|
112
|
+
"default": 5000,
|
|
113
|
+
"minimum": 1024,
|
|
114
|
+
"maximum": 65535,
|
|
115
|
+
"description": "Development server port"
|
|
116
|
+
},
|
|
117
|
+
"hmrPort": {
|
|
118
|
+
"type": "number",
|
|
119
|
+
"default": 6000,
|
|
120
|
+
"minimum": 1024,
|
|
121
|
+
"maximum": 65535,
|
|
122
|
+
"description": "Development HMR server port"
|
|
123
|
+
}
|
|
51
124
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
125
|
+
"required": [],
|
|
126
|
+
"additionalProperties": false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "vite-vue",
|
|
131
|
+
"description": "Vite + Vue 3(Vue 项目):`coze init ${COZE_WORKSPACE_PATH} --template vite-vue`\n- 适用:使用 Vue 3 框架的 SPA 应用、交互式前端、组件化仪表盘等项目。",
|
|
132
|
+
"location": "./vite-vue",
|
|
133
|
+
"paramsSchema": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"properties": {
|
|
136
|
+
"appName": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1,
|
|
139
|
+
"pattern": "^[a-z0-9-]+$",
|
|
140
|
+
"description": "Application name (lowercase, alphanumeric and hyphens only)"
|
|
141
|
+
},
|
|
142
|
+
"port": {
|
|
143
|
+
"type": "number",
|
|
144
|
+
"default": 5000,
|
|
145
|
+
"minimum": 1024,
|
|
146
|
+
"maximum": 65535,
|
|
147
|
+
"description": "Development server port"
|
|
148
|
+
},
|
|
149
|
+
"hmrPort": {
|
|
150
|
+
"type": "number",
|
|
151
|
+
"default": 6000,
|
|
152
|
+
"minimum": 1024,
|
|
153
|
+
"maximum": 65535,
|
|
154
|
+
"description": "Development HMR server port"
|
|
155
|
+
}
|
|
58
156
|
},
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
"description": "Development HMR server port",
|
|
62
|
-
"default": 6000,
|
|
63
|
-
"minimum": 1024,
|
|
64
|
-
"maximum": 65535
|
|
65
|
-
}
|
|
157
|
+
"required": [],
|
|
158
|
+
"additionalProperties": false
|
|
66
159
|
}
|
|
67
160
|
}
|
|
68
161
|
]
|
|
@@ -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,31 @@
|
|
|
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"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@supabase/supabase-js": "2.95.3",
|
|
15
|
+
"dotenv": "^17.2.3"
|
|
11
16
|
},
|
|
12
17
|
"devDependencies": {
|
|
13
18
|
"autoprefixer": "^10.4.20",
|
|
19
|
+
"coze-coding-dev-sdk": "^0.7.16",
|
|
20
|
+
"eslint": "^9",
|
|
14
21
|
"only-allow": "^1.2.2",
|
|
15
22
|
"postcss": "^8.4.49",
|
|
16
23
|
"tailwindcss": "^3.4.17",
|
|
17
24
|
"typescript": "^5.6.0",
|
|
25
|
+
"typescript-eslint": "^8",
|
|
18
26
|
"vite": "^7.2.4"
|
|
19
27
|
},
|
|
20
28
|
"packageManager": "pnpm@9.0.0",
|
|
21
29
|
"engines": {
|
|
22
30
|
"pnpm": ">=9.0.0"
|
|
31
|
+
},
|
|
32
|
+
"pnpm": {
|
|
33
|
+
"overrides": {
|
|
34
|
+
"esbuild": "^0.27.2"
|
|
35
|
+
}
|
|
23
36
|
}
|
|
24
37
|
}
|