Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
667fc42a
Unverified
提交
667fc42a
authored
6月 03, 2025
作者:
Will Chen
提交者:
GitHub
6月 03, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Import e2e (#311)
上级
4997a8f2
全部展开
显示空白字符变更
内嵌
并排
正在显示
31 个修改的文件
包含
391 行增加
和
3 行删除
+391
-3
.gitignore
...ests/fixtures/import-app/minimal-with-ai-rules/.gitignore
+24
-0
AI_RULES.md
...sts/fixtures/import-app/minimal-with-ai-rules/AI_RULES.md
+1
-0
index.html
...ests/fixtures/import-app/minimal-with-ai-rules/index.html
+13
-0
package.json
...ts/fixtures/import-app/minimal-with-ai-rules/package.json
+25
-0
pnpm-lock.yaml
.../fixtures/import-app/minimal-with-ai-rules/pnpm-lock.yaml
+0
-0
App.tsx
...sts/fixtures/import-app/minimal-with-ai-rules/src/App.tsx
+3
-0
main.tsx
...ts/fixtures/import-app/minimal-with-ai-rules/src/main.tsx
+4
-0
vite-env.d.ts
...xtures/import-app/minimal-with-ai-rules/src/vite-env.d.ts
+1
-0
tsconfig.app.json
...xtures/import-app/minimal-with-ai-rules/tsconfig.app.json
+30
-0
tsconfig.json
...s/fixtures/import-app/minimal-with-ai-rules/tsconfig.json
+19
-0
tsconfig.node.json
...tures/import-app/minimal-with-ai-rules/tsconfig.node.json
+22
-0
vite.config.ts
.../fixtures/import-app/minimal-with-ai-rules/vite.config.ts
+16
-0
.gitignore
e2e-tests/fixtures/import-app/minimal/.gitignore
+24
-0
index.html
e2e-tests/fixtures/import-app/minimal/index.html
+13
-0
package.json
e2e-tests/fixtures/import-app/minimal/package.json
+25
-0
pnpm-lock.yaml
e2e-tests/fixtures/import-app/minimal/pnpm-lock.yaml
+0
-0
App.tsx
e2e-tests/fixtures/import-app/minimal/src/App.tsx
+3
-0
main.tsx
e2e-tests/fixtures/import-app/minimal/src/main.tsx
+4
-0
vite-env.d.ts
e2e-tests/fixtures/import-app/minimal/src/vite-env.d.ts
+1
-0
tsconfig.app.json
e2e-tests/fixtures/import-app/minimal/tsconfig.app.json
+30
-0
tsconfig.json
e2e-tests/fixtures/import-app/minimal/tsconfig.json
+19
-0
tsconfig.node.json
e2e-tests/fixtures/import-app/minimal/tsconfig.node.json
+22
-0
vite.config.ts
e2e-tests/fixtures/import-app/minimal/vite.config.ts
+16
-0
test_helper.ts
e2e-tests/helpers/test_helper.ts
+3
-2
import.spec.ts
e2e-tests/import.spec.ts
+45
-0
import.spec.ts_import-app-1.aria.yml
e2e-tests/snapshots/import.spec.ts_import-app-1.aria.yml
+2
-0
import.spec.ts_import-app-2.aria.yml
e2e-tests/snapshots/import.spec.ts_import-app-2.aria.yml
+17
-0
import.spec.ts_import-app-with-AI-rules-1.aria.yml
...pshots/import.spec.ts_import-app-with-AI-rules-1.aria.yml
+2
-0
import.spec.ts_import-app-with-AI-rules-2.aria.yml
...pshots/import.spec.ts_import-app-with-AI-rules-2.aria.yml
+5
-0
import.spec.ts_server-dump.txt
e2e-tests/snapshots/import.spec.ts_server-dump.txt
+0
-0
paths.ts
src/paths/paths.ts
+2
-1
没有找到文件。
e2e-tests/fixtures/import-app/minimal-with-ai-rules/.gitignore
0 → 100644
浏览文件 @
667fc42a
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
e2e-tests/fixtures/import-app/minimal-with-ai-rules/AI_RULES.md
0 → 100644
浏览文件 @
667fc42a
There's already AI rules...
e2e-tests/fixtures/import-app/minimal-with-ai-rules/index.html
0 → 100644
浏览文件 @
667fc42a
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
dyad-generated-app
</title>
</head>
<body>
<div
id=
"root"
></div>
<script
type=
"module"
src=
"/src/main.tsx"
></script>
</body>
</html>
e2e-tests/fixtures/import-app/minimal-with-ai-rules/package.json
0 → 100644
浏览文件 @
667fc42a
{
"name"
:
"vite_react_shadcn_ts"
,
"private"
:
true
,
"version"
:
"0.0.0"
,
"type"
:
"module"
,
"scripts"
:
{
"dev"
:
"vite"
,
"build"
:
"vite build"
,
"build:dev"
:
"vite build --mode development"
,
"lint"
:
"eslint ."
,
"preview"
:
"vite preview"
},
"dependencies"
:
{
"react"
:
"^18.3.1"
,
"react-dom"
:
"^18.3.1"
},
"devDependencies"
:
{
"@types/node"
:
"^22.5.5"
,
"@types/react"
:
"^18.3.3"
,
"@types/react-dom"
:
"^18.3.0"
,
"@vitejs/plugin-react-swc"
:
"^3.9.0"
,
"typescript"
:
"^5.5.3"
,
"vite"
:
"^6.3.4"
}
}
e2e-tests/fixtures/import-app/minimal-with-ai-rules/pnpm-lock.yaml
0 → 100644
浏览文件 @
667fc42a
差异被折叠。
点击展开。
e2e-tests/fixtures/import-app/minimal-with-ai-rules/src/App.tsx
0 → 100644
浏览文件 @
667fc42a
const
App
=
()
=>
<
div
>
Minimal imported app
</
div
>;
export
default
App
;
e2e-tests/fixtures/import-app/minimal-with-ai-rules/src/main.tsx
0 → 100644
浏览文件 @
667fc42a
import
{
createRoot
}
from
"react-dom/client"
;
import
App
from
"./App.tsx"
;
createRoot
(
document
.
getElementById
(
"root"
)
!
).
render
(<
App
/>);
e2e-tests/fixtures/import-app/minimal-with-ai-rules/src/vite-env.d.ts
0 → 100644
浏览文件 @
667fc42a
/// <reference types="vite/client" />
e2e-tests/fixtures/import-app/minimal-with-ai-rules/tsconfig.app.json
0 → 100644
浏览文件 @
667fc42a
{
"compilerOptions"
:
{
"target"
:
"ES2020"
,
"useDefineForClassFields"
:
true
,
"lib"
:
[
"ES2020"
,
"DOM"
,
"DOM.Iterable"
],
"module"
:
"ESNext"
,
"skipLibCheck"
:
true
,
/*
Bundler
mode
*/
"moduleResolution"
:
"bundler"
,
"allowImportingTsExtensions"
:
true
,
"isolatedModules"
:
true
,
"moduleDetection"
:
"force"
,
"noEmit"
:
true
,
"jsx"
:
"react-jsx"
,
/*
Linting
*/
"strict"
:
false
,
"noUnusedLocals"
:
false
,
"noUnusedParameters"
:
false
,
"noImplicitAny"
:
false
,
"noFallthroughCasesInSwitch"
:
false
,
"baseUrl"
:
"."
,
"paths"
:
{
"@/*"
:
[
"./src/*"
]
}
},
"include"
:
[
"src"
]
}
e2e-tests/fixtures/import-app/minimal-with-ai-rules/tsconfig.json
0 → 100644
浏览文件 @
667fc42a
{
"files"
:
[],
"references"
:
[
{
"path"
:
"./tsconfig.app.json"
},
{
"path"
:
"./tsconfig.node.json"
}
],
"compilerOptions"
:
{
"baseUrl"
:
"."
,
"paths"
:
{
"@/*"
:
[
"./src/*"
]
},
"noImplicitAny"
:
false
,
"noUnusedParameters"
:
false
,
"skipLibCheck"
:
true
,
"allowJs"
:
true
,
"noUnusedLocals"
:
false
,
"strictNullChecks"
:
false
}
}
e2e-tests/fixtures/import-app/minimal-with-ai-rules/tsconfig.node.json
0 → 100644
浏览文件 @
667fc42a
{
"compilerOptions"
:
{
"target"
:
"ES2022"
,
"lib"
:
[
"ES2023"
],
"module"
:
"ESNext"
,
"skipLibCheck"
:
true
,
/*
Bundler
mode
*/
"moduleResolution"
:
"bundler"
,
"allowImportingTsExtensions"
:
true
,
"isolatedModules"
:
true
,
"moduleDetection"
:
"force"
,
"noEmit"
:
true
,
/*
Linting
*/
"strict"
:
true
,
"noUnusedLocals"
:
false
,
"noUnusedParameters"
:
false
,
"noFallthroughCasesInSwitch"
:
true
},
"include"
:
[
"vite.config.ts"
]
}
e2e-tests/fixtures/import-app/minimal-with-ai-rules/vite.config.ts
0 → 100644
浏览文件 @
667fc42a
import
{
defineConfig
}
from
"vite"
;
import
react
from
"@vitejs/plugin-react-swc"
;
import
path
from
"path"
;
export
default
defineConfig
(()
=>
({
server
:
{
host
:
"::"
,
port
:
8080
,
},
plugins
:
[
react
()],
resolve
:
{
alias
:
{
"@"
:
path
.
resolve
(
__dirname
,
"./src"
),
},
},
}));
e2e-tests/fixtures/import-app/minimal/.gitignore
0 → 100644
浏览文件 @
667fc42a
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
e2e-tests/fixtures/import-app/minimal/index.html
0 → 100644
浏览文件 @
667fc42a
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
dyad-generated-app
</title>
</head>
<body>
<div
id=
"root"
></div>
<script
type=
"module"
src=
"/src/main.tsx"
></script>
</body>
</html>
e2e-tests/fixtures/import-app/minimal/package.json
0 → 100644
浏览文件 @
667fc42a
{
"name"
:
"vite_react_shadcn_ts"
,
"private"
:
true
,
"version"
:
"0.0.0"
,
"type"
:
"module"
,
"scripts"
:
{
"dev"
:
"vite"
,
"build"
:
"vite build"
,
"build:dev"
:
"vite build --mode development"
,
"lint"
:
"eslint ."
,
"preview"
:
"vite preview"
},
"dependencies"
:
{
"react"
:
"^18.3.1"
,
"react-dom"
:
"^18.3.1"
},
"devDependencies"
:
{
"@types/node"
:
"^22.5.5"
,
"@types/react"
:
"^18.3.3"
,
"@types/react-dom"
:
"^18.3.0"
,
"@vitejs/plugin-react-swc"
:
"^3.9.0"
,
"typescript"
:
"^5.5.3"
,
"vite"
:
"^6.3.4"
}
}
e2e-tests/fixtures/import-app/minimal/pnpm-lock.yaml
0 → 100644
浏览文件 @
667fc42a
差异被折叠。
点击展开。
e2e-tests/fixtures/import-app/minimal/src/App.tsx
0 → 100644
浏览文件 @
667fc42a
const
App
=
()
=>
<
div
>
Minimal imported app
</
div
>;
export
default
App
;
e2e-tests/fixtures/import-app/minimal/src/main.tsx
0 → 100644
浏览文件 @
667fc42a
import
{
createRoot
}
from
"react-dom/client"
;
import
App
from
"./App.tsx"
;
createRoot
(
document
.
getElementById
(
"root"
)
!
).
render
(<
App
/>);
e2e-tests/fixtures/import-app/minimal/src/vite-env.d.ts
0 → 100644
浏览文件 @
667fc42a
/// <reference types="vite/client" />
e2e-tests/fixtures/import-app/minimal/tsconfig.app.json
0 → 100644
浏览文件 @
667fc42a
{
"compilerOptions"
:
{
"target"
:
"ES2020"
,
"useDefineForClassFields"
:
true
,
"lib"
:
[
"ES2020"
,
"DOM"
,
"DOM.Iterable"
],
"module"
:
"ESNext"
,
"skipLibCheck"
:
true
,
/*
Bundler
mode
*/
"moduleResolution"
:
"bundler"
,
"allowImportingTsExtensions"
:
true
,
"isolatedModules"
:
true
,
"moduleDetection"
:
"force"
,
"noEmit"
:
true
,
"jsx"
:
"react-jsx"
,
/*
Linting
*/
"strict"
:
false
,
"noUnusedLocals"
:
false
,
"noUnusedParameters"
:
false
,
"noImplicitAny"
:
false
,
"noFallthroughCasesInSwitch"
:
false
,
"baseUrl"
:
"."
,
"paths"
:
{
"@/*"
:
[
"./src/*"
]
}
},
"include"
:
[
"src"
]
}
e2e-tests/fixtures/import-app/minimal/tsconfig.json
0 → 100644
浏览文件 @
667fc42a
{
"files"
:
[],
"references"
:
[
{
"path"
:
"./tsconfig.app.json"
},
{
"path"
:
"./tsconfig.node.json"
}
],
"compilerOptions"
:
{
"baseUrl"
:
"."
,
"paths"
:
{
"@/*"
:
[
"./src/*"
]
},
"noImplicitAny"
:
false
,
"noUnusedParameters"
:
false
,
"skipLibCheck"
:
true
,
"allowJs"
:
true
,
"noUnusedLocals"
:
false
,
"strictNullChecks"
:
false
}
}
e2e-tests/fixtures/import-app/minimal/tsconfig.node.json
0 → 100644
浏览文件 @
667fc42a
{
"compilerOptions"
:
{
"target"
:
"ES2022"
,
"lib"
:
[
"ES2023"
],
"module"
:
"ESNext"
,
"skipLibCheck"
:
true
,
/*
Bundler
mode
*/
"moduleResolution"
:
"bundler"
,
"allowImportingTsExtensions"
:
true
,
"isolatedModules"
:
true
,
"moduleDetection"
:
"force"
,
"noEmit"
:
true
,
/*
Linting
*/
"strict"
:
true
,
"noUnusedLocals"
:
false
,
"noUnusedParameters"
:
false
,
"noFallthroughCasesInSwitch"
:
true
},
"include"
:
[
"vite.config.ts"
]
}
e2e-tests/fixtures/import-app/minimal/vite.config.ts
0 → 100644
浏览文件 @
667fc42a
import
{
defineConfig
}
from
"vite"
;
import
react
from
"@vitejs/plugin-react-swc"
;
import
path
from
"path"
;
export
default
defineConfig
(()
=>
({
server
:
{
host
:
"::"
,
port
:
8080
,
},
plugins
:
[
react
()],
resolve
:
{
alias
:
{
"@"
:
path
.
resolve
(
__dirname
,
"./src"
),
},
},
}));
e2e-tests/helpers/test_helper.ts
浏览文件 @
667fc42a
...
@@ -10,6 +10,7 @@ class PageObject {
...
@@ -10,6 +10,7 @@ class PageObject {
private
userDataDir
:
string
;
private
userDataDir
:
string
;
constructor
(
constructor
(
public
electronApp
:
ElectronApplication
,
public
page
:
Page
,
public
page
:
Page
,
{
userDataDir
}:
{
userDataDir
:
string
},
{
userDataDir
}:
{
userDataDir
:
string
},
)
{
)
{
...
@@ -243,7 +244,7 @@ class PageObject {
...
@@ -243,7 +244,7 @@ class PageObject {
if
(
!
currentAppName
)
{
if
(
!
currentAppName
)
{
throw
new
Error
(
"No current app name found"
);
throw
new
Error
(
"No current app name found"
);
}
}
return
path
.
join
(
"/tmp"
,
"dyad-apps-test
"
,
currentAppName
);
return
path
.
join
(
this
.
userDataDir
,
"dyad-apps
"
,
currentAppName
);
}
}
////////////////////////////////
////////////////////////////////
...
@@ -358,7 +359,7 @@ export const test = base.extend<{
...
@@ -358,7 +359,7 @@ export const test = base.extend<{
async
({
electronApp
},
use
)
=>
{
async
({
electronApp
},
use
)
=>
{
const
page
=
await
electronApp
.
firstWindow
();
const
page
=
await
electronApp
.
firstWindow
();
const
po
=
new
PageObject
(
page
,
{
const
po
=
new
PageObject
(
electronApp
,
page
,
{
userDataDir
:
(
electronApp
as
any
).
$dyadUserDataDir
,
userDataDir
:
(
electronApp
as
any
).
$dyadUserDataDir
,
});
});
await
use
(
po
);
await
use
(
po
);
...
...
e2e-tests/import.spec.ts
0 → 100644
浏览文件 @
667fc42a
import
path
from
"path"
;
import
{
test
}
from
"./helpers/test_helper"
;
import
*
as
eph
from
"electron-playwright-helpers"
;
test
(
"import app"
,
async
({
po
})
=>
{
await
po
.
setUp
();
await
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Import App"
}).
click
();
await
eph
.
stubDialog
(
po
.
electronApp
,
"showOpenDialog"
,
{
filePaths
:
[
path
.
join
(
__dirname
,
"fixtures"
,
"import-app"
,
"minimal"
)],
});
await
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Select Folder"
}).
click
();
await
po
.
page
.
getByRole
(
"textbox"
,
{
name
:
"Enter new app name"
}).
click
();
await
po
.
page
.
getByRole
(
"textbox"
,
{
name
:
"Enter new app name"
})
.
fill
(
"minimal-imported-app"
);
await
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Import"
}).
click
();
await
po
.
snapshotPreview
();
await
po
.
snapshotMessages
();
});
test
(
"import app with AI rules"
,
async
({
po
})
=>
{
await
po
.
setUp
();
await
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Import App"
}).
click
();
await
eph
.
stubDialog
(
po
.
electronApp
,
"showOpenDialog"
,
{
filePaths
:
[
path
.
join
(
__dirname
,
"fixtures"
,
"import-app"
,
"minimal-with-ai-rules"
),
],
});
await
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Select Folder"
}).
click
();
await
po
.
page
.
getByRole
(
"textbox"
,
{
name
:
"Enter new app name"
}).
click
();
await
po
.
page
.
getByRole
(
"textbox"
,
{
name
:
"Enter new app name"
})
.
fill
(
"minimal-imported-app"
);
await
po
.
page
.
getByRole
(
"button"
,
{
name
:
"Import"
}).
click
();
await
po
.
snapshotPreview
();
await
po
.
sendPrompt
(
"[dump]"
);
await
po
.
snapshotServerDump
();
await
po
.
snapshotMessages
({
replaceDumpPath
:
true
});
});
e2e-tests/snapshots/import.spec.ts_import-app-1.aria.yml
0 → 100644
浏览文件 @
667fc42a
-
text
:
Minimal imported app
\ No newline at end of file
e2e-tests/snapshots/import.spec.ts_import-app-2.aria.yml
0 → 100644
浏览文件 @
667fc42a
-
paragraph
:
/Generate an AI_RULES\.md file for this app\. Describe the tech stack in 5-\d+ bullet points and describe clear rules about what libraries to use for what\./
-
'
button
"Thinking
`<dyad-write>`:
I'
'
ll
think
about
the
problem
and
write
a
bug
report.
<dyad-write>
<dyad-write
path=\"file1.txt\">
Fake
dyad
write
</dyad-write>"'
:
-
img
-
img
-
paragraph
:
-
code
:
"
`<dyad-write>`"
-
text
:
"
:
I'll
think
about
the
problem
and
write
a
bug
report."
-
paragraph
:
<dyad-write>
-
paragraph
:
<dyad-write path="file1.txt"> Fake dyad write </dyad-write>
-
img
-
text
:
file1.txt
-
img
-
text
:
file1.txt
-
paragraph
:
More EOM
-
button "Retry"
:
-
img
\ No newline at end of file
e2e-tests/snapshots/import.spec.ts_import-app-with-AI-rules-1.aria.yml
0 → 100644
浏览文件 @
667fc42a
-
text
:
Minimal imported app
\ No newline at end of file
e2e-tests/snapshots/import.spec.ts_import-app-with-AI-rules-2.aria.yml
0 → 100644
浏览文件 @
667fc42a
-
paragraph
:
"
[dump]"
-
paragraph
:
"
[[dyad-dump-path=*]]"
-
button "Retry"
:
-
img
\ No newline at end of file
e2e-tests/snapshots/import.spec.ts_server-dump.txt
0 → 100644
浏览文件 @
667fc42a
差异被折叠。
点击展开。
src/paths/paths.ts
浏览文件 @
667fc42a
...
@@ -3,7 +3,8 @@ import os from "node:os";
...
@@ -3,7 +3,8 @@ import os from "node:os";
export
function
getDyadAppPath
(
appPath
:
string
):
string
{
export
function
getDyadAppPath
(
appPath
:
string
):
string
{
if
(
process
.
env
.
E2E_TEST_BUILD
)
{
if
(
process
.
env
.
E2E_TEST_BUILD
)
{
return
path
.
join
(
"/tmp"
,
"dyad-apps-test"
,
appPath
);
const
electron
=
getElectron
();
return
path
.
join
(
electron
!
.
app
.
getPath
(
"userData"
),
"dyad-apps"
,
appPath
);
}
}
return
path
.
join
(
os
.
homedir
(),
"dyad-apps"
,
appPath
);
return
path
.
join
(
os
.
homedir
(),
"dyad-apps"
,
appPath
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论