Build into separate folders

This commit is contained in:
Idrees Hassan
2025-11-02 14:56:37 -05:00
parent 8a6b1a584e
commit 1c70c0cc13
32 changed files with 2729 additions and 15 deletions

View File

@@ -4,5 +4,5 @@ This project is still being worked on, but if you wish to help me beta test it,
1. Install [Tampermonkey](https://www.tampermonkey.net/) on your web browser 1. Install [Tampermonkey](https://www.tampermonkey.net/) on your web browser
2. Enable the Tampermonkey extension and give it the permissions requested 2. Enable the Tampermonkey extension and give it the permissions requested
3. Install my Pocket Bird script by going to this link and clicking install: [https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js](https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js) 3. Install my Pocket Bird script by going to this link and clicking install: [https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js](https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js)
4. Now any websites you visit will have a little bird hopping around! 4. Now any websites you visit will have a little bird hopping around!

View File

@@ -1,7 +1,7 @@
// @ts-check // @ts-check
import { rollup } from 'rollup'; import { rollup } from 'rollup';
import { readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs'; import { readFileSync, writeFileSync, mkdirSync, unlinkSync, cpSync } from 'fs';
const spriteSheets = [ const spriteSheets = [
{ {
@@ -56,8 +56,8 @@ const userScriptHeader =
// @version ${version} // @version ${version}
// @description birb // @description birb
// @author Idrees // @author Idrees
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js // @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
// @updateURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js // @updateURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
// @match *://*/* // @match *://*/*
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
@@ -80,6 +80,9 @@ await bundle.close();
let birbJs = readFileSync('dist/birb.bundled.js', 'utf8'); let birbJs = readFileSync('dist/birb.bundled.js', 'utf8');
// Delete bundled file
unlinkSync('./dist/birb.bundled.js');
// Replace version placeholder // Replace version placeholder
birbJs = birbJs.replaceAll('__VERSION__', version); birbJs = birbJs.replaceAll('__VERSION__', version);
@@ -96,9 +99,20 @@ birbJs = birbJs.replace(STYLESHEET_KEY, stylesheetContent);
// Build standard javascript file // Build standard javascript file
writeFileSync('./dist/birb.js', birbJs); writeFileSync('./dist/birb.js', birbJs);
// Delete bundled file
unlinkSync('./dist/birb.bundled.js');
// Build user script // Build user script
mkdirSync('./dist/userscript', { recursive: true });
const userScript = userScriptHeader + birbJs; const userScript = userScriptHeader + birbJs;
writeFileSync('./dist/birb.user.js', userScript); writeFileSync('./dist/userscript/birb.user.js', userScript);
// Build browser extension
mkdirSync('./dist/extension', { recursive: true });
// Copy birb.js
writeFileSync('./dist/extension/birb.js', birbJs);
// Copy manifest.json
const manifestContent = readFileSync('./manifest.json', 'utf8');
writeFileSync('./dist/extension/manifest.json', manifestContent);
// Copy icons folder
mkdirSync('./dist/extension/images/icons', { recursive: true });
cpSync('./images/icons/transparent', './dist/extension/images/icons/transparent', { recursive: true });
console.log(`Build completed: version ${version}`);

2
dist/birb.js vendored
View File

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

2659
dist/extension/birb.js vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

41
dist/extension/manifest.json vendored Normal file
View File

@@ -0,0 +1,41 @@
{
"manifest_version": 3,
"name": "Pocket Bird",
"description": "It's a bird, in your browser. What more could you want?",
"version": "2025.11.2.60",
"homepage_url": "https://idreesinc.com",
"icons": {
"48": "images/icons/transparent/48x48x1.png",
"96": "images/icons/transparent/96x96x1.png",
"128": "images/icons/transparent/128x128x1.png"
},
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"birb.js"
]
}
],
"permissions": [
"storage",
"activeTab"
],
"web_accessible_resources": [
{
"resources": [
"images/*"
],
"matches": [
"<all_urls>"
]
}
],
"browser_specific_settings": {
"gecko": {
"id": "birb@idreesinc.com"
}
}
}

View File

@@ -1,11 +1,11 @@
// ==UserScript== // ==UserScript==
// @name Pocket Bird // @name Pocket Bird
// @namespace https://idreesinc.com // @namespace https://idreesinc.com
// @version 2025.11.2.44 // @version 2025.11.2.60
// @description birb // @description birb
// @author Idrees // @author Idrees
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js // @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
// @updateURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/birb.user.js // @updateURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
// @match *://*/* // @match *://*/*
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
@@ -1881,7 +1881,7 @@
insertModal(`${birdBirb()} Mode`, message); insertModal(`${birdBirb()} Mode`, message);
}), }),
new Separator(), new Separator(),
new MenuItem("2025.11.2.44", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.44"); }, false), new MenuItem("2025.11.2.60", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.2.60"); }, false),
]; ];
const styleElement = document.createElement("style"); const styleElement = document.createElement("style");

View File

@@ -2,7 +2,7 @@
"manifest_version": 3, "manifest_version": 3,
"name": "Pocket Bird", "name": "Pocket Bird",
"description": "It's a bird, in your browser. What more could you want?", "description": "It's a bird, in your browser. What more could you want?",
"version": "2025.11.2.44", "version": "2025.11.2.60",
"homepage_url": "https://idreesinc.com", "homepage_url": "https://idreesinc.com",
"icons": { "icons": {
"48": "images/icons/transparent/48x48x1.png", "48": "images/icons/transparent/48x48x1.png",
@@ -15,7 +15,7 @@
"<all_urls>" "<all_urls>"
], ],
"js": [ "js": [
"./dist/birb.js" "birb.js"
] ]
} }
], ],