@socketsecurity/cli-with-sentry 0.14.111 → 0.14.113
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 +62 -63
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +3 -2
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/require/cli.js +62 -63
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-npm-inject.js +3 -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.113:753a37f:0c2e5474: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=2576ade3-e7e0-4151-971f-f186580d62da
|
|
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":"2576ade3-e7e0-4151-971f-f186580d62da"}
|
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.113:753a37f:0c2e5474: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')
|
|
@@ -3729,7 +3729,7 @@ const cmdDiffScan = {
|
|
|
3729
3729
|
const { GITHUB_REF_NAME } = constants
|
|
3730
3730
|
function formatBranchName(str) {
|
|
3731
3731
|
return str
|
|
3732
|
-
.replace(/[
|
|
3732
|
+
.replace(/[-_.\\/]+/g, '-')
|
|
3733
3733
|
.replace(/[^-a-zA-Z0-9]+/g, '')
|
|
3734
3734
|
.replace(/^-+|-+$/g, '')
|
|
3735
3735
|
}
|
|
@@ -4090,35 +4090,35 @@ async function npmFix(
|
|
|
4090
4090
|
const testedSpecs = new Set()
|
|
4091
4091
|
const unavailableSpecs = new Set()
|
|
4092
4092
|
const revertedSpecs = new Set()
|
|
4093
|
-
for (const
|
|
4094
|
-
const
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
unavailableSpecs.
|
|
4117
|
-
|
|
4093
|
+
for (const pkgJsonPath of pkgJsonPaths) {
|
|
4094
|
+
for (const oldVersion of oldVersions) {
|
|
4095
|
+
const oldSpec = `${name}@${oldVersion}`
|
|
4096
|
+
const oldPurl = `pkg:npm/${oldSpec}`
|
|
4097
|
+
for (const {
|
|
4098
|
+
firstPatchedVersionIdentifier,
|
|
4099
|
+
vulnerableVersionRange
|
|
4100
|
+
} of infos) {
|
|
4101
|
+
const revertTree = arb.idealTree
|
|
4102
|
+
arb.idealTree = null
|
|
4103
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4104
|
+
await arb.buildIdealTree()
|
|
4105
|
+
const node = shadowNpmInject.findPackageNode(
|
|
4106
|
+
arb.idealTree,
|
|
4107
|
+
name,
|
|
4108
|
+
oldVersion
|
|
4109
|
+
)
|
|
4110
|
+
if (!node) {
|
|
4111
|
+
continue
|
|
4112
|
+
}
|
|
4113
|
+
if (
|
|
4114
|
+
!shadowNpmInject.updateNode(node, packument, vulnerableVersionRange)
|
|
4115
|
+
) {
|
|
4116
|
+
if (!unavailableSpecs.has(oldSpec)) {
|
|
4117
|
+
unavailableSpecs.add(oldSpec)
|
|
4118
|
+
spinner?.fail(`No update available for ${oldSpec}`)
|
|
4119
|
+
}
|
|
4120
|
+
continue
|
|
4118
4121
|
}
|
|
4119
|
-
continue
|
|
4120
|
-
}
|
|
4121
|
-
for (const pkgJsonPath of pkgJsonPaths) {
|
|
4122
4122
|
const isWorkspaceRoot =
|
|
4123
4123
|
pkgJsonPath === pkgEnvDetails.editablePkgJson.filename
|
|
4124
4124
|
const workspaceName = isWorkspaceRoot
|
|
@@ -4509,39 +4509,38 @@ async function pnpmFix(
|
|
|
4509
4509
|
const testedSpecs = new Set()
|
|
4510
4510
|
const unavailableSpecs = new Set()
|
|
4511
4511
|
const revertedSpecs = new Set()
|
|
4512
|
-
for (const
|
|
4513
|
-
const
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
} of infos) {
|
|
4519
|
-
const node = shadowNpmInject.findPackageNode(
|
|
4520
|
-
actualTree,
|
|
4521
|
-
name,
|
|
4522
|
-
oldVersion
|
|
4523
|
-
)
|
|
4524
|
-
if (!node) {
|
|
4525
|
-
continue
|
|
4526
|
-
}
|
|
4527
|
-
const availableVersions = Object.keys(packument.versions)
|
|
4528
|
-
const newVersion = shadowNpmInject.findBestPatchVersion(
|
|
4529
|
-
node,
|
|
4530
|
-
availableVersions,
|
|
4512
|
+
for (const pkgJsonPath of pkgJsonPaths) {
|
|
4513
|
+
for (const oldVersion of oldVersions) {
|
|
4514
|
+
const oldSpec = `${name}@${oldVersion}`
|
|
4515
|
+
const oldPurl = `pkg:npm/${oldSpec}`
|
|
4516
|
+
for (const {
|
|
4517
|
+
firstPatchedVersionIdentifier,
|
|
4531
4518
|
vulnerableVersionRange
|
|
4532
|
-
)
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4519
|
+
} of infos) {
|
|
4520
|
+
const node = shadowNpmInject.findPackageNode(
|
|
4521
|
+
actualTree,
|
|
4522
|
+
name,
|
|
4523
|
+
oldVersion
|
|
4524
|
+
)
|
|
4525
|
+
if (!node) {
|
|
4526
|
+
continue
|
|
4527
|
+
}
|
|
4528
|
+
const availableVersions = Object.keys(packument.versions)
|
|
4529
|
+
const newVersion = shadowNpmInject.findBestPatchVersion(
|
|
4530
|
+
node,
|
|
4531
|
+
availableVersions,
|
|
4532
|
+
vulnerableVersionRange
|
|
4533
|
+
)
|
|
4534
|
+
const newVersionPackument = newVersion
|
|
4535
|
+
? packument.versions[newVersion]
|
|
4536
|
+
: undefined
|
|
4537
|
+
if (!(newVersion && newVersionPackument)) {
|
|
4538
|
+
if (!unavailableSpecs.has(oldSpec)) {
|
|
4539
|
+
unavailableSpecs.add(oldSpec)
|
|
4540
|
+
spinner?.fail(`No update available for ${oldSpec}`)
|
|
4541
|
+
}
|
|
4542
|
+
continue
|
|
4540
4543
|
}
|
|
4541
|
-
continue
|
|
4542
|
-
}
|
|
4543
|
-
debug.debugLog('pkgJsonPaths', pkgJsonPaths)
|
|
4544
|
-
for (const pkgJsonPath of pkgJsonPaths) {
|
|
4545
4544
|
const isWorkspaceRoot =
|
|
4546
4545
|
pkgJsonPath === pkgEnvDetails.editablePkgJson.filename
|
|
4547
4546
|
const workspaceName = isWorkspaceRoot
|
|
@@ -12312,7 +12311,7 @@ void (async () => {
|
|
|
12312
12311
|
await vendor.updater({
|
|
12313
12312
|
name: SOCKET_CLI_BIN_NAME,
|
|
12314
12313
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12315
|
-
version: '0.14.
|
|
12314
|
+
version: '0.14.113',
|
|
12316
12315
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12317
12316
|
})
|
|
12318
12317
|
try {
|
|
@@ -12380,5 +12379,5 @@ void (async () => {
|
|
|
12380
12379
|
await shadowNpmInject.captureException(e)
|
|
12381
12380
|
}
|
|
12382
12381
|
})()
|
|
12383
|
-
//# debugId=
|
|
12382
|
+
//# debugId=1f254f8b-5b98-4df3-b06d-39d2637bc819
|
|
12384
12383
|
//# sourceMappingURL=cli.js.map
|