mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
Adds a hardcoded process:transport-owner tier so the terminal can own its WebSocket server and ssh2 clients, which cannot cross the worker boundary.
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
/**
|
|
* Copies plugins/ into dist/plugins so bundled first-party plugins ship with a
|
|
* built server.
|
|
*
|
|
* tsc only emits .ts, and a plugin's backend entry is a hand-written .mjs plus
|
|
* a manifest.json, so without this step the plugins directory simply would not
|
|
* exist in dist and the loader would find nothing.
|
|
*
|
|
* getBundledPluginsDir() in src/backend/plugins/paths.ts resolves
|
|
* dist/backend/backend/plugins -> dist/plugins, which is where this writes.
|
|
*/
|
|
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
|
|
const root = path.resolve(__dirname, "..");
|
|
const source = path.join(root, "plugins");
|
|
const destination = path.join(root, "dist", "plugins");
|
|
|
|
if (!fs.existsSync(source)) {
|
|
console.log("No plugins/ directory, nothing to bundle.");
|
|
process.exit(0);
|
|
}
|
|
|
|
fs.rmSync(destination, { recursive: true, force: true });
|
|
fs.cpSync(source, destination, { recursive: true });
|
|
|
|
const bundled = fs
|
|
.readdirSync(destination, { withFileTypes: true })
|
|
.filter((entry) => entry.isDirectory())
|
|
.map((entry) => entry.name);
|
|
|
|
console.log(`Bundled ${bundled.length} plugin(s): ${bundled.join(", ")}`);
|