@mushi-mushi/svelte 0.1.0 → 0.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @mushi-mushi/svelte
2
2
 
3
- Svelte SDK for Mushi Mushi bug reporting.
3
+ Svelte SDK for Mushi Mushi bug reporting. **API-only** — captures errors and submits reports but does not include the widget UI. Add `@mushi-mushi/web` alongside this package for the full Shadow DOM widget experience.
4
4
 
5
5
  ## Usage
6
6
 
@@ -14,6 +14,16 @@ const mushi = getMushi()
14
14
  mushi.submitReport({ title: 'broken', description: '...' })
15
15
  ```
16
16
 
17
+ ### With Widget UI
18
+
19
+ ```ts
20
+ import { initMushi } from '@mushi-mushi/svelte'
21
+ import { Mushi } from '@mushi-mushi/web'
22
+
23
+ initMushi({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' })
24
+ Mushi.init({ projectId: 'proj_xxx', apiKey: 'mushi_xxx' })
25
+ ```
26
+
17
27
  ### SvelteKit error handler
18
28
 
19
29
  ```ts
package/dist/index.cjs CHANGED
@@ -48,7 +48,7 @@ function initMushi(config) {
48
48
  _client = (0, import_core.createApiClient)({
49
49
  projectId: config.projectId,
50
50
  apiKey: config.apiKey,
51
- apiEndpoint: config.endpoint ?? "https://api.mushimushi.dev"
51
+ ...config.endpoint ? { apiEndpoint: config.endpoint } : {}
52
52
  });
53
53
  _instance = {
54
54
  async submitReport(data) {
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ function initMushi(config) {
22
22
  _client = createApiClient({
23
23
  projectId: config.projectId,
24
24
  apiKey: config.apiKey,
25
- apiEndpoint: config.endpoint ?? "https://api.mushimushi.dev"
25
+ ...config.endpoint ? { apiEndpoint: config.endpoint } : {}
26
26
  });
27
27
  _instance = {
28
28
  async submitReport(data) {
package/package.json CHANGED
@@ -1,65 +1,66 @@
1
- {
2
- "name": "@mushi-mushi/svelte",
3
- "version": "0.1.0",
4
- "license": "MIT",
5
- "description": "Svelte SDK for Mushi Mushi — context-based init, SvelteKit error hook integration",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "scripts": {
10
- "build": "tsup",
11
- "lint": "eslint src/",
12
- "test": "echo 'no tests yet'",
13
- "typecheck": "tsc --noEmit"
14
- },
15
- "peerDependencies": {
16
- "svelte": ">=4"
17
- },
18
- "dependencies": {
19
- "@mushi-mushi/core": "workspace:*"
20
- },
21
- "devDependencies": {
22
- "@mushi-mushi/eslint-config": "workspace:*",
23
- "eslint": "^9.39.4",
24
- "svelte": "^5.0.0",
25
- "tsup": "^8.5.1",
26
- "typescript": "^5.9.3"
27
- },
28
- "author": "Kenji Sakuramoto",
29
- "repository": {
30
- "type": "git",
31
- "url": "https://github.com/kensaurus/mushi-mushi.git",
32
- "directory": "packages/svelte"
33
- },
34
- "homepage": "https://github.com/kensaurus/mushi-mushi/tree/main/packages/svelte#readme",
35
- "bugs": {
36
- "url": "https://github.com/kensaurus/mushi-mushi/issues"
37
- },
38
- "publishConfig": {
39
- "access": "public"
40
- },
41
- "files": [
42
- "dist",
43
- "README.md",
44
- "LICENSE"
45
- ],
46
- "sideEffects": false,
47
- "keywords": [
48
- "mushi-mushi",
49
- "bug-reporting",
50
- "sdk"
51
- ],
52
- "exports": {
53
- ".": {
54
- "import": {
55
- "types": "./dist/index.d.ts",
56
- "default": "./dist/index.js"
57
- },
58
- "require": {
59
- "types": "./dist/index.d.cts",
60
- "default": "./dist/index.cjs"
61
- }
62
- }
63
- },
64
- "type": "module"
65
- }
1
+ {
2
+ "name": "@mushi-mushi/svelte",
3
+ "version": "0.2.0",
4
+ "license": "MIT",
5
+ "description": "Svelte SDK for Mushi Mushi — context-based init, SvelteKit error hook integration",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "peerDependencies": {
10
+ "svelte": ">=4"
11
+ },
12
+ "dependencies": {
13
+ "@mushi-mushi/core": "^0.2.0"
14
+ },
15
+ "devDependencies": {
16
+ "eslint": "^10.2.0",
17
+ "svelte": "^5.0.0",
18
+ "tsup": "^8.5.1",
19
+ "typescript": "^6.0.2",
20
+ "vitest": "^4.1.4",
21
+ "@mushi-mushi/eslint-config": "0.0.0"
22
+ },
23
+ "author": "Kenji Sakuramoto",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/kensaurus/mushi-mushi.git",
27
+ "directory": "packages/svelte"
28
+ },
29
+ "homepage": "https://github.com/kensaurus/mushi-mushi/tree/main/packages/svelte#readme",
30
+ "bugs": {
31
+ "url": "https://github.com/kensaurus/mushi-mushi/issues"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "sideEffects": false,
42
+ "keywords": [
43
+ "mushi-mushi",
44
+ "bug-reporting",
45
+ "sdk"
46
+ ],
47
+ "exports": {
48
+ ".": {
49
+ "import": {
50
+ "types": "./dist/index.d.ts",
51
+ "default": "./dist/index.js"
52
+ },
53
+ "require": {
54
+ "types": "./dist/index.d.cts",
55
+ "default": "./dist/index.cjs"
56
+ }
57
+ }
58
+ },
59
+ "type": "module",
60
+ "scripts": {
61
+ "build": "tsup",
62
+ "lint": "eslint src/",
63
+ "test": "vitest run",
64
+ "typecheck": "tsc --noEmit"
65
+ }
66
+ }