mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Add obsidian build
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/node_modules
|
||||
.DS_Store
|
||||
/dist/birb.bundled.js
|
||||
obsidian-test.sh
|
||||
|
||||
@@ -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.3.21",
|
||||
"version": "2025.11.3.34",
|
||||
"homepage_url": "https://idreesinc.com",
|
||||
"icons": {
|
||||
"48": "images/icons/transparent/48x48x1.png",
|
||||
|
||||
31
build.js
31
build.js
@@ -12,13 +12,15 @@ const FONTS_DIR = "./fonts";
|
||||
const DIST_DIR = "./dist";
|
||||
|
||||
const BROWSER_MANIFEST = "./browser-manifest.json";
|
||||
const OBSIDIAN_MANIFEST = "./obsidian-manifest.json";
|
||||
const USERSCRIPT_DIR = DIST_DIR + "/userscript";
|
||||
const EXTENSION_DIR = DIST_DIR + "/extension";
|
||||
const OBSIDIAN_DIR = DIST_DIR + "/obsidian";
|
||||
|
||||
const STYLESHEET_PATH = SRC_DIR + "/stylesheet.css";
|
||||
const APPLICATION_ENTRY = SRC_DIR + "/application.js";
|
||||
const BUNDLED_OUTPUT = DIST_DIR + "/birb.bundled.js";
|
||||
const BIRB_OUTPUT = DIST_DIR + "/birb.js";
|
||||
const USERSCRIPT_DIR = DIST_DIR + "/userscript";
|
||||
const EXTENSION_DIR = DIST_DIR + "/extension";
|
||||
const EXTENSION_ZIP = DIST_DIR + "/extension.zip";
|
||||
|
||||
const spriteSheets = [
|
||||
{
|
||||
@@ -54,8 +56,9 @@ try {
|
||||
throw e;
|
||||
}
|
||||
|
||||
// Update manifest.json with new version
|
||||
const version = `${versionDate}.${buildNumber}`;
|
||||
|
||||
// Update browser manifest with new version
|
||||
try {
|
||||
const manifest = JSON.parse(readFileSync(BROWSER_MANIFEST, 'utf8'));
|
||||
manifest.version = version;
|
||||
@@ -65,6 +68,14 @@ try {
|
||||
throw e;
|
||||
}
|
||||
|
||||
try {
|
||||
const obsidianManifest = JSON.parse(readFileSync(OBSIDIAN_MANIFEST, 'utf8'));
|
||||
obsidianManifest.version = version;
|
||||
writeFileSync(OBSIDIAN_MANIFEST, JSON.stringify(obsidianManifest, null, 4), 'utf8');
|
||||
} catch (e) {
|
||||
console.error("Could not update version in Obsidian manifest");
|
||||
}
|
||||
|
||||
const userScriptHeader =
|
||||
`// ==UserScript==
|
||||
// @name Pocket Bird
|
||||
@@ -139,7 +150,7 @@ mkdirSync(EXTENSION_DIR + '/fonts', { recursive: true });
|
||||
cpSync(FONTS_DIR, EXTENSION_DIR + '/fonts', { recursive: true });
|
||||
|
||||
// Compress extension folder into zip
|
||||
const output = createWriteStream(EXTENSION_ZIP);
|
||||
const output = createWriteStream(DIST_DIR + "/extension.zip");
|
||||
const archive = archiver('zip');
|
||||
|
||||
output.on('close', () => {
|
||||
@@ -154,4 +165,14 @@ archive.pipe(output);
|
||||
archive.directory(EXTENSION_DIR + '/', false);
|
||||
archive.finalize();
|
||||
|
||||
// Build Obsidian plugin
|
||||
mkdirSync(OBSIDIAN_DIR, { recursive: true });
|
||||
|
||||
// Copy birb.js to main.js
|
||||
writeFileSync(OBSIDIAN_DIR + '/main.js', birbJs);
|
||||
|
||||
// Copy manifest.json
|
||||
const obsidianManifestContent = readFileSync(OBSIDIAN_MANIFEST, 'utf8');
|
||||
writeFileSync(OBSIDIAN_DIR + '/manifest.json', obsidianManifestContent);
|
||||
|
||||
console.log(`Build complete: ${version}`);
|
||||
2
dist/birb.js
vendored
2
dist/birb.js
vendored
@@ -1867,7 +1867,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.3.21", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.21"); }, false),
|
||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
||||
];
|
||||
|
||||
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);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.3.21", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.21"); }, false),
|
||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
|
||||
2
dist/extension/manifest.json
vendored
2
dist/extension/manifest.json
vendored
@@ -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.3.21",
|
||||
"version": "2025.11.3.34",
|
||||
"homepage_url": "https://idreesinc.com",
|
||||
"icons": {
|
||||
"48": "images/icons/transparent/48x48x1.png",
|
||||
|
||||
2659
dist/obsidian/main.js
vendored
Normal file
2659
dist/obsidian/main.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
dist/obsidian/manifest.json
vendored
Normal file
10
dist/obsidian/manifest.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "pocket-bird",
|
||||
"name": "Pocket Bird",
|
||||
"version": "2025.11.3.34",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
||||
"author": "Idrees Hassan",
|
||||
"authorUrl": "https://idreesinc.com",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
4
dist/userscript/birb.user.js
vendored
4
dist/userscript/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Pocket Bird
|
||||
// @namespace https://idreesinc.com
|
||||
// @version 2025.11.3.21
|
||||
// @version 2025.11.3.34
|
||||
// @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.3.21", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.21"); }, false),
|
||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
|
||||
10
obsidian-manifest.json
Normal file
10
obsidian-manifest.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "pocket-bird",
|
||||
"name": "Pocket Bird",
|
||||
"version": "2025.11.3.34",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
||||
"author": "Idrees Hassan",
|
||||
"authorUrl": "https://idreesinc.com",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
Reference in New Issue
Block a user