From e0c0d389cf2f5159159b30f0026f285b52dee512 Mon Sep 17 00:00:00 2001 From: Tushar Anand Date: Tue, 4 Aug 2026 16:25:09 +0530 Subject: [PATCH 1/3] fix: prune unused @asyncapi/studio standalone build to fix Windows installer MAX_PATH --- .changeset/windows-installer-maxpath-fix.md | 5 +++ package.json | 1 + scripts/pretarball.js | 37 +++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .changeset/windows-installer-maxpath-fix.md create mode 100644 scripts/pretarball.js diff --git a/.changeset/windows-installer-maxpath-fix.md b/.changeset/windows-installer-maxpath-fix.md new file mode 100644 index 000000000..33aa885c7 --- /dev/null +++ b/.changeset/windows-installer-maxpath-fix.md @@ -0,0 +1,5 @@ +--- +"@asyncapi/cli": patch +--- + +fix: prune the unused Next.js standalone build from `@asyncapi/studio` before packing so the Windows installer no longer exceeds the 260-character `MAX_PATH` limit. diff --git a/package.json b/package.json index 2050ca04b..707c5781d 100644 --- a/package.json +++ b/package.json @@ -178,6 +178,7 @@ "pack:tarballs:alpine": "oclif pack tarballs -t linux-x64 && npm run pack:rename alpine", "pack:windows": "oclif pack win && npm run pack:rename", "pack:rename": "node scripts/releasePackagesRename.js", + "pretarball": "node ./scripts/pretarball.js", "publish:trusted": "echo \"Working around changesets action not supporting OIDC yet. Need to pass successful release output for triggering github release\";VERSION=$(node -p \"require('./package.json').version\"); PACKAGE_NAME=$(node -p \"require('./package.json').name\"); if npm view $PACKAGE_NAME@$VERSION > /dev/null 2>&1; then echo \"Version $VERSION of package $PACKAGE_NAME already published to NPM. Skipping GitHub release.\"; else git tag v$VERSION -m v$VERSION; echo \"New tag: $PACKAGE_NAME@$VERSION.\"; fi", "prepublishOnly": "npm run build", "pretest": "npm run build", diff --git a/scripts/pretarball.js b/scripts/pretarball.js new file mode 100644 index 000000000..e289b182b --- /dev/null +++ b/scripts/pretarball.js @@ -0,0 +1,37 @@ +/* eslint-disable no-console */ +/* + * scripts/pretarball.js + * + * It removes the Next.js `output: 'standalone'` build that is shipped inside + * the published `@asyncapi/studio` package. The CLI launches Studio/Preview + * via the programmatic Next server with `distDir: 'build'` + * (see src/domains/models/Studio.ts and src/domains/models/Preview.ts), which + * reads from `build/` as described by `build/required-server-files.json` and + * never uses `build/standalone`. + * + * That standalone folder contains a deeply-nested, pnpm-structured + * `node_modules/.pnpm/next@.../...` tree with paths exceeding the Windows + * 260-character MAX_PATH limit, which breaks the NSIS Windows installer with + * "Error opening file for writing". Pruning it here keeps those paths out of + * every packed artifact (win/macos/linux) without affecting runtime behaviour. + * + * See: https://github.com/asyncapi/cli/issues/2239 + */ + +const fs = require('fs'); +const path = require('path'); + +// Paths are relative to the oclif workspace root (process.cwd()). +const targets = [ + path.join('node_modules', '@asyncapi', 'studio', 'build', 'standalone'), +]; + +for (const rel of targets) { + const abs = path.resolve(process.cwd(), rel); + if (fs.existsSync(abs)) { + fs.rmSync(abs, { recursive: true, force: true }); + console.log(`[pretarball] removed ${rel}`); + } else { + console.log(`[pretarball] skip (not found) ${rel}`); + } +} From 2fa182ff09e3aeec63c15fe88f8d81174e4cd47a Mon Sep 17 00:00:00 2001 From: Tushar Anand Date: Sat, 15 Aug 2026 20:54:11 +0530 Subject: [PATCH 2/3] fix: warnings fixed Signed-off-by: Tushar Anand --- scripts/pretarball.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pretarball.js b/scripts/pretarball.js index e289b182b..8551227d8 100644 --- a/scripts/pretarball.js +++ b/scripts/pretarball.js @@ -18,8 +18,8 @@ * See: https://github.com/asyncapi/cli/issues/2239 */ -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); // Paths are relative to the oclif workspace root (process.cwd()). const targets = [ From f4428df42c983a072f8843f0368326cf05cec5b2 Mon Sep 17 00:00:00 2001 From: Tushar Anand Date: Sat, 15 Aug 2026 20:56:10 +0530 Subject: [PATCH 3/3] fix:comments removed Signed-off-by: Tushar Anand --- scripts/pretarball.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/scripts/pretarball.js b/scripts/pretarball.js index 8551227d8..098085ca5 100644 --- a/scripts/pretarball.js +++ b/scripts/pretarball.js @@ -1,22 +1,4 @@ /* eslint-disable no-console */ -/* - * scripts/pretarball.js - * - * It removes the Next.js `output: 'standalone'` build that is shipped inside - * the published `@asyncapi/studio` package. The CLI launches Studio/Preview - * via the programmatic Next server with `distDir: 'build'` - * (see src/domains/models/Studio.ts and src/domains/models/Preview.ts), which - * reads from `build/` as described by `build/required-server-files.json` and - * never uses `build/standalone`. - * - * That standalone folder contains a deeply-nested, pnpm-structured - * `node_modules/.pnpm/next@.../...` tree with paths exceeding the Windows - * 260-character MAX_PATH limit, which breaks the NSIS Windows installer with - * "Error opening file for writing". Pruning it here keeps those paths out of - * every packed artifact (win/macos/linux) without affecting runtime behaviour. - * - * See: https://github.com/asyncapi/cli/issues/2239 - */ const fs = require('node:fs'); const path = require('node:path');