@socketsecurity/cli-with-sentry 0.14.104 → 0.14.105
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/arborist-helpers.d.ts +1 -1
- package/dist/module-sync/cli.js +80 -82
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +18 -12
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/require/cli.js +80 -82
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-npm-inject.js +18 -12
- package/dist/require/shadow-npm-inject.js.map +1 -1
- package/package.json +4 -4
|
@@ -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.105:2179d68:84daf9f9: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=af51dcd1-0bfc-466f-8eba-0a73080fc397
|
|
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":"af51dcd1-0bfc-466f-8eba-0a73080fc397"}
|
package/dist/module-sync/cli.js
CHANGED
|
@@ -900,7 +900,7 @@ function emitBanner(name) {
|
|
|
900
900
|
logger.logger.error(getAsciiHeader(name))
|
|
901
901
|
}
|
|
902
902
|
function getAsciiHeader(command) {
|
|
903
|
-
const cliVersion = '0.14.
|
|
903
|
+
const cliVersion = '0.14.105:2179d68:84daf9f9:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
904
904
|
const nodeVersion = process$1.version
|
|
905
905
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
906
906
|
const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
|
|
@@ -4088,19 +4088,6 @@ async function npmFix(
|
|
|
4088
4088
|
)
|
|
4089
4089
|
const newSpec = `${name}@${newVersionRange}`
|
|
4090
4090
|
const newSpecKey = `${workspaceName ? `${workspaceName}>` : ''}${newSpec}`
|
|
4091
|
-
const branch = isCi
|
|
4092
|
-
? getSocketBranchName(oldPurl, newVersion, workspaceName)
|
|
4093
|
-
: ''
|
|
4094
|
-
const { owner, repo } = isCi
|
|
4095
|
-
? getGitHubEnvRepoInfo()
|
|
4096
|
-
: {
|
|
4097
|
-
owner: '',
|
|
4098
|
-
repo: ''
|
|
4099
|
-
}
|
|
4100
|
-
const shouldOpenPr = isCi
|
|
4101
|
-
? // eslint-disable-next-line no-await-in-loop
|
|
4102
|
-
!(await doesPullRequestExistForBranch(owner, repo, branch))
|
|
4103
|
-
: false
|
|
4104
4091
|
const revertData = {
|
|
4105
4092
|
...(editablePkgJson.content.dependencies
|
|
4106
4093
|
? {
|
|
@@ -4119,30 +4106,45 @@ async function npmFix(
|
|
|
4119
4106
|
}
|
|
4120
4107
|
: undefined)
|
|
4121
4108
|
}
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4109
|
+
const branch = isCi
|
|
4110
|
+
? getSocketBranchName(oldPurl, newVersion, workspaceName)
|
|
4111
|
+
: ''
|
|
4112
|
+
const baseBranch = isCi ? getBaseGitBranch() : ''
|
|
4113
|
+
const { owner, repo } = isCi
|
|
4114
|
+
? getGitHubEnvRepoInfo()
|
|
4115
|
+
: {
|
|
4116
|
+
owner: '',
|
|
4117
|
+
repo: ''
|
|
4118
|
+
}
|
|
4119
|
+
const shouldOpenPr = isCi
|
|
4120
|
+
? // eslint-disable-next-line no-await-in-loop
|
|
4121
|
+
!(await doesPullRequestExistForBranch(owner, repo, branch))
|
|
4122
|
+
: false
|
|
4123
|
+
if (isCi) {
|
|
4124
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4125
|
+
await gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
|
|
4125
4126
|
}
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4127
|
+
shadowNpmInject.updatePackageJsonFromNode(
|
|
4128
|
+
editablePkgJson,
|
|
4129
|
+
arb.idealTree,
|
|
4130
|
+
node,
|
|
4131
|
+
newVersion,
|
|
4132
|
+
rangeStyle
|
|
4133
|
+
)
|
|
4130
4134
|
let error
|
|
4131
4135
|
let errored = false
|
|
4132
4136
|
let installed = false
|
|
4133
4137
|
let saved = false
|
|
4138
|
+
|
|
4139
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4140
|
+
if (await editablePkgJson.save()) {
|
|
4141
|
+
saved = true
|
|
4142
|
+
}
|
|
4143
|
+
if (!installedSpecs.has(newSpecKey)) {
|
|
4144
|
+
testedSpecs.add(newSpecKey)
|
|
4145
|
+
spinner?.info(`Installing ${newSpec}${workspaceDetails}`)
|
|
4146
|
+
}
|
|
4134
4147
|
try {
|
|
4135
|
-
shadowNpmInject.updatePackageJsonFromNode(
|
|
4136
|
-
editablePkgJson,
|
|
4137
|
-
arb.idealTree,
|
|
4138
|
-
node,
|
|
4139
|
-
newVersion,
|
|
4140
|
-
rangeStyle
|
|
4141
|
-
)
|
|
4142
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4143
|
-
if (await editablePkgJson.save()) {
|
|
4144
|
-
saved = true
|
|
4145
|
-
}
|
|
4146
4148
|
// eslint-disable-next-line no-await-in-loop
|
|
4147
4149
|
await install$1(arb.idealTree, {
|
|
4148
4150
|
cwd
|
|
@@ -4513,20 +4515,6 @@ async function pnpmFix(
|
|
|
4513
4515
|
)
|
|
4514
4516
|
const newSpec = `${name}@${newVersionRange}`
|
|
4515
4517
|
const newSpecKey = `${workspaceName ? `${workspaceName}>` : ''}${newSpec}`
|
|
4516
|
-
const branch = isCi
|
|
4517
|
-
? getSocketBranchName(oldPurl, newVersion, workspaceName)
|
|
4518
|
-
: ''
|
|
4519
|
-
const baseBranch = isCi ? getBaseGitBranch() : ''
|
|
4520
|
-
const { owner, repo } = isCi
|
|
4521
|
-
? getGitHubEnvRepoInfo()
|
|
4522
|
-
: {
|
|
4523
|
-
owner: '',
|
|
4524
|
-
repo: ''
|
|
4525
|
-
}
|
|
4526
|
-
const shouldOpenPr = isCi
|
|
4527
|
-
? // eslint-disable-next-line no-await-in-loop
|
|
4528
|
-
!(await doesPullRequestExistForBranch(owner, repo, branch))
|
|
4529
|
-
: false
|
|
4530
4518
|
const updateData = isWorkspaceRoot
|
|
4531
4519
|
? {
|
|
4532
4520
|
[PNPM$8]: {
|
|
@@ -4537,7 +4525,7 @@ async function pnpmFix(
|
|
|
4537
4525
|
}
|
|
4538
4526
|
}
|
|
4539
4527
|
}
|
|
4540
|
-
:
|
|
4528
|
+
: undefined
|
|
4541
4529
|
const revertData = {
|
|
4542
4530
|
...(isWorkspaceRoot
|
|
4543
4531
|
? {
|
|
@@ -4572,32 +4560,47 @@ async function pnpmFix(
|
|
|
4572
4560
|
}
|
|
4573
4561
|
: undefined)
|
|
4574
4562
|
}
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4563
|
+
const branch = isCi
|
|
4564
|
+
? getSocketBranchName(oldPurl, newVersion, workspaceName)
|
|
4565
|
+
: ''
|
|
4566
|
+
const baseBranch = isCi ? getBaseGitBranch() : ''
|
|
4567
|
+
const { owner, repo } = isCi
|
|
4568
|
+
? getGitHubEnvRepoInfo()
|
|
4569
|
+
: {
|
|
4570
|
+
owner: '',
|
|
4571
|
+
repo: ''
|
|
4572
|
+
}
|
|
4573
|
+
const shouldOpenPr = isCi
|
|
4574
|
+
? // eslint-disable-next-line no-await-in-loop
|
|
4575
|
+
!(await doesPullRequestExistForBranch(owner, repo, branch))
|
|
4576
|
+
: false
|
|
4579
4577
|
if (isCi) {
|
|
4580
4578
|
// eslint-disable-next-line no-await-in-loop
|
|
4581
4579
|
await gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
|
|
4582
4580
|
}
|
|
4581
|
+
if (updateData) {
|
|
4582
|
+
editablePkgJson.update(updateData)
|
|
4583
|
+
}
|
|
4584
|
+
shadowNpmInject.updatePackageJsonFromNode(
|
|
4585
|
+
editablePkgJson,
|
|
4586
|
+
actualTree,
|
|
4587
|
+
node,
|
|
4588
|
+
newVersion,
|
|
4589
|
+
rangeStyle
|
|
4590
|
+
)
|
|
4583
4591
|
let error
|
|
4584
4592
|
let errored = false
|
|
4585
4593
|
let installed = false
|
|
4586
|
-
|
|
4594
|
+
|
|
4595
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4596
|
+
if (!(await editablePkgJson.save())) {
|
|
4597
|
+
continue
|
|
4598
|
+
}
|
|
4599
|
+
if (!installedSpecs.has(newSpecKey)) {
|
|
4600
|
+
installedSpecs.add(newSpecKey)
|
|
4601
|
+
spinner?.info(`Installing ${newSpec}${workspaceDetails}`)
|
|
4602
|
+
}
|
|
4587
4603
|
try {
|
|
4588
|
-
editablePkgJson.update(updateData)
|
|
4589
|
-
shadowNpmInject.updatePackageJsonFromNode(
|
|
4590
|
-
editablePkgJson,
|
|
4591
|
-
actualTree,
|
|
4592
|
-
node,
|
|
4593
|
-
newVersion,
|
|
4594
|
-
rangeStyle
|
|
4595
|
-
)
|
|
4596
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4597
|
-
if (!(await editablePkgJson.save())) {
|
|
4598
|
-
continue
|
|
4599
|
-
}
|
|
4600
|
-
saved = true
|
|
4601
4604
|
// eslint-disable-next-line no-await-in-loop
|
|
4602
4605
|
actualTree = await install(pkgEnvDetails, {
|
|
4603
4606
|
spinner
|
|
@@ -4655,21 +4658,15 @@ async function pnpmFix(
|
|
|
4655
4658
|
spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
|
|
4656
4659
|
}
|
|
4657
4660
|
}
|
|
4661
|
+
editablePkgJson.update(revertData)
|
|
4658
4662
|
if (isRepo) {
|
|
4659
4663
|
// eslint-disable-next-line no-await-in-loop
|
|
4660
4664
|
await gitHardReset(cwd)
|
|
4661
|
-
}
|
|
4662
|
-
if (saved) {
|
|
4663
|
-
editablePkgJson.update(revertData)
|
|
4664
|
-
if (!isRepo) {
|
|
4665
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4666
|
-
await editablePkgJson.save()
|
|
4667
|
-
}
|
|
4668
|
-
}
|
|
4669
|
-
if (isRepo) {
|
|
4670
4665
|
// eslint-disable-next-line no-await-in-loop
|
|
4671
4666
|
actualTree = await getActualTree(cwd)
|
|
4672
4667
|
} else if (installed) {
|
|
4668
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4669
|
+
await editablePkgJson.save()
|
|
4673
4670
|
// eslint-disable-next-line no-await-in-loop
|
|
4674
4671
|
actualTree = await install(pkgEnvDetails, {
|
|
4675
4672
|
spinner
|
|
@@ -4861,11 +4858,12 @@ async function detectPackageEnvironment({
|
|
|
4861
4858
|
editable: true
|
|
4862
4859
|
})
|
|
4863
4860
|
: undefined
|
|
4864
|
-
const pkgJson = editablePkgJson?.content
|
|
4865
4861
|
// Read Corepack `packageManager` field in package.json:
|
|
4866
4862
|
// https://nodejs.org/api/packages.html#packagemanager
|
|
4867
|
-
const pkgManager = strings.isNonEmptyString(
|
|
4868
|
-
|
|
4863
|
+
const pkgManager = strings.isNonEmptyString(
|
|
4864
|
+
editablePkgJson?.content?.packageManager
|
|
4865
|
+
)
|
|
4866
|
+
? editablePkgJson.content.packageManager
|
|
4869
4867
|
: undefined
|
|
4870
4868
|
let agent
|
|
4871
4869
|
let agentVersion
|
|
@@ -4913,8 +4911,8 @@ async function detectPackageEnvironment({
|
|
|
4913
4911
|
let pkgNodeRange
|
|
4914
4912
|
let pkgMinAgentVersion = minSupportedAgentVersion
|
|
4915
4913
|
let pkgMinNodeVersion = minSupportedNodeVersion
|
|
4916
|
-
if (
|
|
4917
|
-
const { engines } =
|
|
4914
|
+
if (editablePkgJson?.content) {
|
|
4915
|
+
const { engines } = editablePkgJson.content
|
|
4918
4916
|
const engineAgentRange = engines?.[agent]
|
|
4919
4917
|
const engineNodeRange = engines?.['node']
|
|
4920
4918
|
if (strings.isNonEmptyString(engineAgentRange)) {
|
|
@@ -4935,7 +4933,7 @@ async function detectPackageEnvironment({
|
|
|
4935
4933
|
pkgMinNodeVersion = coerced.version
|
|
4936
4934
|
}
|
|
4937
4935
|
}
|
|
4938
|
-
const browserslistQuery =
|
|
4936
|
+
const browserslistQuery = editablePkgJson.content['browserslist']
|
|
4939
4937
|
if (Array.isArray(browserslistQuery)) {
|
|
4940
4938
|
// List Node targets in ascending version order.
|
|
4941
4939
|
const browserslistNodeTargets = vendor
|
|
@@ -11940,7 +11938,7 @@ void (async () => {
|
|
|
11940
11938
|
await vendor.updater({
|
|
11941
11939
|
name: SOCKET_CLI_BIN_NAME,
|
|
11942
11940
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
11943
|
-
version: '0.14.
|
|
11941
|
+
version: '0.14.105',
|
|
11944
11942
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
11945
11943
|
})
|
|
11946
11944
|
try {
|
|
@@ -12008,5 +12006,5 @@ void (async () => {
|
|
|
12008
12006
|
await shadowNpmInject.captureException(e)
|
|
12009
12007
|
}
|
|
12010
12008
|
})()
|
|
12011
|
-
//# debugId=
|
|
12009
|
+
//# debugId=1651050b-5b34-4e33-bf0e-95c55f069093
|
|
12012
12010
|
//# sourceMappingURL=cli.js.map
|