@vite-hub/cli 0.5.0 → 0.5.1

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.
@@ -1,6 +1,4 @@
1
- import { l as HostCredentials, o as CredentialHost, r as ViteHubCliContext, s as CredentialSource, t as ViteHubCliCommand, u as HostCredentialsDescription } from "../provision-bhi-xnCG.js";
2
- //#region ../internal/dist/config-edit.d.ts
3
- //#region src/config-edit.d.ts
1
+ import { l as HostCredentials, o as CredentialHost, r as ViteHubCliContext, s as CredentialSource, t as ViteHubCliCommand, u as HostCredentialsDescription } from "../provision-kiD8Emd7.js";
4
2
  type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
5
3
  readonly [key: string]: JsonValue;
6
4
  };
@@ -38,15 +36,9 @@ type LocateResult = {
38
36
  reason: ManualReason;
39
37
  line?: number;
40
38
  };
41
- //#endregion
42
- //#region ../internal/dist/deployment.d.ts
43
- //#region src/deployment.d.ts
44
39
  /** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
45
40
  type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
46
41
  type DeploymentService = "blob" | "browser" | "queue" | "rateLimit" | "realtime" | "sandbox";
47
- //#endregion
48
- //#region ../internal/dist/features.d.ts
49
- //#region src/features.d.ts
50
42
  /**
51
43
  * The feature keys of `vitehub({...})`. `vitehub add <feature>` and `vitehub status` read this list before the owner
52
44
  * package of a feature is installed, so the catalog is plain data with no owner imports.
@@ -141,8 +133,6 @@ interface FeatureDefinition<TId extends FeatureId = FeatureId> {
141
133
  /** Hosts that use `hosts.dev` during development instead of their deployment entry. Node always uses `hosts.dev`. */
142
134
  developmentOverrides?: readonly ViteHubHost[];
143
135
  }
144
- //#endregion
145
- //#region src/setup/project.d.ts
146
136
  type SetupFramework = "vite" | "nuxt" | "none";
147
137
  type SetupPackageManager = "pnpm" | "npm" | "yarn" | "bun";
148
138
  interface SetupProject {
@@ -169,8 +159,6 @@ interface SetupProject {
169
159
  * Throws `SETUP_NOT_A_PROJECT` when `root` has no package.json and no Vite or Nuxt config.
170
160
  */
171
161
  export declare function readSetupProject(root: string, env: NodeJS.ProcessEnv): Promise<SetupProject>;
172
- //#endregion
173
- //#region src/setup/status.d.ts
174
162
  interface SetupFeatureStatus {
175
163
  id: FeatureId;
176
164
  enabled: "on" | "off" | "unknown";
@@ -206,8 +194,6 @@ interface SetupStatus {
206
194
  }
207
195
  /** What the project enables, on which host, and what each enabled feature still needs. Reads the config without running it. */
208
196
  export declare function setupStatus(project: SetupProject, env: NodeJS.ProcessEnv, withoutDefinitions?: ReadonlySet<FeatureId>): SetupStatus;
209
- //#endregion
210
- //#region src/setup/add.d.ts
211
197
  interface SetupAddArgs {
212
198
  features: FeatureId[];
213
199
  json: boolean;
@@ -274,8 +260,6 @@ export declare function planSetupAdd(project: SetupProject, args: SetupAddArgs,
274
260
  /** Applies a `vitehub add` plan: installs the packages, writes the starter Definitions, and writes the config last. */
275
261
  export declare function applySetupAdd(project: SetupProject, planned: SetupAddPlanned, args: Pick<SetupAddArgs, "install">, context: Pick<ViteHubCliContext, "env" | "spawn">): Promise<void>;
276
262
  export declare const addCommand: ViteHubCliCommand;
277
- //#endregion
278
- //#region src/setup/catalog.d.ts
279
263
  interface SetupCatalog {
280
264
  schemaVersion: 1;
281
265
  hosts: readonly FeatureHost[];
@@ -283,12 +267,8 @@ interface SetupCatalog {
283
267
  }
284
268
  /** Every feature of `vitehub({...})` and how each host supports it. Needs no project. */
285
269
  export declare function setupCatalog(): SetupCatalog;
286
- //#endregion
287
- //#region src/setup/commands.d.ts
288
270
  /** The setup commands. They run before the CLI loads the project config. */
289
271
  export declare const setupCommands: readonly ViteHubCliCommand[];
290
- //#endregion
291
- //#region src/setup/console-auth.d.ts
292
272
  /** The hosted Console. `--console` and `VITEHUB_CONSOLE_URL` name a self-hosted one. */
293
273
  export declare const defaultConsoleUrl = "https://console.vitehub.dev";
294
274
  /** An API key for CI. It wins over the saved key, and `vitehub logout` does not remove it. */
@@ -328,8 +308,6 @@ export declare function readConsoleCredential(env: NodeJS.ProcessEnv, console?:
328
308
  export declare const loginCommand: ViteHubCliCommand;
329
309
  export declare const whoamiCommand: ViteHubCliCommand;
330
310
  export declare const logoutCommand: ViteHubCliCommand;
331
- //#endregion
332
- //#region src/setup/envelope.d.ts
333
311
  /** Exit codes of the setup commands. */
334
312
  export declare const setupExitCodes: {
335
313
  readonly done: 0;
@@ -367,8 +345,6 @@ type SetupFailure = Error & {
367
345
  readonly details: SetupFailureDetails;
368
346
  readonly exitCode: number;
369
347
  };
370
- //#endregion
371
- //#region src/setup/link.d.ts
372
348
  /** The link file, relative to the project root. It is gitignored and never holds a secret. */
373
349
  export declare const SETUP_LINK_FILE = ".vitehub/link.json";
374
350
  type SetupLinkHost = CredentialHost;
@@ -473,8 +449,6 @@ export declare function readSetupLinkState(project: SetupProject, host: string,
473
449
  }): Promise<SetupLinkState>;
474
450
  /** The link and the credential status for `vitehub status`. The credentials never include the token. */
475
451
  export declare function readSetupLinkStatus(project: SetupProject, host: string, context: ViteHubCliContext): Promise<SetupLinkStatus>;
476
- //#endregion
477
- //#region src/setup/deploy/host.d.ts
478
452
  /** The hosts that `vitehub deploy` deploys to. */
479
453
  type DeployHost = "cloudflare" | "vercel" | "netlify" | "deno";
480
454
  /** The git commit of the deployed source. A folder without git has none. */
@@ -505,8 +479,6 @@ interface HostDeployment {
505
479
  };
506
480
  source: HostDeploymentSource;
507
481
  }
508
- //#endregion
509
- //#region src/setup/deploy/after.d.ts
510
482
  /** One path of `deploy.check`, as the deployed app answered it. */
511
483
  interface DeployCheckResult {
512
484
  path: string;
@@ -537,8 +509,6 @@ type DeployIndexNowOutput = {
537
509
  error: string;
538
510
  status?: number;
539
511
  };
540
- //#endregion
541
- //#region src/setup/deploy/checkouts.d.ts
542
512
  /** What `pushWorkspaces()` returns for one checkout folder, the same as `vitehub push --json`. */
543
513
  interface CheckoutPushResult {
544
514
  workspace: string;
@@ -573,8 +543,6 @@ type DeployCheckoutsOutput = {
573
543
  } | {
574
544
  error: CheckoutPushError;
575
545
  };
576
- //#endregion
577
- //#region src/setup/env.d.ts
578
546
  /** One set of names that the app reads, without its values. */
579
547
  interface EnvDiffEntry {
580
548
  names: readonly string[];
@@ -596,11 +564,7 @@ interface DeployEnvOutput {
596
564
  /** Names that the deploy generated, such as `VITEHUB_SECRET`. They are in `pushed` too. */
597
565
  generated?: string[];
598
566
  }
599
- //#endregion
600
- //#region src/provision.d.ts
601
567
  type ProvisionActionStatus = "create" | "update" | "pending" | "exists";
602
- //#endregion
603
- //#region src/setup/deploy/provision.d.ts
604
568
  /** What `vitehub deploy --json` reports in `provision`. */
605
569
  interface DeployProvisionOutput {
606
570
  /** The resources that this deploy created or changed. Empty when everything existed. */
@@ -613,8 +577,6 @@ interface DeployProvisionOutput {
613
577
  /** The ids of the host resources, by category and key, as `.vitehub/provision.json` records them. */
614
578
  ids: Record<string, Record<string, string>>;
615
579
  }
616
- //#endregion
617
- //#region src/setup/deploy.d.ts
618
580
  interface SetupDeployArgs {
619
581
  /** The host of --host, as the user wrote it. */
620
582
  host?: string;
@@ -661,8 +623,6 @@ interface SetupDeployOutput {
661
623
  }
662
624
  export declare function readDeployArgs(args: readonly string[]): SetupDeployArgs;
663
625
  export declare const deployCommand: ViteHubCliCommand;
664
- //#endregion
665
- //#region src/setup/deployments.d.ts
666
626
  /** How long `vitehub status` waits for the host before it reports `liveReason: "timeout"`. */
667
627
  export declare const STATUS_HOST_TIMEOUT_MS = 5000;
668
628
  /** What `vitehub deployments --json` prints, after `schemaVersion: 1`. */
@@ -699,8 +659,6 @@ export declare function readSetupLive(root: string, link: SetupLink | undefined,
699
659
  offline: boolean;
700
660
  signal?: AbortSignal;
701
661
  }): Promise<SetupLiveStatus>;
702
- //#endregion
703
- //#region src/setup/stack.d.ts
704
662
  interface SetupStack {
705
663
  command: string | null;
706
664
  omits: readonly {
@@ -708,15 +666,13 @@ interface SetupStack {
708
666
  reason: "opaque-config" | "spread" | "expression" | "unresolved-host" | "unresolved-feature" | "disabled-feature" | "unsupported-feature" | "non-replayable-option" | "credential-option" | "required-option" | "unplannable-stack";
709
667
  }[];
710
668
  }
711
- //#endregion
712
- //#region src/setup/init.d.ts
713
669
  declare const initHosts: readonly ["cloudflare", "vercel", "netlify", "deno", "node"];
714
670
  type InitHost = typeof initHosts[number];
715
671
  type InitFramework = "vite" | "nuxt";
716
672
  /**
717
673
  * The packages of a new app, as `getting-started/installation.md` installs them. The Nitro and H3 versions match the
718
- * server integration of ViteHub. Nuxt 5 supplies Nitro 3, and its tutorials import H3 2. Valibot validates request
719
- * bodies in the docs' route examples.
674
+ * server integration of ViteHub. Nuxt 5 supplies Nitro 3, and a Nuxt 4.7 app also gets `nuxtNitroPackage`. The
675
+ * tutorials import H3 2. Valibot validates request bodies in the docs' route examples.
720
676
  */
721
677
  export declare const initPackages: Readonly<Record<InitFramework, {
722
678
  prod: readonly string[];
@@ -766,8 +722,6 @@ interface SetupInitPlan {
766
722
  /** Reads the arguments. Throws `CLI_R0003` for an unknown flag or value. */
767
723
  export declare function readInitArgs(args: readonly string[]): SetupInitArgs;
768
724
  export declare const initCommandDefinition: ViteHubCliCommand;
769
- //#endregion
770
- //#region src/setup/remove.d.ts
771
725
  interface SetupRemoveArgs {
772
726
  features: FeatureId[];
773
727
  json: boolean;
@@ -839,8 +793,6 @@ export declare function applySetupRemove(project: SetupProject, planned: Planned
839
793
  configLast?: boolean;
840
794
  }): Promise<void>;
841
795
  export declare const removeCommand: ViteHubCliCommand;
842
- //#endregion
843
- //#region src/setup/update.d.ts
844
796
  interface SetupUpdateArgs {
845
797
  dryRun: boolean;
846
798
  help: boolean;
@@ -885,8 +837,6 @@ interface PlannedUpdate {
885
837
  /** Plans the update: finds every ViteHub specifier, resolves the target, and computes the new files. Writes nothing. */
886
838
  export declare function planSetupUpdate(rootDir: string, args: Pick<SetupUpdateArgs, "preview">, context: Pick<ViteHubCliContext, "env" | "fetch">): Promise<PlannedUpdate>;
887
839
  export declare const updateCommand: ViteHubCliCommand;
888
- //#endregion
889
- //#region src/setup/session.d.ts
890
840
  /**
891
841
  * Runs the package manager with an argument array and no shell. `onOutput` gets its stdout and stderr as they arrive.
892
842
  * Tests pass a fake runner.
@@ -966,5 +916,4 @@ export declare function setupRequestArgs(request: unknown): {
966
916
  * `add`, and `remove` do, with the same documents, and keeps each plan until one `apply()` uses it.
967
917
  */
968
918
  export declare function createSetupSession(options: SetupSessionOptions): SetupSession;
969
- //#endregion
970
919
  export type { ConsoleCredential, DeployCommit, HostDeployment, HostDeploymentSource, PlannedRemove, SetupAddArgs, SetupAddPlan, SetupAddPlanned, SetupCatalog, SetupChange, SetupChoice, SetupCommandRunner, SetupDeployArgs, SetupDeployOutput, SetupDeploymentsOutput, SetupError, SetupFailure, SetupFailureDetails, SetupFeatureStatus, SetupFramework, SetupInitArgs, SetupInitPlan, SetupLink, SetupLinkAccount, SetupLinkFile, SetupLinkHost, SetupLinkOptions, SetupLinkResult, SetupLinkSelection, SetupLinkState, SetupLinkStatus, SetupLinkSummary, SetupLinkTarget, SetupLinks, SetupLive, SetupLiveReason, SetupLiveStatus, SetupMissing, SetupOptions, SetupPackageManager, SetupPlanRequest, SetupProject, SetupReference, SetupRemoveArgs, SetupRemovePlan, SetupRerun, SetupSession, SetupSessionOptions, SetupSessionPlanFields, SetupSessionResult, SetupStatus, SetupUpdateArgs, SetupUpdatePlan };
@@ -1,13 +1,13 @@
1
- import { m as cliErrorDiagnostics } from "../provision-DgT_lpyn.js";
2
- import { F as setupStatus, H as readSetupProject, I as shellQuote, c as linkSetupProject, d as readSetupLinkStatus, f as readSetupLinks, m as unlinkSetupProject, p as selectSetupLink, r as SETUP_LINK_FILE, u as readSetupLinkState } from "../env-MtXhP7A7.js";
3
- import { _ as applySetupAdd, a as updateCommand, c as planSetupRemove, d as initCommandDefinition, f as initPackages, g as addCommand, h as setupCatalog, i as readUpdateArgs, l as readRemoveArgs, m as readInitArgs, n as setupCommands, o as updateInstallArgs, p as nuxiPackage, r as planSetupUpdate, s as applySetupRemove, u as removeCommand, v as planSetupAdd, y as readAddArgs } from "../commands-W0ijB5R6.js";
4
- import { i as setupFailure, o as writeSetupError, r as setupExitCodes } from "../envelope-C7e408hm.js";
5
- import { a as defaultConsoleUrl, c as readConsoleCredential, i as consoleUrlVariable, l as whoamiCommand, n as consoleOrigin, o as loginCommand, r as consoleTokenVariable, s as logoutCommand, t as consoleCredentialsFile } from "../console-auth-Dz9HHP2G.js";
6
- import { a as deploymentsCommand, i as STATUS_HOST_TIMEOUT_MS, r as readDeployArgs, s as readSetupLive, t as deployCommand } from "../deploy-CHW75le_.js";
1
+ import { _ as applySetupAdd, a as updateCommand, c as planSetupRemove, d as initCommandDefinition, f as initPackages, g as addCommand, h as setupCatalog, i as readUpdateArgs, l as readRemoveArgs, m as readInitArgs, n as setupCommands, o as updateInstallArgs, p as nuxiPackage, r as planSetupUpdate, s as applySetupRemove, u as removeCommand, v as planSetupAdd, y as readAddArgs } from "../commands-C003KqWY.js";
2
+ import { a as defaultConsoleUrl, c as readConsoleCredential, i as consoleUrlVariable, l as whoamiCommand, n as consoleOrigin, o as loginCommand, r as consoleTokenVariable, s as logoutCommand, t as consoleCredentialsFile } from "../console-auth-CpOpbA7U.js";
3
+ import { a as deploymentsCommand, i as STATUS_HOST_TIMEOUT_MS, r as readDeployArgs, s as readSetupLive, t as deployCommand } from "../deploy-BZ2iQjZL.js";
4
+ import { i as setupFailure, o as writeSetupError, r as setupExitCodes } from "../envelope-DbplCDko.js";
5
+ import { F as setupStatus, H as readSetupProject, I as shellQuote, c as linkSetupProject, d as readSetupLinkStatus, f as readSetupLinks, m as unlinkSetupProject, p as selectSetupLink, r as SETUP_LINK_FILE, u as readSetupLinkState } from "../env-DRI0QH4-.js";
6
+ import { m as cliErrorDiagnostics } from "../provision-DlknnTAt.js";
7
7
  import { join } from "pathe";
8
8
  import { readFile } from "node:fs/promises";
9
9
  import { createHash, randomUUID } from "node:crypto";
10
- //#region src/setup/session.ts
10
+ // src/setup/session.ts
11
11
  const featurePattern = /^[a-z][a-z-]*$/iu;
12
12
  function invalid(message) {
13
13
  return cliErrorDiagnostics.CLI_R0003({ message: `[vitehub] ${message}` });
@@ -229,5 +229,4 @@ function createSetupSession(options) {
229
229
  }
230
230
  };
231
231
  }
232
- //#endregion
233
232
  export { SETUP_LINK_FILE, STATUS_HOST_TIMEOUT_MS, addCommand, applySetupAdd, applySetupRemove, consoleCredentialsFile, consoleOrigin, consoleTokenVariable, consoleUrlVariable, createSetupSession, defaultConsoleUrl, deployCommand, deploymentsCommand, initCommandDefinition, initPackages, linkSetupProject, loginCommand, logoutCommand, nuxiPackage, planSetupAdd, planSetupRemove, planSetupUpdate, readAddArgs, readConsoleCredential, readDeployArgs, readInitArgs, readRemoveArgs, readSetupLinkState, readSetupLinkStatus, readSetupLinks, readSetupLive, readSetupProject, readUpdateArgs, removeCommand, selectSetupLink, setupCatalog, setupCommands, setupExitCodes, setupRequestArgs, setupStatus, unlinkSetupProject, updateCommand, updateInstallArgs, whoamiCommand };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Command-line workflows for ViteHub projects.",
5
5
  "keywords": [
6
6
  "agent",
@@ -42,33 +42,33 @@
42
42
  "./package.json": "./package.json"
43
43
  },
44
44
  "dependencies": {
45
- "@babel/parser": "^7.29.9",
45
+ "@babel/parser": "^8.1.3",
46
46
  "@dotenvx/primitives": "^4.4.0",
47
47
  "@noble/ciphers": "^2.4.0",
48
48
  "@noble/hashes": "^2.4.0",
49
- "@vite-hub/runtime": "0.5.0",
49
+ "@vite-hub/runtime": "0.5.1",
50
50
  "birpc": "^4.2.0",
51
51
  "diff": "^9.0.0",
52
52
  "nostics": "1.4.0",
53
53
  "pathe": "^2.0.3",
54
54
  "rc9": "^3.1.0",
55
- "semver": "^7.8.5"
55
+ "semver": "^7.8.6"
56
56
  },
57
57
  "devDependencies": {
58
- "@types/node": "^24.19.1",
58
+ "@types/node": "^24.19.2",
59
59
  "@types/semver": "^7.8.0",
60
- "@vite-hub/forge": "0.5.0",
60
+ "@vite-hub/forge": "0.5.1",
61
61
  "@vite-hub/internal": "0.0.1",
62
- "nuxt": "npm:nuxt-nightly@5.0.0-2611052317-a04317f",
62
+ "nuxt": "npm:nuxt-nightly@5.0.0-2611222336-0ed8910",
63
63
  "typescript": "^6.0.3",
64
64
  "valibot": "^1.5.0",
65
- "vite": "^8.2.2",
66
- "vite-plus": "^0.3.3",
67
- "vitest": "^4.1.11"
65
+ "vite": "^8.3.8",
66
+ "vite-plus": "^1.7.0",
67
+ "vitest": "5.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@vite-hub/forge": "0.5.0",
71
- "nuxt": ">=5.0.0-0",
70
+ "@vite-hub/forge": "0.5.1",
71
+ "nuxt": "^4.7.0 || >=5.0.0-0",
72
72
  "vite": ">=8.0.0"
73
73
  },
74
74
  "engines": {