@eclipse-glsp/cli 2.6.0 → 2.7.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -26
- package/dist/cli.js +1 -81
- package/dist/cli.js.map +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -141,7 +141,6 @@ Commands:
|
|
|
141
141
|
version [options] <versionType> [customVersion] Set the version of all packages in a GLSP repository
|
|
142
142
|
prepare [options] <versionType> [customVersion] Prepare a new release for a GLSP component (version bump, changelog, PR
|
|
143
143
|
creation ...)
|
|
144
|
-
publish [options] Publish a new release for a GLSP component (npm, maven, github ...)
|
|
145
144
|
help [command] display help for command
|
|
146
145
|
```
|
|
147
146
|
|
|
@@ -199,31 +198,6 @@ Options:
|
|
|
199
198
|
-h, --help display help for command
|
|
200
199
|
```
|
|
201
200
|
|
|
202
|
-
### publish
|
|
203
|
-
|
|
204
|
-
Helper command for publishing a new GLSP release.
|
|
205
|
-
This command should be used on the main branch of GLSP repo after a (previously prepared) Release PR has been merged.
|
|
206
|
-
Creates & publishes an new tag and Github release.
|
|
207
|
-
In addition, for all non-Java repositories the release version will be published to npm.
|
|
208
|
-
|
|
209
|
-
The glsp repository type ("glsp-client", "glsp-server-node" etc.) is auto detected from the given repository path.
|
|
210
|
-
If the command is invoked in a non-GLSP repository it will fail.
|
|
211
|
-
|
|
212
|
-
```console
|
|
213
|
-
$ glsp releng publish -h\
|
|
214
|
-
Usage: glsp releng publish [options]
|
|
215
|
-
|
|
216
|
-
Publish a new release for a GLSP component (npm, maven, github ...)
|
|
217
|
-
|
|
218
|
-
Options:
|
|
219
|
-
-v, --verbose Enable verbose (debug) log output (default: false)
|
|
220
|
-
-r, --repoDir <repoDir> Path to the component repository (default:
|
|
221
|
-
"<cwd>")
|
|
222
|
-
--no-npm Skip npm publishing
|
|
223
|
-
-d, --draft Create a draft GitHub release (default: false)
|
|
224
|
-
-h, --help display help for command
|
|
225
|
-
```
|
|
226
|
-
|
|
227
201
|
## More information
|
|
228
202
|
|
|
229
203
|
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/).
|
package/dist/cli.js
CHANGED
|
@@ -20749,9 +20749,6 @@ function commitChanges(message, path13) {
|
|
|
20749
20749
|
function getChangesOfLastCommit(path13) {
|
|
20750
20750
|
return exec("git diff --name-only HEAD^", { cwd: path13 }).split("\n").map((file) => (0, import_path.resolve)(path13 ?? process.cwd(), file));
|
|
20751
20751
|
}
|
|
20752
|
-
function getLastCommitMessage(path13) {
|
|
20753
|
-
return exec("git log -1 --pretty=%B", { cwd: path13 }).trim();
|
|
20754
|
-
}
|
|
20755
20752
|
function getLastModificationDate(filePath, repoRoot, excludeMessage) {
|
|
20756
20753
|
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : "";
|
|
20757
20754
|
try {
|
|
@@ -21766,85 +21763,8 @@ Note: This pull request was created automatically. After merging, the automated
|
|
|
21766
21763
|
}
|
|
21767
21764
|
}
|
|
21768
21765
|
|
|
21769
|
-
// src/commands/releng/publish.ts
|
|
21770
|
-
var PublishCommand = baseCommand().name("publish").description("Publish a new release for a GLSP component (npm, maven, github ...)").option("-v, --verbose", "Enable verbose (debug) log output", false).option("-r, --repoDir <repoDir>", "Path to the component repository", validateGitDirectory, process.cwd()).option("--no-npm", "Skip npm publishing", true).option("-d, --draft", "Create a draft GitHub release", false).action((options) => {
|
|
21771
|
-
configureEnv(options);
|
|
21772
|
-
const repo = GLSPRepo.deriveFromDirectory(options.repoDir);
|
|
21773
|
-
if (!repo) {
|
|
21774
|
-
throw new Error(`Cannot derive GLSP repository from directory ${options.repoDir}`);
|
|
21775
|
-
}
|
|
21776
|
-
const version2 = getLocalVersion(options.repoDir, repo);
|
|
21777
|
-
publish({ ...options, repo, version: version2 });
|
|
21778
|
-
});
|
|
21779
|
-
async function publish(options) {
|
|
21780
|
-
cd(options.repoDir);
|
|
21781
|
-
LOGGER.info("Publish new release for repository", options.repo);
|
|
21782
|
-
LOGGER.debug("Options:", options);
|
|
21783
|
-
validateCurrentState(options);
|
|
21784
|
-
createTag(options);
|
|
21785
|
-
publishGHRelease(options);
|
|
21786
|
-
await publishNpm(options);
|
|
21787
|
-
LOGGER.info("Release process completed successfully.");
|
|
21788
|
-
}
|
|
21789
|
-
function validateCurrentState(options) {
|
|
21790
|
-
LOGGER.info("Validate if repository is in a release state ...");
|
|
21791
|
-
LOGGER.debug(`Validate local repository version: ${options.repoDir}`);
|
|
21792
|
-
const version2 = options.version;
|
|
21793
|
-
checkGHCli();
|
|
21794
|
-
if (version2.includes("-")) {
|
|
21795
|
-
throw new Error(`Cannot publish non-release version: ${version2}`);
|
|
21796
|
-
}
|
|
21797
|
-
LOGGER.debug("Validate last commit message");
|
|
21798
|
-
const lastCommitMessage = getLastCommitMessage(options.repoDir);
|
|
21799
|
-
if (!lastCommitMessage.includes(`v${version2}`)) {
|
|
21800
|
-
throw new Error(`Last commit message is not the correct release message: ${lastCommitMessage}`);
|
|
21801
|
-
}
|
|
21802
|
-
LOGGER.debug("Validate changelog");
|
|
21803
|
-
const changelog = readFile("CHANGELOG.md");
|
|
21804
|
-
if (!changelog.includes("## [v2.5.0")) {
|
|
21805
|
-
throw new Error(`CHANGELOG.md does not contain an entry for version ${version2}`);
|
|
21806
|
-
}
|
|
21807
|
-
LOGGER.debug("Ensure that we are logged in to npm");
|
|
21808
|
-
if (options.npm) {
|
|
21809
|
-
exec("npm whoami", { silent: true, errorMsg: 'Not logged in to npm! Please run "npm login"' });
|
|
21810
|
-
}
|
|
21811
|
-
LOGGER.info("Validation successful. Repository is in a releasable state.");
|
|
21812
|
-
}
|
|
21813
|
-
function createTag(options) {
|
|
21814
|
-
LOGGER.info("Create git tag ...");
|
|
21815
|
-
const version2 = options.version;
|
|
21816
|
-
exec(`git tag -a v${version2} -m "Release v${version2}"`, { errorMsg: "Failed to create git tag" });
|
|
21817
|
-
exec("git push origin tag v${version}", { errorMsg: "Failed to push tag to origin" });
|
|
21818
|
-
LOGGER.info(`Created and pushed git tag v${version2}`);
|
|
21819
|
-
}
|
|
21820
|
-
function publishGHRelease(options) {
|
|
21821
|
-
LOGGER.info("Publish GitHub release ...");
|
|
21822
|
-
const changeLog = getChangeLogChanges(options);
|
|
21823
|
-
const draft = options.draft ? "--draft" : "";
|
|
21824
|
-
exec(
|
|
21825
|
-
`gh release create v${options.version} ${draft} --title "v${options.version}" --notes "${changeLog.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`,
|
|
21826
|
-
{
|
|
21827
|
-
errorMsg: "Failed to create GitHub release"
|
|
21828
|
-
}
|
|
21829
|
-
);
|
|
21830
|
-
LOGGER.info(`Created GitHub release v${options.version}`);
|
|
21831
|
-
}
|
|
21832
|
-
async function publishNpm(options) {
|
|
21833
|
-
if (!options.npm) {
|
|
21834
|
-
LOGGER.info("Skipping npm publish");
|
|
21835
|
-
return;
|
|
21836
|
-
}
|
|
21837
|
-
if (!GLSPRepo.isNpmRepo(options.repo)) {
|
|
21838
|
-
LOGGER.info(`Skipping npm publish for repository ${options.repo}`);
|
|
21839
|
-
return;
|
|
21840
|
-
}
|
|
21841
|
-
LOGGER.info("Publish new npm version ...");
|
|
21842
|
-
await execAsync("lerna publish from-package --no-git-reset -y", { errorMsg: "Failed to publish new npm version" });
|
|
21843
|
-
LOGGER.info(`Published new npm version ${options.version}`);
|
|
21844
|
-
}
|
|
21845
|
-
|
|
21846
21766
|
// src/commands/releng/releng.ts
|
|
21847
|
-
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand)
|
|
21767
|
+
var RelengCommand = baseCommand().name("releng").description("Commands for GLSP release engineering (Linux only, intended for CI/Maintainer use).").addCommand(VersionCommand).addCommand(PrepareReleaseCommand);
|
|
21848
21768
|
|
|
21849
21769
|
// src/commands/update-next.ts
|
|
21850
21770
|
var path12 = __toESM(require("path"));
|