@socketsecurity/cli-with-sentry 1.1.0 → 1.1.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.
Files changed (42) hide show
  1. package/dist/cli.js +123 -324
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +3 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/shadow-npm-bin.js +4 -4
  6. package/dist/shadow-npm-bin.js.map +1 -1
  7. package/dist/shadow-npm-inject.js +4 -4
  8. package/dist/shadow-npm-inject.js.map +1 -1
  9. package/dist/socket-completion.bash +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/commands/fix/coana-fix.d.mts.map +1 -1
  13. package/dist/types/commands/fix/{fix-env-helpers.d.mts → env-helpers.d.mts} +1 -1
  14. package/dist/types/commands/fix/env-helpers.d.mts.map +1 -0
  15. package/dist/types/commands/fix/git.d.mts +13 -0
  16. package/dist/types/commands/fix/git.d.mts.map +1 -0
  17. package/dist/types/commands/fix/pull-request.d.mts +10 -53
  18. package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
  19. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +2 -0
  20. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -1
  21. package/dist/types/shadow/npm/paths.d.mts +0 -1
  22. package/dist/types/shadow/npm/paths.d.mts.map +1 -1
  23. package/dist/types/utils/fs.d.mts +0 -1
  24. package/dist/types/utils/fs.d.mts.map +1 -1
  25. package/dist/types/utils/github.d.mts +38 -0
  26. package/dist/types/utils/github.d.mts.map +1 -0
  27. package/dist/types/utils/glob.d.mts +0 -1
  28. package/dist/types/utils/glob.d.mts.map +1 -1
  29. package/dist/utils.js +205 -18
  30. package/dist/utils.js.map +1 -1
  31. package/dist/vendor.js +55 -49
  32. package/external/@socketsecurity/registry/external/libnpmpack.js +96569 -41361
  33. package/external/@socketsecurity/registry/external/pacote.js +77357 -68133
  34. package/external/@socketsecurity/registry/lib/fs.js +13 -27
  35. package/external/@socketsecurity/registry/lib/json.js +42 -0
  36. package/external/@socketsecurity/registry/manifest.json +4 -4
  37. package/package.json +7 -7
  38. package/dist/types/commands/fix/fix-branch-helpers.d.mts +0 -4
  39. package/dist/types/commands/fix/fix-branch-helpers.d.mts.map +0 -1
  40. package/dist/types/commands/fix/fix-env-helpers.d.mts.map +0 -1
  41. package/dist/types/commands/fix/socket-git.d.mts +0 -32
  42. package/dist/types/commands/fix/socket-git.d.mts.map +0 -1
@@ -3,9 +3,9 @@
3
3
  const { freeze: ObjectFreeze } = Object
4
4
 
5
5
  const { defaultIgnore, getGlobMatcher } = /*@__PURE__*/ require('./globs')
6
+ const { jsonParse } = /*@__PURE__*/ require('./json')
6
7
  const { naturalCompare } = /*@__PURE__*/ require('./sorts')
7
8
  const { pathLikeToString } = /*@__PURE__*/ require('./path')
8
- const { stripBom } = /*@__PURE__*/ require('./strings')
9
9
 
10
10
  const defaultRemoveOptions = ObjectFreeze({
11
11
  __proto__: null,
@@ -94,22 +94,6 @@ function isSymLinkSync(filepath) {
94
94
  return false
95
95
  }
96
96
 
97
- /*@__NO_SIDE_EFFECTS__*/
98
- function parse(filepath, content, reviver, shouldThrow) {
99
- const jsonStr = Buffer.isBuffer(content) ? content.toString('utf8') : content
100
- try {
101
- return JSON.parse(stripBom(jsonStr), reviver)
102
- } catch (e) {
103
- if (shouldThrow) {
104
- if (e) {
105
- e.message = `${filepath}: ${e.message}`
106
- }
107
- throw e
108
- }
109
- }
110
- return null
111
- }
112
-
113
97
  /*@__NO_SIDE_EFFECTS__*/
114
98
  async function readDirNames(dirname, options) {
115
99
  const fs = getFs()
@@ -164,16 +148,17 @@ async function readJson(filepath, options) {
164
148
  }
165
149
  const { reviver, throws, ...fsOptions } = { __proto__: null, ...options }
166
150
  const fs = getFs()
167
- const shouldThrow = throws === undefined || !!throws
168
- return parse(
169
- filepath,
151
+ return jsonParse(
170
152
  await fs.promises.readFile(filepath, {
171
153
  __proto__: null,
172
154
  encoding: 'utf8',
173
155
  ...fsOptions
174
156
  }),
175
- reviver,
176
- shouldThrow
157
+ {
158
+ filepath,
159
+ reviver,
160
+ throws
161
+ }
177
162
  )
178
163
  }
179
164
 
@@ -184,16 +169,17 @@ function readJsonSync(filepath, options) {
184
169
  }
185
170
  const { reviver, throws, ...fsOptions } = { __proto__: null, ...options }
186
171
  const fs = getFs()
187
- const shouldThrow = throws === undefined || !!throws
188
- return parse(
189
- filepath,
172
+ return jsonParse(
190
173
  fs.readFileSync(filepath, {
191
174
  __proto__: null,
192
175
  encoding: 'utf8',
193
176
  ...fsOptions
194
177
  }),
195
- reviver,
196
- shouldThrow
178
+ {
179
+ filepath,
180
+ reviver,
181
+ throws
182
+ }
197
183
  )
198
184
  }
199
185
 
@@ -0,0 +1,42 @@
1
+ 'use strict'
2
+
3
+ const { parse: JSONParse } = JSON
4
+
5
+ const { stripBom } = /*@__PURE__*/ require('./strings')
6
+
7
+ /*@__NO_SIDE_EFFECTS__*/
8
+ function isBuffer(x) {
9
+ if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
10
+ return false
11
+ }
12
+ if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
13
+ return false
14
+ }
15
+ if (x.length > 0 && typeof x[0] !== 'number') {
16
+ return false
17
+ }
18
+
19
+ const Ctor = x.constructor
20
+ return !!(typeof Ctor?.isBuffer === 'function' && Ctor.isBuffer(x))
21
+ }
22
+
23
+ /*@__NO_SIDE_EFFECTS__*/
24
+ function jsonParse(content, options) {
25
+ const { filepath, reviver, throws } = { __proto__: null, ...options }
26
+ const shouldThrow = throws === undefined || !!throws
27
+ const jsonStr = isBuffer(content) ? content.toString('utf8') : content
28
+ try {
29
+ return JSONParse(stripBom(jsonStr), reviver)
30
+ } catch (e) {
31
+ if (shouldThrow) {
32
+ if (e && typeof filepath === 'string') {
33
+ e.message = `${filepath}: ${e.message}`
34
+ }
35
+ throw e
36
+ }
37
+ }
38
+ return null
39
+ }
40
+ module.exports = {
41
+ jsonParse
42
+ }
@@ -297,7 +297,7 @@
297
297
  }
298
298
  ],
299
299
  [
300
- "pkg:npm/%40socketregistry/assert@1.0.18",
300
+ "pkg:npm/%40socketregistry/assert@1.0.19",
301
301
  {
302
302
  "categories": ["cleanup"],
303
303
  "engines": {
@@ -307,7 +307,7 @@
307
307
  "license": "MIT",
308
308
  "name": "@socketregistry/assert",
309
309
  "package": "assert",
310
- "version": "1.0.18"
310
+ "version": "1.0.19"
311
311
  }
312
312
  ],
313
313
  [
@@ -354,7 +354,7 @@
354
354
  }
355
355
  ],
356
356
  [
357
- "pkg:npm/%40socketregistry/deep-equal@1.0.17",
357
+ "pkg:npm/%40socketregistry/deep-equal@1.0.18",
358
358
  {
359
359
  "categories": ["cleanup"],
360
360
  "engines": {
@@ -364,7 +364,7 @@
364
364
  "license": "MIT",
365
365
  "name": "@socketregistry/deep-equal",
366
366
  "package": "deep-equal",
367
- "version": "1.0.17"
367
+ "version": "1.0.18"
368
368
  }
369
369
  ],
370
370
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli-with-sentry",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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",
@@ -107,20 +107,20 @@
107
107
  "@rollup/plugin-json": "6.1.0",
108
108
  "@rollup/plugin-node-resolve": "16.0.1",
109
109
  "@rollup/plugin-replace": "6.0.2",
110
- "@rollup/pluginutils": "5.2.0",
110
+ "@rollup/pluginutils": "5.3.0",
111
111
  "@socketregistry/hyrious__bun.lockb": "1.0.18",
112
112
  "@socketregistry/indent-string": "1.0.13",
113
113
  "@socketregistry/is-interactive": "1.0.6",
114
114
  "@socketregistry/packageurl-js": "1.0.9",
115
115
  "@socketsecurity/config": "3.0.1",
116
- "@socketsecurity/registry": "1.0.279",
117
- "@socketsecurity/sdk": "1.4.84",
116
+ "@socketsecurity/registry": "1.0.281",
117
+ "@socketsecurity/sdk": "1.4.85",
118
118
  "@types/blessed": "0.1.25",
119
119
  "@types/cmd-shim": "5.0.2",
120
120
  "@types/js-yaml": "4.0.9",
121
121
  "@types/micromatch": "4.0.9",
122
122
  "@types/mock-fs": "4.13.4",
123
- "@types/node": "24.3.0",
123
+ "@types/node": "24.3.1",
124
124
  "@types/npmcli__arborist": "6.3.1",
125
125
  "@types/npmcli__config": "6.0.3",
126
126
  "@types/proc-log": "3.0.4",
@@ -128,7 +128,7 @@
128
128
  "@types/which": "3.0.4",
129
129
  "@types/yargs-parser": "21.0.3",
130
130
  "@typescript-eslint/parser": "8.42.0",
131
- "@typescript/native-preview": "7.0.0-dev.20250903.1",
131
+ "@typescript/native-preview": "7.0.0-dev.20250904.1",
132
132
  "@vitest/coverage-v8": "3.2.4",
133
133
  "blessed": "0.1.81",
134
134
  "blessed-contrib": "4.11.0",
@@ -241,6 +241,6 @@
241
241
  "strict": true
242
242
  },
243
243
  "dependencies": {
244
- "@sentry/node": "10.9.0"
244
+ "@sentry/node": "10.10.0"
245
245
  }
246
246
  }
@@ -1,4 +0,0 @@
1
- import type { FixEnv } from './fix-env-helpers.mts';
2
- import type { PrMatch } from './pull-request.mts';
3
- export declare function getPrsForPurl(fixEnv: FixEnv | null | undefined, partialPurl: string): PrMatch[];
4
- //# sourceMappingURL=fix-branch-helpers.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-branch-helpers.d.mts","sourceRoot":"","sources":["../../../../src/commands/fix/fix-branch-helpers.mts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,WAAW,EAAE,MAAM,GAClB,OAAO,EAAE,CA+BX"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fix-env-helpers.d.mts","sourceRoot":"","sources":["../../../../src/commands/fix/fix-env-helpers.mts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAkBnD,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,GAAG,EAAE,OAAO,EAAE,CAAA;IACd,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;CAC1B;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAuDjD"}
@@ -1,32 +0,0 @@
1
- import { PackageURL } from '@socketregistry/packageurl-js';
2
- import type { SocketArtifact } from '../../utils/alert/artifact.mts';
3
- export type GitCreateAndPushBranchOptions = {
4
- cwd?: string | undefined;
5
- email?: string | undefined;
6
- user?: string | undefined;
7
- };
8
- export type SocketBranchParser = (branch: string) => SocketBranchParseResult | null;
9
- export type SocketBranchParseResult = {
10
- fullName: string;
11
- newVersion: string;
12
- type: string;
13
- workspace: string;
14
- version: string;
15
- };
16
- export type SocketBranchPatternOptions = {
17
- newVersion?: string | undefined;
18
- purl?: string | undefined;
19
- workspace?: string | undefined;
20
- };
21
- export declare function createSocketBranchParser(options?: SocketBranchPatternOptions | undefined): SocketBranchParser;
22
- export declare const genericSocketBranchParser: SocketBranchParser;
23
- export declare function getSocketBranchFullNameComponent(pkgName: string | PackageURL | SocketArtifact): string;
24
- export declare function getSocketBranchName(purl: string | PackageURL | SocketArtifact, newVersion: string, workspace?: string | undefined): string;
25
- export declare function getSocketBranchPackageVersionComponent(version: string | PackageURL | SocketArtifact): string;
26
- export declare function getSocketBranchPattern(options?: SocketBranchPatternOptions | undefined): RegExp;
27
- export declare function getSocketBranchPurlTypeComponent(purl: string | PackageURL | SocketArtifact): string;
28
- export declare function getSocketBranchWorkspaceComponent(workspace: string | undefined): string;
29
- export declare function getSocketCommitMessage(purl: string | PackageURL | SocketArtifact, newVersion: string, workspace?: string | undefined): string;
30
- export declare function getSocketPullRequestBody(purl: string | PackageURL | SocketArtifact, newVersion: string, workspace?: string | undefined): string;
31
- export declare function getSocketPullRequestTitle(purl: string | PackageURL | SocketArtifact, newVersion: string, workspace?: string | undefined): string;
32
- //# sourceMappingURL=socket-git.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"socket-git.d.mts","sourceRoot":"","sources":["../../../../src/commands/fix/socket-git.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAS1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,MAAM,MAAM,6BAA6B,GAAG;IAC1C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAMD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,MAAM,EAAE,MAAM,KACX,uBAAuB,GAAG,IAAI,CAAA;AAEnC,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,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