@termix-ssh/plugin-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/cli/commands/build.mjs +246 -0
- package/cli/commands/migrations.mjs +248 -0
- package/cli/commands/pack.mjs +42 -0
- package/cli/commands/sign.mjs +83 -0
- package/cli/commands/test.mjs +33 -0
- package/cli/commands/validate.mjs +215 -0
- package/cli/index.mjs +65 -0
- package/cli/lib/changelog.mjs +126 -0
- package/cli/lib/externals.mjs +46 -0
- package/cli/lib/plugin-dir.mjs +29 -0
- package/cli/lib/signing.mjs +86 -0
- package/cli/lib/static-url-imports.mjs +54 -0
- package/cli/lib/tmxplug.mjs +106 -0
- package/cli/patches/guacamole-common-js-flush.cjs +76 -0
- package/cli/patches/xterm-android-ime.cjs +130 -0
- package/client.d.ts +13 -0
- package/dist/backend.d.ts +1777 -0
- package/dist/backend.js +84 -0
- package/dist/capabilities.d.ts +38 -0
- package/dist/capabilities.js +71 -0
- package/dist/db.d.ts +112 -0
- package/dist/db.js +189 -0
- package/dist/ddl.d.ts +76 -0
- package/dist/ddl.js +678 -0
- package/dist/desktop.d.ts +346 -0
- package/dist/desktop.js +5 -0
- package/dist/frontend.d.ts +1206 -0
- package/dist/frontend.js +388 -0
- package/dist/host/chunk-F3SDZDDG.js +6017 -0
- package/dist/host/chunk-XGWE7BTJ.js +90 -0
- package/dist/host/chunk-XH5NXL6Y.js +56314 -0
- package/dist/host/chunk-YC2MAKSP.js +14 -0
- package/dist/host/linked-server-FZGWQW32.js +12 -0
- package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
- package/dist/host/testing-host.js +414 -0
- package/dist/host/theme.css +91 -0
- package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
- package/dist/host/types/src/types/connection-log.d.ts +13 -0
- package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
- package/dist/host/types/src/types/host-defaults.d.ts +60 -0
- package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
- package/dist/host/types/src/types/index.d.ts +298 -0
- package/dist/host/types/src/types/keybindings.d.ts +27 -0
- package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
- package/dist/host/types/src/types/ui-types.d.ts +260 -0
- package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
- package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
- package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
- package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
- package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
- package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
- package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
- package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
- package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
- package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
- package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
- package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
- package/dist/host/types/src/ui/components/alert.d.ts +9 -0
- package/dist/host/types/src/ui/components/badge.d.ts +9 -0
- package/dist/host/types/src/ui/components/button.d.ts +13 -0
- package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
- package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
- package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
- package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
- package/dist/host/types/src/ui/components/card.d.ts +11 -0
- package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
- package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
- package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
- package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
- package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
- package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
- package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
- package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
- package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
- package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
- package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
- package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
- package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
- package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
- package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
- package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
- package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
- package/dist/host/types/src/ui/components/input.d.ts +3 -0
- package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
- package/dist/host/types/src/ui/components/label.d.ts +4 -0
- package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
- package/dist/host/types/src/ui/components/meter.d.ts +14 -0
- package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
- package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
- package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
- package/dist/host/types/src/ui/components/popover.d.ts +7 -0
- package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
- package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
- package/dist/host/types/src/ui/components/select.d.ts +15 -0
- package/dist/host/types/src/ui/components/select2.d.ts +8 -0
- package/dist/host/types/src/ui/components/separator.d.ts +4 -0
- package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
- package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
- package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
- package/dist/host/types/src/ui/components/slider.d.ts +4 -0
- package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
- package/dist/host/types/src/ui/components/switch.d.ts +4 -0
- package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
- package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
- package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
- package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
- package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
- package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
- package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
- package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
- package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
- package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
- package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
- package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
- package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
- package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
- package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
- package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
- package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
- package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
- package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
- package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
- package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
- package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
- package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
- package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
- package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
- package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
- package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
- package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
- package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
- package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
- package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
- package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
- package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
- package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
- package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
- package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
- package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
- package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
- package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
- package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
- package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
- package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
- package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
- package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
- package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
- package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
- package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
- package/dist/host/types/src/ui/main-axios.d.ts +170 -0
- package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
- package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
- package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
- package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
- package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
- package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
- package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
- package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
- package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
- package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
- package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
- package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
- package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
- package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
- package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
- package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
- package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
- package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
- package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
- package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
- package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
- package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
- package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
- package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
- package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
- package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
- package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
- package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
- package/dist/host/ui.d.ts +1 -0
- package/dist/host/ui.js +31754 -0
- package/dist/host/use-permissions-NULZL43J.js +18 -0
- package/dist/host-commands.d.ts +89 -0
- package/dist/host-commands.js +387 -0
- package/dist/manifest.d.ts +461 -0
- package/dist/manifest.js +1499 -0
- package/dist/settings.d.ts +43 -0
- package/dist/settings.js +168 -0
- package/dist/ssh-certs.d.ts +25 -0
- package/dist/ssh-certs.js +234 -0
- package/dist/ssh-options.d.ts +23 -0
- package/dist/ssh-options.js +1 -0
- package/dist/table-builder.d.ts +26 -0
- package/dist/table-builder.js +87 -0
- package/dist/testing/safe-ports.d.ts +10 -0
- package/dist/testing/safe-ports.js +59 -0
- package/dist/testing/setup.d.ts +7 -0
- package/dist/testing/setup.js +146 -0
- package/dist/testing.d.ts +537 -0
- package/dist/testing.js +1451 -0
- package/dist/vitest-preset.d.ts +54 -0
- package/dist/vitest-preset.js +96 -0
- package/package.json +143 -0
- package/schema/changelog.schema.json +67 -0
- package/schema/manifest.schema.json +1160 -0
- package/tsconfig.plugin.json +31 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vitest config every plugin uses.
|
|
3
|
+
*
|
|
4
|
+
* A plugin's vitest.config.ts is one line:
|
|
5
|
+
*
|
|
6
|
+
* import { pluginVitestConfig } from "@termix-ssh/plugin-sdk/vitest-preset";
|
|
7
|
+
* export default pluginVitestConfig(import.meta.url);
|
|
8
|
+
*
|
|
9
|
+
* Two projects: tests/backend runs in node, tests/frontend in jsdom.
|
|
10
|
+
*/
|
|
11
|
+
export interface PluginVitestOptions {
|
|
12
|
+
/** Extra aliases merged over the defaults. */
|
|
13
|
+
alias?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export declare function pluginVitestConfig(configUrl: string, options?: PluginVitestOptions): {
|
|
16
|
+
resolve: {
|
|
17
|
+
alias: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
test: {
|
|
20
|
+
globals: boolean;
|
|
21
|
+
setupFiles: string[];
|
|
22
|
+
projects: ({
|
|
23
|
+
resolve: {
|
|
24
|
+
alias: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
test: {
|
|
27
|
+
name: string;
|
|
28
|
+
root: string;
|
|
29
|
+
environment: string;
|
|
30
|
+
globals: boolean;
|
|
31
|
+
setupFiles: string[];
|
|
32
|
+
include: string[];
|
|
33
|
+
server?: undefined;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
resolve: {
|
|
37
|
+
alias: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
test: {
|
|
40
|
+
name: string;
|
|
41
|
+
root: string;
|
|
42
|
+
environment: string;
|
|
43
|
+
globals: boolean;
|
|
44
|
+
setupFiles: string[];
|
|
45
|
+
server: {
|
|
46
|
+
deps: {
|
|
47
|
+
inline: RegExp[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
include: string[];
|
|
51
|
+
};
|
|
52
|
+
})[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vitest config every plugin uses.
|
|
3
|
+
*
|
|
4
|
+
* A plugin's vitest.config.ts is one line:
|
|
5
|
+
*
|
|
6
|
+
* import { pluginVitestConfig } from "@termix-ssh/plugin-sdk/vitest-preset";
|
|
7
|
+
* export default pluginVitestConfig(import.meta.url);
|
|
8
|
+
*
|
|
9
|
+
* Two projects: tests/backend runs in node, tests/frontend in jsdom.
|
|
10
|
+
*/
|
|
11
|
+
import fs from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
/**
|
|
15
|
+
* Walks up from a plugin directory to a Termix checkout, if it is in one.
|
|
16
|
+
*
|
|
17
|
+
* Inside the repo the SDK's browser entries and the test host resolve to
|
|
18
|
+
* core's source, so a test exercises the real registries. Outside it they
|
|
19
|
+
* resolve to the builds the SDK ships in dist/host.
|
|
20
|
+
*/
|
|
21
|
+
function findRepoRoot(startDir) {
|
|
22
|
+
let dir = startDir;
|
|
23
|
+
for (;;) {
|
|
24
|
+
if (fs.existsSync(path.join(dir, "src", "ui")))
|
|
25
|
+
return dir;
|
|
26
|
+
const parent = path.dirname(dir);
|
|
27
|
+
if (parent === dir)
|
|
28
|
+
return null;
|
|
29
|
+
dir = parent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function pluginVitestConfig(configUrl, options = {}) {
|
|
33
|
+
const pluginDir = path.dirname(fileURLToPath(configUrl));
|
|
34
|
+
const manifestPath = path.join(pluginDir, "manifest.json");
|
|
35
|
+
const pluginId = (fs.existsSync(manifestPath) &&
|
|
36
|
+
JSON.parse(fs.readFileSync(manifestPath, "utf8")).id) ||
|
|
37
|
+
path.basename(pluginDir);
|
|
38
|
+
const setupFile = fileURLToPath(new URL("./testing/setup.js", import.meta.url));
|
|
39
|
+
const repoRoot = findRepoRoot(pluginDir);
|
|
40
|
+
// Inside a Termix checkout the SDK's browser entries resolve to source and
|
|
41
|
+
// the test host is core's, so renderWithApp exercises the real registries
|
|
42
|
+
// and the plugin shares one SDK instance with them.
|
|
43
|
+
const alias = {
|
|
44
|
+
...(repoRoot
|
|
45
|
+
? {
|
|
46
|
+
"@termix-ssh/plugin-sdk/frontend": path.join(repoRoot, "packages", "plugin-sdk", "src", "frontend.ts"),
|
|
47
|
+
"@termix-ssh/plugin-sdk/ui": path.join(repoRoot, "src", "ui", "plugin-host", "sdk-ui.ts"),
|
|
48
|
+
"@termix-ssh/plugin-host/testing": path.join(repoRoot, "src", "ui", "plugin-host", "testing-host.tsx"),
|
|
49
|
+
// Core's own modules behind sdk-ui and the test host import each
|
|
50
|
+
// other this way. Plugin code may not (eslint refuses it).
|
|
51
|
+
"@/types": path.join(repoRoot, "src", "types"),
|
|
52
|
+
"@": path.join(repoRoot, "src", "ui"),
|
|
53
|
+
}
|
|
54
|
+
: {
|
|
55
|
+
// Outside a Termix checkout: the UI kit resolves through the
|
|
56
|
+
// package, and the test host is the copy the SDK ships.
|
|
57
|
+
"@termix-ssh/plugin-host/testing": fileURLToPath(new URL("./host/testing-host.js", import.meta.url)),
|
|
58
|
+
}),
|
|
59
|
+
...options.alias,
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
resolve: { alias },
|
|
63
|
+
test: {
|
|
64
|
+
globals: true,
|
|
65
|
+
setupFiles: [setupFile],
|
|
66
|
+
projects: [
|
|
67
|
+
{
|
|
68
|
+
resolve: { alias },
|
|
69
|
+
test: {
|
|
70
|
+
name: `${pluginId}:backend`,
|
|
71
|
+
root: pluginDir,
|
|
72
|
+
environment: "node",
|
|
73
|
+
globals: true,
|
|
74
|
+
setupFiles: [setupFile],
|
|
75
|
+
include: ["tests/backend/**/*.test.ts"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
resolve: { alias },
|
|
80
|
+
test: {
|
|
81
|
+
name: `${pluginId}:frontend`,
|
|
82
|
+
root: pluginDir,
|
|
83
|
+
environment: "jsdom",
|
|
84
|
+
globals: true,
|
|
85
|
+
setupFiles: [setupFile],
|
|
86
|
+
// Run the SDK through Vite rather than plain Node, so its import
|
|
87
|
+
// of the test host sees the alias above and the plugin and the
|
|
88
|
+
// host share one copy of @termix-ssh/plugin-sdk/frontend.
|
|
89
|
+
server: { deps: { inline: [/@termix-ssh\/plugin-sdk/] } },
|
|
90
|
+
include: ["tests/frontend/**/*.test.{ts,tsx}"],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@termix-ssh/plugin-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The contract between Termix core and a plugin: types, the capability catalog and the manifest schema.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Termix-SSH/Termix.git",
|
|
9
|
+
"directory": "packages/plugin-sdk"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Termix-SSH/Termix/tree/main/packages/plugin-sdk#readme",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=22"
|
|
15
|
+
},
|
|
16
|
+
"bin": {
|
|
17
|
+
"termix-plugin": "./cli/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
"./backend": {
|
|
21
|
+
"types": "./dist/backend.d.ts",
|
|
22
|
+
"default": "./dist/backend.js"
|
|
23
|
+
},
|
|
24
|
+
"./db": {
|
|
25
|
+
"types": "./dist/db.d.ts",
|
|
26
|
+
"default": "./dist/db.js"
|
|
27
|
+
},
|
|
28
|
+
"./ddl": {
|
|
29
|
+
"types": "./dist/ddl.d.ts",
|
|
30
|
+
"default": "./dist/ddl.js"
|
|
31
|
+
},
|
|
32
|
+
"./table-builder": {
|
|
33
|
+
"types": "./dist/table-builder.d.ts",
|
|
34
|
+
"default": "./dist/table-builder.js"
|
|
35
|
+
},
|
|
36
|
+
"./frontend": {
|
|
37
|
+
"types": "./dist/frontend.d.ts",
|
|
38
|
+
"default": "./dist/frontend.js"
|
|
39
|
+
},
|
|
40
|
+
"./desktop": {
|
|
41
|
+
"types": "./dist/desktop.d.ts",
|
|
42
|
+
"default": "./dist/desktop.js"
|
|
43
|
+
},
|
|
44
|
+
"./manifest": {
|
|
45
|
+
"types": "./dist/manifest.d.ts",
|
|
46
|
+
"default": "./dist/manifest.js"
|
|
47
|
+
},
|
|
48
|
+
"./capabilities": {
|
|
49
|
+
"types": "./dist/capabilities.d.ts",
|
|
50
|
+
"default": "./dist/capabilities.js"
|
|
51
|
+
},
|
|
52
|
+
"./settings": {
|
|
53
|
+
"types": "./dist/settings.d.ts",
|
|
54
|
+
"default": "./dist/settings.js"
|
|
55
|
+
},
|
|
56
|
+
"./testing": {
|
|
57
|
+
"types": "./dist/testing.d.ts",
|
|
58
|
+
"default": "./dist/testing.js"
|
|
59
|
+
},
|
|
60
|
+
"./testing/setup": {
|
|
61
|
+
"types": "./dist/testing/setup.d.ts",
|
|
62
|
+
"default": "./dist/testing/setup.js"
|
|
63
|
+
},
|
|
64
|
+
"./vitest-preset": {
|
|
65
|
+
"types": "./dist/vitest-preset.d.ts",
|
|
66
|
+
"default": "./dist/vitest-preset.js"
|
|
67
|
+
},
|
|
68
|
+
"./host-commands": {
|
|
69
|
+
"types": "./dist/host-commands.d.ts",
|
|
70
|
+
"default": "./dist/host-commands.js"
|
|
71
|
+
},
|
|
72
|
+
"./ssh-certs": {
|
|
73
|
+
"types": "./dist/ssh-certs.d.ts",
|
|
74
|
+
"default": "./dist/ssh-certs.js"
|
|
75
|
+
},
|
|
76
|
+
"./tsconfig.plugin.json": "./tsconfig.plugin.json",
|
|
77
|
+
"./schema/manifest.schema.json": "./schema/manifest.schema.json",
|
|
78
|
+
"./schema/changelog.schema.json": "./schema/changelog.schema.json",
|
|
79
|
+
"./ui": {
|
|
80
|
+
"types": "./dist/host/ui.d.ts",
|
|
81
|
+
"default": "./dist/host/ui.js"
|
|
82
|
+
},
|
|
83
|
+
"./testing-host": {
|
|
84
|
+
"default": "./dist/host/testing-host.js"
|
|
85
|
+
},
|
|
86
|
+
"./theme.css": "./dist/host/theme.css"
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"dist",
|
|
90
|
+
"cli",
|
|
91
|
+
"schema",
|
|
92
|
+
"tsconfig.plugin.json",
|
|
93
|
+
"README.md",
|
|
94
|
+
"client.d.ts"
|
|
95
|
+
],
|
|
96
|
+
"scripts": {
|
|
97
|
+
"build": "tsc -p tsconfig.json",
|
|
98
|
+
"prepublishOnly": "npm run build"
|
|
99
|
+
},
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"@tailwindcss/node": "^4.2.4",
|
|
102
|
+
"@tailwindcss/oxide": "^4.2.4",
|
|
103
|
+
"esbuild": "^0.28.1",
|
|
104
|
+
"semver": "^7.6.3",
|
|
105
|
+
"tailwindcss": "^4.2.4",
|
|
106
|
+
"tar": "^7.5.22"
|
|
107
|
+
},
|
|
108
|
+
"peerDependencies": {
|
|
109
|
+
"@testing-library/react": "^16.3.3",
|
|
110
|
+
"better-sqlite3": "*",
|
|
111
|
+
"drizzle-orm": "*",
|
|
112
|
+
"i18next": "^26.4.2",
|
|
113
|
+
"react": "*",
|
|
114
|
+
"react-dom": "^19.2.8",
|
|
115
|
+
"react-i18next": "^17.0.14",
|
|
116
|
+
"sonner": "^2.0.8",
|
|
117
|
+
"ssh2": "*",
|
|
118
|
+
"vitest": "*"
|
|
119
|
+
},
|
|
120
|
+
"peerDependenciesMeta": {
|
|
121
|
+
"drizzle-orm": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"ssh2": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"better-sqlite3": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"react": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"vitest": {
|
|
134
|
+
"optional": true
|
|
135
|
+
},
|
|
136
|
+
"@testing-library/react": {
|
|
137
|
+
"optional": true
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"publishConfig": {
|
|
141
|
+
"access": "public"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/Termix-SSH/Termix/main/packages/plugin-sdk/schema/changelog.schema.json",
|
|
4
|
+
"title": "Termix plugin changelog",
|
|
5
|
+
"description": "Every release of a plugin, newest first. The newest release must match the manifest version.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["releases"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": { "type": "string" },
|
|
11
|
+
"unreleased": {
|
|
12
|
+
"description": "Changes that are merged but not released yet.",
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": { "$ref": "#/$defs/change" }
|
|
15
|
+
},
|
|
16
|
+
"releases": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"minItems": 1,
|
|
19
|
+
"items": { "$ref": "#/$defs/release" }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"$defs": {
|
|
23
|
+
"release": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["version", "changes"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"version": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
|
|
31
|
+
},
|
|
32
|
+
"date": {
|
|
33
|
+
"description": "When the version was released. Leave it out until it ships.",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
|
|
36
|
+
},
|
|
37
|
+
"notes": {
|
|
38
|
+
"description": "A short line shown above the list of changes.",
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"changes": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"minItems": 1,
|
|
44
|
+
"items": { "$ref": "#/$defs/change" }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"change": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": false,
|
|
51
|
+
"required": ["type", "text"],
|
|
52
|
+
"properties": {
|
|
53
|
+
"type": {
|
|
54
|
+
"enum": [
|
|
55
|
+
"added",
|
|
56
|
+
"changed",
|
|
57
|
+
"fixed",
|
|
58
|
+
"removed",
|
|
59
|
+
"deprecated",
|
|
60
|
+
"security"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"text": { "type": "string", "minLength": 1 }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|