socket 1.1.110 → 1.1.112

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.
@@ -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;AAuHvD,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,GACxE,MAAM,EAAE,CAKV;AAED,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,sBAAsB,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAAC,GACxE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAI/B;AAED,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,sBAAsB,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAAC,GACxE,MAAM,EAAE,CASV;AAED,KAAK,wBAAwB,GAAG,WAAW,GAAG;IAC5C,uEAAuE;IACvE,uEAAuE;IACvE,wEAAwE;IACxE,2EAA2E;IAC3E,4EAA4E;IAC5E,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACjD,sDAAsD;IACtD,iEAAiE;IACjE,wEAAwE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ils.js CHANGED
@@ -4493,18 +4493,36 @@ async function globWithGitIgnore(patterns, options) {
4493
4493
  ...options
4494
4494
  };
4495
4495
  const ignores = new Set(IGNORED_DIR_PATTERNS);
4496
+
4497
+ // CLI-supplied `additionalIgnores` are already anchored minimatch — they
4498
+ // must not pass through the `ignore` package (whose gitignore "match
4499
+ // anywhere" semantics would re-interpret a bare `tests` to match
4500
+ // `subdir/tests/foo.json`). Keep them in fast-glob's ignore list across
4501
+ // both paths; only gitignore-translated entries go into the `ig` matcher.
4502
+ const cliMinimatchIgnores = additionalIgnores ?? [];
4496
4503
  const projectIgnorePaths = socketConfig?.projectIgnorePaths;
4497
- if (Array.isArray(projectIgnorePaths)) {
4498
- const ignorePatterns = ignoreFileLinesToGlobPatterns(projectIgnorePaths, path.join(cwd, '.gitignore'), cwd);
4499
- for (const pattern of ignorePatterns) {
4500
- ignores.add(pattern);
4501
- }
4502
- }
4504
+ const projectIgnoreGlobs = Array.isArray(projectIgnorePaths) ? ignoreFileLinesToGlobPatterns(projectIgnorePaths, path.join(cwd, '.gitignore'), cwd) : [];
4505
+ for (const pattern of projectIgnoreGlobs) {
4506
+ ignores.add(pattern);
4507
+ }
4508
+
4509
+ // The .gitignore discovery walk has to honor the same directory exclusions
4510
+ // as the package walk below. Otherwise an unreadable subtree (e.g. a
4511
+ // postgres `pgdata` dir owned by another uid, or a Docker volume mount) makes
4512
+ // fast-glob throw `EACCES: permission denied, scandir` *here* — before
4513
+ // --exclude-paths (`cliMinimatchIgnores`) or projectIgnorePaths are ever
4514
+ // applied to the main walk, which is why excluding the path did not help.
4515
+ // `suppressErrors` is the backstop: a directory the user simply cannot read
4516
+ // cannot contain manifests they could scan anyway, so skip it instead of
4517
+ // aborting the whole `socket fix` / `socket scan` run. Negated patterns are
4518
+ // dropped — for a discovery walk they could only re-include a subtree (never
4519
+ // prevent a crash), and fast-glob treats `!` ignore entries inconsistently.
4503
4520
  const gitIgnoreStream = vendor.outExports.globStream(['**/.gitignore'], {
4504
4521
  absolute: true,
4505
4522
  cwd,
4506
4523
  dot: true,
4507
- ignore: DEFAULT_IGNORE_FOR_GIT_IGNORE
4524
+ ignore: [...DEFAULT_IGNORE_FOR_GIT_IGNORE, ...projectIgnoreGlobs, ...cliMinimatchIgnores].filter(p => p.charCodeAt(0) !== 33 /*'!'*/).map(stripTrailingSlash),
4525
+ suppressErrors: true
4508
4526
  });
4509
4527
  for await (const ignorePatterns of streams.transform(gitIgnoreStream, async filepath => ignoreFileToGlobPatterns((await fs$1.safeReadFile(filepath)) ?? '', filepath, cwd), {
4510
4528
  concurrency: 8
@@ -4520,20 +4538,20 @@ async function globWithGitIgnore(patterns, options) {
4520
4538
  break;
4521
4539
  }
4522
4540
  }
4523
-
4524
- // CLI-supplied `additionalIgnores` are already anchored minimatch — they
4525
- // must not pass through the `ignore` package (whose gitignore "match
4526
- // anywhere" semantics would re-interpret a bare `tests` to match
4527
- // `subdir/tests/foo.json`). Keep them in fast-glob's ignore list across
4528
- // both paths; only gitignore-translated entries go into the `ig` matcher.
4529
- const cliMinimatchIgnores = additionalIgnores ?? [];
4530
4541
  const globOptions = {
4531
4542
  __proto__: null,
4532
4543
  absolute: true,
4533
4544
  cwd,
4534
4545
  dot: true,
4535
4546
  ignore: hasNegatedPattern ? [...globs.defaultIgnore, ...cliMinimatchIgnores] : [...ignores, ...cliMinimatchIgnores].map(stripTrailingSlash),
4536
- ...additionalOptions
4547
+ ...additionalOptions,
4548
+ // Skip directories the running user cannot read rather than aborting the
4549
+ // whole walk on the first `EACCES` (see the .gitignore discovery walk
4550
+ // above for the full rationale). Pinned after `...additionalOptions` so a
4551
+ // caller's options bag cannot accidentally flip it back to `false` and
4552
+ // re-introduce the crash — `suppressErrors` is a safety invariant here, not
4553
+ // a tunable.
4554
+ suppressErrors: true
4537
4555
  };
4538
4556
 
4539
4557
  // When no filter is provided and no negated patterns exist, use the fast path.
@@ -8261,5 +8279,5 @@ exports.updateConfigValue = updateConfigValue;
8261
8279
  exports.walkNestedMap = walkNestedMap;
8262
8280
  exports.webLink = webLink;
8263
8281
  exports.writeSocketJson = writeSocketJson;
8264
- //# debugId=8907eca2-6921-4ecf-8a5f-ba72849ca53a
8282
+ //# debugId=cf3c91c7-35a1-45af-9dad-1961301233e5
8265
8283
  //# sourceMappingURL=utils.js.map