@botim/mp-debug-sdk 0.7.1 → 0.7.2
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 +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -10
package/README.md
CHANGED
|
@@ -13,14 +13,14 @@ Mini-programs run on user devices in environments you can't easily attach a debu
|
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
16
|
-
> **
|
|
17
|
-
>
|
|
16
|
+
> **If your project's `.npmrc` pins the `@botim` scope to a private registry, override it for this package.**
|
|
17
|
+
> This SDK is published to public npm. If your `.npmrc` contains a line like `@botim:registry=<private-mirror-url>`, plain `npm install @botim/mp-debug-sdk` will route to the private mirror, not find the package, and fail. Use:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install @botim/mp-debug-sdk --registry=https://registry.npmjs.org/
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
If your repo
|
|
23
|
+
If your repo has no `@botim` scope override, the flag is harmless — npm uses `registry.npmjs.org` by default. Don't permanently re-pin the `@botim` scope to public npm in your `.npmrc`: it would shadow whatever private registry your other `@botim/*` packages come from.
|
|
24
24
|
|
|
25
25
|
## 1. Add the env config files
|
|
26
26
|
|
|
@@ -127,7 +127,7 @@ That's it — `console.*`, network calls, and uncaught errors now stream to the
|
|
|
127
127
|
|
|
128
128
|
### Cross-origin setup
|
|
129
129
|
|
|
130
|
-
The SDK posts directly to `endpoint` — there's no proxy required. Your relay must allow the page's origin via CORS.
|
|
130
|
+
The SDK posts directly to `endpoint` — there's no proxy required. Your relay must allow the page's origin via CORS. A reference debug-relay implementation typically defaults to `CORS_ORIGINS=*` for development; tighten via env when going to production:
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
133
|
CORS_ORIGINS=https://my-mp.example.com,https://staging.example.com
|
|
@@ -139,7 +139,7 @@ Once `enableRemoteDebug` returns, an attached agent can send a JS snippet to the
|
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
# From any terminal that can reach your relay:
|
|
142
|
-
curl -sX POST "
|
|
142
|
+
curl -sX POST "<RELAY_URL>/v1/mp/<MP_ID>/devices/<DEVICE_ID>/commands" \
|
|
143
143
|
-H 'content-type: application/json' \
|
|
144
144
|
-d '{"name":"exec","args":{"code":"console.log(\"hi\"); return window.location.href"}}'
|
|
145
145
|
```
|
|
@@ -222,7 +222,7 @@ console.log(handle.sid); // server-issued session id
|
|
|
222
222
|
|
|
223
223
|
## Debugging a live mini-program
|
|
224
224
|
|
|
225
|
-
Once your build is wired and shipped, see **[`docs/live-debugging.md`](./docs/live-debugging.md)** for the end-to-end runbook against
|
|
225
|
+
Once your build is wired and shipped, see **[`docs/live-debugging.md`](./docs/live-debugging.md)** for the end-to-end runbook against your debug-relay deployment. It covers:
|
|
226
226
|
|
|
227
227
|
- pointing the Vite plugin at the live relay URL,
|
|
228
228
|
- pulling errors and tailing sessions from the admin UI,
|
|
@@ -255,3 +255,4 @@ cp -r .claude/skills/botim-debug-relay ~/.claude/skills/
|
|
|
255
255
|
## License
|
|
256
256
|
|
|
257
257
|
[ISC](./LICENSE) © BOTIM
|
|
258
|
+
|