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