@snapfail/browser 0.0.5 → 0.0.7

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.
@@ -4,6 +4,7 @@ export interface SnapfailConfig {
4
4
  projectKey: string;
5
5
  endpoint: string;
6
6
  environment: "dev" | "prod";
7
+ buildId?: string;
7
8
  bufferSeconds?: number;
8
9
  }
9
10
  export declare function buildPayload(config: SnapfailConfig, error: CapturedError, buffers: {
package/dist/index.js CHANGED
@@ -4029,6 +4029,7 @@ var DeviceSchema = exports_external.object({
4029
4029
  var StackFrameSchema = exports_external.object({
4030
4030
  file: exports_external.string(),
4031
4031
  line: exports_external.number().optional(),
4032
+ col: exports_external.number().optional(),
4032
4033
  fn: exports_external.string().optional()
4033
4034
  });
4034
4035
  var NetworkEntrySchema = exports_external.object({
@@ -4217,7 +4218,8 @@ function buildPayload(config, error, buffers) {
4217
4218
  mode: config.environment,
4218
4219
  url: window.location.href,
4219
4220
  route: window.location.pathname,
4220
- framework: detectFramework()
4221
+ framework: detectFramework(),
4222
+ buildId: config.buildId
4221
4223
  },
4222
4224
  device: detectDevice(),
4223
4225
  consoleEntries: scrubConsoleEntries(buffers.console),
@@ -4232,13 +4234,13 @@ function parseStackFromError(stack) {
4232
4234
  return [];
4233
4235
  return stack.split(`
4234
4236
  `).slice(1).map((line) => line.trim()).filter((line) => line.startsWith("at ")).map((line) => {
4235
- const withFn = line.match(/^at (.+?) \((.+):(\d+):\d+\)$/);
4237
+ const withFn = line.match(/^at (.+?) \((.+):(\d+):(\d+)\)$/);
4236
4238
  if (withFn) {
4237
- return { fn: withFn[1], file: withFn[2], line: parseInt(withFn[3], 10) };
4239
+ return { fn: withFn[1], file: withFn[2], line: parseInt(withFn[3], 10), col: parseInt(withFn[4], 10) };
4238
4240
  }
4239
- const bare = line.match(/^at (.+):(\d+):\d+$/);
4241
+ const bare = line.match(/^at (.+):(\d+):(\d+)$/);
4240
4242
  if (bare) {
4241
- return { file: bare[1], line: parseInt(bare[2], 10) };
4243
+ return { file: bare[1], line: parseInt(bare[2], 10), col: parseInt(bare[3], 10) };
4242
4244
  }
4243
4245
  return { file: line.replace(/^at /, "") };
4244
4246
  });
package/package.json CHANGED
@@ -1,20 +1,14 @@
1
1
  {
2
2
  "name": "@snapfail/browser",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "description": "Browser SDK for snapfail — error capture, replay and transport",
6
6
  "license": "MIT",
7
- "main": "./src/index.ts",
7
+ "main": "./dist/index.js",
8
8
  "exports": {
9
- ".": "./src/index.ts"
10
- },
11
- "publishConfig": {
12
- "main": "./dist/index.js",
13
- "exports": {
14
- ".": {
15
- "import": "./dist/index.js",
16
- "types": "./dist/index.d.ts"
17
- }
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
18
12
  }
19
13
  },
20
14
  "files": ["dist"],