mushi-mushi 0.7.16 → 0.8.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -85
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,10 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
+ import { spawnSync } from "child_process";
5
+ import { fileURLToPath } from "url";
4
6
  import { runInit } from "@mushi-mushi/cli/init";
5
- import { FRAMEWORK_IDS, isFrameworkId } from "@mushi-mushi/cli/detect";
6
- var VERSION = true ? "0.7.16" : "0.0.0-dev";
7
- var MIN_NODE_MAJOR = 20;
7
+ import {
8
+ parseArgs,
9
+ assertNodeVersion,
10
+ FLAGS_HELP
11
+ } from "@mushi-mushi/cli/wizard-args";
12
+ var VERSION = true ? "0.8.0" : "0.0.0-dev";
13
+ var BIN = "mushi-mushi";
8
14
  var ISSUES_URL = "https://github.com/kensaurus/mushi-mushi/issues";
9
15
  var HELP = `mushi-mushi \u2014 bug-reporting SDK launcher
10
16
 
@@ -12,95 +18,28 @@ Usage:
12
18
  npx mushi-mushi run the setup wizard (interactive)
13
19
  npx mushi-mushi init same, with optional flags
14
20
 
15
- Flags (forwarded to \`mushi init\`):
16
- --project-id <uuid> skip the project ID prompt (UUID from the Projects page)
17
- --api-key <key> skip the API key prompt (CI only \u2014 leaks into \`ps\`)
18
- --framework <id> force a framework (${FRAMEWORK_IDS.join(", ")})
19
- --skip-install print the install command instead of running it
20
- --skip-test-report don't offer to send a test report at the end
21
- --cwd <path> run in a different directory
22
- --endpoint <url> override the Mushi API endpoint (self-hosted)
23
- -y, --yes accept the detected framework without prompting
24
- -v, --version print the launcher version and exit
25
- -h, --help show this help
21
+ Other commands (setup, status, reports, deploy, test, login, config, ...)
22
+ are forwarded to @mushi-mushi/cli, e.g. \`npx mushi-mushi setup --ide cursor\`.
26
23
 
27
- Other commands (status, reports, deploy, test, login, config, index) live
28
- in @mushi-mushi/cli \u2014 install with \`npm i -g @mushi-mushi/cli\` and use
29
- \`mushi <command>\`.
24
+ ${FLAGS_HELP}
30
25
 
31
26
  Docs: https://github.com/kensaurus/mushi-mushi
32
27
  Console: https://kensaur.us/mushi-mushi/`;
33
- function parseArgs(argv) {
34
- const args = argv[0] === "init" ? argv.slice(1) : argv;
35
- const out = { showHelp: false, showVersion: false };
36
- for (let i = 0; i < args.length; i++) {
37
- const a = args[i];
38
- if (a === "-h" || a === "--help") {
39
- out.showHelp = true;
40
- continue;
41
- }
42
- if (a === "-v" || a === "--version") {
43
- out.showVersion = true;
44
- continue;
45
- }
46
- if (a === "-y" || a === "--yes") {
47
- out.yes = true;
48
- continue;
49
- }
50
- if (a === "--skip-install") {
51
- out.skipInstall = true;
52
- continue;
53
- }
54
- if (a === "--skip-test-report") {
55
- out.skipTestReport = true;
56
- continue;
57
- }
58
- if (a === "--project-id") {
59
- out.projectId = args[++i];
60
- continue;
61
- }
62
- if (a === "--api-key") {
63
- out.apiKey = args[++i];
64
- continue;
65
- }
66
- if (a === "--cwd") {
67
- out.cwd = args[++i];
68
- continue;
69
- }
70
- if (a === "--endpoint") {
71
- out.endpoint = args[++i];
72
- continue;
73
- }
74
- if (a === "--framework") {
75
- const fw = args[++i];
76
- if (!isFrameworkId(fw)) {
77
- throw new Error(`Unknown framework: ${fw}. Valid: ${FRAMEWORK_IDS.join(", ")}`);
78
- }
79
- out.framework = fw;
80
- continue;
81
- }
82
- if (a.startsWith("-")) {
83
- throw new Error(`Unknown flag: ${a}. Try --help.`);
84
- }
85
- }
86
- return out;
87
- }
88
- function assertNodeVersion() {
89
- const major = Number(process.versions.node.split(".")[0]);
90
- if (!Number.isFinite(major) || major < MIN_NODE_MAJOR) {
91
- process.stderr.write(
92
- `mushi-mushi requires Node.js ${MIN_NODE_MAJOR} or newer. You are on ${process.versions.node}.
93
- Upgrade Node (https://nodejs.org/) and try again.
94
- `
95
- );
96
- process.exit(1);
97
- }
28
+ function forwardToCli(argv) {
29
+ const cliBin = fileURLToPath(import.meta.resolve("@mushi-mushi/cli"));
30
+ const result = spawnSync(process.execPath, [cliBin, ...argv], { stdio: "inherit" });
31
+ process.exit(result.status ?? 1);
98
32
  }
99
33
  async function main() {
100
- assertNodeVersion();
34
+ assertNodeVersion(BIN);
35
+ const rawArgs = process.argv.slice(2);
36
+ const first = rawArgs[0];
37
+ if (first !== void 0 && first !== "init" && !first.startsWith("-")) {
38
+ forwardToCli(rawArgs);
39
+ }
101
40
  let parsed;
102
41
  try {
103
- parsed = parseArgs(process.argv.slice(2));
42
+ parsed = parseArgs(rawArgs);
104
43
  } catch (err) {
105
44
  process.stderr.write(`${err instanceof Error ? err.message : String(err)}
106
45
  `);
@@ -128,7 +67,7 @@ async function main() {
128
67
  main().catch((err) => {
129
68
  const message = err instanceof Error ? err.message : String(err);
130
69
  process.stderr.write(`
131
- mushi-mushi: ${message}
70
+ ${BIN}: ${message}
132
71
  `);
133
72
  if (process.env.DEBUG?.includes("mushi") && err instanceof Error && err.stack) {
134
73
  process.stderr.write(err.stack + "\n");
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "mushi-mushi",
3
- "version": "0.7.16",
3
+ "version": "0.8.0",
4
4
  "license": "MIT",
5
5
  "description": "Ship a shake-to-report button and get AI-classified, deduped, ready-to-fix bug reports — one `npx mushi-mushi` command for React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, React Native, Expo, Capacitor, and vanilla JS. Companion to Sentry: catches the user-felt bugs crash trackers can't see. Wires into GitHub, Slack, Jira, Linear, PagerDuty, Langfuse, and any MCP-compatible AI agent (Cursor, Claude Code, Copilot).",
6
6
  "bin": {
7
7
  "mushi-mushi": "./dist/index.js"
8
8
  },
9
9
  "dependencies": {
10
- "@mushi-mushi/cli": "^0.24.0"
10
+ "@mushi-mushi/cli": "^0.26.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/node": "^22.20.0",
@@ -80,7 +80,7 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "engines": {
83
- "node": ">=18"
83
+ "node": ">=20"
84
84
  },
85
85
  "scripts": {
86
86
  "build": "tsup",