chore(deps): update pnpm version and clean up package.json; remove unused dependencies and scripts

- Updated package manager to pnpm@11.22.0 in package.json.
- Removed unused dependencies and scripts from package.json and pnpm-lock.yaml.
- Cleaned up fs-store.js and other files by removing commented-out code and unused imports.
- Updated workflow configurations to use environment variables for URLs.
This commit is contained in:
2026-08-21 21:48:24 +07:00
parent e84432a492
commit 9985ff3440
13 changed files with 12 additions and 103 deletions
-3
View File
@@ -1,6 +1,5 @@
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
import { SERVER_ROOT } from "./paths.js";
const ROOT_PKG = path.resolve(SERVER_ROOT, "../../package.json");
@@ -75,5 +74,3 @@ export function satisfiesRange(version, range) {
}
return true;
}
void fileURLToPath;
-31
View File
@@ -49,12 +49,6 @@ export function readScript(name) {
return fs.readFileSync(filePath, "utf8");
}
export function writeScript(name, content) {
assertScriptName(name);
fs.mkdirSync(SCRIPTS_DIR, { recursive: true });
fs.writeFileSync(path.join(SCRIPTS_DIR, name), content, "utf8");
}
/**
* Icon next to the script: `fetch-html.js` → `fetch-html.png` or `.jpg`.
* @returns {{ filePath: string, contentType: string } | null}
@@ -78,22 +72,6 @@ export function scriptHasIcon(name) {
return resolveScriptIcon(name) != null;
}
export function deleteScript(name) {
assertScriptName(name);
const filePath = path.join(SCRIPTS_DIR, name);
if (!fs.existsSync(filePath)) return false;
const icon = resolveScriptIcon(name);
fs.unlinkSync(filePath);
if (icon) {
try {
fs.unlinkSync(icon.filePath);
} catch {
// ignore missing icon
}
}
return true;
}
export function listOwners() {
if (!fs.existsSync(WORKFLOWS_DIR)) return [];
return fs
@@ -140,15 +118,6 @@ export function writeWorkflowYaml(owner, file, content) {
fs.writeFileSync(path.join(ownerDir, file), content, "utf8");
}
export function deleteWorkflowYaml(owner, file) {
assertOwner(owner);
assertWorkflowFile(file);
const filePath = path.join(WORKFLOWS_DIR, owner, file);
if (!fs.existsSync(filePath)) return false;
fs.unlinkSync(filePath);
return true;
}
export function listOwnerYamlFiles(owner) {
const ownerDir = path.join(WORKFLOWS_DIR, owner);
if (!fs.existsSync(ownerDir)) return [];
+1
View File
@@ -39,6 +39,7 @@
"pino": "^10.3.1",
"pino-roll": "^4.0.0",
"pm2": "^6.0.13",
"rss-parser": "^3.13.0",
"ssh2-sftp-client": "^12.1.1",
"webdav": "^5.10.0",
"yaml": "^2.9.0"
-3
View File
@@ -8,7 +8,6 @@ import {
installPluginFromDirectory,
pluginDir,
} from "./plugin-store.js";
import { readManifestFile } from "./plugin-manifest.js";
const execFileAsync = promisify(execFile);
@@ -214,5 +213,3 @@ export function ensureExampleInstalled(exampleId) {
});
return { ...installed, already: false };
}
void readManifestFile;
-3
View File
@@ -8,7 +8,6 @@ import {
import * as fsStore from "../../fs-store.js";
import {
forkCoreScript,
getInstalledPlugin,
listCoreScriptNames,
listInstalledPlugins,
resolveScriptRef,
@@ -475,7 +474,5 @@ export default function scriptsPluginFactory(registry) {
}
},
);
void getInstalledPlugin;
};
}
@@ -18,7 +18,7 @@ scripts:
- script: fetch-binary.js
- script: ntfy.js
config:
url: https://ntfy.sh/jerapah-flow
url: $VAR_ntfy_channel
triggers:
- type: HTTP
method: POST
@@ -6,9 +6,7 @@ scripts:
- script: plugin/get-current-time
config:
key: ""
- script: ntfy.js
config:
url: https://n.0dev.web.id/system
- profile: ntfy_default
triggers:
- type: HTTP
method: POST