@socketsecurity/cli-with-sentry 0.14.75 → 0.14.77

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.
@@ -39,6 +39,8 @@ type IPC = Readonly<{
39
39
  SOCKET_CLI_SAFE_PROGRESS?: boolean | undefined
40
40
  }>
41
41
  declare const constants: {
42
+ readonly NODE_ENV: 'NODE_ENV'
43
+ readonly kInternalsSymbol: unique symbol
42
44
  readonly [kInternalsSymbol]: registryConstants.Internals
43
45
  readonly AT_LATEST: '@latest'
44
46
  readonly BIOME_JSON: 'biome.json'
@@ -64,7 +66,6 @@ declare const constants: {
64
66
  readonly MANIFEST_JSON: 'manifest.json'
65
67
  readonly MIT: 'MIT'
66
68
  readonly NODE_AUTH_TOKEN: 'NODE_AUTH_TOKEN'
67
- readonly NODE_ENV: 'NODE_ENV'
68
69
  readonly NODE_MODULES: 'node_modules'
69
70
  readonly NODE_MODULES_GLOB_RECURSIVE: '**/node_modules'
70
71
  readonly NODE_WORKSPACES: 'node_workspaces'
@@ -147,7 +148,6 @@ declare const constants: {
147
148
  '**/*.tsbuildinfo',
148
149
  '**/Thumbs.db'
149
150
  ]
150
- readonly kInternalsSymbol: unique symbol
151
151
  readonly lifecycleScriptNames: ReadonlySet<string>
152
152
  readonly maintainedNodeVersions: Readonly<MaintainedNodeVersions>
153
153
  readonly nodeHardenFlags: readonly [
@@ -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.75:48886e4:53d4dbe7:pub'
44
+ '0.14.77:08d925d:4d8a9902: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=6fb4ba09-84f2-42c9-b082-ee55c6760b1f
59
+ //# debugId=6cb32d1e-b8e2-4b5a-a0a5-ea87e21b587f
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":"6fb4ba09-84f2-42c9-b082-ee55c6760b1f"}
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":"6cb32d1e-b8e2-4b5a-a0a5-ea87e21b587f"}
@@ -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.75:48886e4:53d4dbe7:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
917
+ const cliVersion = '0.14.77:08d925d:4d8a9902: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'
@@ -3176,9 +3176,18 @@ async function commitAndPushFix(branchName, commitMsg, cwd) {
3176
3176
  return
3177
3177
  }
3178
3178
  const baseBranch = process.env['GITHUB_REF_NAME'] ?? 'main'
3179
- await spawn.spawn('git', ['checkout', baseBranch], {
3180
- cwd
3181
- })
3179
+ try {
3180
+ await spawn.spawn('git', ['checkout', baseBranch], {
3181
+ cwd
3182
+ })
3183
+ await spawn.spawn('git', ['pull', '--ff-only'], {
3184
+ cwd
3185
+ })
3186
+ } catch (err) {
3187
+ logger.logger.warn(
3188
+ `Could not switch to ${baseBranch}. Proceeding with current HEAD.`
3189
+ )
3190
+ }
3182
3191
  await spawn.spawn('git', ['checkout', '-b', branchName], {
3183
3192
  cwd
3184
3193
  })
@@ -3377,7 +3386,7 @@ async function pnpmFix(pkgEnvDetails, options) {
3377
3386
  'remote',
3378
3387
  'set-url',
3379
3388
  'origin',
3380
- `https://x-access-token:${process.env['SOCKET_AUTOFIX_PAT']}@github.com/${owner}/${repo}`
3389
+ `https://x-access-token:${process.env['SOCKET_AUTOFIX_PAT'] ?? process.env['GITHUB_TOKEN']}@github.com/${owner}/${repo}`
3381
3390
  ],
3382
3391
  {
3383
3392
  cwd
@@ -11056,7 +11065,7 @@ void (async () => {
11056
11065
  await updateNotifier({
11057
11066
  name: SOCKET_CLI_BIN_NAME,
11058
11067
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
11059
- version: '0.14.75',
11068
+ version: '0.14.77',
11060
11069
  ttl: 86_400_000 /* 24 hours in milliseconds */
11061
11070
  })
11062
11071
  try {
@@ -11127,5 +11136,5 @@ void (async () => {
11127
11136
  await shadowNpmInject.captureException(e)
11128
11137
  }
11129
11138
  })()
11130
- //# debugId=99d185ab-8a3c-4079-9df0-6377da54d4a1
11139
+ //# debugId=a692a8d3-8830-467b-b487-c85f8edcde9b
11131
11140
  //# sourceMappingURL=cli.js.map