Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/rsbuild/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
});
}
3 changes: 3 additions & 0 deletions tests/shared/rslib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 2 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 13 additions & 0 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' ||
Expand All @@ -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
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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
Expand All @@ -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;
}
}
Expand Down
Loading