@socketsecurity/cli-with-sentry 0.14.113 → 0.14.115
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/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +26 -30
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/fs.d.ts +63 -0
- package/dist/module-sync/shadow-npm-inject.js +244 -7
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/module-sync/shadow-npm-paths.d.ts +0 -23
- package/dist/module-sync/shadow-npm-paths.js +4 -227
- package/dist/module-sync/shadow-npm-paths.js.map +1 -1
- package/dist/module-sync/vendor.js +20283 -20282
- package/dist/module-sync/vendor.js.map +1 -1
- package/dist/require/cli.js +26 -30
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-npm-inject.js +244 -7
- package/dist/require/shadow-npm-inject.js.map +1 -1
- package/dist/require/shadow-npm-paths.d.ts +0 -23
- package/dist/require/shadow-npm-paths.js +4 -227
- package/dist/require/shadow-npm-paths.js.map +1 -1
- package/package.json +5 -5
|
@@ -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.115:b2d12c7:07656ade: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=3bc6d608-6ee9-4dc4-bfcd-936aa8e3bce3
|
|
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":"3bc6d608-6ee9-4dc4-bfcd-936aa8e3bce3"}
|
package/dist/module-sync/cli.js
CHANGED
|
@@ -917,7 +917,7 @@ function emitBanner(name) {
|
|
|
917
917
|
logger.logger.error(getAsciiHeader(name))
|
|
918
918
|
}
|
|
919
919
|
function getAsciiHeader(command) {
|
|
920
|
-
const cliVersion = '0.14.
|
|
920
|
+
const cliVersion = '0.14.115:b2d12c7:07656ade:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
921
921
|
const nodeVersion = process$1.version
|
|
922
922
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
923
923
|
const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
|
|
@@ -3831,11 +3831,6 @@ async function gitCreateAndPushBranchIfNeeded(
|
|
|
3831
3831
|
basename === 'pnpm-lock.yaml'
|
|
3832
3832
|
)
|
|
3833
3833
|
})
|
|
3834
|
-
debug.debugLog('branch', branch)
|
|
3835
|
-
debug.debugLog(
|
|
3836
|
-
'gitCreateAndPushBranchIfNeeded > moddedFilepaths',
|
|
3837
|
-
moddedFilepaths
|
|
3838
|
-
)
|
|
3839
3834
|
if (moddedFilepaths.length) {
|
|
3840
3835
|
await spawn.spawn('git', ['add', ...moddedFilepaths], {
|
|
3841
3836
|
cwd
|
|
@@ -4030,9 +4025,10 @@ async function npmFix(
|
|
|
4030
4025
|
pkgEnvDetails,
|
|
4031
4026
|
{ autoMerge, cwd, purls, rangeStyle, spinner, test, testScript }
|
|
4032
4027
|
) {
|
|
4028
|
+
const { pkgPath: rootPath } = pkgEnvDetails
|
|
4033
4029
|
spinner?.start()
|
|
4034
4030
|
const arb = new shadowNpmInject.SafeArborist({
|
|
4035
|
-
path:
|
|
4031
|
+
path: rootPath,
|
|
4036
4032
|
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4037
4033
|
})
|
|
4038
4034
|
// Calling arb.reify() creates the arb.diff object and nulls-out arb.idealTree.
|
|
@@ -4057,14 +4053,14 @@ async function npmFix(
|
|
|
4057
4053
|
|
|
4058
4054
|
// Lazily access constants.ENV[CI].
|
|
4059
4055
|
const isCi = constants.ENV[CI$1]
|
|
4060
|
-
const { pkgPath: rootPath } = pkgEnvDetails
|
|
4061
4056
|
const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
|
|
4062
4057
|
isInGitRepo(cwd),
|
|
4063
|
-
|
|
4058
|
+
shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
|
|
4064
4059
|
])
|
|
4065
4060
|
const pkgJsonPaths = [
|
|
4066
|
-
|
|
4067
|
-
|
|
4061
|
+
...workspacePkgJsonPaths,
|
|
4062
|
+
// Process the workspace root last since it will add an override to package.json.
|
|
4063
|
+
pkgEnvDetails.editablePkgJson.filename
|
|
4068
4064
|
]
|
|
4069
4065
|
await arb.buildIdealTree()
|
|
4070
4066
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
@@ -4253,6 +4249,8 @@ async function npmFix(
|
|
|
4253
4249
|
spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
|
|
4254
4250
|
}
|
|
4255
4251
|
}
|
|
4252
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4253
|
+
await shadowNpmInject.removeNodeModules(cwd)
|
|
4256
4254
|
if (isRepo) {
|
|
4257
4255
|
// eslint-disable-next-line no-await-in-loop
|
|
4258
4256
|
await gitHardReset(cwd)
|
|
@@ -4439,12 +4437,10 @@ async function pnpmFix(
|
|
|
4439
4437
|
pkgEnvDetails,
|
|
4440
4438
|
{ autoMerge, cwd, purls, rangeStyle, spinner, test, testScript }
|
|
4441
4439
|
) {
|
|
4442
|
-
const
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
}
|
|
4447
|
-
)
|
|
4440
|
+
const { pkgPath: rootPath } = pkgEnvDetails
|
|
4441
|
+
const lockfile = await vendor.libExports$3.readWantedLockfile(rootPath, {
|
|
4442
|
+
ignoreIncompatible: false
|
|
4443
|
+
})
|
|
4448
4444
|
if (!lockfile) {
|
|
4449
4445
|
return
|
|
4450
4446
|
}
|
|
@@ -4471,21 +4467,20 @@ async function pnpmFix(
|
|
|
4471
4467
|
|
|
4472
4468
|
// Lazily access constants.ENV[CI].
|
|
4473
4469
|
const isCi = constants.ENV[CI]
|
|
4474
|
-
const { pkgPath: rootPath } = pkgEnvDetails
|
|
4475
4470
|
const {
|
|
4476
4471
|
0: isRepo,
|
|
4477
4472
|
1: workspacePkgJsonPaths,
|
|
4478
4473
|
2: initialTree
|
|
4479
4474
|
} = await Promise.all([
|
|
4480
4475
|
isInGitRepo(cwd),
|
|
4481
|
-
|
|
4476
|
+
shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath),
|
|
4482
4477
|
getActualTree(cwd)
|
|
4483
4478
|
])
|
|
4484
4479
|
const pkgJsonPaths = [
|
|
4485
|
-
|
|
4486
|
-
|
|
4480
|
+
...workspacePkgJsonPaths,
|
|
4481
|
+
// Process the workspace root last since it will add an override to package.json.
|
|
4482
|
+
pkgEnvDetails.editablePkgJson.filename
|
|
4487
4483
|
]
|
|
4488
|
-
debug.debugLog('workspacePkgJsonPaths', workspacePkgJsonPaths)
|
|
4489
4484
|
let actualTree = initialTree
|
|
4490
4485
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4491
4486
|
if (registry.getManifestData(NPM$c, name)) {
|
|
@@ -4523,6 +4518,7 @@ async function pnpmFix(
|
|
|
4523
4518
|
oldVersion
|
|
4524
4519
|
)
|
|
4525
4520
|
if (!node) {
|
|
4521
|
+
debug.debugLog('skipping no node', pkgJsonPath)
|
|
4526
4522
|
continue
|
|
4527
4523
|
}
|
|
4528
4524
|
const availableVersions = Object.keys(packument.versions)
|
|
@@ -4641,7 +4637,6 @@ async function pnpmFix(
|
|
|
4641
4637
|
rangeStyle
|
|
4642
4638
|
)
|
|
4643
4639
|
debug.debugLog('updatePackageJsonFromNode', modded)
|
|
4644
|
-
debug.debugLog(branch, editablePkgJson.filename)
|
|
4645
4640
|
let error
|
|
4646
4641
|
let errored = false
|
|
4647
4642
|
let installed = false
|
|
@@ -4683,17 +4678,13 @@ async function pnpmFix(
|
|
|
4683
4678
|
error = e
|
|
4684
4679
|
errored = true
|
|
4685
4680
|
}
|
|
4686
|
-
debug.debugLog('check "shouldOpenPr":', shouldOpenPr)
|
|
4687
|
-
debug.debugLog('check "errored":', errored)
|
|
4688
4681
|
if (!errored && shouldOpenPr) {
|
|
4689
|
-
debug.debugLog('1: gitCreateAndPushBranchIfNeeded')
|
|
4690
4682
|
// eslint-disable-next-line no-await-in-loop
|
|
4691
4683
|
await gitCreateAndPushBranchIfNeeded(
|
|
4692
4684
|
branch,
|
|
4693
4685
|
getSocketCommitMessage(oldPurl, newVersion, workspaceName),
|
|
4694
4686
|
cwd
|
|
4695
4687
|
)
|
|
4696
|
-
debug.debugLog('2: openGitHubPullRequest')
|
|
4697
4688
|
// eslint-disable-next-line no-await-in-loop
|
|
4698
4689
|
const prResponse = await openGitHubPullRequest(
|
|
4699
4690
|
owner,
|
|
@@ -4720,6 +4711,8 @@ async function pnpmFix(
|
|
|
4720
4711
|
}
|
|
4721
4712
|
}
|
|
4722
4713
|
editablePkgJson.update(revertData)
|
|
4714
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4715
|
+
await shadowNpmInject.removeNodeModules(cwd)
|
|
4723
4716
|
if (isRepo) {
|
|
4724
4717
|
// eslint-disable-next-line no-await-in-loop
|
|
4725
4718
|
await gitHardReset(cwd)
|
|
@@ -7518,7 +7511,10 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
7518
7511
|
updated: new Set(),
|
|
7519
7512
|
updatedInWorkspaces: new Set(),
|
|
7520
7513
|
warnedPnpmWorkspaceRequiresNpm: false,
|
|
7521
|
-
workspacePkgJsonPaths: await
|
|
7514
|
+
workspacePkgJsonPaths: await shadowNpmInject.globWorkspace(
|
|
7515
|
+
agent,
|
|
7516
|
+
rootPath
|
|
7517
|
+
)
|
|
7522
7518
|
}
|
|
7523
7519
|
} = {
|
|
7524
7520
|
__proto__: null,
|
|
@@ -12311,7 +12307,7 @@ void (async () => {
|
|
|
12311
12307
|
await vendor.updater({
|
|
12312
12308
|
name: SOCKET_CLI_BIN_NAME,
|
|
12313
12309
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12314
|
-
version: '0.14.
|
|
12310
|
+
version: '0.14.115',
|
|
12315
12311
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12316
12312
|
})
|
|
12317
12313
|
try {
|
|
@@ -12379,5 +12375,5 @@ void (async () => {
|
|
|
12379
12375
|
await shadowNpmInject.captureException(e)
|
|
12380
12376
|
}
|
|
12381
12377
|
})()
|
|
12382
|
-
//# debugId=
|
|
12378
|
+
//# debugId=96cafc13-031a-4b82-add7-4bee8788d10
|
|
12383
12379
|
//# sourceMappingURL=cli.js.map
|