@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,6 @@
1
- import { m as cliErrorDiagnostics } from "./provision-DgT_lpyn.js";
1
+ import { m as cliErrorDiagnostics } from "./provision-DlknnTAt.js";
2
2
  import { formatRuntimeDiagnosticError } from "@vite-hub/runtime";
3
- //#region src/setup/envelope.ts
3
+ // src/setup/envelope.ts
4
4
  /** Exit codes of the setup commands. */
5
5
  const setupExitCodes = {
6
6
  done: 0,
@@ -84,5 +84,4 @@ function table(rows) {
84
84
  const widths = rows[0].map((_, column) => Math.max(...rows.map((row) => row[column].length)));
85
85
  return rows.map((row) => row.map((cell, column) => cell.padEnd(widths[column])).join(" ").trimEnd()).join("\n");
86
86
  }
87
- //#endregion
88
87
  export { table as a, setupFailure as i, readSetupArgs as n, writeSetupError as o, setupExitCodes as r, writeSetupJson as s, isSetupFailure as t };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { a as ProvisionProvider, c as HostCliRun, i as ViteHubCliProvision, n as ViteHubCliCommandNamespace, t as ViteHubCliCommand } from "./provision-bhi-xnCG.js";
2
- //#region src/index.d.ts
1
+ import { a as ProvisionProvider, c as HostCliRun, i as ViteHubCliProvision, n as ViteHubCliCommandNamespace, t as ViteHubCliCommand } from "./provision-kiD8Emd7.js";
3
2
  interface ViteHubCliSpawnResult {
4
3
  exitCode: number | null;
5
4
  signal?: NodeJS.Signals | null;
@@ -77,4 +76,4 @@ export interface RunViteHubCliEntrypointOptions extends Omit<RunViteHubCliOption
77
76
  }
78
77
  export declare function runViteHubCli(options?: RunViteHubCliOptions): Promise<number>;
79
78
  export declare function runViteHubCliEntrypoint(options?: RunViteHubCliEntrypointOptions): void;
80
- //#endregion
79
+ export {};
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { $ as isRecord, A as parseOperationInput, D as operationCliOptions, E as operationCall, G as appUrlError, J as findViteHubDevServerUrl, K as collectViteHubCliContribution, M as reservedOperationNamespaces, N as setupCommandNames, O as operationCliPath, P as resolveViteHubProjectRoot, S as callOperation, T as createOperationRegistry, U as quoteSupportedInstallSpecifier, X as viteCliProjectConfig, Y as getStableStdoutWrite, Z as withStdoutOnStderr, b as loadAllEnv, h as PROVISION_STATE_FILE, j as operationInputJsonSchema, k as operationsOf, m as cliErrorDiagnostics, q as createCliDiscoveryNitroCloser, t as createProvisionNamespace, v as readProvisionStateSync, w as collectOperationContributions, x as withViteStageEnvironment } from "./provision-DgT_lpyn.js";
1
+ import { A as parseOperationInput, D as operationCliOptions, E as operationCall, G as appUrlError, J as findViteHubDevServerUrl, K as collectViteHubCliContribution, M as reservedOperationNamespaces, N as setupCommandNames, O as operationCliPath, P as resolveViteHubProjectRoot, Q as isRecord, S as callOperation, T as createOperationRegistry, U as quoteSupportedInstallSpecifier, X as viteCliProjectConfig, Y as getStableStdoutWrite, Z as withStdoutOnStderr, b as loadAllEnv, h as PROVISION_STATE_FILE, j as operationInputJsonSchema, k as operationsOf, m as cliErrorDiagnostics, q as createCliDiscoveryNitroCloser, t as createProvisionNamespace, v as readProvisionStateSync, w as collectOperationContributions, x as withViteStageEnvironment } from "./provision-DlknnTAt.js";
2
2
  import { spawn } from "node:child_process";
3
3
  import { existsSync, readFileSync, statSync } from "node:fs";
4
4
  import process$1 from "node:process";
5
5
  import { basename, dirname, relative, resolve } from "pathe";
6
6
  import { createInterface } from "node:readline/promises";
7
7
  import { formatRuntimeDiagnosticError } from "@vite-hub/runtime";
8
- //#region ../internal/dist/inspect.js
8
+ // ../internal/dist/inspect.js
9
9
  async function collectContributors(plugins) {
10
10
  const contributors = [];
11
11
  for (const plugin of plugins) {
@@ -99,8 +99,7 @@ function redactInspectionValue(value, key) {
99
99
  }
100
100
  return visit(value, key);
101
101
  }
102
- //#endregion
103
- //#region src/drain.ts
102
+ // src/drain.ts
104
103
  /** `vitehub drain MAINPID [STATUS_URL]`, for a service manager that stops a Node server. It needs no project. */
105
104
  const drainCommand = {
106
105
  description: "Drain a running Node server before it stops, for systemd ExecStop. Needs no project.",
@@ -111,8 +110,7 @@ const drainCommand = {
111
110
  },
112
111
  usage: "vitehub drain MAINPID [STATUS_URL]"
113
112
  };
114
- //#endregion
115
- //#region src/inspect.ts
113
+ // src/inspect.ts
116
114
  const definitionsUsage = "vitehub inspect definitions [--kind <kind>] [--json]";
117
115
  const providerOutputUsage = "vitehub inspect output [--json]";
118
116
  const resourcesUsage = "vitehub inspect resources [--json]";
@@ -548,8 +546,7 @@ function createInspectNamespace(plugins, operations = [], handlers = []) {
548
546
  name: "inspect"
549
547
  };
550
548
  }
551
- //#endregion
552
- //#region ../internal/dist/contributions.js
549
+ // ../internal/dist/contributions.js
553
550
  function isThenable(value) {
554
551
  return typeof value.then === "function";
555
552
  }
@@ -576,8 +573,7 @@ async function flattenPluginOptions(plugins) {
576
573
  await flattenPlugins(plugins ?? [], flattened, /* @__PURE__ */ new Set());
577
574
  return flattened;
578
575
  }
579
- //#endregion
580
- //#region src/operations.ts
576
+ // src/operations.ts
581
577
  /** Reads every contributed operation of the resolved plugins. A module that fails to load is reported on stderr. */
582
578
  async function loadCliOperations(plugins, stderr) {
583
579
  const sources = [];
@@ -1071,8 +1067,7 @@ function mergeOperationNamespaces(written, generated) {
1071
1067
  }
1072
1068
  return merged;
1073
1069
  }
1074
- //#endregion
1075
- //#region src/renamed-commands.ts
1070
+ // src/renamed-commands.ts
1076
1071
  const renamedCommands = [
1077
1072
  {
1078
1073
  from: ["agents", "list"],
@@ -1214,8 +1209,7 @@ function renamedCommandMessage(args) {
1214
1209
  if (!renamed) return;
1215
1210
  return `[vitehub] \`vitehub ${renamed.from.join(" ")}\` is now \`${renamed.now}\`. ${renamed.migration ? `${renamed.migration} ` : ""}\`vitehub migrate\` updates compatible calls and reports manual steps in scripts and CI files.`;
1216
1211
  }
1217
- //#endregion
1218
- //#region src/seed.ts
1212
+ // src/seed.ts
1219
1213
  const usage = "vitehub seed [<primitive>...] [--remote [--url <url>]] [--stage <name>] [--database <name>] [--timeout <ms>]";
1220
1214
  function writeUsage(seeds, stream) {
1221
1215
  stream.write([
@@ -1351,8 +1345,7 @@ function createSeedNamespace(seeds) {
1351
1345
  name: "seed"
1352
1346
  };
1353
1347
  }
1354
- //#endregion
1355
- //#region src/index.ts
1348
+ // src/index.ts
1356
1349
  const BUILTIN_NAMESPACE_NAMES = new Set(reservedOperationNamespaces);
1357
1350
  const ROOT_HELP_WITHOUT_CONFIG = "[vitehub] The project config did not load. Project namespaces are missing. Of the commands below, only `deploy`, `provision run`, and `provision status` load the config. Fix the error above to use those three commands and the project namespaces.";
1358
1351
  const ENV_HELP_WITHOUT_CONFIG = "[vitehub] The project config did not load. The list below shows only the env commands that do not load the config. Fix the error above to see the project env commands.";
@@ -1362,7 +1355,7 @@ const hostEnvFeatures = {
1362
1355
  {
1363
1356
  description: "Compare the env names of the last build with the names on the linked host. Exits with 1 when a required name is missing. Never reads values.",
1364
1357
  name: "diff",
1365
- run: async (args, context) => await (await import("./env-MtXhP7A7.js").then((n) => n.n)).runEnvCommand({
1358
+ run: async (args, context) => await (await import("./env-DRI0QH4-.js").then((n) => n.n)).runEnvCommand({
1366
1359
  ...hostEnvFeatures.features[0],
1367
1360
  name: "diff"
1368
1361
  }, args, context),
@@ -1371,7 +1364,7 @@ const hostEnvFeatures = {
1371
1364
  {
1372
1365
  description: "Set the host variables of the build's env names from the shell and .env.<stage>, with the host CLI. Prints names, never values. Never deletes a host variable.",
1373
1366
  name: "push",
1374
- run: async (args, context) => await (await import("./env-MtXhP7A7.js").then((n) => n.n)).runEnvCommand({
1367
+ run: async (args, context) => await (await import("./env-DRI0QH4-.js").then((n) => n.n)).runEnvCommand({
1375
1368
  ...hostEnvFeatures.features[1],
1376
1369
  name: "push"
1377
1370
  }, args, context),
@@ -1380,14 +1373,14 @@ const hostEnvFeatures = {
1380
1373
  {
1381
1374
  description: "Write the env values of a stage from a self-hosted Console to .env.<stage>. Needs `vitehub login` and the owner or admin role.",
1382
1375
  name: "pull",
1383
- run: async (args, context) => await (await import("./console-env--3nqqpCV.js")).envPullFeature.run(args, context),
1376
+ run: async (args, context) => await (await import("./console-env-CsBruJnE.js")).envPullFeature.run(args, context),
1384
1377
  usage: "vitehub env pull --from console [--stage <name>] [--project <id>] [--console <url>] [--yes] [--json]"
1385
1378
  }
1386
1379
  ],
1387
1380
  name: "env"
1388
1381
  };
1389
1382
  async function loadSetupCommands() {
1390
- return (await import("./commands-W0ijB5R6.js").then((n) => n.t)).setupCommands;
1383
+ return (await import("./commands-C003KqWY.js").then((n) => n.t)).setupCommands;
1391
1384
  }
1392
1385
  async function loadNuxtViteConfig(rootDir, command, mode) {
1393
1386
  if (![
@@ -1854,5 +1847,4 @@ function runViteHubCliEntrypoint(options = {}) {
1854
1847
  process$1.exit(exitCode);
1855
1848
  })();
1856
1849
  }
1857
- //#endregion
1858
1850
  export { runViteHubCli, runViteHubCliEntrypoint };