@socketsecurity/cli-with-sentry 0.14.44 → 0.14.46
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/constants.d.ts +2 -2
- package/dist/constants.js +192 -3
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +9 -7
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +30 -30
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/index.js +14 -14
- package/dist/module-sync/index.js.map +1 -1
- package/dist/module-sync/npm-paths.js +7 -7
- package/dist/module-sync/npm-paths.js.map +1 -1
- package/dist/module-sync/npm.js +6 -6
- package/dist/module-sync/npm.js.map +1 -1
- package/dist/module-sync/shadow-bin.js +12 -12
- package/dist/module-sync/shadow-bin.js.map +1 -1
- package/package.json +2 -1
- package/dist/module-sync/constants2.d.ts +0 -0
- package/dist/module-sync/constants2.js +0 -231
- package/dist/module-sync/constants2.js.map +0 -1
package/dist/constants.d.ts
CHANGED
|
@@ -25,15 +25,15 @@ type IPC = Readonly<{
|
|
|
25
25
|
SOCKET_CLI_SAFE_WRAPPER?: boolean;
|
|
26
26
|
}>;
|
|
27
27
|
declare const constants: {
|
|
28
|
+
readonly CI: "CI";
|
|
28
29
|
readonly [kInternalsSymbol]: registryConstants.Internals;
|
|
29
30
|
readonly NODE_MODULES: "node_modules";
|
|
30
31
|
readonly PACKAGE_JSON: "package.json";
|
|
31
|
-
readonly TAP: "TAP";
|
|
32
32
|
readonly kInternalsSymbol: unique symbol;
|
|
33
|
-
readonly CI: "CI";
|
|
34
33
|
readonly NODE_AUTH_TOKEN: "NODE_AUTH_TOKEN";
|
|
35
34
|
readonly NODE_ENV: "NODE_ENV";
|
|
36
35
|
readonly PRE_COMMIT: "PRE_COMMIT";
|
|
36
|
+
readonly TAP: "TAP";
|
|
37
37
|
readonly VITEST: "VITEST";
|
|
38
38
|
readonly AT_LATEST: "@latest";
|
|
39
39
|
readonly BIOME_JSON: "biome.json";
|
package/dist/constants.js
CHANGED
|
@@ -1,8 +1,197 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var constants = require('./constants2.js');
|
|
3
2
|
|
|
3
|
+
var fs = require('node:fs');
|
|
4
|
+
var path = require('node:path');
|
|
5
|
+
var process = require('node:process');
|
|
6
|
+
var registryConstants = require('@socketsecurity/registry/lib/constants');
|
|
7
|
+
var env = require('@socketsecurity/registry/lib/env');
|
|
4
8
|
|
|
9
|
+
const {
|
|
10
|
+
NODE_MODULES,
|
|
11
|
+
PACKAGE_JSON,
|
|
12
|
+
kInternalsSymbol,
|
|
13
|
+
[kInternalsSymbol]: {
|
|
14
|
+
createConstantsObject
|
|
15
|
+
}
|
|
16
|
+
} = registryConstants;
|
|
17
|
+
const ALERT_TYPE_CRITICAL_CVE = 'criticalCVE';
|
|
18
|
+
const ALERT_TYPE_CVE = 'cve';
|
|
19
|
+
const ALERT_TYPE_MEDIUM_CVE = 'mediumCVE';
|
|
20
|
+
const ALERT_TYPE_MILD_CVE = 'mildCVE';
|
|
21
|
+
const ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE = 'socketUpgradeAvailable';
|
|
22
|
+
const API_V0_URL = 'https://api.socket.dev/v0';
|
|
23
|
+
const BABEL_RUNTIME = '@babel/runtime';
|
|
24
|
+
const BINARY_LOCK_EXT = '.lockb';
|
|
25
|
+
const BUN = 'bun';
|
|
26
|
+
const CLI = 'cli';
|
|
27
|
+
const CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER = 'firstPatchedVersionIdentifier';
|
|
28
|
+
const CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE = 'vulnerableVersionRange';
|
|
29
|
+
const LOCK_EXT = '.lock';
|
|
30
|
+
const MODULE_SYNC = 'module-sync';
|
|
31
|
+
const NPM_INJECTION = 'npm-injection';
|
|
32
|
+
const NPM_REGISTRY_URL = 'https://registry.npmjs.org';
|
|
33
|
+
const NPX = 'npx';
|
|
34
|
+
const PNPM = 'pnpm';
|
|
35
|
+
const REQUIRE = 'require';
|
|
36
|
+
const SHADOW_BIN = 'shadow-bin';
|
|
37
|
+
const SOCKET = 'socket';
|
|
38
|
+
const SOCKET_CLI_DEBUG = 'SOCKET_CLI_DEBUG';
|
|
39
|
+
const SOCKET_CLI_FIX = 'SOCKET_CLI_FIX';
|
|
40
|
+
const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues';
|
|
41
|
+
const SOCKET_CLI_LEGACY_BUILD = 'SOCKET_CLI_LEGACY_BUILD';
|
|
42
|
+
const SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE';
|
|
43
|
+
const SOCKET_CLI_PUBLISHED_BUILD = 'SOCKET_CLI_PUBLISHED_BUILD';
|
|
44
|
+
const SOCKET_CLI_SAFE_WRAPPER = 'SOCKET_CLI_SAFE_WRAPPER';
|
|
45
|
+
const SOCKET_CLI_SENTRY_BUILD = 'SOCKET_CLI_SENTRY_BUILD';
|
|
46
|
+
const SOCKET_CLI_VERSION_HASH = 'SOCKET_CLI_VERSION_HASH';
|
|
47
|
+
const VLT = 'vlt';
|
|
48
|
+
const YARN = 'yarn';
|
|
49
|
+
const YARN_BERRY = `${YARN}/berry`;
|
|
50
|
+
const YARN_CLASSIC = `${YARN}/classic`;
|
|
51
|
+
let _Sentry;
|
|
52
|
+
const LAZY_BATCH_PURL_ENDPOINT = () => {
|
|
53
|
+
const query = new URLSearchParams();
|
|
54
|
+
query.append('alerts', 'true');
|
|
55
|
+
query.append('compact', 'true');
|
|
56
|
+
return `${API_V0_URL}/purl?${query}`;
|
|
57
|
+
};
|
|
58
|
+
const LAZY_DIST_TYPE = () => registryConstants.SUPPORTS_NODE_REQUIRE_MODULE ? MODULE_SYNC : REQUIRE;
|
|
59
|
+
const LAZY_ENV = () => Object.freeze({
|
|
60
|
+
// Lazily access registryConstants.ENV.
|
|
61
|
+
...registryConstants.ENV,
|
|
62
|
+
// Flag set to help debug Socket CLI.
|
|
63
|
+
[SOCKET_CLI_DEBUG]: env.envAsBoolean(process.env[SOCKET_CLI_DEBUG]),
|
|
64
|
+
// Inline the following environment values so that they CANNOT be influenced
|
|
65
|
+
// by user provided environment variables.
|
|
66
|
+
//
|
|
67
|
+
// Flag set to determine if this is the Legacy build.
|
|
68
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_LEGACY_BUILD]".
|
|
69
|
+
[SOCKET_CLI_LEGACY_BUILD]: false,
|
|
70
|
+
// Flag set to determine if this is a published build.
|
|
71
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_PUBLISHED_BUILD]".
|
|
72
|
+
[SOCKET_CLI_PUBLISHED_BUILD]: true,
|
|
73
|
+
// Flag set to determine if this is the Sentry build.
|
|
74
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_SENTRY_BUILD]".
|
|
75
|
+
[SOCKET_CLI_SENTRY_BUILD]: true,
|
|
76
|
+
// Flag set to determine the version hash of the build.
|
|
77
|
+
// The '@rollup/plugin-replace' will replace "process.env[SOCKET_CLI_VERSION_HASH]".
|
|
78
|
+
[SOCKET_CLI_VERSION_HASH]: "0.14.46:bbb426c:2ebaf778:pub"
|
|
79
|
+
});
|
|
80
|
+
const lazyCdxgenBinPath = () =>
|
|
81
|
+
// Lazily access constants.nmBinPath.
|
|
82
|
+
path.join(constants.nmBinPath, 'cdxgen');
|
|
83
|
+
const lazyDistPath = () =>
|
|
84
|
+
// Lazily access constants.rootDistPath and constants.DIST_TYPE.
|
|
85
|
+
path.join(constants.rootDistPath, constants.DIST_TYPE);
|
|
86
|
+
const lazyInstrumentWithSentryPath = () =>
|
|
87
|
+
// Lazily access constants.rootDistPath.
|
|
88
|
+
path.join(constants.rootDistPath, 'instrument-with-sentry.js');
|
|
89
|
+
const lazyNmBinPath = () =>
|
|
90
|
+
// Lazily access constants.rootPath.
|
|
91
|
+
path.join(constants.rootPath, `${NODE_MODULES}/.bin`);
|
|
92
|
+
const lazyNpmInjectionPath = () =>
|
|
93
|
+
// Lazily access constants.distPath.
|
|
94
|
+
path.join(constants.distPath, `${NPM_INJECTION}.js`);
|
|
95
|
+
const lazyRootBinPath = () =>
|
|
96
|
+
// Lazily access constants.rootPath.
|
|
97
|
+
path.join(constants.rootPath, 'bin');
|
|
98
|
+
const lazyRootDistPath = () =>
|
|
99
|
+
// Lazily access constants.rootPath.
|
|
100
|
+
path.join(constants.rootPath, 'dist');
|
|
101
|
+
const lazyRootPath = () =>
|
|
102
|
+
// The '@rollup/plugin-replace' will replace "process.env.['TAP']".
|
|
103
|
+
path.resolve(fs.realpathSync.native(__dirname), '..');
|
|
104
|
+
const lazyRootPkgJsonPath = () =>
|
|
105
|
+
// Lazily access constants.rootPath.
|
|
106
|
+
path.join(constants.rootPath, PACKAGE_JSON);
|
|
107
|
+
const lazyShadowBinPath = () =>
|
|
108
|
+
// Lazily access constants.rootPath.
|
|
109
|
+
path.join(constants.rootPath, SHADOW_BIN);
|
|
110
|
+
const lazySynpBinPath = () =>
|
|
111
|
+
// Lazily access constants.nmBinPath.
|
|
112
|
+
path.join(constants.nmBinPath, 'synp');
|
|
113
|
+
const constants = createConstantsObject({
|
|
114
|
+
ALERT_TYPE_CRITICAL_CVE,
|
|
115
|
+
ALERT_TYPE_CVE,
|
|
116
|
+
ALERT_TYPE_MEDIUM_CVE,
|
|
117
|
+
ALERT_TYPE_MILD_CVE,
|
|
118
|
+
ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE,
|
|
119
|
+
API_V0_URL,
|
|
120
|
+
BABEL_RUNTIME,
|
|
121
|
+
// Lazily defined values are initialized as `undefined` to keep their key order.
|
|
122
|
+
BATCH_PURL_ENDPOINT: undefined,
|
|
123
|
+
BINARY_LOCK_EXT,
|
|
124
|
+
BUN,
|
|
125
|
+
CLI,
|
|
126
|
+
CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,
|
|
127
|
+
CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE,
|
|
128
|
+
DIST_TYPE: undefined,
|
|
129
|
+
ENV: undefined,
|
|
130
|
+
LOCK_EXT,
|
|
131
|
+
MODULE_SYNC,
|
|
132
|
+
NPM_INJECTION,
|
|
133
|
+
NPM_REGISTRY_URL,
|
|
134
|
+
NPX,
|
|
135
|
+
PNPM,
|
|
136
|
+
REQUIRE,
|
|
137
|
+
SHADOW_BIN,
|
|
138
|
+
SOCKET,
|
|
139
|
+
SOCKET_CLI_DEBUG,
|
|
140
|
+
SOCKET_CLI_FIX,
|
|
141
|
+
SOCKET_CLI_ISSUES_URL,
|
|
142
|
+
SOCKET_CLI_LEGACY_BUILD,
|
|
143
|
+
SOCKET_CLI_OPTIMIZE,
|
|
144
|
+
SOCKET_CLI_PUBLISHED_BUILD,
|
|
145
|
+
SOCKET_CLI_SAFE_WRAPPER,
|
|
146
|
+
SOCKET_CLI_SENTRY_BUILD,
|
|
147
|
+
SOCKET_CLI_VERSION_HASH,
|
|
148
|
+
VLT,
|
|
149
|
+
YARN,
|
|
150
|
+
YARN_BERRY,
|
|
151
|
+
YARN_CLASSIC,
|
|
152
|
+
cdxgenBinPath: undefined,
|
|
153
|
+
distPath: undefined,
|
|
154
|
+
instrumentWithSentryPath: undefined,
|
|
155
|
+
nmBinPath: undefined,
|
|
156
|
+
npmInjectionPath: undefined,
|
|
157
|
+
rootBinPath: undefined,
|
|
158
|
+
rootDistPath: undefined,
|
|
159
|
+
rootPath: undefined,
|
|
160
|
+
rootPkgJsonPath: undefined,
|
|
161
|
+
shadowBinPath: undefined,
|
|
162
|
+
synpBinPath: undefined
|
|
163
|
+
}, {
|
|
164
|
+
getters: {
|
|
165
|
+
BATCH_PURL_ENDPOINT: LAZY_BATCH_PURL_ENDPOINT,
|
|
166
|
+
DIST_TYPE: LAZY_DIST_TYPE,
|
|
167
|
+
ENV: LAZY_ENV,
|
|
168
|
+
distPath: lazyDistPath,
|
|
169
|
+
cdxgenBinPath: lazyCdxgenBinPath,
|
|
170
|
+
instrumentWithSentryPath: lazyInstrumentWithSentryPath,
|
|
171
|
+
nmBinPath: lazyNmBinPath,
|
|
172
|
+
npmInjectionPath: lazyNpmInjectionPath,
|
|
173
|
+
rootBinPath: lazyRootBinPath,
|
|
174
|
+
rootDistPath: lazyRootDistPath,
|
|
175
|
+
rootPath: lazyRootPath,
|
|
176
|
+
rootPkgJsonPath: lazyRootPkgJsonPath,
|
|
177
|
+
shadowBinPath: lazyShadowBinPath,
|
|
178
|
+
synpBinPath: lazySynpBinPath
|
|
179
|
+
},
|
|
180
|
+
internals: {
|
|
181
|
+
getSentry() {
|
|
182
|
+
return _Sentry;
|
|
183
|
+
},
|
|
184
|
+
setSentry(Sentry) {
|
|
185
|
+
if (_Sentry === undefined) {
|
|
186
|
+
_Sentry = Sentry;
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
mixin: registryConstants
|
|
193
|
+
});
|
|
5
194
|
|
|
6
|
-
module.exports = constants
|
|
7
|
-
//# debugId=
|
|
195
|
+
module.exports = constants;
|
|
196
|
+
//# debugId=f78c9185-0736-4c65-8fa7-88f4d179ae89
|
|
8
197
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;","debugId":"415faf35-61fa-4973-8b4c-040eacb52c54"}
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["import { realpathSync } from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\n\nimport registryConstants from '@socketsecurity/registry/lib/constants'\nimport { envAsBoolean } from '@socketsecurity/registry/lib/env'\n\nimport type { Remap } from '@socketsecurity/registry/lib/objects'\n\nconst {\n NODE_MODULES,\n PACKAGE_JSON,\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: {\n createConstantsObject\n }\n} = registryConstants\n\ntype RegistryEnv = typeof registryConstants.ENV\n\ntype RegistryInternals = (typeof registryConstants)['Symbol(kInternalsSymbol)']\n\ntype Sentry = any\n\ntype Internals = Remap<\n Omit<RegistryInternals, 'getIPC'> &\n Readonly<{\n getIPC: {\n (): Promise<IPC>\n <K extends keyof IPC | undefined>(\n key?: K\n ): Promise<K extends keyof IPC ? IPC[K] : IPC>\n }\n getSentry: () => Sentry\n setSentry(Sentry: Sentry): boolean\n }>\n>\n\ntype ENV = Remap<\n RegistryEnv &\n Readonly<{\n SOCKET_CLI_DEBUG: boolean\n SOCKET_CLI_LEGACY_BUILD: boolean\n SOCKET_CLI_PUBLISHED_BUILD: boolean\n SOCKET_CLI_SENTRY_BUILD: boolean\n SOCKET_CLI_VERSION_HASH: string\n }>\n>\n\ntype IPC = Readonly<{\n SOCKET_CLI_FIX?: string\n SOCKET_CLI_OPTIMIZE?: boolean\n SOCKET_CLI_SAFE_WRAPPER?: boolean\n}>\n\ntype Constants = Remap<\n Omit<typeof registryConstants, 'Symbol(kInternalsSymbol)' | 'ENV' | 'IPC'> & {\n readonly 'Symbol(kInternalsSymbol)': Internals\n readonly ALERT_TYPE_CRITICAL_CVE: 'criticalCVE'\n readonly ALERT_TYPE_CVE: 'cve'\n readonly ALERT_TYPE_MEDIUM_CVE: 'mediumCVE'\n readonly ALERT_TYPE_MILD_CVE: 'mildCVE'\n readonly ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE: 'socketUpgradeAvailable'\n readonly API_V0_URL: 'https://api.socket.dev/v0'\n readonly BABEL_RUNTIME: '@babel/runtime'\n readonly BATCH_PURL_ENDPOINT: 'https://api.socket.dev/v0/purl?alerts=true&compact=true'\n readonly BINARY_LOCK_EXT: '.lockb'\n readonly BUN: 'bun'\n readonly CLI: 'cli'\n readonly CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER: 'firstPatchedVersionIdentifier'\n readonly CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE: 'vulnerableVersionRange'\n readonly ENV: ENV\n readonly DIST_TYPE: 'module-sync' | 'require'\n readonly IPC: IPC\n readonly LOCK_EXT: '.lock'\n readonly MODULE_SYNC: 'module-sync'\n readonly NPM_INJECTION: 'npm-injection'\n readonly NPM_REGISTRY_URL: 'https://registry.npmjs.org'\n readonly NPX: 'npx'\n readonly PNPM: 'pnpm'\n readonly REQUIRE: 'require'\n readonly SHADOW_BIN: 'shadow-bin'\n readonly SOCKET: 'socket'\n readonly SOCKET_CLI_DEBUG: 'SOCKET_CLI_DEBUG'\n readonly SOCKET_CLI_FIX: 'SOCKET_CLI_FIX'\n readonly SOCKET_CLI_ISSUES_URL: 'https://github.com/SocketDev/socket-cli/issues'\n readonly SOCKET_CLI_LEGACY_BUILD: 'SOCKET_CLI_LEGACY_BUILD'\n readonly SOCKET_CLI_OPTIMIZE: 'SOCKET_CLI_OPTIMIZE'\n readonly SOCKET_CLI_PUBLISHED_BUILD: 'SOCKET_CLI_PUBLISHED_BUILD'\n readonly SOCKET_CLI_SAFE_WRAPPER: 'SOCKET_CLI_SAFE_WRAPPER'\n readonly SOCKET_CLI_SENTRY_BUILD: 'SOCKET_CLI_SENTRY_BUILD'\n readonly SOCKET_CLI_VERSION_HASH: 'SOCKET_CLI_VERSION_HASH'\n readonly VLT: 'vlt'\n readonly YARN: 'yarn'\n readonly YARN_BERRY: 'yarn/berry'\n readonly YARN_CLASSIC: 'yarn/classic'\n readonly cdxgenBinPath: string\n readonly distPath: string\n readonly instrumentWithSentryPath: string\n readonly nmBinPath: string\n readonly npmInjectionPath: string\n readonly rootBinPath: string\n readonly rootDistPath: string\n readonly rootPath: string\n readonly rootPkgJsonPath: string\n readonly shadowBinPath: string\n readonly synpBinPath: string\n }\n>\n\nconst ALERT_TYPE_CRITICAL_CVE = 'criticalCVE'\nconst ALERT_TYPE_CVE = 'cve'\nconst ALERT_TYPE_MEDIUM_CVE = 'mediumCVE'\nconst ALERT_TYPE_MILD_CVE = 'mildCVE'\nconst ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE = 'socketUpgradeAvailable'\nconst API_V0_URL = 'https://api.socket.dev/v0'\nconst BABEL_RUNTIME = '@babel/runtime'\nconst BINARY_LOCK_EXT = '.lockb'\nconst BUN = 'bun'\nconst CLI = 'cli'\nconst CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER =\n 'firstPatchedVersionIdentifier'\nconst CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE = 'vulnerableVersionRange'\nconst LOCK_EXT = '.lock'\nconst MODULE_SYNC = 'module-sync'\nconst NPM_INJECTION = 'npm-injection'\nconst NPM_REGISTRY_URL = 'https://registry.npmjs.org'\nconst NPX = 'npx'\nconst PNPM = 'pnpm'\nconst REQUIRE = 'require'\nconst SHADOW_BIN = 'shadow-bin'\nconst SOCKET = 'socket'\nconst SOCKET_CLI_DEBUG = 'SOCKET_CLI_DEBUG'\nconst SOCKET_CLI_FIX = 'SOCKET_CLI_FIX'\nconst SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'\nconst SOCKET_CLI_LEGACY_BUILD = 'SOCKET_CLI_LEGACY_BUILD'\nconst SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE'\nconst SOCKET_CLI_PUBLISHED_BUILD = 'SOCKET_CLI_PUBLISHED_BUILD'\nconst SOCKET_CLI_SAFE_WRAPPER = 'SOCKET_CLI_SAFE_WRAPPER'\nconst SOCKET_CLI_SENTRY_BUILD = 'SOCKET_CLI_SENTRY_BUILD'\nconst SOCKET_CLI_VERSION_HASH = 'SOCKET_CLI_VERSION_HASH'\nconst VLT = 'vlt'\nconst YARN = 'yarn'\nconst YARN_BERRY = `${YARN}/berry`\nconst YARN_CLASSIC = `${YARN}/classic`\n\nlet _Sentry: any\n\nconst LAZY_BATCH_PURL_ENDPOINT = () => {\n const query = new URLSearchParams()\n query.append('alerts', 'true')\n query.append('compact', 'true')\n return `${API_V0_URL}/purl?${query}`\n}\n\nconst LAZY_DIST_TYPE = () =>\n registryConstants.SUPPORTS_NODE_REQUIRE_MODULE ? MODULE_SYNC : REQUIRE\n\nconst LAZY_ENV = () =>\n Object.freeze({\n // Lazily access registryConstants.ENV.\n ...registryConstants.ENV,\n // Flag set to help debug Socket CLI.\n [SOCKET_CLI_DEBUG]: envAsBoolean(process.env[SOCKET_CLI_DEBUG]),\n // Inline the following environment values so that they CANNOT be influenced\n // by user provided environment variables.\n //\n // Flag set to determine if this is the Legacy build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_LEGACY_BUILD]\".\n [SOCKET_CLI_LEGACY_BUILD]: process.env[SOCKET_CLI_LEGACY_BUILD],\n // Flag set to determine if this is a published build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_PUBLISHED_BUILD]\".\n [SOCKET_CLI_PUBLISHED_BUILD]: process.env[SOCKET_CLI_PUBLISHED_BUILD],\n // Flag set to determine if this is the Sentry build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_SENTRY_BUILD]\".\n [SOCKET_CLI_SENTRY_BUILD]: process.env[SOCKET_CLI_SENTRY_BUILD],\n // Flag set to determine the version hash of the build.\n // The '@rollup/plugin-replace' will replace \"process.env[SOCKET_CLI_VERSION_HASH]\".\n [SOCKET_CLI_VERSION_HASH]: process.env[SOCKET_CLI_VERSION_HASH]\n })\n\nconst lazyCdxgenBinPath = () =>\n // Lazily access constants.nmBinPath.\n path.join(constants.nmBinPath, 'cdxgen')\n\nconst lazyDistPath = () =>\n // Lazily access constants.rootDistPath and constants.DIST_TYPE.\n path.join(constants.rootDistPath, constants.DIST_TYPE)\n\nconst lazyInstrumentWithSentryPath = () =>\n // Lazily access constants.rootDistPath.\n path.join(constants.rootDistPath, 'instrument-with-sentry.js')\n\nconst lazyNmBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, `${NODE_MODULES}/.bin`)\n\nconst lazyNpmInjectionPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, `${NPM_INJECTION}.js`)\n\nconst lazyRootBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'bin')\n\nconst lazyRootDistPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'dist')\n\nconst lazyRootPath = () =>\n // The '@rollup/plugin-replace' will replace \"process.env.['TAP']\".\n path.resolve(\n realpathSync.native(__dirname),\n process.env['TAP'] ? '../..' : '..'\n )\n\nconst lazyRootPkgJsonPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, PACKAGE_JSON)\n\nconst lazyShadowBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, SHADOW_BIN)\n\nconst lazySynpBinPath = () =>\n // Lazily access constants.nmBinPath.\n path.join(constants.nmBinPath, 'synp')\n\nconst constants = <Constants>createConstantsObject(\n {\n ALERT_TYPE_CRITICAL_CVE,\n ALERT_TYPE_CVE,\n ALERT_TYPE_MEDIUM_CVE,\n ALERT_TYPE_MILD_CVE,\n ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE,\n API_V0_URL,\n BABEL_RUNTIME,\n // Lazily defined values are initialized as `undefined` to keep their key order.\n BATCH_PURL_ENDPOINT: undefined,\n BINARY_LOCK_EXT,\n BUN,\n CLI,\n CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,\n CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE,\n DIST_TYPE: undefined,\n ENV: undefined,\n LOCK_EXT,\n MODULE_SYNC,\n NPM_INJECTION,\n NPM_REGISTRY_URL,\n NPX,\n PNPM,\n REQUIRE,\n SHADOW_BIN,\n SOCKET,\n SOCKET_CLI_DEBUG,\n SOCKET_CLI_FIX,\n SOCKET_CLI_ISSUES_URL,\n SOCKET_CLI_LEGACY_BUILD,\n SOCKET_CLI_OPTIMIZE,\n SOCKET_CLI_PUBLISHED_BUILD,\n SOCKET_CLI_SAFE_WRAPPER,\n SOCKET_CLI_SENTRY_BUILD,\n SOCKET_CLI_VERSION_HASH,\n VLT,\n YARN,\n YARN_BERRY,\n YARN_CLASSIC,\n cdxgenBinPath: undefined,\n distPath: undefined,\n instrumentWithSentryPath: undefined,\n nmBinPath: undefined,\n npmInjectionPath: undefined,\n rootBinPath: undefined,\n rootDistPath: undefined,\n rootPath: undefined,\n rootPkgJsonPath: undefined,\n shadowBinPath: undefined,\n synpBinPath: undefined\n },\n {\n getters: {\n BATCH_PURL_ENDPOINT: LAZY_BATCH_PURL_ENDPOINT,\n DIST_TYPE: LAZY_DIST_TYPE,\n ENV: LAZY_ENV,\n distPath: lazyDistPath,\n cdxgenBinPath: lazyCdxgenBinPath,\n instrumentWithSentryPath: lazyInstrumentWithSentryPath,\n nmBinPath: lazyNmBinPath,\n npmInjectionPath: lazyNpmInjectionPath,\n rootBinPath: lazyRootBinPath,\n rootDistPath: lazyRootDistPath,\n rootPath: lazyRootPath,\n rootPkgJsonPath: lazyRootPkgJsonPath,\n shadowBinPath: lazyShadowBinPath,\n synpBinPath: lazySynpBinPath\n },\n internals: {\n getSentry() {\n return _Sentry\n },\n setSentry(Sentry: Sentry): boolean {\n if (_Sentry === undefined) {\n _Sentry = Sentry\n return true\n }\n return false\n }\n },\n mixin: registryConstants\n }\n)\n\nexport default constants\n"],"names":["createConstantsObject","query","path","constants","BATCH_PURL_ENDPOINT","DIST_TYPE","ENV","cdxgenBinPath","distPath","instrumentWithSentryPath","nmBinPath","npmInjectionPath","rootBinPath","rootDistPath","rootPath","rootPkgJsonPath","shadowBinPath","synpBinPath","getters","internals","getSentry","_Sentry","mixin"],"mappings":";;;;;;;;AASA;;;;AAIE;AACEA;AACF;AACF;AA8FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACE;AACAC;AACAA;AACA;AACF;AAEA;AAGA;AAEI;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF;AAEF;AACE;AACAC;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAKF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEIC;;;;;;;;AASF;AACAC;;;;;;AAMAC;AACAC;;;;;;;;;;;;;;;;;;;;;;;AAuBAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAEEC;AACEd;AACAC;AACAC;AACAE;AACAD;AACAE;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;;AAEFE;AACEC;AACE;;;;AAIEC;AACA;AACF;AACA;AACF;;AAEFC;AACF;;","debugId":"f78c9185-0736-4c65-8fa7-88f4d179ae89"}
|
|
@@ -10,20 +10,22 @@ function _socketInterop(e) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
var require$$0 = _socketInterop(require('@sentry/node'));
|
|
13
|
-
var constants = require('./constants2.js');
|
|
14
13
|
|
|
15
14
|
var instrumentWithSentry = {};
|
|
16
15
|
|
|
17
16
|
// This should ONLY be included in the special Sentry build!
|
|
18
17
|
// Otherwise the Sentry dependency won't even be present in the manifest.
|
|
19
18
|
|
|
19
|
+
// Require constants with require(relConstantsPath) instead of require('./constants')
|
|
20
|
+
// so Rollup doesn't generate a constants2.js chunk.
|
|
21
|
+
const relConstantsPath = './constants';
|
|
20
22
|
// The '@rollup/plugin-replace' will replace "process.env['SOCKET_CLI_SENTRY_BUILD']".
|
|
21
23
|
{
|
|
22
24
|
const Sentry = require$$0;
|
|
23
25
|
Sentry.init({
|
|
24
26
|
onFatalError(error) {
|
|
25
27
|
// Defer module loads until after Sentry.init is called.
|
|
26
|
-
if (
|
|
28
|
+
if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {
|
|
27
29
|
console.error('[DEBUG] [Sentry onFatalError]:', error);
|
|
28
30
|
}
|
|
29
31
|
},
|
|
@@ -36,9 +38,9 @@ var instrumentWithSentry = {};
|
|
|
36
38
|
'pub' );
|
|
37
39
|
Sentry.setTag('version',
|
|
38
40
|
// The '@rollup/plugin-replace' will replace "process.env['SOCKET_CLI_VERSION_HASH']".
|
|
39
|
-
"0.14.
|
|
40
|
-
const constants
|
|
41
|
-
if (constants
|
|
41
|
+
"0.14.46:bbb426c:2ebaf778:pub");
|
|
42
|
+
const constants = require(relConstantsPath);
|
|
43
|
+
if (constants.ENV.SOCKET_CLI_DEBUG) {
|
|
42
44
|
Sentry.setTag('debugging', true);
|
|
43
45
|
console.log('[DEBUG] Set up Sentry.');
|
|
44
46
|
} else {
|
|
@@ -49,10 +51,10 @@ var instrumentWithSentry = {};
|
|
|
49
51
|
[kInternalsSymbol]: {
|
|
50
52
|
setSentry
|
|
51
53
|
}
|
|
52
|
-
} = constants
|
|
54
|
+
} = constants;
|
|
53
55
|
setSentry(Sentry);
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
module.exports = instrumentWithSentry;
|
|
57
|
-
//# debugId=
|
|
59
|
+
//# debugId=f6ed194c-046b-4f37-b7e3-813d94301f8c
|
|
58
60
|
//# sourceMappingURL=instrument-with-sentry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument-with-sentry.js","sources":["../../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\n// The '@rollup/plugin-replace' will replace \"process.env['SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(
|
|
1
|
+
{"version":3,"file":"instrument-with-sentry.js","sources":["../../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n console.error('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['SOCKET_CLI_PUBLISHED_BUILD'] ? 'pub' : process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['SOCKET_CLI_VERSION_HASH']\".\n process.env['SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n console.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n console.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["console","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;;AAEA;AACA;AACA;AACA;AAC4C;AAC1C;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAIA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF;;","debugId":"f6ed194c-046b-4f37-b7e3-813d94301f8c"}
|
package/dist/module-sync/cli.js
CHANGED
|
@@ -30,7 +30,7 @@ var fs$1 = require('node:fs/promises');
|
|
|
30
30
|
var ScreenWidget = _socketInterop(require('blessed/lib/widgets/screen'));
|
|
31
31
|
var contrib = _socketInterop(require('blessed-contrib'));
|
|
32
32
|
var spinner = require('@socketsecurity/registry/lib/spinner');
|
|
33
|
-
var constants = require('./
|
|
33
|
+
var constants = require('./constants.js');
|
|
34
34
|
var prompts = require('@socketsecurity/registry/lib/prompts');
|
|
35
35
|
var yargsParse = _socketInterop(require('yargs-parser'));
|
|
36
36
|
var words = require('@socketsecurity/registry/lib/words');
|
|
@@ -1503,7 +1503,7 @@ async function run$z(argv, importMeta, {
|
|
|
1503
1503
|
|
|
1504
1504
|
const {
|
|
1505
1505
|
API_V0_URL
|
|
1506
|
-
} = constants
|
|
1506
|
+
} = constants;
|
|
1507
1507
|
function handleUnsuccessfulApiResponse(_name, result, spinner) {
|
|
1508
1508
|
// SocketSdkErrorType['error'] is not typed.
|
|
1509
1509
|
const resultErrorMessage = result.error?.message;
|
|
@@ -1965,7 +1965,7 @@ const {
|
|
|
1965
1965
|
PNPM: PNPM$8,
|
|
1966
1966
|
cdxgenBinPath,
|
|
1967
1967
|
synpBinPath
|
|
1968
|
-
} = constants
|
|
1968
|
+
} = constants;
|
|
1969
1969
|
const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', NPM$e, PNPM$8, 'ts', 'tsx', 'typescript']);
|
|
1970
1970
|
async function runCycloneDX(yargv) {
|
|
1971
1971
|
let cleanupPackageLock = false;
|
|
@@ -2401,7 +2401,7 @@ const cmdDiffScan = {
|
|
|
2401
2401
|
|
|
2402
2402
|
const {
|
|
2403
2403
|
NPM: NPM$d
|
|
2404
|
-
} = constants
|
|
2404
|
+
} = constants;
|
|
2405
2405
|
function isTopLevel(tree, node) {
|
|
2406
2406
|
return tree.children.get(node.name) === node;
|
|
2407
2407
|
}
|
|
@@ -2817,7 +2817,7 @@ function applyLogin(apiToken, enforcedOrgs, apiBaseUrl, apiProxy) {
|
|
|
2817
2817
|
|
|
2818
2818
|
const {
|
|
2819
2819
|
SOCKET_PUBLIC_API_TOKEN
|
|
2820
|
-
} = constants
|
|
2820
|
+
} = constants;
|
|
2821
2821
|
async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
2822
2822
|
const apiToken = (await prompts.password({
|
|
2823
2823
|
message: `Enter your ${terminalLink('Socket.dev API key', 'https://docs.socket.dev/docs/api-keys')} (leave blank for a public key)`
|
|
@@ -2999,7 +2999,7 @@ async function convertGradleToMaven(target, bin, _out, verbose, gradleOpts) {
|
|
|
2999
2999
|
// We could do a .socket folder. We could do a socket.pom.gz with all the poms, although I'd prefer something plain-text if it is to be committed.
|
|
3000
3000
|
|
|
3001
3001
|
// Note: init.gradle will be exported by .config/rollup.dist.config.mjs
|
|
3002
|
-
const initLocation = path.join(constants.
|
|
3002
|
+
const initLocation = path.join(constants.rootDistPath, 'init.gradle');
|
|
3003
3003
|
const commandArgs = ['--init-script', initLocation, ...gradleOpts, 'pom'];
|
|
3004
3004
|
if (verbose) {
|
|
3005
3005
|
console.log('\n[VERBOSE] Executing:', bin, commandArgs);
|
|
@@ -3718,16 +3718,16 @@ async function run$l(argv, importMeta, {
|
|
|
3718
3718
|
const {
|
|
3719
3719
|
NPM: NPM$b,
|
|
3720
3720
|
SHADOW_BIN: SHADOW_BIN$1
|
|
3721
|
-
} = constants
|
|
3721
|
+
} = constants;
|
|
3722
3722
|
async function wrapNpm(argv) {
|
|
3723
3723
|
// Lazily access constants.distPath.
|
|
3724
|
-
const shadowBin = require(`${constants.
|
|
3724
|
+
const shadowBin = require(`${constants.distPath}/${SHADOW_BIN$1}.js`);
|
|
3725
3725
|
await shadowBin(NPM$b, argv);
|
|
3726
3726
|
}
|
|
3727
3727
|
|
|
3728
3728
|
const {
|
|
3729
3729
|
NPM: NPM$a
|
|
3730
|
-
} = constants
|
|
3730
|
+
} = constants;
|
|
3731
3731
|
const config$k = {
|
|
3732
3732
|
commandName: 'npm',
|
|
3733
3733
|
description: `${NPM$a} wrapper functionality`,
|
|
@@ -3759,16 +3759,16 @@ async function run$k(argv, importMeta, {
|
|
|
3759
3759
|
const {
|
|
3760
3760
|
NPX: NPX$2,
|
|
3761
3761
|
SHADOW_BIN
|
|
3762
|
-
} = constants
|
|
3762
|
+
} = constants;
|
|
3763
3763
|
async function wrapNpx(argv) {
|
|
3764
3764
|
// Lazily access constants.distPath.
|
|
3765
|
-
const shadowBin = require(`${constants.
|
|
3765
|
+
const shadowBin = require(`${constants.distPath}/${SHADOW_BIN}.js`);
|
|
3766
3766
|
await shadowBin(NPX$2, argv);
|
|
3767
3767
|
}
|
|
3768
3768
|
|
|
3769
3769
|
const {
|
|
3770
3770
|
NPX: NPX$1
|
|
3771
|
-
} = constants
|
|
3771
|
+
} = constants;
|
|
3772
3772
|
const config$j = {
|
|
3773
3773
|
commandName: 'npx',
|
|
3774
3774
|
description: `${NPX$1} wrapper functionality`,
|
|
@@ -3833,7 +3833,7 @@ const {
|
|
|
3833
3833
|
VLT: VLT$6,
|
|
3834
3834
|
YARN_BERRY: YARN_BERRY$6,
|
|
3835
3835
|
YARN_CLASSIC: YARN_CLASSIC$6
|
|
3836
|
-
} = constants
|
|
3836
|
+
} = constants;
|
|
3837
3837
|
function matchHumanStdout(stdout, name) {
|
|
3838
3838
|
return stdout.includes(` ${name}@`);
|
|
3839
3839
|
}
|
|
@@ -3861,7 +3861,7 @@ const {
|
|
|
3861
3861
|
YARN,
|
|
3862
3862
|
YARN_BERRY: YARN_BERRY$5,
|
|
3863
3863
|
YARN_CLASSIC: YARN_CLASSIC$5
|
|
3864
|
-
} = constants
|
|
3864
|
+
} = constants;
|
|
3865
3865
|
const AGENTS = [BUN$5, NPM$8, PNPM$6, YARN_BERRY$5, YARN_CLASSIC$5, VLT$5];
|
|
3866
3866
|
const binByAgent = {
|
|
3867
3867
|
__proto__: null,
|
|
@@ -4003,7 +4003,7 @@ async function detect({
|
|
|
4003
4003
|
};
|
|
4004
4004
|
let lockSrc;
|
|
4005
4005
|
// Lazily access constants.maintainedNodeVersions.
|
|
4006
|
-
let minimumNodeVersion = constants.
|
|
4006
|
+
let minimumNodeVersion = constants.maintainedNodeVersions.previous;
|
|
4007
4007
|
if (pkgJson) {
|
|
4008
4008
|
const browserField = pkgJson.browser;
|
|
4009
4009
|
if (strings.isNonEmptyString(browserField) || objects.isObjectObject(browserField)) {
|
|
@@ -4031,7 +4031,7 @@ async function detect({
|
|
|
4031
4031
|
}
|
|
4032
4032
|
}
|
|
4033
4033
|
// Lazily access constants.maintainedNodeVersions.
|
|
4034
|
-
targets.node = constants.
|
|
4034
|
+
targets.node = constants.maintainedNodeVersions.some(v => semver.satisfies(v, `>=${minimumNodeVersion}`));
|
|
4035
4035
|
lockSrc = typeof lockPath === 'string' ? await readLockFileByAgent[agent](lockPath, agentExecPath) : undefined;
|
|
4036
4036
|
} else {
|
|
4037
4037
|
lockBasename = undefined;
|
|
@@ -4058,7 +4058,7 @@ const {
|
|
|
4058
4058
|
NPM: NPM$7,
|
|
4059
4059
|
VLT: VLT$4,
|
|
4060
4060
|
YARN_BERRY: YARN_BERRY$4
|
|
4061
|
-
} = constants
|
|
4061
|
+
} = constants;
|
|
4062
4062
|
const COMMAND_TITLE$2 = 'Socket Optimize';
|
|
4063
4063
|
const manifestNpmOverrides = registry.getManifestData(NPM$7);
|
|
4064
4064
|
async function detectAndValidatePackageManager(cwd, prod) {
|
|
@@ -4158,7 +4158,7 @@ const {
|
|
|
4158
4158
|
VLT: VLT$3,
|
|
4159
4159
|
YARN_BERRY: YARN_BERRY$3,
|
|
4160
4160
|
YARN_CLASSIC: YARN_CLASSIC$4
|
|
4161
|
-
} = constants
|
|
4161
|
+
} = constants;
|
|
4162
4162
|
function getOverridesDataBun(pkgJson) {
|
|
4163
4163
|
const overrides = pkgJson?.[RESOLUTIONS$1] ?? {};
|
|
4164
4164
|
return {
|
|
@@ -4226,7 +4226,7 @@ const getOverridesDataByAgent = {
|
|
|
4226
4226
|
|
|
4227
4227
|
const {
|
|
4228
4228
|
PNPM: PNPM$4
|
|
4229
|
-
} = constants
|
|
4229
|
+
} = constants;
|
|
4230
4230
|
const PNPM_WORKSPACE = `${PNPM$4}-workspace`;
|
|
4231
4231
|
async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
|
|
4232
4232
|
let workspacePatterns;
|
|
@@ -4275,7 +4275,7 @@ const {
|
|
|
4275
4275
|
VLT: VLT$2,
|
|
4276
4276
|
YARN_BERRY: YARN_BERRY$2,
|
|
4277
4277
|
YARN_CLASSIC: YARN_CLASSIC$3
|
|
4278
|
-
} = constants
|
|
4278
|
+
} = constants;
|
|
4279
4279
|
function lockIncludesNpm(lockSrc, name) {
|
|
4280
4280
|
// Detects the package name in the following cases:
|
|
4281
4281
|
// "name":
|
|
@@ -4332,7 +4332,7 @@ const {
|
|
|
4332
4332
|
VLT: VLT$1,
|
|
4333
4333
|
YARN_BERRY: YARN_BERRY$1,
|
|
4334
4334
|
YARN_CLASSIC: YARN_CLASSIC$2
|
|
4335
|
-
} = constants
|
|
4335
|
+
} = constants;
|
|
4336
4336
|
function cleanupQueryStdout(stdout) {
|
|
4337
4337
|
if (stdout === '') {
|
|
4338
4338
|
return '';
|
|
@@ -4464,7 +4464,7 @@ const {
|
|
|
4464
4464
|
VLT,
|
|
4465
4465
|
YARN_BERRY,
|
|
4466
4466
|
YARN_CLASSIC: YARN_CLASSIC$1
|
|
4467
|
-
} = constants
|
|
4467
|
+
} = constants;
|
|
4468
4468
|
const PNPM_FIELD_NAME = PNPM$1;
|
|
4469
4469
|
const depFields = ['dependencies', 'devDependencies', 'peerDependencies', 'peerDependenciesMeta', 'optionalDependencies', 'bundleDependencies'];
|
|
4470
4470
|
function getEntryIndexes(entries, keys) {
|
|
@@ -4576,7 +4576,7 @@ const {
|
|
|
4576
4576
|
NPM: NPM$2,
|
|
4577
4577
|
SOCKET_CLI_SAFE_WRAPPER,
|
|
4578
4578
|
abortSignal: abortSignal$2
|
|
4579
|
-
} = constants
|
|
4579
|
+
} = constants;
|
|
4580
4580
|
const COMMAND_TITLE$1 = 'Socket Optimize';
|
|
4581
4581
|
const NPM_OVERRIDE_PR_URL = 'https://github.com/npm/cli/pull/7025';
|
|
4582
4582
|
async function updatePackageLockJson(lockName, agentExecPath, agent, spinner) {
|
|
@@ -4617,7 +4617,7 @@ const {
|
|
|
4617
4617
|
NPM: NPM$1,
|
|
4618
4618
|
PNPM,
|
|
4619
4619
|
YARN_CLASSIC
|
|
4620
|
-
} = constants
|
|
4620
|
+
} = constants;
|
|
4621
4621
|
const COMMAND_TITLE = 'Socket Optimize';
|
|
4622
4622
|
async function applyOptimization(cwd, pin, prod) {
|
|
4623
4623
|
const pkgMgrData = await detectAndValidatePackageManager(cwd, prod);
|
|
@@ -4955,7 +4955,7 @@ async function run$g(argv, importMeta, {
|
|
|
4955
4955
|
|
|
4956
4956
|
const {
|
|
4957
4957
|
abortSignal: abortSignal$1
|
|
4958
|
-
} = constants
|
|
4958
|
+
} = constants;
|
|
4959
4959
|
async function runRawNpm(argv) {
|
|
4960
4960
|
const spawnPromise = spawn(npmPaths.getNpmBinPath(), argv.slice(0), {
|
|
4961
4961
|
signal: abortSignal$1,
|
|
@@ -4977,7 +4977,7 @@ async function runRawNpm(argv) {
|
|
|
4977
4977
|
|
|
4978
4978
|
const {
|
|
4979
4979
|
NPM
|
|
4980
|
-
} = constants
|
|
4980
|
+
} = constants;
|
|
4981
4981
|
const config$f = {
|
|
4982
4982
|
commandName: 'raw-npm',
|
|
4983
4983
|
description: `Temporarily disable the Socket ${NPM} wrapper`,
|
|
@@ -5014,7 +5014,7 @@ async function run$f(argv, importMeta, {
|
|
|
5014
5014
|
|
|
5015
5015
|
const {
|
|
5016
5016
|
abortSignal
|
|
5017
|
-
} = constants
|
|
5017
|
+
} = constants;
|
|
5018
5018
|
async function runRawNpx(argv) {
|
|
5019
5019
|
const spawnPromise = spawn(npmPaths.getNpxBinPath(), argv, {
|
|
5020
5020
|
signal: abortSignal,
|
|
@@ -5036,7 +5036,7 @@ async function runRawNpx(argv) {
|
|
|
5036
5036
|
|
|
5037
5037
|
const {
|
|
5038
5038
|
NPX
|
|
5039
|
-
} = constants
|
|
5039
|
+
} = constants;
|
|
5040
5040
|
const config$e = {
|
|
5041
5041
|
commandName: 'raw-npx',
|
|
5042
5042
|
description: `Temporarily disable the Socket ${NPX} wrapper`,
|
|
@@ -6774,7 +6774,7 @@ async function run(argv, importMeta, {
|
|
|
6774
6774
|
const {
|
|
6775
6775
|
SOCKET,
|
|
6776
6776
|
rootPkgJsonPath
|
|
6777
|
-
} = constants
|
|
6777
|
+
} = constants;
|
|
6778
6778
|
|
|
6779
6779
|
// TODO: Add autocompletion using https://socket.dev/npm/package/omelette
|
|
6780
6780
|
void (async () => {
|
|
@@ -6847,5 +6847,5 @@ void (async () => {
|
|
|
6847
6847
|
await index.captureException(e);
|
|
6848
6848
|
}
|
|
6849
6849
|
})();
|
|
6850
|
-
//# debugId=
|
|
6850
|
+
//# debugId=fb8eadc9-13dc-438b-93e1-3d3b5a23a39a
|
|
6851
6851
|
//# sourceMappingURL=cli.js.map
|