@socketsecurity/cli-with-sentry 1.1.126 → 1.1.128

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.
@@ -2,7 +2,7 @@ import type { Agent } from './package-environment.mts';
2
2
  import type { SocketYml } from '@socketsecurity/config';
3
3
  import type { SocketSdkSuccessResult } from '@socketsecurity/sdk';
4
4
  import type { Options as GlobOptions } from 'fast-glob';
5
- export declare const IGNORED_DIRS: readonly [".git", ".log", ".nyc_output", ".sass-cache", ".yarn", "bower_components", "coverage", "node_modules", "flow-typed"];
5
+ export declare const IGNORED_DIRS: readonly [".git", ".log", ".nyc_output", ".sass-cache", ".yarn", "bower_components", "coverage", "node_modules", "flow-typed", ".venv"];
6
6
  // fast-glob silently discards `ignore` entries that end in `/` (it
7
7
  // treats them as literal directory paths, not glob patterns). The
8
8
  // gitignore convention of writing directory entries as `dist/` lands
@@ -1 +1 @@
1
- {"version":3,"file":"glob.d.mts","sourceRoot":"","sources":["../../../src/utils/glob.mts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AAMvD,eAAO,MAAM,YAAY,gIAcf,CAAA;AAmGV,mEAAmE;AACnE,kEAAkE;AAClE,qEAAqE;AACrE,uEAAuE;AACvE,uEAAqE;AACrE,4CAA4C;AAC5C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ1D;AAuBD,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EACvC,cAAc,EAAE,sBAAsB,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAAC,GACx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CACrC,CAAA;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EACtC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,EAAE,CAAC,CA+InB;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,KAAK,EACZ,GAAG,SAAgB,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnB;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,sBAAsB,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAAC,WAI1E;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EACnC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,EAAE,CAgBV"}
package/dist/utils.js CHANGED
@@ -4385,8 +4385,16 @@ constants.NODE_MODULES,
4385
4385
  // Where Node modules are installed, see <https://nodejs.org/>
4386
4386
  // Taken from globby:
4387
4387
  // https://github.com/sindresorhus/globby/blob/v14.0.2/ignore.js#L11-L16
4388
- 'flow-typed'];
4388
+ 'flow-typed',
4389
+ // Conventional Python virtual environment dir. Arbitrarily-named venvs are
4390
+ // detected via their pyvenv.cfg marker during the discovery walk below.
4391
+ '.venv'];
4389
4392
  const IGNORED_DIR_PATTERNS = IGNORED_DIRS.map(i => `**/${i}`);
4393
+
4394
+ // Marker file at the root of every Python virtual environment (stdlib `venv`
4395
+ // per PEP 405, and virtualenv >= 20). Lets us detect venvs that don't use a
4396
+ // conventional directory name.
4397
+ const PYVENV_CFG = 'pyvenv.cfg';
4390
4398
  async function getWorkspaceGlobs(agent, cwd = process.cwd()) {
4391
4399
  let workspacePatterns;
4392
4400
  if (agent === constants.PNPM) {
@@ -4520,25 +4528,36 @@ async function globWithGitIgnore(patterns, options) {
4520
4528
  ignores.add(pattern);
4521
4529
  }
4522
4530
 
4523
- // The .gitignore discovery walk has to honor the same directory exclusions
4524
- // as the package walk below. Otherwise an unreadable subtree (e.g. a
4525
- // postgres `pgdata` dir owned by another uid, or a Docker volume mount) makes
4526
- // fast-glob throw `EACCES: permission denied, scandir` *here* — before
4527
- // --exclude-paths (`cliMinimatchIgnores`) or projectIgnorePaths are ever
4528
- // applied to the main walk, which is why excluding the path did not help.
4529
- // `suppressErrors` is the backstop: a directory the user simply cannot read
4530
- // cannot contain manifests they could scan anyway, so skip it instead of
4531
- // aborting the whole `socket fix` / `socket scan` run. Negated patterns are
4532
- // dropped — for a discovery walk they could only re-include a subtree (never
4533
- // prevent a crash), and fast-glob treats `!` ignore entries inconsistently.
4534
- const gitIgnoreStream = vendor.outExports.globStream(['**/.gitignore'], {
4531
+ // The discovery walk (`.gitignore` files plus `pyvenv.cfg` venv markers) has
4532
+ // to honor the same directory exclusions as the package walk below. Otherwise
4533
+ // an unreadable subtree (e.g. a postgres `pgdata` dir owned by another uid, or
4534
+ // a Docker volume mount) makes fast-glob throw `EACCES: permission denied,
4535
+ // scandir` *here* — before --exclude-paths (`cliMinimatchIgnores`) or
4536
+ // projectIgnorePaths are ever applied to the main walk, which is why excluding
4537
+ // the path did not help. `suppressErrors` is the backstop: a directory the
4538
+ // user simply cannot read cannot contain manifests they could scan anyway, so
4539
+ // skip it instead of aborting the whole `socket fix` / `socket scan` run.
4540
+ // Negated patterns are dropped — for a discovery walk they could only
4541
+ // re-include a subtree (never prevent a crash), and fast-glob treats `!`
4542
+ // ignore entries inconsistently. Folding pyvenv.cfg discovery into this same
4543
+ // walk avoids a second full-tree traversal.
4544
+ const discoveryStream = vendor.outExports.globStream(['**/.gitignore', `**/${PYVENV_CFG}`], {
4535
4545
  absolute: true,
4536
4546
  cwd,
4537
4547
  dot: true,
4538
4548
  ignore: [...DEFAULT_IGNORE_FOR_GIT_IGNORE, ...projectIgnoreGlobs, ...cliMinimatchIgnores].filter(p => p.charCodeAt(0) !== 33 /*'!'*/).map(stripTrailingSlash),
4539
4549
  suppressErrors: true
4540
4550
  });
4541
- for await (const ignorePatterns of streams.transform(gitIgnoreStream, async filepath => ignoreFileToGlobPatterns((await fs$1.safeReadFile(filepath)) ?? '', filepath, cwd), {
4551
+ for await (const ignorePatterns of streams.transform(discoveryStream, async filepath => {
4552
+ if (path.basename(filepath) === PYVENV_CFG) {
4553
+ // A pyvenv.cfg sits at the venv root, so exclude the whole directory.
4554
+ const relDir = path.relative(cwd, path.dirname(filepath)).replace(/\\/g, '/');
4555
+ // An empty relDir means the scan target itself is a venv root; don't
4556
+ // emit `/**`, which would exclude everything the user explicitly targeted.
4557
+ return relDir ? [`${relDir}/**`] : [];
4558
+ }
4559
+ return ignoreFileToGlobPatterns((await fs$1.safeReadFile(filepath)) ?? '', filepath, cwd);
4560
+ }, {
4542
4561
  concurrency: 8
4543
4562
  })) {
4544
4563
  for (const p of ignorePatterns) {
@@ -8478,5 +8497,5 @@ exports.updateConfigValue = updateConfigValue;
8478
8497
  exports.walkNestedMap = walkNestedMap;
8479
8498
  exports.webLink = webLink;
8480
8499
  exports.writeSocketJson = writeSocketJson;
8481
- //# debugId=ca641f10-e836-48a4-ba4b-d7184d048e3f
8500
+ //# debugId=6a2346d1-e6a5-427e-9fec-7790860159e2
8482
8501
  //# sourceMappingURL=utils.js.map