@vite-hub/cli 0.3.1 → 0.5.0

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,5 +1,5 @@
1
- import { m as cliErrorDiagnostics } from "./provision-D8OvBBzi.js";
2
- import { o as writeSetupError, r as setupExitCodes, s as writeSetupJson } from "./envelope-Cf56AJLa.js";
1
+ import { m as cliErrorDiagnostics } from "./provision-DgT_lpyn.js";
2
+ import { o as writeSetupError, r as setupExitCodes, s as writeSetupJson } from "./envelope-C7e408hm.js";
3
3
  import { chmod, mkdir, readFile, rename, writeFile } from "node:fs/promises";
4
4
  import { dirname, join } from "node:path";
5
5
  import { homedir, hostname } from "node:os";
@@ -32,7 +32,6 @@ async function readCredentials(file) {
32
32
  consoles: consoles instanceof Object ? consoles : {}
33
33
  };
34
34
  }
35
- /** Writes the file with mode 600 in a folder with mode 700. A temporary file and a rename keep it whole. */
36
35
  async function writeCredentials(file, value) {
37
36
  await mkdir(dirname(file), {
38
37
  mode: 448,
@@ -130,11 +129,9 @@ const dateFormat = new Intl.DateTimeFormat("en-GB", {
130
129
  year: "numeric",
131
130
  timeZone: "UTC"
132
131
  });
133
- /** The user code in two groups, such as `WDJB-MJHT`, as RFC 8628 suggests. The Console accepts it with or without the dash. */
134
132
  function groupCode(code) {
135
133
  return code.length === 8 ? `${code.slice(0, 4)}-${code.slice(4)}` : code;
136
134
  }
137
- /** Runs the device flow against `origin` and returns the API key. The key is never written to a stream. */
138
135
  async function deviceLogin(origin, context, prompt) {
139
136
  const started = await postJson(context, `${origin}/api/auth/device/code`, {
140
137
  client_id: clientId,
@@ -1,6 +1,6 @@
1
- import { m as cliErrorDiagnostics } from "./provision-D8OvBBzi.js";
2
- import { o as writeSetupError, s as writeSetupJson } from "./envelope-Cf56AJLa.js";
3
- import { c as readConsoleCredential, n as consoleOrigin } from "./console-auth-xl7kLQNt.js";
1
+ import { m as cliErrorDiagnostics } from "./provision-DgT_lpyn.js";
2
+ import { o as writeSetupError, s as writeSetupJson } from "./envelope-C7e408hm.js";
3
+ import { c as readConsoleCredential, n as consoleOrigin } from "./console-auth-Dz9HHP2G.js";
4
4
  import { execFile } from "node:child_process";
5
5
  import { mkdtemp, open, rename, rm } from "node:fs/promises";
6
6
  import { join } from "node:path";
@@ -20,7 +20,6 @@ function dotenvLine(name, value) {
20
20
  if (!quote || value.includes("\r")) throw cliErrorDiagnostics.CLI_R0003({ message: `[vitehub] Cannot represent ${name} faithfully in a dotenv file. Use a value without carriage returns and with an available dotenv quote delimiter.` });
21
21
  return `${name}=${quote}${escaped}${quote}`;
22
22
  }
23
- /** Run git in `cwd`. `undefined` when git is missing. */
24
23
  function git(cwd, args) {
25
24
  return new Promise((resolve) => {
26
25
  execFile("git", args, {
@@ -36,10 +35,6 @@ function git(cwd, args) {
36
35
  });
37
36
  });
38
37
  }
39
- /**
40
- * Git must not commit the file. In a repository, the file must be ignored and not tracked. Outside a repository, there is
41
- * nothing to commit it to.
42
- */
43
38
  async function checkIgnored(cwd, file) {
44
39
  if (await git(cwd, ["rev-parse", "--is-inside-work-tree"]) !== 0) return;
45
40
  if (await git(cwd, [