import "nostics"; //#region ../internal/dist/host-credentials-NQkTpoab.d.ts //#region src/host-credentials.d.ts type CredentialHost = "cloudflare" | "vercel" | "netlify" | "deno"; type CredentialSource = "env" | "host-cli"; type HostCredentials = { ok: true; host: CredentialHost; source: CredentialSource; token: string; accountId?: string; teamId?: string; } | { ok: false; host: CredentialHost; missing: readonly string[]; fix: string; }; /** Credential status without the token, safe for `status` and JSON output. */ type HostCredentialsDescription = { ok: true; host: CredentialHost; source: CredentialSource; accountId?: string; teamId?: string; } | { ok: false; host: CredentialHost; missing: readonly string[]; fix: string; }; interface HostCliRunResult { exitCode: number | null; stdout: string; stderr?: string; } /** Runs a host CLI with an argument array and no shell, and returns its stdout. */ type HostCliRun = (command: string, args: readonly string[], options: { cwd?: string; env: NodeJS.ProcessEnv; signal?: AbortSignal; }) => Promise; //#endregion //#region ../internal/dist/provision-k67k9T1h.d.ts //#region src/provision.d.ts type ProvisionProvider = "cloudflare" | "vercel"; interface ProvisionLogger { log: (message: string) => void; warn: (message: string) => void; } interface ProvisionContext { env: Record; fetch: typeof globalThis.fetch; logger: ProvisionLogger; markPlanUnchecked?: () => void; } interface ProvisionState { cloudflare?: Record>; vercel?: Record>; } interface ProvisionResult { ids?: ProvisionState; } interface ProvisionAction { kind: string; name: string; exists: boolean; pending?: boolean; /** Describes the change that `apply()` makes to an existing resource, for example `read replication: disabled -> auto`. */ update?: string; apply: () => Promise; } /** One Provision State category that a step records, with the keys that current Definitions use. */ interface ProvisionStateCategory { category: string; declared: readonly string[]; /** Provider resource identity for shared-resource checks. Return undefined when the recorded id lacks enough information. Defaults to the recorded id. */ resourceIdentity?: (entry: { id: string; key: string; }) => string | undefined; /** Identity expected by current config for a declared key. Omit when it cannot be established without provider access. */ declaredResourceIdentity?: (key: string) => string | undefined; /** Tells a developer how to delete the resource of a recorded entry that no Definition declares. ViteHub never runs it. */ deleteHint: (entry: { id: string; key: string; }) => string; } interface ProvisionStep { id: string; provider: ProvisionProvider; plan: (context: ProvisionContext) => Promise; /** Describes the Provision State this step records. Runs without network access, also without credentials. */ recordedState?: (context: Pick) => ProvisionStateCategory[]; } //#endregion //#region ../internal/dist/cli.d.ts interface ViteHubCliStreams { stderr: { write: (chunk: string | Uint8Array, encoding?: BufferEncoding | StdoutWriteCallback, callback?: StdoutWriteCallback) => unknown; }; stdout: { write: (chunk: string | Uint8Array) => unknown; }; } interface ViteHubCliSpawnResult { exitCode: number | null; signal?: NodeJS.Signals | null; /** The output of the child when `stdout` is `pipe`. */ stdout?: string; } interface ViteHubCliSpawnOptions { cwd?: string; env?: NodeJS.ProcessEnv; stderr?: "inherit" | "pipe"; /** `ignore` gives the child no terminal input, so a tool that asks questions on a terminal does not ask. */ stdin?: "ignore" | "inherit"; /** `stderr` sends the child's stdout to the parent's stderr, so the parent's stdout keeps only its own output. */ stdout?: "inherit" | "pipe" | "stderr"; } type ViteHubCliSpawn = (command: string, args: string[], options?: ViteHubCliSpawnOptions) => Promise; interface ViteHubCliContext extends ViteHubCliStreams { cwd: string; env: NodeJS.ProcessEnv; /** Replaces `fetch` for commands that call a running app, so tests need no server. */ fetch?: typeof fetch; /** * Loads the project config for a build on `host` and returns the Provision Steps of its plugins, with the config root * that holds `.vitehub/provision.json`. Setup commands, such as `vitehub deploy`, call it only when they need the * steps, so they still run on a config that throws. */ loadProvision?: (host: ProvisionProvider) => Promise; /** The deployed app's public origin from `vitehub({ publicUrl })`, when it is one string. */ publicUrl?: string; rootDir: string; /** Replaces the host CLI runner, such as for `wrangler auth token`, so tests need no real host CLI. */ runHostCli?: HostCliRun; spawn: ViteHubCliSpawn; } interface ViteHubCliProvision { rootDir: string; steps: readonly ProvisionStep[]; } interface ViteHubCliFeature { description?: string; name: string; run: (args: string[], context: ViteHubCliContext) => Promise | number | void; usage?: string; } /** * A top-level command, such as `vitehub status`. It runs before the CLI loads the project config, with `rootDir` set to * the working directory, so it works in an empty directory and on a project whose config throws. */ interface ViteHubCliCommand { name: string; description: string; usage: string; run: (args: string[], context: ViteHubCliContext) => Promise; } interface ViteHubCliCommandNamespace { /** The feature that `vitehub ` runs when the next argument names no other feature. It gets every argument after ``. */ defaultFeature?: string; description?: string; features: ViteHubCliFeature[]; name: string; } type StdoutWriteCallback = (error?: Error | null) => void; //#endregion export { ProvisionProvider as a, HostCliRun as c, ViteHubCliProvision as i, HostCredentials as l, ViteHubCliCommandNamespace as n, CredentialHost as o, ViteHubCliContext as r, CredentialSource as s, ViteHubCliCommand as t, HostCredentialsDescription as u };