@eclipse-glsp/cli 2.6.0-next.183 → 2.6.0-next.4
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 +22240 -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 -250
- package/lib/commands/check-header.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 -136
- 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 -182
- 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 -303
- 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 -201
- package/lib/commands/release/release.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 -156
- package/lib/commands/update-next.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/validation-util.d.ts +0 -5
- package/lib/util/validation-util.d.ts.map +0 -1
- package/lib/util/validation-util.js +0 -95
- 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,113 +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
|
-
|
|
17
|
-
import sh from 'shelljs';
|
|
18
|
-
import { fatalExec, getShellConfig } from '../../util/command-util';
|
|
19
|
-
import { LOGGER } from '../../util/logger';
|
|
20
|
-
import {
|
|
21
|
-
ReleaseOptions,
|
|
22
|
-
ReleaseType,
|
|
23
|
-
asMvnVersion,
|
|
24
|
-
checkJavaServerVersion,
|
|
25
|
-
checkoutAndCd,
|
|
26
|
-
commitAndTag,
|
|
27
|
-
lernaSetVersion,
|
|
28
|
-
publish,
|
|
29
|
-
updateLernaForDryRun,
|
|
30
|
-
updateVersion,
|
|
31
|
-
yarnInstall
|
|
32
|
-
} from './common.js';
|
|
33
|
-
|
|
34
|
-
let REPO_ROOT: string;
|
|
35
|
-
|
|
36
|
-
export async function releaseEclipseIntegration(options: ReleaseOptions): Promise<void> {
|
|
37
|
-
LOGGER.info('Prepare glsp-eclipse-integration release');
|
|
38
|
-
LOGGER.debug('Release options: ', options);
|
|
39
|
-
checkJavaServerVersion(options.version);
|
|
40
|
-
|
|
41
|
-
REPO_ROOT = checkoutAndCd(options);
|
|
42
|
-
prepareClient(options);
|
|
43
|
-
prepareServer(options);
|
|
44
|
-
generateChangeLog();
|
|
45
|
-
commitAndTag(asMvnVersion(options.version), REPO_ROOT);
|
|
46
|
-
publish(REPO_ROOT, options);
|
|
47
|
-
LOGGER.info('glsp-eclipse-integration release successful!');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function prepareClient(options: ReleaseOptions): void {
|
|
51
|
-
LOGGER.info('Prepare client');
|
|
52
|
-
updateExternalGLSPDependencies(options.version);
|
|
53
|
-
lernaSetVersion(`${REPO_ROOT}/client`, options.version);
|
|
54
|
-
buildClient();
|
|
55
|
-
if (options.npmDryRun) {
|
|
56
|
-
updateLernaForDryRun();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function updateExternalGLSPDependencies(version: string): void {
|
|
61
|
-
LOGGER.info('Update external GLSP dependencies (Client and workflow example)');
|
|
62
|
-
sh.cd(`${REPO_ROOT}/client`);
|
|
63
|
-
updateVersion({ name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version });
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function buildClient(): void {
|
|
67
|
-
LOGGER.info('[Client] Install & Build with yarn');
|
|
68
|
-
yarnInstall(`${REPO_ROOT}/client`);
|
|
69
|
-
LOGGER.debug('Build successful');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function generateChangeLog(): void {
|
|
73
|
-
// do nothing for now
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function prepareServer(options: ReleaseOptions): void {
|
|
77
|
-
const mvnVersion = asMvnVersion(options.version);
|
|
78
|
-
setServerVersion(mvnVersion);
|
|
79
|
-
updateTarget(mvnVersion, options.releaseType);
|
|
80
|
-
buildServer();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function setServerVersion(version: string): void {
|
|
84
|
-
LOGGER.info(`Set pom version to ${version}`);
|
|
85
|
-
sh.cd(`${REPO_ROOT}/server`);
|
|
86
|
-
// Execute tycho-versions plugin
|
|
87
|
-
fatalExec(`mvn tycho-versions:set-version -DnewVersion=${version}`, 'Mvn set-versions failed', getShellConfig({ silent: false }));
|
|
88
|
-
LOGGER.debug('Version update complete!');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function buildServer(): void {
|
|
92
|
-
sh.cd(`${REPO_ROOT}/server`);
|
|
93
|
-
LOGGER.info('Build Server(P2)');
|
|
94
|
-
fatalExec('mvn clean install', 'P2 build failed', getShellConfig({ silent: false }));
|
|
95
|
-
}
|
|
96
|
-
function updateTarget(mvnVersion: string, releaseType: ReleaseType): void {
|
|
97
|
-
const p2SubLocation = releaseType === 'rc' ? 'staging' : 'releases';
|
|
98
|
-
const p2Location = `https://download.eclipse.org/glsp/server/p2/${p2SubLocation}/${mvnVersion}/`;
|
|
99
|
-
LOGGER.info(`Update glsp server p2 repository to ${p2Location}`);
|
|
100
|
-
sh.cd(`${REPO_ROOT}/server/releng/org.eclipse.glsp.ide.releng.target`);
|
|
101
|
-
LOGGER.debug('Update r2021-03.tpd file');
|
|
102
|
-
sh.exec(
|
|
103
|
-
`sed -i 's_location "https://download.eclipse.org/glsp/server/p2/.*"_location "${p2Location}"_' r2021-03.tpd`,
|
|
104
|
-
getShellConfig()
|
|
105
|
-
);
|
|
106
|
-
LOGGER.debug('Update r2021-03.target file');
|
|
107
|
-
sh.exec(
|
|
108
|
-
// eslint-disable-next-line max-len
|
|
109
|
-
`sed -i 's_ <repository location="https://download.eclipse.org/glsp/server/p2/.*"_ <repository location="${p2Location}"_g' r2021-03.target`,
|
|
110
|
-
getShellConfig()
|
|
111
|
-
);
|
|
112
|
-
LOGGER.debug('Target update successful');
|
|
113
|
-
}
|
|
@@ -1,73 +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
|
-
import sh from 'shelljs';
|
|
17
|
-
import { fatalExec, getShellConfig } from '../../util/command-util';
|
|
18
|
-
import { LOGGER } from '../../util/logger';
|
|
19
|
-
import { ReleaseOptions, asMvnVersion, checkoutAndCd, commitAndTag, publish } from './common';
|
|
20
|
-
|
|
21
|
-
let REPO_ROOT: string;
|
|
22
|
-
|
|
23
|
-
export async function releaseJavaServer(options: ReleaseOptions): Promise<void> {
|
|
24
|
-
LOGGER.info('Prepare glsp-server release');
|
|
25
|
-
LOGGER.debug('Release options: ', options);
|
|
26
|
-
const mvnVersion = asMvnVersion(options.version);
|
|
27
|
-
REPO_ROOT = checkoutAndCd(options);
|
|
28
|
-
sh.find();
|
|
29
|
-
setVersion(mvnVersion);
|
|
30
|
-
build();
|
|
31
|
-
generateChangeLog();
|
|
32
|
-
commitAndTag(mvnVersion, REPO_ROOT);
|
|
33
|
-
publish(REPO_ROOT, options);
|
|
34
|
-
LOGGER.info('glsp-server release successful!');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function setVersion(version: string): void {
|
|
38
|
-
LOGGER.info(`Set pom version to ${version}`);
|
|
39
|
-
sh.cd(REPO_ROOT);
|
|
40
|
-
LOGGER.debug('Preprocessing eclipse-plugins poms');
|
|
41
|
-
// Capture all poms with a `${package.type}` property
|
|
42
|
-
|
|
43
|
-
const pluginPoms = sh
|
|
44
|
-
.exec('grep -ril --include pom.xml \\${package-type}', getShellConfig()) //
|
|
45
|
-
.stdout.trim()
|
|
46
|
-
.split('\n')
|
|
47
|
-
.map(file => `${REPO_ROOT}/${file}`);
|
|
48
|
-
|
|
49
|
-
// Replace `${package.type}` property with `eclipse-plugin`
|
|
50
|
-
sh.sed('-i', /\${package-type}/, 'eclipse-plugin', pluginPoms);
|
|
51
|
-
LOGGER.debug('Preprocessing complete');
|
|
52
|
-
|
|
53
|
-
// Execute tycho-versions plugin
|
|
54
|
-
fatalExec(`mvn tycho-versions:set-version -DnewVersion=${version}`, 'Mvn set-versions failed', getShellConfig({ silent: false }));
|
|
55
|
-
|
|
56
|
-
LOGGER.debug('Restore eclipse-plugin poms');
|
|
57
|
-
sh.sed('-i', /<packaging>eclipse-plugin/, '<packaging>${package-type}', pluginPoms);
|
|
58
|
-
|
|
59
|
-
LOGGER.debug('Version update complete!');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function generateChangeLog(): void {
|
|
63
|
-
// do nothing for now
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function build(): void {
|
|
67
|
-
LOGGER.info('Build M2 & P2');
|
|
68
|
-
LOGGER.debug('M2');
|
|
69
|
-
fatalExec('mvn clean install -Pm2', 'M2 build failed', getShellConfig({ silent: false }));
|
|
70
|
-
LOGGER.newLine();
|
|
71
|
-
LOGGER.debug('P2');
|
|
72
|
-
fatalExec('mvn clean install -Pp2', 'P2 build failed', getShellConfig({ silent: false }));
|
|
73
|
-
}
|
|
@@ -1,61 +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
|
-
|
|
17
|
-
import sh from 'shelljs';
|
|
18
|
-
import { LOGGER } from '../../util/logger';
|
|
19
|
-
import {
|
|
20
|
-
checkoutAndCd,
|
|
21
|
-
commitAndTag,
|
|
22
|
-
lernaSetVersion,
|
|
23
|
-
publish,
|
|
24
|
-
ReleaseOptions,
|
|
25
|
-
updateLernaForDryRun,
|
|
26
|
-
updateVersion,
|
|
27
|
-
yarnInstall
|
|
28
|
-
} from './common.js';
|
|
29
|
-
|
|
30
|
-
let REPO_ROOT: string;
|
|
31
|
-
|
|
32
|
-
export async function releaseServerNode(options: ReleaseOptions): Promise<void> {
|
|
33
|
-
LOGGER.info('Prepare glsp-server-node release');
|
|
34
|
-
LOGGER.debug('Release options: ', options);
|
|
35
|
-
REPO_ROOT = checkoutAndCd(options);
|
|
36
|
-
updateExternalGLSPDependencies(options.version);
|
|
37
|
-
generateChangeLog();
|
|
38
|
-
lernaSetVersion(REPO_ROOT, options.version);
|
|
39
|
-
build();
|
|
40
|
-
if (options.npmDryRun) {
|
|
41
|
-
updateLernaForDryRun();
|
|
42
|
-
}
|
|
43
|
-
commitAndTag(options.version, REPO_ROOT);
|
|
44
|
-
publish(REPO_ROOT, options);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function updateExternalGLSPDependencies(version: string): void {
|
|
48
|
-
LOGGER.info('Update external GLSP dependencies (Protocol)');
|
|
49
|
-
sh.cd(REPO_ROOT);
|
|
50
|
-
updateVersion({ name: '@eclipse-glsp/protocol', version });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function build(): void {
|
|
54
|
-
LOGGER.info('Install & Build with yarn');
|
|
55
|
-
yarnInstall(REPO_ROOT);
|
|
56
|
-
LOGGER.debug('Build successful');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function generateChangeLog(): void {
|
|
60
|
-
// do nothing for now
|
|
61
|
-
}
|
|
@@ -1,65 +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
|
-
|
|
17
|
-
import sh from 'shelljs';
|
|
18
|
-
import { LOGGER } from '../../util/logger';
|
|
19
|
-
import {
|
|
20
|
-
checkoutAndCd,
|
|
21
|
-
commitAndTag,
|
|
22
|
-
lernaSetVersion,
|
|
23
|
-
publish,
|
|
24
|
-
ReleaseOptions,
|
|
25
|
-
updateLernaForDryRun,
|
|
26
|
-
updateVersion,
|
|
27
|
-
yarnInstall
|
|
28
|
-
} from './common.js';
|
|
29
|
-
|
|
30
|
-
let REPO_ROOT: string;
|
|
31
|
-
|
|
32
|
-
export async function releaseTheiaIntegration(options: ReleaseOptions): Promise<void> {
|
|
33
|
-
LOGGER.info('Prepare glsp-theia-integration release');
|
|
34
|
-
LOGGER.debug('Release options: ', options);
|
|
35
|
-
REPO_ROOT = checkoutAndCd(options);
|
|
36
|
-
updateExternalGLSPDependencies(options.version);
|
|
37
|
-
generateChangeLog();
|
|
38
|
-
lernaSetVersion(REPO_ROOT, options.version);
|
|
39
|
-
build();
|
|
40
|
-
if (options.npmDryRun) {
|
|
41
|
-
updateLernaForDryRun();
|
|
42
|
-
}
|
|
43
|
-
commitAndTag(options.version, REPO_ROOT);
|
|
44
|
-
publish(REPO_ROOT, options);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function updateExternalGLSPDependencies(version: string): void {
|
|
48
|
-
LOGGER.info('Update external GLSP dependencies (Client and workflow example & server)');
|
|
49
|
-
sh.cd(REPO_ROOT);
|
|
50
|
-
updateVersion(
|
|
51
|
-
{ name: '@eclipse-glsp/client', version },
|
|
52
|
-
{ name: '@eclipse-glsp-examples/workflow-glsp', version },
|
|
53
|
-
{ name: '@eclipse-glsp-examples/workflow-server', version }
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function build(): void {
|
|
58
|
-
LOGGER.info('Install & Build with yarn');
|
|
59
|
-
yarnInstall(REPO_ROOT);
|
|
60
|
-
LOGGER.debug('Build successful');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function generateChangeLog(): void {
|
|
64
|
-
// do nothing for now
|
|
65
|
-
}
|
|
@@ -1,67 +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
|
-
|
|
17
|
-
import sh from 'shelljs';
|
|
18
|
-
import { LOGGER } from '../../util/logger';
|
|
19
|
-
import {
|
|
20
|
-
checkoutAndCd,
|
|
21
|
-
commitAndTag,
|
|
22
|
-
lernaSetVersion,
|
|
23
|
-
publish,
|
|
24
|
-
ReleaseOptions,
|
|
25
|
-
updateLernaForDryRun,
|
|
26
|
-
updateVersion,
|
|
27
|
-
yarnInstall
|
|
28
|
-
} from './common.js';
|
|
29
|
-
|
|
30
|
-
let REPO_ROOT: string;
|
|
31
|
-
|
|
32
|
-
export async function releaseVscodeIntegration(options: ReleaseOptions): Promise<void> {
|
|
33
|
-
LOGGER.info('Prepare glsp-vscode-integration release');
|
|
34
|
-
LOGGER.debug('Release options: ', options);
|
|
35
|
-
REPO_ROOT = checkoutAndCd(options);
|
|
36
|
-
updateExternalGLSPDependencies(options.version);
|
|
37
|
-
generateChangeLog();
|
|
38
|
-
lernaSetVersion(REPO_ROOT, options.version);
|
|
39
|
-
build();
|
|
40
|
-
if (options.npmDryRun) {
|
|
41
|
-
updateLernaForDryRun();
|
|
42
|
-
}
|
|
43
|
-
commitAndTag(options.version, REPO_ROOT);
|
|
44
|
-
publish(REPO_ROOT, options);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function updateExternalGLSPDependencies(version: string): void {
|
|
48
|
-
LOGGER.info('Update external GLSP dependencies (Protocol)');
|
|
49
|
-
sh.cd(REPO_ROOT);
|
|
50
|
-
updateVersion(
|
|
51
|
-
{ name: '@eclipse-glsp/protocol', version },
|
|
52
|
-
{ name: '@eclipse-glsp/client', version },
|
|
53
|
-
{ name: '@eclipse-glsp-examples/workflow-glsp', version },
|
|
54
|
-
{ name: '@eclipse-glsp-examples/workflow-server', version },
|
|
55
|
-
{ name: '@eclipse-glsp-examples/workflow-server-bundled', version }
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function build(): void {
|
|
60
|
-
LOGGER.info('Install & Build with yarn');
|
|
61
|
-
yarnInstall(REPO_ROOT);
|
|
62
|
-
LOGGER.debug('Build successful');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function generateChangeLog(): void {
|
|
66
|
-
// do nothing for now
|
|
67
|
-
}
|
|
@@ -1,215 +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
|
-
import { ChildProcess } from 'child_process';
|
|
17
|
-
import { Argument } from 'commander';
|
|
18
|
-
import { exit } from 'process';
|
|
19
|
-
import { createInterface } from 'readline';
|
|
20
|
-
import * as readline from 'readline-sync';
|
|
21
|
-
import * as semver from 'semver';
|
|
22
|
-
import sh from 'shelljs';
|
|
23
|
-
import { baseCommand, configureShell, fatalExec, getShellConfig } from '../../util/command-util';
|
|
24
|
-
import { LOGGER, configureLogger } from '../../util/logger';
|
|
25
|
-
import { validateDirectory, validateVersion } from '../../util/validation-util';
|
|
26
|
-
import {
|
|
27
|
-
Component,
|
|
28
|
-
ReleaseOptions,
|
|
29
|
-
ReleaseType,
|
|
30
|
-
VERDACCIO_REGISTRY,
|
|
31
|
-
asMvnVersion,
|
|
32
|
-
checkIfMavenVersionExists,
|
|
33
|
-
checkIfNpmVersionIsNew
|
|
34
|
-
} from './common.js';
|
|
35
|
-
import { releaseClient } from './release-client';
|
|
36
|
-
import { releaseEclipseIntegration } from './release-eclipse-integration';
|
|
37
|
-
import { releaseJavaServer } from './release-java-server';
|
|
38
|
-
import { releaseServerNode } from './release-server-node';
|
|
39
|
-
import { releaseTheiaIntegration } from './release-theia-integration';
|
|
40
|
-
import { releaseVscodeIntegration } from './release-vscode-integration';
|
|
41
|
-
|
|
42
|
-
interface ReleaseCmdOptions {
|
|
43
|
-
checkoutDir: string;
|
|
44
|
-
branch: string;
|
|
45
|
-
force: boolean;
|
|
46
|
-
publish: boolean;
|
|
47
|
-
npmDryRun: boolean;
|
|
48
|
-
draft: boolean;
|
|
49
|
-
verbose: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const ReleaseCommand = baseCommand()
|
|
53
|
-
.name('release')
|
|
54
|
-
.description('Prepare & publish a new release for a glsp component')
|
|
55
|
-
.addArgument(new Argument('<component>', 'The glsp component to be released').choices(Component.CLI_CHOICES).argParser(Component.parse))
|
|
56
|
-
.addArgument(new Argument('<releaseType>', 'The release type').choices(ReleaseType.CLI_CHOICES))
|
|
57
|
-
.argument('[customVersion]', 'Custom version number. Will be ignored if the release type is not "custom"', validateVersion)
|
|
58
|
-
.option('-f, --force', 'Enable force mode', false)
|
|
59
|
-
.option('-d, --checkoutDir <checkoutDir>', 'The git checkout directory', validateDirectory, process.cwd())
|
|
60
|
-
.option('-b, --branch <branch>', 'The git branch to checkout', 'master')
|
|
61
|
-
.option('-v, --verbose', 'Enable verbose (debug) log output', false)
|
|
62
|
-
.option('--no-publish', 'Only prepare release but do not publish to github', true)
|
|
63
|
-
.option('--draft', 'Publish github releases as drafts', false)
|
|
64
|
-
.option(
|
|
65
|
-
'--npm-dryRun',
|
|
66
|
-
'Execute a npm dry-run for inspection. Publishes to the local npm registry and does not publish to github',
|
|
67
|
-
false
|
|
68
|
-
)
|
|
69
|
-
.action(release);
|
|
70
|
-
|
|
71
|
-
let verdaccioChildProcess: ChildProcess | undefined = undefined;
|
|
72
|
-
|
|
73
|
-
export async function release(
|
|
74
|
-
component: Component,
|
|
75
|
-
releaseType: ReleaseType,
|
|
76
|
-
customVersion: string | undefined,
|
|
77
|
-
cliOptions: ReleaseCmdOptions
|
|
78
|
-
): Promise<void> {
|
|
79
|
-
try {
|
|
80
|
-
configureLogger(cliOptions.verbose);
|
|
81
|
-
LOGGER.debug('Cli options:', cliOptions);
|
|
82
|
-
configureShell({ silent: !cliOptions.verbose });
|
|
83
|
-
checkGHCli();
|
|
84
|
-
const version = deriveVersion(releaseType, customVersion);
|
|
85
|
-
const options: ReleaseOptions = { ...cliOptions, component, releaseType, version };
|
|
86
|
-
if (cliOptions.npmDryRun && options.component.releaseRepo === 'npm') {
|
|
87
|
-
await launchVerdaccio().catch(error => LOGGER.error('Error occurred during verdaccio launch', error));
|
|
88
|
-
}
|
|
89
|
-
switch (component.type) {
|
|
90
|
-
case 'server-java':
|
|
91
|
-
checkIfMavenVersionExists('org.eclipse.glsp', 'org.eclipse.glsp.server', asMvnVersion(version));
|
|
92
|
-
return releaseJavaServer(options);
|
|
93
|
-
case 'server-node':
|
|
94
|
-
await checkIfNpmVersionIsNew('@eclipse-glsp/server-node', version);
|
|
95
|
-
return releaseServerNode(options);
|
|
96
|
-
case 'client':
|
|
97
|
-
await checkIfNpmVersionIsNew('@eclipse-glsp/client', version);
|
|
98
|
-
return releaseClient(options);
|
|
99
|
-
case 'theia-integration':
|
|
100
|
-
await checkIfNpmVersionIsNew('@eclipse-glsp/theia-integration', version);
|
|
101
|
-
return releaseTheiaIntegration(options);
|
|
102
|
-
case 'vscode-integration':
|
|
103
|
-
await checkIfNpmVersionIsNew('@eclipse-glsp/vscode-integration', version);
|
|
104
|
-
return releaseVscodeIntegration(options);
|
|
105
|
-
case 'eclipse-integration':
|
|
106
|
-
await checkIfNpmVersionIsNew('@eclipse-glsp/ide', version);
|
|
107
|
-
return releaseEclipseIntegration(options);
|
|
108
|
-
}
|
|
109
|
-
} catch (err) {
|
|
110
|
-
console.error('An error occurred during command execution:', err);
|
|
111
|
-
exit(1);
|
|
112
|
-
} finally {
|
|
113
|
-
if (verdaccioChildProcess) {
|
|
114
|
-
verdaccioChildProcess.kill();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function checkGHCli(): void {
|
|
120
|
-
LOGGER.debug('Verify that Github CLI is configured correctly');
|
|
121
|
-
if (!isGithubCLIAuthenticated()) {
|
|
122
|
-
throw new Error("Github CLI is not configured properly. No user is logged in for host 'github.com'");
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function isGithubCLIAuthenticated(): boolean {
|
|
127
|
-
LOGGER.debug('Verify that Github CLI is installed');
|
|
128
|
-
fatalExec('which gh', 'Github CLI is not installed!');
|
|
129
|
-
|
|
130
|
-
const status = sh.exec('gh auth status', getShellConfig());
|
|
131
|
-
if (status.code !== 0) {
|
|
132
|
-
if (status.stderr.includes('You are not logged into any GitHub hosts')) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
throw new Error(status.stderr);
|
|
136
|
-
}
|
|
137
|
-
if (!status.stdout.trim().includes('Logged in to github.com')) {
|
|
138
|
-
LOGGER.debug("No user is logged in for host 'github.com'");
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
LOGGER.debug('Github CLI is authenticated and ready to use');
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function launchVerdaccio(): Promise<void> {
|
|
146
|
-
LOGGER.debug('Verify that verdaccio is installed and start if necessary');
|
|
147
|
-
fatalExec('which verdaccio', 'Verdaccio is not installed!');
|
|
148
|
-
// Check if verdaccio is alreaddy running
|
|
149
|
-
const result = sh.exec(`curl -i ${VERDACCIO_REGISTRY}`, getShellConfig());
|
|
150
|
-
if (result.code !== 0) {
|
|
151
|
-
LOGGER.info('Starting local verdaccio registry');
|
|
152
|
-
verdaccioChildProcess = sh.exec('verdaccio', { async: true, silent: true });
|
|
153
|
-
return new Promise(resolve => {
|
|
154
|
-
createInterface(verdaccioChildProcess!.stdout!).on('line', line => {
|
|
155
|
-
if (line.includes(`http address - ${VERDACCIO_REGISTRY}`)) {
|
|
156
|
-
resolve();
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return Promise.resolve();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function deriveVersion(releaseType: ReleaseType, customVersion?: string): string {
|
|
165
|
-
LOGGER.debug(`Derive version from release type: ${release}`);
|
|
166
|
-
switch (releaseType) {
|
|
167
|
-
case 'custom':
|
|
168
|
-
return getCustomVersion(customVersion);
|
|
169
|
-
case 'rc':
|
|
170
|
-
return getRCVersion();
|
|
171
|
-
case 'patch':
|
|
172
|
-
case 'major':
|
|
173
|
-
case 'minor':
|
|
174
|
-
return semverInc(releaseType);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const REFERENCE_NPM_PACKAGE = '@eclipse-glsp/ide';
|
|
179
|
-
|
|
180
|
-
function getRCVersion(): string {
|
|
181
|
-
LOGGER.debug('Retrieve and new RC version');
|
|
182
|
-
const newBaseVersion = semverInc('minor');
|
|
183
|
-
const currentRcVersion = sh.exec(`npm view ${REFERENCE_NPM_PACKAGE} dist-tags.rc`, getShellConfig()).stdout.trim();
|
|
184
|
-
const currentRcBaseVersion = currentRcVersion.split('-')[0];
|
|
185
|
-
if (currentRcBaseVersion !== newBaseVersion) {
|
|
186
|
-
return `${newBaseVersion}-RC01`;
|
|
187
|
-
}
|
|
188
|
-
let rcNumber = Number.parseInt(currentRcVersion.replace(`${currentRcBaseVersion}-RC`, ''), 10);
|
|
189
|
-
rcNumber++;
|
|
190
|
-
|
|
191
|
-
return `${newBaseVersion}-RC` + `${rcNumber}`.padStart(2, '0');
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function getCustomVersion(customVersion?: string): string {
|
|
195
|
-
LOGGER.debug('Retrieve and validate custom version');
|
|
196
|
-
LOGGER.debug(customVersion ? `Custom version has been passed as argument: ${customVersion}` : 'Prompt custom version from user');
|
|
197
|
-
const version = customVersion ?? readline.question('> Please enter the new version');
|
|
198
|
-
return validateVersion(version);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function getCurrentVersion(): string {
|
|
202
|
-
LOGGER.debug('Retrieve base version by querying the latest tag of the reference npm package');
|
|
203
|
-
const version = sh.exec(`npm view ${REFERENCE_NPM_PACKAGE} dist-tags.latest`, getShellConfig()).stdout.trim();
|
|
204
|
-
return validateVersion(version);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function semverInc(releaseType: semver.ReleaseType, identifier?: string): string {
|
|
208
|
-
const currentVersion = getCurrentVersion();
|
|
209
|
-
LOGGER.debug(`Execute: semver.inc("${currentVersion}", ${releaseType}, ${identifier})`);
|
|
210
|
-
const newVersion = semver.inc(currentVersion, releaseType, identifier);
|
|
211
|
-
if (!newVersion) {
|
|
212
|
-
throw new Error(`Could not increment version: ${currentVersion} `);
|
|
213
|
-
}
|
|
214
|
-
return newVersion;
|
|
215
|
-
}
|