@coze-arch/cli 0.0.1-alpha.6a5120 → 0.0.1-alpha.7d92f8

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.
@@ -42,7 +42,7 @@
42
42
  "class-variance-authority": "^0.7.1",
43
43
  "clsx": "^2.1.1",
44
44
  "cmdk": "^1.1.1",
45
- "coze-coding-dev-sdk": "0.5.0",
45
+ "coze-coding-dev-sdk": "^0.5.2",
46
46
  "date-fns": "^4.1.0",
47
47
  "drizzle-kit": "^0.31.8",
48
48
  "drizzle-orm": "^0.45.1",
@@ -105,8 +105,8 @@ importers:
105
105
  specifier: ^1.1.1
106
106
  version: 1.1.1(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
107
107
  coze-coding-dev-sdk:
108
- specifier: 0.5.0
109
- version: 0.5.0(@types/pg@8.16.0)(openai@6.15.0(zod@4.3.5))
108
+ specifier: ^0.5.2
109
+ version: 0.5.4(@types/pg@8.16.0)(openai@6.15.0(zod@4.3.5))
110
110
  date-fns:
111
111
  specifier: ^4.1.0
112
112
  version: 4.1.0
@@ -2747,8 +2747,8 @@ packages:
2747
2747
  typescript:
2748
2748
  optional: true
2749
2749
 
2750
- coze-coding-dev-sdk@0.5.0:
2751
- resolution: {integrity: sha512-fmJypE4jgExKOOFSz26ZNRUyKmAh3FENKORXMfvP7JIbXmk092ntrnll9DCJ+HpNOcpdvlE5lTmGSvyGh9nwrw==}
2750
+ coze-coding-dev-sdk@0.5.4:
2751
+ resolution: {integrity: sha512-nIH2hMFlO2PSnqdslFzOITK+2FhR64caoYFuzy2ma+ceu0o2Spe7tLYLIsyUc42Prr5gXqk4MZESQqpXD34ZwQ==}
2752
2752
  engines: {node: '>=18.0.0'}
2753
2753
  hasBin: true
2754
2754
 
@@ -7931,7 +7931,7 @@ snapshots:
7931
7931
  optionalDependencies:
7932
7932
  typescript: 5.9.3
7933
7933
 
7934
- coze-coding-dev-sdk@0.5.0(@types/pg@8.16.0)(openai@6.15.0(zod@4.3.5)):
7934
+ coze-coding-dev-sdk@0.5.4(@types/pg@8.16.0)(openai@6.15.0(zod@4.3.5)):
7935
7935
  dependencies:
7936
7936
  '@aws-sdk/client-s3': 3.962.0
7937
7937
  '@aws-sdk/lib-storage': 3.962.0(@aws-sdk/client-s3@3.962.0)
@@ -4,44 +4,25 @@ set -Eeuo pipefail
4
4
  PORT=<%= port %>
5
5
  COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
6
6
  NODE_ENV=development
7
+ DEPLOY_RUN_PORT=<%= port %>
7
8
 
8
9
  cd "${COZE_WORKSPACE_PATH}"
9
10
 
10
11
  kill_port_if_listening() {
11
12
  local pids
12
-
13
- # Check if lsof is available (macOS/BSD) or ss (Linux)
14
- if command -v lsof >/dev/null 2>&1; then
15
- # macOS/BSD using lsof
16
- pids=$(lsof -ti:${PORT} 2>/dev/null || true)
17
- elif command -v ss >/dev/null 2>&1; then
18
- # Linux using ss
19
- pids=$(ss -H -lntp 2>/dev/null | awk -v port="${PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
20
- else
21
- echo "Warning: neither lsof nor ss found, cannot check port ${PORT}"
22
- return
23
- fi
24
-
13
+ pids=$(ss -H -lntp 2>/dev/null | awk -v port="${DEPLOY_RUN_PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
25
14
  if [[ -z "${pids}" ]]; then
26
- echo "Port ${PORT} is free."
15
+ echo "Port ${DEPLOY_RUN_PORT} is free."
27
16
  return
28
17
  fi
29
-
30
- echo "Port ${PORT} in use by PIDs: ${pids} (SIGKILL)"
18
+ echo "Port ${DEPLOY_RUN_PORT} in use by PIDs: ${pids} (SIGKILL)"
31
19
  echo "${pids}" | xargs -I {} kill -9 {}
32
20
  sleep 1
33
-
34
- # Verify port is cleared
35
- if command -v lsof >/dev/null 2>&1; then
36
- pids=$(lsof -ti:${PORT} 2>/dev/null || true)
37
- elif command -v ss >/dev/null 2>&1; then
38
- pids=$(ss -H -lntp 2>/dev/null | awk -v port="${PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
39
- fi
40
-
21
+ pids=$(ss -H -lntp 2>/dev/null | awk -v port="${DEPLOY_RUN_PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
41
22
  if [[ -n "${pids}" ]]; then
42
- echo "Warning: port ${PORT} still busy after SIGKILL, PIDs: ${pids}"
23
+ echo "Warning: port ${DEPLOY_RUN_PORT} still busy after SIGKILL, PIDs: ${pids}"
43
24
  else
44
- echo "Port ${PORT} cleared."
25
+ echo "Port ${DEPLOY_RUN_PORT} cleared."
45
26
  fi
46
27
  }
47
28
 
@@ -33,9 +33,9 @@ export const metadata: Metadata = {
33
33
  ],
34
34
  authors: [{ name: 'Coze Code Team', url: 'https://code.coze.cn' }],
35
35
  generator: 'Coze Code',
36
- icons: {
37
- icon: '',
38
- },
36
+ // icons: {
37
+ // icon: '',
38
+ // },
39
39
  openGraph: {
40
40
  title: '扣子编程 | 你的 AI 工程师已就位',
41
41
  description:
@@ -44,22 +44,22 @@ export const metadata: Metadata = {
44
44
  siteName: '扣子编程',
45
45
  locale: 'zh_CN',
46
46
  type: 'website',
47
- images: [
48
- {
49
- url: '',
50
- width: 1200,
51
- height: 630,
52
- alt: '扣子编程 - 你的 AI 工程师',
53
- },
54
- ],
55
- },
56
- twitter: {
57
- card: 'summary_large_image',
58
- title: 'Coze Code | Your AI Engineer is Here',
59
- description:
60
- 'Build and deploy full-stack applications through AI conversation. No env setup, just flow.',
61
- images: [''],
47
+ // images: [
48
+ // {
49
+ // url: '',
50
+ // width: 1200,
51
+ // height: 630,
52
+ // alt: '扣子编程 - 你的 AI 工程师',
53
+ // },
54
+ // ],
62
55
  },
56
+ // twitter: {
57
+ // card: 'summary_large_image',
58
+ // title: 'Coze Code | Your AI Engineer is Here',
59
+ // description:
60
+ // 'Build and deploy full-stack applications through AI conversation. No env setup, just flow.',
61
+ // // images: [''],
62
+ // },
63
63
  robots: {
64
64
  index: true,
65
65
  follow: true,
@@ -52,6 +52,13 @@
52
52
  "port": {
53
53
  "type": "number",
54
54
  "description": "Development server port",
55
+ "default": 5000,
56
+ "minimum": 1024,
57
+ "maximum": 65535
58
+ },
59
+ "hmrPort": {
60
+ "type": "number",
61
+ "description": "Development HMR server port",
55
62
  "default": 6000,
56
63
  "minimum": 1024,
57
64
  "maximum": 65535
@@ -15,7 +15,7 @@
15
15
  "postcss": "^8.4.49",
16
16
  "tailwindcss": "^3.4.17",
17
17
  "typescript": "^5.6.0",
18
- "vite": "^6.0.0"
18
+ "vite": "^7.2.4"
19
19
  },
20
20
  "packageManager": "pnpm@9.0.0",
21
21
  "engines": {
@@ -24,8 +24,8 @@ importers:
24
24
  specifier: ^5.6.0
25
25
  version: 5.9.3
26
26
  vite:
27
- specifier: ^6.0.0
28
- version: 6.4.1(jiti@1.21.7)
27
+ specifier: ^7.2.4
28
+ version: 7.3.0(jiti@1.21.7)
29
29
 
30
30
  packages:
31
31
 
@@ -33,158 +33,158 @@ packages:
33
33
  resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
34
34
  engines: {node: '>=10'}
35
35
 
36
- '@esbuild/aix-ppc64@0.25.12':
37
- resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==}
36
+ '@esbuild/aix-ppc64@0.27.2':
37
+ resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==}
38
38
  engines: {node: '>=18'}
39
39
  cpu: [ppc64]
40
40
  os: [aix]
41
41
 
42
- '@esbuild/android-arm64@0.25.12':
43
- resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==}
42
+ '@esbuild/android-arm64@0.27.2':
43
+ resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==}
44
44
  engines: {node: '>=18'}
45
45
  cpu: [arm64]
46
46
  os: [android]
47
47
 
48
- '@esbuild/android-arm@0.25.12':
49
- resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==}
48
+ '@esbuild/android-arm@0.27.2':
49
+ resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==}
50
50
  engines: {node: '>=18'}
51
51
  cpu: [arm]
52
52
  os: [android]
53
53
 
54
- '@esbuild/android-x64@0.25.12':
55
- resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==}
54
+ '@esbuild/android-x64@0.27.2':
55
+ resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==}
56
56
  engines: {node: '>=18'}
57
57
  cpu: [x64]
58
58
  os: [android]
59
59
 
60
- '@esbuild/darwin-arm64@0.25.12':
61
- resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==}
60
+ '@esbuild/darwin-arm64@0.27.2':
61
+ resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==}
62
62
  engines: {node: '>=18'}
63
63
  cpu: [arm64]
64
64
  os: [darwin]
65
65
 
66
- '@esbuild/darwin-x64@0.25.12':
67
- resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==}
66
+ '@esbuild/darwin-x64@0.27.2':
67
+ resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==}
68
68
  engines: {node: '>=18'}
69
69
  cpu: [x64]
70
70
  os: [darwin]
71
71
 
72
- '@esbuild/freebsd-arm64@0.25.12':
73
- resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==}
72
+ '@esbuild/freebsd-arm64@0.27.2':
73
+ resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==}
74
74
  engines: {node: '>=18'}
75
75
  cpu: [arm64]
76
76
  os: [freebsd]
77
77
 
78
- '@esbuild/freebsd-x64@0.25.12':
79
- resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==}
78
+ '@esbuild/freebsd-x64@0.27.2':
79
+ resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==}
80
80
  engines: {node: '>=18'}
81
81
  cpu: [x64]
82
82
  os: [freebsd]
83
83
 
84
- '@esbuild/linux-arm64@0.25.12':
85
- resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==}
84
+ '@esbuild/linux-arm64@0.27.2':
85
+ resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==}
86
86
  engines: {node: '>=18'}
87
87
  cpu: [arm64]
88
88
  os: [linux]
89
89
 
90
- '@esbuild/linux-arm@0.25.12':
91
- resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==}
90
+ '@esbuild/linux-arm@0.27.2':
91
+ resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==}
92
92
  engines: {node: '>=18'}
93
93
  cpu: [arm]
94
94
  os: [linux]
95
95
 
96
- '@esbuild/linux-ia32@0.25.12':
97
- resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==}
96
+ '@esbuild/linux-ia32@0.27.2':
97
+ resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==}
98
98
  engines: {node: '>=18'}
99
99
  cpu: [ia32]
100
100
  os: [linux]
101
101
 
102
- '@esbuild/linux-loong64@0.25.12':
103
- resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==}
102
+ '@esbuild/linux-loong64@0.27.2':
103
+ resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==}
104
104
  engines: {node: '>=18'}
105
105
  cpu: [loong64]
106
106
  os: [linux]
107
107
 
108
- '@esbuild/linux-mips64el@0.25.12':
109
- resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==}
108
+ '@esbuild/linux-mips64el@0.27.2':
109
+ resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==}
110
110
  engines: {node: '>=18'}
111
111
  cpu: [mips64el]
112
112
  os: [linux]
113
113
 
114
- '@esbuild/linux-ppc64@0.25.12':
115
- resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==}
114
+ '@esbuild/linux-ppc64@0.27.2':
115
+ resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==}
116
116
  engines: {node: '>=18'}
117
117
  cpu: [ppc64]
118
118
  os: [linux]
119
119
 
120
- '@esbuild/linux-riscv64@0.25.12':
121
- resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==}
120
+ '@esbuild/linux-riscv64@0.27.2':
121
+ resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==}
122
122
  engines: {node: '>=18'}
123
123
  cpu: [riscv64]
124
124
  os: [linux]
125
125
 
126
- '@esbuild/linux-s390x@0.25.12':
127
- resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==}
126
+ '@esbuild/linux-s390x@0.27.2':
127
+ resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==}
128
128
  engines: {node: '>=18'}
129
129
  cpu: [s390x]
130
130
  os: [linux]
131
131
 
132
- '@esbuild/linux-x64@0.25.12':
133
- resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==}
132
+ '@esbuild/linux-x64@0.27.2':
133
+ resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==}
134
134
  engines: {node: '>=18'}
135
135
  cpu: [x64]
136
136
  os: [linux]
137
137
 
138
- '@esbuild/netbsd-arm64@0.25.12':
139
- resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==}
138
+ '@esbuild/netbsd-arm64@0.27.2':
139
+ resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==}
140
140
  engines: {node: '>=18'}
141
141
  cpu: [arm64]
142
142
  os: [netbsd]
143
143
 
144
- '@esbuild/netbsd-x64@0.25.12':
145
- resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==}
144
+ '@esbuild/netbsd-x64@0.27.2':
145
+ resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==}
146
146
  engines: {node: '>=18'}
147
147
  cpu: [x64]
148
148
  os: [netbsd]
149
149
 
150
- '@esbuild/openbsd-arm64@0.25.12':
151
- resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==}
150
+ '@esbuild/openbsd-arm64@0.27.2':
151
+ resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==}
152
152
  engines: {node: '>=18'}
153
153
  cpu: [arm64]
154
154
  os: [openbsd]
155
155
 
156
- '@esbuild/openbsd-x64@0.25.12':
157
- resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==}
156
+ '@esbuild/openbsd-x64@0.27.2':
157
+ resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==}
158
158
  engines: {node: '>=18'}
159
159
  cpu: [x64]
160
160
  os: [openbsd]
161
161
 
162
- '@esbuild/openharmony-arm64@0.25.12':
163
- resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==}
162
+ '@esbuild/openharmony-arm64@0.27.2':
163
+ resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==}
164
164
  engines: {node: '>=18'}
165
165
  cpu: [arm64]
166
166
  os: [openharmony]
167
167
 
168
- '@esbuild/sunos-x64@0.25.12':
169
- resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==}
168
+ '@esbuild/sunos-x64@0.27.2':
169
+ resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==}
170
170
  engines: {node: '>=18'}
171
171
  cpu: [x64]
172
172
  os: [sunos]
173
173
 
174
- '@esbuild/win32-arm64@0.25.12':
175
- resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==}
174
+ '@esbuild/win32-arm64@0.27.2':
175
+ resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==}
176
176
  engines: {node: '>=18'}
177
177
  cpu: [arm64]
178
178
  os: [win32]
179
179
 
180
- '@esbuild/win32-ia32@0.25.12':
181
- resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==}
180
+ '@esbuild/win32-ia32@0.27.2':
181
+ resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==}
182
182
  engines: {node: '>=18'}
183
183
  cpu: [ia32]
184
184
  os: [win32]
185
185
 
186
- '@esbuild/win32-x64@0.25.12':
187
- resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==}
186
+ '@esbuild/win32-x64@0.27.2':
187
+ resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==}
188
188
  engines: {node: '>=18'}
189
189
  cpu: [x64]
190
190
  os: [win32]
@@ -401,8 +401,8 @@ packages:
401
401
  electron-to-chromium@1.5.267:
402
402
  resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==}
403
403
 
404
- esbuild@0.25.12:
405
- resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==}
404
+ esbuild@0.27.2:
405
+ resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==}
406
406
  engines: {node: '>=18'}
407
407
  hasBin: true
408
408
 
@@ -665,19 +665,19 @@ packages:
665
665
  util-deprecate@1.0.2:
666
666
  resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
667
667
 
668
- vite@6.4.1:
669
- resolution: {integrity: sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==}
670
- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
668
+ vite@7.3.0:
669
+ resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==}
670
+ engines: {node: ^20.19.0 || >=22.12.0}
671
671
  hasBin: true
672
672
  peerDependencies:
673
- '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
673
+ '@types/node': ^20.19.0 || >=22.12.0
674
674
  jiti: '>=1.21.0'
675
- less: '*'
675
+ less: ^4.0.0
676
676
  lightningcss: ^1.21.0
677
- sass: '*'
678
- sass-embedded: '*'
679
- stylus: '*'
680
- sugarss: '*'
677
+ sass: ^1.70.0
678
+ sass-embedded: ^1.70.0
679
+ stylus: '>=0.54.8'
680
+ sugarss: ^5.0.0
681
681
  terser: ^5.16.0
682
682
  tsx: ^4.8.1
683
683
  yaml: ^2.4.2
@@ -713,82 +713,82 @@ snapshots:
713
713
 
714
714
  '@alloc/quick-lru@5.2.0': {}
715
715
 
716
- '@esbuild/aix-ppc64@0.25.12':
716
+ '@esbuild/aix-ppc64@0.27.2':
717
717
  optional: true
718
718
 
719
- '@esbuild/android-arm64@0.25.12':
719
+ '@esbuild/android-arm64@0.27.2':
720
720
  optional: true
721
721
 
722
- '@esbuild/android-arm@0.25.12':
722
+ '@esbuild/android-arm@0.27.2':
723
723
  optional: true
724
724
 
725
- '@esbuild/android-x64@0.25.12':
725
+ '@esbuild/android-x64@0.27.2':
726
726
  optional: true
727
727
 
728
- '@esbuild/darwin-arm64@0.25.12':
728
+ '@esbuild/darwin-arm64@0.27.2':
729
729
  optional: true
730
730
 
731
- '@esbuild/darwin-x64@0.25.12':
731
+ '@esbuild/darwin-x64@0.27.2':
732
732
  optional: true
733
733
 
734
- '@esbuild/freebsd-arm64@0.25.12':
734
+ '@esbuild/freebsd-arm64@0.27.2':
735
735
  optional: true
736
736
 
737
- '@esbuild/freebsd-x64@0.25.12':
737
+ '@esbuild/freebsd-x64@0.27.2':
738
738
  optional: true
739
739
 
740
- '@esbuild/linux-arm64@0.25.12':
740
+ '@esbuild/linux-arm64@0.27.2':
741
741
  optional: true
742
742
 
743
- '@esbuild/linux-arm@0.25.12':
743
+ '@esbuild/linux-arm@0.27.2':
744
744
  optional: true
745
745
 
746
- '@esbuild/linux-ia32@0.25.12':
746
+ '@esbuild/linux-ia32@0.27.2':
747
747
  optional: true
748
748
 
749
- '@esbuild/linux-loong64@0.25.12':
749
+ '@esbuild/linux-loong64@0.27.2':
750
750
  optional: true
751
751
 
752
- '@esbuild/linux-mips64el@0.25.12':
752
+ '@esbuild/linux-mips64el@0.27.2':
753
753
  optional: true
754
754
 
755
- '@esbuild/linux-ppc64@0.25.12':
755
+ '@esbuild/linux-ppc64@0.27.2':
756
756
  optional: true
757
757
 
758
- '@esbuild/linux-riscv64@0.25.12':
758
+ '@esbuild/linux-riscv64@0.27.2':
759
759
  optional: true
760
760
 
761
- '@esbuild/linux-s390x@0.25.12':
761
+ '@esbuild/linux-s390x@0.27.2':
762
762
  optional: true
763
763
 
764
- '@esbuild/linux-x64@0.25.12':
764
+ '@esbuild/linux-x64@0.27.2':
765
765
  optional: true
766
766
 
767
- '@esbuild/netbsd-arm64@0.25.12':
767
+ '@esbuild/netbsd-arm64@0.27.2':
768
768
  optional: true
769
769
 
770
- '@esbuild/netbsd-x64@0.25.12':
770
+ '@esbuild/netbsd-x64@0.27.2':
771
771
  optional: true
772
772
 
773
- '@esbuild/openbsd-arm64@0.25.12':
773
+ '@esbuild/openbsd-arm64@0.27.2':
774
774
  optional: true
775
775
 
776
- '@esbuild/openbsd-x64@0.25.12':
776
+ '@esbuild/openbsd-x64@0.27.2':
777
777
  optional: true
778
778
 
779
- '@esbuild/openharmony-arm64@0.25.12':
779
+ '@esbuild/openharmony-arm64@0.27.2':
780
780
  optional: true
781
781
 
782
- '@esbuild/sunos-x64@0.25.12':
782
+ '@esbuild/sunos-x64@0.27.2':
783
783
  optional: true
784
784
 
785
- '@esbuild/win32-arm64@0.25.12':
785
+ '@esbuild/win32-arm64@0.27.2':
786
786
  optional: true
787
787
 
788
- '@esbuild/win32-ia32@0.25.12':
788
+ '@esbuild/win32-ia32@0.27.2':
789
789
  optional: true
790
790
 
791
- '@esbuild/win32-x64@0.25.12':
791
+ '@esbuild/win32-x64@0.27.2':
792
792
  optional: true
793
793
 
794
794
  '@jridgewell/gen-mapping@0.3.13':
@@ -945,34 +945,34 @@ snapshots:
945
945
 
946
946
  electron-to-chromium@1.5.267: {}
947
947
 
948
- esbuild@0.25.12:
948
+ esbuild@0.27.2:
949
949
  optionalDependencies:
950
- '@esbuild/aix-ppc64': 0.25.12
951
- '@esbuild/android-arm': 0.25.12
952
- '@esbuild/android-arm64': 0.25.12
953
- '@esbuild/android-x64': 0.25.12
954
- '@esbuild/darwin-arm64': 0.25.12
955
- '@esbuild/darwin-x64': 0.25.12
956
- '@esbuild/freebsd-arm64': 0.25.12
957
- '@esbuild/freebsd-x64': 0.25.12
958
- '@esbuild/linux-arm': 0.25.12
959
- '@esbuild/linux-arm64': 0.25.12
960
- '@esbuild/linux-ia32': 0.25.12
961
- '@esbuild/linux-loong64': 0.25.12
962
- '@esbuild/linux-mips64el': 0.25.12
963
- '@esbuild/linux-ppc64': 0.25.12
964
- '@esbuild/linux-riscv64': 0.25.12
965
- '@esbuild/linux-s390x': 0.25.12
966
- '@esbuild/linux-x64': 0.25.12
967
- '@esbuild/netbsd-arm64': 0.25.12
968
- '@esbuild/netbsd-x64': 0.25.12
969
- '@esbuild/openbsd-arm64': 0.25.12
970
- '@esbuild/openbsd-x64': 0.25.12
971
- '@esbuild/openharmony-arm64': 0.25.12
972
- '@esbuild/sunos-x64': 0.25.12
973
- '@esbuild/win32-arm64': 0.25.12
974
- '@esbuild/win32-ia32': 0.25.12
975
- '@esbuild/win32-x64': 0.25.12
950
+ '@esbuild/aix-ppc64': 0.27.2
951
+ '@esbuild/android-arm': 0.27.2
952
+ '@esbuild/android-arm64': 0.27.2
953
+ '@esbuild/android-x64': 0.27.2
954
+ '@esbuild/darwin-arm64': 0.27.2
955
+ '@esbuild/darwin-x64': 0.27.2
956
+ '@esbuild/freebsd-arm64': 0.27.2
957
+ '@esbuild/freebsd-x64': 0.27.2
958
+ '@esbuild/linux-arm': 0.27.2
959
+ '@esbuild/linux-arm64': 0.27.2
960
+ '@esbuild/linux-ia32': 0.27.2
961
+ '@esbuild/linux-loong64': 0.27.2
962
+ '@esbuild/linux-mips64el': 0.27.2
963
+ '@esbuild/linux-ppc64': 0.27.2
964
+ '@esbuild/linux-riscv64': 0.27.2
965
+ '@esbuild/linux-s390x': 0.27.2
966
+ '@esbuild/linux-x64': 0.27.2
967
+ '@esbuild/netbsd-arm64': 0.27.2
968
+ '@esbuild/netbsd-x64': 0.27.2
969
+ '@esbuild/openbsd-arm64': 0.27.2
970
+ '@esbuild/openbsd-x64': 0.27.2
971
+ '@esbuild/openharmony-arm64': 0.27.2
972
+ '@esbuild/sunos-x64': 0.27.2
973
+ '@esbuild/win32-arm64': 0.27.2
974
+ '@esbuild/win32-ia32': 0.27.2
975
+ '@esbuild/win32-x64': 0.27.2
976
976
 
977
977
  escalade@3.2.0: {}
978
978
 
@@ -1234,9 +1234,9 @@ snapshots:
1234
1234
 
1235
1235
  util-deprecate@1.0.2: {}
1236
1236
 
1237
- vite@6.4.1(jiti@1.21.7):
1237
+ vite@7.3.0(jiti@1.21.7):
1238
1238
  dependencies:
1239
- esbuild: 0.25.12
1239
+ esbuild: 0.27.2
1240
1240
  fdir: 6.5.0(picomatch@4.0.3)
1241
1241
  picomatch: 4.0.3
1242
1242
  postcss: 8.5.6
@@ -3,44 +3,25 @@ set -Eeuo pipefail
3
3
 
4
4
  PORT=<%= port %>
5
5
  COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
6
+ DEPLOY_RUN_PORT=<%= port %>
6
7
 
7
8
  cd "${COZE_WORKSPACE_PATH}"
8
9
 
9
10
  kill_port_if_listening() {
10
11
  local pids
11
-
12
- # Check if lsof is available (macOS/BSD) or ss (Linux)
13
- if command -v lsof >/dev/null 2>&1; then
14
- # macOS/BSD using lsof
15
- pids=$(lsof -ti:${PORT} 2>/dev/null || true)
16
- elif command -v ss >/dev/null 2>&1; then
17
- # Linux using ss
18
- pids=$(ss -H -lntp 2>/dev/null | awk -v port="${PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
19
- else
20
- echo "Warning: neither lsof nor ss found, cannot check port ${PORT}"
21
- return
22
- fi
23
-
12
+ pids=$(ss -H -lntp 2>/dev/null | awk -v port="${DEPLOY_RUN_PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
24
13
  if [[ -z "${pids}" ]]; then
25
- echo "Port ${PORT} is free."
14
+ echo "Port ${DEPLOY_RUN_PORT} is free."
26
15
  return
27
16
  fi
28
-
29
- echo "Port ${PORT} in use by PIDs: ${pids} (SIGKILL)"
17
+ echo "Port ${DEPLOY_RUN_PORT} in use by PIDs: ${pids} (SIGKILL)"
30
18
  echo "${pids}" | xargs -I {} kill -9 {}
31
19
  sleep 1
32
-
33
- # Verify port is cleared
34
- if command -v lsof >/dev/null 2>&1; then
35
- pids=$(lsof -ti:${PORT} 2>/dev/null || true)
36
- elif command -v ss >/dev/null 2>&1; then
37
- pids=$(ss -H -lntp 2>/dev/null | awk -v port="${PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
38
- fi
39
-
20
+ pids=$(ss -H -lntp 2>/dev/null | awk -v port="${DEPLOY_RUN_PORT}" '$4 ~ ":"port"$"' | grep -o 'pid=[0-9]*' | cut -d= -f2 | paste -sd' ' - || true)
40
21
  if [[ -n "${pids}" ]]; then
41
- echo "Warning: port ${PORT} still busy after SIGKILL, PIDs: ${pids}"
22
+ echo "Warning: port ${DEPLOY_RUN_PORT} still busy after SIGKILL, PIDs: ${pids}"
42
23
  else
43
- echo "Port ${PORT} cleared."
24
+ echo "Port ${DEPLOY_RUN_PORT} cleared."
44
25
  fi
45
26
  }
46
27
 
@@ -7,6 +7,7 @@
7
7
 
8
8
 
9
9
 
10
+
10
11
  export const paramsSchema = {
11
12
  type: 'object',
12
13
  properties: {
@@ -19,11 +20,18 @@ export const paramsSchema = {
19
20
  },
20
21
  port: {
21
22
  type: 'number',
22
- default: 6000,
23
+ default: 5000,
23
24
  minimum: 1024,
24
25
  maximum: 65535,
25
26
  description: 'Development server port',
26
27
  },
28
+ hmrPort: {
29
+ type: 'number',
30
+ default: 6000,
31
+ minimum: 1024,
32
+ maximum: 65535,
33
+ description: 'Development HMR server port',
34
+ },
27
35
  },
28
36
  required: [],
29
37
  additionalProperties: false,
@@ -33,7 +41,8 @@ const config = {
33
41
  paramsSchema,
34
42
 
35
43
  defaultParams: {
36
- port: 6000,
44
+ port: 5000,
45
+ hmrPort: 6000,
37
46
  appName: 'projects',
38
47
  },
39
48
 
@@ -1,13 +1,16 @@
1
1
  import { defineConfig } from 'vite';
2
2
 
3
3
  export default defineConfig({
4
- port: '<%= port %>',
5
- host: '0.0.0.0',
4
+ define:{
5
+ __DEFINES__:JSON.stringify({})
6
+ },
6
7
  server: {
8
+ port: <%= port %>,
9
+ host: '0.0.0.0',
7
10
  hmr: {
8
11
  overlay: true,
9
12
  path: '/hot/vite-hmr',
10
- port: '<%= port %>',
13
+ port: <%= hmrPort %>,
11
14
  clientPort: 443,
12
15
  timeout: 30000,
13
16
  },
package/lib/cli.js CHANGED
@@ -9,6 +9,8 @@ var perf_hooks = require('perf_hooks');
9
9
  var fs$1 = require('fs/promises');
10
10
  var toml = require('@iarna/toml');
11
11
  var jsYaml = require('js-yaml');
12
+ var child_process = require('child_process');
13
+ var os = require('os');
12
14
  var addFormats = require('ajv-formats');
13
15
  var Ajv = require('ajv');
14
16
  var minimist = require('minimist');
@@ -125,7 +127,7 @@ const generateTemplatesHelpText = () => {
125
127
  return lines.join('\n');
126
128
  };
127
129
 
128
- function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var LogLevel; (function (LogLevel) {
130
+ function _nullishCoalesce$2(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var LogLevel; (function (LogLevel) {
129
131
  const ERROR = 0; LogLevel[LogLevel["ERROR"] = ERROR] = "ERROR";
130
132
  const WARN = 1; LogLevel[LogLevel["WARN"] = WARN] = "WARN";
131
133
  const SUCCESS = 2; LogLevel[LogLevel["SUCCESS"] = SUCCESS] = "SUCCESS";
@@ -172,7 +174,7 @@ class Logger {
172
174
  return level;
173
175
  }
174
176
 
175
- const envLevel = _optionalChain$4([process, 'access', _ => _.env, 'access', _2 => _2.LOG_LEVEL, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]);
177
+ const envLevel = _optionalChain$3([process, 'access', _ => _.env, 'access', _2 => _2.LOG_LEVEL, 'optionalAccess', _3 => _3.toLowerCase, 'call', _4 => _4()]);
176
178
  if (envLevel && envLevel in LOG_LEVEL_MAP) {
177
179
  return LOG_LEVEL_MAP[envLevel];
178
180
  }
@@ -184,7 +186,7 @@ class Logger {
184
186
  // 简单检测:Node.js 环境且支持 TTY
185
187
  return (
186
188
  typeof process !== 'undefined' &&
187
- _optionalChain$4([process, 'access', _5 => _5.stdout, 'optionalAccess', _6 => _6.isTTY]) === true &&
189
+ _optionalChain$3([process, 'access', _5 => _5.stdout, 'optionalAccess', _6 => _6.isTTY]) === true &&
188
190
  process.env.NO_COLOR === undefined
189
191
  );
190
192
  }
@@ -593,7 +595,7 @@ const registerCommand$2 = program => {
593
595
  });
594
596
  };
595
597
 
596
- function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* eslint-disable @typescript-eslint/no-explicit-any */
598
+ function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/* eslint-disable @typescript-eslint/no-explicit-any */
597
599
  // Safe JSON parsing utilities with type safety and error handling
598
600
  // Provides fallback values, validation, and error monitoring capabilities
599
601
 
@@ -684,12 +686,12 @@ function safeJsonParse(
684
686
  const parsed = JSON.parse(String(input));
685
687
 
686
688
  // Optional validation
687
- if (_optionalChain$3([options, 'optionalAccess', _ => _.validate])) {
689
+ if (_optionalChain$2([options, 'optionalAccess', _ => _.validate])) {
688
690
  if (options.validate(parsed)) {
689
691
  return parsed;
690
692
  } else {
691
693
  const validationError = new Error('JSON validation failed');
692
- _optionalChain$3([options, 'access', _2 => _2.onError, 'optionalCall', _3 => _3(validationError, input)]);
694
+ _optionalChain$2([options, 'access', _2 => _2.onError, 'optionalCall', _3 => _3(validationError, input)]);
693
695
 
694
696
  if (options.throwOnValidationError) {
695
697
  throw validationError;
@@ -701,15 +703,15 @@ function safeJsonParse(
701
703
  return parsed;
702
704
  } catch (error) {
703
705
  // Re-throw validation errors when throwOnValidationError is true
704
- if (error instanceof Error && error.message === 'JSON validation failed' && _optionalChain$3([options, 'optionalAccess', _4 => _4.throwOnValidationError])) {
706
+ if (error instanceof Error && error.message === 'JSON validation failed' && _optionalChain$2([options, 'optionalAccess', _4 => _4.throwOnValidationError])) {
705
707
  throw error;
706
708
  }
707
- _optionalChain$3([options, 'optionalAccess', _5 => _5.onError, 'optionalCall', _6 => _6(error , input)]);
709
+ _optionalChain$2([options, 'optionalAccess', _5 => _5.onError, 'optionalCall', _6 => _6(error , input)]);
708
710
  return defaultValue;
709
711
  }
710
712
  }
711
713
 
712
- function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
714
+ function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
713
715
 
714
716
 
715
717
  /**
@@ -799,13 +801,13 @@ const getCommandConfig = (
799
801
  // 根据命令名称映射到配置路径
800
802
  switch (commandName) {
801
803
  case 'dev':
802
- commandConfig = _optionalChain$2([config, 'access', _ => _.dev, 'optionalAccess', _2 => _2.run]);
804
+ commandConfig = _optionalChain$1([config, 'access', _ => _.dev, 'optionalAccess', _2 => _2.run]);
803
805
  break;
804
806
  case 'build':
805
- commandConfig = _optionalChain$2([config, 'access', _3 => _3.deploy, 'optionalAccess', _4 => _4.build]);
807
+ commandConfig = _optionalChain$1([config, 'access', _3 => _3.deploy, 'optionalAccess', _4 => _4.build]);
806
808
  break;
807
809
  case 'start':
808
- commandConfig = _optionalChain$2([config, 'access', _5 => _5.deploy, 'optionalAccess', _6 => _6.run]);
810
+ commandConfig = _optionalChain$1([config, 'access', _5 => _5.deploy, 'optionalAccess', _6 => _6.run]);
809
811
  break;
810
812
  default:
811
813
  throw new Error(`Unknown command: ${commandName}`);
@@ -821,7 +823,7 @@ const getCommandConfig = (
821
823
  return commandConfig;
822
824
  };
823
825
 
824
- function _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
826
+ function _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
825
827
 
826
828
  /**
827
829
  * 创建日志管理器
@@ -879,12 +881,12 @@ const executeRun = async (
879
881
  }
880
882
 
881
883
  // 将输出同时写入控制台和日志文件
882
- _optionalChain$1([childProcess, 'access', _ => _.stdout, 'optionalAccess', _2 => _2.on, 'call', _3 => _3('data', (data) => {
884
+ _optionalChain([childProcess, 'access', _ => _.stdout, 'optionalAccess', _2 => _2.on, 'call', _3 => _3('data', (data) => {
883
885
  process.stdout.write(data);
884
886
  logStream.write(data);
885
887
  })]);
886
888
 
887
- _optionalChain$1([childProcess, 'access', _4 => _4.stderr, 'optionalAccess', _5 => _5.on, 'call', _6 => _6('data', (data) => {
889
+ _optionalChain([childProcess, 'access', _4 => _4.stderr, 'optionalAccess', _5 => _5.on, 'call', _6 => _6('data', (data) => {
888
890
  process.stderr.write(data);
889
891
  logStream.write(data);
890
892
  })]);
@@ -952,6 +954,45 @@ const registerCommand$1 = program => {
952
954
  });
953
955
  };
954
956
 
957
+ /**
958
+ * 在后台启动一个独立的子进程
959
+ * 类似于 `setsid command args >/dev/null 2>&1 &`
960
+ *
961
+ * @param command - 要执行的命令 (例如: 'npm', 'node', 'bash')
962
+ * @param args - 命令参数数组 (例如: ['run', 'dev'])
963
+ * @param options - 配置选项
964
+ * @returns 子进程的 PID
965
+ */
966
+ function spawnDetached(
967
+ command,
968
+ args,
969
+ options,
970
+ ) {
971
+ const { cwd, verbose = true } = options;
972
+ const isWindows = os.platform() === 'win32';
973
+
974
+ if (verbose) {
975
+ console.log(`Spawning detached process: ${command} ${args.join(' ')}`);
976
+ console.log(`Working directory: ${cwd}`);
977
+ }
978
+
979
+ // 使用 spawn 创建后台子进程
980
+ const child = child_process.spawn(command, args, {
981
+ cwd,
982
+ detached: !isWindows, // Windows 不完全支持 detached,但仍可以使用
983
+ stdio: 'ignore', // 忽略所有输入输出,让进程完全独立运行
984
+ });
985
+
986
+ // 分离父子进程引用,允许父进程退出而不等待子进程
987
+ child.unref();
988
+
989
+ if (verbose && child.pid) {
990
+ console.log(`Process started with PID: ${child.pid}`);
991
+ }
992
+
993
+ return child.pid;
994
+ }
995
+
955
996
  /**
956
997
  * 创建 AJV 验证器实例
957
998
  */
@@ -1465,7 +1506,7 @@ const execute = async (
1465
1506
  return absoluteOutputPath;
1466
1507
  };
1467
1508
 
1468
- function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1509
+ function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1469
1510
  /**
1470
1511
  * 运行 pnpm install
1471
1512
  */
@@ -1568,45 +1609,26 @@ const runGitInit = (projectPath) => {
1568
1609
  };
1569
1610
 
1570
1611
  /**
1571
- * 运行开发服务器
1612
+ * 运行开发服务器(后台模式)
1613
+ * 启动后台子进程运行开发服务器,父进程可以直接退出
1572
1614
  */
1573
1615
  const runNpmDev = (projectPath) => {
1574
- logger.info('\nStarting development server...');
1616
+ logger.info('\nStarting development server in background...');
1575
1617
  logger.info(`Executing: npm run dev in ${projectPath}`);
1576
- logger.info('Press Ctrl+C to stop the server\n');
1577
1618
 
1578
- // 使用 async: true 异步执行,不阻塞进程
1579
- const child = shelljs.exec('npm run dev', {
1619
+ // 使用通用的后台执行函数启动开发服务器
1620
+ const pid = spawnDetached('npm', ['run', 'dev'], {
1580
1621
  cwd: projectPath,
1581
- async: true,
1582
- silent: true, // 手动处理输出以便显示详细信息
1622
+ verbose: false, // 不输出额外的进程信息,由 logger 统一处理
1583
1623
  });
1584
1624
 
1585
- if (child) {
1586
- // 输出 stdout
1587
- _optionalChain([child, 'access', _ => _.stdout, 'optionalAccess', _2 => _2.on, 'call', _3 => _3('data', (data) => {
1588
- process.stdout.write(data);
1589
- })]);
1590
-
1591
- // 输出 stderr
1592
- _optionalChain([child, 'access', _4 => _4.stderr, 'optionalAccess', _5 => _5.on, 'call', _6 => _6('data', (data) => {
1593
- process.stderr.write(data);
1594
- })]);
1595
-
1596
- // 监听错误
1597
- child.on('error', (error) => {
1598
- logger.error(`Failed to start dev server: ${error.message}`);
1599
- logger.error(`Error stack: ${error.stack}`);
1600
- });
1601
-
1602
- // 监听退出
1603
- child.on('exit', (code, signal) => {
1604
- if (code !== 0 && code !== null) {
1605
- logger.error(
1606
- `Dev server exited with code ${code}${signal ? ` and signal ${signal}` : ''}`,
1607
- );
1608
- }
1609
- });
1625
+ logger.success('Development server started in background!');
1626
+ if (pid) {
1627
+ logger.info(`Process ID: ${pid}`);
1628
+ logger.info(
1629
+ '\nThe dev server is running independently. You can close this terminal.',
1630
+ );
1631
+ logger.info(`To stop the server later, use: kill ${pid}`);
1610
1632
  }
1611
1633
  };
1612
1634
 
@@ -1719,7 +1741,7 @@ const registerCommand = program => {
1719
1741
  });
1720
1742
  };
1721
1743
 
1722
- var version = "0.0.1-alpha.6a5120";
1744
+ var version = "0.0.1-alpha.7d92f8";
1723
1745
  var packageJson = {
1724
1746
  version: version};
1725
1747
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.1-alpha.6a5120",
3
+ "version": "0.0.1-alpha.7d92f8",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",