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 e757e7202..b88e15503 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..098085ca5 --- /dev/null +++ b/scripts/pretarball.js @@ -0,0 +1,19 @@ +/* eslint-disable no-console */ + +const fs = require('node:fs'); +const path = require('node: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}`); + } +}