@socketsecurity/cli-with-sentry 0.15.33 → 0.15.35

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.
@@ -1,30 +1,59 @@
1
- // Purposefully in sloppy mode to aid with debuggability.
2
- // 'use strict'
1
+ 'use strict'
2
+
3
3
  const { apply: ReflectApply } = Reflect
4
4
 
5
5
  /*@__NO_SIDE_EFFECTS__*/
6
6
  function debugDir() {
7
- 'use strict'
8
7
  if (isDebug()) {
9
8
  const { logger } = /*@__PURE__*/ require('./logger')
10
9
  ReflectApply(logger.dir, logger, arguments)
11
10
  }
12
11
  }
13
12
 
13
+ let pointingTriangle
14
14
  /*@__NO_SIDE_EFFECTS__*/
15
15
  function debugFn() {
16
- // Purposefully in sloppy mode to aid with debuggability.
17
- // 'use strict'
18
16
  if (isDebug()) {
19
17
  const { logger } = /*@__PURE__*/ require('./logger')
20
- const name = debugFn.caller?.name ?? ''
21
- logger.info(`[DEBUG]${name ? ` ${name} >` : ''}`, ...Array.from(arguments))
18
+ const { stack } = new Error()
19
+ let lineCount = 0
20
+ let lineStart = 0
21
+ let name = 'anonymous'
22
+ // Scan the stack trace character-by-character to find the 4th line
23
+ // (index 3), which is typically the caller of debugFn.
24
+ for (let i = 0, { length } = stack; i < length; i += 1) {
25
+ if (stack.charCodeAt(i) === 10 /*'\n'*/) {
26
+ lineCount += 1
27
+ if (lineCount < 4) {
28
+ // Store the start index of the next line.
29
+ lineStart = i + 1
30
+ } else {
31
+ // Extract the full line and trim it.
32
+ const line = stack.slice(lineStart, i).trimStart()
33
+ // Match the function name portion (e.g., "async runFix").
34
+ const match = /(?<=^at\s+).*?(?=\s+\(|$)/.exec(line)?.[0]
35
+ if (match) {
36
+ // Strip known V8 invocation prefixes to get the clean name.
37
+ name = match.replace(/^(?:async|bound|get|new|set)\s+/, '')
38
+ }
39
+ break
40
+ }
41
+ }
42
+ }
43
+ if (pointingTriangle === undefined) {
44
+ const supported =
45
+ /*@__PURE__*/ require('../external/@socketregistry/is-unicode-supported')()
46
+ pointingTriangle = supported ? '▸' : '>'
47
+ }
48
+ logger.info(
49
+ `[DEBUG]${name ? ` ${name} ${pointingTriangle}` : ''}`,
50
+ ...arguments
51
+ )
22
52
  }
23
53
  }
24
54
 
25
55
  /*@__NO_SIDE_EFFECTS__*/
26
56
  function debugLog() {
27
- 'use strict'
28
57
  if (isDebug()) {
29
58
  const { logger } = /*@__PURE__*/ require('./logger')
30
59
  ReflectApply(logger.info, logger, arguments)
@@ -33,7 +62,6 @@ function debugLog() {
33
62
 
34
63
  /*@__NO_SIDE_EFFECTS__*/
35
64
  function isDebug() {
36
- 'use strict'
37
65
  const ENV = /*@__PURE__*/ require('./constants/env')
38
66
  // eslint-disable-next-line no-warning-comments
39
67
  // TODO: Make the environment variable name configurable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli-with-sentry",
3
- "version": "0.15.33",
3
+ "version": "0.15.35",
4
4
  "description": "CLI tool for Socket.dev, includes Sentry error handling, otherwise identical to the regular `socket` package",
5
5
  "homepage": "https://github.com/SocketDev/socket-cli",
6
6
  "license": "MIT",
@@ -111,14 +111,14 @@
111
111
  "@socketregistry/is-interactive": "1.0.5",
112
112
  "@socketregistry/packageurl-js": "1.0.6",
113
113
  "@socketsecurity/config": "3.0.1",
114
- "@socketsecurity/registry": "1.0.200",
114
+ "@socketsecurity/registry": "1.0.201",
115
115
  "@socketsecurity/sdk": "1.4.40",
116
116
  "@types/blessed": "0.1.25",
117
117
  "@types/cmd-shim": "5.0.2",
118
118
  "@types/js-yaml": "4.0.9",
119
119
  "@types/micromatch": "4.0.9",
120
120
  "@types/mock-fs": "4.13.4",
121
- "@types/node": "22.15.23",
121
+ "@types/node": "22.15.24",
122
122
  "@types/npmcli__arborist": "6.3.0",
123
123
  "@types/proc-log": "3.0.4",
124
124
  "@types/semver": "7.7.0",
@@ -146,7 +146,7 @@
146
146
  "husky": "9.1.7",
147
147
  "ignore": "7.0.4",
148
148
  "js-yaml": "npm:@zkochan/js-yaml@0.0.7",
149
- "knip": "5.58.1",
149
+ "knip": "5.59.0",
150
150
  "lint-staged": "16.1.0",
151
151
  "magic-string": "0.30.17",
152
152
  "meow": "13.2.0",
@@ -233,6 +233,6 @@
233
233
  "strict": true
234
234
  },
235
235
  "dependencies": {
236
- "@sentry/node": "9.23.0"
236
+ "@sentry/node": "9.24.0"
237
237
  }
238
238
  }