Add obsidian build

This commit is contained in:
Idrees Hassan
2025-11-03 21:35:27 -05:00
parent 3fe52e5492
commit e50c2c8a1f
11 changed files with 2712 additions and 11 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/node_modules /node_modules
.DS_Store .DS_Store
/dist/birb.bundled.js /dist/birb.bundled.js
obsidian-test.sh

View File

@@ -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.21", "version": "2025.11.3.34",
"homepage_url": "https://idreesinc.com", "homepage_url": "https://idreesinc.com",
"icons": { "icons": {
"48": "images/icons/transparent/48x48x1.png", "48": "images/icons/transparent/48x48x1.png",

View File

@@ -12,13 +12,15 @@ const FONTS_DIR = "./fonts";
const DIST_DIR = "./dist"; const DIST_DIR = "./dist";
const BROWSER_MANIFEST = "./browser-manifest.json"; 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 STYLESHEET_PATH = SRC_DIR + "/stylesheet.css";
const APPLICATION_ENTRY = SRC_DIR + "/application.js"; const APPLICATION_ENTRY = SRC_DIR + "/application.js";
const BUNDLED_OUTPUT = DIST_DIR + "/birb.bundled.js"; const BUNDLED_OUTPUT = DIST_DIR + "/birb.bundled.js";
const BIRB_OUTPUT = DIST_DIR + "/birb.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 = [ const spriteSheets = [
{ {
@@ -54,8 +56,9 @@ try {
throw e; throw e;
} }
// Update manifest.json with new version
const version = `${versionDate}.${buildNumber}`; const version = `${versionDate}.${buildNumber}`;
// Update browser manifest with new version
try { try {
const manifest = JSON.parse(readFileSync(BROWSER_MANIFEST, 'utf8')); const manifest = JSON.parse(readFileSync(BROWSER_MANIFEST, 'utf8'));
manifest.version = version; manifest.version = version;
@@ -65,6 +68,14 @@ try {
throw e; 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 = const userScriptHeader =
`// ==UserScript== `// ==UserScript==
// @name Pocket Bird // @name Pocket Bird
@@ -139,7 +150,7 @@ mkdirSync(EXTENSION_DIR + '/fonts', { recursive: true });
cpSync(FONTS_DIR, EXTENSION_DIR + '/fonts', { recursive: true }); cpSync(FONTS_DIR, EXTENSION_DIR + '/fonts', { recursive: true });
// Compress extension folder into zip // Compress extension folder into zip
const output = createWriteStream(EXTENSION_ZIP); const output = createWriteStream(DIST_DIR + "/extension.zip");
const archive = archiver('zip'); const archive = archiver('zip');
output.on('close', () => { output.on('close', () => {
@@ -154,4 +165,14 @@ archive.pipe(output);
archive.directory(EXTENSION_DIR + '/', false); archive.directory(EXTENSION_DIR + '/', false);
archive.finalize(); 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}`); console.log(`Build complete: ${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.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"); const styleElement = document.createElement("style");

BIN
dist/extension.zip vendored

Binary file not shown.

View File

@@ -1867,7 +1867,7 @@
insertModal(`${birdBirb()} Mode`, message); insertModal(`${birdBirb()} Mode`, message);
}), }),
new Separator(), 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"); 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 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.21", "version": "2025.11.3.34",
"homepage_url": "https://idreesinc.com", "homepage_url": "https://idreesinc.com",
"icons": { "icons": {
"48": "images/icons/transparent/48x48x1.png", "48": "images/icons/transparent/48x48x1.png",

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
View 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
}

View File

@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Pocket Bird // @name Pocket Bird
// @namespace https://idreesinc.com // @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 // @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.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"); const styleElement = document.createElement("style");

10
obsidian-manifest.json Normal file
View 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
}