@eclipse-glsp/cli 2.2.1 → 2.3.0-next.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +143 -38
  2. package/dist/cli.js +21959 -0
  3. package/dist/cli.js.map +6 -0
  4. package/package.json +22 -29
  5. package/bin/glsp +0 -2
  6. package/lib/app.d.ts +0 -3
  7. package/lib/app.d.ts.map +0 -1
  8. package/lib/app.js +0 -36
  9. package/lib/app.js.map +0 -1
  10. package/lib/commands/check-header.d.ts +0 -21
  11. package/lib/commands/check-header.d.ts.map +0 -1
  12. package/lib/commands/check-header.js +0 -240
  13. package/lib/commands/check-header.js.map +0 -1
  14. package/lib/commands/checkout.d.ts +0 -27
  15. package/lib/commands/checkout.d.ts.map +0 -1
  16. package/lib/commands/checkout.js +0 -41
  17. package/lib/commands/checkout.js.map +0 -1
  18. package/lib/commands/coverage-report.d.ts +0 -29
  19. package/lib/commands/coverage-report.d.ts.map +0 -1
  20. package/lib/commands/coverage-report.js +0 -126
  21. package/lib/commands/coverage-report.js.map +0 -1
  22. package/lib/commands/generate-index.d.ts +0 -46
  23. package/lib/commands/generate-index.d.ts.map +0 -1
  24. package/lib/commands/generate-index.js +0 -172
  25. package/lib/commands/generate-index.js.map +0 -1
  26. package/lib/commands/release/common.d.ts +0 -68
  27. package/lib/commands/release/common.d.ts.map +0 -1
  28. package/lib/commands/release/common.js +0 -293
  29. package/lib/commands/release/common.js.map +0 -1
  30. package/lib/commands/release/release-client.d.ts +0 -3
  31. package/lib/commands/release/release-client.d.ts.map +0 -1
  32. package/lib/commands/release/release-client.js +0 -57
  33. package/lib/commands/release/release-client.js.map +0 -1
  34. package/lib/commands/release/release-eclipse-integration.d.ts +0 -18
  35. package/lib/commands/release/release-eclipse-integration.d.ts.map +0 -1
  36. package/lib/commands/release/release-eclipse-integration.js +0 -92
  37. package/lib/commands/release/release-eclipse-integration.js.map +0 -1
  38. package/lib/commands/release/release-java-server.d.ts +0 -3
  39. package/lib/commands/release/release-java-server.d.ts.map +0 -1
  40. package/lib/commands/release/release-java-server.js +0 -70
  41. package/lib/commands/release/release-java-server.js.map +0 -1
  42. package/lib/commands/release/release-server-node.d.ts +0 -18
  43. package/lib/commands/release/release-server-node.d.ts.map +0 -1
  44. package/lib/commands/release/release-server-node.js +0 -53
  45. package/lib/commands/release/release-server-node.js.map +0 -1
  46. package/lib/commands/release/release-theia-integration.d.ts +0 -18
  47. package/lib/commands/release/release-theia-integration.d.ts.map +0 -1
  48. package/lib/commands/release/release-theia-integration.js +0 -53
  49. package/lib/commands/release/release-theia-integration.js.map +0 -1
  50. package/lib/commands/release/release-vscode-integration.d.ts +0 -18
  51. package/lib/commands/release/release-vscode-integration.d.ts.map +0 -1
  52. package/lib/commands/release/release-vscode-integration.js +0 -53
  53. package/lib/commands/release/release-vscode-integration.js.map +0 -1
  54. package/lib/commands/release/release.d.ts +0 -14
  55. package/lib/commands/release/release.d.ts.map +0 -1
  56. package/lib/commands/release/release.js +0 -191
  57. package/lib/commands/release/release.js.map +0 -1
  58. package/lib/commands/repo/clone.d.ts +0 -28
  59. package/lib/commands/repo/clone.d.ts.map +0 -1
  60. package/lib/commands/repo/clone.js +0 -113
  61. package/lib/commands/repo/clone.js.map +0 -1
  62. package/lib/commands/repo/clone.spec.d.ts +0 -17
  63. package/lib/commands/repo/clone.spec.d.ts.map +0 -1
  64. package/lib/commands/repo/clone.spec.js +0 -126
  65. package/lib/commands/repo/clone.spec.js.map +0 -1
  66. package/lib/commands/repo/common.d.ts +0 -23
  67. package/lib/commands/repo/common.d.ts.map +0 -1
  68. package/lib/commands/repo/common.js +0 -18
  69. package/lib/commands/repo/common.js.map +0 -1
  70. package/lib/commands/repo/config.d.ts +0 -18
  71. package/lib/commands/repo/config.d.ts.map +0 -1
  72. package/lib/commands/repo/config.js +0 -28
  73. package/lib/commands/repo/config.js.map +0 -1
  74. package/lib/commands/repo/repo.d.ts +0 -17
  75. package/lib/commands/repo/repo.d.ts.map +0 -1
  76. package/lib/commands/repo/repo.js +0 -25
  77. package/lib/commands/repo/repo.js.map +0 -1
  78. package/lib/commands/update-next.d.ts +0 -20
  79. package/lib/commands/update-next.d.ts.map +0 -1
  80. package/lib/commands/update-next.js +0 -146
  81. package/lib/commands/update-next.js.map +0 -1
  82. package/lib/common/glsp-component.d.ts +0 -27
  83. package/lib/common/glsp-component.d.ts.map +0 -1
  84. package/lib/common/glsp-component.js +0 -13
  85. package/lib/common/glsp-component.js.map +0 -1
  86. package/lib/common/glsp-repo.d.ts +0 -44
  87. package/lib/common/glsp-repo.d.ts.map +0 -1
  88. package/lib/common/glsp-repo.js +0 -135
  89. package/lib/common/glsp-repo.js.map +0 -1
  90. package/lib/common/glsp-repo.spec.d.ts +0 -17
  91. package/lib/common/glsp-repo.spec.d.ts.map +0 -1
  92. package/lib/common/glsp-repo.spec.js +0 -130
  93. package/lib/common/glsp-repo.spec.js.map +0 -1
  94. package/lib/foo.spec.d.ts +0 -17
  95. package/lib/foo.spec.d.ts.map +0 -1
  96. package/lib/foo.spec.js +0 -23
  97. package/lib/foo.spec.js.map +0 -1
  98. package/lib/index.d.ts +0 -18
  99. package/lib/index.d.ts.map +0 -1
  100. package/lib/index.js +0 -18
  101. package/lib/index.js.map +0 -1
  102. package/lib/util/command-util.d.ts +0 -26
  103. package/lib/util/command-util.d.ts.map +0 -1
  104. package/lib/util/command-util.js +0 -59
  105. package/lib/util/command-util.js.map +0 -1
  106. package/lib/util/git-util.d.ts +0 -42
  107. package/lib/util/git-util.d.ts.map +0 -1
  108. package/lib/util/git-util.js +0 -124
  109. package/lib/util/git-util.js.map +0 -1
  110. package/lib/util/logger.d.ts +0 -23
  111. package/lib/util/logger.d.ts.map +0 -1
  112. package/lib/util/logger.js +0 -50
  113. package/lib/util/logger.js.map +0 -1
  114. package/lib/util/test-util.spec.d.ts +0 -2
  115. package/lib/util/test-util.spec.d.ts.map +0 -1
  116. package/lib/util/test-util.spec.js +0 -44
  117. package/lib/util/test-util.spec.js.map +0 -1
  118. package/lib/util/validation-util.d.ts +0 -5
  119. package/lib/util/validation-util.d.ts.map +0 -1
  120. package/lib/util/validation-util.js +0 -85
  121. package/lib/util/validation-util.js.map +0 -1
  122. package/src/app.ts +0 -35
  123. package/src/commands/check-header.ts +0 -280
  124. package/src/commands/coverage-report.ts +0 -113
  125. package/src/commands/generate-index.ts +0 -169
  126. package/src/commands/release/common.ts +0 -306
  127. package/src/commands/release/release-client.ts +0 -55
  128. package/src/commands/release/release-eclipse-integration.ts +0 -113
  129. package/src/commands/release/release-java-server.ts +0 -73
  130. package/src/commands/release/release-server-node.ts +0 -61
  131. package/src/commands/release/release-theia-integration.ts +0 -65
  132. package/src/commands/release/release-vscode-integration.ts +0 -67
  133. package/src/commands/release/release.ts +0 -215
  134. package/src/commands/update-next.ts +0 -129
  135. package/src/util/command-util.ts +0 -54
  136. package/src/util/git-util.ts +0 -123
  137. package/src/util/logger.ts +0 -57
  138. package/src/util/validation-util.ts +0 -62
package/package.json CHANGED
@@ -1,11 +1,7 @@
1
1
  {
2
2
  "name": "@eclipse-glsp/cli",
3
- "version": "2.2.1",
3
+ "version": "2.3.0-next.17+e7783b7",
4
4
  "description": "CLI Tooling & scripts for GLSP components",
5
- "keywords": [
6
- "eclipse",
7
- "tsconfig"
8
- ],
9
5
  "homepage": "https://www.eclipse.org/glsp/",
10
6
  "bugs": "https://github.com/eclipse-glsp/glsp/issues",
11
7
  "repository": {
@@ -24,41 +20,38 @@
24
20
  }
25
21
  ],
26
22
  "bin": {
27
- "glsp": "bin/glsp"
23
+ "glsp": "dist/cli.js"
28
24
  },
29
25
  "files": [
30
- "src",
31
- "bin",
32
- "lib"
26
+ "dist"
33
27
  ],
34
28
  "scripts": {
35
- "build": "tsc -b",
36
- "clean": "rimraf lib tsconfig.tsbuildinfo",
29
+ "build": "yarn check-types && yarn bundle",
30
+ "build:prod": "yarn check-types && yarn bundle --production",
31
+ "bundle": "yarn clean:dist && node esbuild.js",
32
+ "check-types": "tsc",
33
+ "clean": "rimraf dist tsconfig.tsbuildinfo",
34
+ "clean:dist": "rimraf dist",
37
35
  "lint": "eslint --ext .ts,.tsx ./src",
38
36
  "lint:ci": "yarn lint -o eslint.xml -f checkstyle",
39
- "start": "node --enable-source-maps lib/app.js",
40
- "watch": "tsc -w"
41
- },
42
- "dependencies": {
43
- "commander": "^10.0.1",
44
- "glob": "^10.3.10",
45
- "globby": "13.2.2",
46
- "node-fetch": "^2.6.11",
47
- "node-jq": "^4.3.1",
48
- "readline-sync": "^1.4.10",
49
- "semver": "^7.5.1",
50
- "shelljs": "^0.8.5"
37
+ "start": "node dist/cli.js",
38
+ "watch": "node esbuild.js --watch",
39
+ "watch:tsc": "tsc --watch"
51
40
  },
52
41
  "devDependencies": {
53
- "@eclipse-glsp/config": "2.2.1",
42
+ "@eclipse-glsp/config": "2.3.0-next.17+e7783b7",
54
43
  "@types/glob": "^8.1.0",
55
- "@types/node-fetch": "^2.6.6",
56
- "@types/readline-sync": "^1.4.5",
57
- "@types/semver": "^7.5.3",
58
- "@types/shelljs": "^0.8.13"
44
+ "@types/readline-sync": "^1.4.8",
45
+ "@types/semver": "^7.7.1",
46
+ "commander": "^14.0.0",
47
+ "esbuild": "~0.25.9",
48
+ "glob": "^10.4.5",
49
+ "globby": "^14.1.0",
50
+ "readline-sync": "^1.4.10",
51
+ "semver": "^7.7.2"
59
52
  },
60
53
  "publishConfig": {
61
54
  "access": "public"
62
55
  },
63
- "gitHead": "e396f7fda21b56f33a20e8f207db3a6643669ae3"
56
+ "gitHead": "e7783b7358cafd9750db09d6c44a96404390c50a"
64
57
  }
package/bin/glsp DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- require('../lib/app');
package/lib/app.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare const COMMAND_VERSION = "1.1.0-next";
3
- //# sourceMappingURL=app.d.ts.map
package/lib/app.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";AAuBA,eAAO,MAAM,eAAe,eAAe,CAAC"}
package/lib/app.js DELETED
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.COMMAND_VERSION = 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 check_header_1 = require("./commands/check-header");
21
- const coverage_report_1 = require("./commands/coverage-report");
22
- const generate_index_1 = require("./commands/generate-index");
23
- const release_1 = require("./commands/release/release");
24
- const update_next_1 = require("./commands/update-next");
25
- const command_util_1 = require("./util/command-util");
26
- exports.COMMAND_VERSION = '1.1.0-next';
27
- const app = (0, command_util_1.baseCommand)() //
28
- .version(exports.COMMAND_VERSION)
29
- .name('glsp')
30
- .addCommand(coverage_report_1.CoverageReportCommand)
31
- .addCommand(release_1.ReleaseCommand)
32
- .addCommand(check_header_1.CheckHeaderCommand)
33
- .addCommand(update_next_1.UpdateNextCommand)
34
- .addCommand(generate_index_1.GenerateIndex);
35
- app.parse(process.argv);
36
- //# sourceMappingURL=app.js.map
package/lib/app.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;AACA;;;;;;;;;;;;;;kFAckF;AAClF,0DAA6D;AAC7D,gEAAmE;AACnE,8DAA0D;AAC1D,wDAA4D;AAC5D,wDAA2D;AAC3D,sDAAkD;AAErC,QAAA,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,GAAG,GAAG,IAAA,0BAAW,GAAE,CAAC,EAAE;KACvB,OAAO,CAAC,uBAAe,CAAC;KACxB,IAAI,CAAC,MAAM,CAAC;KACZ,UAAU,CAAC,uCAAqB,CAAC;KACjC,UAAU,CAAC,wBAAc,CAAC;KAC1B,UAAU,CAAC,iCAAkB,CAAC;KAC9B,UAAU,CAAC,+BAAiB,CAAC;KAC7B,UAAU,CAAC,8BAAa,CAAC,CAAC;AAE/B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- export interface HeaderCheckOptions {
2
- type: CheckType;
3
- exclude: string[];
4
- fileExtensions: string[];
5
- json: boolean;
6
- excludeDefaults: boolean;
7
- autoFix: boolean;
8
- }
9
- declare const checkTypes: readonly ["full", "changes", "lastCommit"];
10
- type CheckType = (typeof checkTypes)[number];
11
- export declare const CheckHeaderCommand: import("commander").Command;
12
- export declare function checkHeaders(rootDir: string, options: HeaderCheckOptions): void;
13
- export declare function handleValidationResults(rootDir: string, results: ValidationResult[], options: HeaderCheckOptions): void;
14
- interface ValidationResult {
15
- file: string;
16
- violation: Violation;
17
- line?: string;
18
- }
19
- type Violation = 'none' | 'noOrMissingHeader' | 'invalidEndYear' | 'noYear';
20
- export {};
21
- //# sourceMappingURL=check-header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-header.d.ts","sourceRoot":"","sources":["../../src/commands/check-header.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,4CAA6C,CAAC;AAC9D,KAAK,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAO7C,eAAO,MAAM,kBAAkB,6BA0BN,CAAC;AAE1B,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAgB/E;AAoGD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CA2BvH;AA8CD,UAAU,gBAAgB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD,KAAK,SAAS,GAAG,MAAM,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,QAAQ,CAAC"}
@@ -1,240 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.CheckHeaderCommand = void 0;
30
- exports.checkHeaders = checkHeaders;
31
- exports.handleValidationResults = handleValidationResults;
32
- /********************************************************************************
33
- * Copyright (c) 2022-2024 EclipseSource and others.
34
- *
35
- * This program and the accompanying materials are made available under the
36
- * terms of the Eclipse Public License v. 2.0 which is available at
37
- * http://www.eclipse.org/legal/epl-2.0.
38
- *
39
- * This Source Code may also be made available under the following Secondary
40
- * Licenses when the conditions for such availability set forth in the Eclipse
41
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
42
- * with the GNU Classpath Exception which is available at
43
- * https://www.gnu.org/software/classpath/license.html.
44
- *
45
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
46
- ********************************************************************************/
47
- /* eslint-disable max-len */
48
- const commander_1 = require("commander");
49
- const fs = __importStar(require("fs"));
50
- const glob_1 = require("glob");
51
- const minimatch = __importStar(require("minimatch"));
52
- const readline = __importStar(require("readline-sync"));
53
- const shelljs_1 = __importDefault(require("shelljs"));
54
- const command_util_1 = require("../util/command-util");
55
- const git_util_1 = require("../util/git-util");
56
- const path = __importStar(require("path"));
57
- const logger_1 = require("../util/logger");
58
- const validation_util_1 = require("../util/validation-util");
59
- const checkTypes = ['full', 'changes', 'lastCommit'];
60
- const DEFAULT_EXCLUDES = ['**/@(node_modules|lib|dist|bundle)/**'];
61
- const YEAR_RANGE_REGEX = /\d{4}/g;
62
- const HEADER_PATTERN = 'Copyright \\([cC]\\) \\d{4}';
63
- const AUTO_FIX_MESSAGE = 'Fix copyright header violations';
64
- exports.CheckHeaderCommand = (0, command_util_1.baseCommand)() //
65
- .name('checkHeaders')
66
- .description('Validates the copyright year range (end year) of license header files')
67
- .argument('<rootDir>', 'The starting directory for the check', validation_util_1.validateGitDirectory)
68
- .addOption(new commander_1.Option('-t, --type <type>', 'The scope of the check. In addition to a full recursive check, is also possible to only' +
69
- ' consider pending changes or the last commit')
70
- .choices(checkTypes)
71
- .default('full'))
72
- .option('-f, --fileExtensions <extensions...>', 'File extensions that should be checked', ['ts', 'tsx'])
73
- .addOption(new commander_1.Option('-e, --exclude <exclude...>', 'File patterns that should be excluded from the check. New exclude patterns are added to the default patterns').default([], `[${DEFAULT_EXCLUDES}]`))
74
- .option('--no-exclude-defaults', 'Disables the default excludes patterns. Only explicitly passed exclude patterns (-e, --exclude) are considered')
75
- .option('-j, --json', 'Also persist validation results as json file', false)
76
- .option('-a, --autoFix', 'Auto apply & commit fixes without prompting the user', false)
77
- .action(checkHeaders);
78
- function checkHeaders(rootDir, options) {
79
- (0, command_util_1.configureShell)({ silent: true, fatal: true });
80
- if (options.excludeDefaults) {
81
- options.exclude.push(...DEFAULT_EXCLUDES);
82
- }
83
- shelljs_1.default.cd(rootDir);
84
- const files = getFiles(rootDir, options);
85
- logger_1.LOGGER.info(`Check copy right headers of ${files.length} files`);
86
- if (files.length === 0) {
87
- logger_1.LOGGER.info('Check completed');
88
- return;
89
- }
90
- const results = validate(rootDir, files, options);
91
- handleValidationResults(rootDir, results, options);
92
- }
93
- function getFiles(rootDir, options) {
94
- const includePattern = `**/*.@(${options.fileExtensions.join('|')})`;
95
- const excludePattern = options.exclude;
96
- if (options.type === 'full') {
97
- return glob_1.glob.sync(includePattern, {
98
- cwd: rootDir,
99
- ignore: excludePattern
100
- });
101
- }
102
- let changedFiles = options.type === 'changes' ? (0, git_util_1.getUncommittedChanges)(rootDir) : (0, git_util_1.getChangesOfLastCommit)(rootDir);
103
- changedFiles = changedFiles.filter(minimatch.filter(includePattern));
104
- excludePattern.forEach(pattern => {
105
- changedFiles = changedFiles.filter(minimatch.filter(`!${pattern}`));
106
- });
107
- return changedFiles.filter(file => fs.existsSync(file));
108
- }
109
- function validate(rootDir, files, options) {
110
- var _a;
111
- // Derives all files with valid headers and all files with no or invalid headers
112
- const filesWithHeader = shelljs_1.default.grep('-l', HEADER_PATTERN, files).stdout.trim().split('\n');
113
- const noHeaders = files.filter(file => !filesWithHeader.includes(file));
114
- const results = [];
115
- const allFilesLength = files.length;
116
- // Create validation results for all files with no or invalid headers
117
- const noHeadersLength = noHeaders.length;
118
- if (noHeadersLength > 0) {
119
- logger_1.LOGGER.info(`Found ${noHeadersLength} files with no (or an invalid) copyright header`);
120
- }
121
- noHeaders.forEach((file, i) => {
122
- printFileProgress(i + 1, allFilesLength, `Validating ${file}`);
123
- results.push({ file: path.resolve(rootDir, file), violation: 'noOrMissingHeader' });
124
- });
125
- // Performance optimization: avoid retrieving the dates for each individual file by precalculating the endYear if possible.
126
- let defaultEndYear;
127
- if (options.type === 'changes') {
128
- defaultEndYear = new Date().getFullYear();
129
- }
130
- else if (options.type === 'lastCommit') {
131
- defaultEndYear = (_a = (0, git_util_1.getLastModificationDate)(undefined, rootDir)) === null || _a === void 0 ? void 0 : _a.getFullYear();
132
- }
133
- // Create validation results for all files with valid headers
134
- filesWithHeader.forEach((file, i) => {
135
- printFileProgress(i + 1 + noHeadersLength, allFilesLength, `Validating ${file}`);
136
- const copyrightLine = shelljs_1.default.head({ '-n': 2 }, file).stdout.trim().split('\n')[1];
137
- const copyRightYears = copyrightLine.match(YEAR_RANGE_REGEX);
138
- if (!copyRightYears) {
139
- const result = { file, violation: 'noYear', line: copyrightLine };
140
- results.push(result);
141
- }
142
- else {
143
- const currentStartYear = Number.parseInt(copyRightYears[0], 10);
144
- const currentEndYear = copyRightYears[1] ? Number.parseInt(copyRightYears[1], 10) : undefined;
145
- const result = {
146
- currentStartYear,
147
- currentEndYear,
148
- expectedEndYear: defaultEndYear !== null && defaultEndYear !== void 0 ? defaultEndYear : (0, git_util_1.getLastModificationDate)(file, rootDir, AUTO_FIX_MESSAGE).getFullYear(),
149
- file,
150
- violation: 'none'
151
- };
152
- validateEndYear(result);
153
- results.push(result);
154
- }
155
- });
156
- results.sort((a, b) => a.file.localeCompare(b.file));
157
- process.stdout.clearLine(0);
158
- return results;
159
- }
160
- function validateEndYear(result) {
161
- const { currentStartYear, expectedEndYear, currentEndYear } = result;
162
- result.violation = 'invalidEndYear';
163
- const valid = currentEndYear ? currentEndYear === expectedEndYear : currentStartYear === expectedEndYear;
164
- if (valid) {
165
- result.violation = 'none';
166
- return;
167
- }
168
- }
169
- function printFileProgress(currentFileCount, maxFileCount, message, clear = true) {
170
- if (clear) {
171
- process.stdout.clearLine(0);
172
- process.stdout.cursorTo(0);
173
- }
174
- process.stdout.write(`[${currentFileCount} of ${maxFileCount}] ${message}`);
175
- if (!clear) {
176
- process.stdout.write('\n');
177
- }
178
- }
179
- function handleValidationResults(rootDir, results, options) {
180
- logger_1.LOGGER.newLine();
181
- logger_1.LOGGER.info(`Header validation for ${results.length} files completed`);
182
- const violations = results.filter(result => result.violation !== 'none');
183
- // Adjust results to print based on configured severity level
184
- const toPrint = violations;
185
- logger_1.LOGGER.info(`Found ${toPrint.length} copyright header violations:`);
186
- logger_1.LOGGER.newLine();
187
- toPrint.forEach((result, i) => logger_1.LOGGER.info(`${i + 1}. `, result.file, ':', toPrintMessage(result)));
188
- logger_1.LOGGER.newLine();
189
- if (options.json) {
190
- fs.writeFileSync(path.join(rootDir, 'headerCheck.json'), JSON.stringify(results, undefined, 2));
191
- }
192
- if (violations.length > 0 &&
193
- (options.autoFix || readline.keyInYN('Do you want to automatically fix copyright year range violations?'))) {
194
- const toFix = violations.filter(violation => isDateValidationResult(violation));
195
- fixViolations(rootDir, toFix, options);
196
- }
197
- logger_1.LOGGER.info('Check completed');
198
- }
199
- function toPrintMessage(result) {
200
- const error = '\x1b[31m';
201
- const info = '\x1b[32m';
202
- if (isDateValidationResult(result) && result.violation === 'invalidEndYear') {
203
- const expected = result.expectedEndYear.toString();
204
- const actual = result.currentEndYear
205
- ? `${result.currentEndYear} (${result.currentStartYear}-${result.currentEndYear})`
206
- : result.currentStartYear.toString();
207
- const message = 'Invalid copyright end year';
208
- return `${error} ${message}! Expected end year '${expected}' but is '${actual}'`;
209
- }
210
- else if (result.violation === 'noOrMissingHeader') {
211
- return `${error} No or invalid copyright header!`;
212
- }
213
- else if (result.violation === 'noYear') {
214
- return `${error} No year found!${result.line ? ' (line: ' + result.line + ')' : ''}`;
215
- }
216
- return `${info} OK`;
217
- }
218
- function fixViolations(rootDir, violations, options) {
219
- logger_1.LOGGER.newLine();
220
- violations.forEach((violation, i) => {
221
- printFileProgress(i + 1, violations.length, `Fix ${violation.file}`, false);
222
- const currentRange = `${violation.currentStartYear}${violation.currentEndYear ? '-' + violation.currentEndYear : ''}`;
223
- const fixedRange = violation.currentEndYear || violation.currentStartYear < violation.expectedEndYear
224
- ? `${violation.currentStartYear}-${violation.expectedEndYear}`
225
- : `${violation.expectedEndYear}`;
226
- shelljs_1.default.sed('-i', RegExp('Copyright \\([cC]\\) ' + currentRange), `Copyright (c) ${fixedRange}`, violation.file);
227
- });
228
- logger_1.LOGGER.newLine();
229
- if (options.autoFix || readline.keyInYN('Do you want to create a commit for the fixed files?')) {
230
- logger_1.LOGGER.newLine();
231
- const files = violations.map(violation => violation.file).join(' ');
232
- shelljs_1.default.exec(`git add ${files}`, (0, command_util_1.getShellConfig)());
233
- shelljs_1.default.exec(`git commit -m "${AUTO_FIX_MESSAGE}"`);
234
- logger_1.LOGGER.newLine();
235
- }
236
- }
237
- function isDateValidationResult(object) {
238
- return 'currentStartYear' in object && 'expectedEndYear' in object;
239
- }
240
- //# sourceMappingURL=check-header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-header.js","sourceRoot":"","sources":["../../src/commands/check-header.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,oCAgBC;AAoGD,0DA2BC;AAzND;;;;;;;;;;;;;;kFAckF;AAClF,4BAA4B;AAC5B,yCAAmC;AACnC,uCAAyB;AACzB,+BAA4B;AAC5B,qDAAuC;AACvC,wDAA0C;AAC1C,sDAAyB;AACzB,uDAAmF;AACnF,+CAA0G;AAE1G,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AC;AAeD,SAAS,sBAAsB,CAAC,MAAwB;IACpD,OAAO,kBAAkB,IAAI,MAAM,IAAI,iBAAiB,IAAI,MAAM,CAAC;AACvE,CAAC"}
@@ -1,27 +0,0 @@
1
- import { GlspComponent } from '../common/glsp-component';
2
- export interface CheckoutOptions {
3
- }
4
- export interface ComponentConfig {
5
- repo?: string;
6
- directory?: string;
7
- }
8
- export declare const LinkType: {
9
- readonly NONE: "none";
10
- readonly YARN_LINK: "yarnLink";
11
- readonly RESOLUTIONS: "resolutions";
12
- };
13
- export type LinkType = (typeof LinkType)[keyof Omit<typeof LinkType, 'parse'>];
14
- export interface SetupConfig extends Partial<SetupCmdOptions> {
15
- config: Record<GlspComponent, ComponentConfig>;
16
- }
17
- export interface SetupCmdOptions {
18
- config: Record<GlspComponent, ComponentConfig>;
19
- baseDir: string;
20
- force: boolean;
21
- linkType: LinkType;
22
- build: boolean;
23
- verbose: boolean;
24
- }
25
- export declare const SetupCommand: import("commander").Command;
26
- export declare function setupComponents(options: SetupCmdOptions): void;
27
- //# sourceMappingURL=checkout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,MAAM,WAAW,eAAe;CAAG;AAEnC,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/E,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,eAAe,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,6BASG,CAAC;AAE7B,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAE9D"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SetupCommand = exports.LinkType = void 0;
4
- exports.setupComponents = setupComponents;
5
- /********************************************************************************
6
- * Copyright (c) 2024 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 command_util_1 = require("../util/command-util");
22
- const validation_util_1 = require("../util/validation-util");
23
- exports.LinkType = {
24
- NONE: 'none',
25
- YARN_LINK: 'yarnLink',
26
- RESOLUTIONS: 'resolutions'
27
- };
28
- exports.SetupCommand = (0, command_util_1.baseCommand)() //
29
- .name('setup')
30
- .description('Setup GLSP components (repositories)')
31
- .option('-d, --baseDir <baseDir>', 'The base directory to setup the components in', validation_util_1.validateDirectory, process.cwd())
32
- .option('-c, --config', 'Name of the built-in configuration or path to the setup configuration file')
33
- .option('-f, --force', 'Enable force mode', false)
34
- .addOption(new commander_1.Option('-l, --linkType <linkType>', 'The link type to use').default(exports.LinkType.NONE).choices(Object.values(exports.LinkType)))
35
- .option('-b, --build', 'Build the components after setup', true)
36
- .option('-v, --verbose', 'Enable verbose mode', false)
37
- .action(setupComponents);
38
- function setupComponents(options) {
39
- console.log('Setting up components...', options);
40
- }
41
- //# sourceMappingURL=checkout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":";;;AA0DA,0CAEC;AA5DD;;;;;;;;;;;;;;kFAckF;AAClF,yCAAmC;AAEnC,uDAAmD;AACnD,6DAA4D;AAS/C,QAAA,QAAQ,GAAG;IACpB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,UAAU;IACrB,WAAW,EAAE,aAAa;CACpB,CAAC;AAgBE,QAAA,YAAY,GAAG,IAAA,0BAAW,GAAE,CAAC,EAAE;KACvC,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,yBAAyB,EAAE,+CAA+C,EAAE,mCAAiB,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;KACpH,MAAM,CAAC,cAAc,EAAE,4EAA4E,CAAC;KACpG,MAAM,CAAC,aAAa,EAAE,mBAAmB,EAAE,KAAK,CAAC;KACjD,SAAS,CAAC,IAAI,kBAAM,CAAC,2BAA2B,EAAE,sBAAsB,CAAC,CAAC,OAAO,CAAC,gBAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAQ,CAAC,CAAC,CAAC;KAClI,MAAM,CAAC,aAAa,EAAE,kCAAkC,EAAE,IAAI,CAAC;KAC/D,MAAM,CAAC,eAAe,EAAE,qBAAqB,EAAE,KAAK,CAAC;KACrD,MAAM,CAAC,eAAe,CAAC,CAAC;AAE7B,SAAgB,eAAe,CAAC,OAAwB;IACpD,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC"}
@@ -1,29 +0,0 @@
1
- /********************************************************************************
2
- * Copyright (c) 2022-2024 EclipseSource and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
- export interface CoverageCmdOptions {
17
- coverageScript: string;
18
- projectRoot: string;
19
- }
20
- export declare const CoverageReportCommand: import("commander").Command;
21
- /**
22
- * Generates and aggregates an 'nyc' coverage report for lerna/yarn mono repositories.
23
- * First, individual reports for each package are generated. Then, they are aggregated into one combined HTML report.
24
- * @param options configuration options
25
- */
26
- export declare function generateCoverageReport(options: CoverageCmdOptions): void;
27
- export declare function validateAndRetrievePackages(options: CoverageCmdOptions): string[];
28
- export declare function collectPackageReportFiles(packages: string[], options: CoverageCmdOptions): string[];
29
- //# sourceMappingURL=coverage-report.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverage-report.d.ts","sourceRoot":"","sources":["../../src/commands/coverage-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AASlF,MAAM,WAAW,kBAAkB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,qBAAqB,6BAKC,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAOxE;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAoBjF;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAWnG"}