@mushi-mushi/web 1.34.1 → 1.37.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 +6 -3
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/mushi.loader.global.js +11 -11
- package/dist/test-utils.cjs +1 -0
- package/dist/test-utils.cjs.map +1 -1
- package/dist/test-utils.js +1 -0
- package/dist/test-utils.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
A bug widget for any website. When a user reports a problem, it sends a screenshot, the route, their note and the last console and network events to [Mushi Mushi](https://github.com/kensaurus/mushi-mushi). Mushi Mushi explains the cause in plain English and hands your editor a fix. It renders in a Shadow DOM, so your CSS and the widget's never mix.
|
|
6
6
|
|
|
7
|
+
The same code ships in the [`mushi-mushi`](https://www.npmjs.com/package/mushi-mushi) package: `npm install mushi-mushi`, then `import { Mushi } from 'mushi-mushi'`. This package keeps working and keeps getting updates.
|
|
8
|
+
|
|
7
9
|
```mermaid
|
|
8
10
|
flowchart LR
|
|
9
11
|
A["User taps the widget"] --> B["Mushi Mushi diagnoses the bug"] --> C["Fix lands in your editor"]
|
|
@@ -12,12 +14,13 @@ flowchart LR
|
|
|
12
14
|
## Quick start
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
|
-
|
|
16
|
-
# or:
|
|
17
|
+
npm install mushi-mushi # then import from 'mushi-mushi'
|
|
18
|
+
# or: npx mushi-mushi # wizard: picks the right SDK, installs it, writes env vars
|
|
19
|
+
# or: npm install @mushi-mushi/web # same code; import from '@mushi-mushi/web'
|
|
17
20
|
```
|
|
18
21
|
|
|
19
22
|
```ts
|
|
20
|
-
import { Mushi } from '
|
|
23
|
+
import { Mushi } from 'mushi-mushi';
|
|
21
24
|
|
|
22
25
|
Mushi.init({
|
|
23
26
|
projectId: '00000000-0000-0000-0000-000000000000', // from the console's Manage apps page
|
package/dist/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var reporterUi = require('@mushi-mushi/core/reporter-ui');
|
|
4
4
|
var core = require('@mushi-mushi/core');
|
|
5
|
+
var diagnostics = require('@mushi-mushi/core/diagnostics');
|
|
5
6
|
var reporterChannels = require('@mushi-mushi/core/reporter-channels');
|
|
6
7
|
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
@@ -6834,7 +6835,7 @@ function createProactiveManager(config = {}) {
|
|
|
6834
6835
|
|
|
6835
6836
|
// src/version.ts
|
|
6836
6837
|
var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
|
|
6837
|
-
var MUSHI_SDK_VERSION = "1.
|
|
6838
|
+
var MUSHI_SDK_VERSION = "1.37.0" ;
|
|
6838
6839
|
function resolveReportAppVersion(config, environment) {
|
|
6839
6840
|
if (config.appVersion) return config.appVersion;
|
|
6840
6841
|
const vercelId = config.integrations?.vercel?.analyticsId;
|
|
@@ -7171,6 +7172,7 @@ function createInstance(config) {
|
|
|
7171
7172
|
let userInfo = null;
|
|
7172
7173
|
let lastIdentifySig = null;
|
|
7173
7174
|
const customMetadata = {};
|
|
7175
|
+
let diagnosticsProvider = null;
|
|
7174
7176
|
const stickyTags = {};
|
|
7175
7177
|
const breadcrumbs = core.createBreadcrumbBuffer({ max: 50 });
|
|
7176
7178
|
breadcrumbs.add({
|
|
@@ -7727,7 +7729,7 @@ function createInstance(config) {
|
|
|
7727
7729
|
if (shouldUseRuntimeConfig(config)) {
|
|
7728
7730
|
const cached = readCachedRuntimeConfig(config.projectId);
|
|
7729
7731
|
if (cached) applyRuntimeConfig(cached);
|
|
7730
|
-
apiClient2.getSdkConfig().then((result) => {
|
|
7732
|
+
apiClient2.getSdkConfig(trackSessionsMode === "on-demand" ? { fresh: true } : void 0).then((result) => {
|
|
7731
7733
|
if (result.ok && result.data) {
|
|
7732
7734
|
cacheRuntimeConfig(config.projectId, result.data);
|
|
7733
7735
|
applyRuntimeConfig(result.data);
|
|
@@ -7846,6 +7848,7 @@ function createInstance(config) {
|
|
|
7846
7848
|
log.warn("Screenshot dropped \u2014 could not compress under wire budget");
|
|
7847
7849
|
}
|
|
7848
7850
|
const capturedEnvironment = core.captureEnvironment();
|
|
7851
|
+
const hostDiagnostics = await diagnostics.collectDiagnostics(diagnosticsProvider);
|
|
7849
7852
|
const report = {
|
|
7850
7853
|
id: core.newUuid(),
|
|
7851
7854
|
projectId: config.projectId,
|
|
@@ -7863,6 +7866,7 @@ function createInstance(config) {
|
|
|
7863
7866
|
...replayCap ? { replayEvents: replayCap.flush() } : {},
|
|
7864
7867
|
metadata: {
|
|
7865
7868
|
...customMetadata,
|
|
7869
|
+
...hostDiagnostics ?? {},
|
|
7866
7870
|
...userInfo ? { user: userInfo } : {},
|
|
7867
7871
|
...sentryCtx?.release ? { sentryRelease: sentryCtx.release } : {}
|
|
7868
7872
|
},
|
|
@@ -8047,6 +8051,9 @@ function createInstance(config) {
|
|
|
8047
8051
|
setMetadata(key, value) {
|
|
8048
8052
|
customMetadata[key] = value;
|
|
8049
8053
|
},
|
|
8054
|
+
setDiagnosticsProvider(provider) {
|
|
8055
|
+
diagnosticsProvider = provider;
|
|
8056
|
+
},
|
|
8050
8057
|
setScreen(screen) {
|
|
8051
8058
|
timelineCap.setScreen(screen);
|
|
8052
8059
|
},
|
|
@@ -8657,6 +8664,8 @@ function createNoopInstance() {
|
|
|
8657
8664
|
},
|
|
8658
8665
|
setMetadata: () => {
|
|
8659
8666
|
},
|
|
8667
|
+
setDiagnosticsProvider: () => {
|
|
8668
|
+
},
|
|
8660
8669
|
setScreen: () => {
|
|
8661
8670
|
},
|
|
8662
8671
|
isOpen: () => false,
|