From d05540cc1be6a56d5391092a12b461717a76c986 Mon Sep 17 00:00:00 2001 From: cnbailian <594647004@qq.com> Date: Fri, 6 Mar 2026 11:29:58 +0800 Subject: [PATCH 1/4] fix: remove "bun" export condition to fix dual-module-instance bug When repterm is installed as an npm dependency, the "bun" export condition causes CLI (from dist/) and user test code (from src/) to use different TestRegistry instances, resulting in "beforeAll must be called inside a describe() block" errors. Removing the "bun" condition ensures both resolve to the same dist/ module. This follows the Playwright pattern and is the standard approach for CLI tools. Co-Authored-By: Claude Opus 4.6 --- packages/plugin-api/package.json | 4 +--- packages/plugin-kubectl/package.json | 4 +--- packages/repterm/package.json | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/plugin-api/package.json b/packages/plugin-api/package.json index d4d615a..e5355a9 100644 --- a/packages/plugin-api/package.json +++ b/packages/plugin-api/package.json @@ -7,14 +7,12 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "bun": "./src/index.ts", "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, "files": [ - "dist", - "src" + "dist" ], "scripts": { "build": "tsc", diff --git a/packages/plugin-kubectl/package.json b/packages/plugin-kubectl/package.json index 5eba870..27fb819 100644 --- a/packages/plugin-kubectl/package.json +++ b/packages/plugin-kubectl/package.json @@ -7,14 +7,12 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "bun": "./src/index.ts", "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, "files": [ - "dist", - "src" + "dist" ], "scripts": { "build": "tsc", diff --git a/packages/repterm/package.json b/packages/repterm/package.json index eebcbb8..70eb4ea 100644 --- a/packages/repterm/package.json +++ b/packages/repterm/package.json @@ -10,14 +10,12 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "bun": "./src/index.ts", "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, "files": [ - "dist", - "src" + "dist" ], "scripts": { "build": "tsc", From 19975f94852921cfb3877b802bb2f046e20085fa Mon Sep 17 00:00:00 2001 From: cnbailian <594647004@qq.com> Date: Fri, 6 Mar 2026 11:30:34 +0800 Subject: [PATCH 2/4] chore: update bun.lock --- bun.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bun.lock b/bun.lock index 719e078..c6e6ed7 100644 --- a/bun.lock +++ b/bun.lock @@ -43,7 +43,7 @@ }, "packages/plugin-api": { "name": "repterm-api", - "version": "0.1.2", + "version": "0.1.3", "devDependencies": { "typescript": "^5.3.0", }, From 9a1bd074fa8cfa77fa728d523cdac379eea68918 Mon Sep 17 00:00:00 2001 From: cnbailian <594647004@qq.com> Date: Fri, 6 Mar 2026 11:34:26 +0800 Subject: [PATCH 3/4] fix: add build step before tests in CI Without the "bun" export condition, workspace packages resolve to dist/ instead of src/. The test job needs to build packages first so dist/ exists when tests import from workspace dependencies like repterm-api. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cc5734..205425b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,9 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile + - name: Build all packages + run: bun run build + - name: Run tests run: bun run test From 65b3579d3eabe8126666379fb57879fe6b9058fa Mon Sep 17 00:00:00 2001 From: cnbailian <594647004@qq.com> Date: Fri, 6 Mar 2026 11:37:08 +0800 Subject: [PATCH 4/4] bump: update plugin versions to 0.1.4 Co-Authored-By: Claude Opus 4.6 --- packages/plugin-api/package.json | 2 +- packages/plugin-kubectl/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-api/package.json b/packages/plugin-api/package.json index e5355a9..e457c31 100644 --- a/packages/plugin-api/package.json +++ b/packages/plugin-api/package.json @@ -1,6 +1,6 @@ { "name": "repterm-api", - "version": "0.1.3", + "version": "0.1.4", "description": "Plugin and matcher API for repterm - use this to build repterm plugins without depending on repterm", "type": "module", "main": "./dist/index.js", diff --git a/packages/plugin-kubectl/package.json b/packages/plugin-kubectl/package.json index 27fb819..5b49378 100644 --- a/packages/plugin-kubectl/package.json +++ b/packages/plugin-kubectl/package.json @@ -1,6 +1,6 @@ { "name": "@nexusgpu/repterm-plugin-kubectl", - "version": "0.1.3", + "version": "0.1.4", "description": "Kubernetes plugin for repterm - provides kubectl testing utilities", "type": "module", "main": "./dist/index.js",