@eclipse-glsp/cli 1.1.0-next.28fb493.121

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 (79) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +89 -0
  3. package/bin/glsp +2 -0
  4. package/lib/app.d.ts +3 -0
  5. package/lib/app.d.ts.map +1 -0
  6. package/lib/app.js +32 -0
  7. package/lib/app.js.map +1 -0
  8. package/lib/commands/check-header.d.ts +24 -0
  9. package/lib/commands/check-header.d.ts.map +1 -0
  10. package/lib/commands/check-header.js +234 -0
  11. package/lib/commands/check-header.js.map +1 -0
  12. package/lib/commands/coverage-report.d.ts +29 -0
  13. package/lib/commands/coverage-report.d.ts.map +1 -0
  14. package/lib/commands/coverage-report.js +100 -0
  15. package/lib/commands/coverage-report.js.map +1 -0
  16. package/lib/commands/release/common.d.ts +69 -0
  17. package/lib/commands/release/common.d.ts.map +1 -0
  18. package/lib/commands/release/common.js +273 -0
  19. package/lib/commands/release/common.js.map +1 -0
  20. package/lib/commands/release/release-client.d.ts +3 -0
  21. package/lib/commands/release/release-client.d.ts.map +1 -0
  22. package/lib/commands/release/release-client.js +53 -0
  23. package/lib/commands/release/release-client.js.map +1 -0
  24. package/lib/commands/release/release-eclipse-integration.d.ts +18 -0
  25. package/lib/commands/release/release-eclipse-integration.d.ts.map +1 -0
  26. package/lib/commands/release/release-eclipse-integration.js +90 -0
  27. package/lib/commands/release/release-eclipse-integration.js.map +1 -0
  28. package/lib/commands/release/release-java-server.d.ts +3 -0
  29. package/lib/commands/release/release-java-server.d.ts.map +1 -0
  30. package/lib/commands/release/release-java-server.js +68 -0
  31. package/lib/commands/release/release-java-server.js.map +1 -0
  32. package/lib/commands/release/release-server-node.d.ts +18 -0
  33. package/lib/commands/release/release-server-node.d.ts.map +1 -0
  34. package/lib/commands/release/release-server-node.js +51 -0
  35. package/lib/commands/release/release-server-node.js.map +1 -0
  36. package/lib/commands/release/release-theia-integration.d.ts +18 -0
  37. package/lib/commands/release/release-theia-integration.d.ts.map +1 -0
  38. package/lib/commands/release/release-theia-integration.js +62 -0
  39. package/lib/commands/release/release-theia-integration.js.map +1 -0
  40. package/lib/commands/release/release-vscode-integration.d.ts +18 -0
  41. package/lib/commands/release/release-vscode-integration.d.ts.map +1 -0
  42. package/lib/commands/release/release-vscode-integration.js +51 -0
  43. package/lib/commands/release/release-vscode-integration.js.map +1 -0
  44. package/lib/commands/release/release.d.ts +14 -0
  45. package/lib/commands/release/release.d.ts.map +1 -0
  46. package/lib/commands/release/release.js +165 -0
  47. package/lib/commands/release/release.js.map +1 -0
  48. package/lib/util/command-util.d.ts +26 -0
  49. package/lib/util/command-util.d.ts.map +1 -0
  50. package/lib/util/command-util.js +53 -0
  51. package/lib/util/command-util.js.map +1 -0
  52. package/lib/util/git-util.d.ts +60 -0
  53. package/lib/util/git-util.d.ts.map +1 -0
  54. package/lib/util/git-util.js +171 -0
  55. package/lib/util/git-util.js.map +1 -0
  56. package/lib/util/logger.d.ts +23 -0
  57. package/lib/util/logger.d.ts.map +1 -0
  58. package/lib/util/logger.js +50 -0
  59. package/lib/util/logger.js.map +1 -0
  60. package/lib/util/validation-util.d.ts +6 -0
  61. package/lib/util/validation-util.d.ts.map +1 -0
  62. package/lib/util/validation-util.js +64 -0
  63. package/lib/util/validation-util.js.map +1 -0
  64. package/package.json +64 -0
  65. package/src/app.ts +30 -0
  66. package/src/commands/check-header.ts +315 -0
  67. package/src/commands/coverage-report.ts +113 -0
  68. package/src/commands/release/common.ts +312 -0
  69. package/src/commands/release/release-client.ts +64 -0
  70. package/src/commands/release/release-eclipse-integration.ts +113 -0
  71. package/src/commands/release/release-java-server.ts +73 -0
  72. package/src/commands/release/release-server-node.ts +61 -0
  73. package/src/commands/release/release-theia-integration.ts +77 -0
  74. package/src/commands/release/release-vscode-integration.ts +65 -0
  75. package/src/commands/release/release.ts +215 -0
  76. package/src/util/command-util.ts +54 -0
  77. package/src/util/git-util.ts +172 -0
  78. package/src/util/logger.ts +57 -0
  79. package/src/util/validation-util.ts +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-server-node.js","sourceRoot":"","sources":["../../../src/commands/release/release-server-node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,8BAA8B;AAC9B,8CAA2C;AAC3C,qCASkB;AAElB,IAAI,SAAiB,CAAC;AAEf,KAAK,UAAU,iBAAiB,CAAC,OAAuB;IAC3D,eAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAChD,eAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC3C,SAAS,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;IACnC,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,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,8CAaC;AAED,SAAS,8BAA8B,CAAC,OAAe;IACnD,eAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC5D,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACjB,IAAA,sBAAa,EAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,CAAC,CAAC;AAC/D,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;AAED,SAAS,iBAAiB;IACtB,qBAAqB;AACzB,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 releaseTheiaIntegration(options: ReleaseOptions): Promise<void>;
18
+ //# sourceMappingURL=release-theia-integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-theia-integration.d.ts","sourceRoot":"","sources":["../../../src/commands/release/release-theia-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAIlF,OAAO,EAOH,cAAc,EAKjB,MAAM,UAAU,CAAC;AAIlB,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAcpF"}
@@ -0,0 +1,62 @@
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.releaseTheiaIntegration = void 0;
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 releaseTheiaIntegration(options) {
24
+ logger_1.LOGGER.info('Prepare glsp-theia-integration release');
25
+ logger_1.LOGGER.debug('Release options: ', options);
26
+ REPO_ROOT = (0, common_1.checkoutAndCd)(options);
27
+ updateExternalGLSPDependencies(options.version);
28
+ await updateDownloadServerScript(options.version);
29
+ generateChangeLog();
30
+ (0, common_1.lernaSetVersion)(REPO_ROOT, options.version);
31
+ build();
32
+ if (options.npmDryRun) {
33
+ (0, common_1.updateLernaForDryRun)();
34
+ }
35
+ (0, common_1.commitAndTag)(options.version, REPO_ROOT);
36
+ (0, common_1.publish)(REPO_ROOT, options);
37
+ }
38
+ exports.releaseTheiaIntegration = releaseTheiaIntegration;
39
+ function updateExternalGLSPDependencies(version) {
40
+ logger_1.LOGGER.info('Update external GLSP dependencies (Client and workflow example)');
41
+ sh.cd(REPO_ROOT);
42
+ (0, common_1.updateVersion)({ name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version });
43
+ }
44
+ async function updateDownloadServerScript(version) {
45
+ logger_1.LOGGER.info('Update example server download config');
46
+ const mvnVersion = (0, common_1.asMvnVersion)(version);
47
+ if (!(0, common_1.isExistingMavenVersion)('org.eclipse.glsp', 'org.eclipse.glsp.server', mvnVersion)) {
48
+ logger_1.LOGGER.warn(`No Java GLSP server with version ${mvnVersion} found on maven central!. Please release a new Java GLSP Server version
49
+ before publishing this release!`);
50
+ }
51
+ sh.cd(`${REPO_ROOT}/examples/workflow-theia/src/node`);
52
+ (0, common_1.updateServerConfig)('server-config.json', mvnVersion, false);
53
+ }
54
+ function build() {
55
+ logger_1.LOGGER.info('Install & Build with yarn');
56
+ (0, common_1.yarnInstall)(REPO_ROOT);
57
+ logger_1.LOGGER.debug('Build successful');
58
+ }
59
+ function generateChangeLog() {
60
+ // do nothing for now
61
+ }
62
+ //# sourceMappingURL=release-theia-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-theia-integration.js","sourceRoot":"","sources":["../../../src/commands/release/release-theia-integration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,8BAA8B;AAC9B,8CAA2C;AAC3C,qCAYkB;AAElB,IAAI,SAAiB,CAAC;AAEf,KAAK,UAAU,uBAAuB,CAAC,OAAuB;IACjE,eAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACtD,eAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC3C,SAAS,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;IACnC,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,0BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,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;AAdD,0DAcC;AAED,SAAS,8BAA8B,CAAC,OAAe;IACnD,eAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAC/E,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACjB,IAAA,sBAAa,EAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,sCAAsC,EAAE,OAAO,EAAE,CAAC,CAAC;AACxH,CAAC;AAED,KAAK,UAAU,0BAA0B,CAAC,OAAe;IACrD,eAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,IAAA,+BAAsB,EAAC,kBAAkB,EAAE,yBAAyB,EAAE,UAAU,CAAC,EAAE;QACpF,eAAM,CAAC,IAAI,CAAC,oCAAoC,UAAU;wCAC1B,CAAC,CAAC;KACrC;IAED,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,mCAAmC,CAAC,CAAC;IACvD,IAAA,2BAAkB,EAAC,oBAAoB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;AAChE,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;AAED,SAAS,iBAAiB;IACtB,qBAAqB;AACzB,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 releaseVscodeIntegration(options: ReleaseOptions): Promise<void>;
18
+ //# sourceMappingURL=release-vscode-integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-vscode-integration.d.ts","sourceRoot":"","sources":["../../../src/commands/release/release-vscode-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAIlF,OAAO,EAKH,cAAc,EAIjB,MAAM,UAAU,CAAC;AAIlB,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF"}
@@ -0,0 +1,51 @@
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.releaseVscodeIntegration = void 0;
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 releaseVscodeIntegration(options) {
24
+ logger_1.LOGGER.info('Prepare glsp-vscode-integration release');
25
+ logger_1.LOGGER.debug('Release options: ', options);
26
+ REPO_ROOT = (0, common_1.checkoutAndCd)(options);
27
+ updateExternalGLSPDependencies(options.version);
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.releaseVscodeIntegration = releaseVscodeIntegration;
38
+ function updateExternalGLSPDependencies(version) {
39
+ logger_1.LOGGER.info('Update external GLSP dependencies (Protocol)');
40
+ sh.cd(REPO_ROOT);
41
+ (0, common_1.updateVersion)({ name: '@eclipse-glsp/protocol', version }, { name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version });
42
+ }
43
+ function build() {
44
+ logger_1.LOGGER.info('Install & Build with yarn');
45
+ (0, common_1.yarnInstall)(REPO_ROOT);
46
+ logger_1.LOGGER.debug('Build successful');
47
+ }
48
+ function generateChangeLog() {
49
+ // do nothing for now
50
+ }
51
+ //# sourceMappingURL=release-vscode-integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-vscode-integration.js","sourceRoot":"","sources":["../../../src/commands/release/release-vscode-integration.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,8BAA8B;AAC9B,8CAA2C;AAC3C,qCASkB;AAElB,IAAI,SAAiB,CAAC;AAEf,KAAK,UAAU,wBAAwB,CAAC,OAAuB;IAClE,eAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;IACvD,eAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC3C,SAAS,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;IACnC,8BAA8B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,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,4DAaC;AAED,SAAS,8BAA8B,CAAC,OAAe;IACnD,eAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC5D,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACjB,IAAA,sBAAa,EACT,EAAE,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,EAC3C,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,EACzC,EAAE,IAAI,EAAE,sCAAsC,EAAE,OAAO,EAAE,CAC5D,CAAC;AACN,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;AAED,SAAS,iBAAiB;IACtB,qBAAqB;AACzB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Component, ReleaseType } from './common';
2
+ interface ReleaseCmdOptions {
3
+ checkoutDir: string;
4
+ branch: string;
5
+ force: boolean;
6
+ publish: boolean;
7
+ npmDryRun: boolean;
8
+ draft: boolean;
9
+ verbose: boolean;
10
+ }
11
+ export declare const ReleaseCommand: import("commander").Command;
12
+ export declare function release(component: Component, releaseType: ReleaseType, customVersion: string | undefined, cliOptions: ReleaseCmdOptions): Promise<void>;
13
+ export {};
14
+ //# sourceMappingURL=release.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/commands/release/release.ts"],"names":[],"mappings":"AAyBA,OAAO,EAIH,SAAS,EAET,WAAW,EAEd,MAAM,UAAU,CAAC;AAQlB,UAAU,iBAAiB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,6BAiBP,CAAC;AAIrB,wBAAsB,OAAO,CACzB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,UAAU,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAuCf"}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.release = exports.ReleaseCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const process_1 = require("process");
6
+ const readline_1 = require("readline");
7
+ const readline = require("readline-sync");
8
+ const semver = require("semver");
9
+ const sh = require("shelljs");
10
+ const command_util_1 = require("../../util/command-util");
11
+ const logger_1 = require("../../util/logger");
12
+ const validation_util_1 = require("../../util/validation-util");
13
+ const common_1 = require("./common");
14
+ const release_client_1 = require("./release-client");
15
+ const release_eclipse_integration_1 = require("./release-eclipse-integration");
16
+ const release_java_server_1 = require("./release-java-server");
17
+ const release_server_node_1 = require("./release-server-node");
18
+ const release_theia_integration_1 = require("./release-theia-integration");
19
+ const release_vscode_integration_1 = require("./release-vscode-integration");
20
+ exports.ReleaseCommand = (0, command_util_1.baseCommand)()
21
+ .name('release')
22
+ .description('Prepare & publish a new release for a glsp component')
23
+ .addArgument(new commander_1.Argument('<component>', 'The glsp component to be released').choices(common_1.Component.CLI_CHOICES).argParser(common_1.Component.parse))
24
+ .addArgument(new commander_1.Argument('<releaseType>', 'The release type').choices(common_1.ReleaseType.CLI_CHOICES))
25
+ .argument('[customVersion]', 'Custom version number. Will be ignored if the release type is not "custom"', validation_util_1.validateVersion)
26
+ .option('-f, --force', 'Enable force mode', false)
27
+ .option('-d, --checkoutDir <checkoutDir>', 'The git checkout directory', validation_util_1.validateDirectory, process.cwd())
28
+ .option('-b, --branch <branch>', 'The git branch to checkout', 'master')
29
+ .option('-v, --verbose', 'Enable verbose (debug) log output', false)
30
+ .option('--no-publish', 'Only prepare release but do not publish to github', true)
31
+ .option('--draft', 'Publish github releases as drafts', false)
32
+ .option('--npm-dryRun', 'Execute a npm dry-run for inspection. Publishes to the local npm registry and does not publish to github', false)
33
+ .action(release);
34
+ let verdaccioChildProcess = undefined;
35
+ async function release(component, releaseType, customVersion, cliOptions) {
36
+ try {
37
+ logger_1.LOGGER.debug('Cli options:', cliOptions);
38
+ (0, command_util_1.configureShell)({ silent: !cliOptions.verbose });
39
+ (0, logger_1.configureLogger)(cliOptions.verbose);
40
+ checkGHCli();
41
+ const version = deriveVersion(releaseType, customVersion);
42
+ const options = Object.assign(Object.assign({}, cliOptions), { component, releaseType, version });
43
+ if (cliOptions.npmDryRun && options.component.releaseRepo === 'npm') {
44
+ await launchVerdaccio().catch(error => logger_1.LOGGER.error('Error occurred during verdaccio launch', error));
45
+ }
46
+ switch (component.type) {
47
+ case 'server-java':
48
+ (0, common_1.checkIfMavenVersionExists)('org.eclipse.glsp', 'org.eclipse.glsp.server', (0, common_1.asMvnVersion)(version));
49
+ return (0, release_java_server_1.releaseJavaServer)(options);
50
+ case 'server-node':
51
+ await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/server-node', version);
52
+ return (0, release_server_node_1.releaseServerNode)(options);
53
+ case 'client':
54
+ await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/client', version);
55
+ return (0, release_client_1.releaseClient)(options);
56
+ case 'theia-integration':
57
+ await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/theia-integration', version);
58
+ return (0, release_theia_integration_1.releaseTheiaIntegration)(options);
59
+ case 'vscode-integration':
60
+ await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/vscode-integration', version);
61
+ return (0, release_vscode_integration_1.releaseVscodeIntegration)(options);
62
+ case 'eclipse-integration':
63
+ await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/ide', version);
64
+ return (0, release_eclipse_integration_1.releaseEclipseIntegration)(options);
65
+ }
66
+ }
67
+ catch (err) {
68
+ console.error('An error occurred during command execution:', err);
69
+ (0, process_1.exit)(1);
70
+ }
71
+ finally {
72
+ if (verdaccioChildProcess) {
73
+ verdaccioChildProcess.kill();
74
+ }
75
+ }
76
+ }
77
+ exports.release = release;
78
+ function checkGHCli() {
79
+ logger_1.LOGGER.debug('Verify that Github CLI is configured correctly');
80
+ if (!isGithubCLIAuthenticated()) {
81
+ throw new Error("Github CLI is not configured properly. No user is logged in for host 'github.com'");
82
+ }
83
+ }
84
+ function isGithubCLIAuthenticated() {
85
+ logger_1.LOGGER.debug('Verify that Github CLI is installed');
86
+ (0, command_util_1.fatalExec)('which gh', 'Github CLI is not installed!');
87
+ const status = sh.exec('gh auth status', (0, command_util_1.getShellConfig)());
88
+ if (status.code !== 0) {
89
+ if (status.stderr.includes('You are not logged into any GitHub hosts')) {
90
+ return false;
91
+ }
92
+ throw new Error(status.stderr);
93
+ }
94
+ if (!status.stderr.trim().includes('Logged in to github.com')) {
95
+ logger_1.LOGGER.debug("No user is logged in for host 'github.com'");
96
+ return false;
97
+ }
98
+ logger_1.LOGGER.debug('Github CLI is authenticated and ready to use');
99
+ return true;
100
+ }
101
+ function launchVerdaccio() {
102
+ logger_1.LOGGER.debug('Verify that verdaccio is installed and start if necessary');
103
+ (0, command_util_1.fatalExec)('which verdaccio', 'Verdaccio is not installed!');
104
+ // Check if verdaccio is alreaddy running
105
+ const result = sh.exec(`curl -i ${common_1.VERDACCIO_REGISTRY}`, (0, command_util_1.getShellConfig)());
106
+ if (result.code !== 0) {
107
+ logger_1.LOGGER.info('Starting local verdaccio registry');
108
+ verdaccioChildProcess = sh.exec('verdaccio', { async: true, silent: true });
109
+ return new Promise(resolve => {
110
+ (0, readline_1.createInterface)(verdaccioChildProcess.stdout).on('line', line => {
111
+ if (line.includes(`http address - ${common_1.VERDACCIO_REGISTRY}`)) {
112
+ resolve();
113
+ }
114
+ });
115
+ });
116
+ }
117
+ return Promise.resolve();
118
+ }
119
+ function deriveVersion(releaseType, customVersion) {
120
+ logger_1.LOGGER.debug(`Derive version from release type: ${release}`);
121
+ switch (releaseType) {
122
+ case 'custom':
123
+ return getCustomVersion(customVersion);
124
+ case 'rc':
125
+ return getRCVersion();
126
+ case 'patch':
127
+ case 'major':
128
+ case 'minor':
129
+ return semverInc(releaseType);
130
+ }
131
+ }
132
+ const REFERENCE_NPM_PACKAGE = '@eclipse-glsp/ide';
133
+ function getRCVersion() {
134
+ logger_1.LOGGER.debug('Retrieve and new RC version');
135
+ const newBaseVersion = semverInc('minor');
136
+ const currentRcVersion = sh.exec(`npm view ${REFERENCE_NPM_PACKAGE} dist-tags.rc`, (0, command_util_1.getShellConfig)()).stdout.trim();
137
+ const currentRcBaseVersion = currentRcVersion.split('-')[0];
138
+ if (currentRcBaseVersion !== newBaseVersion) {
139
+ return `${newBaseVersion}-RC01`;
140
+ }
141
+ let rcNumber = Number.parseInt(currentRcVersion.replace(`${currentRcBaseVersion}-RC`, ''), 10);
142
+ rcNumber++;
143
+ return `${newBaseVersion}-RC` + `${rcNumber}`.padStart(2, '0');
144
+ }
145
+ function getCustomVersion(customVersion) {
146
+ logger_1.LOGGER.debug('Retrieve and validate custom version');
147
+ logger_1.LOGGER.debug(customVersion ? `Custom version has been passed as argument: ${customVersion}` : 'Prompt custom version from user');
148
+ const version = customVersion !== null && customVersion !== void 0 ? customVersion : readline.question('> Please enter the new version');
149
+ return (0, validation_util_1.validateVersion)(version);
150
+ }
151
+ function getCurrentVersion() {
152
+ logger_1.LOGGER.debug('Retrieve base version by querying the latest tag of the reference npm package');
153
+ const version = sh.exec(`npm view ${REFERENCE_NPM_PACKAGE} dist-tags.latest`, (0, command_util_1.getShellConfig)()).stdout.trim();
154
+ return (0, validation_util_1.validateVersion)(version);
155
+ }
156
+ function semverInc(releaseType, identifier) {
157
+ const currentVersion = getCurrentVersion();
158
+ logger_1.LOGGER.debug(`Execute: semver.inc("${currentVersion}", ${releaseType}, ${identifier})`);
159
+ const newVersion = semver.inc(currentVersion, releaseType, identifier);
160
+ if (!newVersion) {
161
+ throw new Error(`Could not increment version: ${currentVersion} `);
162
+ }
163
+ return newVersion;
164
+ }
165
+ //# sourceMappingURL=release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/commands/release/release.ts"],"names":[],"mappings":";;;AAgBA,yCAAqC;AACrC,qCAA+B;AAC/B,uCAA2C;AAC3C,0CAA0C;AAC1C,iCAAiC;AACjC,8BAA8B;AAC9B,0DAAiG;AACjG,8CAA4D;AAC5D,gEAAgF;AAChF,qCAQkB;AAClB,qDAAiD;AACjD,+EAA0E;AAC1E,+DAA0D;AAC1D,+DAA0D;AAC1D,2EAAsE;AACtE,6EAAwE;AAY3D,QAAA,cAAc,GAAG,IAAA,0BAAW,GAAE;KACtC,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,OAAO,CAAC,GAAG,EAAE,CAAC;KACzG,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,KAA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,CAAC,+CAA+C,aAAa,EAAE,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC;IACjI,MAAM,OAAO,GAAG,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,QAAQ,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC;IACrF,OAAO,IAAA,iCAAe,EAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,iBAAiB;IACtB,eAAM,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;IAC9F,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,qBAAqB,mBAAmB,EAAE,IAAA,6BAAc,GAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9G,OAAO,IAAA,iCAAe,EAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,WAA+B,EAAE,UAAmB;IACnE,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,eAAM,CAAC,KAAK,CAAC,wBAAwB,cAAc,MAAM,WAAW,KAAK,UAAU,GAAG,CAAC,CAAC;IACxF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IACvE,IAAI,CAAC,UAAU,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,gCAAgC,cAAc,GAAG,CAAC,CAAC;KACtE;IACD,OAAO,UAAU,CAAC;AACtB,CAAC"}
@@ -0,0 +1,26 @@
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 { Command } from 'commander';
17
+ import * as sh from 'shelljs';
18
+ export declare function baseCommand(cmd?: Command): Command;
19
+ export type ShellConfig = sh.ExecOptions & {
20
+ async: false;
21
+ };
22
+ export declare const SH_CONFIG: ShellConfig;
23
+ export declare function getShellConfig(options?: Partial<Omit<ShellConfig, 'async'>>): ShellConfig;
24
+ export declare function configureShell(config: Partial<sh.ShellConfig>): void;
25
+ export declare function fatalExec(command: string, fatalErrorMessage: string, options?: Partial<Omit<ShellConfig, 'async'>>): sh.ShellString;
26
+ //# sourceMappingURL=command-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-util.d.ts","sourceRoot":"","sources":["../../src/util/command-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,wBAAgB,WAAW,CAAC,GAAG,UAAgB,GAAG,OAAO,CAKxD;AAED,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAC5D,eAAO,MAAM,SAAS,EAAE,WAIvB,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAM,GAAG,WAAW,CAK7F;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,IAAI,CAKpE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAM,GAAG,EAAE,CAAC,WAAW,CAMvI"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fatalExec = exports.configureShell = exports.getShellConfig = exports.SH_CONFIG = exports.baseCommand = 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 commander_1 = require("commander");
20
+ const sh = require("shelljs");
21
+ // Commander.js utils
22
+ function baseCommand(cmd = new commander_1.Command()) {
23
+ return cmd //
24
+ .showSuggestionAfterError(true)
25
+ .showHelpAfterError(true)
26
+ .allowUnknownOption(false);
27
+ }
28
+ exports.baseCommand = baseCommand;
29
+ exports.SH_CONFIG = {
30
+ async: false,
31
+ fatal: true,
32
+ silent: false
33
+ };
34
+ function getShellConfig(options = {}) {
35
+ return Object.assign(Object.assign({}, exports.SH_CONFIG), options);
36
+ }
37
+ exports.getShellConfig = getShellConfig;
38
+ function configureShell(config) {
39
+ sh.config.reset();
40
+ getShellConfig({});
41
+ exports.SH_CONFIG.silent = config.silent;
42
+ exports.SH_CONFIG.fatal = config.fatal;
43
+ }
44
+ exports.configureShell = configureShell;
45
+ function fatalExec(command, fatalErrorMessage, options = {}) {
46
+ const result = sh.exec(command, getShellConfig(options));
47
+ if (result.code !== 0) {
48
+ throw new Error(fatalErrorMessage);
49
+ }
50
+ return result;
51
+ }
52
+ exports.fatalExec = fatalExec;
53
+ //# sourceMappingURL=command-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-util.js","sourceRoot":"","sources":["../../src/util/command-util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAAoC;AACpC,8BAA8B;AAE9B,qBAAqB;AACrB,SAAgB,WAAW,CAAC,GAAG,GAAG,IAAI,mBAAO,EAAE;IAC3C,OAAO,GAAG,CAAC,EAAE;SACR,wBAAwB,CAAC,IAAI,CAAC;SAC9B,kBAAkB,CAAC,IAAI,CAAC;SACxB,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AALD,kCAKC;AAGY,QAAA,SAAS,GAAgB;IAClC,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,KAAK;CAChB,CAAC;AAEF,SAAgB,cAAc,CAAC,UAA+C,EAAE;IAC5E,uCACO,iBAAS,GACT,OAAO,EACZ;AACN,CAAC;AALD,wCAKC;AAED,SAAgB,cAAc,CAAC,MAA+B;IAC1D,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,CAAC;IACnB,iBAAS,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,iBAAS,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACnC,CAAC;AALD,wCAKC;AAED,SAAgB,SAAS,CAAC,OAAe,EAAE,iBAAyB,EAAE,UAA+C,EAAE;IACnH,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACtC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAND,8BAMC"}
@@ -0,0 +1,60 @@
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 function isGitRepository(path?: string): boolean;
17
+ export declare function getGitRoot(path?: string): string;
18
+ export declare function hasGitChanges(path?: string): boolean;
19
+ /**
20
+ * Returns the files that have uncommitted changes (staged, not staged and untracked) of a git repository.
21
+ * Filepaths are absolute.
22
+ */
23
+ export declare function getUncommittedChanges(path?: string): string[];
24
+ /**
25
+ * Returns the files tha have been changed with the last commit (also includes currently staged but uncommitted changes)
26
+ * Filepaths are absolute.
27
+ */
28
+ export declare function getChangesOfLastCommit(path?: string): string[];
29
+ /**
30
+ * Returns the last modification date of a file (or the last commit) in a git repo.
31
+ * @param filePath The file. If undefined the modification date of the last commit will be returned
32
+ * @param repoRoot The path to the repo root. If undefined the current working directory is used.
33
+ * @returns The date or undefined if the file is outside of the git repo.
34
+ */
35
+ export declare function getLastModificationDate(filePath?: string, repoRoot?: string): Date | undefined;
36
+ /**
37
+ * Returns the last modification date of a file in a git repo.
38
+ * @param filePath The file
39
+ * @param repoRoot The path to the repo root. If undefined the current working directory is used.
40
+ * @returns The date or undefined if the file is outside of the git repo.
41
+ */
42
+ export declare function getFirstModificationDate(filePath: string, repoRoot?: string): Date | undefined;
43
+ export declare function getFilesOfCommit(commitHash: string, repoRoot?: string): string[];
44
+ /**
45
+ * Returns the commit hash of the initial commit of the given repository
46
+ * @param repoRoot The path to the repo root. If undefined the current working directory is used.
47
+ * @returns The commit hash or undefined if something went wrong.
48
+ */
49
+ export declare function getInitialCommit(repoRoot?: string): string | undefined;
50
+ /**
51
+ * Returns the commit hash of the first commit for a given file (across renames).
52
+ * @param repoRoot The path to the repo root. If undefined the current working directory is used.
53
+ * @returns The commit hash or undefined if something went wrong.
54
+ */
55
+ export declare function getFirstCommit(filePath: string, repoRoot?: string): string | undefined;
56
+ export declare function getLatestGithubRelease(path?: string): string;
57
+ export declare function getLatestTag(path?: string): string;
58
+ export declare function hasBranch(branch: string, path?: string): boolean;
59
+ export declare function getRemoteUrl(path?: string): string;
60
+ //# sourceMappingURL=git-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-util.d.ts","sourceRoot":"","sources":["../../src/util/git-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAMlF,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAQtD;AAED,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAU7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAO9D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAO9F;AACD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAa9F;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAQhF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,Q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