Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

maintenance.ts

39 lines1.4 KB

1import type { ProviderDriverKind } from "@t3tools/contracts";
2import type * as Effect from "effect/Effect";
3​
4export interface ProviderMaintenanceCapabilities {
5 readonly provider: ProviderDriverKind;
6 readonly packageName: string | null;
7 readonly update: ProviderMaintenanceCommandAction | null;
8 /**
9 * `undefined` means the installer has no channel of its own and the npm
10 * registry entry for `packageName` is authoritative; `null` means the
11 * installer was asked and did not know.
12 */
13 readonly latestVersion?: string | null;
14 /**
15 * Deferred until update checks are enabled; `null` falls back to
16 * `latestVersion`, then npm.
17 */
18 readonly lookupLatestVersion?: Effect.Effect<string | null>;
19 readonly compareVersions?: (current: string, latest: string) => number;
20 /**
21 * The executable T3 Code runs, symlinks followed, when no update command is
22 * proven for it. The version advisory names it so the user knows which
23 * install to update.
24 */
25 readonly installPath?: string;
27​
28export interface ProviderMaintenanceCommandAction {
29 readonly command: string;
30 readonly executable: string;
31 readonly args: ReadonlyArray<string>;
32 readonly lockKey: string;
33 /**
34 * A native updater finds its install through the same variables the
35 * provider runs with (e.g. `CODEX_HOME`), so an instance with a custom home
36 * must update that home and not the default one.
37 */
38 readonly env?: NodeJS.ProcessEnv;