From d8b7a863666d2cdb33903ece8dad06ef794a90ec Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 26 Jul 2026 18:58:49 +0200 Subject: [PATCH] ci(plugin-kit): repair the file: dependency bun 1.3 links to itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish workflow has been failing at Typecheck with "cannot find module '@punktfunk/host'" — every import of the SDK, in a job whose previous step built that very SDK successfully. bun 1.3 installs a `file:` dependency by copying its DIRECTORIES but symlinking each top-level FILE to itself: `node_modules/@punktfunk/host/package.json -> package.json`, a dangling self-reference. So `dist/index.d.ts` arrives intact while the manifest that points at it does not, and resolution dies at the first step it takes. The types were never missing; nothing could find the front door. Replacing that tree with a real copy is the whole fix, and the step no-ops itself the moment bun links `file:` deps correctly again. Not a regression from anything in the kit — it has been broken since bun updated, and went unnoticed because nothing has been published since 0.1.4. Verified from a clean node_modules: install → repair → typecheck → 20 tests → build, all green. --- .gitea/workflows/plugin-kit-publish.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitea/workflows/plugin-kit-publish.yml b/.gitea/workflows/plugin-kit-publish.yml index 61ec3ead..14bddc54 100644 --- a/.gitea/workflows/plugin-kit-publish.yml +++ b/.gitea/workflows/plugin-kit-publish.yml @@ -39,6 +39,25 @@ jobs: working-directory: plugin-kit run: bun install --frozen-lockfile --ignore-scripts + # bun 1.3 installs a `file:` dependency by copying its DIRECTORIES but symlinking each + # top-level FILE to itself — `node_modules/@punktfunk/host/package.json -> package.json`, a + # dangling self-reference. `dist/` therefore arrives intact while the manifest that points at + # it does not, so module resolution dies at the first step and every `@punktfunk/host` import + # reads as "cannot find module". Replacing the tree with a real copy is the whole fix; drop + # this step once bun links `file:` deps correctly again. + - name: Repair the file: dependency (bun 1.3 self-symlink) + working-directory: plugin-kit + run: | + # -f follows the link, so this is true only when the manifest actually resolves. + if test -f node_modules/@punktfunk/host/package.json; then + echo "bun linked it correctly — this step can go" + else + rm -rf node_modules/@punktfunk/host + cp -R ../sdk node_modules/@punktfunk/host + fi + test -f node_modules/@punktfunk/host/package.json + test -f node_modules/@punktfunk/host/dist/index.d.ts + - name: Typecheck working-directory: plugin-kit run: bun run typecheck