Move yaml-js to being dep

This commit is contained in:
thororen1234 2026-04-16 11:45:25 -04:00
parent c0459e2adb
commit 14e4026d1b
No known key found for this signature in database
4 changed files with 15 additions and 5180 deletions

View file

@ -58,7 +58,8 @@
"nanoid": "^5.1.6",
"native-file-system-adapter": "^3.0.1",
"usercss-meta": "^0.12.0",
"virtual-merge": "^1.0.1"
"virtual-merge": "^1.0.1",
"yaml-js": "^0.3.1"
},
"devDependencies": {
"@electron/asar": "^4.2.0",

9
pnpm-lock.yaml generated
View file

@ -73,6 +73,9 @@ importers:
virtual-merge:
specifier: ^1.0.1
version: 1.0.2
yaml-js:
specifier: ^0.3.1
version: 0.3.1
devDependencies:
'@electron/asar':
specifier: ^4.2.0
@ -2886,6 +2889,10 @@ packages:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
yaml-js@0.3.1:
resolution: {integrity: sha512-LjoIFHCtSfkGzPsmYmfDsW+TShtQBcY7lwH1yLQ5brJHXRhjteUnVE2ThCbz1madq8JUZIAjFiavfnIFeTO8CQ==}
engines: {node: '>=8'}
yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
@ -5772,6 +5779,8 @@ snapshots:
y18n@5.0.8: {}
yaml-js@0.3.1: {}
yargs-parser@21.1.1: {}
yargs@17.7.2:

View file

@ -10,6 +10,7 @@ import { BrowserWindow, dialog, shell, WebContentsView } from "electron";
import { existsSync, readdirSync, readFileSync } from "fs";
import { readdir, readFile, rm } from "fs/promises";
import { basename, join } from "path";
import yaml from "yaml-js";
// @ts-ignore fuck off
import pluginValidateContent from "./misc/pluginValidate.txt"; // i would use HTML but esbuild is being whiny
@ -17,7 +18,6 @@ import pluginValidateContent from "./misc/pluginValidate.txt"; // i would use HT
import setGitPathContent from "./misc/setGitPath.txt";
// @ts-ignore fuck off
import updateValidateContent from "./misc/updateValidate.txt"; // see above
import YAML from "./yaml.js";
const PLUGIN_META_REGEX = /export default definePlugin\((?:\s|\/(?:\/|\*).*)*{\s*(?:\s|\/(?:\/|\*).*)*name:\s*(?:"|'|`)(.*)(?:"|'|`)(?:\s|\/(?:\/|\*).*)*,(?:\s|\/(?:\/|\*).*)*(?:\s|\/(?:\/|\*).*)*description:\s*(?:"|'|`)(.*)(?:"|'|`)(?:\s|\/(?:\/|\*).*)*/;
// if edited, also edit in misc/constants.ts!!!
@ -206,7 +206,7 @@ async function getPluginMeta(path: string, extra: object = {}): Promise<{
try {
const meta = readFileSync(join(path, "meta.yml"), "utf8");
console.log(meta);
const parsed = YAML.load(meta);
const parsed = yaml.load(meta);
if (parsed.thread && typeof parsed.thread === "string" && /^\d+$/.test(parsed.thread)) {
supportChannelID = parsed.thread;
}
@ -448,7 +448,7 @@ export async function openGitPathModal(_: any) {
});
}
});
} catch(e) {
} catch (e) {
dialog.showMessageBox({
title: "Error",
message: "Git error",
@ -464,7 +464,7 @@ export async function openGitPathModal(_: any) {
win.webContents.executeJavaScript(`document.querySelector("input").value = ${JSON.stringify(gitPathSet)};`);
}
console.log(YAML.load(`
console.log(yaml.load(`
name: test
items:
- a

File diff suppressed because it is too large Load diff