From b1552fc26e2c31d87811536a6dea95a44230db43 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 13 Jul 2026 12:32:05 +0800 Subject: [PATCH 1/2] chore: reuse shared test utilities --- package.json | 1 + pnpm-lock.yaml | 8 ++++++++ pnpm-workspace.yaml | 2 ++ tests/prebundle.test.ts | 14 ++++---------- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 023138d..e35c42e 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@astrojs/sitemap": "^3.7.3", "@rslib/core": "0.23.1", "@rslint/core": "^0.6.4", + "@rstackjs/test-utils": "^0.2.0", "@rstest/core": "^0.10.6", "@types/fs-extra": "^11.0.4", "@types/node": "24.13.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d1b5e8..62908b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ importers: '@rslint/core': specifier: ^0.6.4 version: 0.6.4 + '@rstackjs/test-utils': + specifier: ^0.2.0 + version: 0.2.0 '@rstest/core': specifier: ^0.10.6 version: 0.10.6 @@ -574,6 +577,9 @@ packages: '@swc/helpers': optional: true + '@rstackjs/test-utils@0.2.0': + resolution: {integrity: sha512-P+LOo1WE3xYeGkHmEthyq2cIpN69k4LhiB/4UBSceD+nW9hDlhWv8MC0LTLWokZXccWl4ntcfOBjQFllkcBlPA==} + '@rstest/core@0.10.6': resolution: {integrity: sha512-nX61dw2Tnxfwy/jGZEuNbh2tzapgaH6Iwj4Aw5d2wxUwxptUL3ddUxFF5M1ZSWoLEVG30VaPg3ITzrSo5sdbTg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1206,6 +1212,8 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.23 + '@rstackjs/test-utils@0.2.0': {} + '@rstest/core@0.10.6': dependencies: '@rsbuild/core': 2.0.15 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 10ed64a..4ba1e01 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,4 @@ allowBuilds: core-js: false +minimumReleaseAgeExclude: + - '@rstackjs/test-utils@0.2.0' diff --git a/tests/prebundle.test.ts b/tests/prebundle.test.ts index 59a8869..6511550 100644 --- a/tests/prebundle.test.ts +++ b/tests/prebundle.test.ts @@ -1,6 +1,7 @@ import { afterAll, beforeAll, describe, expect, it } from '@rstest/core'; +import { prepareDist } from '@rstackjs/test-utils'; import { execFile } from 'node:child_process'; -import { promises as fs, readdirSync } from 'node:fs'; +import { readdirSync } from 'node:fs'; import { join, relative, sep } from 'node:path'; import { pathToFileURL } from 'node:url'; import { promisify } from 'node:util'; @@ -46,14 +47,14 @@ beforeAll(async () => { for (const target of targetPackages) { const distPath = join(process.cwd(), 'compiled', target.name); bundledPaths.set(target.name, distPath); - await resetDist(distPath); + await prepareDist(distPath); } await runPrebundle(); }); afterAll(async () => { for (const distPath of bundledPaths.values()) { - await resetDist(distPath); + await prepareDist(distPath); } }); @@ -67,13 +68,6 @@ describe('prebundle integration smoke tests', () => { }); }); -async function resetDist(distPath?: string) { - if (!distPath) { - return; - } - await fs.rm(distPath, { recursive: true, force: true }); -} - function readRelativeFileTree(distPath: string) { const results: string[] = []; const walk = (dir: string) => { From 37c2664bb7c943f9b636f80962befb17c524e336 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 13 Jul 2026 13:07:21 +0800 Subject: [PATCH 2/2] chore: exclude rstack scope from release age --- pnpm-workspace.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4ba1e01..c956dc7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ allowBuilds: core-js: false minimumReleaseAgeExclude: - - '@rstackjs/test-utils@0.2.0' + - '@rstackjs/*'