Create working obsidian plugin boilerplate

This commit is contained in:
Idrees Hassan
2025-11-13 17:10:50 -05:00
parent 807bf1019f
commit e99a61a4c6
8 changed files with 26 additions and 10 deletions

View File

@@ -158,8 +158,17 @@ archive.finalize();
// Build Obsidian plugin // Build Obsidian plugin
mkdirSync(OBSIDIAN_DIR, { recursive: true }); mkdirSync(OBSIDIAN_DIR, { recursive: true });
// Copy birb.js to main.js // Wrap birb.js with plugin boilerplate
writeFileSync(OBSIDIAN_DIR + '/main.js', birbJs); const obsidianPlugin = `
const { Plugin, Notice } = require('obsidian');
module.exports = class MyPlugin extends Plugin {
onload() {
${birbJs}
}
};`
// Create main.js with plugin code
writeFileSync(OBSIDIAN_DIR + '/main.js', obsidianPlugin);
// Copy manifest.json // Copy manifest.json
let obsidianManifest = readFileSync(OBSIDIAN_MANIFEST, 'utf8'); let obsidianManifest = readFileSync(OBSIDIAN_MANIFEST, 'utf8');

2
dist/birb.js vendored
View File

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

BIN
dist/extension.zip vendored

Binary file not shown.

View File

@@ -1902,7 +1902,7 @@
insertModal(`${birdBirb()} Mode`, message); insertModal(`${birdBirb()} Mode`, message);
}), }),
new Separator(), new Separator(),
new MenuItem("2025.11.3.40", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.40"); }, false), new MenuItem("2025.11.13.1", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.1"); }, 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.40", "version": "2025.11.13.1",
"homepage_url": "https://idreesinc.com", "homepage_url": "https://idreesinc.com",
"icons": { "icons": {
"48": "images/icons/transparent/48x48x1.png", "48": "images/icons/transparent/48x48x1.png",

11
dist/obsidian/main.js vendored
View File

@@ -1,4 +1,8 @@
(function () {
const { Plugin, Notice } = require('obsidian');
module.exports = class MyPlugin extends Plugin {
onload() {
(function () {
'use strict'; 'use strict';
const Directions = { const Directions = {
@@ -1902,7 +1906,7 @@
insertModal(`${birdBirb()} Mode`, message); insertModal(`${birdBirb()} Mode`, message);
}), }),
new Separator(), new Separator(),
new MenuItem("2025.11.3.40", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.40"); }, false), new MenuItem("2025.11.13.1", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.1"); }, false),
]; ];
const styleElement = document.createElement("style"); const styleElement = document.createElement("style");
@@ -2692,3 +2696,6 @@
}); });
})(); })();
}
};

View File

@@ -1,7 +1,7 @@
{ {
"id": "pocket-bird", "id": "pocket-bird",
"name": "Pocket Bird", "name": "Pocket Bird",
"version": "2025.11.3.40", "version": "2025.11.13.1",
"minAppVersion": "0.15.0", "minAppVersion": "0.15.0",
"description": "It's a pet bird in your Obsidian, what more could you want?", "description": "It's a pet bird in your Obsidian, what more could you want?",
"author": "Idrees Hassan", "author": "Idrees Hassan",

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.40 // @version 2025.11.13.1
// @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
@@ -1916,7 +1916,7 @@
insertModal(`${birdBirb()} Mode`, message); insertModal(`${birdBirb()} Mode`, message);
}), }),
new Separator(), new Separator(),
new MenuItem("2025.11.3.40", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.40"); }, false), new MenuItem("2025.11.13.1", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.1"); }, false),
]; ];
const styleElement = document.createElement("style"); const styleElement = document.createElement("style");