Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
0f4e5322
Unverified
提交
0f4e5322
authored
6月 04, 2025
作者:
Will Chen
提交者:
GitHub
6月 04, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean package.json & rebaseline snapshots (#328)
上级
e060f780
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
53 行增加
和
23 行删除
+53
-23
context_window.spec.ts_context-window-1.txt
...sts/snapshots/context_window.spec.ts_context-window-1.txt
+5
-5
context_window.spec.ts_context-window-2.txt
...sts/snapshots/context_window.spec.ts_context-window-2.txt
+5
-5
context_window.spec.ts_context-window-3.txt
...sts/snapshots/context_window.spec.ts_context-window-3.txt
+5
-5
context_window.spec.ts_context-window-5.txt
...sts/snapshots/context_window.spec.ts_context-window-5.txt
+5
-5
engine.spec.ts_auto-should-send-message-to-gateway-1.txt
.../engine.spec.ts_auto-should-send-message-to-gateway-1.txt
+0
-0
engine.spec.ts_send-message-to-engine-1.txt
...sts/snapshots/engine.spec.ts_send-message-to-engine-1.txt
+1
-1
engine.spec.ts_send-message-to-gateway-1.txt
...ts/snapshots/engine.spec.ts_send-message-to-gateway-1.txt
+0
-0
codebase.ts
src/utils/codebase.ts
+32
-2
没有找到文件。
e2e-tests/snapshots/context_window.spec.ts_context-window-1.txt
浏览文件 @
0f4e5322
...
...
@@ -418,11 +418,6 @@ Available packages and libraries:
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="eslint.config.js">
// Contents omitted for brevity
</dyad-file>
...
...
@@ -454,6 +449,11 @@ export default {
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="src/App.css">
#root {
max-width: 1280px;
...
...
e2e-tests/snapshots/context_window.spec.ts_context-window-2.txt
浏览文件 @
0f4e5322
...
...
@@ -418,11 +418,6 @@ Available packages and libraries:
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="eslint.config.js">
// Contents omitted for brevity
</dyad-file>
...
...
@@ -454,6 +449,11 @@ export default {
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="src/App.css">
#root {
max-width: 1280px;
...
...
e2e-tests/snapshots/context_window.spec.ts_context-window-3.txt
浏览文件 @
0f4e5322
...
...
@@ -418,11 +418,6 @@ Available packages and libraries:
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="eslint.config.js">
// Contents omitted for brevity
</dyad-file>
...
...
@@ -454,6 +449,11 @@ export default {
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="src/App.css">
#root {
max-width: 1280px;
...
...
e2e-tests/snapshots/context_window.spec.ts_context-window-5.txt
浏览文件 @
0f4e5322
...
...
@@ -418,11 +418,6 @@ Available packages and libraries:
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="eslint.config.js">
// Contents omitted for brevity
</dyad-file>
...
...
@@ -454,6 +449,11 @@ export default {
</dyad-file>
<dyad-file path="README.md">
# Welcome to your Dyad app
</dyad-file>
<dyad-file path="src/App.css">
#root {
max-width: 1280px;
...
...
e2e-tests/snapshots/engine.spec.ts_auto-should-send-message-to-gateway-1.txt
浏览文件 @
0f4e5322
差异被折叠。
点击展开。
e2e-tests/snapshots/engine.spec.ts_send-message-to-engine-1.txt
浏览文件 @
0f4e5322
...
...
@@ -30,7 +30,7 @@
},
{
"path": "package.json",
"content": "{\n \"
name\": \"vite_react_shadcn_ts\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"build:dev\": \"vite build --mode development\",\n \"lint\": \"eslint .\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@hookform/resolvers\": \"^3.9.0\",\n \"@radix-ui/react-accordion\": \"^1.2.0\",\n \"@radix-ui/react-alert-dialog\": \"^1.1.1\",\n \"@radix-ui/react-aspect-ratio\": \"^1.1.0\",\n \"@radix-ui/react-avatar\": \"^1.1.0\",\n \"@radix-ui/react-checkbox\": \"^1.1.1\",\n \"@radix-ui/react-collapsible\": \"^1.1.0\",\n \"@radix-ui/react-context-menu\": \"^2.2.1\",\n \"@radix-ui/react-dialog\": \"^1.1.2\",\n \"@radix-ui/react-dropdown-menu\": \"^2.1.1\",\n \"@radix-ui/react-hover-card\": \"^1.1.1\",\n \"@radix-ui/react-label\": \"^2.1.0\",\n \"@radix-ui/react-menubar\": \"^1.1.1\",\n \"@radix-ui/react-navigation-menu\": \"^1.2.0\",\n \"@radix-ui/react-popover\": \"^1.1.1\",\n \"@radix-ui/react-progress\": \"^1.1.0\",\n \"@radix-ui/react-radio-group\": \"^1.2.0\",\n \"@radix-ui/react-scroll-area\": \"^1.1.0\",\n \"@radix-ui/react-select\": \"^2.1.1\",\n \"@radix-ui/react-separator\": \"^1.1.0\",\n \"@radix-ui/react-slider\": \"^1.2.0\",\n \"@radix-ui/react-slot\": \"^1.1.0\",\n \"@radix-ui/react-switch\": \"^1.1.0\",\n \"@radix-ui/react-tabs\": \"^1.1.0\",\n \"@radix-ui/react-toast\": \"^1.2.1\",\n \"@radix-ui/react-toggle\": \"^1.1.0\",\n \"@radix-ui/react-toggle-group\": \"^1.1.0\",\n \"@radix-ui/react-tooltip\": \"^1.1.4\",\n \"@tanstack/react-query\": \"^5.56.2\",\n \"class-variance-authority\": \"^0.7.1\",\n \"clsx\": \"^2.1.1\",\n \"cmdk\": \"^1.0.0\",\n \"date-fns\": \"^3.6.0\",\n \"embla-carousel-react\": \"^8.3.0\",\n \"input-otp\": \"^1.2.4\",\n \"lucide-react\": \"^0.462.0\",\n \"next-themes\": \"^0.3.0\",\n \"react\": \"^18.3.1\",\n \"react-day-picker\": \"^8.10.1\",\n \"react-dom\": \"^18.3.1\",\n \"react-hook-form\": \"^7.53.0\",\n \"react-resizable-panels\": \"^2.1.3\",\n \"react-router-dom\": \"^6.26.2\",\n \"recharts\": \"^2.12.7\",\n \"sonner\": \"^1.5.0\",\n \"tailwind-merge\": \"^2.5.2\",\n \"tailwindcss-animate\": \"^1.0.7\",\n \"vaul\": \"^0.9.3\",\n \"zod\": \"^3.23.8\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.9.0\",\n \"@tailwindcss/typography\": \"^0.5.15\",\n \"@types/node\": \"^22.5.5\",\n \"@types/react\": \"^18.3.3\",\n \"@types/react-dom\": \"^18.3.0\",\n \"@vitejs/plugin-react-swc\": \"^3.9.0\",\n \"autoprefixer\": \"^10.4.20\",\n \"eslint\": \"^9.9.0\",\n \"eslint-plugin-react-hooks\": \"^5.1.0-rc.0\",\n \"eslint-plugin-react-refresh\": \"^0.4.9\",\n \"globals\": \"^15.9.0\",\n \"postcss\": \"^8.4.47\",\n \"tailwindcss\": \"^3.4.11\",\n \"typescript\": \"^5.5.3\",\n \"typescript-eslint\": \"^8.0.1\",\n \"vite\": \"^6.3.4\"\n }\n}\n
"
"content": "{\n \"
dependencies\": {\n \"@hookform/resolvers\": \"^3.9.0\",\n \"@radix-ui/react-accordion\": \"^1.2.0\",\n \"@radix-ui/react-alert-dialog\": \"^1.1.1\",\n \"@radix-ui/react-aspect-ratio\": \"^1.1.0\",\n \"@radix-ui/react-avatar\": \"^1.1.0\",\n \"@radix-ui/react-checkbox\": \"^1.1.1\",\n \"@radix-ui/react-collapsible\": \"^1.1.0\",\n \"@radix-ui/react-context-menu\": \"^2.2.1\",\n \"@radix-ui/react-dialog\": \"^1.1.2\",\n \"@radix-ui/react-dropdown-menu\": \"^2.1.1\",\n \"@radix-ui/react-hover-card\": \"^1.1.1\",\n \"@radix-ui/react-label\": \"^2.1.0\",\n \"@radix-ui/react-menubar\": \"^1.1.1\",\n \"@radix-ui/react-navigation-menu\": \"^1.2.0\",\n \"@radix-ui/react-popover\": \"^1.1.1\",\n \"@radix-ui/react-progress\": \"^1.1.0\",\n \"@radix-ui/react-radio-group\": \"^1.2.0\",\n \"@radix-ui/react-scroll-area\": \"^1.1.0\",\n \"@radix-ui/react-select\": \"^2.1.1\",\n \"@radix-ui/react-separator\": \"^1.1.0\",\n \"@radix-ui/react-slider\": \"^1.2.0\",\n \"@radix-ui/react-slot\": \"^1.1.0\",\n \"@radix-ui/react-switch\": \"^1.1.0\",\n \"@radix-ui/react-tabs\": \"^1.1.0\",\n \"@radix-ui/react-toast\": \"^1.2.1\",\n \"@radix-ui/react-toggle\": \"^1.1.0\",\n \"@radix-ui/react-toggle-group\": \"^1.1.0\",\n \"@radix-ui/react-tooltip\": \"^1.1.4\",\n \"@tanstack/react-query\": \"^5.56.2\",\n \"class-variance-authority\": \"^0.7.1\",\n \"clsx\": \"^2.1.1\",\n \"cmdk\": \"^1.0.0\",\n \"date-fns\": \"^3.6.0\",\n \"embla-carousel-react\": \"^8.3.0\",\n \"input-otp\": \"^1.2.4\",\n \"lucide-react\": \"^0.462.0\",\n \"next-themes\": \"^0.3.0\",\n \"react\": \"^18.3.1\",\n \"react-day-picker\": \"^8.10.1\",\n \"react-dom\": \"^18.3.1\",\n \"react-hook-form\": \"^7.53.0\",\n \"react-resizable-panels\": \"^2.1.3\",\n \"react-router-dom\": \"^6.26.2\",\n \"recharts\": \"^2.12.7\",\n \"sonner\": \"^1.5.0\",\n \"tailwind-merge\": \"^2.5.2\",\n \"tailwindcss-animate\": \"^1.0.7\",\n \"vaul\": \"^0.9.3\",\n \"zod\": \"^3.23.8\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.9.0\",\n \"@tailwindcss/typography\": \"^0.5.15\",\n \"@types/node\": \"^22.5.5\",\n \"@types/react\": \"^18.3.3\",\n \"@types/react-dom\": \"^18.3.0\",\n \"@vitejs/plugin-react-swc\": \"^3.9.0\",\n \"autoprefixer\": \"^10.4.20\",\n \"eslint\": \"^9.9.0\",\n \"eslint-plugin-react-hooks\": \"^5.1.0-rc.0\",\n \"eslint-plugin-react-refresh\": \"^0.4.9\",\n \"globals\": \"^15.9.0\",\n \"postcss\": \"^8.4.47\",\n \"tailwindcss\": \"^3.4.11\",\n \"typescript\": \"^5.5.3\",\n \"typescript-eslint\": \"^8.0.1\",\n \"vite\": \"^6.3.4\"\n }\n}
"
},
{
"path": "postcss.config.js",
...
...
e2e-tests/snapshots/engine.spec.ts_send-message-to-gateway-1.txt
浏览文件 @
0f4e5322
差异被折叠。
点击展开。
src/utils/codebase.ts
浏览文件 @
0f4e5322
...
...
@@ -135,8 +135,12 @@ async function readFileWithCache(filePath: string): Promise<string | null> {
}
// Read file and update cache
const
content
=
await
fsAsync
.
readFile
(
filePath
,
"utf-8"
);
fileContentCache
.
set
(
filePath
,
{
content
,
mtime
:
currentMtime
});
const
rawContent
=
await
fsAsync
.
readFile
(
filePath
,
"utf-8"
);
const
content
=
cleanContent
({
content
:
rawContent
,
filePath
});
fileContentCache
.
set
(
filePath
,
{
content
,
mtime
:
currentMtime
,
});
// Manage cache size by clearing oldest entries when it gets too large
if
(
fileContentCache
.
size
>
MAX_FILE_CACHE_SIZE
)
{
...
...
@@ -157,6 +161,32 @@ async function readFileWithCache(filePath: string): Promise<string | null> {
}
}
function
cleanContent
({
content
,
filePath
,
}:
{
content
:
string
;
filePath
:
string
;
}):
string
{
// Why are we cleaning package.json?
// 1. It contains unnecessary information for LLM context
// 2. Fields like packageManager cause diffs in e2e test snapshots.
if
(
path
.
basename
(
filePath
)
===
"package.json"
)
{
try
{
const
{
dependencies
,
devDependencies
}
=
JSON
.
parse
(
content
);
const
cleanPackageJson
=
{
dependencies
,
devDependencies
,
};
return
JSON
.
stringify
(
cleanPackageJson
,
null
,
2
);
}
catch
(
error
)
{
logger
.
error
(
`Error cleaning package.json:
${
filePath
}
`
,
error
);
return
content
;
}
}
return
content
;
}
/**
* Recursively walk a directory and collect all relevant files
*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论