@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/README.md +3 -1
- package/dist/{chunk-OS2ZLURO.js → chunk-BC3Y5C3L.js} +9 -3
- package/dist/chunk-DSYPYBJT.js +432 -0
- package/dist/chunk-GNTEONTU.js +10 -0
- package/dist/chunk-HXLBH5GE.js +8 -0
- package/dist/chunk-RQEWLXGY.js +2770 -0
- package/dist/{chunk-VECP4KOK.js → chunk-T36WTCFM.js} +172 -564
- package/dist/{connect-T5BBOIWS.js → connect-DCXEXEIG.js} +4 -3
- package/dist/{connect-3UDYCZKF.js → connect-TBE7M2G5.js} +2 -2
- package/dist/daemon-LG3VI5EK.js +22 -0
- package/dist/index.js +1196 -1172
- package/dist/init.js +35 -7
- package/dist/{version-UVLMVFNO.js → version-XGDCADFX.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CY2BHCA5.js +0 -8
- package/dist/chunk-FPVAQNHT.js +0 -10
package/dist/init.js
CHANGED
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
saveConfig,
|
|
26
26
|
savedSdkKeyFor,
|
|
27
27
|
trySaveKeyToKeychain
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BC3Y5C3L.js";
|
|
29
29
|
import {
|
|
30
30
|
MUSHI_CLI_VERSION
|
|
31
|
-
} from "./chunk-
|
|
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-
|
|
2089
|
+
const { runConnect } = await import("./connect-TBE7M2G5.js");
|
|
2062
2090
|
const saved = loadConfig();
|
|
2063
2091
|
const result = await runConnect(
|
|
2064
2092
|
{
|
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.
|
|
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
package/package.json
CHANGED
package/dist/chunk-CY2BHCA5.js
DELETED