@socketsecurity/cli-with-sentry 0.14.120 → 0.14.122
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 +34 -20
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +2 -2
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/require/cli.js +34 -20
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-npm-inject.js +2 -2
- package/dist/require/shadow-npm-inject.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.122:30c1354:1911ca49: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=13c369c3-e747-4648-b594-082d73b04755
|
|
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":"13c369c3-e747-4648-b594-082d73b04755"}
|
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.122:30c1354:1911ca49: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')
|
|
@@ -4063,15 +4063,20 @@ async function npmFix(
|
|
|
4063
4063
|
// Process the workspace root last since it will add an override to package.json.
|
|
4064
4064
|
pkgEnvDetails.editablePkgJson.filename
|
|
4065
4065
|
]
|
|
4066
|
-
await arb.buildIdealTree()
|
|
4067
4066
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4068
4067
|
const hasUpgrade = !!registry.getManifestData(NPM$f, name)
|
|
4069
4068
|
if (hasUpgrade) {
|
|
4070
4069
|
spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
|
|
4071
4070
|
continue
|
|
4072
4071
|
}
|
|
4072
|
+
arb.idealTree = null
|
|
4073
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4074
|
+
await arb.buildIdealTree()
|
|
4073
4075
|
const oldVersions = arrays.arrayUnique(
|
|
4074
|
-
shadowNpmInject
|
|
4076
|
+
shadowNpmInject
|
|
4077
|
+
.findPackageNodes(arb.idealTree, name)
|
|
4078
|
+
.map(n => n.version)
|
|
4079
|
+
.filter(Boolean)
|
|
4075
4080
|
)
|
|
4076
4081
|
const packument =
|
|
4077
4082
|
oldVersions.length && infos.length
|
|
@@ -4245,9 +4250,13 @@ async function npmFix(
|
|
|
4245
4250
|
workspaceName
|
|
4246
4251
|
}
|
|
4247
4252
|
)
|
|
4248
|
-
if (prResponse
|
|
4249
|
-
|
|
4250
|
-
|
|
4253
|
+
if (prResponse) {
|
|
4254
|
+
const { data } = prResponse
|
|
4255
|
+
spinner?.info(`PR #${data.number} opened.`)
|
|
4256
|
+
if (autoMerge) {
|
|
4257
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4258
|
+
await enableAutoMerge(data)
|
|
4259
|
+
}
|
|
4251
4260
|
}
|
|
4252
4261
|
}
|
|
4253
4262
|
if (errored || isCi) {
|
|
@@ -4471,29 +4480,30 @@ async function pnpmFix(
|
|
|
4471
4480
|
|
|
4472
4481
|
// Lazily access constants.ENV[CI].
|
|
4473
4482
|
const isCi = constants.ENV[CI]
|
|
4474
|
-
const {
|
|
4475
|
-
0: isRepo,
|
|
4476
|
-
1: workspacePkgJsonPaths,
|
|
4477
|
-
2: initialTree
|
|
4478
|
-
} = await Promise.all([
|
|
4483
|
+
const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
|
|
4479
4484
|
isInGitRepo(cwd),
|
|
4480
|
-
shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
|
|
4481
|
-
getActualTree(cwd)
|
|
4485
|
+
shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
|
|
4482
4486
|
])
|
|
4483
4487
|
const pkgJsonPaths = [
|
|
4484
4488
|
...workspacePkgJsonPaths,
|
|
4485
4489
|
// Process the workspace root last since it will add an override to package.json.
|
|
4486
4490
|
pkgEnvDetails.editablePkgJson.filename
|
|
4487
4491
|
]
|
|
4488
|
-
let actualTree
|
|
4492
|
+
let actualTree
|
|
4489
4493
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4490
4494
|
if (registry.getManifestData(NPM$c, name)) {
|
|
4491
4495
|
spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
|
|
4492
4496
|
continue
|
|
4493
4497
|
}
|
|
4498
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4499
|
+
actualTree = await getActualTree(cwd)
|
|
4494
4500
|
const oldVersions = arrays.arrayUnique(
|
|
4495
|
-
shadowNpmInject
|
|
4501
|
+
shadowNpmInject
|
|
4502
|
+
.findPackageNodes(actualTree, name)
|
|
4503
|
+
.map(n => n.version)
|
|
4504
|
+
.filter(Boolean)
|
|
4496
4505
|
)
|
|
4506
|
+
debug.debugLog(name, 'oldVersions', oldVersions)
|
|
4497
4507
|
const packument =
|
|
4498
4508
|
oldVersions.length && infos.length
|
|
4499
4509
|
? // eslint-disable-next-line no-await-in-loop
|
|
@@ -4710,9 +4720,13 @@ async function pnpmFix(
|
|
|
4710
4720
|
workspaceName
|
|
4711
4721
|
}
|
|
4712
4722
|
)
|
|
4713
|
-
if (prResponse
|
|
4714
|
-
|
|
4715
|
-
|
|
4723
|
+
if (prResponse) {
|
|
4724
|
+
const { data } = prResponse
|
|
4725
|
+
spinner?.info(`PR #${data.number} opened.`)
|
|
4726
|
+
if (autoMerge) {
|
|
4727
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4728
|
+
await enableAutoMerge(data)
|
|
4729
|
+
}
|
|
4716
4730
|
}
|
|
4717
4731
|
}
|
|
4718
4732
|
if (errored || isCi) {
|
|
@@ -12317,7 +12331,7 @@ void (async () => {
|
|
|
12317
12331
|
await vendor.updater({
|
|
12318
12332
|
name: SOCKET_CLI_BIN_NAME,
|
|
12319
12333
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12320
|
-
version: '0.14.
|
|
12334
|
+
version: '0.14.122',
|
|
12321
12335
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12322
12336
|
})
|
|
12323
12337
|
try {
|
|
@@ -12385,5 +12399,5 @@ void (async () => {
|
|
|
12385
12399
|
await shadowNpmInject.captureException(e)
|
|
12386
12400
|
}
|
|
12387
12401
|
})()
|
|
12388
|
-
//# debugId=
|
|
12402
|
+
//# debugId=89d93dc5-77bf-4052-b196-09f5e5169b84
|
|
12389
12403
|
//# sourceMappingURL=cli.js.map
|