mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
chore: rename the plugin sdk to @termix-ssh/plugin-sdk
This commit is contained in:
1 parent
0c4f673318
commit
e608505b39
132 files changed
+250
-1336
No files matched your search
@@ -213,7 +213,7 @@ export interface ShellApi {
|
||||
/**
|
||||
* Asks a yes or no question over the main area, for code that runs outside
|
||||
* a panel or tab (a keybinding, a toolbar action). Inside one, prefer
|
||||
* useConfirm from @termix/plugin-sdk/ui, which asks over that surface.
|
||||
* useConfirm from @termix-ssh/plugin-sdk/ui, which asks over that surface.
|
||||
*/
|
||||
confirm?: (options: ConfirmRequest) => Promise<boolean>;
|
||||
}
|
||||
@@ -897,7 +897,7 @@ export interface TermixApp extends TermixAppInfo {
|
||||
invokeAction: (id: string, ...args: unknown[]) => Promise<unknown>;
|
||||
/**
|
||||
* Offers a component to other plugins and to core by id, rendered where
|
||||
* they choose with `PluginComponent` from @termix/plugin-sdk/ui or
|
||||
* they choose with `PluginComponent` from @termix-ssh/plugin-sdk/ui or
|
||||
* `usePluginComponent`. The id should start with a name the plugin owns
|
||||
* ("terminal.view"). The props are the owner's contract; document them.
|
||||
*/
|
||||
@@ -941,7 +941,7 @@ export interface TermixApp extends TermixAppInfo {
|
||||
tabs: TabsApi;
|
||||
/**
|
||||
* Asks a yes or no question over the main area. For code that runs outside
|
||||
* a panel or tab; inside one, useConfirm from @termix/plugin-sdk/ui asks
|
||||
* a panel or tab; inside one, useConfirm from @termix-ssh/plugin-sdk/ui asks
|
||||
* over that surface instead.
|
||||
*/
|
||||
confirm: (options: ConfirmRequest) => Promise<boolean>;
|
||||
@@ -1190,7 +1190,7 @@ let host: PluginHostBridge | null = null;
|
||||
export function __setPluginHost(bridge: PluginHostBridge | null): void {
|
||||
if (host && bridge !== host) {
|
||||
throw new Error(
|
||||
"@termix/plugin-sdk/frontend: the plugin host is already set",
|
||||
"@termix-ssh/plugin-sdk/frontend: the plugin host is already set",
|
||||
);
|
||||
}
|
||||
host = bridge;
|
||||
@@ -1209,7 +1209,7 @@ function requireHost(): PluginHostBridge {
|
||||
if (!host && fallback) return fallback;
|
||||
if (!host) {
|
||||
throw new Error(
|
||||
"@termix/plugin-sdk/frontend: no plugin host. Hooks only work inside Termix or renderWithApp().",
|
||||
"@termix-ssh/plugin-sdk/frontend: no plugin host. Hooks only work inside Termix or renderWithApp().",
|
||||
);
|
||||
}
|
||||
return host;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* real runtime does. createFakeContext stays for tests that only need a
|
||||
* context-shaped object and do not care about the gates.
|
||||
*
|
||||
* The vitest config these run under comes from @termix/plugin-sdk/vitest-preset.
|
||||
* The vitest config these run under comes from @termix-ssh/plugin-sdk/vitest-preset.
|
||||
*/
|
||||
|
||||
import {
|
||||
@@ -2080,7 +2080,7 @@ export async function createTestDb(
|
||||
* so a test sees exactly what the shell would: which rail items, tabs, host
|
||||
* actions and cards it registered, and each of those rendered with the SDK
|
||||
* hooks working. It is implemented by the Termix host, which is where the
|
||||
* registries live; the vitest preset points "@termix/plugin-host/testing" at
|
||||
* registries live; the vitest preset points "@termix-ssh/plugin-host/testing" at
|
||||
* core's implementation.
|
||||
*/
|
||||
export interface RenderWithAppOptions {
|
||||
@@ -2205,7 +2205,7 @@ interface PluginTestHost {
|
||||
) => Promise<RenderedPluginApp>;
|
||||
}
|
||||
|
||||
const TEST_HOST = "@termix/plugin-host/testing";
|
||||
const TEST_HOST = "@termix-ssh/plugin-host/testing";
|
||||
|
||||
export async function renderWithApp(
|
||||
plugin: FrontendPluginModule,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* A plugin's vitest.config.ts is one line:
|
||||
*
|
||||
* import { pluginVitestConfig } from "@termix/plugin-sdk/vitest-preset";
|
||||
* import { pluginVitestConfig } from "@termix-ssh/plugin-sdk/vitest-preset";
|
||||
* export default pluginVitestConfig(import.meta.url);
|
||||
*
|
||||
* Two projects: tests/backend runs in node, tests/frontend in jsdom.
|
||||
@@ -56,21 +56,21 @@ export function pluginVitestConfig(
|
||||
const alias: Record<string, string> = {
|
||||
...(repoRoot
|
||||
? {
|
||||
"@termix/plugin-sdk/frontend": path.join(
|
||||
"@termix-ssh/plugin-sdk/frontend": path.join(
|
||||
repoRoot,
|
||||
"packages",
|
||||
"plugin-sdk",
|
||||
"src",
|
||||
"frontend.ts",
|
||||
),
|
||||
"@termix/plugin-sdk/ui": path.join(
|
||||
"@termix-ssh/plugin-sdk/ui": path.join(
|
||||
repoRoot,
|
||||
"src",
|
||||
"ui",
|
||||
"plugin-host",
|
||||
"sdk-ui.ts",
|
||||
),
|
||||
"@termix/plugin-host/testing": path.join(
|
||||
"@termix-ssh/plugin-host/testing": path.join(
|
||||
repoRoot,
|
||||
"src",
|
||||
"ui",
|
||||
@@ -85,7 +85,7 @@ export function pluginVitestConfig(
|
||||
: {
|
||||
// Outside a Termix checkout: the UI kit resolves through the
|
||||
// package, and the test host is the copy the SDK ships.
|
||||
"@termix/plugin-host/testing": fileURLToPath(
|
||||
"@termix-ssh/plugin-host/testing": fileURLToPath(
|
||||
new URL("./host/testing-host.js", import.meta.url),
|
||||
),
|
||||
}),
|
||||
@@ -119,8 +119,8 @@ export function pluginVitestConfig(
|
||||
setupFiles: [setupFile],
|
||||
// Run the SDK through Vite rather than plain Node, so its import
|
||||
// of the test host sees the alias above and the plugin and the
|
||||
// host share one copy of @termix/plugin-sdk/frontend.
|
||||
server: { deps: { inline: [/@termix\/plugin-sdk/] } },
|
||||
// host share one copy of @termix-ssh/plugin-sdk/frontend.
|
||||
server: { deps: { inline: [/@termix-ssh\/plugin-sdk/] } },
|
||||
include: ["tests/frontend/**/*.test.{ts,tsx}"],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user