@socketsecurity/cli-with-sentry 0.14.86 → 0.14.88
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/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +59 -50
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +14 -7
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/require/cli.js +59 -50
- package/dist/require/cli.js.map +1 -1
- package/package.json +1 -1
- package/dist/module-sync/fs.d.ts +0 -61
package/dist/constants.d.ts
CHANGED
|
@@ -44,8 +44,6 @@ type IPC = Readonly<{
|
|
|
44
44
|
SOCKET_CLI_SAFE_PROGRESS?: boolean | undefined
|
|
45
45
|
}>
|
|
46
46
|
declare const constants: {
|
|
47
|
-
readonly NODE_ENV: 'NODE_ENV'
|
|
48
|
-
readonly kInternalsSymbol: unique symbol
|
|
49
47
|
readonly [kInternalsSymbol]: registryConstants.Internals
|
|
50
48
|
readonly AT_LATEST: '@latest'
|
|
51
49
|
readonly BIOME_JSON: 'biome.json'
|
|
@@ -71,6 +69,7 @@ declare const constants: {
|
|
|
71
69
|
readonly MANIFEST_JSON: 'manifest.json'
|
|
72
70
|
readonly MIT: 'MIT'
|
|
73
71
|
readonly NODE_AUTH_TOKEN: 'NODE_AUTH_TOKEN'
|
|
72
|
+
readonly NODE_ENV: 'NODE_ENV'
|
|
74
73
|
readonly NODE_MODULES: 'node_modules'
|
|
75
74
|
readonly NODE_MODULES_GLOB_RECURSIVE: '**/node_modules'
|
|
76
75
|
readonly NODE_WORKSPACES: 'node_workspaces'
|
|
@@ -153,6 +152,7 @@ declare const constants: {
|
|
|
153
152
|
'**/*.tsbuildinfo',
|
|
154
153
|
'**/Thumbs.db'
|
|
155
154
|
]
|
|
155
|
+
readonly kInternalsSymbol: unique symbol
|
|
156
156
|
readonly lifecycleScriptNames: ReadonlySet<string>
|
|
157
157
|
readonly maintainedNodeVersions: Readonly<MaintainedNodeVersions>
|
|
158
158
|
readonly nodeHardenFlags: readonly string[] & string[]
|
|
@@ -41,7 +41,7 @@ const relConstantsPath = './constants'
|
|
|
41
41
|
Sentry.setTag(
|
|
42
42
|
'version',
|
|
43
43
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
44
|
-
'0.14.
|
|
44
|
+
'0.14.88:959a4cc:d7e588e6:pub'
|
|
45
45
|
)
|
|
46
46
|
const constants = require(relConstantsPath)
|
|
47
47
|
if (constants.ENV.SOCKET_CLI_DEBUG) {
|
|
@@ -56,5 +56,5 @@ const relConstantsPath = './constants'
|
|
|
56
56
|
} = constants
|
|
57
57
|
setSentry(Sentry)
|
|
58
58
|
}
|
|
59
|
-
//# debugId=
|
|
59
|
+
//# debugId=62792282-4926-4712-8bf6-c517fce548c
|
|
60
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\nimport { logger } from '@socketsecurity/registry/lib/logger'\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['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_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 logger.fail('[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['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.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 logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"
|
|
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\nimport { logger } from '@socketsecurity/registry/lib/logger'\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['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_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 logger.fail('[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['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.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 logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"62792282-4926-4712-8bf6-c517fce548c"}
|
package/dist/module-sync/cli.js
CHANGED
|
@@ -915,7 +915,7 @@ function emitBanner(name) {
|
|
|
915
915
|
logger.logger.error(getAsciiHeader(name))
|
|
916
916
|
}
|
|
917
917
|
function getAsciiHeader(command) {
|
|
918
|
-
const cliVersion = '0.14.
|
|
918
|
+
const cliVersion = '0.14.88:959a4cc:d7e588e6:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
919
919
|
const nodeVersion = process$1.version
|
|
920
920
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
921
921
|
const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
|
|
@@ -3903,7 +3903,6 @@ async function npmFix(
|
|
|
3903
3903
|
const editablePkgJson = await packages.readPackageJson(cwd, {
|
|
3904
3904
|
editable: true
|
|
3905
3905
|
})
|
|
3906
|
-
const { content: pkgJson } = editablePkgJson
|
|
3907
3906
|
await arb.buildIdealTree()
|
|
3908
3907
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
3909
3908
|
const hasUpgrade = !!registry.getManifestData(NPM$f, name)
|
|
@@ -3955,19 +3954,20 @@ async function npmFix(
|
|
|
3955
3954
|
targetVersion = node.package.version
|
|
3956
3955
|
const fixSpec = `${name}@^${targetVersion}`
|
|
3957
3956
|
const revertData = {
|
|
3958
|
-
...(
|
|
3957
|
+
...(editablePkgJson.content.dependencies
|
|
3959
3958
|
? {
|
|
3960
|
-
dependencies:
|
|
3959
|
+
dependencies: editablePkgJson.content.dependencies
|
|
3961
3960
|
}
|
|
3962
3961
|
: undefined),
|
|
3963
|
-
...(
|
|
3962
|
+
...(editablePkgJson.content.optionalDependencies
|
|
3964
3963
|
? {
|
|
3965
|
-
optionalDependencies:
|
|
3964
|
+
optionalDependencies:
|
|
3965
|
+
editablePkgJson.content.optionalDependencies
|
|
3966
3966
|
}
|
|
3967
3967
|
: undefined),
|
|
3968
|
-
...(
|
|
3968
|
+
...(editablePkgJson.content.peerDependencies
|
|
3969
3969
|
? {
|
|
3970
|
-
peerDependencies:
|
|
3970
|
+
peerDependencies: editablePkgJson.content.peerDependencies
|
|
3971
3971
|
}
|
|
3972
3972
|
: undefined)
|
|
3973
3973
|
}
|
|
@@ -3977,6 +3977,7 @@ async function npmFix(
|
|
|
3977
3977
|
editablePkgJson,
|
|
3978
3978
|
arb.idealTree,
|
|
3979
3979
|
node,
|
|
3980
|
+
targetVersion,
|
|
3980
3981
|
rangeStyle
|
|
3981
3982
|
)
|
|
3982
3983
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4298,7 +4299,6 @@ async function pnpmFix(
|
|
|
4298
4299
|
const editablePkgJson = await packages.readPackageJson(cwd, {
|
|
4299
4300
|
editable: true
|
|
4300
4301
|
})
|
|
4301
|
-
const { content: pkgJson } = editablePkgJson
|
|
4302
4302
|
let actualTree = await getActualTree(cwd)
|
|
4303
4303
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4304
4304
|
if (registry.getManifestData(NPM$c, name)) {
|
|
@@ -4348,14 +4348,18 @@ async function pnpmFix(
|
|
|
4348
4348
|
let installed = false
|
|
4349
4349
|
let saved = false
|
|
4350
4350
|
if (targetVersion && targetPackument) {
|
|
4351
|
-
const oldPnpm =
|
|
4352
|
-
const
|
|
4351
|
+
const oldPnpm = editablePkgJson.content[PNPM$9]
|
|
4352
|
+
const oldPnpmKeyCount = oldPnpm ? Object.keys(oldPnpm).length : 0
|
|
4353
4353
|
const oldOverrides = oldPnpm?.[OVERRIDES$2]
|
|
4354
|
-
const
|
|
4354
|
+
const oldOverridesCount = oldOverrides
|
|
4355
4355
|
? Object.keys(oldOverrides).length
|
|
4356
4356
|
: 0
|
|
4357
4357
|
const overrideKey = `${node.name}@${vulnerableVersionRange}`
|
|
4358
|
-
const overrideRange =
|
|
4358
|
+
const overrideRange = shadowNpmInject.applyRange(
|
|
4359
|
+
oldOverrides?.[overrideKey] ?? targetVersion,
|
|
4360
|
+
targetVersion,
|
|
4361
|
+
rangeStyle
|
|
4362
|
+
)
|
|
4359
4363
|
const fixSpec = `${name}@${overrideRange}`
|
|
4360
4364
|
const updateData = {
|
|
4361
4365
|
[PNPM$9]: {
|
|
@@ -4367,11 +4371,11 @@ async function pnpmFix(
|
|
|
4367
4371
|
}
|
|
4368
4372
|
}
|
|
4369
4373
|
const revertData = {
|
|
4370
|
-
[PNPM$9]:
|
|
4374
|
+
[PNPM$9]: oldPnpmKeyCount
|
|
4371
4375
|
? {
|
|
4372
4376
|
...oldPnpm,
|
|
4373
4377
|
[OVERRIDES$2]:
|
|
4374
|
-
|
|
4378
|
+
oldOverridesCount === 1
|
|
4375
4379
|
? undefined
|
|
4376
4380
|
: {
|
|
4377
4381
|
[overrideKey]: undefined,
|
|
@@ -4379,19 +4383,20 @@ async function pnpmFix(
|
|
|
4379
4383
|
}
|
|
4380
4384
|
}
|
|
4381
4385
|
: undefined,
|
|
4382
|
-
...(
|
|
4386
|
+
...(editablePkgJson.content.dependencies
|
|
4383
4387
|
? {
|
|
4384
|
-
dependencies:
|
|
4388
|
+
dependencies: editablePkgJson.content.dependencies
|
|
4385
4389
|
}
|
|
4386
4390
|
: undefined),
|
|
4387
|
-
...(
|
|
4391
|
+
...(editablePkgJson.content.optionalDependencies
|
|
4388
4392
|
? {
|
|
4389
|
-
optionalDependencies:
|
|
4393
|
+
optionalDependencies:
|
|
4394
|
+
editablePkgJson.content.optionalDependencies
|
|
4390
4395
|
}
|
|
4391
4396
|
: undefined),
|
|
4392
|
-
...(
|
|
4397
|
+
...(editablePkgJson.content.peerDependencies
|
|
4393
4398
|
? {
|
|
4394
|
-
peerDependencies:
|
|
4399
|
+
peerDependencies: editablePkgJson.content.peerDependencies
|
|
4395
4400
|
}
|
|
4396
4401
|
: undefined)
|
|
4397
4402
|
}
|
|
@@ -4402,6 +4407,7 @@ async function pnpmFix(
|
|
|
4402
4407
|
editablePkgJson,
|
|
4403
4408
|
actualTree,
|
|
4404
4409
|
node,
|
|
4410
|
+
targetVersion,
|
|
4405
4411
|
rangeStyle
|
|
4406
4412
|
)
|
|
4407
4413
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4455,6 +4461,7 @@ async function pnpmFix(
|
|
|
4455
4461
|
// eslint-disable-next-line no-await-in-loop
|
|
4456
4462
|
prResponse = await openGitHubPullRequest(name, targetVersion, cwd)
|
|
4457
4463
|
} catch (e) {
|
|
4464
|
+
console.log(e)
|
|
4458
4465
|
logger.logger.error('Failed to open pull request', e)
|
|
4459
4466
|
}
|
|
4460
4467
|
if (prResponse && autoMerge) {
|
|
@@ -6400,13 +6407,13 @@ const depsIncludesByAgent = new Map([
|
|
|
6400
6407
|
[YARN_CLASSIC$5, matchLsCmdViewHumanStdout]
|
|
6401
6408
|
])
|
|
6402
6409
|
|
|
6403
|
-
function getDependencyEntries(
|
|
6410
|
+
function getDependencyEntries(editablePkgJson) {
|
|
6404
6411
|
const {
|
|
6405
6412
|
dependencies,
|
|
6406
6413
|
devDependencies,
|
|
6407
6414
|
optionalDependencies,
|
|
6408
6415
|
peerDependencies
|
|
6409
|
-
} =
|
|
6416
|
+
} = editablePkgJson.content
|
|
6410
6417
|
return [
|
|
6411
6418
|
[
|
|
6412
6419
|
'dependencies',
|
|
@@ -6457,8 +6464,8 @@ const {
|
|
|
6457
6464
|
YARN_BERRY: YARN_BERRY$3,
|
|
6458
6465
|
YARN_CLASSIC: YARN_CLASSIC$4
|
|
6459
6466
|
} = constants
|
|
6460
|
-
function getOverridesDataBun(
|
|
6461
|
-
const overrides =
|
|
6467
|
+
function getOverridesDataBun(editablePkgJson) {
|
|
6468
|
+
const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
|
|
6462
6469
|
return {
|
|
6463
6470
|
type: YARN_BERRY$3,
|
|
6464
6471
|
overrides
|
|
@@ -6467,8 +6474,8 @@ function getOverridesDataBun(pkgJson) {
|
|
|
6467
6474
|
|
|
6468
6475
|
// npm overrides documentation:
|
|
6469
6476
|
// https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides
|
|
6470
|
-
function getOverridesDataNpm(
|
|
6471
|
-
const overrides =
|
|
6477
|
+
function getOverridesDataNpm(editablePkgJson) {
|
|
6478
|
+
const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
|
|
6472
6479
|
return {
|
|
6473
6480
|
type: NPM$5,
|
|
6474
6481
|
overrides
|
|
@@ -6477,15 +6484,15 @@ function getOverridesDataNpm(pkgJson) {
|
|
|
6477
6484
|
|
|
6478
6485
|
// pnpm overrides documentation:
|
|
6479
6486
|
// https://pnpm.io/package_json#pnpmoverrides
|
|
6480
|
-
function getOverridesDataPnpm(
|
|
6481
|
-
const overrides =
|
|
6487
|
+
function getOverridesDataPnpm(editablePkgJson) {
|
|
6488
|
+
const overrides = editablePkgJson.content?.[PNPM$5]?.[OVERRIDES$1] ?? {}
|
|
6482
6489
|
return {
|
|
6483
6490
|
type: PNPM$5,
|
|
6484
6491
|
overrides
|
|
6485
6492
|
}
|
|
6486
6493
|
}
|
|
6487
|
-
function getOverridesDataVlt(
|
|
6488
|
-
const overrides =
|
|
6494
|
+
function getOverridesDataVlt(editablePkgJson) {
|
|
6495
|
+
const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
|
|
6489
6496
|
return {
|
|
6490
6497
|
type: VLT$3,
|
|
6491
6498
|
overrides
|
|
@@ -6494,8 +6501,8 @@ function getOverridesDataVlt(pkgJson) {
|
|
|
6494
6501
|
|
|
6495
6502
|
// Yarn resolutions documentation:
|
|
6496
6503
|
// https://yarnpkg.com/configuration/manifest#resolutions
|
|
6497
|
-
function getOverridesDataYarn(
|
|
6498
|
-
const overrides =
|
|
6504
|
+
function getOverridesDataYarn(editablePkgJson) {
|
|
6505
|
+
const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
|
|
6499
6506
|
return {
|
|
6500
6507
|
type: YARN_BERRY$3,
|
|
6501
6508
|
overrides
|
|
@@ -6504,8 +6511,8 @@ function getOverridesDataYarn(pkgJson) {
|
|
|
6504
6511
|
|
|
6505
6512
|
// Yarn resolutions documentation:
|
|
6506
6513
|
// https://classic.yarnpkg.com/en/docs/selective-version-resolutions
|
|
6507
|
-
function
|
|
6508
|
-
const overrides =
|
|
6514
|
+
function getOverridesDataYarnClassic(editablePkgJson) {
|
|
6515
|
+
const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
|
|
6509
6516
|
return {
|
|
6510
6517
|
type: YARN_CLASSIC$4,
|
|
6511
6518
|
overrides
|
|
@@ -6517,12 +6524,12 @@ const overridesDataByAgent = new Map([
|
|
|
6517
6524
|
[PNPM$5, getOverridesDataPnpm],
|
|
6518
6525
|
[VLT$3, getOverridesDataVlt],
|
|
6519
6526
|
[YARN_BERRY$3, getOverridesDataYarn],
|
|
6520
|
-
[YARN_CLASSIC$4,
|
|
6527
|
+
[YARN_CLASSIC$4, getOverridesDataYarnClassic]
|
|
6521
6528
|
])
|
|
6522
6529
|
|
|
6523
6530
|
const { PNPM: PNPM$4 } = constants
|
|
6524
6531
|
const PNPM_WORKSPACE = `${PNPM$4}-workspace`
|
|
6525
|
-
async function getWorkspaceGlobs(agent, pkgPath,
|
|
6532
|
+
async function getWorkspaceGlobs(agent, pkgPath, editablePkgJson) {
|
|
6526
6533
|
let workspacePatterns
|
|
6527
6534
|
if (agent === PNPM$4) {
|
|
6528
6535
|
for (const workspacePath of [
|
|
@@ -6541,7 +6548,7 @@ async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
|
|
|
6541
6548
|
}
|
|
6542
6549
|
}
|
|
6543
6550
|
} else {
|
|
6544
|
-
workspacePatterns =
|
|
6551
|
+
workspacePatterns = editablePkgJson.content['workspaces']
|
|
6545
6552
|
}
|
|
6546
6553
|
return Array.isArray(workspacePatterns)
|
|
6547
6554
|
? workspacePatterns
|
|
@@ -6814,8 +6821,7 @@ function getHighestEntryIndex(entries, keys) {
|
|
|
6814
6821
|
return getEntryIndexes(entries, keys).at(-1) ?? -1
|
|
6815
6822
|
}
|
|
6816
6823
|
function updatePkgJsonField(editablePkgJson, field, value) {
|
|
6817
|
-
const
|
|
6818
|
-
const oldValue = pkgJson[field]
|
|
6824
|
+
const oldValue = editablePkgJson.content[field]
|
|
6819
6825
|
if (oldValue) {
|
|
6820
6826
|
// The field already exists so we simply update the field value.
|
|
6821
6827
|
if (field === PNPM$1) {
|
|
@@ -6866,7 +6872,7 @@ function updatePkgJsonField(editablePkgJson, field, value) {
|
|
|
6866
6872
|
// Since the field doesn't exist we want to insert it into the package.json
|
|
6867
6873
|
// in a place that makes sense, e.g. close to the "dependencies" field. If
|
|
6868
6874
|
// we can't find a place to insert the field we'll add it to the bottom.
|
|
6869
|
-
const entries = Object.entries(
|
|
6875
|
+
const entries = Object.entries(editablePkgJson.content)
|
|
6870
6876
|
let insertIndex = -1
|
|
6871
6877
|
let isPlacingHigher = false
|
|
6872
6878
|
if (field === OVERRIDES) {
|
|
@@ -6965,9 +6971,12 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
6965
6971
|
editable: true
|
|
6966
6972
|
})
|
|
6967
6973
|
}
|
|
6968
|
-
const { content: pkgJson } = editablePkgJson
|
|
6969
6974
|
const workspaceName = path$1.relative(rootPath, pkgPath)
|
|
6970
|
-
const workspaceGlobs = await getWorkspaceGlobs(
|
|
6975
|
+
const workspaceGlobs = await getWorkspaceGlobs(
|
|
6976
|
+
agent,
|
|
6977
|
+
pkgPath,
|
|
6978
|
+
editablePkgJson
|
|
6979
|
+
)
|
|
6971
6980
|
const isRoot = pkgPath === rootPath
|
|
6972
6981
|
const isLockScanned = isRoot && !prod
|
|
6973
6982
|
const isWorkspace = !!workspaceGlobs
|
|
@@ -6987,19 +6996,19 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
6987
6996
|
)
|
|
6988
6997
|
}
|
|
6989
6998
|
const overridesDataObjects = []
|
|
6990
|
-
if (
|
|
6991
|
-
overridesDataObjects.push(overridesDataByAgent.get(agent)(
|
|
6999
|
+
if (editablePkgJson.content['private'] || isWorkspace) {
|
|
7000
|
+
overridesDataObjects.push(overridesDataByAgent.get(agent)(editablePkgJson))
|
|
6992
7001
|
} else {
|
|
6993
7002
|
overridesDataObjects.push(
|
|
6994
|
-
overridesDataByAgent.get(NPM$1)(
|
|
6995
|
-
overridesDataByAgent.get(YARN_CLASSIC)(
|
|
7003
|
+
overridesDataByAgent.get(NPM$1)(editablePkgJson),
|
|
7004
|
+
overridesDataByAgent.get(YARN_CLASSIC)(editablePkgJson)
|
|
6996
7005
|
)
|
|
6997
7006
|
}
|
|
6998
7007
|
spinner?.setText(
|
|
6999
7008
|
`Adding overrides${workspaceName ? ` to ${workspaceName}` : ''}...`
|
|
7000
7009
|
)
|
|
7001
7010
|
const depAliasMap = new Map()
|
|
7002
|
-
const depEntries = getDependencyEntries(
|
|
7011
|
+
const depEntries = getDependencyEntries(editablePkgJson)
|
|
7003
7012
|
const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
|
|
7004
7013
|
semver.satisfies(
|
|
7005
7014
|
// Roughly check Node range as semver.coerce will strip leading
|
|
@@ -11342,7 +11351,7 @@ void (async () => {
|
|
|
11342
11351
|
await updateNotifier({
|
|
11343
11352
|
name: SOCKET_CLI_BIN_NAME,
|
|
11344
11353
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
11345
|
-
version: '0.14.
|
|
11354
|
+
version: '0.14.88',
|
|
11346
11355
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
11347
11356
|
})
|
|
11348
11357
|
try {
|
|
@@ -11410,5 +11419,5 @@ void (async () => {
|
|
|
11410
11419
|
await shadowNpmInject.captureException(e)
|
|
11411
11420
|
}
|
|
11412
11421
|
})()
|
|
11413
|
-
//# debugId=
|
|
11422
|
+
//# debugId=651998b3-39a1-4965-a7b7-d5b2b0e06056
|
|
11414
11423
|
//# sourceMappingURL=cli.js.map
|