mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Failed vscode wip
This commit is contained in:
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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
20
build.js
20
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";
|
||||
@@ -183,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}`);
|
||||
2
dist/birb.js
vendored
2
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
|
||||
|
||||
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
@@ -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
|
||||
|
||||
2
dist/obsidian/main.js
vendored
2
dist/obsidian/main.js
vendored
@@ -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
|
||||
|
||||
2
dist/userscript/birb.user.js
vendored
2
dist/userscript/birb.user.js
vendored
@@ -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
|
||||
|
||||
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
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