@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.
Files changed (143) hide show
  1. package/README.md +1 -0
  2. package/lib/__templates__/expo/_npmrc +1 -0
  3. package/lib/__templates__/expo/client/components/Screen.tsx +2 -2
  4. package/lib/__templates__/expo/client/eslint.config.mjs +7 -0
  5. package/lib/__templates__/expo/client/scripts/install-missing-deps.js +10 -10
  6. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/index.js +9 -0
  7. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/rule.js +112 -0
  8. package/lib/__templates__/expo/eslint-plugins/forbid-emoji/tech.md +94 -0
  9. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/index.js +9 -0
  10. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/rule.js +120 -0
  11. package/lib/__templates__/expo/eslint-plugins/restrict-linear-gradient/tech.md +58 -0
  12. package/lib/__templates__/nextjs/AGENTS.md +54 -0
  13. package/lib/__templates__/nextjs/README.md +5 -0
  14. package/lib/__templates__/nextjs/eslint.config.mjs +5 -0
  15. package/lib/__templates__/nextjs/next.config.ts +1 -2
  16. package/lib/__templates__/nextjs/package.json +2 -5
  17. package/lib/__templates__/nextjs/pnpm-lock.yaml +1028 -5
  18. package/lib/__templates__/nextjs/scripts/build.sh +4 -1
  19. package/lib/__templates__/nextjs/scripts/dev.sh +8 -2
  20. package/lib/__templates__/nextjs/scripts/start.sh +7 -1
  21. package/lib/__templates__/nextjs/src/app/layout.tsx +1 -1
  22. package/lib/__templates__/nextjs/src/app/page.tsx +1 -2
  23. package/lib/__templates__/nextjs/src/server.ts +35 -0
  24. package/lib/__templates__/nextjs/tsconfig.json +1 -1
  25. package/lib/__templates__/nuxt-vue/AGENTS.md +42 -0
  26. package/lib/__templates__/nuxt-vue/README.md +73 -0
  27. package/lib/__templates__/nuxt-vue/_gitignore +24 -0
  28. package/lib/__templates__/nuxt-vue/app/app.vue +6 -0
  29. package/lib/__templates__/nuxt-vue/app/pages/index.vue +23 -0
  30. package/lib/__templates__/{vite-vue/src/index.css → nuxt-vue/assets/css/main.css} +6 -11
  31. package/lib/__templates__/nuxt-vue/nuxt.config.ts +116 -0
  32. package/lib/__templates__/nuxt-vue/package.json +35 -0
  33. package/lib/__templates__/nuxt-vue/pnpm-lock.yaml +8759 -0
  34. package/lib/__templates__/{vite-vue → nuxt-vue}/postcss.config.mjs +3 -1
  35. package/lib/__templates__/nuxt-vue/public/favicon.ico +0 -0
  36. package/lib/__templates__/nuxt-vue/public/robots.txt +2 -0
  37. package/lib/__templates__/{vite-vue → nuxt-vue}/scripts/build.sh +2 -2
  38. package/lib/__templates__/{vite-vue → nuxt-vue}/scripts/dev.sh +9 -2
  39. package/lib/__templates__/nuxt-vue/scripts/prepare.sh +14 -0
  40. package/lib/__templates__/nuxt-vue/scripts/start.sh +21 -0
  41. package/lib/__templates__/nuxt-vue/server/api/hello.ts +10 -0
  42. package/lib/__templates__/nuxt-vue/server/middleware/logger.ts +10 -0
  43. package/lib/__templates__/nuxt-vue/server/routes/health.ts +10 -0
  44. package/lib/__templates__/nuxt-vue/tailwind.config.js +13 -0
  45. package/lib/__templates__/nuxt-vue/template.config.js +87 -0
  46. package/lib/__templates__/nuxt-vue/tsconfig.json +18 -0
  47. package/lib/__templates__/taro/README.md +57 -45
  48. package/lib/__templates__/taro/config/index.ts +45 -30
  49. package/lib/__templates__/taro/eslint.config.mjs +61 -6
  50. package/lib/__templates__/taro/package.json +8 -3
  51. package/lib/__templates__/taro/pnpm-lock.yaml +515 -203
  52. package/lib/__templates__/taro/src/app.css +140 -36
  53. package/lib/__templates__/taro/src/components/ui/accordion.tsx +159 -0
  54. package/lib/__templates__/taro/src/components/ui/alert-dialog.tsx +260 -0
  55. package/lib/__templates__/taro/src/components/ui/alert.tsx +60 -0
  56. package/lib/__templates__/taro/src/components/ui/aspect-ratio.tsx +36 -0
  57. package/lib/__templates__/taro/src/components/ui/avatar.tsx +84 -0
  58. package/lib/__templates__/taro/src/components/ui/badge.tsx +37 -0
  59. package/lib/__templates__/taro/src/components/ui/breadcrumb.tsx +117 -0
  60. package/lib/__templates__/taro/src/components/ui/button-group.tsx +83 -0
  61. package/lib/__templates__/taro/src/components/ui/button.tsx +67 -0
  62. package/lib/__templates__/taro/src/components/ui/calendar.tsx +394 -0
  63. package/lib/__templates__/taro/src/components/ui/card.tsx +108 -0
  64. package/lib/__templates__/taro/src/components/ui/carousel.tsx +228 -0
  65. package/lib/__templates__/taro/src/components/ui/checkbox.tsx +58 -0
  66. package/lib/__templates__/taro/src/components/ui/code-block.tsx +169 -0
  67. package/lib/__templates__/taro/src/components/ui/collapsible.tsx +71 -0
  68. package/lib/__templates__/taro/src/components/ui/command.tsx +385 -0
  69. package/lib/__templates__/taro/src/components/ui/context-menu.tsx +614 -0
  70. package/lib/__templates__/taro/src/components/ui/dialog.tsx +256 -0
  71. package/lib/__templates__/taro/src/components/ui/drawer.tsx +192 -0
  72. package/lib/__templates__/taro/src/components/ui/dropdown-menu.tsx +561 -0
  73. package/lib/__templates__/taro/src/components/ui/field.tsx +228 -0
  74. package/lib/__templates__/taro/src/components/ui/hover-card.tsx +282 -0
  75. package/lib/__templates__/taro/src/components/ui/input-group.tsx +197 -0
  76. package/lib/__templates__/taro/src/components/ui/input-otp.tsx +136 -0
  77. package/lib/__templates__/taro/src/components/ui/input.tsx +56 -0
  78. package/lib/__templates__/taro/src/components/ui/label.tsx +24 -0
  79. package/lib/__templates__/taro/src/components/ui/menubar.tsx +595 -0
  80. package/lib/__templates__/taro/src/components/ui/navigation-menu.tsx +264 -0
  81. package/lib/__templates__/taro/src/components/ui/pagination.tsx +118 -0
  82. package/lib/__templates__/taro/src/components/ui/popover.tsx +291 -0
  83. package/lib/__templates__/taro/src/components/ui/portal.tsx +19 -0
  84. package/lib/__templates__/taro/src/components/ui/progress.tsx +28 -0
  85. package/lib/__templates__/taro/src/components/ui/radio-group.tsx +64 -0
  86. package/lib/__templates__/taro/src/components/ui/resizable.tsx +346 -0
  87. package/lib/__templates__/taro/src/components/ui/scroll-area.tsx +34 -0
  88. package/lib/__templates__/taro/src/components/ui/select.tsx +438 -0
  89. package/lib/__templates__/taro/src/components/ui/separator.tsx +30 -0
  90. package/lib/__templates__/taro/src/components/ui/sheet.tsx +262 -0
  91. package/lib/__templates__/taro/src/components/ui/skeleton.tsx +17 -0
  92. package/lib/__templates__/taro/src/components/ui/slider.tsx +203 -0
  93. package/lib/__templates__/taro/src/components/ui/sonner.tsx +1 -0
  94. package/lib/__templates__/taro/src/components/ui/switch.tsx +55 -0
  95. package/lib/__templates__/taro/src/components/ui/table.tsx +142 -0
  96. package/lib/__templates__/taro/src/components/ui/tabs.tsx +114 -0
  97. package/lib/__templates__/taro/src/components/ui/textarea.tsx +54 -0
  98. package/lib/__templates__/taro/src/components/ui/toast.tsx +517 -0
  99. package/lib/__templates__/taro/src/components/ui/toggle-group.tsx +120 -0
  100. package/lib/__templates__/taro/src/components/ui/toggle.tsx +77 -0
  101. package/lib/__templates__/taro/src/components/ui/tooltip.tsx +455 -0
  102. package/lib/__templates__/taro/src/lib/hooks/use-keyboard-offset.ts +37 -0
  103. package/lib/__templates__/taro/src/lib/measure.ts +115 -0
  104. package/lib/__templates__/taro/src/lib/platform.ts +12 -0
  105. package/lib/__templates__/taro/src/lib/utils.ts +6 -0
  106. package/lib/__templates__/taro/src/presets/h5-navbar.tsx +49 -12
  107. package/lib/__templates__/taro/src/presets/h5-styles.ts +78 -0
  108. package/lib/__templates__/templates.json +17 -17
  109. package/lib/__templates__/vite/AGENTS.md +41 -0
  110. package/lib/__templates__/vite/README.md +190 -11
  111. package/lib/__templates__/vite/_gitignore +1 -0
  112. package/lib/__templates__/vite/eslint.config.mjs +6 -1
  113. package/lib/__templates__/vite/package.json +10 -3
  114. package/lib/__templates__/vite/pnpm-lock.yaml +755 -15
  115. package/lib/__templates__/vite/scripts/build.sh +4 -1
  116. package/lib/__templates__/vite/scripts/dev.sh +9 -2
  117. package/lib/__templates__/vite/scripts/start.sh +9 -3
  118. package/lib/__templates__/vite/server/routes/index.ts +31 -0
  119. package/lib/__templates__/vite/server/server.ts +65 -0
  120. package/lib/__templates__/vite/server/vite.ts +67 -0
  121. package/lib/__templates__/vite/tsconfig.json +4 -3
  122. package/lib/__templates__/vite/vite.config.ts +4 -0
  123. package/lib/cli.js +3251 -768
  124. package/package.json +9 -3
  125. package/lib/__templates__/vite-vue/README.md +0 -451
  126. package/lib/__templates__/vite-vue/_gitignore +0 -66
  127. package/lib/__templates__/vite-vue/eslint.config.mjs +0 -9
  128. package/lib/__templates__/vite-vue/index.html +0 -13
  129. package/lib/__templates__/vite-vue/package.json +0 -38
  130. package/lib/__templates__/vite-vue/pnpm-lock.yaml +0 -3132
  131. package/lib/__templates__/vite-vue/scripts/prepare.sh +0 -9
  132. package/lib/__templates__/vite-vue/scripts/start.sh +0 -15
  133. package/lib/__templates__/vite-vue/src/App.vue +0 -6
  134. package/lib/__templates__/vite-vue/src/main.ts +0 -8
  135. package/lib/__templates__/vite-vue/src/router/index.ts +0 -17
  136. package/lib/__templates__/vite-vue/src/views/Home.vue +0 -38
  137. package/lib/__templates__/vite-vue/src/vite-env.d.ts +0 -8
  138. package/lib/__templates__/vite-vue/tailwind.config.js +0 -9
  139. package/lib/__templates__/vite-vue/template.config.js +0 -127
  140. package/lib/__templates__/vite-vue/tsconfig.json +0 -17
  141. package/lib/__templates__/vite-vue/vite.config.ts +0 -28
  142. /package/lib/__templates__/{vite-vue → nuxt-vue}/.coze +0 -0
  143. /package/lib/__templates__/{vite-vue → nuxt-vue}/_npmrc +0 -0
@@ -1,9 +0,0 @@
1
- #!/bin/bash
2
- set -Eeuo pipefail
3
-
4
- COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
5
-
6
- cd "${COZE_WORKSPACE_PATH}"
7
-
8
- echo "Installing dependencies..."
9
- pnpm install --prefer-frozen-lockfile --prefer-offline --loglevel debug --reporter=append-only
@@ -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,6 +0,0 @@
1
- <script setup lang="ts">
2
- </script>
3
-
4
- <template>
5
- <router-view />
6
- </template>
@@ -1,8 +0,0 @@
1
- import { createApp } from 'vue';
2
- import App from './App.vue';
3
- import router from './router';
4
- import './index.css';
5
-
6
- const app = createApp(App);
7
- app.use(router);
8
- app.mount('#app');
@@ -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,8 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare module '*.vue' {
4
- import type { DefineComponent } from 'vue';
5
- // eslint-disable-next-line
6
- const component: DefineComponent<{}, {}, any>;
7
- export default component;
8
- }
@@ -1,9 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- export default {
3
- content: ['./index.html', './src/**/*.{js,ts,jsx,tsx,vue}'],
4
- darkMode: 'media',
5
- theme: {
6
- extend: {},
7
- },
8
- plugins: [],
9
- };
@@ -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