@socketsecurity/cli-with-sentry 1.0.75 → 1.0.77

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 (35) hide show
  1. package/bin/cli.js +4 -2
  2. package/dist/cli.js +99 -97
  3. package/dist/cli.js.map +1 -1
  4. package/dist/constants.js +14 -5
  5. package/dist/constants.js.map +1 -1
  6. package/dist/flags.js +185 -0
  7. package/dist/flags.js.map +1 -0
  8. package/dist/shadow-npm-bin.js +5 -3
  9. package/dist/shadow-npm-bin.js.map +1 -1
  10. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  11. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  12. package/dist/types/constants.d.mts +1 -1
  13. package/dist/types/constants.d.mts.map +1 -1
  14. package/dist/types/flags.d.mts +6 -5
  15. package/dist/types/flags.d.mts.map +1 -1
  16. package/dist/types/shadow/npm/bin.d.mts.map +1 -1
  17. package/dist/types/shadow/npm/install.d.mts.map +1 -1
  18. package/dist/types/utils/coana.d.mts.map +1 -1
  19. package/dist/types/utils/config.d.mts.map +1 -1
  20. package/dist/types/utils/glob.d.mts +1 -1
  21. package/dist/types/utils/glob.d.mts.map +1 -1
  22. package/dist/types/utils/meow-with-subcommands.d.mts +5 -6
  23. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  24. package/dist/utils.js +70 -94
  25. package/dist/utils.js.map +1 -1
  26. package/dist/vendor.js +3741 -3922
  27. package/external/@socketsecurity/registry/external/@inquirer/search.js +2 -2
  28. package/external/@socketsecurity/registry/external/browserslist.js +233 -211
  29. package/external/@socketsecurity/registry/external/fast-glob.js +7994 -0
  30. package/external/@socketsecurity/registry/external/streaming-iterables.js +326 -0
  31. package/external/@socketsecurity/registry/lib/constants/env.js +6 -0
  32. package/external/@socketsecurity/registry/lib/globs.js +9 -10
  33. package/external/@socketsecurity/registry/lib/streams.js +37 -0
  34. package/package.json +13 -13
  35. package/external/@socketsecurity/registry/external/tinyglobby.js +0 -3888
@@ -0,0 +1,326 @@
1
+ 'use strict'
2
+
3
+ function getIterator(iterable) {
4
+ if (typeof iterable.next === 'function') {
5
+ return iterable
6
+ }
7
+ if (typeof iterable[Symbol.iterator] === 'function') {
8
+ return iterable[Symbol.iterator]()
9
+ }
10
+ if (typeof iterable[Symbol.asyncIterator] === 'function') {
11
+ return iterable[Symbol.asyncIterator]()
12
+ }
13
+ throw new TypeError(
14
+ '"values" does not to conform to any of the iterator or iterable protocols'
15
+ )
16
+ }
17
+ function defer() {
18
+ let reject
19
+ let resolve
20
+ const promise = new Promise((resolveFunc, rejectFunc) => {
21
+ resolve = resolveFunc
22
+ reject = rejectFunc
23
+ })
24
+ return {
25
+ promise,
26
+ reject,
27
+ resolve
28
+ }
29
+ }
30
+ function _buffer(size, iterable) {
31
+ const iterator = getIterator(iterable)
32
+ const resultQueue = []
33
+ const readQueue = []
34
+ let reading = false
35
+ let ended = false
36
+ function fulfillReadQueue() {
37
+ while (readQueue.length > 0 && resultQueue.length > 0) {
38
+ const readDeferred = readQueue.shift()
39
+ const { error, value } = resultQueue.shift()
40
+ if (error) {
41
+ readDeferred.reject(error)
42
+ } else {
43
+ readDeferred.resolve({
44
+ done: false,
45
+ value
46
+ })
47
+ }
48
+ }
49
+ while (readQueue.length > 0 && ended) {
50
+ const { resolve } = readQueue.shift()
51
+ resolve({
52
+ done: true,
53
+ value: undefined
54
+ })
55
+ }
56
+ }
57
+ async function fillQueue() {
58
+ if (ended) {
59
+ return
60
+ }
61
+ if (reading) {
62
+ return
63
+ }
64
+ if (resultQueue.length >= size) {
65
+ return
66
+ }
67
+ reading = true
68
+ try {
69
+ const { done, value } = await iterator.next()
70
+ if (done) {
71
+ ended = true
72
+ } else {
73
+ resultQueue.push({
74
+ value
75
+ })
76
+ }
77
+ } catch (error) {
78
+ ended = true
79
+ resultQueue.push({
80
+ error
81
+ })
82
+ }
83
+ fulfillReadQueue()
84
+ reading = false
85
+ fillQueue()
86
+ }
87
+ async function next() {
88
+ if (resultQueue.length > 0) {
89
+ const { error, value } = resultQueue.shift()
90
+ if (error) {
91
+ throw error
92
+ }
93
+ fillQueue()
94
+ return {
95
+ done: false,
96
+ value
97
+ }
98
+ }
99
+ if (ended) {
100
+ return {
101
+ done: true,
102
+ value: undefined
103
+ } // stupid ts
104
+ }
105
+ const deferred = defer()
106
+ readQueue.push(deferred)
107
+ fillQueue()
108
+ return deferred.promise
109
+ }
110
+ const asyncIterableIterator = {
111
+ next,
112
+ [Symbol.asyncIterator]: () => asyncIterableIterator
113
+ }
114
+ return asyncIterableIterator
115
+ }
116
+ function* syncBuffer(size, iterable) {
117
+ const valueQueue = []
118
+ let e
119
+ try {
120
+ for (const value of iterable) {
121
+ valueQueue.push(value)
122
+ if (valueQueue.length <= size) {
123
+ continue
124
+ }
125
+ yield valueQueue.shift()
126
+ }
127
+ } catch (error) {
128
+ e = error
129
+ }
130
+ for (const value of valueQueue) {
131
+ yield value
132
+ }
133
+ if (e) {
134
+ throw e
135
+ }
136
+ }
137
+ function buffer(size, iterable) {
138
+ if (iterable === undefined) {
139
+ return curriedIterable => buffer(size, curriedIterable)
140
+ }
141
+ if (size === 0) {
142
+ return iterable
143
+ }
144
+ if (iterable[Symbol.asyncIterator]) {
145
+ return _buffer(size, iterable)
146
+ }
147
+ return syncBuffer(size, iterable)
148
+ }
149
+ async function* _map(func, iterable) {
150
+ for await (const val of iterable) {
151
+ yield await func(val)
152
+ }
153
+ }
154
+ function map(func, iterable) {
155
+ if (iterable === undefined) {
156
+ return curriedIterable => _map(func, curriedIterable)
157
+ }
158
+ return _map(func, iterable)
159
+ }
160
+ function pipeline(firstFn, ...fns) {
161
+ let previousFn = firstFn()
162
+ for (const func of fns) {
163
+ previousFn = func(previousFn)
164
+ }
165
+ return previousFn
166
+ }
167
+ async function* _parallelMap(concurrency, func, iterable) {
168
+ let transformError = null
169
+ const wrapFunc = value => ({
170
+ value: func(value)
171
+ })
172
+ const stopOnError = async function* (source) {
173
+ for await (const value of source) {
174
+ if (transformError) {
175
+ return
176
+ }
177
+ yield value
178
+ }
179
+ }
180
+ const output = pipeline(
181
+ () => iterable,
182
+ buffer(1),
183
+ stopOnError,
184
+ map(wrapFunc),
185
+ buffer(concurrency - 1)
186
+ )
187
+ const itr = getIterator(output)
188
+ while (true) {
189
+ const { value, done } = await itr.next()
190
+ if (done) {
191
+ break
192
+ }
193
+ try {
194
+ const val = await value.value
195
+ if (!transformError) {
196
+ yield val
197
+ }
198
+ } catch (error) {
199
+ transformError = error
200
+ }
201
+ }
202
+ if (transformError) {
203
+ throw transformError
204
+ }
205
+ }
206
+ function parallelMap(concurrency, func, iterable) {
207
+ if (func === undefined) {
208
+ return (curriedFunc, curriedIterable) =>
209
+ parallelMap(concurrency, curriedFunc, curriedIterable)
210
+ }
211
+ if (iterable === undefined) {
212
+ return curriedIterable => parallelMap(concurrency, func, curriedIterable)
213
+ }
214
+ if (concurrency === 1) {
215
+ return map(func, iterable)
216
+ }
217
+ return _parallelMap(concurrency, func, iterable)
218
+ }
219
+ function _transform(concurrency, func, iterable) {
220
+ const iterator = getIterator(iterable)
221
+ const resultQueue = []
222
+ const readQueue = []
223
+ let ended = false
224
+ let reading = false
225
+ let inflightCount = 0
226
+ let lastError = null
227
+ function fulfillReadQueue() {
228
+ while (readQueue.length > 0 && resultQueue.length > 0) {
229
+ const { resolve } = readQueue.shift()
230
+ const value = resultQueue.shift()
231
+ resolve({
232
+ done: false,
233
+ value
234
+ })
235
+ }
236
+ while (readQueue.length > 0 && inflightCount === 0 && ended) {
237
+ const { resolve, reject } = readQueue.shift()
238
+ if (lastError) {
239
+ reject(lastError)
240
+ lastError = null
241
+ } else {
242
+ resolve({
243
+ done: true,
244
+ value: undefined
245
+ })
246
+ }
247
+ }
248
+ }
249
+ async function fillQueue() {
250
+ if (ended) {
251
+ fulfillReadQueue()
252
+ return
253
+ }
254
+ if (reading) {
255
+ return
256
+ }
257
+ if (inflightCount + resultQueue.length >= concurrency) {
258
+ return
259
+ }
260
+ reading = true
261
+ inflightCount++
262
+ try {
263
+ const { done, value } = await iterator.next()
264
+ if (done) {
265
+ ended = true
266
+ inflightCount--
267
+ fulfillReadQueue()
268
+ } else {
269
+ mapAndQueue(value)
270
+ }
271
+ } catch (error) {
272
+ ended = true
273
+ inflightCount--
274
+ lastError = error
275
+ fulfillReadQueue()
276
+ }
277
+ reading = false
278
+ fillQueue()
279
+ }
280
+ async function mapAndQueue(itrValue) {
281
+ try {
282
+ const value = await func(itrValue)
283
+ resultQueue.push(value)
284
+ } catch (error) {
285
+ ended = true
286
+ lastError = error
287
+ }
288
+ inflightCount--
289
+ fulfillReadQueue()
290
+ fillQueue()
291
+ }
292
+ async function next() {
293
+ if (resultQueue.length === 0) {
294
+ const deferred = defer()
295
+ readQueue.push(deferred)
296
+ fillQueue()
297
+ return deferred.promise
298
+ }
299
+ const value = resultQueue.shift()
300
+ fillQueue()
301
+ return {
302
+ done: false,
303
+ value
304
+ }
305
+ }
306
+ const asyncIterableIterator = {
307
+ next,
308
+ [Symbol.asyncIterator]: () => asyncIterableIterator
309
+ }
310
+ return asyncIterableIterator
311
+ }
312
+ function transform(concurrency, func, iterable) {
313
+ if (func === undefined) {
314
+ return (curriedFunc, curriedIterable) =>
315
+ curriedIterable
316
+ ? transform(concurrency, curriedFunc, curriedIterable)
317
+ : transform(concurrency, curriedFunc)
318
+ }
319
+ if (iterable === undefined) {
320
+ return curriedIterable => transform(concurrency, func, curriedIterable)
321
+ }
322
+ return _transform(concurrency, func, iterable)
323
+ }
324
+
325
+ exports.parallelMap = parallelMap
326
+ exports.transform = transform
@@ -28,6 +28,12 @@ module.exports = ObjectFreeze({
28
28
  envAsString(env.NODE_ENV).toLowerCase() === 'development'
29
29
  ? 'development'
30
30
  : 'production',
31
+ // A space-separated list of command-line options. `options...` are interpreted
32
+ // before command-line options, so command-line options will override or compound
33
+ // after anything in `options...`. Node.js will exit with an error if an option
34
+ // that is not allowed in the environment is used, such as `-p` or a script file.
35
+ // https://nodejs.org/api/cli.html#node_optionsoptions
36
+ NODE_OPTIONS: envAsString(env.NODE_OPTIONS),
31
37
  // PRE_COMMIT is set to '1' by our 'test-pre-commit' script run by the
32
38
  // .husky/pre-commit hook.
33
39
  PRE_COMMIT: envAsBoolean(env.PRE_COMMIT),
@@ -10,17 +10,17 @@ function getPicomatch() {
10
10
  return _picomatch
11
11
  }
12
12
 
13
- let _tinyGlobby
13
+ let _fastGlob
14
14
  /*@__NO_SIDE_EFFECTS__*/
15
- function getTinyGlobby() {
16
- if (_tinyGlobby === undefined) {
17
- _tinyGlobby = /*@__PURE__*/ require('../external/tinyglobby')
15
+ function getFastGlob() {
16
+ if (_fastGlob === undefined) {
17
+ _fastGlob = /*@__PURE__*/ require('../external/fast-glob')
18
18
  }
19
- return _tinyGlobby
19
+ return _fastGlob
20
20
  }
21
21
 
22
22
  /*@__NO_SIDE_EFFECTS__*/
23
- async function globLicenses(dirname, options) {
23
+ function globStreamLicenses(dirname, options) {
24
24
  const {
25
25
  ignore: ignoreOpt,
26
26
  ignoreOriginals,
@@ -36,8 +36,8 @@ async function globLicenses(dirname, options) {
36
36
  /*@__PURE__*/ require('./constants/license-original-glob-recursive')
37
37
  )
38
38
  }
39
- const tinyGlobby = getTinyGlobby()
40
- return await tinyGlobby.glob(
39
+ const fastGlob = getFastGlob()
40
+ return fastGlob.globStream(
41
41
  [
42
42
  recursive
43
43
  ? /*@__PURE__*/ require('./constants/license-glob-recursive')
@@ -48,7 +48,6 @@ async function globLicenses(dirname, options) {
48
48
  absolute: true,
49
49
  caseSensitiveMatch: false,
50
50
  cwd: dirname,
51
- expandDirectories: recursive,
52
51
  ...globOptions,
53
52
  ...(ignore ? { ignore } : {})
54
53
  }
@@ -76,5 +75,5 @@ function getGlobMatcher(glob, options) {
76
75
 
77
76
  module.exports = {
78
77
  getGlobMatcher,
79
- globLicenses
78
+ globStreamLicenses
80
79
  }
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ const { apply: ReflectApply } = Reflect
4
+
5
+ let _streamingIterables
6
+ /*@__NO_SIDE_EFFECTS__*/
7
+ function getStreamingIterables() {
8
+ if (_streamingIterables === undefined) {
9
+ _streamingIterables = /*@__PURE__*/ require('../external/streaming-iterables')
10
+ }
11
+ return _streamingIterables
12
+ }
13
+
14
+ /*@__NO_SIDE_EFFECTS__*/
15
+ async function parallelForEach(concurrency, func, iterable) {
16
+ for await (const _ of parallelMap(concurrency, func, iterable)) {
17
+ /* empty block */
18
+ }
19
+ }
20
+
21
+ /*@__NO_SIDE_EFFECTS__*/
22
+ function parallelMap(...args) {
23
+ const streamingIterables = getStreamingIterables()
24
+ return ReflectApply(streamingIterables.parallelMap, undefined, args)
25
+ }
26
+
27
+ /*@__NO_SIDE_EFFECTS__*/
28
+ function transform(...args) {
29
+ const streamingIterables = getStreamingIterables()
30
+ return ReflectApply(streamingIterables.transform, undefined, args)
31
+ }
32
+
33
+ module.exports = {
34
+ parallelForEach,
35
+ parallelMap,
36
+ transform
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli-with-sentry",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "description": "CLI 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",
@@ -87,7 +87,7 @@
87
87
  "@biomejs/biome": "2.1.3",
88
88
  "@coana-tech/cli": "14.10.6",
89
89
  "@cyclonedx/cdxgen": "11.4.4",
90
- "@dotenvx/dotenvx": "1.48.3",
90
+ "@dotenvx/dotenvx": "1.48.4",
91
91
  "@eslint/compat": "1.3.1",
92
92
  "@eslint/js": "9.32.0",
93
93
  "@npmcli/arborist": "9.1.3",
@@ -97,9 +97,9 @@
97
97
  "@octokit/request-error": "7.0.0",
98
98
  "@octokit/rest": "22.0.0",
99
99
  "@octokit/types": "14.1.0",
100
- "@pnpm/dependency-path": "1001.0.2",
101
- "@pnpm/lockfile.detect-dep-types": "1001.0.12",
102
- "@pnpm/lockfile.fs": "1001.1.16",
100
+ "@pnpm/dependency-path": "1001.1.0",
101
+ "@pnpm/lockfile.detect-dep-types": "1001.0.13",
102
+ "@pnpm/lockfile.fs": "1001.1.17",
103
103
  "@pnpm/logger": "1001.0.0",
104
104
  "@rollup/plugin-babel": "6.0.4",
105
105
  "@rollup/plugin-commonjs": "28.0.6",
@@ -112,7 +112,7 @@
112
112
  "@socketregistry/is-interactive": "1.0.6",
113
113
  "@socketregistry/packageurl-js": "1.0.8",
114
114
  "@socketsecurity/config": "3.0.1",
115
- "@socketsecurity/registry": "1.0.249",
115
+ "@socketsecurity/registry": "1.0.254",
116
116
  "@socketsecurity/sdk": "1.4.67",
117
117
  "@types/blessed": "0.1.25",
118
118
  "@types/cmd-shim": "5.0.2",
@@ -127,14 +127,14 @@
127
127
  "@types/which": "3.0.4",
128
128
  "@types/yargs-parser": "21.0.3",
129
129
  "@typescript-eslint/parser": "8.38.0",
130
- "@typescript/native-preview": "7.0.0-dev.20250729.2",
130
+ "@typescript/native-preview": "7.0.0-dev.20250801.1",
131
131
  "@vitest/coverage-v8": "3.2.4",
132
132
  "blessed": "0.1.81",
133
133
  "blessed-contrib": "4.11.0",
134
134
  "browserslist": "4.25.1",
135
135
  "chalk-table": "1.0.2",
136
136
  "cmd-shim": "7.0.0",
137
- "custompatch": "1.1.7",
137
+ "custompatch": "1.1.8",
138
138
  "del-cli": "6.0.0",
139
139
  "dev-null-cli": "2.0.0",
140
140
  "eslint": "9.32.0",
@@ -143,18 +143,19 @@
143
143
  "eslint-plugin-n": "17.21.3",
144
144
  "eslint-plugin-sort-destructure-keys": "2.0.0",
145
145
  "eslint-plugin-unicorn": "56.0.1",
146
+ "fast-glob": "3.3.3",
146
147
  "globals": "16.3.0",
147
148
  "hpagent": "1.2.0",
148
149
  "husky": "9.1.7",
149
150
  "ignore": "7.0.5",
150
- "js-yaml": "npm:@zkochan/js-yaml@0.0.7",
151
+ "js-yaml": "npm:@zkochan/js-yaml@0.0.9",
151
152
  "knip": "5.62.0",
152
153
  "lint-staged": "16.1.2",
153
154
  "magic-string": "0.30.17",
154
155
  "meow": "13.2.0",
155
156
  "micromatch": "4.0.8",
156
157
  "mock-fs": "5.5.0",
157
- "nock": "14.0.7",
158
+ "nock": "14.0.8",
158
159
  "npm-package-arg": "13.0.0",
159
160
  "npm-run-all2": "8.0.4",
160
161
  "open": "10.2.0",
@@ -162,12 +163,11 @@
162
163
  "pony-cause": "2.1.11",
163
164
  "registry-auth-token": "5.1.0",
164
165
  "registry-url": "7.2.0",
165
- "rollup": "4.46.1",
166
+ "rollup": "4.46.2",
166
167
  "semver": "7.7.2",
167
168
  "synp": "1.9.14",
168
169
  "terminal-link": "2.1.1",
169
170
  "tiny-updater": "3.5.3",
170
- "tinyglobby": "0.2.14",
171
171
  "trash": "9.0.0",
172
172
  "type-coverage": "2.29.7",
173
173
  "typescript-eslint": "8.38.0",
@@ -239,6 +239,6 @@
239
239
  "strict": true
240
240
  },
241
241
  "dependencies": {
242
- "@sentry/node": "9.43.0"
242
+ "@sentry/node": "10.0.0"
243
243
  }
244
244
  }