@mushi-mushi/cli 0.34.0 → 0.35.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.
package/dist/init.js CHANGED
@@ -25,10 +25,10 @@ import {
25
25
  saveConfig,
26
26
  savedSdkKeyFor,
27
27
  trySaveKeyToKeychain
28
- } from "./chunk-OS2ZLURO.js";
28
+ } from "./chunk-BC3Y5C3L.js";
29
29
  import {
30
30
  MUSHI_CLI_VERSION
31
- } from "./chunk-CY2BHCA5.js";
31
+ } from "./chunk-HXLBH5GE.js";
32
32
  import {
33
33
  FRAMEWORKS,
34
34
  detectFramework,
@@ -53,6 +53,26 @@ import { randomUUID } from "crypto";
53
53
  import { appendFileSync, existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
54
54
  import { join as join2 } from "path";
55
55
 
56
+ // src/hosting-env-hint.ts
57
+ var LOVABLE_BOLT_DOCS = "https://kensaur.us/mushi-mushi/docs/quickstart/lovable-bolt";
58
+ function envVarNames(block) {
59
+ return block.split("\n").map((line) => /^([A-Z_][A-Z0-9_]*)=/.exec(line.trim())?.[1]).filter((name) => Boolean(name));
60
+ }
61
+ function hostingEnvHint(envBlock, envFile) {
62
+ const names = envVarNames(envBlock);
63
+ const first = names[0] ?? "MUSHI_PROJECT_ID";
64
+ const last = names[names.length - 1] ?? first;
65
+ return [
66
+ `Your deployed site needs these too. The values are in ${envFile}; copy them from there:`,
67
+ ...names.map((n) => ` ${n}`),
68
+ "",
69
+ `Vercel: Project \u2192 Settings \u2192 Environment Variables, or \`vercel env add ${first} production\` (it asks for the value).`,
70
+ `Netlify: Project configuration \u2192 Environment variables, or \`netlify env:set ${last} "<value>"\`.`,
71
+ "Then redeploy: a NEXT_PUBLIC_ / VITE_ variable only reaches the site on the next build.",
72
+ `Lovable or Bolt: no variables needed; paste the script tag instead: ${LOVABLE_BOLT_DOCS}`
73
+ ].join("\n");
74
+ }
75
+
56
76
  // src/device-auth.ts
57
77
  var DEVICE_FETCH_TIMEOUT_MS = 15e3;
58
78
  var DEFAULT_SLOW_DOWN_MS = 5e3;
@@ -1341,6 +1361,7 @@ ${failed.length} check${failed.length === 1 ? "" : "s"} failed.`);
1341
1361
  }
1342
1362
 
1343
1363
  // src/init.ts
1364
+ var NATIVE_FRAMEWORK_IDS = /* @__PURE__ */ new Set(["expo", "react-native", "capacitor"]);
1344
1365
  var ENV_FILES = [".env.local", ".env"];
1345
1366
  function isInteractive() {
1346
1367
  return Boolean(process.stdin.isTTY && process.stdout.isTTY);
@@ -1391,7 +1412,7 @@ async function runInit(options = {}) {
1391
1412
  } else {
1392
1413
  p.log.info(`Skipped install. Run \`${installCommand(pm, packagesToInstall)}\` yourself.`);
1393
1414
  }
1394
- await writeEnvFile(
1415
+ const envFile = await writeEnvFile(
1395
1416
  cwd,
1396
1417
  credentials.sdkKey,
1397
1418
  credentials.projectId,
@@ -1399,6 +1420,12 @@ async function runInit(options = {}) {
1399
1420
  endpoint,
1400
1421
  Boolean(options.yes)
1401
1422
  );
1423
+ if (!NATIVE_FRAMEWORK_IDS.has(framework.id)) {
1424
+ p.note(
1425
+ hostingEnvHint(envVarsToWrite(credentials.sdkKey, credentials.projectId, framework, endpoint), envFile),
1426
+ "Before you deploy:"
1427
+ );
1428
+ }
1402
1429
  persistCliConfig(credentials, endpoint);
1403
1430
  emitWizardFunnelEvent(credentials, endpoint, "wizard_env_written", { framework: framework.id });
1404
1431
  const enableRewards = await maybeEnableRewards(options);
@@ -1908,13 +1935,13 @@ async function writeEnvFile(cwd, apiKey, projectId, framework, endpoint, overwri
1908
1935
  });
1909
1936
  if (p.isCancel(answer)) {
1910
1937
  p.log.info(`Kept existing env vars in ${target}.`);
1911
- return;
1938
+ return target;
1912
1939
  }
1913
1940
  shouldOverwrite = Boolean(answer);
1914
1941
  }
1915
1942
  if (!shouldOverwrite) {
1916
1943
  p.log.info(`Kept existing env vars in ${target}. Re-run and confirm to overwrite.`);
1917
- return;
1944
+ return target;
1918
1945
  }
1919
1946
  const MUSHI_LINE_RE = /^(NEXT_PUBLIC_|NUXT_PUBLIC_|VITE_|EXPO_PUBLIC_)?MUSHI_[A-Z_]+=.*/gm;
1920
1947
  const stripped = existing.replace(MUSHI_LINE_RE, "").replace(/\n{3,}/g, "\n\n").trimEnd();
@@ -1925,7 +1952,7 @@ ${newVars}
1925
1952
  `);
1926
1953
  p.log.success(`Updated MUSHI_* env vars in ${target}`);
1927
1954
  warnIfMissingFromGitignore(cwd, target);
1928
- return;
1955
+ return target;
1929
1956
  }
1930
1957
  const prefix = existing.length > 0 && !existing.endsWith("\n") ? "\n" : "";
1931
1958
  appendFileSync(targetPath, `${prefix}
@@ -1934,6 +1961,7 @@ ${newVars}
1934
1961
  `);
1935
1962
  p.log.success(`Wrote env vars to ${target}`);
1936
1963
  warnIfMissingFromGitignore(cwd, target);
1964
+ return target;
1937
1965
  }
1938
1966
  function isEnvFileCoveredByGitignore(gitignoreContent, envFile) {
1939
1967
  const lines = gitignoreContent.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
@@ -2058,7 +2086,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
2058
2086
  if (p.isCancel(answer) || !answer) return;
2059
2087
  const endpoint = resolveCloudEndpoint(options.endpoint);
2060
2088
  try {
2061
- const { runConnect } = await import("./connect-3UDYCZKF.js");
2089
+ const { runConnect } = await import("./connect-TBE7M2G5.js");
2062
2090
  const saved = loadConfig();
2063
2091
  const result = await runConnect(
2064
2092
  {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MUSHI_CLI_VERSION,
4
4
  MUSHI_MCP_PIN_SPEC
5
- } from "./chunk-FPVAQNHT.js";
5
+ } from "./chunk-GNTEONTU.js";
6
6
  export {
7
7
  MUSHI_CLI_VERSION,
8
8
  MUSHI_MCP_PIN_SPEC
package/dist/version.d.ts CHANGED
@@ -14,6 +14,6 @@ declare const MUSHI_CLI_VERSION: string;
14
14
  * setup refreshes the pin. Synced to packages/mcp/package.json by
15
15
  * `scripts/sync-mcp-pin.mjs` — never hand-edit the version.
16
16
  */
17
- declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.29.1";
17
+ declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.30.0";
18
18
 
19
19
  export { MUSHI_CLI_VERSION, MUSHI_MCP_PIN_SPEC };
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MUSHI_CLI_VERSION,
3
3
  MUSHI_MCP_PIN_SPEC
4
- } from "./chunk-CY2BHCA5.js";
4
+ } from "./chunk-HXLBH5GE.js";
5
5
  export {
6
6
  MUSHI_CLI_VERSION,
7
7
  MUSHI_MCP_PIN_SPEC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/cli",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "license": "MIT",
5
5
  "description": "Mushi CLI: SDK setup, MCP wiring, bug triage. The bug mediator for AI-built apps: plain-English diagnosis + a ready fix, in your editor.",
6
6
  "bin": {
@@ -1,8 +0,0 @@
1
- // src/version.ts
2
- var MUSHI_CLI_VERSION = true ? "0.34.0" : "0.0.0-dev";
3
- var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.29.1";
4
-
5
- export {
6
- MUSHI_CLI_VERSION,
7
- MUSHI_MCP_PIN_SPEC
8
- };
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/version.ts
4
- var MUSHI_CLI_VERSION = true ? "0.34.0" : "0.0.0-dev";
5
- var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.29.1";
6
-
7
- export {
8
- MUSHI_CLI_VERSION,
9
- MUSHI_MCP_PIN_SPEC
10
- };