@theia/cli 1.67.0-next.56 → 1.67.0-next.59
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/lib/check-dependencies.d.ts +13 -0
- package/lib/check-dependencies.d.ts.map +1 -0
- package/lib/check-dependencies.js +269 -0
- package/lib/check-dependencies.js.map +1 -0
- package/lib/download-plugins.d.ts +29 -0
- package/lib/download-plugins.d.ts.map +1 -0
- package/lib/download-plugins.js +293 -0
- package/lib/download-plugins.js.map +1 -0
- package/lib/run-test.d.ts +12 -0
- package/lib/run-test.d.ts.map +1 -0
- package/lib/run-test.js +80 -0
- package/lib/run-test.js.map +1 -0
- package/lib/test-page.d.ts +18 -0
- package/lib/test-page.d.ts.map +1 -0
- package/lib/test-page.js +104 -0
- package/lib/test-page.js.map +1 -0
- package/lib/theia.d.ts +2 -0
- package/lib/theia.d.ts.map +1 -0
- package/lib/theia.js +602 -0
- package/lib/theia.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface CheckDependenciesOptions {
|
|
2
|
+
workspaces: string[] | undefined;
|
|
3
|
+
include: string[];
|
|
4
|
+
exclude: string[];
|
|
5
|
+
skipHoisted: boolean;
|
|
6
|
+
skipUniqueness: boolean;
|
|
7
|
+
skipSingleTheiaVersion: boolean;
|
|
8
|
+
onlyTheiaExtensions: boolean;
|
|
9
|
+
suppress: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default function checkDependencies(options: CheckDependenciesOptions): void;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=check-dependencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-dependencies.d.ts","sourceRoot":"","sources":["../src/check-dependencies.ts"],"names":[],"mappings":"AA2BA,UAAU,wBAAwB;IAC9B,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;IAChC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAA;CACpB;AA8BD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAmBjF"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const fs = require("fs");
|
|
19
|
+
const path = require("path");
|
|
20
|
+
const glob_1 = require("glob");
|
|
21
|
+
const log_update_1 = require("log-update");
|
|
22
|
+
const chalk = require("chalk");
|
|
23
|
+
const NODE_MODULES = 'node_modules';
|
|
24
|
+
const PACKAGE_JSON = 'package.json';
|
|
25
|
+
const logUpdate = (0, log_update_1.create)(process.stdout);
|
|
26
|
+
function checkDependencies(options) {
|
|
27
|
+
const workspaces = deriveWorkspaces(options);
|
|
28
|
+
logUpdate(`✅ Found ${workspaces.length} workspaces`);
|
|
29
|
+
console.log('🔍 Collecting dependencies...');
|
|
30
|
+
const dependencies = findAllDependencies(workspaces, options);
|
|
31
|
+
logUpdate(`✅ Found ${dependencies.length} dependencies`);
|
|
32
|
+
console.log('🔍 Analyzing dependencies...');
|
|
33
|
+
const issues = analyzeDependencies(dependencies, options);
|
|
34
|
+
if (issues.length <= 0) {
|
|
35
|
+
logUpdate('✅ No issues were found');
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
logUpdate('🟠 Found ' + issues.length + ' issues');
|
|
39
|
+
printIssues(issues);
|
|
40
|
+
printHints(issues);
|
|
41
|
+
process.exit(options.suppress ? 0 : 1);
|
|
42
|
+
}
|
|
43
|
+
exports.default = checkDependencies;
|
|
44
|
+
function deriveWorkspaces(options) {
|
|
45
|
+
var _a;
|
|
46
|
+
const wsGlobs = (_a = options.workspaces) !== null && _a !== void 0 ? _a : readWorkspaceGlobsFromPackageJson();
|
|
47
|
+
const workspaces = [];
|
|
48
|
+
for (const wsGlob of wsGlobs) {
|
|
49
|
+
workspaces.push(...glob_1.glob.sync(wsGlob + '/'));
|
|
50
|
+
}
|
|
51
|
+
return workspaces;
|
|
52
|
+
}
|
|
53
|
+
function readWorkspaceGlobsFromPackageJson() {
|
|
54
|
+
var _a;
|
|
55
|
+
const rootPackageJson = path.join(process.cwd(), PACKAGE_JSON);
|
|
56
|
+
if (!fs.existsSync(rootPackageJson)) {
|
|
57
|
+
console.error('Directory does not contain a package.json with defined workspaces');
|
|
58
|
+
console.info('Run in the root of a Theia project or specify them via --workspaces');
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
return (_a = require(rootPackageJson).workspaces) !== null && _a !== void 0 ? _a : [];
|
|
62
|
+
}
|
|
63
|
+
function findAllDependencies(workspaces, options) {
|
|
64
|
+
const dependencies = [];
|
|
65
|
+
dependencies.push(...findDependencies('.', options));
|
|
66
|
+
for (const workspace of workspaces) {
|
|
67
|
+
dependencies.push(...findDependencies(workspace, options));
|
|
68
|
+
}
|
|
69
|
+
return dependencies;
|
|
70
|
+
}
|
|
71
|
+
function findDependencies(workspace, options) {
|
|
72
|
+
const dependent = getPackageName(path.join(process.cwd(), workspace, PACKAGE_JSON));
|
|
73
|
+
const nodeModulesDir = path.join(workspace, NODE_MODULES);
|
|
74
|
+
const matchingPackageJsons = [];
|
|
75
|
+
options.include.forEach(include => glob_1.glob.sync(`${include}/${PACKAGE_JSON}`, {
|
|
76
|
+
cwd: nodeModulesDir,
|
|
77
|
+
ignore: [
|
|
78
|
+
`**/${NODE_MODULES}/**`, // node_modules folders within dependencies
|
|
79
|
+
`[^@]*/*/**/${PACKAGE_JSON}`, // package.json that isn't at the package root (and not in an @org)
|
|
80
|
+
`@*/*/*/**/${PACKAGE_JSON}`, // package.json that isn't at the package root (and in an @org)
|
|
81
|
+
...options.exclude
|
|
82
|
+
] // user-specified exclude patterns
|
|
83
|
+
}).forEach(packageJsonPath => {
|
|
84
|
+
const dependency = toDependency(packageJsonPath, nodeModulesDir, dependent);
|
|
85
|
+
if (!options.onlyTheiaExtensions || dependency.isTheiaExtension) {
|
|
86
|
+
matchingPackageJsons.push(dependency);
|
|
87
|
+
}
|
|
88
|
+
const childNodeModules = path.join(nodeModulesDir, packageJsonPath, '..');
|
|
89
|
+
matchingPackageJsons.push(...findDependencies(childNodeModules, options));
|
|
90
|
+
}));
|
|
91
|
+
return matchingPackageJsons;
|
|
92
|
+
}
|
|
93
|
+
function toDependency(packageJsonPath, nodeModulesDir, dependent) {
|
|
94
|
+
const fullPackageJsonPath = path.join(process.cwd(), nodeModulesDir, packageJsonPath);
|
|
95
|
+
const name = getPackageName(fullPackageJsonPath);
|
|
96
|
+
const version = getPackageVersion(fullPackageJsonPath);
|
|
97
|
+
return {
|
|
98
|
+
name: name !== null && name !== void 0 ? name : packageJsonPath.replace('/' + PACKAGE_JSON, ''),
|
|
99
|
+
version: version !== null && version !== void 0 ? version : 'unknown',
|
|
100
|
+
path: path.relative(process.cwd(), fullPackageJsonPath),
|
|
101
|
+
hoisted: nodeModulesDir === NODE_MODULES,
|
|
102
|
+
dependent: dependent,
|
|
103
|
+
isTheiaExtension: isTheiaExtension(fullPackageJsonPath)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function getPackageVersion(fullPackageJsonPath) {
|
|
107
|
+
try {
|
|
108
|
+
return require(fullPackageJsonPath).version;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function getPackageName(fullPackageJsonPath) {
|
|
115
|
+
try {
|
|
116
|
+
return require(fullPackageJsonPath).name;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function isTheiaExtension(fullPackageJsonPath) {
|
|
123
|
+
try {
|
|
124
|
+
const theiaExtension = require(fullPackageJsonPath).theiaExtensions;
|
|
125
|
+
return theiaExtension ? true : false;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function analyzeDependencies(packages, options) {
|
|
132
|
+
const issues = [];
|
|
133
|
+
if (!options.skipHoisted) {
|
|
134
|
+
issues.push(...findNotHoistedDependencies(packages, options));
|
|
135
|
+
}
|
|
136
|
+
if (!options.skipUniqueness) {
|
|
137
|
+
issues.push(...findDuplicateDependencies(packages, options));
|
|
138
|
+
}
|
|
139
|
+
if (!options.skipSingleTheiaVersion) {
|
|
140
|
+
issues.push(...findTheiaVersionMix(packages, options));
|
|
141
|
+
}
|
|
142
|
+
return issues;
|
|
143
|
+
}
|
|
144
|
+
function findNotHoistedDependencies(packages, options) {
|
|
145
|
+
const issues = [];
|
|
146
|
+
const nonHoistedPackages = packages.filter(p => p.hoisted === false);
|
|
147
|
+
for (const nonHoistedPackage of nonHoistedPackages) {
|
|
148
|
+
issues.push(createNonHoistedPackageIssue(nonHoistedPackage, options));
|
|
149
|
+
}
|
|
150
|
+
return issues;
|
|
151
|
+
}
|
|
152
|
+
function createNonHoistedPackageIssue(nonHoistedPackage, options) {
|
|
153
|
+
return {
|
|
154
|
+
issueType: 'not-hoisted',
|
|
155
|
+
package: nonHoistedPackage,
|
|
156
|
+
relatedPackages: [getHoistedPackageByName(nonHoistedPackage.name)],
|
|
157
|
+
severity: options.suppress ? 'warning' : 'error'
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function getHoistedPackageByName(name) {
|
|
161
|
+
return toDependency(path.join(name, PACKAGE_JSON), NODE_MODULES);
|
|
162
|
+
}
|
|
163
|
+
function findDuplicateDependencies(packages, options) {
|
|
164
|
+
const duplicates = [];
|
|
165
|
+
const packagesGroupedByName = new Map();
|
|
166
|
+
for (const currentPackage of packages) {
|
|
167
|
+
const name = currentPackage.name;
|
|
168
|
+
if (!packagesGroupedByName.has(name)) {
|
|
169
|
+
packagesGroupedByName.set(name, []);
|
|
170
|
+
}
|
|
171
|
+
const currentPackages = packagesGroupedByName.get(name);
|
|
172
|
+
currentPackages.push(currentPackage);
|
|
173
|
+
if (currentPackages.length > 1 && duplicates.indexOf(name) === -1) {
|
|
174
|
+
duplicates.push(name);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
duplicates.sort();
|
|
178
|
+
const issues = [];
|
|
179
|
+
for (const duplicate of duplicates) {
|
|
180
|
+
const duplicatePackages = packagesGroupedByName.get(duplicate);
|
|
181
|
+
if (duplicatePackages && duplicatePackages.length > 0) {
|
|
182
|
+
issues.push({
|
|
183
|
+
issueType: 'multiple-versions',
|
|
184
|
+
package: duplicatePackages.pop(),
|
|
185
|
+
relatedPackages: duplicatePackages,
|
|
186
|
+
severity: options.suppress ? 'warning' : 'error'
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return issues;
|
|
191
|
+
}
|
|
192
|
+
function findTheiaVersionMix(packages, options) {
|
|
193
|
+
// @theia/monaco-editor-core is following the versions of Monaco so it can't be part of this check
|
|
194
|
+
const theiaPackages = packages.filter(p => p.name.startsWith('@theia/') && !p.name.startsWith('@theia/monaco-editor-core'));
|
|
195
|
+
let theiaVersion = undefined;
|
|
196
|
+
let referenceTheiaPackage = undefined;
|
|
197
|
+
const packagesWithOtherVersion = [];
|
|
198
|
+
for (const theiaPackage of theiaPackages) {
|
|
199
|
+
if (!theiaVersion && theiaPackage.version) {
|
|
200
|
+
theiaVersion = theiaPackage.version;
|
|
201
|
+
referenceTheiaPackage = theiaPackage;
|
|
202
|
+
}
|
|
203
|
+
else if (theiaVersion !== theiaPackage.version) {
|
|
204
|
+
packagesWithOtherVersion.push(theiaPackage);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (referenceTheiaPackage && packagesWithOtherVersion.length > 0) {
|
|
208
|
+
return [{
|
|
209
|
+
issueType: 'theia-version-mix',
|
|
210
|
+
package: referenceTheiaPackage,
|
|
211
|
+
relatedPackages: packagesWithOtherVersion,
|
|
212
|
+
severity: 'error'
|
|
213
|
+
}];
|
|
214
|
+
}
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
function printIssues(issues) {
|
|
218
|
+
console.log();
|
|
219
|
+
const indent = issues.length.toString().length;
|
|
220
|
+
issues.forEach((issue, index) => {
|
|
221
|
+
printIssue(issue, index + 1, indent);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function printIssue(issue, issueNumber, indent) {
|
|
225
|
+
const remainingIndent = indent - issueNumber.toString().length;
|
|
226
|
+
const indentString = ' '.repeat(remainingIndent + 1);
|
|
227
|
+
console.log(issueTitle(issue, issueNumber, indentString));
|
|
228
|
+
console.log(issueDetails(issue, ' ' + ' '.repeat(indent)));
|
|
229
|
+
console.log();
|
|
230
|
+
}
|
|
231
|
+
function issueTitle(issue, issueNumber, indent) {
|
|
232
|
+
var _a;
|
|
233
|
+
const dependent = issue.package.dependent ? ` in ${chalk.blueBright((_a = issue.package.dependent) !== null && _a !== void 0 ? _a : 'unknown')}` : '';
|
|
234
|
+
return chalk.bgWhiteBright.bold.black(`#${issueNumber}${indent}`) + ' ' + chalk.cyanBright(issue.package.name)
|
|
235
|
+
+ dependent + chalk.dim(` [${issue.issueType}]`);
|
|
236
|
+
}
|
|
237
|
+
function issueDetails(issue, indent) {
|
|
238
|
+
return indent + severity(issue) + ' ' + issueMessage(issue) + '\n'
|
|
239
|
+
+ indent + versionLine(issue.package) + '\n'
|
|
240
|
+
+ issue.relatedPackages.map(p => indent + versionLine(p)).join('\n');
|
|
241
|
+
}
|
|
242
|
+
function issueMessage(issue) {
|
|
243
|
+
if (issue.issueType === 'multiple-versions') {
|
|
244
|
+
return `Multiple versions of dependency ${chalk.bold(issue.package.name)} found.`;
|
|
245
|
+
}
|
|
246
|
+
else if (issue.issueType === 'theia-version-mix') {
|
|
247
|
+
return `Mix of ${chalk.bold('@theia/*')} versions found.`;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
return `Dependency ${chalk.bold(issue.package.name)} is not hoisted.`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
function severity(issue) {
|
|
254
|
+
return issue.severity === 'error' ? chalk.red('error') : chalk.yellow('warning');
|
|
255
|
+
}
|
|
256
|
+
function versionLine(pckg) {
|
|
257
|
+
return chalk.bold(pckg.version) + ' in ' + pckg.path;
|
|
258
|
+
}
|
|
259
|
+
function printHints(issues) {
|
|
260
|
+
console.log();
|
|
261
|
+
if (issues.find(i => i.issueType === 'theia-version-mix')) {
|
|
262
|
+
console.log('⛔ A mix of Theia versions is very likely leading to a broken application.');
|
|
263
|
+
}
|
|
264
|
+
console.log(`ℹ️ Use ${chalk.bold('npm ls <package-name>')} to find out why those multiple versions of a package are pulled.`);
|
|
265
|
+
console.log('ℹ️ Try to resolve those issues by finding package versions along the dependency chain that depend on compatible versions.');
|
|
266
|
+
console.log(`ℹ️ Use ${chalk.bold('overrides')} in your root package.json to force specific versions as a last resort.`);
|
|
267
|
+
console.log();
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=check-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-dependencies.js","sourceRoot":"","sources":["../src/check-dependencies.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,yBAAyB;AACzB,6BAA6B;AAC7B,+BAA4B;AAC5B,2CAAkD;AAClD,+BAA+B;AAE/B,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAyC7C,SAAwB,iBAAiB,CAAC,OAAiC;IACvE,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,SAAS,CAAC,WAAW,UAAU,CAAC,MAAM,aAAa,CAAC,CAAC;IAErD,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC7C,MAAM,YAAY,GAAG,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9D,SAAS,CAAC,WAAW,YAAY,CAAC,MAAM,eAAe,CAAC,CAAC;IAEzD,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,mBAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACrB,SAAS,CAAC,wBAAwB,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,SAAS,CAAC,WAAW,GAAG,M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KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;AACzD,CAAC;AAED,SAAS,UAAU,CAAC,MAAyB;IACzC,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,mBAAmB,CAAC,EAAE,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,mEAAmE,CAAC,CAAC;IAC/H,OAAO,CAAC,GAAG,CAAC,4HAA4H,CAAC,CAAC;IAC1I,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,yEAAyE,CAAC,CAAC;IACzH,OAAO,CAAC,GAAG,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OVSXClient } from '@theia/ovsx-client';
|
|
2
|
+
import { RequestService } from '@theia/request';
|
|
3
|
+
import { RateLimiter } from 'limiter';
|
|
4
|
+
/**
|
|
5
|
+
* Available options when downloading.
|
|
6
|
+
*/
|
|
7
|
+
export interface DownloadPluginsOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Determines if a plugin should be unpacked.
|
|
10
|
+
* Defaults to `false`.
|
|
11
|
+
*/
|
|
12
|
+
packed?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Determines if failures while downloading plugins should be ignored.
|
|
15
|
+
* Defaults to `false`.
|
|
16
|
+
*/
|
|
17
|
+
ignoreErrors?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The supported vscode API version.
|
|
20
|
+
* Used to determine extension compatibility.
|
|
21
|
+
*/
|
|
22
|
+
apiVersion?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Fetch plugins in parallel
|
|
25
|
+
*/
|
|
26
|
+
parallel?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export default function downloadPlugins(ovsxClient: OVSXClient, rateLimiter: RateLimiter, requestService: RequestService, options?: DownloadPluginsOptions): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=download-plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-plugins.d.ts","sourceRoot":"","sources":["../src/download-plugins.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAqB,UAAU,EAAqB,MAAM,oBAAoB,CAAC;AAOtF,OAAO,EAAkB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAQD,wBAA8B,eAAe,CACzC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,sBAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CAyGf"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
19
|
+
const ovsx_client_1 = require("@theia/ovsx-client");
|
|
20
|
+
const chalk = require("chalk");
|
|
21
|
+
const decompress = require("decompress");
|
|
22
|
+
const fs_1 = require("fs");
|
|
23
|
+
const path = require("path");
|
|
24
|
+
const temp = require("temp");
|
|
25
|
+
const api_1 = require("@theia/application-package/lib/api");
|
|
26
|
+
const escapeStringRegexp = require("escape-string-regexp");
|
|
27
|
+
temp.track();
|
|
28
|
+
async function downloadPlugins(ovsxClient, rateLimiter, requestService, options = {}) {
|
|
29
|
+
const { packed = false, ignoreErrors = false, apiVersion = api_1.DEFAULT_SUPPORTED_API_VERSION, parallel = true } = options;
|
|
30
|
+
const apiFilter = new ovsx_client_1.OVSXApiFilterImpl(ovsxClient, apiVersion);
|
|
31
|
+
// Collect the list of failures to be appended at the end of the script.
|
|
32
|
+
const failures = [];
|
|
33
|
+
// Resolve the `package.json` at the current working directory.
|
|
34
|
+
const pck = JSON.parse(await fs_1.promises.readFile(path.resolve('package.json'), 'utf8'));
|
|
35
|
+
// Resolve the directory for which to download the plugins.
|
|
36
|
+
const pluginsDir = pck.theiaPluginsDir || 'plugins';
|
|
37
|
+
// Excluded extension ids.
|
|
38
|
+
const excludedIds = new Set(pck.theiaPluginsExcludeIds || []);
|
|
39
|
+
const parallelOrSequence = async (tasks) => {
|
|
40
|
+
if (parallel) {
|
|
41
|
+
await Promise.all(tasks.map(task => task()));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
for (const task of tasks) {
|
|
45
|
+
await task();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
// Downloader wrapper
|
|
50
|
+
const downloadPlugin = async (plugin) => {
|
|
51
|
+
await downloadPluginAsync(requestService, rateLimiter, failures, plugin.id, plugin.downloadUrl, pluginsDir, packed, plugin.version);
|
|
52
|
+
};
|
|
53
|
+
const downloader = async (plugins) => {
|
|
54
|
+
await parallelOrSequence(plugins.map(plugin => () => downloadPlugin(plugin)));
|
|
55
|
+
};
|
|
56
|
+
await fs_1.promises.mkdir(pluginsDir, { recursive: true });
|
|
57
|
+
if (!pck.theiaPlugins) {
|
|
58
|
+
console.log(chalk.red('error: missing mandatory \'theiaPlugins\' property.'));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
console.warn('--- downloading plugins ---');
|
|
63
|
+
// Download the raw plugins defined by the `theiaPlugins` property.
|
|
64
|
+
// This will include both "normal" plugins as well as "extension packs".
|
|
65
|
+
const pluginsToDownload = Object.entries(pck.theiaPlugins)
|
|
66
|
+
.filter((entry) => typeof entry[1] === 'string')
|
|
67
|
+
.map(([id, url]) => ({ id, downloadUrl: resolveDownloadUrlPlaceholders(url) }));
|
|
68
|
+
await downloader(pluginsToDownload);
|
|
69
|
+
const handleDependencyList = async (dependencies) => {
|
|
70
|
+
// De-duplicate extension ids to only download each once:
|
|
71
|
+
const ids = new Set(dependencies.flat());
|
|
72
|
+
await parallelOrSequence(Array.from(ids, id => async () => {
|
|
73
|
+
try {
|
|
74
|
+
await rateLimiter.removeTokens(1);
|
|
75
|
+
const extension = await apiFilter.findLatestCompatibleExtension({
|
|
76
|
+
extensionId: id,
|
|
77
|
+
includeAllVersions: true,
|
|
78
|
+
targetPlatform
|
|
79
|
+
});
|
|
80
|
+
const version = extension === null || extension === void 0 ? void 0 : extension.version;
|
|
81
|
+
const downloadUrl = extension === null || extension === void 0 ? void 0 : extension.files.download;
|
|
82
|
+
if (downloadUrl) {
|
|
83
|
+
await rateLimiter.removeTokens(1);
|
|
84
|
+
await downloadPlugin({ id, downloadUrl, version });
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
failures.push(`No download url for extension pack ${id} (${version})`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
console.error(err);
|
|
92
|
+
failures.push(err.message);
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
};
|
|
96
|
+
console.warn('--- collecting extension-packs ---');
|
|
97
|
+
const extensionPacks = await collectExtensionPacks(pluginsDir, excludedIds);
|
|
98
|
+
if (extensionPacks.size > 0) {
|
|
99
|
+
console.warn(`--- resolving ${extensionPacks.size} extension-packs ---`);
|
|
100
|
+
await handleDependencyList(Array.from(extensionPacks.values()));
|
|
101
|
+
}
|
|
102
|
+
console.warn('--- collecting extension dependencies ---');
|
|
103
|
+
const pluginDependencies = await collectPluginDependencies(pluginsDir, excludedIds);
|
|
104
|
+
if (pluginDependencies.length > 0) {
|
|
105
|
+
console.warn(`--- resolving ${pluginDependencies.length} extension dependencies ---`);
|
|
106
|
+
await handleDependencyList(pluginDependencies);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
temp.cleanupSync();
|
|
111
|
+
}
|
|
112
|
+
for (const failure of failures) {
|
|
113
|
+
console.error(failure);
|
|
114
|
+
}
|
|
115
|
+
if (!ignoreErrors && failures.length > 0) {
|
|
116
|
+
throw new Error('Errors downloading some plugins. To make these errors non fatal, re-run with --ignore-errors');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.default = downloadPlugins;
|
|
120
|
+
const targetPlatform = `${process.platform}-${process.arch}`;
|
|
121
|
+
const placeholders = {
|
|
122
|
+
targetPlatform
|
|
123
|
+
};
|
|
124
|
+
function resolveDownloadUrlPlaceholders(url) {
|
|
125
|
+
for (const [name, value] of Object.entries(placeholders)) {
|
|
126
|
+
url = url.replace(new RegExp(escapeStringRegexp(`\${${name}}`), 'g'), value);
|
|
127
|
+
}
|
|
128
|
+
return url;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Downloads a plugin, will make multiple attempts before actually failing.
|
|
132
|
+
* @param requestService
|
|
133
|
+
* @param failures reference to an array storing all failures.
|
|
134
|
+
* @param plugin plugin short name.
|
|
135
|
+
* @param pluginUrl url to download the plugin at.
|
|
136
|
+
* @param target where to download the plugin in.
|
|
137
|
+
* @param packed whether to decompress or not.
|
|
138
|
+
*/
|
|
139
|
+
async function downloadPluginAsync(requestService, rateLimiter, failures, plugin, pluginUrl, pluginsDir, packed, version) {
|
|
140
|
+
if (!plugin) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
let fileExt;
|
|
144
|
+
if (pluginUrl.endsWith('tar.gz')) {
|
|
145
|
+
fileExt = '.tar.gz';
|
|
146
|
+
}
|
|
147
|
+
else if (pluginUrl.endsWith('vsix')) {
|
|
148
|
+
fileExt = '.vsix';
|
|
149
|
+
}
|
|
150
|
+
else if (pluginUrl.endsWith('theia')) {
|
|
151
|
+
fileExt = '.theia'; // theia plugins.
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
failures.push(chalk.red(`error: '${plugin}' has an unsupported file type: '${pluginUrl}'`));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const targetPath = path.resolve(pluginsDir, `${plugin}${packed === true ? fileExt : ''}`);
|
|
158
|
+
// Skip plugins which have previously been downloaded.
|
|
159
|
+
if (await isDownloaded(targetPath)) {
|
|
160
|
+
console.warn('- ' + plugin + ': already downloaded - skipping');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const maxAttempts = 5;
|
|
164
|
+
const retryDelay = 2000;
|
|
165
|
+
let attempts;
|
|
166
|
+
let lastError;
|
|
167
|
+
let response;
|
|
168
|
+
for (attempts = 0; attempts < maxAttempts; attempts++) {
|
|
169
|
+
if (attempts > 0) {
|
|
170
|
+
await new Promise(resolve => setTimeout(resolve, retryDelay));
|
|
171
|
+
}
|
|
172
|
+
lastError = undefined;
|
|
173
|
+
try {
|
|
174
|
+
await rateLimiter.removeTokens(1);
|
|
175
|
+
response = await requestService.request({
|
|
176
|
+
url: pluginUrl
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
lastError = error;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
const status = response.res.statusCode;
|
|
184
|
+
const retry = status && (status === 429 || status === 439 || status >= 500);
|
|
185
|
+
if (!retry) {
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (lastError) {
|
|
190
|
+
failures.push(chalk.red(`x ${plugin}: failed to download, last error:\n ${lastError}`));
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (typeof response === 'undefined') {
|
|
194
|
+
failures.push(chalk.red(`x ${plugin}: failed to download (unknown reason)`));
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (response.res.statusCode !== 200) {
|
|
198
|
+
failures.push(chalk.red(`x ${plugin}: failed to download with: ${response.res.statusCode}`));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if ((fileExt === '.vsix' || fileExt === '.theia') && packed === true) {
|
|
202
|
+
// Download .vsix without decompressing.
|
|
203
|
+
await fs_1.promises.writeFile(targetPath, response.buffer);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
await fs_1.promises.mkdir(targetPath, { recursive: true });
|
|
207
|
+
const tempFile = temp.path('theia-plugin-download');
|
|
208
|
+
await fs_1.promises.writeFile(tempFile, response.buffer);
|
|
209
|
+
await decompress(tempFile, targetPath);
|
|
210
|
+
}
|
|
211
|
+
console.warn(chalk.green(`+ ${plugin}${version ? `@${version}` : ''}: downloaded successfully ${attempts > 1 ? `(after ${attempts} attempts)` : ''}`));
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Determine if the resource for the given path is already downloaded.
|
|
215
|
+
* @param filePath the resource path.
|
|
216
|
+
*
|
|
217
|
+
* @returns `true` if the resource is already downloaded, else `false`.
|
|
218
|
+
*/
|
|
219
|
+
async function isDownloaded(filePath) {
|
|
220
|
+
return fs_1.promises.stat(filePath).then(() => true, () => false);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Walk the plugin directory and collect available extension paths.
|
|
224
|
+
* @param pluginDir the plugin directory.
|
|
225
|
+
* @returns the list of all available extension paths.
|
|
226
|
+
*/
|
|
227
|
+
async function collectPackageJsonPaths(pluginDir) {
|
|
228
|
+
const packageJsonPathList = [];
|
|
229
|
+
const files = await fs_1.promises.readdir(pluginDir);
|
|
230
|
+
// Recursively fetch the list of extension `package.json` files.
|
|
231
|
+
for (const file of files) {
|
|
232
|
+
const filePath = path.join(pluginDir, file);
|
|
233
|
+
if ((await fs_1.promises.stat(filePath)).isDirectory()) {
|
|
234
|
+
packageJsonPathList.push(...await collectPackageJsonPaths(filePath));
|
|
235
|
+
}
|
|
236
|
+
else if (path.basename(filePath) === 'package.json' && !path.dirname(filePath).includes('node_modules')) {
|
|
237
|
+
packageJsonPathList.push(filePath);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return packageJsonPathList;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get the mapping of extension-pack paths and their included plugin ids.
|
|
244
|
+
* - If an extension-pack references an explicitly excluded `id` the `id` will be omitted.
|
|
245
|
+
* @param pluginDir the plugin directory.
|
|
246
|
+
* @param excludedIds the list of plugin ids to exclude.
|
|
247
|
+
* @returns the mapping of extension-pack paths and their included plugin ids.
|
|
248
|
+
*/
|
|
249
|
+
async function collectExtensionPacks(pluginDir, excludedIds) {
|
|
250
|
+
const extensionPackPaths = new Map();
|
|
251
|
+
const packageJsonPaths = await collectPackageJsonPaths(pluginDir);
|
|
252
|
+
await Promise.all(packageJsonPaths.map(async (packageJsonPath) => {
|
|
253
|
+
const json = JSON.parse(await fs_1.promises.readFile(packageJsonPath, 'utf8'));
|
|
254
|
+
const extensionPack = json.extensionPack;
|
|
255
|
+
if (Array.isArray(extensionPack)) {
|
|
256
|
+
extensionPackPaths.set(packageJsonPath, extensionPack.filter(id => {
|
|
257
|
+
if (excludedIds.has(id)) {
|
|
258
|
+
console.log(chalk.yellow(`'${id}' referred to by '${json.name}' (ext pack) is excluded because of 'theiaPluginsExcludeIds'`));
|
|
259
|
+
return false; // remove
|
|
260
|
+
}
|
|
261
|
+
return true; // keep
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
}));
|
|
265
|
+
return extensionPackPaths;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Get the mapping of paths and their included plugin ids.
|
|
269
|
+
* - If an extension-pack references an explicitly excluded `id` the `id` will be omitted.
|
|
270
|
+
* @param pluginDir the plugin directory.
|
|
271
|
+
* @param excludedIds the list of plugin ids to exclude.
|
|
272
|
+
* @returns the mapping of extension-pack paths and their included plugin ids.
|
|
273
|
+
*/
|
|
274
|
+
async function collectPluginDependencies(pluginDir, excludedIds) {
|
|
275
|
+
const dependencyIds = [];
|
|
276
|
+
const packageJsonPaths = await collectPackageJsonPaths(pluginDir);
|
|
277
|
+
await Promise.all(packageJsonPaths.map(async (packageJsonPath) => {
|
|
278
|
+
const json = JSON.parse(await fs_1.promises.readFile(packageJsonPath, 'utf8'));
|
|
279
|
+
const extensionDependencies = json.extensionDependencies;
|
|
280
|
+
if (Array.isArray(extensionDependencies)) {
|
|
281
|
+
for (const dependency of extensionDependencies) {
|
|
282
|
+
if (excludedIds.has(dependency)) {
|
|
283
|
+
console.log(chalk.yellow(`'${dependency}' referred to by '${json.name}' is excluded because of 'theiaPluginsExcludeIds'`));
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
dependencyIds.push(dependency);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}));
|
|
291
|
+
return dependencyIds;
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=download-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|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AC7C,IAAI,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,UAAU,qBAAqB,IAAI,CAAC,IAAI,mDAAmD,CAAC,CAAC,CAAC;gBAC/H,CAAC;qBAAM,CAAC;oBACJ,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACnC,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,aAAa,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as net from 'net';
|
|
3
|
+
import * as puppeteer from 'puppeteer-core';
|
|
4
|
+
import { TestFileOptions } from './test-page';
|
|
5
|
+
export interface TestOptions {
|
|
6
|
+
start: () => Promise<net.AddressInfo>;
|
|
7
|
+
launch?: puppeteer.PuppeteerLaunchOptions;
|
|
8
|
+
files?: Partial<TestFileOptions>;
|
|
9
|
+
coverage?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export default function runTest(options: TestOptions): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=run-test.d.ts.map
|