mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
feat: move snippets backend and tables into a plugin (B2)
This commit is contained in:
1 parent
fdedca39fd
commit
e07221eaf3
51 files changed
+28426
-3553
No files matched your search
@@ -111,7 +111,9 @@ function main() {
|
||||
}
|
||||
|
||||
if (problems.length > 0) {
|
||||
console.error("The shell names plugins it should reach through a registry:");
|
||||
console.error(
|
||||
"The shell names plugins it should reach through a registry:",
|
||||
);
|
||||
for (const problem of problems) console.error(` ${problem}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,10 @@ export function scanLegacyCoreModules(repoRoot) {
|
||||
}
|
||||
for (const plugin of plugins) {
|
||||
if (!plugin.isDirectory()) continue;
|
||||
const files = walk(path.join(pluginsDir, plugin.name, "src", "frontend"), []);
|
||||
const files = walk(
|
||||
path.join(pluginsDir, plugin.name, "src", "frontend"),
|
||||
[],
|
||||
);
|
||||
for (const file of files) {
|
||||
for (const specifier of findLegacyCoreImports(
|
||||
fs.readFileSync(file, "utf8"),
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
"plugins/remote-desktop/src/frontend/index.tsx",
|
||||
"plugins/remote-desktop/src/frontend/quick-connect-guac-host.ts",
|
||||
"plugins/remote-desktop/src/frontend/rdp-credential-prompt.ts",
|
||||
"plugins/ssh-terminal/src/frontend/TerminalTabWithRegistry.tsx",
|
||||
"plugins/ssh-terminal/src/frontend/index.tsx",
|
||||
"plugins/ssh-terminal/src/frontend/session-registry.ts",
|
||||
"plugins/tailscale/src/frontend/TailscaleCheckDialog.tsx",
|
||||
"plugins/tailscale/src/frontend/TailscaleCheckOverlay.tsx",
|
||||
"plugins/tailscale/src/frontend/TailscaleDevicesPanel.tsx",
|
||||
|
||||
@@ -52,7 +52,8 @@ export { default } from ${target};`
|
||||
}
|
||||
const require = createRequire(path.join(repoRoot, "package.json"));
|
||||
const names = Object.keys(require(specifier)).filter(
|
||||
(name) => name !== "default" && name !== "__esModule" && IDENTIFIER.test(name),
|
||||
(name) =>
|
||||
name !== "default" && name !== "__esModule" && IDENTIFIER.test(name),
|
||||
);
|
||||
const lines = [`import * as m from ${JSON.stringify(specifier)};`];
|
||||
lines.push("const d = m.default ?? m;");
|
||||
@@ -140,7 +141,7 @@ export function termixPluginHost({ repoRoot, sdkUiEntry, sdkFrontendEntry }) {
|
||||
"}",
|
||||
"for (const [file, load] of Object.entries(locales)) {",
|
||||
' const parts = file.split("/");',
|
||||
' const id = parts[2];',
|
||||
" const id = parts[2];",
|
||||
' const name = parts[parts.length - 1].replace(/\\.json$/, "");',
|
||||
" (workspaceLocales[id] ??= {})[name] = load;",
|
||||
"}",
|
||||
|
||||
Reference in new issue
Block a user