mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 12:17:22 +00:00
Compare commits
11 Commits
2025.11.14
...
vs-code
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e3ff28706 | ||
|
|
76e55a3caa | ||
|
|
224fe4aaec | ||
|
|
764e8311fa | ||
|
|
b66521b7a2 | ||
|
|
72f2805fa0 | ||
|
|
1ca5094536 | ||
|
|
2ddf10bb01 | ||
|
|
9eba0c13ed | ||
|
|
45626fda25 | ||
|
|
322b0d0b90 |
12
.vscode/launch.json
vendored
Normal file
12
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Run Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}/dist/vscode"]
|
||||
}
|
||||
]
|
||||
}
|
||||
10
README.md
10
README.md
@@ -35,6 +35,14 @@ It's a pet bird that hops around your computer, what more could you want?
|
||||
2. Click "Add to Firefox"
|
||||
3. Confirm any permission prompts that appear
|
||||
|
||||
### Obsidian
|
||||
|
||||
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
|
||||
|
||||
*Note that this is mainly used for beta testing new features, installation via browser extension is recommended for the best experience.*
|
||||
@@ -74,4 +82,4 @@ If you are running Pocket bird on a browser, the extension needs these permissio
|
||||
|
||||
If you'd like to get in touch, check out the [Discord](https://discord.gg/6yxE9prcNc) to suggest features, report bugs, and stay updated on development!
|
||||
|
||||
Also feel free to check out my other open-source projects like [Monocraft](https://github.com/IdreesInc/Monocraft), [PicoChat](https://github.com/IdreesInc/PicoChat), and more on [my website](https://idreesinc.com/)!
|
||||
Also feel free to check out my other open-source projects like [Monocraft](https://github.com/IdreesInc/Monocraft), [PicoChat](https://github.com/IdreesInc/PicoChat), and more on [my website](https://idreesinc.com/)!
|
||||
|
||||
23
build.js
23
build.js
@@ -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
4
dist/birb.js
vendored
@@ -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
BIN
dist/extension.zip
vendored
Binary file not shown.
4
dist/extension/birb.js
vendored
4
dist/extension/birb.js
vendored
@@ -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");
|
||||
|
||||
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.14.205",
|
||||
"version": "2025.11.15",
|
||||
"homepage_url": "https://idreesinc.com",
|
||||
"icons": {
|
||||
"48": "images/icons/transparent/48x48x1.png",
|
||||
|
||||
6
dist/obsidian/main.js
vendored
6
dist/obsidian/main.js
vendored
@@ -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");
|
||||
|
||||
4
dist/obsidian/manifest.json
vendored
4
dist/obsidian/manifest.json
vendored
@@ -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
|
||||
|
||||
6
dist/userscript/birb.user.js
vendored
6
dist/userscript/birb.user.js
vendored
@@ -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
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
21
dist/vscode/package.json
vendored
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
16
platform-specific/vscode/extension.js
Normal file
16
platform-specific/vscode/extension.js
Normal 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() {}
|
||||
|
||||
5
platform-specific/vscode/inject.sh
Normal file
5
platform-specific/vscode/inject.sh
Normal 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" \
|
||||
"$@"
|
||||
21
platform-specific/vscode/package.json
Normal file
21
platform-specific/vscode/package.json
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
1
platform-specific/vscode/patch.js
Normal file
1
platform-specific/vscode/patch.js
Normal file
@@ -0,0 +1 @@
|
||||
console.log("Birb patch for VSCode loaded.");
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user