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
+1 -10
View File
@@ -16,14 +16,5 @@
"start:control": "pnpm --filter @jerapah-flow/server start:control", "start:control": "pnpm --filter @jerapah-flow/server start:control",
"migrate": "pnpm --filter @jerapah-flow/server migrate" "migrate": "pnpm --filter @jerapah-flow/server migrate"
}, },
"packageManager": "pnpm@10.25.0", "packageManager": "pnpm@11.22.0"
"pnpm": {
"onlyBuiltDependencies": [
"better-sqlite3",
"esbuild"
]
},
"dependencies": {
"rss-parser": "^3.13.0"
}
} }
-3
View File
@@ -1,6 +1,5 @@
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import { fileURLToPath } from "url";
import { SERVER_ROOT } from "./paths.js"; import { SERVER_ROOT } from "./paths.js";
const ROOT_PKG = path.resolve(SERVER_ROOT, "../../package.json"); const ROOT_PKG = path.resolve(SERVER_ROOT, "../../package.json");
@@ -75,5 +74,3 @@ export function satisfiesRange(version, range) {
} }
return true; return true;
} }
void fileURLToPath;
-31
View File
@@ -49,12 +49,6 @@ export function readScript(name) {
return fs.readFileSync(filePath, "utf8"); 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`. * Icon next to the script: `fetch-html.js` → `fetch-html.png` or `.jpg`.
* @returns {{ filePath: string, contentType: string } | null} * @returns {{ filePath: string, contentType: string } | null}
@@ -78,22 +72,6 @@ export function scriptHasIcon(name) {
return resolveScriptIcon(name) != null; 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() { export function listOwners() {
if (!fs.existsSync(WORKFLOWS_DIR)) return []; if (!fs.existsSync(WORKFLOWS_DIR)) return [];
return fs return fs
@@ -140,15 +118,6 @@ export function writeWorkflowYaml(owner, file, content) {
fs.writeFileSync(path.join(ownerDir, file), content, "utf8"); 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) { export function listOwnerYamlFiles(owner) {
const ownerDir = path.join(WORKFLOWS_DIR, owner); const ownerDir = path.join(WORKFLOWS_DIR, owner);
if (!fs.existsSync(ownerDir)) return []; if (!fs.existsSync(ownerDir)) return [];
+1
View File
@@ -39,6 +39,7 @@
"pino": "^10.3.1", "pino": "^10.3.1",
"pino-roll": "^4.0.0", "pino-roll": "^4.0.0",
"pm2": "^6.0.13", "pm2": "^6.0.13",
"rss-parser": "^3.13.0",
"ssh2-sftp-client": "^12.1.1", "ssh2-sftp-client": "^12.1.1",
"webdav": "^5.10.0", "webdav": "^5.10.0",
"yaml": "^2.9.0" "yaml": "^2.9.0"
-3
View File
@@ -8,7 +8,6 @@ import {
installPluginFromDirectory, installPluginFromDirectory,
pluginDir, pluginDir,
} from "./plugin-store.js"; } from "./plugin-store.js";
import { readManifestFile } from "./plugin-manifest.js";
const execFileAsync = promisify(execFile); const execFileAsync = promisify(execFile);
@@ -214,5 +213,3 @@ export function ensureExampleInstalled(exampleId) {
}); });
return { ...installed, already: false }; return { ...installed, already: false };
} }
void readManifestFile;
-3
View File
@@ -8,7 +8,6 @@ import {
import * as fsStore from "../../fs-store.js"; import * as fsStore from "../../fs-store.js";
import { import {
forkCoreScript, forkCoreScript,
getInstalledPlugin,
listCoreScriptNames, listCoreScriptNames,
listInstalledPlugins, listInstalledPlugins,
resolveScriptRef, resolveScriptRef,
@@ -475,7 +474,5 @@ export default function scriptsPluginFactory(registry) {
} }
}, },
); );
void getInstalledPlugin;
}; };
} }
@@ -18,7 +18,7 @@ scripts:
- script: fetch-binary.js - script: fetch-binary.js
- script: ntfy.js - script: ntfy.js
config: config:
url: https://ntfy.sh/jerapah-flow url: $VAR_ntfy_channel
triggers: triggers:
- type: HTTP - type: HTTP
method: POST method: POST
@@ -6,9 +6,7 @@ scripts:
- script: plugin/get-current-time - script: plugin/get-current-time
config: config:
key: "" key: ""
- script: ntfy.js - profile: ntfy_default
config:
url: https://n.0dev.web.id/system
triggers: triggers:
- type: HTTP - type: HTTP
method: POST method: POST
-9
View File
@@ -625,15 +625,6 @@ export function useOpsProcessRestart() {
}); });
} }
export function useOpsBumpGeneration() {
const qc = useQueryClient();
return useMutation({
mutationFn: async (reason) =>
(await opsApi.post("/generation/bump", { reason })).data,
onSuccess: () => qc.invalidateQueries({ queryKey: ["ops-status"] }),
});
}
export function useWorkflowTrash() { export function useWorkflowTrash() {
return useQuery({ return useQuery({
queryKey: ["workflows", "trash"], queryKey: ["workflows", "trash"],
-6
View File
@@ -27,12 +27,6 @@ export const DEFAULT_INPUT_CONTEXT = `{
} }
`; `;
export function normalizeScriptName(name) {
const trimmed = name.trim();
if (!trimmed) return "";
return trimmed.endsWith(".js") ? trimmed : `${trimmed}.js`;
}
export function scriptTags(meta) { export function scriptTags(meta) {
if (!Array.isArray(meta?.tags)) return []; if (!Array.isArray(meta?.tags)) return [];
return meta.tags.map((t) => String(t).trim()).filter(Boolean); return meta.tags.map((t) => String(t).trim()).filter(Boolean);
-29
View File
@@ -12,35 +12,6 @@ triggers:
path: /new path: /new
`; `;
export function ensureWorkflowFilename(file) {
const trimmed = String(file ?? "").trim();
if (!trimmed) return "";
return /\.ya?ml$/i.test(trimmed) ? trimmed : `${trimmed}.yaml`;
}
/**
* Next unused copy filename: `track.yaml` → `track-copy.yaml`,
* `track-copy.yaml` → `track-copy-2.yaml`.
* @param {string} file
* @param {string[]} existingFiles
*/
export function suggestCopyFilename(file, existingFiles = []) {
const name = ensureWorkflowFilename(file) || "workflow.yaml";
const match = name.match(/^(.*?)(\.ya?ml)$/i);
const base = match ? match[1] : name;
const ext = match ? match[2] : ".yaml";
const existing = new Set(existingFiles);
const copyMatch = base.match(/^(.*)-copy(?:-(\d+))?$/);
const root = copyMatch ? copyMatch[1] : base;
const candidate = (i) =>
i <= 1 ? `${root}-copy${ext}` : `${root}-copy-${i}${ext}`;
let n = copyMatch ? Number(copyMatch[2] || 1) + 1 : 1;
while (existing.has(candidate(n))) n += 1;
return candidate(n);
}
let uidSeq = 0; let uidSeq = 0;
export function nextUiId(prefix = "ui") { export function nextUiId(prefix = "ui") {
+4 -5
View File
@@ -6,11 +6,7 @@ settings:
importers: importers:
.: .: {}
dependencies:
rss-parser:
specifier: ^3.13.0
version: 3.13.0
packages/server: packages/server:
dependencies: dependencies:
@@ -80,6 +76,9 @@ importers:
pm2: pm2:
specifier: ^6.0.13 specifier: ^6.0.13
version: 6.0.14 version: 6.0.14
rss-parser:
specifier: ^3.13.0
version: 3.13.0
ssh2-sftp-client: ssh2-sftp-client:
specifier: ^12.1.1 specifier: ^12.1.1
version: 12.1.1 version: 12.1.1
+4
View File
@@ -2,4 +2,8 @@ packages:
- packages/* - packages/*
allowBuilds: allowBuilds:
better-sqlite3: true better-sqlite3: true
cpu-features: true
esbuild: true esbuild: true
msgpackr-extract: true
ssh2: true
rss-parser: true