@eclipse-glsp/cli 1.1.0-next.4c65907.114

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.
Files changed (69) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +45 -0
  3. package/bin/glsp +2 -0
  4. package/lib/app.d.ts +19 -0
  5. package/lib/app.d.ts.map +1 -0
  6. package/lib/app.js +46 -0
  7. package/lib/app.js.map +1 -0
  8. package/lib/release/common.d.ts +69 -0
  9. package/lib/release/common.d.ts.map +1 -0
  10. package/lib/release/common.js +273 -0
  11. package/lib/release/common.js.map +1 -0
  12. package/lib/release/release-client.d.ts +3 -0
  13. package/lib/release/release-client.d.ts.map +1 -0
  14. package/lib/release/release-client.js +53 -0
  15. package/lib/release/release-client.js.map +1 -0
  16. package/lib/release/release-eclipse-integration.d.ts +18 -0
  17. package/lib/release/release-eclipse-integration.d.ts.map +1 -0
  18. package/lib/release/release-eclipse-integration.js +90 -0
  19. package/lib/release/release-eclipse-integration.js.map +1 -0
  20. package/lib/release/release-java-server.d.ts +3 -0
  21. package/lib/release/release-java-server.d.ts.map +1 -0
  22. package/lib/release/release-java-server.js +67 -0
  23. package/lib/release/release-java-server.js.map +1 -0
  24. package/lib/release/release-server-node.d.ts +18 -0
  25. package/lib/release/release-server-node.d.ts.map +1 -0
  26. package/lib/release/release-server-node.js +51 -0
  27. package/lib/release/release-server-node.js.map +1 -0
  28. package/lib/release/release-theia-integration.d.ts +18 -0
  29. package/lib/release/release-theia-integration.d.ts.map +1 -0
  30. package/lib/release/release-theia-integration.js +62 -0
  31. package/lib/release/release-theia-integration.js.map +1 -0
  32. package/lib/release/release-vscode-integration.d.ts +18 -0
  33. package/lib/release/release-vscode-integration.d.ts.map +1 -0
  34. package/lib/release/release-vscode-integration.js +51 -0
  35. package/lib/release/release-vscode-integration.js.map +1 -0
  36. package/lib/release/release.d.ts +13 -0
  37. package/lib/release/release.d.ts.map +1 -0
  38. package/lib/release/release.js +133 -0
  39. package/lib/release/release.js.map +1 -0
  40. package/lib/util/command-util.d.ts +31 -0
  41. package/lib/util/command-util.d.ts.map +1 -0
  42. package/lib/util/command-util.js +38 -0
  43. package/lib/util/command-util.js.map +1 -0
  44. package/lib/util/git-util.d.ts +23 -0
  45. package/lib/util/git-util.d.ts.map +1 -0
  46. package/lib/util/git-util.js +87 -0
  47. package/lib/util/git-util.js.map +1 -0
  48. package/lib/util/logger.d.ts +9 -0
  49. package/lib/util/logger.d.ts.map +1 -0
  50. package/lib/util/logger.js +34 -0
  51. package/lib/util/logger.js.map +1 -0
  52. package/lib/util/validation-util.d.ts +5 -0
  53. package/lib/util/validation-util.d.ts.map +1 -0
  54. package/lib/util/validation-util.js +53 -0
  55. package/lib/util/validation-util.js.map +1 -0
  56. package/package.json +65 -0
  57. package/src/app.ts +49 -0
  58. package/src/release/common.ts +312 -0
  59. package/src/release/release-client.ts +64 -0
  60. package/src/release/release-eclipse-integration.ts +113 -0
  61. package/src/release/release-java-server.ts +72 -0
  62. package/src/release/release-server-node.ts +61 -0
  63. package/src/release/release-theia-integration.ts +77 -0
  64. package/src/release/release-vscode-integration.ts +65 -0
  65. package/src/release/release.ts +174 -0
  66. package/src/util/command-util.ts +63 -0
  67. package/src/util/git-util.ts +87 -0
  68. package/src/util/logger.ts +38 -0
  69. package/src/util/validation-util.ts +50 -0
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Eclipse GLSP - CLI
2
+
3
+ The `@eclipse-glsp/cli` package provides helpful scripts and commands for extension and application development.
4
+ The contributed `glsp`, is a command line tool that offers all contributed commands.
5
+
6
+ ## Getting Started
7
+
8
+ Install `@eclipse-glsp/cli` as a dev dependency in your application.
9
+
10
+ ```bash
11
+ yarn add @eclipse-glsp/cli --dev
12
+ ```
13
+
14
+ ## Commands
15
+
16
+ Eclipse GLSP committers can use the `release` following command to prepare & publish a new Github release
17
+ for a specific GLSP component.
18
+
19
+ ```bash
20
+ $ glsp release -h
21
+ Usage: glsp release [options] <component> <releaseType> [customVersion]
22
+
23
+ Prepare & publish a new release for a glsp component
24
+
25
+ Arguments:
26
+ component The glsp component to be released (choices: "client", "theia-integration", "vscode-integration", "eclipse-integration", "server-node", "server-java")
27
+ releaseType The release type (choices: "major", "minor", "patch", "rc", "custom")
28
+ customVersion Custom version number. Will be ignored if the release type is not "custom"
29
+
30
+ Options:
31
+ -V, --version output the version number
32
+ -f, --force Enable force mode (default: false)
33
+ -d, --checkoutDir <checkoutDir> The git checkout directory (default: "/home/tobias/Git/OpenSource/glsp/glsp/dev-packages/cli")
34
+ -b, --branch <branch> The git branch to checkout (default: "master")
35
+ -v, --verbose Enable verbose (debug) log output (default: false)
36
+ --no-publish Only prepare release but do not publish to github
37
+ --draft Publish github releases as drafts (default: false)
38
+ --npm-dryRun Execute a npm dry-run for inspection. Publishes to the local npm registry and does not publish to github (default: false)
39
+ -h, --help display help for command
40
+ ```
41
+
42
+ ## More information
43
+
44
+ For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/).
45
+ If you have questions, please raise them in the [discussions](https://github.com/eclipse-glsp/glsp/discussions) and have a look at our [communication and support options](https://www.eclipse.org/glsp/contact/).
package/bin/glsp ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../lib/app.js');
package/lib/app.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ /********************************************************************************
3
+ * Copyright (c) 2022 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
+ import { Command } from 'commander';
18
+ export declare const ReleaseCommand: Command;
19
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAY,OAAO,EAAE,MAAM,WAAW,CAAC;AAO9C,eAAO,MAAM,cAAc,SAiBP,CAAC"}
package/lib/app.js ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ReleaseCommand = void 0;
5
+ /********************************************************************************
6
+ * Copyright (c) 2022 EclipseSource and others.
7
+ *
8
+ * This program and the accompanying materials are made available under the
9
+ * terms of the Eclipse Public License v. 2.0 which is available at
10
+ * http://www.eclipse.org/legal/epl-2.0.
11
+ *
12
+ * This Source Code may also be made available under the following Secondary
13
+ * Licenses when the conditions for such availability set forth in the Eclipse
14
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
15
+ * with the GNU Classpath Exception which is available at
16
+ * https://www.gnu.org/software/classpath/license.html.
17
+ *
18
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
19
+ ********************************************************************************/
20
+ const commander_1 = require("commander");
21
+ const sh = require("shelljs");
22
+ const common_1 = require("./release/common");
23
+ const release_1 = require("./release/release");
24
+ const command_util_1 = require("./util/command-util");
25
+ const validation_util_1 = require("./util/validation-util");
26
+ exports.ReleaseCommand = (0, command_util_1.baseConfiguration)(new commander_1.Command())
27
+ .name('release')
28
+ .description('Prepare & publish a new release for a glsp component')
29
+ .addArgument(new commander_1.Argument('<component>', 'The glsp component to be released').choices(common_1.Component.CLI_CHOICES).argParser(common_1.Component.parse))
30
+ .addArgument(new commander_1.Argument('<releaseType>', 'The release type').choices(common_1.ReleaseType.CLI_CHOICES))
31
+ .argument('[customVersion]', 'Custom version number. Will be ignored if the release type is not "custom"', validation_util_1.validateVersion)
32
+ .option('-f, --force', 'Enable force mode', false)
33
+ .option('-d, --checkoutDir <checkoutDir>', 'The git checkout directory', validation_util_1.validateDirectory, sh.pwd().stdout)
34
+ .option('-b, --branch <branch>', 'The git branch to checkout', 'master')
35
+ .option('-v, --verbose', 'Enable verbose (debug) log output', false)
36
+ .option('--no-publish', 'Only prepare release but do not publish to github', true)
37
+ .option('--draft', 'Publish github releases as drafts', false)
38
+ .option('--npm-dryRun', 'Execute a npm dry-run for inspection. Publishes to the local npm registry and does not publish to github', false)
39
+ .action(release_1.release);
40
+ const app = (0, command_util_1.baseConfiguration)(new commander_1.Command())
41
+ .showSuggestionAfterError(true)
42
+ .showHelpAfterError(true)
43
+ .name('glsp')
44
+ .addCommand(exports.ReleaseCommand);
45
+ app.parse(process.argv);
46
+ //# sourceMappingURL=app.js.map
package/lib/app.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;AACA;;;;;;;;;;;;;;kFAckF;AAClF,yCAA8C;AAC9C,8BAA8B;AAC9B,6CAA0D;AAC1D,+CAA4C;AAC5C,sDAAwD;AACxD,4DAA4E;AAE/D,QAAA,cAAc,GAAG,IAAA,gCAAiB,EAAC,IAAI,mBAAO,EAAE,CAAC;KACzD,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,sDAAsD,CAAC;KACnE,WAAW,CAAC,IAAI,oBAAQ,CAAC,aAAa,EAAE,mCAAmC,CAAC,CAAC,OAAO,CAAC,kBAAS,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,kBAAS,CAAC,KAAK,CAAC,CAAC;KACvI,WAAW,CAAC,IAAI,oBAAQ,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,OAAO,CAAC,oBAAW,CAAC,WAAW,CAAC,CAAC;KAC/F,QAAQ,CAAC,iBAAiB,EAAE,4EAA4E,EAAE,iCAAe,CAAC;KAC1H,MAAM,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,CAAC;KACjD,MAAM,CAAC,iCAAiC,EAAE,4BAA4B,EAAE,mCAAiB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAC3G,MAAM,CAAC,uBAAuB,EAAE,4BAA4B,EAAE,QAAQ,CAAC;KACvE,MAAM,CAAC,eAAe,EAAE,mCAAmC,EAAE,KAAK,CAAC;KACnE,MAAM,CAAC,cAAc,EAAE,mDAAmD,EAAE,IAAI,CAAC;KACjF,MAAM,CAAC,SAAS,EAAE,mCAAmC,EAAE,KAAK,CAAC;KAC7D,MAAM,CACH,cAAc,EACd,0GAA0G,EAC1G,KAAK,CACR;KACA,MAAM,CAAC,iBAAO,CAAC,CAAC;AAErB,MAAM,GAAG,GAAG,IAAA,gCAAiB,EAAC,IAAI,mBAAO,EAAE,CAAC;KACvC,wBAAwB,CAAC,IAAI,CAAC;KAC9B,kBAAkB,CAAC,IAAI,CAAC;KACxB,IAAI,CAAC,MAAM,CAAC;KACZ,UAAU,CAAC,sBAAc,CAAC,CAAC;AAEhC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,69 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 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 updateServerConfig(configFile: string, version: string, isSnapShot: boolean): void;
63
+ export declare function asMvnVersion(version: string): string;
64
+ export declare function checkIfNpmVersionExists(pckgName: string, newVersion: string): Promise<void>;
65
+ export declare function checkIfMavenVersionExists(groupId: string, artifactId: string, newVersion: string): void;
66
+ export declare function isExistingMavenVersion(groupId: string, artifactId: string, version: string): boolean;
67
+ export declare function checkJavaServerVersion(version: string, force?: boolean): void;
68
+ export declare function updateLernaForDryRun(): void;
69
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/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,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC;AAE9D,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,OAAO,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C,WAAW,EAAE,iBAAiB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACrB;AACD,yBAAiB,SAAS,CAAC;IAChB,MAAM,MAAM,EAAE,SAKpB,CAAC;IACK,MAAM,iBAAiB,EAAE,SAK/B,CAAC;IACK,MAAM,kBAAkB,EAAE,SAKhC,CAAC;IACK,MAAM,WAAW,EAAE,SAKzB,CAAC;IACK,MAAM,WAAW,EAAE,SAKzB,CAAC;IACK,MAAM,mBAAmB,EAAE,SAKjC,CAAC;IAEK,MAAM,GAAG,EAAE,SAAS,EAAmG,CAAC;IACxH,MAAM,WAAW,qHAOd,CAAC;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,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAMvG;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAYpG;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAW3E;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
@@ -0,0 +1,273 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2022 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
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.updateLernaForDryRun = exports.checkJavaServerVersion = exports.isExistingMavenVersion = exports.checkIfMavenVersionExists = exports.checkIfNpmVersionExists = exports.asMvnVersion = exports.updateServerConfig = exports.updateVersion = exports.upgradeCommand = exports.yarnInstall = exports.lernaSetVersion = exports.publish = exports.commitAndTag = exports.checkoutAndCd = exports.ReleaseType = exports.Component = exports.VERDACCIO_REGISTRY = void 0;
19
+ const fs = require("fs");
20
+ const node_fetch_1 = require("node-fetch");
21
+ const path_1 = require("path");
22
+ const readline = require("readline-sync");
23
+ const semver = require("semver");
24
+ const sh = require("shelljs");
25
+ const command_util_1 = require("../util/command-util");
26
+ const git_util_1 = require("../util/git-util");
27
+ const logger_1 = require("../util/logger");
28
+ const validation_util_1 = require("../util/validation-util");
29
+ exports.VERDACCIO_REGISTRY = 'http://localhost:4873/';
30
+ var Component;
31
+ (function (Component) {
32
+ Component.CLIENT = {
33
+ type: 'client',
34
+ githubRepo: 'eclipse-glsp/glsp-client',
35
+ releaseRepo: 'npm',
36
+ directory: 'glsp-client'
37
+ };
38
+ Component.THEIA_INTEGRATION = {
39
+ type: 'theia-integration',
40
+ githubRepo: 'eclipse-glsp/glsp-theia-integration',
41
+ releaseRepo: 'npm',
42
+ directory: 'glsp-theia-integration'
43
+ };
44
+ Component.VSCODE_INTEGRATION = {
45
+ type: 'vscode-integration',
46
+ githubRepo: 'eclipse-glsp/glsp-vscode-integration',
47
+ releaseRepo: 'npm',
48
+ directory: 'glsp-vscode-integration'
49
+ };
50
+ Component.SERVER_NODE = {
51
+ type: 'server-node',
52
+ githubRepo: 'eclipse-glsp/glsp-server-node',
53
+ releaseRepo: 'npm',
54
+ directory: 'serer-node'
55
+ };
56
+ Component.SERVER_JAVA = {
57
+ type: 'server-java',
58
+ githubRepo: 'eclipse-glsp/glsp-server',
59
+ releaseRepo: 'm2&p2',
60
+ directory: 'glsp-server'
61
+ };
62
+ Component.ECLIPSE_INTEGRATION = {
63
+ type: 'eclipse-integration',
64
+ githubRepo: 'eclipse-glsp/glsp-eclipse-integration',
65
+ releaseRepo: 'm2',
66
+ directory: 'glsp-eclipse-integration'
67
+ };
68
+ Component.ALL = [Component.CLIENT, Component.THEIA_INTEGRATION, Component.VSCODE_INTEGRATION, Component.ECLIPSE_INTEGRATION, Component.SERVER_JAVA, Component.SERVER_NODE];
69
+ Component.CLI_CHOICES = [
70
+ 'client',
71
+ 'theia-integration',
72
+ 'vscode-integration',
73
+ 'eclipse-integration',
74
+ 'server-node',
75
+ 'server-java'
76
+ ];
77
+ function parse(cliChoice) {
78
+ const key = cliChoice.toUpperCase().replace('-', '_');
79
+ const component = Component[key];
80
+ if (!component) {
81
+ throw new Error(`Could not parse component for type: ${cliChoice}`);
82
+ }
83
+ return component;
84
+ }
85
+ Component.parse = parse;
86
+ function is(object) {
87
+ return typeof object === 'object' && typeof object.type === 'string';
88
+ }
89
+ Component.is = is;
90
+ })(Component = exports.Component || (exports.Component = {}));
91
+ var ReleaseType;
92
+ (function (ReleaseType) {
93
+ ReleaseType.CLI_CHOICES = ['major', 'minor', 'patch', 'rc', 'custom'];
94
+ })(ReleaseType = exports.ReleaseType || (exports.ReleaseType = {}));
95
+ function checkoutAndCd(options) {
96
+ const ghUrl = options.component.githubRepo;
97
+ logger_1.LOGGER.info(`Clone repository '${ghUrl}' to directory: ${options.checkoutDir}`);
98
+ sh.cd(options.checkoutDir);
99
+ const directory = ghUrl.substring(ghUrl.lastIndexOf('/') + 1);
100
+ const repoPath = (0, path_1.resolve)(options.checkoutDir, directory);
101
+ if (fs.existsSync((0, path_1.resolve)(options.checkoutDir, directory))) {
102
+ if (options.force) {
103
+ logger_1.LOGGER.debug('A directory with the checkout name already exists.');
104
+ logger_1.LOGGER.debug('Force mode is enabled. The directory will be removed');
105
+ (0, command_util_1.fatalExec)(`rm -rf ${repoPath}`, `Could not remove directory: ${repoPath}`);
106
+ }
107
+ else {
108
+ throw new Error('Directory with the checkout name already exists.');
109
+ }
110
+ }
111
+ sh.exec(`gh repo clone ${ghUrl}`, (0, command_util_1.getShellConfig)());
112
+ logger_1.LOGGER.debug(`Successfully cloned to ${directory}`);
113
+ sh.cd(directory);
114
+ if (options.checkoutDir !== 'master') {
115
+ sh.exec(`git switch ${options.branch} `);
116
+ }
117
+ return sh.pwd();
118
+ }
119
+ exports.checkoutAndCd = checkoutAndCd;
120
+ function commitAndTag(version, repositoryPath) {
121
+ logger_1.LOGGER.info('Commit changes and create new tag');
122
+ sh.cd(repositoryPath);
123
+ logger_1.LOGGER.debug('Check wether the given url is a git repository');
124
+ if (!(0, git_util_1.isGitRepository)(sh.pwd())) {
125
+ throw new Error(`The given path is not a git repository: ${repositoryPath}`);
126
+ }
127
+ const tag = `v${version}`;
128
+ logger_1.LOGGER.debug(`Create tag with label: ${tag}}`);
129
+ sh.exec(`git checkout -b ${tag}`, (0, command_util_1.getShellConfig)());
130
+ sh.exec('git add .', (0, command_util_1.getShellConfig)());
131
+ sh.exec(`git commit -m "${tag}"`, (0, command_util_1.getShellConfig)());
132
+ sh.exec(`git tag ${tag}`, (0, command_util_1.getShellConfig)());
133
+ return tag;
134
+ }
135
+ exports.commitAndTag = commitAndTag;
136
+ function publish(repositoryPath, options) {
137
+ if (!options.publish || options.npmDryRun) {
138
+ logger_1.LOGGER.info('Skip publishing to Github');
139
+ if (options.npmDryRun && options.component.releaseRepo === 'npm') {
140
+ (0, command_util_1.fatalExec)('lerna publish from-git --no-git-reset --no-git-tag-version --no-verify-access --no-push --dist-tag rc --yes', 'Dry-run publish failed', { silent: false });
141
+ }
142
+ return;
143
+ }
144
+ logger_1.LOGGER.info(`Publish new GH release ${options.draft ? '[DRAFT]' : ''}`);
145
+ sh.cd(repositoryPath);
146
+ if (!options.force && (0, git_util_1.hasGitChanges)()) {
147
+ throw new Error('Publish failed. The repository has pending changes');
148
+ }
149
+ const latestReleaseTag = (0, git_util_1.getLatestRelease)();
150
+ const localTag = (0, git_util_1.getLatestTag)();
151
+ validateTag(latestReleaseTag, localTag);
152
+ const preRelease = options.releaseType === 'rc' || localTag.includes('-');
153
+ doPublish(localTag, preRelease, latestReleaseTag, options.draft);
154
+ }
155
+ exports.publish = publish;
156
+ function doPublish(tag, preRelease, latestRelease, draft) {
157
+ (0, command_util_1.fatalExec)(`git push origin HEAD:${tag}`, 'Could not push release branch to Github', (0, command_util_1.getShellConfig)({ silent: false }));
158
+ (0, command_util_1.fatalExec)(`git push origin tag ${tag}`, 'Could not push tag to Github', (0, command_util_1.getShellConfig)({ silent: false }));
159
+ const version = tagToVersion(tag);
160
+ const titleSuffix = preRelease ? ` Candiate ${version.substring(version.length - 1)}` : '';
161
+ const title = `${version.replace(/-.*/, '')} Release${titleSuffix} `;
162
+ sh.exec(`gh release create ${tag} -t "${title}" --notes-start-tag ${latestRelease} --generate-notes ${draft ? '-d' : ''} ${preRelease ? '-p' : ''}`, (0, command_util_1.getShellConfig)());
163
+ }
164
+ function validateTag(currentReleaseTag, newTag) {
165
+ const releaseVersion = tagToVersion(currentReleaseTag);
166
+ const newVersion = tagToVersion(newTag);
167
+ if (!semver.satisfies(newVersion, `>${releaseVersion}`, { includePrerelease: true })) {
168
+ throw new Error(`Tag version is lower than the current release: ${newTag} `);
169
+ }
170
+ }
171
+ function tagToVersion(tag) {
172
+ if (!tag.startsWith('v')) {
173
+ throw new Error(`Invalid format. The release tag should start with 'v': ${tag}`);
174
+ }
175
+ const version = tag.substring(1).replace('.RC', '-RC');
176
+ return (0, validation_util_1.validateVersion)(version);
177
+ }
178
+ function lernaSetVersion(repositoryPath, version) {
179
+ logger_1.LOGGER.info(`Bump version in ${repositoryPath} to: ${version}`);
180
+ sh.cd(repositoryPath);
181
+ (0, command_util_1.fatalExec)(`lerna version --exact ${version} --ignore-scripts --yes --no-push --no-git-tag-version`, 'Lerna version bump failed!', {
182
+ silent: false
183
+ });
184
+ logger_1.LOGGER.debug('Update root package.json version');
185
+ sh.exec(`jq '.version="${version}"' package.json > temp.json`, (0, command_util_1.getShellConfig)());
186
+ sh.exec('mv temp.json package.json ', (0, command_util_1.getShellConfig)());
187
+ }
188
+ exports.lernaSetVersion = lernaSetVersion;
189
+ function yarnInstall(repositoryPath) {
190
+ logger_1.LOGGER.debug(`Build ${repositoryPath}`);
191
+ sh.cd(repositoryPath);
192
+ (0, command_util_1.fatalExec)('yarn', 'Yarn build failed', (0, command_util_1.getShellConfig)({ silent: false }));
193
+ }
194
+ exports.yarnInstall = yarnInstall;
195
+ function upgradeCommand(pckName, version) {
196
+ logger_1.LOGGER.debug(`Upgrade '${pckName}' to version ${version}`);
197
+ return `lernaupdate --non-interactive --dependency ${pckName}@${version}`;
198
+ }
199
+ exports.upgradeCommand = upgradeCommand;
200
+ function updateVersion(...packages) {
201
+ packages.forEach(pckg => {
202
+ const result = sh.exec(upgradeCommand(pckg.name, pckg.version), (0, command_util_1.getShellConfig)({ silent: false })).stdout.trim();
203
+ if (result.includes('An error occurred:')) {
204
+ const errorMsg = result.substring(result.lastIndexOf('An error occurred:')).trim();
205
+ throw new Error(errorMsg);
206
+ }
207
+ });
208
+ }
209
+ exports.updateVersion = updateVersion;
210
+ function updateServerConfig(configFile, version, isSnapShot) {
211
+ logger_1.LOGGER.info('Update example server download config');
212
+ sh.exec(`jq '.isSnapShot=${isSnapShot}| .version="${version}"' ${configFile} > temp.json`, (0, command_util_1.getShellConfig)());
213
+ sh.exec(`mv temp.json ${configFile}`, (0, command_util_1.getShellConfig)());
214
+ }
215
+ exports.updateServerConfig = updateServerConfig;
216
+ function asMvnVersion(version) {
217
+ logger_1.LOGGER.debug(`Convert to maven conform version: ${version}`);
218
+ const mavenVersion = version.replace('-', '.');
219
+ logger_1.LOGGER.debug(`Maven version :${mavenVersion}`);
220
+ return mavenVersion;
221
+ }
222
+ exports.asMvnVersion = asMvnVersion;
223
+ async function checkIfNpmVersionExists(pckgName, newVersion) {
224
+ logger_1.LOGGER.debug(`Check if version exists on npm: ${newVersion}`);
225
+ const response = await (0, node_fetch_1.default)(`https://registry.npmjs.org/${pckgName}/${newVersion}`);
226
+ const data = await response.json();
227
+ if (typeof data === 'string' && data.includes('version not found:')) {
228
+ logger_1.LOGGER.debug(`Version '${newVersion}' does not exist on NPM. Continue with release`);
229
+ return;
230
+ }
231
+ throw new Error(`Version '${newVersion} is already present on NPM!}`);
232
+ }
233
+ exports.checkIfNpmVersionExists = checkIfNpmVersionExists;
234
+ function checkIfMavenVersionExists(groupId, artifactId, newVersion) {
235
+ logger_1.LOGGER.debug('Check if maven version exists');
236
+ if (isExistingMavenVersion(groupId, artifactId, newVersion)) {
237
+ throw new Error(`Version '${newVersion} is already present on maven central!}`);
238
+ }
239
+ logger_1.LOGGER.debug(`Version '${newVersion}' does not exist on maven central. Continue with release`);
240
+ }
241
+ exports.checkIfMavenVersionExists = checkIfMavenVersionExists;
242
+ function isExistingMavenVersion(groupId, artifactId, version) {
243
+ const versions = sh
244
+ .exec(`wget -q -O - https://repo1.maven.org/maven2/${groupId.replace(/\./g, '/')}/${artifactId}/maven-metadata.xml`, (0, command_util_1.getShellConfig)())
245
+ .exec("grep -P '<version>\\K[^<]*'", (0, command_util_1.getShellConfig)())
246
+ .stdout.replace(/<\/?version>/g, '')
247
+ .split('\n')
248
+ .map(versionString => versionString.trim());
249
+ logger_1.LOGGER.debug(`${versions.length} released versions found:`, versions);
250
+ return versions.includes(version);
251
+ }
252
+ exports.isExistingMavenVersion = isExistingMavenVersion;
253
+ function checkJavaServerVersion(version, force = false) {
254
+ const mvnVersion = asMvnVersion(version);
255
+ if (!isExistingMavenVersion('org.eclipse.glsp', 'org.eclipse.glsp.server', mvnVersion)) {
256
+ // eslint-disable-next-line max-len
257
+ const errorMsg = `No Java GLSP server with version ${mvnVersion} found on maven central!. Please release a new Java GLSP Server version before publishing this release!`;
258
+ logger_1.LOGGER.warn(errorMsg);
259
+ if (force || readline.keyInYN('No Java GLSP server with corresponding version found. Do you want to continue anyways?')) {
260
+ return;
261
+ }
262
+ throw new Error(errorMsg);
263
+ }
264
+ }
265
+ exports.checkJavaServerVersion = checkJavaServerVersion;
266
+ function updateLernaForDryRun() {
267
+ logger_1.LOGGER.debug('Update lerna.json to use local publish registry');
268
+ sh.exec(`jq '.command.publish.registry="${exports.VERDACCIO_REGISTRY}"' lerna.json > temp.json`, (0, command_util_1.getShellConfig)());
269
+ sh.exec('mv temp.json lerna.json', (0, command_util_1.getShellConfig)());
270
+ sh.exec(`npm set registry ${exports.VERDACCIO_REGISTRY}`);
271
+ }
272
+ exports.updateLernaForDryRun = updateLernaForDryRun;
273
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/release/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yBAAyB;AACzB,2CAA+B;AAC/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AC,IAAI,CAAC,oBAAoB,0BAAkB,EAAE,CAAC,CAAC;AACtD,CAAC;AALD,oDAKC"}
@@ -0,0 +1,3 @@
1
+ import { ReleaseOptions } from './common';
2
+ export declare function releaseClient(options: ReleaseOptions): Promise<void>;
3
+ //# sourceMappingURL=release-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-client.d.ts","sourceRoot":"","sources":["../../src/release/release-client.ts"],"names":[],"mappings":"AAiBA,OAAO,EAOH,cAAc,EAIjB,MAAM,UAAU,CAAC;AAIlB,wBAAsB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAa1E"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.releaseClient = void 0;
4
+ /********************************************************************************
5
+ * Copyright (c) 2022 EclipseSource and others.
6
+ *
7
+ * This program and the accompanying materials are made available under the
8
+ * terms of the Eclipse Public License v. 2.0 which is available at
9
+ * http://www.eclipse.org/legal/epl-2.0.
10
+ *
11
+ * This Source Code may also be made available under the following Secondary
12
+ * Licenses when the conditions for such availability set forth in the Eclipse
13
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
+ * with the GNU Classpath Exception which is available at
15
+ * https://www.gnu.org/software/classpath/license.html.
16
+ *
17
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
+ ********************************************************************************/
19
+ const sh = require("shelljs");
20
+ const logger_1 = require("../util/logger");
21
+ const common_1 = require("./common");
22
+ let REPO_ROOT;
23
+ async function releaseClient(options) {
24
+ logger_1.LOGGER.info('Prepare glsp-client release');
25
+ logger_1.LOGGER.debug('Release options: ', options.version);
26
+ REPO_ROOT = (0, common_1.checkoutAndCd)(options);
27
+ await updateDownloadServerScript(options.version, options.force);
28
+ generateChangeLog();
29
+ (0, common_1.lernaSetVersion)(REPO_ROOT, options.version);
30
+ build();
31
+ if (options.npmDryRun) {
32
+ (0, common_1.updateLernaForDryRun)();
33
+ }
34
+ (0, common_1.commitAndTag)(options.version, REPO_ROOT);
35
+ (0, common_1.publish)(REPO_ROOT, options);
36
+ }
37
+ exports.releaseClient = releaseClient;
38
+ async function updateDownloadServerScript(version, force) {
39
+ logger_1.LOGGER.info('Update example server download config');
40
+ const mvnVersion = (0, common_1.asMvnVersion)(version);
41
+ (0, common_1.checkJavaServerVersion)(version, force);
42
+ sh.cd(`${REPO_ROOT}/examples/workflow-glsp/scripts`);
43
+ (0, common_1.updateServerConfig)('config.json', mvnVersion, false);
44
+ }
45
+ function generateChangeLog() {
46
+ // do nothing for now
47
+ }
48
+ function build() {
49
+ logger_1.LOGGER.info('Install & Build with yarn');
50
+ (0, common_1.yarnInstall)(REPO_ROOT);
51
+ logger_1.LOGGER.debug('Build successful');
52
+ }
53
+ //# sourceMappingURL=release-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-client.js","sourceRoot":"","sources":["../../src/release/release-client.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,8BAA8B;AAC9B,2CAAwC;AACxC,qCAWkB;AAElB,IAAI,SAAiB,CAAC;AAEf,KAAK,UAAU,aAAa,CAAC,OAAuB;IACvD,eAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAC3C,eAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,SAAS,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;IACnC,MAAM,0BAA0B,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACjE,iBAAiB,EAAE,CAAC;IACpB,IAAA,wBAAe,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,KAAK,EAAE,CAAC;IACR,IAAI,OAAO,CAAC,SAAS,EAAE;QACnB,IAAA,6BAAoB,GAAE,CAAC;KAC1B;IACD,IAAA,qBAAY,EAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACzC,IAAA,gBAAO,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AAbD,sCAaC;AAED,KAAK,UAAU,0BAA0B,CAAC,OAAe,EAAE,KAAc;IACrE,eAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC;IACzC,IAAA,+BAAsB,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACvC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,iCAAiC,CAAC,CAAC;IACrD,IAAA,2BAAkB,EAAC,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,iBAAiB;IACtB,qBAAqB;AACzB,CAAC;AAED,SAAS,KAAK;IACV,eAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IACzC,IAAA,oBAAW,EAAC,SAAS,CAAC,CAAC;IACvB,eAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 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 { ReleaseOptions } from './common';
17
+ export declare function releaseEclipseIntegration(options: ReleaseOptions): Promise<void>;
18
+ //# sourceMappingURL=release-eclipse-integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-eclipse-integration.d.ts","sourceRoot":"","sources":["../../src/release/release-eclipse-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAKlF,OAAO,EAOH,cAAc,EAKjB,MAAM,UAAU,CAAC;AAIlB,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAYtF"}