@eclipse-glsp/cli 2.2.1 → 2.3.0-next.17
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/README.md +143 -38
- package/dist/cli.js +21959 -0
- package/dist/cli.js.map +6 -0
- package/package.json +22 -29
- package/bin/glsp +0 -2
- package/lib/app.d.ts +0 -3
- package/lib/app.d.ts.map +0 -1
- package/lib/app.js +0 -36
- package/lib/app.js.map +0 -1
- package/lib/commands/check-header.d.ts +0 -21
- package/lib/commands/check-header.d.ts.map +0 -1
- package/lib/commands/check-header.js +0 -240
- package/lib/commands/check-header.js.map +0 -1
- package/lib/commands/checkout.d.ts +0 -27
- package/lib/commands/checkout.d.ts.map +0 -1
- package/lib/commands/checkout.js +0 -41
- package/lib/commands/checkout.js.map +0 -1
- package/lib/commands/coverage-report.d.ts +0 -29
- package/lib/commands/coverage-report.d.ts.map +0 -1
- package/lib/commands/coverage-report.js +0 -126
- package/lib/commands/coverage-report.js.map +0 -1
- package/lib/commands/generate-index.d.ts +0 -46
- package/lib/commands/generate-index.d.ts.map +0 -1
- package/lib/commands/generate-index.js +0 -172
- package/lib/commands/generate-index.js.map +0 -1
- package/lib/commands/release/common.d.ts +0 -68
- package/lib/commands/release/common.d.ts.map +0 -1
- package/lib/commands/release/common.js +0 -293
- package/lib/commands/release/common.js.map +0 -1
- package/lib/commands/release/release-client.d.ts +0 -3
- package/lib/commands/release/release-client.d.ts.map +0 -1
- package/lib/commands/release/release-client.js +0 -57
- package/lib/commands/release/release-client.js.map +0 -1
- package/lib/commands/release/release-eclipse-integration.d.ts +0 -18
- package/lib/commands/release/release-eclipse-integration.d.ts.map +0 -1
- package/lib/commands/release/release-eclipse-integration.js +0 -92
- package/lib/commands/release/release-eclipse-integration.js.map +0 -1
- package/lib/commands/release/release-java-server.d.ts +0 -3
- package/lib/commands/release/release-java-server.d.ts.map +0 -1
- package/lib/commands/release/release-java-server.js +0 -70
- package/lib/commands/release/release-java-server.js.map +0 -1
- package/lib/commands/release/release-server-node.d.ts +0 -18
- package/lib/commands/release/release-server-node.d.ts.map +0 -1
- package/lib/commands/release/release-server-node.js +0 -53
- package/lib/commands/release/release-server-node.js.map +0 -1
- package/lib/commands/release/release-theia-integration.d.ts +0 -18
- package/lib/commands/release/release-theia-integration.d.ts.map +0 -1
- package/lib/commands/release/release-theia-integration.js +0 -53
- package/lib/commands/release/release-theia-integration.js.map +0 -1
- package/lib/commands/release/release-vscode-integration.d.ts +0 -18
- package/lib/commands/release/release-vscode-integration.d.ts.map +0 -1
- package/lib/commands/release/release-vscode-integration.js +0 -53
- package/lib/commands/release/release-vscode-integration.js.map +0 -1
- package/lib/commands/release/release.d.ts +0 -14
- package/lib/commands/release/release.d.ts.map +0 -1
- package/lib/commands/release/release.js +0 -191
- package/lib/commands/release/release.js.map +0 -1
- package/lib/commands/repo/clone.d.ts +0 -28
- package/lib/commands/repo/clone.d.ts.map +0 -1
- package/lib/commands/repo/clone.js +0 -113
- package/lib/commands/repo/clone.js.map +0 -1
- package/lib/commands/repo/clone.spec.d.ts +0 -17
- package/lib/commands/repo/clone.spec.d.ts.map +0 -1
- package/lib/commands/repo/clone.spec.js +0 -126
- package/lib/commands/repo/clone.spec.js.map +0 -1
- package/lib/commands/repo/common.d.ts +0 -23
- package/lib/commands/repo/common.d.ts.map +0 -1
- package/lib/commands/repo/common.js +0 -18
- package/lib/commands/repo/common.js.map +0 -1
- package/lib/commands/repo/config.d.ts +0 -18
- package/lib/commands/repo/config.d.ts.map +0 -1
- package/lib/commands/repo/config.js +0 -28
- package/lib/commands/repo/config.js.map +0 -1
- package/lib/commands/repo/repo.d.ts +0 -17
- package/lib/commands/repo/repo.d.ts.map +0 -1
- package/lib/commands/repo/repo.js +0 -25
- package/lib/commands/repo/repo.js.map +0 -1
- package/lib/commands/update-next.d.ts +0 -20
- package/lib/commands/update-next.d.ts.map +0 -1
- package/lib/commands/update-next.js +0 -146
- package/lib/commands/update-next.js.map +0 -1
- package/lib/common/glsp-component.d.ts +0 -27
- package/lib/common/glsp-component.d.ts.map +0 -1
- package/lib/common/glsp-component.js +0 -13
- package/lib/common/glsp-component.js.map +0 -1
- package/lib/common/glsp-repo.d.ts +0 -44
- package/lib/common/glsp-repo.d.ts.map +0 -1
- package/lib/common/glsp-repo.js +0 -135
- package/lib/common/glsp-repo.js.map +0 -1
- package/lib/common/glsp-repo.spec.d.ts +0 -17
- package/lib/common/glsp-repo.spec.d.ts.map +0 -1
- package/lib/common/glsp-repo.spec.js +0 -130
- package/lib/common/glsp-repo.spec.js.map +0 -1
- package/lib/foo.spec.d.ts +0 -17
- package/lib/foo.spec.d.ts.map +0 -1
- package/lib/foo.spec.js +0 -23
- package/lib/foo.spec.js.map +0 -1
- package/lib/index.d.ts +0 -18
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -18
- package/lib/index.js.map +0 -1
- package/lib/util/command-util.d.ts +0 -26
- package/lib/util/command-util.d.ts.map +0 -1
- package/lib/util/command-util.js +0 -59
- package/lib/util/command-util.js.map +0 -1
- package/lib/util/git-util.d.ts +0 -42
- package/lib/util/git-util.d.ts.map +0 -1
- package/lib/util/git-util.js +0 -124
- package/lib/util/git-util.js.map +0 -1
- package/lib/util/logger.d.ts +0 -23
- package/lib/util/logger.d.ts.map +0 -1
- package/lib/util/logger.js +0 -50
- package/lib/util/logger.js.map +0 -1
- package/lib/util/test-util.spec.d.ts +0 -2
- package/lib/util/test-util.spec.d.ts.map +0 -1
- package/lib/util/test-util.spec.js +0 -44
- package/lib/util/test-util.spec.js.map +0 -1
- package/lib/util/validation-util.d.ts +0 -5
- package/lib/util/validation-util.d.ts.map +0 -1
- package/lib/util/validation-util.js +0 -85
- package/lib/util/validation-util.js.map +0 -1
- package/src/app.ts +0 -35
- package/src/commands/check-header.ts +0 -280
- package/src/commands/coverage-report.ts +0 -113
- package/src/commands/generate-index.ts +0 -169
- package/src/commands/release/common.ts +0 -306
- package/src/commands/release/release-client.ts +0 -55
- package/src/commands/release/release-eclipse-integration.ts +0 -113
- package/src/commands/release/release-java-server.ts +0 -73
- package/src/commands/release/release-server-node.ts +0 -61
- package/src/commands/release/release-theia-integration.ts +0 -65
- package/src/commands/release/release-vscode-integration.ts +0 -67
- package/src/commands/release/release.ts +0 -215
- package/src/commands/update-next.ts +0 -129
- package/src/util/command-util.ts +0 -54
- package/src/util/git-util.ts +0 -123
- package/src/util/logger.ts +0 -57
- package/src/util/validation-util.ts +0 -62
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2022-2024 EclipseSource 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 WITH Classpath-exception-2.0
|
|
16
|
-
********************************************************************************/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.CoverageReportCommand = void 0;
|
|
45
|
-
exports.generateCoverageReport = generateCoverageReport;
|
|
46
|
-
exports.validateAndRetrievePackages = validateAndRetrievePackages;
|
|
47
|
-
exports.collectPackageReportFiles = collectPackageReportFiles;
|
|
48
|
-
const fs = __importStar(require("fs"));
|
|
49
|
-
const path = __importStar(require("path"));
|
|
50
|
-
const shelljs_1 = __importDefault(require("shelljs"));
|
|
51
|
-
const command_util_1 = require("../util/command-util");
|
|
52
|
-
const logger_1 = require("../util/logger");
|
|
53
|
-
const validation_util_1 = require("../util/validation-util");
|
|
54
|
-
exports.CoverageReportCommand = (0, command_util_1.baseCommand)() //
|
|
55
|
-
.name('coverageReport')
|
|
56
|
-
.description('Generate a test coverage report for a glsp component')
|
|
57
|
-
.option('-p, --projectRoot <projectRoot>', 'The root directory of the GLSP component', validation_util_1.validateDirectory, process.cwd())
|
|
58
|
-
.option('-c, --coverageScript <script>', 'Script command of the package root for creating coverage reports', 'test:coverage')
|
|
59
|
-
.action(generateCoverageReport);
|
|
60
|
-
/**
|
|
61
|
-
* Generates and aggregates an 'nyc' coverage report for lerna/yarn mono repositories.
|
|
62
|
-
* First, individual reports for each package are generated. Then, they are aggregated into one combined HTML report.
|
|
63
|
-
* @param options configuration options
|
|
64
|
-
*/
|
|
65
|
-
function generateCoverageReport(options) {
|
|
66
|
-
shelljs_1.default.cd(options.projectRoot);
|
|
67
|
-
const packages = validateAndRetrievePackages(options);
|
|
68
|
-
logger_1.LOGGER.info('Create individual package coverage reports');
|
|
69
|
-
const jsonReports = collectPackageReportFiles(packages, options);
|
|
70
|
-
combineReports(jsonReports, options);
|
|
71
|
-
logger_1.LOGGER.info('Coverage reported generation successful');
|
|
72
|
-
}
|
|
73
|
-
function validateAndRetrievePackages(options) {
|
|
74
|
-
var _a;
|
|
75
|
-
const packagePath = path.join(options.projectRoot, 'package.json');
|
|
76
|
-
if (!fs.existsSync(packagePath)) {
|
|
77
|
-
exports.CoverageReportCommand.error(`Invalid root directory. '${options.projectRoot}' does not contain a package.json.`);
|
|
78
|
-
}
|
|
79
|
-
(0, command_util_1.fatalExec)('yarn nyc -h', 'Nyc is not installed!', (0, command_util_1.getShellConfig)({ silent: true }));
|
|
80
|
-
const packageJson = JSON.parse(fs.readFileSync(packagePath).toString());
|
|
81
|
-
if (!((_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.scripts) === null || _a === void 0 ? void 0 : _a[options.coverageScript])) {
|
|
82
|
-
exports.CoverageReportCommand.error(`Invalid coverage script! The package.json does not have a script with name '${options.coverageScript}'!`);
|
|
83
|
-
}
|
|
84
|
-
if (!Array.isArray(packageJson.workspaces)) {
|
|
85
|
-
exports.CoverageReportCommand.error('Invalid package.json! No yarn workspaces are configured!');
|
|
86
|
-
}
|
|
87
|
-
return packageJson.workspaces.map(pkg => pkg.replace('/*', ''));
|
|
88
|
-
}
|
|
89
|
-
function collectPackageReportFiles(packages, options) {
|
|
90
|
-
logger_1.LOGGER.info('Create combined report');
|
|
91
|
-
shelljs_1.default.exec(`yarn ${options.coverageScript}`);
|
|
92
|
-
// collect reports
|
|
93
|
-
const reports = [];
|
|
94
|
-
packages.forEach(pkg => {
|
|
95
|
-
shelljs_1.default.find(pkg)
|
|
96
|
-
.filter(file => file.endsWith('coverage-final.json'))
|
|
97
|
-
.forEach(json => reports.push(path.resolve(options.projectRoot, json)));
|
|
98
|
-
});
|
|
99
|
-
return reports;
|
|
100
|
-
}
|
|
101
|
-
function combineReports(reportFiles, options) {
|
|
102
|
-
// Copy coverage into root/.nyc_output
|
|
103
|
-
const reportsDir = path.join(options.projectRoot, '.nyc_output');
|
|
104
|
-
if (fs.existsSync(reportsDir)) {
|
|
105
|
-
fs.rmSync(reportsDir, { force: true, recursive: true });
|
|
106
|
-
}
|
|
107
|
-
fs.mkdirSync(reportsDir);
|
|
108
|
-
for (let i = 0; i < reportFiles.length; i++) {
|
|
109
|
-
fs.copyFileSync(reportFiles[i], path.resolve('.nyc_output', `coverage-final-${i}.json`));
|
|
110
|
-
}
|
|
111
|
-
// Temporarily remove root nyc configs otherwise the report command might fail.
|
|
112
|
-
shelljs_1.default.cd(options.projectRoot);
|
|
113
|
-
const configFiles = ['.nycrc', '.nycrc.json', '.nyc-config.js'];
|
|
114
|
-
const tempFiles = [];
|
|
115
|
-
configFiles.forEach(config => {
|
|
116
|
-
if (fs.existsSync(path.join(options.projectRoot, config))) {
|
|
117
|
-
shelljs_1.default.mv(config, '_' + config);
|
|
118
|
-
tempFiles.push('_' + config);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
// Generate report
|
|
122
|
-
shelljs_1.default.exec('yarn nyc report --reporter html', (0, command_util_1.getShellConfig)());
|
|
123
|
-
// Restore nyc configs (if any)
|
|
124
|
-
tempFiles.forEach(config => shelljs_1.default.mv(config, config.substring(1)));
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=coverage-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-report.js","sourceRoot":"","sources":["../../src/commands/coverage-report.ts"],"names":[],"mappings":";AAAA;;;;;;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ClB,iBAAE,CAAC,IAAI,CAAC,iCAAiC,EAAE,IAAA,6BAAc,GAAE,CAAC,CAAC;IAE7D,+BAA+B;IAC/B,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,iBAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023-2024 EclipseSource and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
export interface GenerateIndexCmdOptions {
|
|
17
|
-
singleIndex: boolean;
|
|
18
|
-
forceOverwrite: boolean;
|
|
19
|
-
match: string[] | boolean;
|
|
20
|
-
ignore: string[] | boolean;
|
|
21
|
-
ignoreFile: string;
|
|
22
|
-
style: 'commonjs' | 'esm';
|
|
23
|
-
verbose: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface GlobbyOptions {
|
|
26
|
-
ignore: string[];
|
|
27
|
-
cwd: string;
|
|
28
|
-
onlyFiles: boolean;
|
|
29
|
-
markDirectories: true;
|
|
30
|
-
ignoreFiles: string;
|
|
31
|
-
}
|
|
32
|
-
export declare const GenerateIndex: import("commander").Command;
|
|
33
|
-
export declare function generateIndices(rootDirs: string[], options: GenerateIndexCmdOptions): Promise<void>;
|
|
34
|
-
export declare function generateIndex(rootDir: string, ignoreFilter: (pattern: string[], options: GlobbyOptions) => string[], options: GenerateIndexCmdOptions): Promise<void>;
|
|
35
|
-
export declare function isDirectChild(parent: string, child: string, childHasChildren: () => boolean): boolean;
|
|
36
|
-
export declare function isDirectory(file: string): boolean;
|
|
37
|
-
export declare function isFile(file: string): boolean;
|
|
38
|
-
export declare function getLevel(file: string): number;
|
|
39
|
-
export declare function isChild(parent: string, child: string): boolean;
|
|
40
|
-
export declare function isChildDirectory(parent: string, child: string): boolean;
|
|
41
|
-
export declare function isChildFile(parent: string, child: string): boolean;
|
|
42
|
-
export declare function writeIndex(directory: string, exports: string[], options: GenerateIndexCmdOptions): void;
|
|
43
|
-
export declare function createExport(directory: string, relativePath: string, options: GenerateIndexCmdOptions): string;
|
|
44
|
-
export declare function extractReusableContent(fileContent: string): string;
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=generate-index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-index.d.ts","sourceRoot":"","sources":["../../src/commands/generate-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAWlF,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CACpB;AAGD,UAAU,aAAa;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,IAAI,CAAC;IACtB,WAAW,EAAE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GlE"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2023-2024 EclipseSource 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 WITH Classpath-exception-2.0
|
|
16
|
-
********************************************************************************/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.GenerateIndex = void 0;
|
|
45
|
-
exports.generateIndices = generateIndices;
|
|
46
|
-
exports.generateIndex = generateIndex;
|
|
47
|
-
exports.isDirectChild = isDirectChild;
|
|
48
|
-
exports.isDirectory = isDirectory;
|
|
49
|
-
exports.isFile = isFile;
|
|
50
|
-
exports.getLevel = getLevel;
|
|
51
|
-
exports.isChild = isChild;
|
|
52
|
-
exports.isChildDirectory = isChildDirectory;
|
|
53
|
-
exports.isChildFile = isChildFile;
|
|
54
|
-
exports.writeIndex = writeIndex;
|
|
55
|
-
exports.createExport = createExport;
|
|
56
|
-
exports.extractReusableContent = extractReusableContent;
|
|
57
|
-
const commander_1 = require("commander");
|
|
58
|
-
const fs = __importStar(require("fs"));
|
|
59
|
-
const os = __importStar(require("os"));
|
|
60
|
-
const path = __importStar(require("path"));
|
|
61
|
-
const shelljs_1 = __importDefault(require("shelljs"));
|
|
62
|
-
const command_util_1 = require("../util/command-util");
|
|
63
|
-
const logger_1 = require("../util/logger");
|
|
64
|
-
const validation_util_1 = require("../util/validation-util");
|
|
65
|
-
exports.GenerateIndex = (0, command_util_1.baseCommand)() //
|
|
66
|
-
.name('generateIndex')
|
|
67
|
-
.description('Generate index files in a given source directory.')
|
|
68
|
-
.argument('<rootDir...>', 'The source directory for index generation.')
|
|
69
|
-
.option('-s, --singleIndex', 'Generate a single index file in the source directory instead of indices in each sub-directory', false)
|
|
70
|
-
.option('-f, --forceOverwrite', 'Overwrite existing index files and remove them if there are no entries', false)
|
|
71
|
-
.option('-m, --match [match patterns...]', 'File patterns to consider during indexing', ['**/*.ts', '**/*.tsx'])
|
|
72
|
-
.option('-i, --ignore [ignore patterns...]', 'File patterns to ignore during indexing', ['**/*.spec.ts', '**/*.spec.tsx', '**/*.d.ts'])
|
|
73
|
-
.addOption((0, commander_1.createOption)('-s, --style <importStyle>', 'Import Style').choices(['commonjs', 'esm']).default('commonjs'))
|
|
74
|
-
.option('--ignoreFile <ignoreFile>', 'The file that is used to specify patterns that should be ignored during indexing', '.indexignore')
|
|
75
|
-
.option('-v, --verbose', 'Generate verbose output during generation', false)
|
|
76
|
-
.action(generateIndices);
|
|
77
|
-
async function generateIndices(rootDirs, options) {
|
|
78
|
-
const dirs = rootDirs.map(rootDir => (0, validation_util_1.validateDirectory)(path.resolve(rootDir)));
|
|
79
|
-
const globby = await import('globby');
|
|
80
|
-
const ignoreFilter = (pattern, globbyOptions) => globby.globbySync(pattern, globbyOptions);
|
|
81
|
-
dirs.forEach(dir => generateIndex(dir, ignoreFilter, options));
|
|
82
|
-
}
|
|
83
|
-
async function generateIndex(rootDir, ignoreFilter, options) {
|
|
84
|
-
(0, logger_1.configureLogger)(options.verbose);
|
|
85
|
-
logger_1.LOGGER.debug('Run generateIndex for', rootDir, 'with the following options:', options);
|
|
86
|
-
shelljs_1.default.cd(rootDir);
|
|
87
|
-
const cwd = process.cwd();
|
|
88
|
-
// we want to match all given patterns and subdirectories and ignore all given patterns and (generated) index files
|
|
89
|
-
const pattern = typeof options.match === 'boolean' ? ['**/'] : [...options.match, '**/'];
|
|
90
|
-
const ignore = typeof options.ignore === 'boolean' ? ['**/index.ts'] : [...options.ignore, '**/index.ts'];
|
|
91
|
-
const globbyOptions = {
|
|
92
|
-
ignore,
|
|
93
|
-
cwd,
|
|
94
|
-
onlyFiles: options.singleIndex,
|
|
95
|
-
markDirectories: true, // directories have '/' at the end
|
|
96
|
-
ignoreFiles: '**/' + options.ignoreFile // users can add this file in their directories to ignore files for indexing
|
|
97
|
-
};
|
|
98
|
-
logger_1.LOGGER.debug('Search for children using the following globby options', globbyOptions);
|
|
99
|
-
const files = ignoreFilter(pattern, globbyOptions);
|
|
100
|
-
logger_1.LOGGER.debug('All children considered in the input directory', files);
|
|
101
|
-
const relativeRootDirectory = '';
|
|
102
|
-
if (options.singleIndex) {
|
|
103
|
-
writeIndex(relativeRootDirectory, files.filter(isFile), options);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
// sort by length so we deal with sub-directories before we deal with their parents to determine whether they are empty
|
|
107
|
-
const directories = [...files.filter(isDirectory), relativeRootDirectory].sort((left, right) => right.length - left.length);
|
|
108
|
-
const directoryChildren = new Map();
|
|
109
|
-
for (const directory of directories) {
|
|
110
|
-
const children = files.filter(file => isDirectChild(directory, file, () => { var _a; return !!((_a = directoryChildren.get(file)) === null || _a === void 0 ? void 0 : _a.length); }));
|
|
111
|
-
directoryChildren.set(directory, children);
|
|
112
|
-
writeIndex(directory, children, options);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function isDirectChild(parent, child, childHasChildren) {
|
|
117
|
-
return isChildFile(parent, child) || (isChildDirectory(parent, child) && childHasChildren());
|
|
118
|
-
}
|
|
119
|
-
function isDirectory(file) {
|
|
120
|
-
return file.endsWith('/');
|
|
121
|
-
}
|
|
122
|
-
function isFile(file) {
|
|
123
|
-
return !isDirectory(file);
|
|
124
|
-
}
|
|
125
|
-
function getLevel(file) {
|
|
126
|
-
return file.split('/').length;
|
|
127
|
-
}
|
|
128
|
-
function isChild(parent, child) {
|
|
129
|
-
return child.startsWith(parent);
|
|
130
|
-
}
|
|
131
|
-
function isChildDirectory(parent, child) {
|
|
132
|
-
return isDirectory(child) && isChild(parent, child) && getLevel(child) === getLevel(parent) + 1;
|
|
133
|
-
}
|
|
134
|
-
function isChildFile(parent, child) {
|
|
135
|
-
return isFile(child) && isChild(parent, child) && getLevel(child) === getLevel(parent);
|
|
136
|
-
}
|
|
137
|
-
function writeIndex(directory, exports, options) {
|
|
138
|
-
const indexFile = path.join(process.cwd(), directory, 'index.ts');
|
|
139
|
-
if (exports.length === 0) {
|
|
140
|
-
if (options.forceOverwrite && fs.existsSync(indexFile)) {
|
|
141
|
-
logger_1.LOGGER.info('Remove index file', indexFile);
|
|
142
|
-
fs.rmSync(indexFile);
|
|
143
|
-
}
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const exists = fs.existsSync(indexFile);
|
|
147
|
-
if (exists && !options.forceOverwrite) {
|
|
148
|
-
logger_1.LOGGER.info("Do not overwrite existing index file. Use '-f' to force an overwrite.", indexFile);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const headerContent = exists ? extractReusableContent(fs.readFileSync(indexFile, { encoding: 'utf-8' })) : '';
|
|
152
|
-
const exportContent = exports.map(exported => createExport(directory, exported, options)).sort();
|
|
153
|
-
const content = headerContent + exportContent.join(os.EOL) + os.EOL; // end with an empty line
|
|
154
|
-
logger_1.LOGGER.info((exists ? 'Overwrite' : 'Write') + ' index file', indexFile);
|
|
155
|
-
logger_1.LOGGER.debug(' ' + content.split(os.EOL).join(os.EOL + ' '));
|
|
156
|
-
fs.writeFileSync(indexFile, content, { flag: 'w' });
|
|
157
|
-
}
|
|
158
|
-
function createExport(directory, relativePath, options) {
|
|
159
|
-
// remove directory prefix, file extension and directory ending '/'
|
|
160
|
-
const parentPrefix = directory.length;
|
|
161
|
-
const suffix = isFile(relativePath) ? path.extname(relativePath).length : 1;
|
|
162
|
-
const relativeName = relativePath.substring(parentPrefix, relativePath.length - suffix);
|
|
163
|
-
const exportName = options.style === 'esm' && isFile(relativePath) ? relativeName + '.js' : relativeName;
|
|
164
|
-
const exportLine = `export * from './${exportName}';`;
|
|
165
|
-
return exportLine;
|
|
166
|
-
}
|
|
167
|
-
function extractReusableContent(fileContent) {
|
|
168
|
-
var _a, _b;
|
|
169
|
-
// all code before any actual export lines are considered re-usable
|
|
170
|
-
return (_b = (_a = fileContent.match(/^(.*?)(?=^export)/ms)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '';
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=generate-index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-index.js","sourceRoot":"","sources":["../../src/commands/generate-index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2ClF,0CAMC;AAED,sCAqCC;AAED,sCAEC;AAED,kCAEC;AAED,wBAEC;AAED,4BAEC;AAED,0BAEC;AAED,4CAEC;AAED,kCAEC;AAED,gCAqBC;AAED,oCAQC;AAED,wDAGC;AAxJD,yCAAyC;AACzC,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,sDAAyB;AACzB,uDAAmD;AACnD,2CAAyD;AACzD,6DAA4D;AAqB/C,QAAA,aAAa,GAAG,IAAA,0BAAW,GAAE,CAAC,EAAE;KACxC,IAAI,CAAC,eAAe,CAAC;KACrB,WAAW,CAAC,mDAAmD,CAAC;KAChE,QAAQ,CAAC,cAAc,EAAE,4CAA4C,CAAC;KACtE,MAAM,CAAC,mBAAmB,EAAE,+FAA+F,EAAE,KAAK,CAAC;KACnI,MAAM,CAAC,sBAAsB,EAAE,wEAAwE,EAAE,KAAK,CAAC;KAC/G,MAAM,CAAC,iCAAiC,EAAE,2CAA2C,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;KAC/G,MAAM,CAAC,mCAAmC,EAAE,yCAAyC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;KACtI,SAAS,CAAC,IAAA,wBAAY,EAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACrH,MAAM,CAAC,2BAA2B,EAAE,kFAAkF,EAAE,cAAc,CAAC;KACvI,MAAM,CAAC,eAAe,EAAE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IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/D,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,YAAY,CAAC,SAAiB,EAAE,YAAoB,EAAE,OAAgC;IAClG,mEAAmE;IACnE,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACxF,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,KAAK,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC;IACzG,MAAM,UAAU,GAAG,oBAAoB,UAAU,IAAI,CAAC;IACtD,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,SAAgB,sBAAsB,CAAC,WAAmB;;IACtD,mEAAmE;IACnE,OAAO,MAAA,MAAA,WAAW,CAAC,KAAK,CAAC,qBAAqB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-2024 EclipseSource and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
export declare const VERDACCIO_REGISTRY = "http://localhost:4873/";
|
|
17
|
-
export interface ReleaseOptions {
|
|
18
|
-
component: Component;
|
|
19
|
-
releaseType: ReleaseType;
|
|
20
|
-
version: string;
|
|
21
|
-
checkoutDir: string;
|
|
22
|
-
branch: string;
|
|
23
|
-
verbose: boolean;
|
|
24
|
-
force: boolean;
|
|
25
|
-
publish: boolean;
|
|
26
|
-
npmDryRun: boolean;
|
|
27
|
-
draft: boolean;
|
|
28
|
-
}
|
|
29
|
-
export type ReleaseRepository = 'npm' | 'm2' | 'm2&p2' | 'p2';
|
|
30
|
-
export interface Component {
|
|
31
|
-
type: (typeof Component.CLI_CHOICES)[number];
|
|
32
|
-
releaseRepo: ReleaseRepository;
|
|
33
|
-
githubRepo: string;
|
|
34
|
-
directory: string;
|
|
35
|
-
}
|
|
36
|
-
export declare namespace Component {
|
|
37
|
-
const CLIENT: Component;
|
|
38
|
-
const THEIA_INTEGRATION: Component;
|
|
39
|
-
const VSCODE_INTEGRATION: Component;
|
|
40
|
-
const SERVER_NODE: Component;
|
|
41
|
-
const SERVER_JAVA: Component;
|
|
42
|
-
const ECLIPSE_INTEGRATION: Component;
|
|
43
|
-
const ALL: Component[];
|
|
44
|
-
const CLI_CHOICES: readonly ["client", "theia-integration", "vscode-integration", "eclipse-integration", "server-node", "server-java"];
|
|
45
|
-
function parse(cliChoice: string): Component;
|
|
46
|
-
function is(object: any): object is Component;
|
|
47
|
-
}
|
|
48
|
-
export declare namespace ReleaseType {
|
|
49
|
-
const CLI_CHOICES: readonly ["major", "minor", "patch", "rc", "custom"];
|
|
50
|
-
}
|
|
51
|
-
export type ReleaseType = (typeof ReleaseType.CLI_CHOICES)[number];
|
|
52
|
-
export declare function checkoutAndCd(options: ReleaseOptions): string;
|
|
53
|
-
export declare function commitAndTag(version: string, repositoryPath: string): string;
|
|
54
|
-
export declare function publish(repositoryPath: string, options: ReleaseOptions): void;
|
|
55
|
-
export declare function lernaSetVersion(repositoryPath: string, version: string): void;
|
|
56
|
-
export declare function yarnInstall(repositoryPath: string): void;
|
|
57
|
-
export declare function upgradeCommand(pckName: string, version: string): string;
|
|
58
|
-
export declare function updateVersion(...packages: {
|
|
59
|
-
name: string;
|
|
60
|
-
version: string;
|
|
61
|
-
}[]): void;
|
|
62
|
-
export declare function asMvnVersion(version: string): string;
|
|
63
|
-
export declare function checkIfNpmVersionIsNew(pckgName: string, newVersion: string): Promise<void>;
|
|
64
|
-
export declare function checkIfMavenVersionExists(groupId: string, artifactId: string, newVersion: string): void;
|
|
65
|
-
export declare function isExistingMavenVersion(groupId: string, artifactId: string, version: string): boolean;
|
|
66
|
-
export declare function checkJavaServerVersion(version: string, force?: boolean): void;
|
|
67
|
-
export declare function updateLernaForDryRun(): void;
|
|
68
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/commands/release/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAalF,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,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