bugstack-sdk 2.2.0 → 2.2.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +109 -87
  2. package/README.md +423 -421
  3. package/bin/bugstack.cjs +6 -6
  4. package/dist/adapters/express/index.d.mts +2 -2
  5. package/dist/adapters/express/index.d.ts +2 -2
  6. package/dist/adapters/express/index.js +2 -2
  7. package/dist/adapters/express/index.js.map +1 -1
  8. package/dist/adapters/express/index.mjs +2 -2
  9. package/dist/adapters/express/index.mjs.map +1 -1
  10. package/dist/adapters/generic/index.d.mts +2 -2
  11. package/dist/adapters/generic/index.d.ts +2 -2
  12. package/dist/adapters/generic/index.js +2 -2
  13. package/dist/adapters/generic/index.js.map +1 -1
  14. package/dist/adapters/generic/index.mjs +2 -2
  15. package/dist/adapters/generic/index.mjs.map +1 -1
  16. package/dist/adapters/nextjs/index.d.mts +2 -2
  17. package/dist/adapters/nextjs/index.d.ts +2 -2
  18. package/dist/adapters/nextjs/index.js +2 -2
  19. package/dist/adapters/nextjs/index.js.map +1 -1
  20. package/dist/adapters/nextjs/index.mjs +2 -2
  21. package/dist/adapters/nextjs/index.mjs.map +1 -1
  22. package/dist/build/cli.js.map +1 -1
  23. package/dist/build/cli.mjs.map +1 -1
  24. package/dist/build/upload.js.map +1 -1
  25. package/dist/build/upload.mjs.map +1 -1
  26. package/dist/{client-DoqE7sNh.d.mts → client-DK_ItP55.d.mts} +1 -1
  27. package/dist/{client-DoqE7sNh.d.ts → client-DK_ItP55.d.ts} +1 -1
  28. package/dist/index.d.mts +2 -2
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.js +2 -2
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +2 -2
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/next-config/index.js.map +1 -1
  35. package/dist/next-config/index.mjs.map +1 -1
  36. package/package.json +103 -104
package/CHANGELOG.md CHANGED
@@ -1,87 +1,109 @@
1
- # Changelog
2
-
3
- All notable changes to `bugstack-sdk` are documented here.
4
- Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
-
6
- ## [2.2.0] — 2026-04-29
7
-
8
- ### Added
9
- - **Source-map upload pipeline for production builds.** Customers can now
10
- upload server-side source maps to bugstack so the orchestrator resolves
11
- bundled stack frames (`.next/server/chunks/8393.js:1:8734`) back to
12
- source-file positions (`app/api/orders/route.ts:42:5`) — turning the
13
- "Could not identify primary file" failure mode into auto-fixable
14
- errors. Two-step setup:
15
- 1. Wrap your `next.config.js`:
16
- ```js
17
- const { withBugstack } = require('bugstack-sdk/next-config')
18
- module.exports = withBugstack({ /* your config */ })
19
- ```
20
- This enables `webpack.devtool = 'source-map'` for production
21
- server builds, preserving any existing webpack hook.
22
- 2. Append to your `build` script:
23
- ```json
24
- "build": "next build && bugstack sourcemaps upload"
25
- ```
26
- The CLI walks `.next/server/**/*.map`, uploads each with the
27
- active release identifier, and never fails the build.
28
- - New `bugstack` CLI binary (registered via `bin`) — `bugstack sourcemaps
29
- upload [--api-key X] [--release Y] [--endpoint Z] [--server-dir D]
30
- [--concurrency N] [--max-bytes N] [--quiet]`. Auto-detects release from
31
- `BUGSTACK_RELEASE`, `RENDER_GIT_COMMIT`, `VERCEL_GIT_COMMIT_SHA`,
32
- `GITHUB_SHA`, or `git rev-parse HEAD` in that order.
33
- - New programmatic API: `import { uploadSourceMaps } from 'bugstack-sdk/build'`
34
- for callers who want to invoke the uploader from a custom Node script
35
- rather than via the CLI.
36
- - New entry: `bugstack-sdk/next-config` exports `withBugstack(config,
37
- options?)` — the Next.js config wrapper. Idempotent and pass-through
38
- when `emitServerSourceMaps: false`.
39
-
40
- ### Internal
41
- - New tsup entries for `src/build/upload`, `src/build/cli`, and
42
- `src/next-config`. Bin stub at `bin/bugstack.cjs` requires the built
43
- CLI so the shebang concern stays in checked-in JavaScript and out of
44
- the bundler's hands.
45
-
46
- ## [2.1.0] — 2026-04-29
47
-
48
- ### Added
49
- - **Chunk-load error telemetry.** `ChunkLoadError` and the related family
50
- (`Loading chunk N failed`, `Loading CSS chunk N failed`,
51
- `Failed to fetch dynamically imported module`,
52
- `Importing a module script failed`) are now detected and routed to a
53
- lightweight telemetry endpoint instead of the main fix pipeline. They
54
- aren't real bugs (stale-tab artifacts after a redeploy) and have no
55
- source frames the orchestrator could fix, so they were wasting LLM
56
- cycles when they hit `/api/capture`. The new path lets the dashboard
57
- render a deploy-health spike detector while keeping the noise out of
58
- the bug feed.
59
- - New config option `dropChunkErrors` (default `false`) — set to `true`
60
- to disable telemetry forwarding entirely and silently discard chunk
61
- errors instead.
62
- - New config option `chunkErrorsEndpoint` (default auto-derived from the
63
- main `endpoint` — `/api/capture` becomes `/api/chunk-errors`). Override
64
- if your error service splits telemetry across hosts.
65
- - New exported helper `isChunkLoadError(error)` so callers can reuse the
66
- same detection logic in their own browser-side error boundaries (e.g.
67
- to soft-reload the page on first occurrence).
68
-
69
- ### Fixed
70
- - The wire header `X-BugStack-SDK-Version` reported `0.2.0` since pre-2.0,
71
- regardless of the actual installed version. Now injected at build time
72
- from `package.json` via `tsup`'s `define`, so it stays in sync on every
73
- release.
74
-
75
- ### Changed
76
- - Default behavior of `reportError` for chunk-load errors is now route-to-
77
- telemetry. Previously these went into the main capture pipeline (where
78
- they'd create unfixable rows the orchestrator would burn cycles on).
79
- This is a soft behavior change: customer code is unaffected, but the
80
- destination endpoint differs. Hosted customers (api.bugstack.ai) get
81
- the new endpoint automatically; self-hosted error-service deployments
82
- should pull the matching error-service release for the
83
- `/api/chunk-errors` ingest route.
84
-
85
- ## [2.0.2] — 2026-02-27
86
-
87
- Previous published baseline.
1
+ # Changelog
2
+
3
+ All notable changes to `bugstack-sdk` are documented here.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## [2.2.2] — 2026-10-29
7
+
8
+ ### Fixed
9
+ - **Errors reach Bugstack without setting an endpoint.** The default
10
+ endpoint was `http://localhost:3001/api/capture`, so an app that did not
11
+ pass `endpoint` or set `BUGSTACK_ENDPOINT` reported nothing. It is now
12
+ `https://dashboard.bugstack.ai/api/ingest/sdk`, the ingest endpoint, which accepts this SDK's payload and its
13
+ `X-BugStack-API-Key` header. Source-map uploads derive
14
+ `https://dashboard.bugstack.ai/api/ingest/sdk/api/sourcemaps/upload` from it. An explicit `endpoint` or
15
+ `BUGSTACK_ENDPOINT` still wins.
16
+ - **The package's homepage is bugstack.ai.** npm listed the GitHub README
17
+ as the homepage; it now links to https://bugstack.ai.
18
+
19
+ ## [2.2.1] — 2026-04-30
20
+
21
+ ### Fixed
22
+ - **`bugstack` CLI is now installed on the user's `PATH`.** In `2.2.0`,
23
+ npm dropped the `bin[bugstack]` entry at publish time because the path
24
+ was prefixed with `./`, so `npx bugstack sourcemaps upload` and global
25
+ installs could not resolve the binary. Path normalized to
26
+ `bin/bugstack.cjs`.
27
+
28
+ ## [2.2.0] — 2026-04-29
29
+
30
+ ### Added
31
+ - **Source-map upload pipeline for production builds.** Customers can now
32
+ upload server-side source maps to Bugstack so the orchestrator resolves
33
+ bundled stack frames (`.next/server/chunks/8393.js:1:8734`) back to
34
+ source-file positions (`app/api/orders/route.ts:42:5`) — turning the
35
+ "Could not identify primary file" failure mode into auto-fixable
36
+ errors. Two-step setup:
37
+ 1. Wrap your `next.config.js`:
38
+ ```js
39
+ const { withBugstack } = require('bugstack-sdk/next-config')
40
+ module.exports = withBugstack({ /* your config */ })
41
+ ```
42
+ This enables `webpack.devtool = 'source-map'` for production
43
+ server builds, preserving any existing webpack hook.
44
+ 2. Append to your `build` script:
45
+ ```json
46
+ "build": "next build && bugstack sourcemaps upload"
47
+ ```
48
+ The CLI walks `.next/server/**/*.map`, uploads each with the
49
+ active release identifier, and never fails the build.
50
+ - New `bugstack` CLI binary (registered via `bin`) — `bugstack sourcemaps
51
+ upload [--api-key X] [--release Y] [--endpoint Z] [--server-dir D]
52
+ [--concurrency N] [--max-bytes N] [--quiet]`. Auto-detects release from
53
+ `BUGSTACK_RELEASE`, `RENDER_GIT_COMMIT`, `VERCEL_GIT_COMMIT_SHA`,
54
+ `GITHUB_SHA`, or `git rev-parse HEAD` in that order.
55
+ - New programmatic API: `import { uploadSourceMaps } from 'bugstack-sdk/build'`
56
+ for callers who want to invoke the uploader from a custom Node script
57
+ rather than via the CLI.
58
+ - New entry: `bugstack-sdk/next-config` exports `withBugstack(config,
59
+ options?)` — the Next.js config wrapper. Idempotent and pass-through
60
+ when `emitServerSourceMaps: false`.
61
+
62
+ ### Internal
63
+ - New tsup entries for `src/build/upload`, `src/build/cli`, and
64
+ `src/next-config`. Bin stub at `bin/bugstack.cjs` requires the built
65
+ CLI so the shebang concern stays in checked-in JavaScript and out of
66
+ the bundler's hands.
67
+
68
+ ## [2.1.0] — 2026-04-29
69
+
70
+ ### Added
71
+ - **Chunk-load error telemetry.** `ChunkLoadError` and the related family
72
+ (`Loading chunk N failed`, `Loading CSS chunk N failed`,
73
+ `Failed to fetch dynamically imported module`,
74
+ `Importing a module script failed`) are now detected and routed to a
75
+ lightweight telemetry endpoint instead of the main fix pipeline. They
76
+ aren't real bugs (stale-tab artifacts after a redeploy) and have no
77
+ source frames the orchestrator could fix, so they were wasting LLM
78
+ cycles when they hit `/api/capture`. The new path lets the dashboard
79
+ render a deploy-health spike detector while keeping the noise out of
80
+ the bug feed.
81
+ - New config option `dropChunkErrors` (default `false`) — set to `true`
82
+ to disable telemetry forwarding entirely and silently discard chunk
83
+ errors instead.
84
+ - New config option `chunkErrorsEndpoint` (default auto-derived from the
85
+ main `endpoint` — `/api/capture` becomes `/api/chunk-errors`). Override
86
+ if your error service splits telemetry across hosts.
87
+ - New exported helper `isChunkLoadError(error)` so callers can reuse the
88
+ same detection logic in their own browser-side error boundaries (e.g.
89
+ to soft-reload the page on first occurrence).
90
+
91
+ ### Fixed
92
+ - The wire header `X-BugStack-SDK-Version` reported `0.2.0` since pre-2.0,
93
+ regardless of the actual installed version. Now injected at build time
94
+ from `package.json` via `tsup`'s `define`, so it stays in sync on every
95
+ release.
96
+
97
+ ### Changed
98
+ - Default behavior of `reportError` for chunk-load errors is now route-to-
99
+ telemetry. Previously these went into the main capture pipeline (where
100
+ they'd create unfixable rows the orchestrator would burn cycles on).
101
+ This is a soft behavior change: customer code is unaffected, but the
102
+ destination endpoint differs. Hosted customers (api.bugstack.ai) get
103
+ the new endpoint automatically; self-hosted error-service deployments
104
+ should pull the matching error-service release for the
105
+ `/api/chunk-errors` ingest route.
106
+
107
+ ## [2.0.2] — 2026-02-27
108
+
109
+ Previous published baseline.