snyk-nodejs-lockfile-parser 1.27.0 → 1.30.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/errors/index.d.ts +1 -0
- package/dist/errors/index.js +2 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/unsupported-error.d.ts +5 -0
- package/dist/errors/unsupported-error.js +12 -0
- package/dist/errors/unsupported-error.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +20 -13
- package/dist/index.js.map +1 -1
- package/dist/parsers/index.d.ts +1 -2
- package/dist/parsers/package-lock-parser.js +3 -3
- package/dist/parsers/package-lock-parser.js.map +1 -1
- package/dist/parsers/yarn-utils.d.ts +0 -5
- package/dist/parsers/yarn-utils.js +82 -66
- package/dist/parsers/yarn-utils.js.map +1 -1
- package/dist/parsers/yarn2-lock-parse.d.ts +0 -9
- package/dist/parsers/yarn2-lock-parse.js +56 -42
- package/dist/parsers/yarn2-lock-parse.js.map +1 -1
- package/package.json +5 -7
package/dist/errors/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { InvalidUserInputError } from './invalid-user-input-error';
|
|
|
2
2
|
export { UnsupportedRuntimeError } from './unsupported-runtime-error';
|
|
3
3
|
export { OutOfSyncError } from './out-of-sync-error';
|
|
4
4
|
export { TreeSizeLimitError } from './tree-size-limit-error';
|
|
5
|
+
export { UnsupportedError } from './unsupported-error';
|
package/dist/errors/index.js
CHANGED
|
@@ -8,4 +8,6 @@ var out_of_sync_error_1 = require("./out-of-sync-error");
|
|
|
8
8
|
exports.OutOfSyncError = out_of_sync_error_1.OutOfSyncError;
|
|
9
9
|
var tree_size_limit_error_1 = require("./tree-size-limit-error");
|
|
10
10
|
exports.TreeSizeLimitError = tree_size_limit_error_1.TreeSizeLimitError;
|
|
11
|
+
var unsupported_error_1 = require("./unsupported-error");
|
|
12
|
+
exports.UnsupportedError = unsupported_error_1.UnsupportedError;
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
package/dist/errors/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/errors/index.ts"],"names":[],"mappings":";;AAAA,uEAAmE;AAA1D,2DAAA,qBAAqB,CAAA;AAC9B,yEAAsE;AAA7D,8DAAA,uBAAuB,CAAA;AAChC,yDAAqD;AAA5C,6CAAA,cAAc,CAAA;AACvB,iEAA6D;AAApD,qDAAA,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/errors/index.ts"],"names":[],"mappings":";;AAAA,uEAAmE;AAA1D,2DAAA,qBAAqB,CAAA;AAC9B,yEAAsE;AAA7D,8DAAA,uBAAuB,CAAA;AAChC,yDAAqD;AAA5C,6CAAA,cAAc,CAAA;AACvB,iEAA6D;AAApD,qDAAA,kBAAkB,CAAA;AAC3B,yDAAuD;AAA9C,+CAAA,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class UnsupportedError extends Error {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
this.name = 'UnsupportedError';
|
|
7
|
+
this.code = 500;
|
|
8
|
+
Error.captureStackTrace(this, UnsupportedError);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.UnsupportedError = UnsupportedError;
|
|
12
|
+
//# sourceMappingURL=unsupported-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsupported-error.js","sourceRoot":"","sources":["../../lib/errors/unsupported-error.ts"],"names":[],"mappings":";;AAAA,MAAa,gBAAiB,SAAQ,KAAK;IAIzC,YAAY,GAAG,IAAI;QACjB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QAJV,SAAI,GAAG,kBAAkB,CAAC;QAC1B,SAAI,GAAG,GAAG,CAAC;QAIhB,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAClD,CAAC;CACF;AARD,4CAQC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'source-map-support/register';
|
|
2
1
|
import { PkgTree, Scope, LockfileType, getYarnWorkspaces } from './parsers';
|
|
3
2
|
import { UnsupportedRuntimeError, InvalidUserInputError, OutOfSyncError } from './errors';
|
|
4
3
|
export { buildDepTree, buildDepTreeFromFiles, getYarnWorkspacesFromFiles, getYarnWorkspaces, PkgTree, Scope, LockfileType, UnsupportedRuntimeError, InvalidUserInputError, OutOfSyncError, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("source-map-support/register");
|
|
4
3
|
const fs = require("fs");
|
|
5
4
|
const path = require("path");
|
|
6
5
|
const parsers_1 = require("./parsers");
|
|
@@ -9,8 +8,8 @@ exports.LockfileType = parsers_1.LockfileType;
|
|
|
9
8
|
exports.getYarnWorkspaces = parsers_1.getYarnWorkspaces;
|
|
10
9
|
const package_lock_parser_1 = require("./parsers/package-lock-parser");
|
|
11
10
|
const yarn_lock_parse_1 = require("./parsers/yarn-lock-parse");
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// import { Yarn2LockParser } from './parsers/yarn2-lock-parse';
|
|
12
|
+
// import getRuntimeVersion from './get-node-runtime-version';
|
|
14
13
|
const errors_1 = require("./errors");
|
|
15
14
|
exports.UnsupportedRuntimeError = errors_1.UnsupportedRuntimeError;
|
|
16
15
|
exports.InvalidUserInputError = errors_1.InvalidUserInputError;
|
|
@@ -31,16 +30,24 @@ async function buildDepTree(manifestFileContents, lockFileContents, includeDev =
|
|
|
31
30
|
lockfileParser = new yarn_lock_parse_1.YarnLockParser();
|
|
32
31
|
break;
|
|
33
32
|
case parsers_1.LockfileType.yarn2:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
throw new errors_1.UnsupportedError('Yarn2 support has been temporarily removed to support Node.js versions 8.x.x');
|
|
34
|
+
/**
|
|
35
|
+
* Removing yarn 2 support as this breaks support for yarn with Node.js 8
|
|
36
|
+
* See: https://github.com/snyk/snyk/issues/1270
|
|
37
|
+
*
|
|
38
|
+
* Uncomment following code once Snyk stops Node.js 8 support
|
|
39
|
+
* // parsing yarn.lock is supported for Node.js v10 and higher
|
|
40
|
+
* if (getRuntimeVersion() >= 10) {
|
|
41
|
+
* lockfileParser = new Yarn2LockParser();
|
|
42
|
+
* } else {
|
|
43
|
+
* throw new UnsupportedRuntimeError(
|
|
44
|
+
* 'Parsing `yarn.lock` is not ' +
|
|
45
|
+
* 'supported on Node.js version less than 10. Please upgrade your ' +
|
|
46
|
+
* 'Node.js environment or use `package-lock.json`',
|
|
47
|
+
* );
|
|
48
|
+
* }
|
|
49
|
+
* break;
|
|
50
|
+
*/
|
|
44
51
|
default:
|
|
45
52
|
throw new errors_1.InvalidUserInputError('Unsupported lockfile type ' +
|
|
46
53
|
`${lockfileType} provided. Only 'npm' or 'yarn' is currently ` +
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAC7B,uCASmB;AAkBjB,gBAtBA,eAAK,CAsBA;AACL,uBArBA,sBAAY,CAqBA;AAHZ,4BAjBA,2BAAiB,CAiBA;AAfnB,uEAAkE;AAClE,+DAA2D;AAC3D,gEAAgE;AAChE,8DAA8D;AAC9D,qCAKkB;AAUhB,kCAdA,gCAAuB,CAcA;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AAI;YAClC,uDAAuD,CAC1D,CAAC;KACH;IAED,OAAO,MAAM,YAAY,CACvB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,MAAM,EACN,gBAAgB,CACjB,CAAC;AACJ,CAAC;AA/HC,sDAAqB;AAiIvB,SAAS,0BAA0B,CACjC,IAAI,EACJ,gBAAwB;IAExB,IAAI,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE;QAC9B,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAC;KACH;IACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAClE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE;QACxC,MAAM,IAAI,8BAAqB,CAC7B,wCAAwC;YACtC,aAAa,oBAAoB,EAAE,CACtC,CAAC;KACH;IACD,MAAM,oBAAoB,GAAG,EAAE,CAAC,YAAY,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAE5E,OAAO,2BAAiB,CAAC,oBAAoB,CAAC,CAAC;AACjD,CAAC;AAnJC,gEAA0B;AAqJ5B,SAAS,mBAAmB,CAC1B,gBAAwB,EACxB,IAAa,EACb,YAAqB;IAErB,IACE,gBAAgB,CAAC,QAAQ,CAAC,YAAY,CAAC;QACvC,CAAC,IAAI;YACH,YAAY;YACZ,EAAE,CAAC,UAAU,CACX,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CACrE,CAAC,EACJ;QACA,OAAO,sBAAY,CAAC,KAAK,CAAC;KAC3B;SAAM;QACL,OAAO,sBAAY,CAAC,IAAI,CAAC;KAC1B;AACH,CAAC"}
|
package/dist/parsers/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PackageLock } from './package-lock-parser';
|
|
2
2
|
import { YarnLock } from './yarn-lock-parse';
|
|
3
|
-
import { Yarn2Lock } from './yarn2-lock-parse';
|
|
4
3
|
export interface Dep {
|
|
5
4
|
name: string;
|
|
6
5
|
version: string;
|
|
@@ -64,7 +63,7 @@ export interface LockfileParser {
|
|
|
64
63
|
parseLockFile: (lockFileContents: string) => Lockfile;
|
|
65
64
|
getDependencyTree: (manifestFile: ManifestFile, lockfile: Lockfile, includeDev?: boolean, strict?: boolean) => Promise<PkgTree>;
|
|
66
65
|
}
|
|
67
|
-
export declare type Lockfile = PackageLock | YarnLock
|
|
66
|
+
export declare type Lockfile = PackageLock | YarnLock;
|
|
68
67
|
export declare function parseManifestFile(manifestFileContents: string): ManifestFile;
|
|
69
68
|
export declare function getTopLevelDeps(targetFile: ManifestFile, includeDev: boolean): Dep[];
|
|
70
69
|
export declare function createDepTreeDepFromDep(dep: Dep): DepTreeDep;
|
|
@@ -4,8 +4,8 @@ const _cloneDeep = require("lodash.clonedeep");
|
|
|
4
4
|
const _isEmpty = require("lodash.isempty");
|
|
5
5
|
const _set = require("lodash.set");
|
|
6
6
|
const _toPairs = require("lodash.topairs");
|
|
7
|
-
const graphlib = require("
|
|
8
|
-
const
|
|
7
|
+
const graphlib = require("graphlib");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
9
|
const config_1 = require("../config");
|
|
10
10
|
const event_loop_spinner_1 = require("event-loop-spinner");
|
|
11
11
|
const _1 = require("./");
|
|
@@ -208,7 +208,7 @@ class PackageLockParser {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
cloneNodeWithoutEdges(node, depMap, depGraph) {
|
|
211
|
-
const newNode = node +
|
|
211
|
+
const newNode = node + uuid_1.v4();
|
|
212
212
|
// update depMap with new node
|
|
213
213
|
depMap[newNode] = _cloneDeep(depMap[node]);
|
|
214
214
|
// add new node to the graph
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-lock-parser.js","sourceRoot":"","sources":["../../lib/parsers/package-lock-parser.ts"],"names":[],"mappings":";;AA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AC,YAAY,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAEpD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA7YD,8CA6YC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { structUtils } from '@yarnpkg/core';
|
|
2
|
-
export declare type ParseDescriptor = typeof structUtils.parseDescriptor;
|
|
3
|
-
export declare type ParseRange = typeof structUtils.parseRange;
|
|
4
|
-
export declare type YarnLockFileKeyNormalizer = (fullDescriptor: string) => Set<string>;
|
|
5
|
-
export declare const yarnLockFileKeyNormalizer: (parseDescriptor: typeof structUtils.parseDescriptor, parseRange: typeof structUtils.parseRange) => YarnLockFileKeyNormalizer;
|
|
@@ -1,68 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const BUILTIN_PLACEHOLDER = 'builtin';
|
|
5
|
-
const MULTIPLE_KEYS_REGEXP = / *, */g;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
2
|
+
// import { structUtils } from '@yarnpkg/core';
|
|
3
|
+
// import * as _flatMap from 'lodash.flatmap';
|
|
4
|
+
// const BUILTIN_PLACEHOLDER = 'builtin';
|
|
5
|
+
// const MULTIPLE_KEYS_REGEXP = / *, */g;
|
|
6
|
+
// export type ParseDescriptor = typeof structUtils.parseDescriptor;
|
|
7
|
+
// export type ParseRange = typeof structUtils.parseRange;
|
|
8
|
+
// const keyNormalizer = (
|
|
9
|
+
// parseDescriptor: ParseDescriptor,
|
|
10
|
+
// parseRange: ParseRange,
|
|
11
|
+
// ) => (rawDescriptor: string): string[] => {
|
|
12
|
+
// // See https://yarnpkg.com/features/protocols
|
|
13
|
+
// const descriptors: string[] = [rawDescriptor];
|
|
14
|
+
// const descriptor = parseDescriptor(rawDescriptor);
|
|
15
|
+
// const name = `${descriptor.scope ? '@' + descriptor.scope + '/' : ''}${
|
|
16
|
+
// descriptor.name
|
|
17
|
+
// }`;
|
|
18
|
+
// const range = parseRange(descriptor.range);
|
|
19
|
+
// const protocol = range.protocol;
|
|
20
|
+
// switch (protocol) {
|
|
21
|
+
// case 'npm:':
|
|
22
|
+
// case 'file:':
|
|
23
|
+
// descriptors.push(`${name}@${range.selector}`);
|
|
24
|
+
// descriptors.push(`${name}@${protocol}${range.selector}`);
|
|
25
|
+
// break;
|
|
26
|
+
// case 'git:':
|
|
27
|
+
// case 'git+ssh:':
|
|
28
|
+
// case 'git+http:':
|
|
29
|
+
// case 'git+https:':
|
|
30
|
+
// case 'github:':
|
|
31
|
+
// if (range.source) {
|
|
32
|
+
// descriptors.push(
|
|
33
|
+
// `${name}@${protocol}${range.source}${
|
|
34
|
+
// range.selector ? '#' + range.selector : ''
|
|
35
|
+
// }`,
|
|
36
|
+
// );
|
|
37
|
+
// } else {
|
|
38
|
+
// descriptors.push(`${name}@${protocol}${range.selector}`);
|
|
39
|
+
// }
|
|
40
|
+
// break;
|
|
41
|
+
// case 'patch:':
|
|
42
|
+
// if (range.source && range.selector.indexOf(BUILTIN_PLACEHOLDER) === 0) {
|
|
43
|
+
// descriptors.push(range.source);
|
|
44
|
+
// } else {
|
|
45
|
+
// descriptors.push(
|
|
46
|
+
// `${name}@${protocol}${range.source}${
|
|
47
|
+
// range.selector ? '#' + range.selector : ''
|
|
48
|
+
// }`,
|
|
49
|
+
// );
|
|
50
|
+
// }
|
|
51
|
+
// break;
|
|
52
|
+
// case null:
|
|
53
|
+
// case undefined:
|
|
54
|
+
// if (range.source) {
|
|
55
|
+
// descriptors.push(`${name}@${range.source}#${range.selector}`);
|
|
56
|
+
// } else {
|
|
57
|
+
// descriptors.push(`${name}@${range.selector}`);
|
|
58
|
+
// }
|
|
59
|
+
// break;
|
|
60
|
+
// case 'http:':
|
|
61
|
+
// case 'https:':
|
|
62
|
+
// case 'link:':
|
|
63
|
+
// case 'portal:':
|
|
64
|
+
// case 'exec:':
|
|
65
|
+
// case 'workspace:':
|
|
66
|
+
// case 'virtual:':
|
|
67
|
+
// default:
|
|
68
|
+
// // For user defined plugins
|
|
69
|
+
// descriptors.push(`${name}@${protocol}${range.selector}`);
|
|
70
|
+
// break;
|
|
71
|
+
// }
|
|
72
|
+
// return descriptors;
|
|
73
|
+
// };
|
|
74
|
+
// export type YarnLockFileKeyNormalizer = (fullDescriptor: string) => Set<string>;
|
|
75
|
+
// export const yarnLockFileKeyNormalizer = (
|
|
76
|
+
// parseDescriptor: ParseDescriptor,
|
|
77
|
+
// parseRange: ParseRange,
|
|
78
|
+
// ): YarnLockFileKeyNormalizer => (fullDescriptor: string) => {
|
|
79
|
+
// const allKeys = fullDescriptor
|
|
80
|
+
// .split(MULTIPLE_KEYS_REGEXP)
|
|
81
|
+
// .map(keyNormalizer(parseDescriptor, parseRange));
|
|
82
|
+
// return new Set<string>(_flatMap(allKeys));
|
|
83
|
+
// };
|
|
68
84
|
//# sourceMappingURL=yarn-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn-utils.js","sourceRoot":"","sources":["../../lib/parsers/yarn-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"yarn-utils.js","sourceRoot":"","sources":["../../lib/parsers/yarn-utils.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,8CAA8C;AAE9C,yCAAyC;AACzC,yCAAyC;AAEzC,oEAAoE;AACpE,0DAA0D;AAE1D,0BAA0B;AAC1B,sCAAsC;AACtC,4BAA4B;AAC5B,8CAA8C;AAC9C,kDAAkD;AAClD,mDAAmD;AACnD,uDAAuD;AACvD,4EAA4E;AAC5E,sBAAsB;AACtB,QAAQ;AACR,gDAAgD;AAChD,qCAAqC;AACrC,wBAAwB;AACxB,mBAAmB;AACnB,oBAAoB;AACpB,uDAAuD;AACvD,kEAAkE;AAClE,eAAe;AACf,mBAAmB;AACnB,uBAAuB;AACvB,wBAAwB;AACxB,yBAAyB;AACzB,sBAAsB;AACtB,4BAA4B;AAC5B,4BAA4B;AAC5B,kDAAkD;AAClD,yDAAyD;AACzD,gBAAgB;AAChB,aAAa;AACb,iBAAiB;AACjB,oEAAoE;AACpE,UAAU;AACV,eAAe;AACf,qBAAqB;AACrB,iFAAiF;AACjF,0CAA0C;AAC1C,iBAAiB;AACjB,4BAA4B;AAC5B,kDAAkD;AAClD,yDAAyD;AACzD,gBAAgB;AAChB,aAAa;AACb,UAAU;AACV,eAAe;AACf,iBAAiB;AACjB,sBAAsB;AACtB,4BAA4B;AAC5B,yEAAyE;AACzE,iBAAiB;AACjB,yDAAyD;AACzD,UAAU;AACV,eAAe;AACf,oBAAoB;AACpB,qBAAqB;AACrB,oBAAoB;AACpB,sBAAsB;AACtB,oBAAoB;AACpB,yBAAyB;AACzB,uBAAuB;AACvB,eAAe;AACf,oCAAoC;AACpC,kEAAkE;AAClE,eAAe;AACf,MAAM;AACN,wBAAwB;AACxB,KAAK;AAEL,mFAAmF;AAEnF,6CAA6C;AAC7C,sCAAsC;AACtC,4BAA4B;AAC5B,gEAAgE;AAChE,mCAAmC;AACnC,mCAAmC;AACnC,wDAAwD;AACxD,+CAA+C;AAC/C,KAAK"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LockfileType } from './';
|
|
2
|
-
import { YarnLockBase } from './yarn-lock-parse-base';
|
|
3
|
-
import { YarnLockParseBase } from './yarn-lock-parse-base';
|
|
4
|
-
export declare type Yarn2Lock = YarnLockBase<LockfileType.yarn2>;
|
|
5
|
-
export declare class Yarn2LockParser extends YarnLockParseBase<LockfileType.yarn2> {
|
|
6
|
-
private keyNormalizer;
|
|
7
|
-
constructor();
|
|
8
|
-
parseLockFile(lockFileContents: string): Yarn2Lock;
|
|
9
|
-
}
|
|
@@ -1,44 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
2
|
+
// import * as yaml from 'yaml';
|
|
3
|
+
//
|
|
4
|
+
// import { LockfileType } from './';
|
|
5
|
+
// import getRuntimeVersion from '../get-node-runtime-version';
|
|
6
|
+
// import { InvalidUserInputError, UnsupportedRuntimeError } from '../errors';
|
|
7
|
+
// import { YarnLockBase, YarnLockDeps } from './yarn-lock-parse-base';
|
|
8
|
+
// import { YarnLockParseBase } from './yarn-lock-parse-base';
|
|
9
|
+
// import {
|
|
10
|
+
// YarnLockFileKeyNormalizer,
|
|
11
|
+
// yarnLockFileKeyNormalizer,
|
|
12
|
+
// } from './yarn-utils';
|
|
13
|
+
//
|
|
14
|
+
// export type Yarn2Lock = YarnLockBase<LockfileType.yarn2>;
|
|
15
|
+
//
|
|
16
|
+
// export class Yarn2LockParser extends YarnLockParseBase<LockfileType.yarn2> {
|
|
17
|
+
// private keyNormalizer: YarnLockFileKeyNormalizer;
|
|
18
|
+
//
|
|
19
|
+
// constructor() {
|
|
20
|
+
// super(LockfileType.yarn2);
|
|
21
|
+
// // @yarnpkg/core doesn't work with Node.js < 10
|
|
22
|
+
// if (getRuntimeVersion() < 10) {
|
|
23
|
+
// throw new UnsupportedRuntimeError(
|
|
24
|
+
// `yarn.lock parsing is supported for Node.js v10 and higher.`,
|
|
25
|
+
// );
|
|
26
|
+
// }
|
|
27
|
+
// const structUtils = require('@yarnpkg/core').structUtils;
|
|
28
|
+
// const parseDescriptor = structUtils.parseDescriptor;
|
|
29
|
+
// const parseRange = structUtils.parseRange;
|
|
30
|
+
// this.keyNormalizer = yarnLockFileKeyNormalizer(parseDescriptor, parseRange);
|
|
31
|
+
// }
|
|
32
|
+
//
|
|
33
|
+
// public parseLockFile(lockFileContents: string): Yarn2Lock {
|
|
34
|
+
// try {
|
|
35
|
+
// const rawYarnLock: any = yaml.parse(lockFileContents);
|
|
36
|
+
// delete rawYarnLock.__metadata;
|
|
37
|
+
// const dependencies: YarnLockDeps = {};
|
|
38
|
+
// Object.entries(rawYarnLock).forEach(
|
|
39
|
+
// ([fullDescriptor, versionData]: [string, any]) => {
|
|
40
|
+
// this.keyNormalizer(fullDescriptor).forEach((descriptor) => {
|
|
41
|
+
// dependencies[descriptor] = versionData;
|
|
42
|
+
// });
|
|
43
|
+
// },
|
|
44
|
+
// );
|
|
45
|
+
// return {
|
|
46
|
+
// dependencies,
|
|
47
|
+
// lockfileType: LockfileType.yarn2,
|
|
48
|
+
// object: dependencies,
|
|
49
|
+
// type: LockfileType.yarn2,
|
|
50
|
+
// };
|
|
51
|
+
// } catch (e) {
|
|
52
|
+
// throw new InvalidUserInputError(
|
|
53
|
+
// `yarn.lock parsing failed with an error: ${e.message}`,
|
|
54
|
+
// );
|
|
55
|
+
// }
|
|
56
|
+
// }
|
|
57
|
+
// }
|
|
44
58
|
//# sourceMappingURL=yarn2-lock-parse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn2-lock-parse.js","sourceRoot":"","sources":["../../lib/parsers/yarn2-lock-parse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"yarn2-lock-parse.js","sourceRoot":"","sources":["../../lib/parsers/yarn2-lock-parse.ts"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,EAAE;AACF,qCAAqC;AACrC,+DAA+D;AAC/D,8EAA8E;AAC9E,uEAAuE;AACvE,8DAA8D;AAC9D,WAAW;AACX,+BAA+B;AAC/B,+BAA+B;AAC/B,yBAAyB;AACzB,EAAE;AACF,4DAA4D;AAC5D,EAAE;AACF,+EAA+E;AAC/E,sDAAsD;AACtD,EAAE;AACF,oBAAoB;AACpB,iCAAiC;AACjC,sDAAsD;AACtD,sCAAsC;AACtC,2CAA2C;AAC3C,wEAAwE;AACxE,WAAW;AACX,QAAQ;AACR,gEAAgE;AAChE,2DAA2D;AAC3D,iDAAiD;AACjD,mFAAmF;AACnF,MAAM;AACN,EAAE;AACF,gEAAgE;AAChE,YAAY;AACZ,+DAA+D;AAC/D,uCAAuC;AACvC,+CAA+C;AAC/C,6CAA6C;AAC7C,8DAA8D;AAC9D,yEAAyE;AACzE,sDAAsD;AACtD,gBAAgB;AAChB,aAAa;AACb,WAAW;AACX,iBAAiB;AACjB,wBAAwB;AACxB,4CAA4C;AAC5C,gCAAgC;AAChC,oCAAoC;AACpC,WAAW;AACX,oBAAoB;AACpB,yCAAyC;AACzC,kEAAkE;AAClE,WAAW;AACX,QAAQ;AACR,MAAM;AACN,IAAI"}
|
package/package.json
CHANGED
|
@@ -30,26 +30,24 @@
|
|
|
30
30
|
],
|
|
31
31
|
"homepage": "https://github.com/snyk/nodejs-lockfile-parser#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@snyk/graphlib": "2.1.9-patch",
|
|
34
|
-
"@yarnpkg/core": "^2.0.0-rc.29",
|
|
35
33
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
36
34
|
"event-loop-spinner": "^2.0.0",
|
|
37
35
|
"got": "11.4.0",
|
|
36
|
+
"graphlib": "2.1.8",
|
|
38
37
|
"lodash.clonedeep": "^4.5.0",
|
|
39
|
-
"lodash.isempty": "^4.4.0",
|
|
40
38
|
"lodash.flatmap": "^4.5.0",
|
|
39
|
+
"lodash.isempty": "^4.4.0",
|
|
41
40
|
"lodash.set": "^4.3.2",
|
|
42
41
|
"lodash.topairs": "^4.3.0",
|
|
43
42
|
"p-map": "2.1.0",
|
|
44
43
|
"snyk-config": "^3.0.0",
|
|
45
|
-
"source-map-support": "^0.5.7",
|
|
46
44
|
"tslib": "^1.9.3",
|
|
47
|
-
"uuid": "^
|
|
45
|
+
"uuid": "^8.3.0",
|
|
48
46
|
"yaml": "^1.9.2"
|
|
49
47
|
},
|
|
50
48
|
"devDependencies": {
|
|
51
49
|
"@types/node": "^10.17.26",
|
|
52
|
-
"@types/uuid": "^3.
|
|
50
|
+
"@types/uuid": "^8.3.0",
|
|
53
51
|
"@typescript-eslint/eslint-plugin": "^2.29.0",
|
|
54
52
|
"@typescript-eslint/parser": "^2.29.0",
|
|
55
53
|
"eslint": "6.8.0",
|
|
@@ -59,5 +57,5 @@
|
|
|
59
57
|
"tap": "^12.6.1",
|
|
60
58
|
"typescript": "3.8.3"
|
|
61
59
|
},
|
|
62
|
-
"version": "1.
|
|
60
|
+
"version": "1.30.0"
|
|
63
61
|
}
|