mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Use constant for browser manifest path
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"description": "It's a pet bird in your browser, what more could you want?",
|
"description": "It's a pet bird in your browser, what more could you want?",
|
||||||
"version": "2025.11.3.5",
|
"version": "2025.11.3.10",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "images/icons/transparent/48x48x1.png",
|
"48": "images/icons/transparent/48x48x1.png",
|
||||||
|
|||||||
17
build.js
17
build.js
@@ -17,6 +17,7 @@ const spriteSheets = [
|
|||||||
|
|
||||||
const STYLESHEET_PATH = "./src/stylesheet.css";
|
const STYLESHEET_PATH = "./src/stylesheet.css";
|
||||||
const STYLESHEET_KEY = "___STYLESHEET___";
|
const STYLESHEET_KEY = "___STYLESHEET___";
|
||||||
|
const BROWSER_MANIFEST = "./browser-manifest.json";
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const versionDate = `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`;
|
const versionDate = `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`;
|
||||||
@@ -24,7 +25,7 @@ const versionDate = `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}
|
|||||||
// Get current build number from the browser-manifest.json
|
// Get current build number from the browser-manifest.json
|
||||||
let buildNumber = 0;
|
let buildNumber = 0;
|
||||||
try {
|
try {
|
||||||
const manifest = JSON.parse(readFileSync('browser-manifest.json', 'utf8'));
|
const manifest = JSON.parse(readFileSync(BROWSER_MANIFEST, 'utf8'));
|
||||||
if (manifest.version) {
|
if (manifest.version) {
|
||||||
if (manifest.version.startsWith(versionDate)) {
|
if (manifest.version.startsWith(versionDate)) {
|
||||||
// Same day, increment build number
|
// Same day, increment build number
|
||||||
@@ -35,18 +36,18 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Could not read version from browser-manifest.json");
|
console.error("Could not read version from browser manifest");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update manifest.json with new version
|
// Update manifest.json with new version
|
||||||
const version = `${versionDate}.${buildNumber}`;
|
const version = `${versionDate}.${buildNumber}`;
|
||||||
try {
|
try {
|
||||||
const manifest = JSON.parse(readFileSync('browser-manifest.json', 'utf8'));
|
const manifest = JSON.parse(readFileSync(BROWSER_MANIFEST, 'utf8'));
|
||||||
manifest.version = version;
|
manifest.version = version;
|
||||||
writeFileSync('browser-manifest.json', JSON.stringify(manifest, null, 4), 'utf8');
|
writeFileSync(BROWSER_MANIFEST, JSON.stringify(manifest, null, 4), 'utf8');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Could not update version in browser-manifest.json");
|
console.error("Could not update version in browser manifest");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,14 +108,18 @@ writeFileSync('./dist/userscript/birb.user.js', userScript);
|
|||||||
|
|
||||||
// Build browser extension
|
// Build browser extension
|
||||||
mkdirSync('./dist/extension', { recursive: true });
|
mkdirSync('./dist/extension', { recursive: true });
|
||||||
|
|
||||||
// Copy birb.js
|
// Copy birb.js
|
||||||
writeFileSync('./dist/extension/birb.js', birbJs);
|
writeFileSync('./dist/extension/birb.js', birbJs);
|
||||||
|
|
||||||
// Copy manifest.json
|
// Copy manifest.json
|
||||||
const manifestContent = readFileSync('./browser-manifest.json', 'utf8');
|
const manifestContent = readFileSync(BROWSER_MANIFEST, 'utf8');
|
||||||
writeFileSync('./dist/extension/manifest.json', manifestContent);
|
writeFileSync('./dist/extension/manifest.json', manifestContent);
|
||||||
|
|
||||||
// Copy icons folder
|
// Copy icons folder
|
||||||
mkdirSync('./dist/extension/images/icons', { recursive: true });
|
mkdirSync('./dist/extension/images/icons', { recursive: true });
|
||||||
cpSync('./images/icons/transparent', './dist/extension/images/icons/transparent', { recursive: true });
|
cpSync('./images/icons/transparent', './dist/extension/images/icons/transparent', { recursive: true });
|
||||||
|
|
||||||
// Copy fonts folder
|
// Copy fonts folder
|
||||||
mkdirSync('./dist/extension/fonts', { recursive: true });
|
mkdirSync('./dist/extension/fonts', { recursive: true });
|
||||||
cpSync('./fonts', './dist/extension/fonts', { recursive: true });
|
cpSync('./fonts', './dist/extension/fonts', { recursive: true });
|
||||||
|
|||||||
2
dist/birb.js
vendored
2
dist/birb.js
vendored
@@ -1867,7 +1867,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.5", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.5"); }, false),
|
new MenuItem("2025.11.3.10", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.10"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
BIN
dist/extension.zip
vendored
BIN
dist/extension.zip
vendored
Binary file not shown.
2
dist/extension/birb.js
vendored
2
dist/extension/birb.js
vendored
@@ -1867,7 +1867,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.5", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.5"); }, false),
|
new MenuItem("2025.11.3.10", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.10"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
2
dist/extension/manifest.json
vendored
2
dist/extension/manifest.json
vendored
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"description": "It's a pet bird in your browser, what more could you want?",
|
"description": "It's a pet bird in your browser, what more could you want?",
|
||||||
"version": "2025.11.3.5",
|
"version": "2025.11.3.10",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "images/icons/transparent/48x48x1.png",
|
"48": "images/icons/transparent/48x48x1.png",
|
||||||
|
|||||||
4
dist/userscript/birb.user.js
vendored
4
dist/userscript/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Pocket Bird
|
// @name Pocket Bird
|
||||||
// @namespace https://idreesinc.com
|
// @namespace https://idreesinc.com
|
||||||
// @version 2025.11.3.5
|
// @version 2025.11.3.10
|
||||||
// @description It's a bird that hops around your web browser, the future is here
|
// @description It's a bird that hops around your web browser, the future is here
|
||||||
// @author Idrees
|
// @author Idrees
|
||||||
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
||||||
@@ -1881,7 +1881,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.5", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.5"); }, false),
|
new MenuItem("2025.11.3.10", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.10"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
Reference in New Issue
Block a user