@abide/abide 0.114.0 → 0.114.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @abide/abide
2
2
 
3
+ ## 0.114.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ea48b1b: a server stack frame names the .abide column it was thrown at — bun 1.4.4 counts a call site's column from 1 ([`81bcd9b`](https://github.com/briancray/abide/commit/81bcd9b5dab56c14c6b9262361d0dfdb068fb3f5))
8
+
3
9
  ## 0.114.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abide/abide",
3
- "version": "0.114.0",
3
+ "version": "0.114.1",
4
4
  "type": "module",
5
5
  "description": "Isomorphic type-safe framework for reactive async interfaces for humans and machines",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@
25
25
  "cli"
26
26
  ],
27
27
  "engines": {
28
- "bun": ">=1.4.3"
28
+ "bun": ">=1.4.4"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public",
@@ -62,7 +62,7 @@ function placeFrames(error: Error, frames: CallSite[]): string {
62
62
  return out
63
63
  }
64
64
 
65
- // A call site's column counts from 0 where the stack bun writes counts from 1.
65
+ // A call site's line and column count from 1; a map's from 0.
66
66
  function placed(frame: CallSite): string {
67
67
  // A handler file's frames name the file the author wrote, not the face it is served as.
68
68
  const file = (frame.getFileName() ?? '<anonymous>').replace(
@@ -70,15 +70,19 @@ function placed(frame: CallSite): string {
70
70
  '',
71
71
  )
72
72
  const line = frame.getLineNumber() ?? 0
73
- const column = frame.getColumnNumber() ?? 0
73
+ const column = frame.getColumnNumber() ?? 1
74
74
  const registered = registeredFor(file)
75
75
  if (registered !== undefined && line > 0) {
76
76
  registered.lines ??= decodeMappings(registered.mappings)
77
- const place = placeAt(registered.lines, line - 1, column)
77
+ const place = placeAt(
78
+ registered.lines,
79
+ line - 1,
80
+ Math.max(column - 1, 0),
81
+ )
78
82
  if (place !== undefined)
79
83
  return `${registered.source}:${place[0] + 1}:${place[1] + 1}`
80
84
  }
81
- return `${file}:${line}:${column + 1}`
85
+ return `${file}:${line}:${column}`
82
86
  }
83
87
 
84
88
  function registeredFor(path: string): Registered | undefined {