Skip to content

Commit

Permalink
fix: INVALID_PACKAGE on large plugin_package files (#6)
Browse files Browse the repository at this point in the history
* fix: INVALID_PACKAGE on large plugin_package file

fix for: caido-community/devtools#2

* Bump to 0.1.1

---------

Co-authored-by: corb3nik <[email protected]>
  • Loading branch information
bebiksior and Corb3nik authored Feb 22, 2025
1 parent 5e70d4f commit 767e02e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@caido-community/dev",
"version": "0.1.0",
"version": "0.1.1",
"description": "Development tools for building Caido plugins",
"type": "module",
"exports": {
Expand Down
22 changes: 13 additions & 9 deletions src/bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,17 @@ export async function bundlePackage(options: {
// Write zip file to dist directory
const zipPath = path.join(distDir, "plugin_package.zip");
const zipFile = await fs.open(zipPath, "w");
zip
.generateNodeStream({
type: "nodebuffer",
streamFiles: true,
})
.pipe(zipFile.createWriteStream())
.on("finish", () => {
logSuccess("Plugin package zip file created successfully");
});
await new Promise<void>((resolve, reject) => {
zip
.generateNodeStream({
type: "nodebuffer",
streamFiles: true,
})
.pipe(zipFile.createWriteStream())
.on("finish", () => {
logSuccess("Plugin package zip file created successfully");
resolve();
})
.on("error", reject);
});
}

0 comments on commit 767e02e

Please sign in to comment.