@socketsecurity/cli-with-sentry 0.14.72 → 0.14.74

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.
@@ -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.72:f9c998c:c2fcad47:pub'
44
+ '0.14.74:e430910:86507715: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=18bbf742-94b9-4db8-bd89-67b6def9943c
59
+ //# debugId=4afe5937-59b7-4604-bc7f-7f3849766b91
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":"18bbf742-94b9-4db8-bd89-67b6def9943c"}
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":"4afe5937-59b7-4604-bc7f-7f3849766b91"}
@@ -914,7 +914,7 @@ function emitBanner(name) {
914
914
  logger.logger.error(getAsciiHeader(name))
915
915
  }
916
916
  function getAsciiHeader(command) {
917
- const cliVersion = '0.14.72:f9c998c:c2fcad47:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
917
+ const cliVersion = '0.14.74:e430910:86507715:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
918
918
  const nodeVersion = process$1.version
919
919
  const apiToken = shadowNpmInject.getDefaultToken()
920
920
  const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
@@ -3175,6 +3175,10 @@ async function commitAndPushFix(branchName, commitMsg, cwd) {
3175
3175
  )
3176
3176
  return
3177
3177
  }
3178
+ const baseBranch = process.env['GITHUB_REF_NAME'] ?? 'main'
3179
+ await spawn.spawn('git', ['checkout', baseBranch], {
3180
+ cwd
3181
+ })
3178
3182
  await spawn.spawn('git', ['checkout', '-b', branchName], {
3179
3183
  cwd
3180
3184
  })
@@ -3199,6 +3203,7 @@ async function createPullRequest({
3199
3203
  const octokit = new rest.Octokit({
3200
3204
  auth: process.env['SOCKET_AUTOFIX_PAT'] ?? process.env['GITHUB_TOKEN']
3201
3205
  })
3206
+ await new Promise(resolve => setTimeout(resolve, 3000)) // 3s
3202
3207
  await octokit.pulls.create({
3203
3208
  owner,
3204
3209
  repo,
@@ -3344,6 +3349,19 @@ async function pnpmFix(pkgEnvDetails, options) {
3344
3349
  const commitMsg = `fix: upgrade ${name} to ${targetVersion}`
3345
3350
  const { owner, repo } = getRepoInfo()
3346
3351
  // eslint-disable-next-line no-await-in-loop
3352
+ await spawn.spawn(
3353
+ 'git',
3354
+ [
3355
+ 'remote',
3356
+ 'set-url',
3357
+ 'origin',
3358
+ `https://x-access-token:${process.env['SOCKET_AUTOFIX_PAT']}@github.com/${owner}/${repo}`
3359
+ ],
3360
+ {
3361
+ cwd
3362
+ }
3363
+ )
3364
+ // eslint-disable-next-line no-await-in-loop
3347
3365
  await commitAndPushFix(branchName, commitMsg, cwd)
3348
3366
  // eslint-disable-next-line no-await-in-loop
3349
3367
  await createPullRequest({
@@ -11016,7 +11034,7 @@ void (async () => {
11016
11034
  await updateNotifier({
11017
11035
  name: SOCKET_CLI_BIN_NAME,
11018
11036
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
11019
- version: '0.14.72',
11037
+ version: '0.14.74',
11020
11038
  ttl: 86_400_000 /* 24 hours in milliseconds */
11021
11039
  })
11022
11040
  try {
@@ -11087,5 +11105,5 @@ void (async () => {
11087
11105
  await shadowNpmInject.captureException(e)
11088
11106
  }
11089
11107
  })()
11090
- //# debugId=8a70023e-6c7f-4c96-9924-43bd5d767813
11108
+ //# debugId=ec615037-63d4-4535-aef1-e79be169b436
11091
11109
  //# sourceMappingURL=cli.js.map