@socketsecurity/cli-with-sentry 0.14.117 → 0.14.119

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.117:3a58b03:18d6b824:pub'
44
+ '0.14.119:4f7b6a8:bcd85d46: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=1856da96-c6ab-479f-a1b1-7429c4535465
59
+ //# debugId=2e9cbeee-2740-4dc0-b3e0-3f6f3b1dd424
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":"1856da96-c6ab-479f-a1b1-7429c4535465"}
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":"2e9cbeee-2740-4dc0-b3e0-3f6f3b1dd424"}
@@ -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.117:3a58b03:18d6b824:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.119:4f7b6a8:bcd85d46: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')
@@ -3817,12 +3817,9 @@ async function gitCreateAndPushBranchIfNeeded(
3817
3817
  cwd = process.cwd()
3818
3818
  ) {
3819
3819
  if (await gitBranchExists(branch, cwd)) {
3820
- logger.logger.warn(`Branch "${branch}" already exists. Skipping creation.`)
3821
- return false
3820
+ logger.logger.warn(`Branch "${branch}" already exists, skipping creation.`)
3821
+ return true
3822
3822
  }
3823
- await spawn.spawn('git', ['checkout', '-b', branch], {
3824
- cwd
3825
- })
3826
3823
  const moddedFilepaths = (await gitUnstagedModifiedFiles(cwd)).filter(p => {
3827
3824
  const basename = path$1.basename(p)
3828
3825
  return (
@@ -3831,11 +3828,16 @@ async function gitCreateAndPushBranchIfNeeded(
3831
3828
  basename === 'pnpm-lock.yaml'
3832
3829
  )
3833
3830
  })
3834
- if (moddedFilepaths.length) {
3835
- await spawn.spawn('git', ['add', ...moddedFilepaths], {
3836
- cwd
3837
- })
3831
+ if (!moddedFilepaths.length) {
3832
+ logger.logger.warn('Nothing to commit, skipping push.')
3833
+ return false
3838
3834
  }
3835
+ await spawn.spawn('git', ['checkout', '-b', branch], {
3836
+ cwd
3837
+ })
3838
+ await spawn.spawn('git', ['add', ...moddedFilepaths], {
3839
+ cwd
3840
+ })
3839
3841
  await spawn.spawn('git', ['commit', '-m', commitMsg], {
3840
3842
  cwd
3841
3843
  })
@@ -4216,13 +4218,16 @@ async function npmFix(
4216
4218
  error = e
4217
4219
  errored = true
4218
4220
  }
4219
- if (!errored && shouldOpenPr) {
4221
+ if (
4222
+ !errored &&
4223
+ shouldOpenPr &&
4220
4224
  // eslint-disable-next-line no-await-in-loop
4221
- await gitCreateAndPushBranchIfNeeded(
4225
+ (await gitCreateAndPushBranchIfNeeded(
4222
4226
  branch,
4223
4227
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4224
4228
  cwd
4225
- )
4229
+ ))
4230
+ ) {
4226
4231
  // eslint-disable-next-line no-await-in-loop
4227
4232
  const prResponse = await openGitHubPullRequest(
4228
4233
  owner,
@@ -4248,19 +4253,15 @@ async function npmFix(
4248
4253
  spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
4249
4254
  }
4250
4255
  }
4251
- // eslint-disable-next-line no-await-in-loop
4252
- await shadowNpmInject.removeNodeModules(cwd)
4253
- if (isRepo) {
4254
- // eslint-disable-next-line no-await-in-loop
4255
- await gitHardReset(cwd)
4256
- }
4257
4256
  if (saved) {
4258
4257
  editablePkgJson.update(revertData)
4259
- if (!isRepo) {
4260
- // eslint-disable-next-line no-await-in-loop
4261
- await editablePkgJson.save()
4262
- }
4263
4258
  }
4259
+ // eslint-disable-next-line no-await-in-loop
4260
+ await Promise.all([
4261
+ shadowNpmInject.removeNodeModules(cwd),
4262
+ ...(isRepo ? [gitHardReset(cwd)] : []),
4263
+ ...(saved && !isRepo ? [editablePkgJson.save()] : [])
4264
+ ])
4264
4265
  if (!isRepo && installed) {
4265
4266
  // eslint-disable-next-line no-await-in-loop
4266
4267
  await install$1(revertTree, {
@@ -4677,13 +4678,16 @@ async function pnpmFix(
4677
4678
  error = e
4678
4679
  errored = true
4679
4680
  }
4680
- if (!errored && shouldOpenPr) {
4681
+ if (
4682
+ !errored &&
4683
+ shouldOpenPr &&
4681
4684
  // eslint-disable-next-line no-await-in-loop
4682
- await gitCreateAndPushBranchIfNeeded(
4685
+ (await gitCreateAndPushBranchIfNeeded(
4683
4686
  branch,
4684
4687
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4685
4688
  cwd
4686
- )
4689
+ ))
4690
+ ) {
4687
4691
  // eslint-disable-next-line no-await-in-loop
4688
4692
  const prResponse = await openGitHubPullRequest(
4689
4693
  owner,
@@ -4711,20 +4715,18 @@ async function pnpmFix(
4711
4715
  }
4712
4716
  editablePkgJson.update(revertData)
4713
4717
  // eslint-disable-next-line no-await-in-loop
4714
- await shadowNpmInject.removeNodeModules(cwd)
4715
- if (isRepo) {
4716
- // eslint-disable-next-line no-await-in-loop
4717
- await gitHardReset(cwd)
4718
- // eslint-disable-next-line no-await-in-loop
4719
- actualTree = await getActualTree(cwd)
4720
- } else if (installed) {
4721
- // eslint-disable-next-line no-await-in-loop
4722
- await editablePkgJson.save()
4723
- // eslint-disable-next-line no-await-in-loop
4724
- actualTree = await install(pkgEnvDetails, {
4725
- spinner
4726
- })
4727
- }
4718
+ await Promise.all([
4719
+ shadowNpmInject.removeNodeModules(cwd),
4720
+ ...(isRepo
4721
+ ? [gitHardReset(cwd)]
4722
+ : installed
4723
+ ? [editablePkgJson.save()]
4724
+ : [])
4725
+ ])
4726
+ // eslint-disable-next-line no-await-in-loop
4727
+ actualTree = await install(pkgEnvDetails, {
4728
+ spinner
4729
+ })
4728
4730
  if (errored) {
4729
4731
  if (!failedSpecs.has(newSpecKey)) {
4730
4732
  failedSpecs.add(newSpecKey)
@@ -12306,7 +12308,7 @@ void (async () => {
12306
12308
  await vendor.updater({
12307
12309
  name: SOCKET_CLI_BIN_NAME,
12308
12310
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12309
- version: '0.14.117',
12311
+ version: '0.14.119',
12310
12312
  ttl: 86_400_000 /* 24 hours in milliseconds */
12311
12313
  })
12312
12314
  try {
@@ -12374,5 +12376,5 @@ void (async () => {
12374
12376
  await shadowNpmInject.captureException(e)
12375
12377
  }
12376
12378
  })()
12377
- //# debugId=c1200007-dc9d-4528-aa07-687a56c33e72
12379
+ //# debugId=451e4d23-1f70-43f5-92f6-ed127d74f7d7
12378
12380
  //# sourceMappingURL=cli.js.map