8 Commits

Author SHA1 Message Date
Idrees Hassan
2e3ff28706 Failed vscode wip 2025-11-15 21:08:28 -05:00
Idrees Hassan
76e55a3caa Merge branch 'main' of https://github.com/IdreesInc/Pocket-Bird 2025-11-15 18:25:48 -05:00
Idrees Hassan
224fe4aaec Update obsidian manifest 2025-11-15 18:25:44 -05:00
Idrees
764e8311fa Update plugin URL for Obsidian instructions 2025-11-15 18:09:39 -05:00
Idrees Hassan
b66521b7a2 Remove eslint configs 2025-11-15 17:32:18 -05:00
Idrees Hassan
72f2805fa0 Create eslint.config.js 2025-11-15 16:14:12 -05:00
Idrees Hassan
1ca5094536 Add readme for obsidian plugin testing 2025-11-15 15:35:14 -05:00
Idrees Hassan
2ddf10bb01 Update version to remove build number 2025-11-15 15:30:57 -05:00
20 changed files with 2952 additions and 28 deletions

View File

@@ -1 +0,0 @@
src/

12
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}/dist/vscode"]
}
]
}

View File

@@ -37,7 +37,11 @@ It's a pet bird that hops around your computer, what more could you want?
### Obsidian
_Coming soon!_
1. Install the [Beta Plugin Manager (BRAT)](https://obsidian.md/plugins?id=obsidian42-brat) plugin for Obsidian
2. Enable the BRAT plugin and open its settings
3. In the BRAT settings, click "Add Beta Plugin" and enter the following URL: `https://github.com/IdreesInc/PB-Obsidian-Releases`
4. Select "Latest version" and click "Add Plugin"
5. Enjoy a pet bird in your Obsidian notes!
### Userscript

View File

@@ -15,11 +15,14 @@ const DIST_DIR = "./dist";
const BROWSER_MANIFEST = "./platform-specific/extension/manifest.json";
const OBSIDIAN_MANIFEST = "./platform-specific/obsidian/manifest.json";
const USERSCRIPT_HEADER = "./platform-specific/userscript/header.txt";
const VSCODE_PACKAGE = "./platform-specific/vscode/package.json";
const OBSIDIAN_WRAPPER = "./platform-specific/obsidian/wrapper.js";
const VSCODE_WRAPPER = "./platform-specific/vscode/extension.js";
const USERSCRIPT_DIR = DIST_DIR + "/userscript";
const EXTENSION_DIR = DIST_DIR + "/extension";
const OBSIDIAN_DIR = DIST_DIR + "/obsidian";
const VSCODE_DIR = DIST_DIR + "/vscode";
const STYLESHEET_PATH = SRC_DIR + "/stylesheet.css";
const APPLICATION_ENTRY = SRC_DIR + "/application.js";
@@ -67,7 +70,8 @@ if (buildCache.version && buildCache.version.startsWith(versionDate)) {
}
}
const version = `${versionDate}.${buildNumber}`;
// const version = `${versionDate}.${buildNumber}`;
const version = `${versionDate}`; // Disable build number for now
// Update build cache
buildCache.version = version;
@@ -182,4 +186,21 @@ let obsidianManifest = readFileSync(OBSIDIAN_MANIFEST, 'utf8');
obsidianManifest = obsidianManifest.replace(/"version":\s*".*"/, `"version": "${version}"`);
writeFileSync(OBSIDIAN_DIR + '/manifest.json', obsidianManifest);
// =============================================
// Build VSCode extension
// =============================================
mkdirSync(VSCODE_DIR, { recursive: true });
// Wrap birb.js with VSCode extension boilerplate
let vscodeExtension = readFileSync(VSCODE_WRAPPER, 'utf8').replace(VERSION_KEY, version).replace(CODE_KEY, birbJs);
// Create extension.js with extension code
writeFileSync(VSCODE_DIR + '/extension.js', vscodeExtension);
// Copy package.json
let vscodePackage = readFileSync(VSCODE_PACKAGE, 'utf8');
vscodePackage = vscodePackage.replace(VERSION_KEY, version);
writeFileSync(VSCODE_DIR + '/package.json', vscodePackage);
console.log(`Build complete: ${version}`);

4
dist/birb.js vendored
View File

@@ -6,7 +6,7 @@
RIGHT: 1,
};
let debugMode = location.hostname === "127.0.0.1";
let debugMode = window.location.hostname === "127.0.0.1";
/**
* @returns {boolean} Whether debug mode is enabled
@@ -2046,7 +2046,7 @@
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.14.205", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.14.205"); }, false),
new MenuItem("2025.11.15", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.15"); }, false),
];
const styleElement = document.createElement("style");

BIN
dist/extension.zip vendored

Binary file not shown.

View File

@@ -6,7 +6,7 @@
RIGHT: 1,
};
let debugMode = location.hostname === "127.0.0.1";
let debugMode = window.location.hostname === "127.0.0.1";
/**
* @returns {boolean} Whether debug mode is enabled
@@ -2046,7 +2046,7 @@
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.14.205", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.14.205"); }, false),
new MenuItem("2025.11.15", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.15"); }, false),
];
const styleElement = document.createElement("style");

View File

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

View File

@@ -1,7 +1,7 @@
const { Plugin, Notice } = require('obsidian');
module.exports = class PocketBird extends Plugin {
onload() {
console.log("Loading Pocket Bird version 2025.11.14.205...");
console.log("Loading Pocket Bird version 2025.11.15...");
const OBSIDIAN_PLUGIN = this;
(function () {
'use strict';
@@ -11,7 +11,7 @@ module.exports = class PocketBird extends Plugin {
RIGHT: 1,
};
let debugMode = location.hostname === "127.0.0.1";
let debugMode = window.location.hostname === "127.0.0.1";
/**
* @returns {boolean} Whether debug mode is enabled
@@ -2051,7 +2051,7 @@ module.exports = class PocketBird extends Plugin {
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.14.205", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.14.205"); }, false),
new MenuItem("2025.11.15", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.15"); }, false),
];
const styleElement = document.createElement("style");

View File

@@ -1,9 +1,9 @@
{
"id": "pocket-bird",
"name": "Pocket Bird",
"version": "2025.11.14.205",
"version": "2025.11.15",
"minAppVersion": "0.15.0",
"description": "It's a pet bird in your Obsidian, what more could you want?",
"description": "Add a pet bird to fly around your notes and keep you company!",
"author": "Idrees Hassan",
"authorUrl": "https://idreesinc.com",
"isDesktopOnly": false

View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name Pocket Bird
// @namespace https://idreesinc.com
// @version 2025.11.14.205
// @version 2025.11.15
// @description It's a pet bird in your browser, what more could you want?
// @author Idrees
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
@@ -20,7 +20,7 @@
RIGHT: 1,
};
let debugMode = location.hostname === "127.0.0.1";
let debugMode = window.location.hostname === "127.0.0.1";
/**
* @returns {boolean} Whether debug mode is enabled
@@ -2060,7 +2060,7 @@
insertModal(`${birdBirb()} Mode`, message);
}),
new Separator(),
new MenuItem("2025.11.14.205", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.14.205"); }, false),
new MenuItem("2025.11.15", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.15"); }, false),
];
const styleElement = document.createElement("style");

2834
dist/vscode/extension.js vendored Normal file

File diff suppressed because it is too large Load Diff

21
dist/vscode/package.json vendored Normal file
View File

@@ -0,0 +1,21 @@
{
"name": "pocket-bird",
"version": "2025.11.15",
"engines": {
"vscode": "^1.32.0"
},
"activationEvents": [
"onStartupFinished"
],
"main": "extension.js",
"contributes": {
"commands": [
{
"command": "pocket-bird.helloWorld",
"title": "Hello World",
"category": "Example"
}
]
}
}

View File

@@ -1,10 +0,0 @@
{
"id": "pocket-bird",
"name": "Pocket Bird",
"version": "2025.11.14.205",
"minAppVersion": "0.15.0",
"description": "Add a pet bird to fly around your notes and keep you company!",
"author": "Idrees Hassan",
"authorUrl": "https://idreesinc.com",
"isDesktopOnly": false
}

View File

@@ -3,7 +3,7 @@
"name": "Pocket Bird",
"version": "__VERSION__",
"minAppVersion": "0.15.0",
"description": "It's a pet bird in your Obsidian, what more could you want?",
"description": "Add a pet bird to fly around your notes and keep you company!",
"author": "Idrees Hassan",
"authorUrl": "https://idreesinc.com",
"isDesktopOnly": false

View File

@@ -0,0 +1,16 @@
// The module 'vscode' contains the VS Code extensibility API
const vscode = require("vscode");
module.exports = {
activate,
deactivate,
};
function activate(context) {
console.log("Loading Pocket Bird...");
__CODE__
console.log("Pocket Bird loaded!");
}
function deactivate() {}

View File

@@ -0,0 +1,5 @@
#!/bin/bash
# my-vscode
export NODE_OPTIONS="--require /Users/idrees/Documents/Programs/JavaScript/Birb/platform-specific/vscode/patch.js"
"/Applications/Visual Studio Code.app/Contents/MacOS/Electron" \
"$@"

View File

@@ -0,0 +1,21 @@
{
"name": "pocket-bird",
"version": "__VERSION__",
"engines": {
"vscode": "^1.32.0"
},
"activationEvents": [
"onStartupFinished"
],
"main": "extension.js",
"contributes": {
"commands": [
{
"command": "pocket-bird.helloWorld",
"title": "Hello World",
"category": "Example"
}
]
}
}

View File

@@ -0,0 +1 @@
console.log("Birb patch for VSCode loaded.");

View File

@@ -3,7 +3,7 @@ export const Directions = {
RIGHT: 1,
};
let debugMode = location.hostname === "127.0.0.1";
let debugMode = window.location.hostname === "127.0.0.1";
/**
* @returns {boolean} Whether debug mode is enabled