mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
feat: shared list kit, settings search, rail order and ui consistency fixes
This commit is contained in:
1 parent
3ed5775ed5
commit
58c3434e58
68 files changed
+2078
-512
No files matched your search
@@ -5,6 +5,10 @@
|
||||
* dist/backend/backend/plugins -> dist/plugins, which is where this writes.
|
||||
* Each .tmxplug is downloaded (or read from a path), checked against its
|
||||
* pinned sha256 and unpacked.
|
||||
*
|
||||
* For development, `--local <dir>` (or TERMIX_LOCAL_PLUGINS) points at a
|
||||
* folder of plugin repos like ../Termix-Plugins. Any plugin built there (has
|
||||
* dist/) is copied in place of its pin, so local plugin changes show up.
|
||||
*/
|
||||
|
||||
const fs = require("node:fs");
|
||||
@@ -13,6 +17,8 @@ const {
|
||||
loadBundledPlugins,
|
||||
fetchArtifact,
|
||||
extractArtifact,
|
||||
findLocalPluginBuilds,
|
||||
copyLocalBuild,
|
||||
} = require("./lib/bundled-plugins.cjs");
|
||||
|
||||
const root = path.resolve(__dirname, "..");
|
||||
@@ -20,11 +26,22 @@ const destination = path.join(root, "dist", "plugins");
|
||||
|
||||
async function main() {
|
||||
const plugins = loadBundledPlugins(root);
|
||||
const flag = process.argv.indexOf("--local");
|
||||
const localArg =
|
||||
flag !== -1 ? process.argv[flag + 1] : process.env.TERMIX_LOCAL_PLUGINS;
|
||||
const localDir = localArg ? path.resolve(root, localArg) : null;
|
||||
const local = findLocalPluginBuilds(localDir);
|
||||
|
||||
fs.rmSync(destination, { recursive: true, force: true });
|
||||
fs.mkdirSync(destination, { recursive: true });
|
||||
|
||||
for (const plugin of plugins) {
|
||||
const repo = local.get(plugin.id);
|
||||
if (repo) {
|
||||
copyLocalBuild(repo, path.join(destination, plugin.id));
|
||||
console.log(`copied local build of ${plugin.id}`);
|
||||
continue;
|
||||
}
|
||||
const buffer = await fetchArtifact(plugin, root);
|
||||
await extractArtifact(buffer, path.join(destination, plugin.id), plugin.id);
|
||||
console.log(`unpacked ${plugin.id}`);
|
||||
|
||||
Reference in new issue
Block a user