Skip to content

Commit b28f834

Browse files
authored
fix: use v2 branch to run mondern.js cases (#127)
1 parent 2beb95f commit b28f834

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

cases/modernjs-framework/app-ssg/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"dependencies": {
1313
"@modern-js/runtime": "workspace:*",
1414
"@modern-js/plugin-ssg": "workspace:*",
15-
"react": "^19",
16-
"react-dom": "^19"
15+
"react": "^18",
16+
"react-dom": "^18"
1717
},
1818
"devDependencies": {
1919
"@modern-js/app-tools": "workspace:*",
@@ -23,8 +23,8 @@
2323
"prettier": "^2.6.2",
2424
"husky": "4.3.8",
2525
"typescript": "^5",
26-
"@types/react": "^19",
27-
"@types/react-dom": "^19",
26+
"@types/react": "^18",
27+
"@types/react-dom": "^18",
2828
"@types/node": "^14"
2929
}
3030
}

scripts/src/shared/git.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function cloneRepo(productName: string, caseName: string) {
2626

2727
const options = ['clone'];
2828

29-
if (!COMMIT_ID && !PR_NUMBER) {
29+
if (!COMMIT_ID && !PR_NUMBER && repoName !== 'modern.js') {
3030
options.push('--single-branch');
3131
options.push('--depth', '1');
3232
}
@@ -37,6 +37,19 @@ export async function cloneRepo(productName: string, caseName: string) {
3737
stdout: 'inherit',
3838
});
3939

40+
if (repoName === 'modern.js') {
41+
await execa('git', ['fetch', 'origin', 'v2'], {
42+
cwd: localRepoPath,
43+
stderr: 'inherit',
44+
stdout: 'inherit',
45+
});
46+
await execa('git', ['checkout', 'v2'], {
47+
cwd: localRepoPath,
48+
stderr: 'inherit',
49+
stdout: 'inherit',
50+
});
51+
}
52+
4053
if (COMMIT_ID) {
4154
await execa('git', ['checkout', COMMIT_ID], {
4255
cwd: localRepoPath,

0 commit comments

Comments
 (0)