socket 1.1.0 → 1.1.2
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/dist/cli.js +465 -404
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/flags.js +5 -6
- package/dist/flags.js.map +1 -1
- package/dist/shadow-npm-bin.js +4 -4
- package/dist/shadow-npm-bin.js.map +1 -1
- package/dist/shadow-npm-inject.js +5 -8
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/socket-completion.bash +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/{fix-env-helpers.d.mts → env-helpers.d.mts} +1 -1
- package/dist/types/commands/fix/env-helpers.d.mts.map +1 -0
- package/dist/types/commands/fix/git.d.mts +13 -0
- package/dist/types/commands/fix/git.d.mts.map +1 -0
- package/dist/types/commands/fix/pull-request.d.mts +10 -53
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/dist/types/commands/patch/cmd-patch.d.mts.map +1 -1
- package/dist/types/commands/patch/handle-patch.d.mts +1 -1
- package/dist/types/commands/patch/handle-patch.d.mts.map +1 -1
- package/dist/types/commands/patch/manifest-schema.d.mts +34 -0
- package/dist/types/commands/patch/manifest-schema.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +2 -0
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -1
- package/dist/types/flags.d.mts +9 -8
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts.map +1 -1
- package/dist/types/shadow/npm/paths.d.mts +0 -1
- package/dist/types/shadow/npm/paths.d.mts.map +1 -1
- package/dist/types/utils/fs.d.mts +0 -1
- package/dist/types/utils/fs.d.mts.map +1 -1
- package/dist/types/utils/github.d.mts +38 -0
- package/dist/types/utils/github.d.mts.map +1 -0
- package/dist/types/utils/glob.d.mts +0 -1
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/utils.js +205 -18
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +3460 -140
- package/external/@socketsecurity/registry/external/libnpmpack.js +96569 -41361
- package/external/@socketsecurity/registry/external/pacote.js +77357 -68133
- package/external/@socketsecurity/registry/lib/fs.js +13 -27
- package/external/@socketsecurity/registry/lib/json.js +42 -0
- package/external/@socketsecurity/registry/manifest.json +4 -4
- package/package.json +8 -7
- package/dist/types/commands/fix/fix-branch-helpers.d.mts +0 -4
- package/dist/types/commands/fix/fix-branch-helpers.d.mts.map +0 -1
- package/dist/types/commands/fix/fix-env-helpers.d.mts.map +0 -1
- package/dist/types/commands/fix/socket-git.d.mts +0 -32
- 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
|
-
|
|
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
|
-
|
|
176
|
-
|
|
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
|
-
|
|
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
|
-
|
|
196
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
367
|
+
"version": "1.0.18"
|
|
368
368
|
}
|
|
369
369
|
],
|
|
370
370
|
[
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "socket",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "CLI for Socket.dev",
|
|
5
5
|
"homepage": "https://github.com/SocketDev/socket-cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -106,20 +106,20 @@
|
|
|
106
106
|
"@rollup/plugin-json": "6.1.0",
|
|
107
107
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
108
108
|
"@rollup/plugin-replace": "6.0.2",
|
|
109
|
-
"@rollup/pluginutils": "5.
|
|
109
|
+
"@rollup/pluginutils": "5.3.0",
|
|
110
110
|
"@socketregistry/hyrious__bun.lockb": "1.0.18",
|
|
111
111
|
"@socketregistry/indent-string": "1.0.13",
|
|
112
112
|
"@socketregistry/is-interactive": "1.0.6",
|
|
113
113
|
"@socketregistry/packageurl-js": "1.0.9",
|
|
114
114
|
"@socketsecurity/config": "3.0.1",
|
|
115
|
-
"@socketsecurity/registry": "1.0.
|
|
116
|
-
"@socketsecurity/sdk": "1.4.
|
|
115
|
+
"@socketsecurity/registry": "1.0.281",
|
|
116
|
+
"@socketsecurity/sdk": "1.4.85",
|
|
117
117
|
"@types/blessed": "0.1.25",
|
|
118
118
|
"@types/cmd-shim": "5.0.2",
|
|
119
119
|
"@types/js-yaml": "4.0.9",
|
|
120
120
|
"@types/micromatch": "4.0.9",
|
|
121
121
|
"@types/mock-fs": "4.13.4",
|
|
122
|
-
"@types/node": "24.3.
|
|
122
|
+
"@types/node": "24.3.1",
|
|
123
123
|
"@types/npmcli__arborist": "6.3.1",
|
|
124
124
|
"@types/npmcli__config": "6.0.3",
|
|
125
125
|
"@types/proc-log": "3.0.4",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"@types/which": "3.0.4",
|
|
128
128
|
"@types/yargs-parser": "21.0.3",
|
|
129
129
|
"@typescript-eslint/parser": "8.42.0",
|
|
130
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
130
|
+
"@typescript/native-preview": "7.0.0-dev.20250904.1",
|
|
131
131
|
"@vitest/coverage-v8": "3.2.4",
|
|
132
132
|
"blessed": "0.1.81",
|
|
133
133
|
"blessed-contrib": "4.11.0",
|
|
@@ -176,7 +176,8 @@
|
|
|
176
176
|
"which": "5.0.0",
|
|
177
177
|
"yaml": "2.8.1",
|
|
178
178
|
"yargs-parser": "22.0.0",
|
|
179
|
-
"yoctocolors-cjs": "2.1.3"
|
|
179
|
+
"yoctocolors-cjs": "2.1.3",
|
|
180
|
+
"zod": "4.1.5"
|
|
180
181
|
},
|
|
181
182
|
"overrides": {
|
|
182
183
|
"@octokit/graphql": "$@octokit/graphql",
|
|
@@ -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,GAA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