snyk 1.837.0 → 1.841.0

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,5 +1,5 @@
1
- exports.id = 925;
2
- exports.ids = [925];
1
+ exports.id = 293;
2
+ exports.ids = [293];
3
3
  exports.modules = {
4
4
 
5
5
  /***/ 61452:
@@ -4230,11 +4230,9 @@ exports.getExtraProjectCount = getExtraProjectCount;
4230
4230
  "use strict";
4231
4231
 
4232
4232
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4233
- exports.getMultiPluginResult = void 0;
4233
+ exports.filterOutProcessedWorkspaces = exports.getMultiPluginResult = void 0;
4234
4234
  const cloneDeep = __webpack_require__(83465);
4235
4235
  const pathLib = __webpack_require__(85622);
4236
- const sortBy = __webpack_require__(58254);
4237
- const groupBy = __webpack_require__(20276);
4238
4236
  const cliInterface = __webpack_require__(65266);
4239
4237
  const chalk_1 = __webpack_require__(32589);
4240
4238
  const theme_1 = __webpack_require__(86988);
@@ -4254,6 +4252,7 @@ async function getMultiPluginResult(root, options, targetFiles) {
4254
4252
  // the files need to be proceeded together as they provide context to each other
4255
4253
  const { scannedProjects, unprocessedFiles, } = await processYarnWorkspacesProjects(root, options, targetFiles);
4256
4254
  allResults.push(...scannedProjects);
4255
+ debug(`Not part of a workspace: ${unprocessedFiles.join(', ')}}`);
4257
4256
  // process the rest 1 by 1 sent to relevant plugins
4258
4257
  for (const targetFile of unprocessedFiles) {
4259
4258
  const optionsClone = cloneDeep(options);
@@ -4304,7 +4303,7 @@ async function processYarnWorkspacesProjects(root, options, targetFiles) {
4304
4303
  strictOutOfSync: options.strictOutOfSync,
4305
4304
  dev: options.dev,
4306
4305
  }, targetFiles);
4307
- const unprocessedFiles = filterOutProcessedWorkspaces(scannedProjects, targetFiles);
4306
+ const unprocessedFiles = filterOutProcessedWorkspaces(root, scannedProjects, targetFiles);
4308
4307
  return { scannedProjects, unprocessedFiles };
4309
4308
  }
4310
4309
  catch (e) {
@@ -4312,30 +4311,32 @@ async function processYarnWorkspacesProjects(root, options, targetFiles) {
4312
4311
  return { scannedProjects: [], unprocessedFiles: targetFiles };
4313
4312
  }
4314
4313
  }
4315
- function filterOutProcessedWorkspaces(scannedProjects, allTargetFiles) {
4316
- const mapped = allTargetFiles.map((p) => ({ path: p, ...pathLib.parse(p) }));
4317
- const sorted = sortBy(mapped, 'dir');
4318
- const targetFilesByDirectory = groupBy(sorted, 'dir');
4319
- const scanned = scannedProjects.map((p) => p.targetFile);
4314
+ function filterOutProcessedWorkspaces(root, scannedProjects, allTargetFiles) {
4320
4315
  const targetFiles = [];
4321
- for (const directory of Object.keys(targetFilesByDirectory)) {
4322
- for (const targetFile of targetFilesByDirectory[directory]) {
4323
- const { base, path } = targetFile;
4324
- // any non yarn workspace files should be scanned
4325
- if (!['package.json', 'yarn.lock'].includes(base)) {
4326
- targetFiles.push(path);
4327
- continue;
4328
- }
4329
- // check if Node manifest has already been processed a part or a workspace
4330
- const packageJsonFileName = pathLib.join(directory, 'package.json');
4331
- const alreadyScanned = scanned.some((f) => packageJsonFileName.endsWith(f));
4332
- if (!alreadyScanned) {
4333
- targetFiles.push(path);
4334
- }
4316
+ const scanned = scannedProjects
4317
+ .map((p) => p.targetFile)
4318
+ .map((p) => pathLib.resolve(process.cwd(), root, p));
4319
+ const all = allTargetFiles.map((p) => ({
4320
+ path: pathLib.resolve(process.cwd(), root, p),
4321
+ original: p,
4322
+ }));
4323
+ for (const entry of all) {
4324
+ const { path, original } = entry;
4325
+ const { base } = pathLib.parse(path);
4326
+ if (!['package.json', 'yarn.lock'].includes(base)) {
4327
+ targetFiles.push(original);
4328
+ continue;
4329
+ }
4330
+ // standardise to package.json
4331
+ // we discover the lockfiles but targetFile is package.json
4332
+ if (!scanned.includes(path.replace('yarn.lock', 'package.json'))) {
4333
+ targetFiles.push(original);
4334
+ continue;
4335
4335
  }
4336
4336
  }
4337
4337
  return targetFiles;
4338
4338
  }
4339
+ exports.filterOutProcessedWorkspaces = filterOutProcessedWorkspaces;
4339
4340
 
4340
4341
 
4341
4342
  /***/ }),
@@ -5290,7 +5291,7 @@ exports.codePlugin = {
5290
5291
  return '';
5291
5292
  },
5292
5293
  async test(paths, options) {
5293
- var _a, _b;
5294
+ var _a, _b, _c, _d;
5294
5295
  try {
5295
5296
  analytics.add('sast-scan', true);
5296
5297
  const sastSettings = await settings_1.getSastSettings(options);
@@ -5304,6 +5305,11 @@ exports.codePlugin = {
5304
5305
  analytics.add('sast-issues-found', numOfIssues);
5305
5306
  if (options.sarif || options.json) {
5306
5307
  if (numOfIssues > 0) {
5308
+ if (options['no-markdown']) {
5309
+ (_d = (_c = sarifTypedResult.runs) === null || _c === void 0 ? void 0 : _c[0].results) === null || _d === void 0 ? void 0 : _d.forEach(({ message }) => {
5310
+ delete message.markdown;
5311
+ });
5312
+ }
5307
5313
  hasIssues(json_1.jsonStringifyLargeObject(sarifTypedResult));
5308
5314
  }
5309
5315
  return { readableResult: json_1.jsonStringifyLargeObject(sarifTypedResult) };
@@ -7245,4 +7251,4 @@ function validateProjectType(options, projectType) {
7245
7251
 
7246
7252
  };
7247
7253
  ;
7248
- //# sourceMappingURL=925.index.js.map
7254
+ //# sourceMappingURL=293.index.js.map