From aa2619f95ea0d65e9cd57ad83862d7c74f245924 Mon Sep 17 00:00:00 2001 From: Volodymyr Rudenko Date: Thu, 11 Jun 2026 14:44:29 +0200 Subject: [PATCH] fix(build): migrate build-mcpb to archiver v8 named exports archiver 8.0.0 (bumped in #11) is pure ESM and replaced the default archiver("zip", opts) factory with named class exports; the v0.2.2 publish workflow failed at "Build MCPB bundle" with "does not provide an export named 'default'". Use `new ZipArchive(opts)` instead. Also run build:mcpb in CI so packaging breakage from dependency bumps surfaces on PRs instead of at release-tag time. Co-Authored-By: Claude Fable 5 --- .github/workflows/ci.yml | 2 ++ scripts/build-mcpb.mjs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e97aac3..2d3dc3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,3 +23,5 @@ jobs: - run: npm run typecheck - run: npm test - run: npm run build + # Catches packaging breakage (e.g. archiver major bumps) before a release tag. + - run: npm run build:mcpb diff --git a/scripts/build-mcpb.mjs b/scripts/build-mcpb.mjs index 5ea0c4d..ad945fc 100644 --- a/scripts/build-mcpb.mjs +++ b/scripts/build-mcpb.mjs @@ -1,4 +1,4 @@ -import archiver from "archiver"; +import { ZipArchive } from "archiver"; import { execFileSync } from "node:child_process"; import { copyFileSync, createWriteStream, existsSync, mkdtempSync, rmSync, statSync } from "node:fs"; import { mkdir, readFile } from "node:fs/promises"; @@ -43,7 +43,7 @@ await mkdir(outDir, { recursive: true }); const outPath = resolve(outDir, `${manifest.name}-${manifest.version}.mcpb`); const output = createWriteStream(outPath); -const archive = archiver("zip", { zlib: { level: 9 } }); +const archive = new ZipArchive({ zlib: { level: 9 } }); try { archive.pipe(output);