diff --git a/tests/rsbuild/examples.ts b/tests/rsbuild/examples.ts index 0153595f..f543b239 100644 --- a/tests/rsbuild/examples.ts +++ b/tests/rsbuild/examples.ts @@ -6,6 +6,10 @@ export async function test(options: RunOptions) { ...options, repo: 'rstackjs/rstack-examples', branch: 'main', + skipPackageOverrides: [ + // TODO: Remove after @rsbuild/plugin-solid v2 has a stable release. + '@rsbuild/plugin-solid', + ], test: ['build:rsbuild'], }); } diff --git a/tests/shared/rslib.ts b/tests/shared/rslib.ts index 9c7e007c..b303adab 100644 --- a/tests/shared/rslib.ts +++ b/tests/shared/rslib.ts @@ -6,6 +6,9 @@ export async function test(options: RunOptions) { ...options, repo: 'web-infra-dev/rslib', branch: process.env.RSLIB ?? 'main', + // TODO: Remove after @rsbuild/plugin-solid v2 has a stable release. + skipPackageOverrides: + options.stack === 'rsbuild' ? ['@rsbuild/plugin-solid'] : undefined, build: 'node --run build', // ignore snapshot changes test: ['testu', 'test:e2e'], diff --git a/types.d.ts b/types.d.ts index 02887f00..c329085a 100644 --- a/types.d.ts +++ b/types.d.ts @@ -88,6 +88,8 @@ export interface RepoOptions { commit?: string; shallow?: boolean; overrides?: Overrides; + /** Package names excluded from automatically generated stack overrides. */ + skipPackageOverrides?: string[]; } export interface Overrides { diff --git a/utils.ts b/utils.ts index e57dabb8..eecf6776 100644 --- a/utils.ts +++ b/utils.ts @@ -452,6 +452,7 @@ export async function runInRepo(options: RunOptions & RepoOptions) { await testCommand?.(pkg.scripts); } const overrides: Overrides = { ...(options.overrides || {}) }; + const skippedPackageOverrides = new Set(options.skipPackageOverrides); if ( activeStack === 'rsbuild' || @@ -463,6 +464,9 @@ export async function runInRepo(options: RunOptions & RepoOptions) { const packages = await getMonorepoPackages(activeStack); if (options.release) { for (const pkgInfo of packages) { + if (skippedPackageOverrides.has(pkgInfo.name)) { + continue; + } if ( overrides[pkgInfo.name] && overrides[pkgInfo.name] !== options.release @@ -475,6 +479,9 @@ export async function runInRepo(options: RunOptions & RepoOptions) { } } else { for (const pkgInfo of packages) { + if (skippedPackageOverrides.has(pkgInfo.name)) { + continue; + } overrides[pkgInfo.name] ||= pkgInfo.directory; } } @@ -503,6 +510,9 @@ export async function runInRepo(options: RunOptions & RepoOptions) { ]; if (options.release) { for (const pkgInfo of packageList) { + if (skippedPackageOverrides.has(pkgInfo.name)) { + continue; + } if ( overrides[pkgInfo.name] && overrides[pkgInfo.name] !== options.release @@ -516,6 +526,9 @@ export async function runInRepo(options: RunOptions & RepoOptions) { } else { await patchBindingPackageJson(binding); for (const pkgInfo of packageList) { + if (skippedPackageOverrides.has(pkgInfo.name)) { + continue; + } overrides[pkgInfo.name] ||= pkgInfo.directory; } }