scanoss 0.5.4 → 0.5.6
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/.idea/workspace.xml +57 -38
- package/build/main/cli/bin/cli-bin.js +1 -1
- package/build/main/sdk/DataLayer/DataProviders/ComponentDataProvider.js +3 -1
- package/build/main/sdk/Dependencies/LocalDependency/parsers/npmParser.js +3 -3
- package/build/main/tsconfig.tsbuildinfo +3 -3
- package/build/module/cli/bin/cli-bin.js +1 -1
- package/build/module/sdk/DataLayer/DataProviders/ComponentDataProvider.js +3 -1
- package/build/module/sdk/Dependencies/LocalDependency/parsers/npmParser.js +3 -3
- package/build/module/tsconfig.module.tsbuildinfo +3 -3
- package/package-lock.json +2 -2
- package/package.json +2 -1
- package/src/cli/bin/cli-bin.ts +1 -1
- package/src/sdk/DataLayer/DataProviders/ComponentDataProvider.ts +1 -0
- package/src/sdk/Dependencies/LocalDependency/parsers/npmParser.ts +2 -2
- package/tests/sdk/DataLayer/DataProviders/ComponentDataProvider.spec.ts +42 -9
- package/tests/sdk/Dependencies/LocalDependency/Parsers/npmParser.spec.ts +7 -0
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/generate_expected_output.sh +2 -2
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1_2/scancode-out.json +149662 -0
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1_2/yarn.lock +8409 -0
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1_2/yarn.lock-expected +1153 -0
- package/yarn.lock +4847 -4947
- package/tests/sdk/DataLayer/DataProviders/LicenseDataProvider.ts +0 -37
- package/tests/sdk/DataLayer/samples/simple/expected-output.json +0 -206
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1-complex2/yarn.lock +0 -220
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v2/yarn.lock +0 -31
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v2/yarn.lock-expected +0 -57
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v2-local/yarn.lock +0 -11
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v2-local/yarn.lock-expected +0 -27204
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
-
import { expect } from 'chai';
|
|
3
2
|
import path from 'path';
|
|
4
3
|
|
|
5
4
|
import { ComponentDataProvider } from '../../../../src/sdk/DataLayer/DataProviders/ComponentDataProvider';
|
|
6
5
|
import { ComponentDataLayer } from '../../../../src/sdk/DataLayer/DataLayerTypes';
|
|
7
6
|
|
|
7
|
+
const deepEqualInAnyOrder = require('deep-equal-in-any-order');
|
|
8
|
+
const chai = require('chai');
|
|
9
|
+
chai.use(deepEqualInAnyOrder);
|
|
10
|
+
const { expect } = chai;
|
|
11
|
+
|
|
8
12
|
|
|
9
13
|
describe('Suit test for DataProvider', () => {
|
|
10
14
|
|
|
@@ -36,9 +40,12 @@ describe('Suit test for DataProvider', () => {
|
|
|
36
40
|
name: "Copyright (c) 2015 Unshift.io; Arnout Kazemier; the Contributors.",
|
|
37
41
|
source: "license_file"
|
|
38
42
|
}
|
|
39
|
-
]
|
|
43
|
+
],
|
|
44
|
+
cryptography: null,
|
|
45
|
+
quality: null
|
|
40
46
|
}
|
|
41
|
-
]
|
|
47
|
+
],
|
|
48
|
+
health: null,
|
|
42
49
|
},
|
|
43
50
|
|
|
44
51
|
//Second component with multiple versions detected
|
|
@@ -62,7 +69,13 @@ describe('Suit test for DataProvider', () => {
|
|
|
62
69
|
name: "Copyright (c) 2015 Unshift.io; Arnout Kazemier; the Contributors.",
|
|
63
70
|
source: "license_file"
|
|
64
71
|
}
|
|
65
|
-
]
|
|
72
|
+
],
|
|
73
|
+
cryptography: null,
|
|
74
|
+
quality: {
|
|
75
|
+
sum: 4,
|
|
76
|
+
scoreAvg: 4,
|
|
77
|
+
count: 1
|
|
78
|
+
}
|
|
66
79
|
},
|
|
67
80
|
{
|
|
68
81
|
version: "1.5.0",
|
|
@@ -72,7 +85,13 @@ describe('Suit test for DataProvider', () => {
|
|
|
72
85
|
name: "Copyright (c) 2015 Unshift.io; Arnout Kazemier; the Contributors.",
|
|
73
86
|
source: "license_file"
|
|
74
87
|
}
|
|
75
|
-
]
|
|
88
|
+
],
|
|
89
|
+
cryptography: null,
|
|
90
|
+
quality: {
|
|
91
|
+
sum: 4,
|
|
92
|
+
scoreAvg: 4,
|
|
93
|
+
count: 1
|
|
94
|
+
}
|
|
76
95
|
},
|
|
77
96
|
{
|
|
78
97
|
version: "1.5.10",
|
|
@@ -82,9 +101,12 @@ describe('Suit test for DataProvider', () => {
|
|
|
82
101
|
name: "Copyright (c) 2015 Unshift.io; Arnout Kazemier; the Contributors.",
|
|
83
102
|
source: "license_file"
|
|
84
103
|
}
|
|
85
|
-
]
|
|
104
|
+
],
|
|
105
|
+
cryptography: null,
|
|
106
|
+
quality: null
|
|
86
107
|
}
|
|
87
|
-
]
|
|
108
|
+
],
|
|
109
|
+
health: null,
|
|
88
110
|
},{
|
|
89
111
|
key: "pkg:npm/querystringify",
|
|
90
112
|
purls: ["pkg:npm/querystringify"],
|
|
@@ -94,8 +116,11 @@ describe('Suit test for DataProvider', () => {
|
|
|
94
116
|
version: "2.2.0",
|
|
95
117
|
licenses: ["MIT"],
|
|
96
118
|
copyrights: null,
|
|
119
|
+
cryptography: null,
|
|
120
|
+
quality: null
|
|
97
121
|
}],
|
|
98
122
|
vendor: null,
|
|
123
|
+
health: null,
|
|
99
124
|
},{
|
|
100
125
|
key: "pkg:npm/requires-port",
|
|
101
126
|
purls: ["pkg:npm/requires-port"],
|
|
@@ -105,8 +130,11 @@ describe('Suit test for DataProvider', () => {
|
|
|
105
130
|
version: "1.0.0",
|
|
106
131
|
licenses: ["MIT"],
|
|
107
132
|
copyrights: null,
|
|
133
|
+
cryptography: null,
|
|
134
|
+
quality: null
|
|
108
135
|
}],
|
|
109
136
|
vendor: null,
|
|
137
|
+
health: null,
|
|
110
138
|
},
|
|
111
139
|
{
|
|
112
140
|
key: "pkg:npm/assume",
|
|
@@ -117,7 +145,10 @@ describe('Suit test for DataProvider', () => {
|
|
|
117
145
|
version: "2.3.0",
|
|
118
146
|
licenses: ["MIT"],
|
|
119
147
|
copyrights: null,
|
|
148
|
+
cryptography: null,
|
|
149
|
+
quality: null
|
|
120
150
|
}],
|
|
151
|
+
health: null,
|
|
121
152
|
vendor: null,
|
|
122
153
|
},
|
|
123
154
|
{
|
|
@@ -129,13 +160,15 @@ describe('Suit test for DataProvider', () => {
|
|
|
129
160
|
version: "17.0.0",
|
|
130
161
|
licenses: ["MIT"],
|
|
131
162
|
copyrights: null,
|
|
163
|
+
cryptography: null,
|
|
164
|
+
quality: null
|
|
132
165
|
}],
|
|
133
166
|
vendor: null,
|
|
167
|
+
health: null,
|
|
134
168
|
}
|
|
135
169
|
];
|
|
136
170
|
|
|
137
|
-
expect(componentData.component).to.
|
|
138
|
-
|
|
171
|
+
expect(componentData.component).to.deep.equalInAnyOrder(expectedOutput);
|
|
139
172
|
});
|
|
140
173
|
|
|
141
174
|
});
|
|
@@ -125,4 +125,11 @@ describe('Suit test for yarn lock files', function() {
|
|
|
125
125
|
expect(results).to.be.deep.equal(expectedOutput)
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
it('Testing yarn lock file v1_2', function() {
|
|
129
|
+
const expectedOutput = JSON.parse(fs.readFileSync(path.join(__dirname, './samples/yarn-lock/v1_2/yarn.lock-expected'), 'utf-8'));
|
|
130
|
+
const yarnLock = fs.readFileSync(path.join(__dirname, './samples/yarn-lock/v1_2/yarn.lock'), 'utf-8');
|
|
131
|
+
const results = yarnLockParser(yarnLock, 'yarn.lock');
|
|
132
|
+
expect(results).to.be.deep.equal(expectedOutput)
|
|
133
|
+
});
|
|
134
|
+
|
|
128
135
|
});
|
package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/generate_expected_output.sh
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
# Command used to generate the expected output
|
|
4
|
-
scancode --json-pp - --package $1 | jq -c '.
|
|
3
|
+
# Command used to generate the expected output for yarn.lock
|
|
4
|
+
scancode --json-pp - --package $1 | jq -c '.dependencies[] | { "purl": .purl , "requirement": .extracted_requirement | split(" ") | join(", ") }'
|