@coze-arch/cli 0.0.1-alpha.fc5c04 → 0.0.1-alpha.ff3d06
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/README.md +1 -0
- package/lib/__templates__/expo/_npmrc +1 -0
- package/lib/__templates__/expo/client/components/Screen.tsx +2 -2
- package/lib/__templates__/expo/client/eslint.config.mjs +7 -0
- package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
- package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
- package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
- package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
- package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
- package/lib/__templates__/nextjs/AGENTS.md +54 -0
- package/lib/__templates__/nextjs/README.md +5 -0
- package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
- package/lib/__templates__/nextjs/next.config.ts +1 -2
- package/lib/__templates__/nextjs/package.json +2 -5
- package/lib/__templates__/nextjs/pnpm-lock.yaml +1028 -5
- package/lib/__templates__/nextjs/scripts/build.sh +4 -1
- package/lib/__templates__/nextjs/scripts/dev.sh +8 -2
- package/lib/__templates__/nextjs/scripts/start.sh +7 -1
- package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
- package/lib/__templates__/nextjs/src/app/page.tsx +1 -2
- package/lib/__templates__/nextjs/src/server.ts +35 -0
- package/lib/__templates__/nextjs/tsconfig.json +1 -1
- package/lib/__templates__/nuxt-vue/AGENTS.md +42 -0
- package/lib/__templates__/nuxt-vue/README.md +73 -0
- package/lib/__templates__/nuxt-vue/_gitignore +24 -0
- package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
- package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
- package/lib/__templates__/{vite-vue/src/index.css → nuxt-vue/assets/css/main.css} +6 -11
- package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
- package/lib/__templates__/nuxt-vue/package.json +35 -0
- package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
- package/lib/__templates__/{vite-vue → nuxt-vue}/postcss.config.mjs +3 -1
- package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
- package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
- package/lib/__templates__/{vite-vue → nuxt-vue}/scripts/build.sh +2 -2
- package/lib/__templates__/{vite-vue → nuxt-vue}/scripts/dev.sh +9 -2
- package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
- package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
- package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
- package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
- package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
- package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
- package/lib/__templates__/nuxt-vue/template.config.js +87 -0
- package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
- package/lib/__templates__/taro/README.md +57 -45
- package/lib/__templates__/taro/config/index.ts +45 -30
- package/lib/__templates__/taro/eslint.config.mjs +61 -6
- package/lib/__templates__/taro/package.json +8 -3
- package/lib/__templates__/taro/pnpm-lock.yaml +515 -203
- package/lib/__templates__/taro/src/app.css +140 -36
- package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
- package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
- package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
- package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
- package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
- package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
- package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
- package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
- package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
- package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
- package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
- package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
- package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
- package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
- package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
- package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
- package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
- package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
- package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
- package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
- package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
- package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
- package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
- package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
- package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
- package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
- package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
- package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
- package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
- package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
- package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
- package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
- package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
- package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
- package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
- package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
- package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
- package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
- package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
- package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
- package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
- package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
- package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
- package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
- package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
- package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
- package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
- package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
- package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
- package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
- package/lib/__templates__/taro/src/lib/measure.ts +115 -0
- package/lib/__templates__/taro/src/lib/platform.ts +12 -0
- package/lib/__templates__/taro/src/lib/utils.ts +6 -0
- package/lib/__templates__/taro/src/presets/h5-navbar.tsx +49 -12
- package/lib/__templates__/taro/src/presets/h5-styles.ts +78 -0
- package/lib/__templates__/templates.json +17 -17
- package/lib/__templates__/vite/AGENTS.md +41 -0
- package/lib/__templates__/vite/README.md +190 -11
- package/lib/__templates__/vite/_gitignore +1 -0
- package/lib/__templates__/vite/eslint.config.mjs +6 -1
- package/lib/__templates__/vite/package.json +10 -3
- package/lib/__templates__/vite/pnpm-lock.yaml +755 -15
- package/lib/__templates__/vite/scripts/build.sh +4 -1
- package/lib/__templates__/vite/scripts/dev.sh +9 -2
- package/lib/__templates__/vite/scripts/start.sh +9 -3
- package/lib/__templates__/vite/server/routes/index.ts +31 -0
- package/lib/__templates__/vite/server/server.ts +65 -0
- package/lib/__templates__/vite/server/vite.ts +67 -0
- package/lib/__templates__/vite/tsconfig.json +4 -3
- package/lib/__templates__/vite/vite.config.ts +4 -0
- package/lib/cli.js +3251 -768
- package/package.json +9 -3
- package/lib/__templates__/vite-vue/README.md +0 -451
- package/lib/__templates__/vite-vue/_gitignore +0 -66
- package/lib/__templates__/vite-vue/eslint.config.mjs +0 -9
- package/lib/__templates__/vite-vue/index.html +0 -13
- package/lib/__templates__/vite-vue/package.json +0 -38
- package/lib/__templates__/vite-vue/pnpm-lock.yaml +0 -3132
- package/lib/__templates__/vite-vue/scripts/prepare.sh +0 -9
- package/lib/__templates__/vite-vue/scripts/start.sh +0 -15
- package/lib/__templates__/vite-vue/src/App.vue +0 -6
- package/lib/__templates__/vite-vue/src/main.ts +0 -8
- package/lib/__templates__/vite-vue/src/router/index.ts +0 -17
- package/lib/__templates__/vite-vue/src/views/Home.vue +0 -38
- package/lib/__templates__/vite-vue/src/vite-env.d.ts +0 -8
- package/lib/__templates__/vite-vue/tailwind.config.js +0 -9
- package/lib/__templates__/vite-vue/template.config.js +0 -127
- package/lib/__templates__/vite-vue/tsconfig.json +0 -17
- package/lib/__templates__/vite-vue/vite.config.ts +0 -28
- /package/lib/__templates__/{vite-vue → nuxt-vue}/.coze +0 -0
- /package/lib/__templates__/{vite-vue → nuxt-vue}/_npmrc +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -Eeuo pipefail
|
|
3
|
-
|
|
4
|
-
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
5
|
-
PORT=<%= port %>
|
|
6
|
-
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
|
|
7
|
-
|
|
8
|
-
start_service() {
|
|
9
|
-
cd "${COZE_WORKSPACE_PATH}"
|
|
10
|
-
echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
|
|
11
|
-
npx vite preview --port $DEPLOY_RUN_PORT
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for deploy..."
|
|
15
|
-
start_service
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from 'vue-router';
|
|
2
|
-
import type { RouteRecordRaw } from 'vue-router';
|
|
3
|
-
|
|
4
|
-
const routes: RouteRecordRaw[] = [
|
|
5
|
-
{
|
|
6
|
-
path: '/',
|
|
7
|
-
name: 'Home',
|
|
8
|
-
component: () => import('../views/Home.vue'),
|
|
9
|
-
},
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
const router = createRouter({
|
|
13
|
-
history: createWebHistory(),
|
|
14
|
-
routes,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export default router;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<template>
|
|
5
|
-
<div
|
|
6
|
-
class="flex h-full items-center justify-center bg-background text-foreground transition-colors duration-300 dark:bg-background dark:text-foreground overflow-hidden min-h-screen"
|
|
7
|
-
>
|
|
8
|
-
<main
|
|
9
|
-
class="flex w-full h-full max-w-3xl flex-col items-center justify-center px-16 py-32 sm:items-center"
|
|
10
|
-
>
|
|
11
|
-
<div class="flex flex-col items-center justify-between gap-4">
|
|
12
|
-
<img
|
|
13
|
-
src="https://lf-coze-web-cdn.coze.cn/obj/eden-cn/lm-lgvj/ljhwZthlaukjlkulzlp/coze-coding/icon/coze-coding.gif"
|
|
14
|
-
alt="扣子编程 Logo"
|
|
15
|
-
width="156"
|
|
16
|
-
height="130"
|
|
17
|
-
class="w-[156px] h-[130px] object-contain"
|
|
18
|
-
/>
|
|
19
|
-
<div>
|
|
20
|
-
<div
|
|
21
|
-
class="flex flex-col items-center gap-2 text-center sm:items-center sm:text-center"
|
|
22
|
-
>
|
|
23
|
-
<h1
|
|
24
|
-
class="max-w-xl text-base font-semibold leading-tight tracking-tight text-foreground dark:text-foreground"
|
|
25
|
-
>
|
|
26
|
-
应用开发中
|
|
27
|
-
</h1>
|
|
28
|
-
<p
|
|
29
|
-
class="max-w-2xl text-sm-14 leading-8 text-muted-foreground dark:text-muted-foreground"
|
|
30
|
-
>
|
|
31
|
-
请稍后,页面即将呈现
|
|
32
|
-
</p>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</main>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
import { resolve, join, basename } from 'path';
|
|
4
|
-
import { appendFileSync, openSync, closeSync, mkdirSync } from 'fs';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export const paramsSchema = {
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
appName: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
minLength: 1,
|
|
20
|
-
pattern: '^[a-z0-9-]+$',
|
|
21
|
-
description:
|
|
22
|
-
'Application name (lowercase, alphanumeric and hyphens only)',
|
|
23
|
-
},
|
|
24
|
-
port: {
|
|
25
|
-
type: 'number',
|
|
26
|
-
default: 5000,
|
|
27
|
-
minimum: 1024,
|
|
28
|
-
maximum: 65535,
|
|
29
|
-
description: 'Development server port',
|
|
30
|
-
},
|
|
31
|
-
hmrPort: {
|
|
32
|
-
type: 'number',
|
|
33
|
-
default: 6000,
|
|
34
|
-
minimum: 1024,
|
|
35
|
-
maximum: 65535,
|
|
36
|
-
description: 'Development HMR server port',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
required: [],
|
|
40
|
-
additionalProperties: false,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const description = `Vite + Vue 3(Vue 项目):\`coze init \${COZE_WORKSPACE_PATH} --template vite-vue\`
|
|
44
|
-
- 适用:使用 Vue 3 框架的 SPA 应用、交互式前端、组件化仪表盘等项目。`;
|
|
45
|
-
|
|
46
|
-
const config = {
|
|
47
|
-
description: description,
|
|
48
|
-
paramsSchema,
|
|
49
|
-
|
|
50
|
-
defaultParams: {
|
|
51
|
-
port: 5000,
|
|
52
|
-
hmrPort: 6000,
|
|
53
|
-
appName: 'projects',
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
onBeforeRender: async context => {
|
|
57
|
-
console.log(
|
|
58
|
-
`Creating Vue 3 + TypeScript + Vite project: ${context.appName}`,
|
|
59
|
-
);
|
|
60
|
-
return context;
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
onAfterRender: async (_context, outputPath) => {
|
|
64
|
-
console.log(`\nProject created at: ${outputPath}`);
|
|
65
|
-
console.log('\nConfiguration:');
|
|
66
|
-
console.log(' - Framework: Vue 3 + Vite');
|
|
67
|
-
console.log(' - TypeScript: enabled');
|
|
68
|
-
console.log(' - Composition API: enabled');
|
|
69
|
-
console.log(` - Port: ${_context.port}`);
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
onComplete: async (_context, outputPath) => {
|
|
73
|
-
// Skip pnpm update in test environment to avoid monorepo workspace issues
|
|
74
|
-
if (process.env.NODE_ENV === 'test') {
|
|
75
|
-
console.log('⊘ Skipping dependency update in test environment');
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const cmd = 'pnpm';
|
|
80
|
-
const args = ['update', 'coze-coding-dev-sdk@^0.7.0'];
|
|
81
|
-
console.log(
|
|
82
|
-
`\nTriggering: ${cmd} ${args.join(' ')} (running in background)`,
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
const projectRoot = resolve(outputPath);
|
|
87
|
-
|
|
88
|
-
// Determine log directory
|
|
89
|
-
const logDir = process.env.COZE_LOG_DIR || resolve(__dirname, '../.log');
|
|
90
|
-
mkdirSync(logDir, { recursive: true });
|
|
91
|
-
|
|
92
|
-
// Use project name in log file to avoid conflicts
|
|
93
|
-
const projectName = basename(projectRoot);
|
|
94
|
-
const logFile = join(logDir, `${projectName}-init.log`);
|
|
95
|
-
|
|
96
|
-
// Write log header
|
|
97
|
-
const timestamp = new Date().toISOString();
|
|
98
|
-
appendFileSync(
|
|
99
|
-
logFile,
|
|
100
|
-
`\n=== [${timestamp}] ${cmd} ${args.join(' ')} ===\n`,
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
// Open log file for appending
|
|
104
|
-
const logFd = openSync(logFile, 'a');
|
|
105
|
-
|
|
106
|
-
// Spawn in detached mode
|
|
107
|
-
const child = spawn(cmd, args, {
|
|
108
|
-
cwd: projectRoot,
|
|
109
|
-
detached: true,
|
|
110
|
-
stdio: ['ignore', logFd, logFd],
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
child.unref();
|
|
114
|
-
closeSync(logFd);
|
|
115
|
-
|
|
116
|
-
console.log(
|
|
117
|
-
'✓ coze-coding-dev-sdk update triggered (running in background)',
|
|
118
|
-
);
|
|
119
|
-
console.log(` Log file: ${logFile}`);
|
|
120
|
-
} catch (error) {
|
|
121
|
-
console.error('✗ Failed to trigger coze-coding-dev-sdk update:', error);
|
|
122
|
-
console.log(' You can manually run: pnpm update coze-coding-dev-sdk');
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export default config;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"isolatedModules": true,
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"jsx": "preserve"
|
|
15
|
-
},
|
|
16
|
-
"include": ["src"]
|
|
17
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import vue from '@vitejs/plugin-vue';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
plugins: [
|
|
6
|
-
vue({
|
|
7
|
-
include: [/\.vue$/],
|
|
8
|
-
}),
|
|
9
|
-
],
|
|
10
|
-
resolve: {
|
|
11
|
-
extensions: ['.ts', '.tsx', '.js', '.jsx', '.vue', '.json'],
|
|
12
|
-
},
|
|
13
|
-
optimizeDeps: {
|
|
14
|
-
include: ['vue'],
|
|
15
|
-
},
|
|
16
|
-
server: {
|
|
17
|
-
port: <%= port %>,
|
|
18
|
-
host: '0.0.0.0',
|
|
19
|
-
allowedHosts: true,
|
|
20
|
-
hmr: {
|
|
21
|
-
overlay: true,
|
|
22
|
-
path: '/hot/vite-hmr',
|
|
23
|
-
port: <%= hmrPort %>,
|
|
24
|
-
clientPort: 443,
|
|
25
|
-
timeout: 30000,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
File without changes
|
|
File without changes
|