snyk 1.1205.0 → 1.1206.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.
- package/dist/cli/245.index.js +7 -108
- package/dist/cli/245.index.js.map +1 -1
- package/dist/cli/thirdPartyNotice.json +2 -2
- package/package.json +1 -1
- package/src/generated/sha256sums.txt +7 -7
- package/src/generated/version +1 -1
- package/wrapper_dist/generated/sha256sums.txt +7 -7
- package/wrapper_dist/generated/version +1 -1
package/dist/cli/245.index.js
CHANGED
|
@@ -213131,7 +213131,7 @@ const tslib_1 = __webpack_require__(90999);
|
|
|
213131
213131
|
const os = __webpack_require__(22037);
|
|
213132
213132
|
const fs = __webpack_require__(57147);
|
|
213133
213133
|
const path = __webpack_require__(71017);
|
|
213134
|
-
const
|
|
213134
|
+
const parse_versions_1 = __webpack_require__(55648);
|
|
213135
213135
|
const subProcess = __webpack_require__(17872);
|
|
213136
213136
|
const archive_1 = __webpack_require__(59337);
|
|
213137
213137
|
const error_format_1 = __webpack_require__(34083);
|
|
@@ -213257,14 +213257,8 @@ function inspect(root, targetFile, options, snykHttpClient) {
|
|
|
213257
213257
|
const versionResult = yield subProcess.execute(`${mavenCommand} --version`, [], {
|
|
213258
213258
|
cwd: mvnWorkingDirectory,
|
|
213259
213259
|
});
|
|
213260
|
-
|
|
213261
|
-
|
|
213262
|
-
parseResult = (0, parse_1.parse)(result, options.dev);
|
|
213263
|
-
}
|
|
213264
|
-
else {
|
|
213265
|
-
parseResult = (0, parse_mvn_1.parseTree)(result, options.dev);
|
|
213266
|
-
}
|
|
213267
|
-
const { javaVersion, mavenVersion } = (0, parse_mvn_1.parseVersions)(versionResult);
|
|
213260
|
+
const parseResult = (0, parse_1.parse)(result, options.dev);
|
|
213261
|
+
const { javaVersion, mavenVersion } = (0, parse_versions_1.parseVersions)(versionResult);
|
|
213268
213262
|
return Object.assign({ plugin: {
|
|
213269
213263
|
name: 'bundled:maven',
|
|
213270
213264
|
runtime: 'unknown',
|
|
@@ -213344,31 +213338,13 @@ exports.parseDigraph = parseDigraph;
|
|
|
213344
213338
|
|
|
213345
213339
|
/***/ }),
|
|
213346
213340
|
|
|
213347
|
-
/***/
|
|
213348
|
-
/***/ ((__unused_webpack_module, exports
|
|
213341
|
+
/***/ 55648:
|
|
213342
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
213349
213343
|
|
|
213350
213344
|
"use strict";
|
|
213351
213345
|
|
|
213352
213346
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
213353
|
-
exports.parseVersions =
|
|
213354
|
-
const parse_digraph_1 = __webpack_require__(58553);
|
|
213355
|
-
const dependency_1 = __webpack_require__(20448);
|
|
213356
|
-
const newline = /[\r\n]+/g;
|
|
213357
|
-
const logLabel = /^\[\w+\]\s*/gm;
|
|
213358
|
-
const errorLabel = /^\[ERROR\]/gm;
|
|
213359
|
-
// Parse the output from 'mvn dependency:tree -DoutputType=dot'
|
|
213360
|
-
function parseTree(text, withDev) {
|
|
213361
|
-
// check for errors in mvn output
|
|
213362
|
-
if (errorLabel.test(text)) {
|
|
213363
|
-
throw new Error('Failed to execute an `mvn` command.');
|
|
213364
|
-
}
|
|
213365
|
-
// clear all labels
|
|
213366
|
-
text = text.replace(logLabel, '');
|
|
213367
|
-
// extract deps
|
|
213368
|
-
const data = getRootProject(text, withDev);
|
|
213369
|
-
return { package: data };
|
|
213370
|
-
}
|
|
213371
|
-
exports.parseTree = parseTree;
|
|
213347
|
+
exports.parseVersions = void 0;
|
|
213372
213348
|
function parseVersions(text) {
|
|
213373
213349
|
// AppVeyor (at least) doesn't use \n\r, therefore os.EOL doesn't work
|
|
213374
213350
|
const data = text.split('\n');
|
|
@@ -213377,84 +213353,7 @@ function parseVersions(text) {
|
|
|
213377
213353
|
return { javaVersion, mavenVersion };
|
|
213378
213354
|
}
|
|
213379
213355
|
exports.parseVersions = parseVersions;
|
|
213380
|
-
|
|
213381
|
-
const projects = (0, parse_digraph_1.parseDigraph)(text);
|
|
213382
|
-
if (!projects) {
|
|
213383
|
-
throw new Error('Cannot find dependency information.');
|
|
213384
|
-
}
|
|
213385
|
-
const rootProject = getProject(projects[0], withDev);
|
|
213386
|
-
const defaultRoot = {
|
|
213387
|
-
name: 'no-name',
|
|
213388
|
-
version: '0.0.0',
|
|
213389
|
-
dependencies: {},
|
|
213390
|
-
packageFormatVersion: 'mvn:0.0.1',
|
|
213391
|
-
};
|
|
213392
|
-
const root = Object.assign(Object.assign({}, defaultRoot), rootProject);
|
|
213393
|
-
return root;
|
|
213394
|
-
}
|
|
213395
|
-
function getProject(projectDump, withDev) {
|
|
213396
|
-
const lines = projectDump.split(newline);
|
|
213397
|
-
const identity = dequote(lines[0]);
|
|
213398
|
-
const deps = {};
|
|
213399
|
-
for (let i = 1; i < lines.length - 1; i++) {
|
|
213400
|
-
const line = lines[i];
|
|
213401
|
-
const nodes = line.trim().split('->');
|
|
213402
|
-
const source = dequote(nodes[0]);
|
|
213403
|
-
const target = dequote(nodes[1]);
|
|
213404
|
-
deps[source] = deps[source] || [];
|
|
213405
|
-
deps[source].push(target);
|
|
213406
|
-
}
|
|
213407
|
-
return assemblePackage(identity, deps, withDev);
|
|
213408
|
-
}
|
|
213409
|
-
function assemblePackage(source, projectDeps, withDev) {
|
|
213410
|
-
const sourcePackage = createPackage(source);
|
|
213411
|
-
if (sourcePackage.labels &&
|
|
213412
|
-
sourcePackage.labels.scope === 'test' &&
|
|
213413
|
-
!withDev) {
|
|
213414
|
-
// skip a test dependency if it's not asked for
|
|
213415
|
-
return null;
|
|
213416
|
-
}
|
|
213417
|
-
const sourceDeps = projectDeps[source];
|
|
213418
|
-
if (sourceDeps) {
|
|
213419
|
-
sourcePackage.dependencies = {};
|
|
213420
|
-
for (const dep of sourceDeps) {
|
|
213421
|
-
const pkg = assemblePackage(dep, projectDeps, withDev);
|
|
213422
|
-
if (pkg && pkg.name) {
|
|
213423
|
-
sourcePackage.dependencies[pkg.name] = pkg;
|
|
213424
|
-
}
|
|
213425
|
-
}
|
|
213426
|
-
}
|
|
213427
|
-
return sourcePackage;
|
|
213428
|
-
}
|
|
213429
|
-
function createPackage(pkg) {
|
|
213430
|
-
const range = getConstraint(pkg);
|
|
213431
|
-
if (range) {
|
|
213432
|
-
pkg = pkg.substring(0, pkg.indexOf(' '));
|
|
213433
|
-
}
|
|
213434
|
-
const { groupId, artifactId, version, scope, classifier } = (0, dependency_1.parseDependency)(pkg);
|
|
213435
|
-
const coordinate = `${groupId}:${artifactId}`;
|
|
213436
|
-
const name = classifier ? `${coordinate}:${classifier}` : coordinate;
|
|
213437
|
-
const result = {
|
|
213438
|
-
name,
|
|
213439
|
-
version,
|
|
213440
|
-
dependencies: {},
|
|
213441
|
-
};
|
|
213442
|
-
if (scope) {
|
|
213443
|
-
result.labels = { scope };
|
|
213444
|
-
}
|
|
213445
|
-
return result;
|
|
213446
|
-
}
|
|
213447
|
-
function dequote(str) {
|
|
213448
|
-
return str.slice(str.indexOf('"') + 1, str.lastIndexOf('"'));
|
|
213449
|
-
}
|
|
213450
|
-
function getConstraint(str) {
|
|
213451
|
-
const index = str.indexOf('selected from constraint');
|
|
213452
|
-
if (index === -1) {
|
|
213453
|
-
return null;
|
|
213454
|
-
}
|
|
213455
|
-
return str.slice(index + 25, str.lastIndexOf(')'));
|
|
213456
|
-
}
|
|
213457
|
-
//# sourceMappingURL=parse-mvn.js.map
|
|
213356
|
+
//# sourceMappingURL=parse-versions.js.map
|
|
213458
213357
|
|
|
213459
213358
|
/***/ }),
|
|
213460
213359
|
|