@coze-arch/cli 0.0.20-alpha.d2b336 → 0.0.21-alpha.df4fd6
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/.cozeproj/scripts/dev_build.sh +1 -13
- package/lib/__templates__/expo/.cozeproj/scripts/dev_run.sh +0 -12
- package/lib/__templates__/expo/client/components/Screen.tsx +5 -5
- package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.types.ts +6 -6
- package/lib/__templates__/expo/client/heroui/components/toast/toast.tsx +2 -2
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-augmented-ref.ts +2 -2
- package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts +1 -1
- package/lib/__templates__/expo/client/package.json +1 -1
- package/lib/__templates__/expo/server/package.json +1 -1
- package/lib/__templates__/nextjs/scripts/dev.sh +4 -4
- package/lib/__templates__/nuxt-vue/scripts/dev.sh +4 -4
- package/lib/__templates__/pi-agent/package.json +1 -1
- package/lib/__templates__/pi-agent/tests/web-search.test.ts +2 -2
- package/lib/__templates__/taro/src/components/ui/collapsible.tsx +2 -2
- package/lib/__templates__/taro/src/components/ui/hover-card.tsx +10 -10
- package/lib/__templates__/taro/src/components/ui/input-otp.tsx +3 -2
- package/lib/__templates__/taro/src/components/ui/slider.tsx +4 -4
- package/lib/__templates__/taro/src/components/ui/tabs.tsx +2 -1
- package/lib/__templates__/taro/src/components/ui/toast.tsx +1 -1
- package/lib/__templates__/taro/src/components/ui/tooltip.tsx +10 -10
- package/lib/__templates__/taro/src/lib/measure.ts +1 -1
- package/lib/__templates__/vite/scripts/dev.sh +4 -4
- package/lib/__templates__/vite/server/server.ts +1 -2
- package/lib/cli.js +14 -10
- package/package.json +10 -6
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
if [ -z "${BASH_VERSION:-}" ]; then exec /usr/bin/env bash "$0" "$@"; fi
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
ROOT_DIR="$(pwd)"
|
|
5
|
-
PREVIEW_DIR="${COZE_PREVIEW_DIR:-/source/preview}"
|
|
6
5
|
|
|
7
6
|
# ==================== 配置项 ====================
|
|
8
7
|
SERVER_DIR="app"
|
|
@@ -17,11 +16,6 @@ check_command() {
|
|
|
17
16
|
|
|
18
17
|
echo "==================== 开始构建 ===================="
|
|
19
18
|
|
|
20
|
-
echo "检查根目录 pre_install.py"
|
|
21
|
-
if [ -f "$PREVIEW_DIR/pre_install.py" ]; then
|
|
22
|
-
echo "执行:python $PREVIEW_DIR/pre_install.py"
|
|
23
|
-
python "$PREVIEW_DIR/pre_install.py" || echo "pre_install.py 执行失败"
|
|
24
|
-
fi
|
|
25
19
|
|
|
26
20
|
echo "开始执行构建脚本(build_dev.sh)..."
|
|
27
21
|
echo "正在检查依赖命令是否存在..."
|
|
@@ -36,11 +30,5 @@ fi
|
|
|
36
30
|
# 步骤 2.1/2.2:安装项目依赖
|
|
37
31
|
pnpm install --registry=https://registry.npmmirror.com || echo "Expo 项目依赖安装失败(pnpm 执行出错)"
|
|
38
32
|
|
|
39
|
-
echo "检查根目录 post_install.py"
|
|
40
|
-
if [ -f "$PREVIEW_DIR/post_install.py" ]; then
|
|
41
|
-
echo "执行:python $PREVIEW_DIR/post_install.py"
|
|
42
|
-
python "$PREVIEW_DIR/post_install.py" || echo "post_install.py 执行失败"
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
33
|
echo "==================== 依赖安装完成!====================\n"
|
|
46
|
-
echo "下一步:执行 ./
|
|
34
|
+
echo "下一步:执行 ./dev_run.sh 启动服务"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
2
|
-
PREVIEW_DIR="${COZE_PREVIEW_DIR:-/source/preview}"
|
|
3
2
|
LOG_DIR="${COZE_LOG_DIR:-$ROOT_DIR/logs}"
|
|
4
3
|
LOG_CLIENT_FILE="$LOG_DIR/client.log"
|
|
5
4
|
mkdir -p "$LOG_DIR"
|
|
@@ -148,17 +147,6 @@ detect_expo_fetch_failed() {
|
|
|
148
147
|
# 关掉nginx进程
|
|
149
148
|
ps -ef | grep nginx | grep -v grep | awk '{print $2}' | xargs -r kill -9
|
|
150
149
|
|
|
151
|
-
echo "检查根目录 pre_install.py"
|
|
152
|
-
if [ -f "$PREVIEW_DIR/pre_install.py" ]; then
|
|
153
|
-
echo "执行:python $PREVIEW_DIR/pre_install.py"
|
|
154
|
-
python "$PREVIEW_DIR/pre_install.py" || echo "pre_install.py 执行失败"
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
echo "检查根目录 post_install.py"
|
|
158
|
-
if [ -f "$PREVIEW_DIR/post_install.py" ]; then
|
|
159
|
-
echo "执行:python $PREVIEW_DIR/post_install.py"
|
|
160
|
-
python "$PREVIEW_DIR/post_install.py" || echo "post_install.py 执行失败"
|
|
161
|
-
fi
|
|
162
150
|
|
|
163
151
|
echo "==================== 开始启动 ===================="
|
|
164
152
|
echo "开始执行服务启动脚本(start_dev.sh)..."
|
|
@@ -92,7 +92,7 @@ const KeyboardAwareScrollable = ({
|
|
|
92
92
|
contentInsetBehaviorIOS,
|
|
93
93
|
}: KeyboardAwareProps) => {
|
|
94
94
|
// 获取原始组件的 props
|
|
95
|
-
const childAttrs
|
|
95
|
+
const childAttrs = ((element as React.ReactElement).props ?? {}) as Record<string, unknown>;
|
|
96
96
|
const originStyle = childAttrs['contentContainerStyle'];
|
|
97
97
|
const styleArray = Array.isArray(originStyle) ? originStyle : originStyle ? [originStyle] : [];
|
|
98
98
|
const merged = Object.assign({}, ...styleArray);
|
|
@@ -117,7 +117,7 @@ const KeyboardAwareScrollable = ({
|
|
|
117
117
|
: {}),
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
const t = (element as
|
|
120
|
+
const t = (element as React.ReactElement).type;
|
|
121
121
|
|
|
122
122
|
// 根据组件类型返回对应的 KeyboardAware 版本
|
|
123
123
|
// 注意:不再使用 KeyboardAvoidingView,直接替换为增强版 ScrollView
|
|
@@ -171,7 +171,7 @@ const RawScreen = ({
|
|
|
171
171
|
const props = element.props as Record<string, unknown> | undefined;
|
|
172
172
|
// 仅识别“垂直”滚动容器;横向滚动不视为页面已处理垂直滚动
|
|
173
173
|
// eslint-disable-next-line react/prop-types
|
|
174
|
-
const isHorizontal = !!(props &&
|
|
174
|
+
const isHorizontal = !!(props && props.horizontal === true);
|
|
175
175
|
if ((t === ScrollView || t === FlatList || t === SectionList) && !isHorizontal) return true;
|
|
176
176
|
const c: React.ReactNode | undefined = props && 'children' in props
|
|
177
177
|
? (props.children as React.ReactNode)
|
|
@@ -238,8 +238,8 @@ const RawScreen = ({
|
|
|
238
238
|
const wrapScrollableWithKeyboardAvoid = (nodes: React.ReactNode): React.ReactNode => {
|
|
239
239
|
const isVerticalScrollable = (el: React.ReactElement<any, any>): boolean => {
|
|
240
240
|
const t = el.type;
|
|
241
|
-
const elementProps = (el as
|
|
242
|
-
const isHorizontal = !!
|
|
241
|
+
const elementProps = ((el as React.ReactElement).props ?? {}) as Record<string, unknown>;
|
|
242
|
+
const isHorizontal = !!elementProps.horizontal;
|
|
243
243
|
return (t === ScrollView || t === FlatList || t === SectionList) && !isHorizontal;
|
|
244
244
|
};
|
|
245
245
|
|
package/lib/__templates__/expo/client/heroui/components/scroll-shadow/scroll-shadow.types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { ViewProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import type {
|
|
4
4
|
AnimationRoot,
|
|
5
5
|
AnimationValue,
|
|
@@ -32,11 +32,11 @@ export type ScrollShadowVisibility =
|
|
|
32
32
|
| 'none';
|
|
33
33
|
|
|
34
34
|
export interface LinearGradientProps {
|
|
35
|
-
colors:
|
|
36
|
-
locations?:
|
|
37
|
-
start?:
|
|
38
|
-
end?:
|
|
39
|
-
style?:
|
|
35
|
+
colors: readonly string[];
|
|
36
|
+
locations?: readonly number[];
|
|
37
|
+
start?: { x: number; y: number };
|
|
38
|
+
end?: { x: number; y: number };
|
|
39
|
+
style?: StyleProp<ViewStyle>;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export type LinearGradientComponent = ComponentType<LinearGradientProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef, useMemo } from 'react';
|
|
1
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { View, Text as RNText } from 'react-native';
|
|
3
3
|
import { GestureDetector } from 'react-native-gesture-handler';
|
|
4
4
|
import Animated from 'react-native-reanimated';
|
|
@@ -339,7 +339,7 @@ const ToastClose = forwardRef<View, ToastCloseProps>((props, ref) => {
|
|
|
339
339
|
* If hide and id are available from context, use them to hide the toast
|
|
340
340
|
* Otherwise, use the provided onPress handler
|
|
341
341
|
*/
|
|
342
|
-
const handlePress = (event:
|
|
342
|
+
const handlePress = (event: Parameters<NonNullable<React.ComponentProps<typeof Button>['onPress']>>[0]) => {
|
|
343
343
|
if (hide && id) {
|
|
344
344
|
hide(id);
|
|
345
345
|
}
|
|
@@ -3,8 +3,8 @@ import { useImperativeHandle, useRef } from 'react';
|
|
|
3
3
|
|
|
4
4
|
interface AugmentRefProps<T> {
|
|
5
5
|
ref: React.Ref<T>;
|
|
6
|
-
methods?: Record<string, (...args:
|
|
7
|
-
deps?:
|
|
6
|
+
methods?: Record<string, (...args: unknown[]) => unknown>;
|
|
7
|
+
deps?: unknown[];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function useAugmentedRef<T>({
|
package/lib/__templates__/expo/client/heroui/helpers/internal/hooks/use-controllable-state.ts
CHANGED
|
@@ -108,7 +108,7 @@ function useUncontrolledState<T>({
|
|
|
108
108
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
109
109
|
* prop or avoid re-executing effects when passed as a dependency
|
|
110
110
|
*/
|
|
111
|
-
function useCallbackRef<T extends (...args:
|
|
111
|
+
function useCallbackRef<T extends (...args: unknown[]) => unknown>(
|
|
112
112
|
callback: T | undefined
|
|
113
113
|
): T {
|
|
114
114
|
const callbackRef = useRef(callback);
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@react-native-picker/picker": "2.11.1",
|
|
25
25
|
"@react-navigation/bottom-tabs": "^7.2.0",
|
|
26
26
|
"@react-navigation/native": "^7.0.14",
|
|
27
|
-
"dayjs": "^1.11.
|
|
27
|
+
"dayjs": "^1.11.20",
|
|
28
28
|
"expo": "54.0.33",
|
|
29
29
|
"expo-auth-session": "~7.0.10",
|
|
30
30
|
"expo-av": "~16.0.8",
|
|
@@ -9,7 +9,7 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
|
9
9
|
<% } else { %>
|
|
10
10
|
PORT=<%= port %>
|
|
11
11
|
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
12
|
-
DEPLOY_RUN_PORT
|
|
12
|
+
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
13
13
|
<% } %>
|
|
14
14
|
|
|
15
15
|
cd "${COZE_WORKSPACE_PATH}"
|
|
@@ -32,8 +32,8 @@ kill_port_if_listening() {
|
|
|
32
32
|
fi
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
echo "Clearing port ${
|
|
35
|
+
echo "Clearing port ${DEPLOY_RUN_PORT} before start."
|
|
36
36
|
kill_port_if_listening
|
|
37
|
-
echo "Starting HTTP service on port ${
|
|
37
|
+
echo "Starting HTTP service on port ${DEPLOY_RUN_PORT} for dev..."
|
|
38
38
|
|
|
39
|
-
PORT=$
|
|
39
|
+
PORT=${DEPLOY_RUN_PORT} pnpm tsx watch src/server.ts
|
|
@@ -9,7 +9,7 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
|
9
9
|
<% } else { %>
|
|
10
10
|
PORT=<%= port %>
|
|
11
11
|
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
12
|
-
DEPLOY_RUN_PORT
|
|
12
|
+
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
13
13
|
<% } %>
|
|
14
14
|
|
|
15
15
|
cd "${COZE_WORKSPACE_PATH}"
|
|
@@ -32,8 +32,8 @@ kill_port_if_listening() {
|
|
|
32
32
|
fi
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
echo "Clearing port ${
|
|
35
|
+
echo "Clearing port ${DEPLOY_RUN_PORT} before start."
|
|
36
36
|
kill_port_if_listening
|
|
37
|
-
echo "Starting Nuxt dev server on port ${
|
|
37
|
+
echo "Starting Nuxt dev server on port ${DEPLOY_RUN_PORT}..."
|
|
38
38
|
|
|
39
|
-
PORT=$
|
|
39
|
+
PORT=${DEPLOY_RUN_PORT} pnpm nuxt dev
|
|
@@ -171,7 +171,7 @@ test("web-search: returns error content on search failure", async (t) => {
|
|
|
171
171
|
});
|
|
172
172
|
|
|
173
173
|
test("web-search: defaults count to 10 and type to web", async (t) => {
|
|
174
|
-
const captured:
|
|
174
|
+
const captured: Array<{ query: string; count: number; needSummary?: boolean }> = [];
|
|
175
175
|
t.mock.method(SearchClient.prototype, "webSearch", async (query: string, count: number, needSummary?: boolean) => {
|
|
176
176
|
captured.push({ query, count, needSummary });
|
|
177
177
|
return makeWebSearchResponse();
|
|
@@ -181,7 +181,7 @@ test("web-search: defaults count to 10 and type to web", async (t) => {
|
|
|
181
181
|
|
|
182
182
|
assert.equal(captured[0].query, "hello");
|
|
183
183
|
assert.equal(captured[0].count, 10);
|
|
184
|
-
assert.equal(
|
|
184
|
+
assert.equal(captured[0].needSummary, undefined);
|
|
185
185
|
});
|
|
186
186
|
|
|
187
187
|
test("web-search: details contain correct metadata", async (t) => {
|
|
@@ -46,11 +46,11 @@ const CollapsibleTrigger = React.forwardRef<
|
|
|
46
46
|
<View
|
|
47
47
|
ref={ref}
|
|
48
48
|
className={className}
|
|
49
|
-
onClick={(e
|
|
49
|
+
onClick={(e) => {
|
|
50
50
|
context?.onOpenChange(!context.open)
|
|
51
51
|
onClick?.(e)
|
|
52
52
|
}}
|
|
53
|
-
{...
|
|
53
|
+
{...props}
|
|
54
54
|
/>
|
|
55
55
|
)
|
|
56
56
|
})
|
|
@@ -83,8 +83,8 @@ const HoverCard = ({
|
|
|
83
83
|
const HoverCardTrigger = React.forwardRef<
|
|
84
84
|
React.ElementRef<typeof View>,
|
|
85
85
|
React.ComponentPropsWithoutRef<typeof View> & {
|
|
86
|
-
onMouseEnter?: (e:
|
|
87
|
-
onMouseLeave?: (e:
|
|
86
|
+
onMouseEnter?: (e: React.MouseEvent) => void
|
|
87
|
+
onMouseLeave?: (e: React.MouseEvent) => void
|
|
88
88
|
}
|
|
89
89
|
>(({ className, children, onClick, onMouseEnter, onMouseLeave, ...props }, ref) => {
|
|
90
90
|
const context = React.useContext(HoverCardContext)
|
|
@@ -101,15 +101,15 @@ const HoverCardTrigger = React.forwardRef<
|
|
|
101
101
|
}}
|
|
102
102
|
{...(isH5()
|
|
103
103
|
? ({
|
|
104
|
-
onMouseEnter: (e:
|
|
104
|
+
onMouseEnter: (e: React.MouseEvent) => {
|
|
105
105
|
onMouseEnter?.(e)
|
|
106
106
|
context?.setHoverPart?.("trigger", true)
|
|
107
107
|
},
|
|
108
|
-
onMouseLeave: (e:
|
|
108
|
+
onMouseLeave: (e: React.MouseEvent) => {
|
|
109
109
|
onMouseLeave?.(e)
|
|
110
110
|
context?.setHoverPart?.("trigger", false)
|
|
111
111
|
},
|
|
112
|
-
} as
|
|
112
|
+
} as React.ComponentPropsWithoutRef<typeof View>)
|
|
113
113
|
: {})}
|
|
114
114
|
>
|
|
115
115
|
{children}
|
|
@@ -124,8 +124,8 @@ const HoverCardContent = React.forwardRef<
|
|
|
124
124
|
align?: "start" | "center" | "end"
|
|
125
125
|
side?: "top" | "bottom" | "left" | "right"
|
|
126
126
|
sideOffset?: number
|
|
127
|
-
onMouseEnter?: (e:
|
|
128
|
-
onMouseLeave?: (e:
|
|
127
|
+
onMouseEnter?: (e: React.MouseEvent) => void
|
|
128
|
+
onMouseLeave?: (e: React.MouseEvent) => void
|
|
129
129
|
}
|
|
130
130
|
>(
|
|
131
131
|
(
|
|
@@ -262,15 +262,15 @@ const HoverCardContent = React.forwardRef<
|
|
|
262
262
|
style={contentStyle}
|
|
263
263
|
{...(isH5()
|
|
264
264
|
? ({
|
|
265
|
-
onMouseEnter: (e:
|
|
265
|
+
onMouseEnter: (e: React.MouseEvent) => {
|
|
266
266
|
onMouseEnter?.(e)
|
|
267
267
|
context?.setHoverPart?.("content", true)
|
|
268
268
|
},
|
|
269
|
-
onMouseLeave: (e:
|
|
269
|
+
onMouseLeave: (e: React.MouseEvent) => {
|
|
270
270
|
onMouseLeave?.(e)
|
|
271
271
|
context?.setHoverPart?.("content", false)
|
|
272
272
|
},
|
|
273
|
-
} as
|
|
273
|
+
} as React.ComponentPropsWithoutRef<typeof View>)
|
|
274
274
|
: {})}
|
|
275
275
|
/>
|
|
276
276
|
</Portal>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { View, Input } from "@tarojs/components"
|
|
2
|
+
import { View, Input, type BaseEventOrig } from "@tarojs/components"
|
|
3
|
+
import { type InputProps } from "@tarojs/components/types/Input"
|
|
3
4
|
import { Dot } from "lucide-react-taro"
|
|
4
5
|
import { cn } from "@/lib/utils"
|
|
5
6
|
|
|
@@ -27,7 +28,7 @@ const InputOTP = React.forwardRef<
|
|
|
27
28
|
const [isFocused, setIsFocused] = React.useState(false)
|
|
28
29
|
const value = valueProp !== undefined ? valueProp : valueState
|
|
29
30
|
|
|
30
|
-
const handleChange = (e:
|
|
31
|
+
const handleChange = (e: BaseEventOrig<InputProps.inputValueEventDetail>) => {
|
|
31
32
|
const newValue = e.detail.value
|
|
32
33
|
if (newValue.length <= maxLength) {
|
|
33
34
|
if (valueProp === undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { View } from "@tarojs/components"
|
|
3
|
-
import Taro from "@tarojs/taro"
|
|
3
|
+
import Taro, { type ITouchEvent } from "@tarojs/taro"
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
@@ -79,7 +79,7 @@ const Slider = React.forwardRef<
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const handleTouchStart = (e:
|
|
82
|
+
const handleTouchStart = (e: ITouchEvent) => {
|
|
83
83
|
if (disabled) return
|
|
84
84
|
setIsDragging(true)
|
|
85
85
|
// Try to update rect on touch start in case of layout changes
|
|
@@ -135,7 +135,7 @@ const Slider = React.forwardRef<
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
const handleTouchMove = (e:
|
|
138
|
+
const handleTouchMove = (e: ITouchEvent) => {
|
|
139
139
|
if (disabled) return
|
|
140
140
|
const touch = e.touches[0] || e.changedTouches[0]
|
|
141
141
|
if (touch) {
|
|
@@ -143,7 +143,7 @@ const Slider = React.forwardRef<
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
const handleTouchEnd = (e:
|
|
146
|
+
const handleTouchEnd = (e: ITouchEvent) => {
|
|
147
147
|
if (disabled) return
|
|
148
148
|
setIsDragging(false)
|
|
149
149
|
const touch = e.touches[0] || e.changedTouches[0]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { View } from "@tarojs/components"
|
|
3
|
+
import { type ITouchEvent } from "@tarojs/taro"
|
|
3
4
|
import { cn } from "@/lib/utils"
|
|
4
5
|
|
|
5
6
|
const TabsContext = React.createContext<{
|
|
@@ -62,7 +63,7 @@ const TabsTrigger = React.forwardRef<
|
|
|
62
63
|
const context = React.useContext(TabsContext)
|
|
63
64
|
const isActive = context?.value === value
|
|
64
65
|
|
|
65
|
-
const handleClick = (e:
|
|
66
|
+
const handleClick = (e: ITouchEvent) => {
|
|
66
67
|
if (disabled) return
|
|
67
68
|
context?.onValueChange?.(value)
|
|
68
69
|
onClick?.(e)
|
|
@@ -119,7 +119,7 @@ const toast = Object.assign(toastFn, {
|
|
|
119
119
|
data: {
|
|
120
120
|
loading?: string | React.ReactNode
|
|
121
121
|
success?: string | React.ReactNode | ((data: T) => React.ReactNode)
|
|
122
|
-
error?: string | React.ReactNode | ((error:
|
|
122
|
+
error?: string | React.ReactNode | ((error: unknown) => React.ReactNode)
|
|
123
123
|
finally?: () => void
|
|
124
124
|
} & ToastData
|
|
125
125
|
) => {
|
|
@@ -92,8 +92,8 @@ const Tooltip = ({
|
|
|
92
92
|
const TooltipTrigger = React.forwardRef<
|
|
93
93
|
React.ElementRef<typeof View>,
|
|
94
94
|
React.ComponentPropsWithoutRef<typeof View> & {
|
|
95
|
-
onMouseEnter?: (e:
|
|
96
|
-
onMouseLeave?: (e:
|
|
95
|
+
onMouseEnter?: (e: React.MouseEvent) => void
|
|
96
|
+
onMouseLeave?: (e: React.MouseEvent) => void
|
|
97
97
|
}
|
|
98
98
|
>(
|
|
99
99
|
(
|
|
@@ -113,15 +113,15 @@ const TooltipTrigger = React.forwardRef<
|
|
|
113
113
|
}}
|
|
114
114
|
{...(isH5()
|
|
115
115
|
? ({
|
|
116
|
-
onMouseEnter: (e:
|
|
116
|
+
onMouseEnter: (e: React.MouseEvent) => {
|
|
117
117
|
onMouseEnter?.(e)
|
|
118
118
|
context?.setHoverPart?.("trigger", true)
|
|
119
119
|
},
|
|
120
|
-
onMouseLeave: (e:
|
|
120
|
+
onMouseLeave: (e: React.MouseEvent) => {
|
|
121
121
|
onMouseLeave?.(e)
|
|
122
122
|
context?.setHoverPart?.("trigger", false)
|
|
123
123
|
},
|
|
124
|
-
} as
|
|
124
|
+
} as React.ComponentPropsWithoutRef<typeof View>)
|
|
125
125
|
: {})}
|
|
126
126
|
{...props}
|
|
127
127
|
>
|
|
@@ -142,8 +142,8 @@ const TooltipContent = React.forwardRef<
|
|
|
142
142
|
collisionPadding?: number
|
|
143
143
|
showArrow?: boolean
|
|
144
144
|
arrowSize?: number
|
|
145
|
-
onMouseEnter?: (e:
|
|
146
|
-
onMouseLeave?: (e:
|
|
145
|
+
onMouseEnter?: (e: React.MouseEvent) => void
|
|
146
|
+
onMouseLeave?: (e: React.MouseEvent) => void
|
|
147
147
|
}
|
|
148
148
|
>(
|
|
149
149
|
(
|
|
@@ -432,15 +432,15 @@ const TooltipContent = React.forwardRef<
|
|
|
432
432
|
style={contentStyle}
|
|
433
433
|
{...(isH5()
|
|
434
434
|
? ({
|
|
435
|
-
onMouseEnter: (e:
|
|
435
|
+
onMouseEnter: (e: React.MouseEvent) => {
|
|
436
436
|
onMouseEnter?.(e)
|
|
437
437
|
context?.setHoverPart?.("content", true)
|
|
438
438
|
},
|
|
439
|
-
onMouseLeave: (e:
|
|
439
|
+
onMouseLeave: (e: React.MouseEvent) => {
|
|
440
440
|
onMouseLeave?.(e)
|
|
441
441
|
context?.setHoverPart?.("content", false)
|
|
442
442
|
},
|
|
443
|
-
} as
|
|
443
|
+
} as React.ComponentPropsWithoutRef<typeof View>)
|
|
444
444
|
: {})}
|
|
445
445
|
{...props}
|
|
446
446
|
>
|
|
@@ -9,7 +9,7 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
|
9
9
|
<% } else { %>
|
|
10
10
|
PORT=<%= port %>
|
|
11
11
|
COZE_WORKSPACE_PATH="${COZE_WORKSPACE_PATH:-$(pwd)}"
|
|
12
|
-
DEPLOY_RUN_PORT
|
|
12
|
+
DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-${PORT}}"
|
|
13
13
|
<% } %>
|
|
14
14
|
|
|
15
15
|
cd "${COZE_WORKSPACE_PATH}"
|
|
@@ -32,8 +32,8 @@ kill_port_if_listening() {
|
|
|
32
32
|
fi
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
echo "Clearing port ${
|
|
35
|
+
echo "Clearing port ${DEPLOY_RUN_PORT} before start."
|
|
36
36
|
kill_port_if_listening
|
|
37
|
-
echo "Starting express + Vite dev server on port ${
|
|
37
|
+
echo "Starting express + Vite dev server on port ${DEPLOY_RUN_PORT}..."
|
|
38
38
|
|
|
39
|
-
PORT=$
|
|
39
|
+
PORT=${DEPLOY_RUN_PORT} pnpm tsx watch server/server.ts
|
|
@@ -39,8 +39,7 @@ async function startServer(): Promise<Server> {
|
|
|
39
39
|
// 全局错误处理
|
|
40
40
|
app.use((err: Error, req: express.Request, res: express.Response) => {
|
|
41
41
|
console.error('Server error:', err);
|
|
42
|
-
|
|
43
|
-
const status = 'status' in err ? (err as any).status || 500 : 500;
|
|
42
|
+
const status = 'status' in err ? (err as { status?: number }).status ?? 500 : 500;
|
|
44
43
|
res.status(status).json({
|
|
45
44
|
error: err.message || 'Internal server error',
|
|
46
45
|
});
|
package/lib/cli.js
CHANGED
|
@@ -2107,7 +2107,7 @@ const EventBuilder = {
|
|
|
2107
2107
|
};
|
|
2108
2108
|
|
|
2109
2109
|
var name = "@coze-arch/cli";
|
|
2110
|
-
var version = "0.0.
|
|
2110
|
+
var version = "0.0.21-alpha.df4fd6";
|
|
2111
2111
|
var description = "coze coding devtools cli";
|
|
2112
2112
|
var license = "MIT";
|
|
2113
2113
|
var author = "fanwenjie.fe@bytedance.com";
|
|
@@ -2130,6 +2130,8 @@ var scripts = {
|
|
|
2130
2130
|
prebuild: "tsx scripts/prebuild.ts",
|
|
2131
2131
|
build: "tsx scripts/build.ts",
|
|
2132
2132
|
create: "tsx scripts/create-template.ts",
|
|
2133
|
+
knip: "knip --include files",
|
|
2134
|
+
"knip:all": "knip",
|
|
2133
2135
|
lint: "eslint ./ --cache",
|
|
2134
2136
|
"pre-release": "tsx scripts/pre-release.ts",
|
|
2135
2137
|
postpublish: "bash scripts/sync-npmmirror.sh",
|
|
@@ -2159,32 +2161,34 @@ var devDependencies = {
|
|
|
2159
2161
|
"@coze-arch/cli-slardar": "workspace:*",
|
|
2160
2162
|
"@coze-arch/eslint-config": "workspace:*",
|
|
2161
2163
|
"@coze-arch/fs-enhance": "workspace:*",
|
|
2162
|
-
"@coze-arch/monorepo-kits": "workspace:*",
|
|
2163
2164
|
"@coze-arch/pack-audit": "workspace:*",
|
|
2164
2165
|
"@coze-arch/rollup-config": "workspace:*",
|
|
2165
2166
|
"@coze-arch/ts-config": "workspace:*",
|
|
2166
2167
|
"@coze-arch/vitest-config": "workspace:*",
|
|
2167
2168
|
"@coze-coding/lambda": "workspace:*",
|
|
2169
|
+
"@emnapi/runtime": "^1.7.1",
|
|
2168
2170
|
"@inquirer/prompts": "^3.2.0",
|
|
2169
2171
|
"@playwright/test": "~1.55.0",
|
|
2172
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
2173
|
+
"@rollup/plugin-json": "~6.0.0",
|
|
2174
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
2175
|
+
"@rollup/plugin-sucrase": "^5.0.2",
|
|
2170
2176
|
"@slardar/rd-cli": "^0.10.3",
|
|
2171
|
-
"@types/debug": "^4.1.
|
|
2177
|
+
"@types/debug": "^4.1.13",
|
|
2172
2178
|
"@types/ejs": "^3.1.5",
|
|
2173
2179
|
"@types/iarna__toml": "^2.0.5",
|
|
2174
2180
|
"@types/js-yaml": "^4.0.9",
|
|
2175
|
-
"@types/minimatch": "^5.1.2",
|
|
2176
2181
|
"@types/minimist": "^1.2.5",
|
|
2177
2182
|
"@types/node": "^24",
|
|
2178
2183
|
"@types/shelljs": "^0.10.0",
|
|
2179
2184
|
"@vitest/coverage-v8": "~4.0.18",
|
|
2180
|
-
|
|
2185
|
+
knip: "^5.30.1",
|
|
2181
2186
|
minimatch: "^10.0.1",
|
|
2182
2187
|
playwright: "~1.55.0",
|
|
2183
2188
|
rollup: "^4.60.1",
|
|
2184
2189
|
sucrase: "^3.35.0",
|
|
2185
2190
|
"tree-kill": "^1.2.2",
|
|
2186
2191
|
tsx: "^4.20.6",
|
|
2187
|
-
"vite-tsconfig-paths": "^4.2.1",
|
|
2188
2192
|
vitest: "~4.0.18"
|
|
2189
2193
|
};
|
|
2190
2194
|
var publishConfig = {
|
|
@@ -6217,7 +6221,7 @@ const isPackageJsonValid$3 = async (projectFolder) => {
|
|
|
6217
6221
|
return false;
|
|
6218
6222
|
}
|
|
6219
6223
|
if (typeof scripts.validate !== 'undefined') {
|
|
6220
|
-
logger.info('[patch-expo-validate] NOT APPLY: validate exists');
|
|
6224
|
+
logger.info('[patch-expo-validate] NOT APPLY: pnpm validate exists');
|
|
6221
6225
|
return false;
|
|
6222
6226
|
}
|
|
6223
6227
|
return true;
|
|
@@ -6391,7 +6395,7 @@ const isPackageJsonValid$2 = async (projectFolder) => {
|
|
|
6391
6395
|
return false;
|
|
6392
6396
|
}
|
|
6393
6397
|
if (typeof scripts.validate !== 'undefined') {
|
|
6394
|
-
logger.info('[patch-nextjs-validate] NOT APPLY: validate exists');
|
|
6398
|
+
logger.info('[patch-nextjs-validate] NOT APPLY: pnpm validate exists');
|
|
6395
6399
|
return false;
|
|
6396
6400
|
}
|
|
6397
6401
|
return true;
|
|
@@ -6572,7 +6576,7 @@ const isPackageJsonValid$1 = async (projectFolder) => {
|
|
|
6572
6576
|
return false;
|
|
6573
6577
|
}
|
|
6574
6578
|
if (typeof scripts.validate !== 'undefined') {
|
|
6575
|
-
logger.info('[patch-vite-validate] NOT APPLY: validate exists');
|
|
6579
|
+
logger.info('[patch-vite-validate] NOT APPLY: pnpm validate exists');
|
|
6576
6580
|
return false;
|
|
6577
6581
|
}
|
|
6578
6582
|
return true;
|
|
@@ -6755,7 +6759,7 @@ const isPackageJsonValid = async (projectFolder) => {
|
|
|
6755
6759
|
}
|
|
6756
6760
|
|
|
6757
6761
|
if (typeof scripts.validate !== 'undefined') {
|
|
6758
|
-
logger.info('[patch-taro-validate] NOT APPLY: validate exists');
|
|
6762
|
+
logger.info('[patch-taro-validate] NOT APPLY: pnpm validate exists');
|
|
6759
6763
|
return false;
|
|
6760
6764
|
}
|
|
6761
6765
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coze-arch/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21-alpha.df4fd6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "coze coding devtools cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"prebuild": "tsx scripts/prebuild.ts",
|
|
24
24
|
"build": "tsx scripts/build.ts",
|
|
25
25
|
"create": "tsx scripts/create-template.ts",
|
|
26
|
+
"knip": "knip --include files",
|
|
27
|
+
"knip:all": "knip",
|
|
26
28
|
"lint": "eslint ./ --cache",
|
|
27
29
|
"pre-release": "tsx scripts/pre-release.ts",
|
|
28
30
|
"postpublish": "bash scripts/sync-npmmirror.sh",
|
|
@@ -52,32 +54,34 @@
|
|
|
52
54
|
"@coze-arch/cli-slardar": "workspace:*",
|
|
53
55
|
"@coze-arch/eslint-config": "workspace:*",
|
|
54
56
|
"@coze-arch/fs-enhance": "workspace:*",
|
|
55
|
-
"@coze-arch/monorepo-kits": "workspace:*",
|
|
56
57
|
"@coze-arch/pack-audit": "workspace:*",
|
|
57
58
|
"@coze-arch/rollup-config": "workspace:*",
|
|
58
59
|
"@coze-arch/ts-config": "workspace:*",
|
|
59
60
|
"@coze-arch/vitest-config": "workspace:*",
|
|
60
61
|
"@coze-coding/lambda": "workspace:*",
|
|
62
|
+
"@emnapi/runtime": "^1.7.1",
|
|
61
63
|
"@inquirer/prompts": "^3.2.0",
|
|
62
64
|
"@playwright/test": "~1.55.0",
|
|
65
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
66
|
+
"@rollup/plugin-json": "~6.0.0",
|
|
67
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
68
|
+
"@rollup/plugin-sucrase": "^5.0.2",
|
|
63
69
|
"@slardar/rd-cli": "^0.10.3",
|
|
64
|
-
"@types/debug": "^4.1.
|
|
70
|
+
"@types/debug": "^4.1.13",
|
|
65
71
|
"@types/ejs": "^3.1.5",
|
|
66
72
|
"@types/iarna__toml": "^2.0.5",
|
|
67
73
|
"@types/js-yaml": "^4.0.9",
|
|
68
|
-
"@types/minimatch": "^5.1.2",
|
|
69
74
|
"@types/minimist": "^1.2.5",
|
|
70
75
|
"@types/node": "^24",
|
|
71
76
|
"@types/shelljs": "^0.10.0",
|
|
72
77
|
"@vitest/coverage-v8": "~4.0.18",
|
|
73
|
-
"
|
|
78
|
+
"knip": "^5.30.1",
|
|
74
79
|
"minimatch": "^10.0.1",
|
|
75
80
|
"playwright": "~1.55.0",
|
|
76
81
|
"rollup": "^4.60.1",
|
|
77
82
|
"sucrase": "^3.35.0",
|
|
78
83
|
"tree-kill": "^1.2.2",
|
|
79
84
|
"tsx": "^4.20.6",
|
|
80
|
-
"vite-tsconfig-paths": "^4.2.1",
|
|
81
85
|
"vitest": "~4.0.18"
|
|
82
86
|
},
|
|
83
87
|
"publishConfig": {
|