Compress extension in build

This commit is contained in:
Idrees Hassan
2025-11-02 21:40:25 -05:00
parent 6e40e658bf
commit 2d95496fd9
9 changed files with 1038 additions and 9 deletions

View File

@@ -1,7 +1,8 @@
// @ts-check
import { rollup } from 'rollup';
import { readFileSync, writeFileSync, mkdirSync, unlinkSync, cpSync } from 'fs';
import { readFileSync, writeFileSync, mkdirSync, unlinkSync, cpSync, createWriteStream } from 'fs';
import archiver from 'archiver';
const spriteSheets = [
{
@@ -118,4 +119,20 @@ cpSync('./images/icons/transparent', './dist/extension/images/icons/transparent'
mkdirSync('./dist/extension/fonts', { recursive: true });
cpSync('./fonts', './dist/extension/fonts', { recursive: true });
// Compress extension folder into zip
const output = createWriteStream('./dist/extension.zip');
const archive = archiver('zip');
output.on('close', () => {
console.log(`Created zip file: ${archive.pointer()} total bytes`);
});
archive.on('error', (err) => {
throw err;
});
archive.pipe(output);
archive.directory('./dist/extension/', false);
archive.finalize();
console.log(`Build completed: version ${version}`);

2
dist/birb.js vendored
View File

@@ -1867,7 +1867,7 @@
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.2.66", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.66"); }, false),
new MenuItem("2025.11.2.73", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.73"); }, false),
];
const styleElement = document.createElement("style");

BIN
dist/extension.zip vendored Normal file

Binary file not shown.

View File

@@ -1867,7 +1867,7 @@
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.2.66", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.66"); }, false),
new MenuItem("2025.11.2.73", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.73"); }, false),
];
const styleElement = document.createElement("style");

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Pocket Bird",
"description": "It's a pet bird in your browser, what more could you want?",
"version": "2025.11.2.66",
"version": "2025.11.2.73",
"homepage_url": "https://idreesinc.com",
"icons": {
"48": "images/icons/transparent/48x48x1.png",
@@ -36,7 +36,12 @@
],
"browser_specific_settings": {
"gecko": {
"id": "birb@idreesinc.com"
"id": "pocket-bird@idreesinc.com",
"data_collection_permissions": {
"required": [
"none"
]
}
}
}
}

View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name Pocket Bird
// @namespace https://idreesinc.com
// @version 2025.11.2.66
// @version 2025.11.2.73
// @description It's a bird that hops around your web browser, the future is here
// @author Idrees
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
@@ -1881,7 +1881,7 @@
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.2.66", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.66"); }, false),
new MenuItem("2025.11.2.73", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.73"); }, false),
];
const styleElement = document.createElement("style");

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Pocket Bird",
"description": "It's a pet bird in your browser, what more could you want?",
"version": "2025.11.2.66",
"version": "2025.11.2.73",
"homepage_url": "https://idreesinc.com",
"icons": {
"48": "images/icons/transparent/48x48x1.png",
@@ -36,7 +36,12 @@
],
"browser_specific_settings": {
"gecko": {
"id": "birb@idreesinc.com"
"id": "pocket-bird@idreesinc.com",
"data_collection_permissions": {
"required": [
"none"
]
}
}
}
}

1001
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,7 @@
"dev": "nodemon --watch src --watch stylesheet.css --watch build.js --exec \"npm run build\""
},
"devDependencies": {
"archiver": "^7.0.1",
"nodemon": "^3.1.10",
"rollup": "^4.52.5"
}