New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-glsp/cli

Package Overview
Dependencies
Maintainers
6
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-glsp/cli - npm Package Compare versions

Comparing version 1.1.0-next.e31f2e5.119 to 1.1.0-next.ffcc7ce.140

lib/commands/check-header.d.ts

4

lib/app.js

@@ -20,2 +20,3 @@ #!/usr/bin/env node

********************************************************************************/
const check_header_1 = require("./commands/check-header");
const coverage_report_1 = require("./commands/coverage-report");

@@ -28,5 +29,6 @@ const release_1 = require("./commands/release/release");

.name('glsp')
.addCommand(coverage_report_1.CoverageReportCommand)
.addCommand(release_1.ReleaseCommand)
.addCommand(coverage_report_1.CoverageReportCommand);
.addCommand(check_header_1.CheckHeaderCommand);
app.parse(process.argv);
//# sourceMappingURL=app.js.map

@@ -17,7 +17,30 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.collectPackageReportFiles = exports.validateAndRetrievePackages = exports.generateCoverageReport = exports.CoverageReportCommand = void 0;
const fs = require("fs");
const path = require("path");
const sh = require("shelljs");
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const sh = __importStar(require("shelljs"));
const command_util_1 = require("../util/command-util");

@@ -24,0 +47,0 @@ const logger_1 = require("../util/logger");

@@ -64,3 +64,3 @@ /********************************************************************************

export declare function asMvnVersion(version: string): string;
export declare function checkIfNpmVersionExists(pckgName: string, newVersion: string): Promise<void>;
export declare function checkIfNpmVersionIsNew(pckgName: string, newVersion: string): Promise<void>;
export declare function checkIfMavenVersionExists(groupId: string, artifactId: string, newVersion: string): void;

@@ -67,0 +67,0 @@ export declare function isExistingMavenVersion(groupId: string, artifactId: string, version: string): boolean;

@@ -17,10 +17,36 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
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;
const fs = require("fs");
const node_fetch_1 = require("node-fetch");
exports.updateLernaForDryRun = exports.checkJavaServerVersion = exports.isExistingMavenVersion = exports.checkIfMavenVersionExists = exports.checkIfNpmVersionIsNew = 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;
const fs = __importStar(require("fs"));
const node_fetch_1 = __importDefault(require("node-fetch"));
const path_1 = require("path");
const readline = require("readline-sync");
const semver = require("semver");
const sh = require("shelljs");
const readline = __importStar(require("readline-sync"));
const semver = __importStar(require("semver"));
const sh = __importStar(require("shelljs"));
const command_util_1 = require("../../util/command-util");

@@ -91,7 +117,7 @@ const git_util_1 = require("../../util/git-util");

Component.is = is;
})(Component = exports.Component || (exports.Component = {}));
})(Component || (exports.Component = Component = {}));
var ReleaseType;
(function (ReleaseType) {
ReleaseType.CLI_CHOICES = ['major', 'minor', 'patch', 'rc', 'custom'];
})(ReleaseType = exports.ReleaseType || (exports.ReleaseType = {}));
})(ReleaseType || (exports.ReleaseType = ReleaseType = {}));
function checkoutAndCd(options) {

@@ -116,4 +142,4 @@ const ghUrl = options.component.githubRepo;

sh.cd(directory);
if (options.checkoutDir !== 'master') {
sh.exec(`git switch ${options.branch} `);
if (options.branch !== 'master' && options.branch !== 'main') {
sh.exec(`git checkout ${options.branch} `);
}

@@ -152,3 +178,3 @@ return sh.pwd();

}
const latestReleaseTag = (0, git_util_1.getLatestRelease)();
const latestReleaseTag = (0, git_util_1.getLatestGithubRelease)();
const localTag = (0, git_util_1.getLatestTag)();

@@ -164,3 +190,3 @@ validateTag(latestReleaseTag, localTag);

const version = tagToVersion(tag);
const titleSuffix = preRelease ? ` Candiate ${version.substring(version.length - 1)}` : '';
const titleSuffix = preRelease ? ` Candidate ${version.substring(version.lastIndexOf('-RC') + 3)}` : '';
const title = `${version.replace(/-.*/, '')} Release${titleSuffix} `;

@@ -228,4 +254,4 @@ sh.exec(`gh release create ${tag} -t "${title}" --notes-start-tag ${latestRelease} --generate-notes ${draft ? '-d' : ''} ${preRelease ? '-p' : ''}`, (0, command_util_1.getShellConfig)());

exports.asMvnVersion = asMvnVersion;
async function checkIfNpmVersionExists(pckgName, newVersion) {
logger_1.LOGGER.debug(`Check if version exists on npm: ${newVersion}`);
async function checkIfNpmVersionIsNew(pckgName, newVersion) {
logger_1.LOGGER.debug(`Check that the release version is new i.e. does not exist on npm: ${newVersion}`);
const response = await (0, node_fetch_1.default)(`https://registry.npmjs.org/${pckgName}/${newVersion}`);

@@ -239,3 +265,3 @@ const data = await response.json();

}
exports.checkIfNpmVersionExists = checkIfNpmVersionExists;
exports.checkIfNpmVersionIsNew = checkIfNpmVersionIsNew;
function checkIfMavenVersionExists(groupId, artifactId, newVersion) {

@@ -242,0 +268,0 @@ logger_1.LOGGER.debug('Check if maven version exists');

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -19,3 +42,3 @@ exports.releaseClient = void 0;

********************************************************************************/
const sh = require("shelljs");
const sh = __importStar(require("shelljs"));
const logger_1 = require("../../util/logger");

@@ -28,3 +51,3 @@ const common_1 = require("./common");

REPO_ROOT = (0, common_1.checkoutAndCd)(options);
await updateDownloadServerScript(options.version, options.force);
updateExternalGLSPDependencies(options.version);
generateChangeLog();

@@ -40,8 +63,6 @@ (0, common_1.lernaSetVersion)(REPO_ROOT, options.version);

exports.releaseClient = releaseClient;
async function updateDownloadServerScript(version, force) {
logger_1.LOGGER.info('Update example server download config');
const mvnVersion = (0, common_1.asMvnVersion)(version);
(0, common_1.checkJavaServerVersion)(version, force);
sh.cd(`${REPO_ROOT}/examples/workflow-glsp/scripts`);
(0, common_1.updateServerConfig)('config.json', mvnVersion, false);
function updateExternalGLSPDependencies(version) {
logger_1.LOGGER.info('Update external GLSP dependencies (workflow example server)');
sh.cd(REPO_ROOT);
(0, common_1.updateVersion)({ name: '@eclipse-glsp-examples/workflow-server-bundled', version });
}

@@ -48,0 +69,0 @@ function generateChangeLog() {

@@ -17,5 +17,28 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.releaseEclipseIntegration = void 0;
const sh = require("shelljs");
const sh = __importStar(require("shelljs"));
const command_util_1 = require("../../util/command-util");

@@ -22,0 +45,0 @@ const logger_1 = require("../../util/logger");

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -19,3 +42,3 @@ exports.releaseJavaServer = void 0;

********************************************************************************/
const sh = require("shelljs");
const sh = __importStar(require("shelljs"));
const command_util_1 = require("../../util/command-util");

@@ -65,3 +88,3 @@ const logger_1 = require("../../util/logger");

(0, command_util_1.fatalExec)('mvn clean install -Pm2', 'M2 build failed', (0, command_util_1.getShellConfig)({ silent: false }));
console.log('');
logger_1.LOGGER.newLine();
logger_1.LOGGER.debug('P2');

@@ -68,0 +91,0 @@ (0, command_util_1.fatalExec)('mvn clean install -Pp2', 'P2 build failed', (0, command_util_1.getShellConfig)({ silent: false }));

@@ -17,5 +17,28 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.releaseServerNode = void 0;
const sh = require("shelljs");
const sh = __importStar(require("shelljs"));
const logger_1 = require("../../util/logger");

@@ -22,0 +45,0 @@ const common_1 = require("./common");

@@ -17,5 +17,28 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.releaseTheiaIntegration = void 0;
const sh = require("shelljs");
const sh = __importStar(require("shelljs"));
const logger_1 = require("../../util/logger");

@@ -29,3 +52,2 @@ const common_1 = require("./common");

updateExternalGLSPDependencies(options.version);
await updateDownloadServerScript(options.version);
generateChangeLog();

@@ -42,16 +64,6 @@ (0, common_1.lernaSetVersion)(REPO_ROOT, options.version);

function updateExternalGLSPDependencies(version) {
logger_1.LOGGER.info('Update external GLSP dependencies (Client and workflow example)');
logger_1.LOGGER.info('Update external GLSP dependencies (Client and workflow example & server)');
sh.cd(REPO_ROOT);
(0, common_1.updateVersion)({ name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version });
(0, common_1.updateVersion)({ name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version }, { name: '@eclipse-glsp-examples/workflow-server', version });
}
async function updateDownloadServerScript(version) {
logger_1.LOGGER.info('Update example server download config');
const mvnVersion = (0, common_1.asMvnVersion)(version);
if (!(0, common_1.isExistingMavenVersion)('org.eclipse.glsp', 'org.eclipse.glsp.server', mvnVersion)) {
logger_1.LOGGER.warn(`No Java GLSP server with version ${mvnVersion} found on maven central!. Please release a new Java GLSP Server version
before publishing this release!`);
}
sh.cd(`${REPO_ROOT}/examples/workflow-theia/src/node`);
(0, common_1.updateServerConfig)('server-config.json', mvnVersion, false);
}
function build() {

@@ -58,0 +70,0 @@ logger_1.LOGGER.info('Install & Build with yarn');

@@ -17,5 +17,28 @@ "use strict";

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.releaseVscodeIntegration = void 0;
const sh = require("shelljs");
const sh = __importStar(require("shelljs"));
const logger_1 = require("../../util/logger");

@@ -42,3 +65,3 @@ const common_1 = require("./common");

sh.cd(REPO_ROOT);
(0, common_1.updateVersion)({ name: '@eclipse-glsp/protocol', version }, { name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version });
(0, common_1.updateVersion)({ name: '@eclipse-glsp/protocol', version }, { name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version }, { name: '@eclipse-glsp-examples/workflow-server', version });
}

@@ -45,0 +68,0 @@ function build() {

@@ -1,4 +0,3 @@

import { BaseCmdOptions } from '../../util/command-util';
import { Component, ReleaseType } from './common';
interface ReleaseCmdOptions extends BaseCmdOptions {
interface ReleaseCmdOptions {
checkoutDir: string;

@@ -10,2 +9,3 @@ branch: string;

draft: boolean;
verbose: boolean;
}

@@ -12,0 +12,0 @@ export declare const ReleaseCommand: import("commander").Command;

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -7,7 +30,6 @@ exports.release = exports.ReleaseCommand = void 0;

const readline_1 = require("readline");
const readline = require("readline-sync");
const semver = require("semver");
const sh = require("shelljs");
const readline = __importStar(require("readline-sync"));
const semver = __importStar(require("semver"));
const sh = __importStar(require("shelljs"));
const command_util_1 = require("../../util/command-util");
const git_util_1 = require("../../util/git-util");
const logger_1 = require("../../util/logger");

@@ -40,3 +62,4 @@ const validation_util_1 = require("../../util/validation-util");

logger_1.LOGGER.debug('Cli options:', cliOptions);
(0, command_util_1.initialConfiguration)(cliOptions.verbose);
(0, command_util_1.configureShell)({ silent: !cliOptions.verbose });
(0, logger_1.configureLogger)(cliOptions.verbose);
checkGHCli();

@@ -53,15 +76,15 @@ const version = deriveVersion(releaseType, customVersion);

case 'server-node':
await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/server-node', version);
await (0, common_1.checkIfNpmVersionIsNew)('@eclipse-glsp/server-node', version);
return (0, release_server_node_1.releaseServerNode)(options);
case 'client':
await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/client', version);
await (0, common_1.checkIfNpmVersionIsNew)('@eclipse-glsp/client', version);
return (0, release_client_1.releaseClient)(options);
case 'theia-integration':
await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/theia-integration', version);
await (0, common_1.checkIfNpmVersionIsNew)('@eclipse-glsp/theia-integration', version);
return (0, release_theia_integration_1.releaseTheiaIntegration)(options);
case 'vscode-integration':
await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/vscode-integration', version);
await (0, common_1.checkIfNpmVersionIsNew)('@eclipse-glsp/vscode-integration', version);
return (0, release_vscode_integration_1.releaseVscodeIntegration)(options);
case 'eclipse-integration':
await (0, common_1.checkIfNpmVersionExists)('@eclipse-glsp/ide', version);
await (0, common_1.checkIfNpmVersionIsNew)('@eclipse-glsp/ide', version);
return (0, release_eclipse_integration_1.releaseEclipseIntegration)(options);

@@ -83,6 +106,23 @@ }

logger_1.LOGGER.debug('Verify that Github CLI is configured correctly');
if (!(0, git_util_1.isGithubCLIAuthenticated)()) {
if (!isGithubCLIAuthenticated()) {
throw new Error("Github CLI is not configured properly. No user is logged in for host 'github.com'");
}
}
function isGithubCLIAuthenticated() {
logger_1.LOGGER.debug('Verify that Github CLI is installed');
(0, command_util_1.fatalExec)('which gh', 'Github CLI is not installed!');
const status = sh.exec('gh auth status', (0, command_util_1.getShellConfig)());
if (status.code !== 0) {
if (status.stderr.includes('You are not logged into any GitHub hosts')) {
return false;
}
throw new Error(status.stderr);
}
if (!status.stdout.trim().includes('Logged in to github.com')) {
logger_1.LOGGER.debug("No user is logged in for host 'github.com'");
return false;
}
logger_1.LOGGER.debug('Github CLI is authenticated and ready to use');
return true;
}
function launchVerdaccio() {

@@ -89,0 +129,0 @@ logger_1.LOGGER.debug('Verify that verdaccio is installed and start if necessary');

@@ -19,13 +19,9 @@ /********************************************************************************

export declare function baseCommand(cmd?: Command): Command;
export interface BaseCmdOptions {
verbose: boolean;
}
export declare const SH_CONFIG: sh.ExecOptions & {
export type ShellConfig = sh.ExecOptions & {
async: false;
};
export declare function getShellConfig(options?: Partial<Omit<sh.ExecOptions, 'async'>>): sh.ExecOptions & {
async: false;
};
export declare function initialConfiguration(verbose: boolean): void;
export declare function fatalExec(command: string, fatalErrorMessage: string, options?: Partial<Omit<sh.ExecOptions, 'async'>>): sh.ShellString;
export declare const SH_CONFIG: ShellConfig;
export declare function getShellConfig(options?: Partial<Omit<ShellConfig, 'async'>>): ShellConfig;
export declare function configureShell(config: Partial<sh.ShellConfig>): void;
export declare function fatalExec(command: string, fatalErrorMessage: string, options?: Partial<Omit<ShellConfig, 'async'>>): sh.ShellString;
//# sourceMappingURL=command-util.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fatalExec = exports.initialConfiguration = exports.getShellConfig = exports.SH_CONFIG = exports.baseCommand = void 0;
exports.fatalExec = exports.configureShell = exports.getShellConfig = exports.SH_CONFIG = exports.baseCommand = void 0;
/********************************************************************************

@@ -20,4 +43,4 @@ * Copyright (c) 2022 EclipseSource and others.

const commander_1 = require("commander");
const sh = require("shelljs");
const logger_1 = require("./logger");
const sh = __importStar(require("shelljs"));
// Commander.js utils
function baseCommand(cmd = new commander_1.Command()) {

@@ -39,8 +62,9 @@ return cmd //

exports.getShellConfig = getShellConfig;
function initialConfiguration(verbose) {
function configureShell(config) {
sh.config.reset();
exports.SH_CONFIG.silent = !verbose;
(0, logger_1.configureLogger)(verbose);
getShellConfig({});
exports.SH_CONFIG.silent = config.silent;
exports.SH_CONFIG.fatal = config.fatal;
}
exports.initialConfiguration = initialConfiguration;
exports.configureShell = configureShell;
function fatalExec(command, fatalErrorMessage, options = {}) {

@@ -47,0 +71,0 @@ const result = sh.exec(command, getShellConfig(options));

/********************************************************************************
* Copyright (c) 2022 EclipseSource and others.
* Copyright (c) 2022-2022 EclipseSource and others.
*

@@ -16,6 +16,45 @@ * This program and the accompanying materials are made available under the

********************************************************************************/
export declare function isGithubCLIAuthenticated(): boolean;
export declare function isGitRepository(path: string): boolean;
export declare function isGitRepository(path?: string): boolean;
export declare function getGitRoot(path?: string): string;
export declare function hasGitChanges(path?: string): boolean;
export declare function getLatestRelease(path?: string): string;
/**
* Returns the files that have uncommitted changes (staged, not staged and untracked) of a git repository.
* Filepaths are absolute.
*/
export declare function getUncommittedChanges(path?: string): string[];
/**
* Returns the files tha have been changed with the last commit (also includes currently staged but uncommitted changes)
* Filepaths are absolute.
*/
export declare function getChangesOfLastCommit(path?: string): string[];
/**
* Returns the last modification date of a file (or the last commit) in a git repo.
* @param filePath The file. If undefined the modification date of the last commit will be returned
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @param excludeMessage Only consider commits that don`t match the excludeMessage
* @returns The date or undefined if the file is outside of the git repo.
*/
export declare function getLastModificationDate(filePath?: string, repoRoot?: string, excludeMessage?: string): Date | undefined;
/**
* Returns the last modification date of a file in a git repo.
* @param filePath The file
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @param excludeMessage Only consider commits that don`t match the excludeMessage
* @returns The date or undefined if the file is outside of the git repo.
*/
export declare function getFirstModificationDate(filePath: string, repoRoot?: string, excludeMessage?: string): Date | undefined;
export declare function getFilesOfCommit(commitHash: string, repoRoot?: string): string[];
/**
* Returns the commit hash of the initial commit of the given repository
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @returns The commit hash or undefined if something went wrong.
*/
export declare function getInitialCommit(repoRoot?: string): string | undefined;
/**
* Returns the commit hash of the first commit for a given file (across renames).
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @returns The commit hash or undefined if something went wrong.
*/
export declare function getFirstCommit(filePath: string, repoRoot?: string): string | undefined;
export declare function getLatestGithubRelease(path?: string): string;
export declare function getLatestTag(path?: string): string;

@@ -22,0 +61,0 @@ export declare function hasBranch(branch: string, path?: string): boolean;

"use strict";
/********************************************************************************
* Copyright (c) 2022 EclipseSource and others.
* Copyright (c) 2022-2022 EclipseSource and others.
*

@@ -17,47 +17,165 @@ * This program and the accompanying materials are made available under the

********************************************************************************/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRemoteUrl = exports.hasBranch = exports.getLatestTag = exports.getLatestRelease = exports.hasGitChanges = exports.isGitRepository = exports.isGithubCLIAuthenticated = void 0;
const sh = require("shelljs");
exports.getRemoteUrl = exports.hasBranch = exports.getLatestTag = exports.getLatestGithubRelease = exports.getFirstCommit = exports.getInitialCommit = exports.getFilesOfCommit = exports.getFirstModificationDate = exports.getLastModificationDate = exports.getChangesOfLastCommit = exports.getUncommittedChanges = exports.hasGitChanges = exports.getGitRoot = exports.isGitRepository = void 0;
const path_1 = require("path");
const sh = __importStar(require("shelljs"));
const command_util_1 = require("./command-util");
const logger_1 = require("./logger");
const validation_util_1 = require("./validation-util");
function isGithubCLIAuthenticated() {
logger_1.LOGGER.debug('Verify that Github CLI is installed');
(0, command_util_1.fatalExec)('which gh', 'Github CLI is not installed!');
const status = sh.exec('gh auth status', (0, command_util_1.getShellConfig)());
if (status.code !== 0) {
if (status.stderr.includes('You are not logged into any GitHub hosts')) {
return false;
}
throw new Error(status.stderr);
}
if (!status.stderr.trim().includes('Logged in to github.com')) {
logger_1.LOGGER.debug("No user is logged in for host 'github.com'");
return false;
}
logger_1.LOGGER.debug('Github CLI is authenticated and ready to use');
return true;
}
exports.isGithubCLIAuthenticated = isGithubCLIAuthenticated;
function isGitRepository(path) {
logger_1.LOGGER.debug(`Check if the given directory is a git repo: ${path}`);
sh.cd(path);
return sh.exec('git rev-parse --is-inside-work-tree', (0, command_util_1.getShellConfig)()).stdout.trim().toLocaleLowerCase() === 'true';
cdIfPresent(path);
const isGitRepo = sh
.exec('git rev-parse --is-inside-work-tree', (0, command_util_1.getShellConfig)({ silent: true }))
.stdout.trim()
.toLocaleLowerCase() === 'true';
return isGitRepo;
}
exports.isGitRepository = isGitRepository;
function hasGitChanges(path) {
logger_1.LOGGER.debug(`Check if the directory has git changes: ${asDebugArg(path)}`);
function getGitRoot(path) {
cdIfPresent(path);
return sh.exec('git status --porcelain').stdout.trim().length !== 0;
const fileString = sh.exec('git rev-parse --show-toplevel', (0, command_util_1.getShellConfig)()).stdout.trim();
return (0, path_1.resolve)(fileString);
}
exports.getGitRoot = getGitRoot;
function hasGitChanges(path) {
return getUncommittedChanges(path).length > 0;
}
exports.hasGitChanges = hasGitChanges;
function getLatestRelease(path) {
logger_1.LOGGER.debug(`Retrieve latest release from repo: ${asDebugArg(path)}`);
/**
* Returns the files that have uncommitted changes (staged, not staged and untracked) of a git repository.
* Filepaths are absolute.
*/
function getUncommittedChanges(path) {
cdIfPresent(path);
return sh
.exec('git status --porcelain', (0, command_util_1.getShellConfig)())
.stdout.trim()
.split('\n')
.filter(value => value.trim().length !== 0)
.map(fileInfo => { var _a;
// Extract relative file path from the info string and convert to absolute path
return (0, path_1.resolve)(path !== null && path !== void 0 ? path : process.cwd(), (_a = fileInfo.trim().split(' ').pop()) !== null && _a !== void 0 ? _a : ''); });
}
exports.getUncommittedChanges = getUncommittedChanges;
/**
* Returns the files tha have been changed with the last commit (also includes currently staged but uncommitted changes)
* Filepaths are absolute.
*/
function getChangesOfLastCommit(path) {
cdIfPresent(path);
return sh
.exec('git diff --name-only HEAD^', (0, command_util_1.getShellConfig)())
.stdout.trim()
.split('\n')
.map(file => (0, path_1.resolve)(path !== null && path !== void 0 ? path : process.cwd(), file));
}
exports.getChangesOfLastCommit = getChangesOfLastCommit;
/**
* Returns the last modification date of a file (or the last commit) in a git repo.
* @param filePath The file. If undefined the modification date of the last commit will be returned
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @param excludeMessage Only consider commits that don`t match the excludeMessage
* @returns The date or undefined if the file is outside of the git repo.
*/
function getLastModificationDate(filePath, repoRoot, excludeMessage) {
cdIfPresent(repoRoot);
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : '';
const result = sh.exec(`git log -1 ${additionalArgs} --pretty="format:%ci" ${filePath !== null && filePath !== void 0 ? filePath : ''}`, (0, command_util_1.getShellConfig)());
if (result.code !== 0) {
return undefined;
}
return new Date(result.stdout.trim());
}
exports.getLastModificationDate = getLastModificationDate;
/**
* Returns the last modification date of a file in a git repo.
* @param filePath The file
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @param excludeMessage Only consider commits that don`t match the excludeMessage
* @returns The date or undefined if the file is outside of the git repo.
*/
function getFirstModificationDate(filePath, repoRoot, excludeMessage) {
cdIfPresent(repoRoot);
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : '';
const result = sh.exec(`git log ${additionalArgs} --pretty="format:%ci" --follow ${filePath}`, (0, command_util_1.getShellConfig)());
if (result.code !== 0) {
return undefined;
}
const datesString = result.stdout.trim();
if (datesString.length === 0) {
return new Date();
}
const date = datesString.split('\n').pop();
return date ? new Date(date) : undefined;
}
exports.getFirstModificationDate = getFirstModificationDate;
function getFilesOfCommit(commitHash, repoRoot) {
cdIfPresent(repoRoot);
const result = sh.exec(`git show --pretty="" --name-only ${commitHash}`, (0, command_util_1.getShellConfig)());
if (result.code !== 0) {
return [];
}
return result.stdout.trim().split('\n');
}
exports.getFilesOfCommit = getFilesOfCommit;
/**
* Returns the commit hash of the initial commit of the given repository
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @returns The commit hash or undefined if something went wrong.
*/
function getInitialCommit(repoRoot) {
cdIfPresent(repoRoot);
const result = sh.exec('git log --pretty=oneline --reverse', (0, command_util_1.getShellConfig)());
if (result.code !== 0) {
return undefined;
}
const commits = result.stdout.trim();
if (commits.length === 0) {
return undefined;
}
return commits.substring(0, commits.indexOf(' '));
}
exports.getInitialCommit = getInitialCommit;
/**
* Returns the commit hash of the first commit for a given file (across renames).
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @returns The commit hash or undefined if something went wrong.
*/
function getFirstCommit(filePath, repoRoot) {
cdIfPresent(repoRoot);
const result = sh.exec(`git log --follow --pretty=format:"%H" ${filePath}`, (0, command_util_1.getShellConfig)());
if (result.code !== 0) {
return undefined;
}
return result.stdout.trim().split('\n').pop();
}
exports.getFirstCommit = getFirstCommit;
function getLatestGithubRelease(path) {
cdIfPresent(path);
const release = sh.exec('gh release list --exclude-drafts -L 1', (0, command_util_1.getShellConfig)()).stdout.trim().split('\t');
return release[release.length - 2];
}
exports.getLatestRelease = getLatestRelease;
exports.getLatestGithubRelease = getLatestGithubRelease;
function getLatestTag(path) {
logger_1.LOGGER.debug(`Retrieve latest tag from local repo : ${asDebugArg(path)}`);
cdIfPresent(path);

@@ -68,3 +186,2 @@ return sh.exec('git describe --abbrev=0 --tags', (0, command_util_1.getShellConfig)()).stdout.trim();

function hasBranch(branch, path) {
logger_1.LOGGER.debug(`Check if branch exists: ${asDebugArg(path)}`);
cdIfPresent(path);

@@ -75,3 +192,2 @@ return sh.exec(`git branch --list ${branch}`, (0, command_util_1.getShellConfig)()).stdout.trim().length !== 0;

function getRemoteUrl(path) {
logger_1.LOGGER.debug(`Retrieve remote git url for: ${asDebugArg(path)}`);
cdIfPresent(path);

@@ -83,9 +199,5 @@ return sh.exec('git config --get remote.origin.url', (0, command_util_1.getShellConfig)()).stdout.trim();

if (path) {
(0, validation_util_1.validateGitDirectory)(path);
sh.cd(path);
}
}
function asDebugArg(path) {
return path !== null && path !== void 0 ? path : sh.pwd().stdout;
}
//# sourceMappingURL=git-util.js.map

@@ -0,9 +1,23 @@

/********************************************************************************
* Copyright (c) 2022 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
export interface Logger extends Pick<Console, LogLevel> {
newLine(): void;
}
export type LogLevel = 'info' | 'debug' | 'error' | 'warn';
export declare const LOGGER: Logger;
export declare function configureLogger(isVerbose: boolean): void;
export interface Logger {
info(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
debug(message: string, ...args: any[]): void;
}
export declare function configureLogger(level: LogLevel): void;
export declare function configureLogger(verbose: boolean): void;
//# sourceMappingURL=logger.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.configureLogger = exports.LOGGER = void 0;
/********************************************************************************

@@ -19,17 +17,35 @@ * Copyright (c) 2022 EclipseSource and others.

********************************************************************************/
let verbose = false;
Object.defineProperty(exports, "__esModule", { value: true });
exports.configureLogger = exports.LOGGER = void 0;
const levels = {
error: { threshold: 0, color: '\x1b[31m' },
warn: { threshold: 1, color: '\x1b[33m' },
info: { threshold: 2, color: '\x1b[0m' },
debug: { threshold: 3, color: '\x1b[32m' } // green
};
let levelThreshold = levels.info.threshold;
exports.LOGGER = {
info: (message, ...args) => console.info(`[INFO] ${message}`, ...args),
error: (message, ...args) => console.error(`[ERROR] ${message}`, ...args),
warn: (message, ...args) => console.warn(`[WARNING] ${message}`, ...args),
debug: (message, ...args) => {
if (verbose) {
console.log(`[DEBUG] ${message}`, ...args);
}
info: (...args) => log('info', ...args),
error: (...args) => log('error', ...args),
warn: (...args) => log('warn', ...args),
debug: (...args) => log('debug', ...args),
newLine: () => console.log('')
};
function log(level, ...args) {
const levelData = levels[level];
if (levelThreshold < levelData.threshold) {
return;
}
};
function configureLogger(isVerbose) {
verbose = isVerbose;
console[level](levelData.color, ...args, '\x1b[0m');
}
function configureLogger(levelOrVerbose) {
if (typeof levelOrVerbose === 'boolean') {
const level = levelOrVerbose ? 'debug' : 'info';
levelThreshold = levels[level].threshold;
}
else {
levelThreshold = levels[levelOrVerbose].threshold;
}
}
exports.configureLogger = configureLogger;
//# sourceMappingURL=logger.js.map
export declare const COMMAND_VERSION = "1.1.0-next";
export declare function validateDirectory(rootDir: string): string;
export declare function validateFile(filePath: string, hasToExist?: boolean): string;
export declare function validateVersion(version: string): string;
export declare function validateGitDirectory(repository: string): string;
//# sourceMappingURL=validation-util.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateGitDirectory = exports.validateVersion = exports.validateDirectory = exports.COMMAND_VERSION = void 0;
exports.validateGitDirectory = exports.validateVersion = exports.validateFile = exports.validateDirectory = exports.COMMAND_VERSION = void 0;
/********************************************************************************

@@ -20,5 +43,5 @@ * Copyright (c) 2022 EclipseSource and others.

const commander_1 = require("commander");
const fs = require("fs");
const fs = __importStar(require("fs"));
const path_1 = require("path");
const semver = require("semver");
const semver = __importStar(require("semver"));
const git_util_1 = require("./git-util");

@@ -38,6 +61,17 @@ const logger_1 = require("./logger");

exports.validateDirectory = validateDirectory;
function validateFile(filePath, hasToExist = false) {
const path = (0, path_1.resolve)(filePath);
if (hasToExist && !fs.existsSync(path)) {
throw new commander_1.InvalidArgumentError('Not a valid file path!');
}
if (!fs.statSync(path).isFile()) {
throw new commander_1.InvalidArgumentError('Not a file!');
}
return path;
}
exports.validateFile = validateFile;
function validateVersion(version) {
logger_1.LOGGER.debug(`Validate version format of: ${version}`);
if (!semver.valid(version)) {
throw new Error(`Not a valid version: ${version}`);
throw new commander_1.InvalidArgumentError(`Not a valid version: ${version}`);
}

@@ -50,7 +84,7 @@ return version;

if (!(0, git_util_1.isGitRepository)(repoPath)) {
throw new Error('Not a valid git repository');
throw new commander_1.InvalidArgumentError('Not a valid git repository');
}
return repoPath;
return (0, git_util_1.getGitRoot)(repository);
}
exports.validateGitDirectory = validateGitDirectory;
//# sourceMappingURL=validation-util.js.map
{
"name": "@eclipse-glsp/cli",
"version": "1.1.0-next.e31f2e5.119+e31f2e5",
"version": "1.1.0-next.ffcc7ce.140+ffcc7ce",
"description": "CLI Tooling & scripts for GLSP components",
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
"keywords": [

@@ -10,6 +9,4 @@ "eclipse",

],
"author": {
"name": "Eclipse GLSP"
},
"homepage": "https://www.eclipse.org/glsp/",
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
"repository": {

@@ -19,3 +16,6 @@ "type": "git",

},
"bugs": "https://github.com/eclipse-glsp/glsp/issues",
"license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
"author": {
"name": "Eclipse GLSP"
},
"contributors": [

@@ -28,2 +28,10 @@ {

],
"bin": {
"glsp": "bin/glsp"
},
"files": [
"src",
"bin",
"lib"
],
"scripts": {

@@ -38,29 +46,22 @@ "build": "tsc -b",

},
"publishConfig": {
"access": "public"
},
"dependencies": {
"commander": "^9.4.0",
"node-fetch": "2.6.7",
"commander": "^10.0.1",
"glob": "^8.0.3",
"node-fetch": "^2.6.11",
"readline-sync": "^1.4.10",
"semver": "^7.3.7",
"shelljs": "0.8.5"
"semver": "^7.5.1",
"shelljs": "^0.8.5"
},
"devDependencies": {
"@eclipse-glsp/config": "1.1.0-next.e31f2e5.119+e31f2e5",
"@eclipse-glsp/config": "1.1.0-next.ffcc7ce.140+ffcc7ce",
"@types/glob": "^8.0.0",
"@types/node-fetch": "2.6.2",
"@types/readline-sync": "1.4.4",
"@types/semver": "7.3.12",
"@types/shelljs": "0.8.11",
"ts-node": "^10.9.1"
"@types/shelljs": "0.8.11"
},
"bin": {
"glsp": "bin/glsp"
"publishConfig": {
"access": "public"
},
"files": [
"src",
"bin",
"lib"
],
"gitHead": "e31f2e57b5be8c784247c469669ed2a20ec548ee"
"gitHead": "ffcc7ce86bc05d6e16c3af131b27824aae282e6f"
}

@@ -14,2 +14,31 @@ # Eclipse GLSP - CLI

## checkHeaders
The `checkHeaders` command can be used to validate the copyright year (range) of license headers.
It checks for each file (matching the include pattern) whether the defined copyright range is in line with the first and last modification date in the git repository.
Found violations are printed to the console and can be fixed automatically.
The validation check can be restricted to pending changes and/or the last commit e.g. to validate a commit before creating a PR.
```console
$ glsp checkHeaders -h
Usage: glsp checkHeaders [options] <rootDir>
Validates the copyright year range of license header files
Arguments:
rootDir The starting directory for the check
Options:
-t, --type <type> The scope of the check. In addition to a full recursive check, is also possible to only consider pending changes or the last commit (choices: "full", "changes", "lastCommit", default:
"full")
-f, --fileExtensions <extensions...> File extensions that should be checked (default: ["ts","tsx"])
-e, --exclude <exclude...> File patterns that should be excluded from the check. New exclude patterns are added to the default patterns (default: [**/@(node_modules|lib|dist|bundle)/**])
--no-exclude-defaults Disables the default excludes patterns. Only explicitly passed exclude patterns (-e, --exclude) are considered
-j, --json Also persist validation results as json file (default: false)
-s, --severity <severity> The severity of validation results that should be printed. (choices: "error", "warn", "ok", default: "error" (only))
-a, --autoFix Auto apply & commit fixes without prompting the user (default: false)
-h, --help display help for command
```
## coverageReport

@@ -36,3 +65,3 @@

```bash
```console
$ glsp release -h

@@ -39,0 +68,0 @@ Usage: glsp release [options] <component> <releaseType> [customVersion]

@@ -17,5 +17,7 @@ #!/usr/bin/env node

********************************************************************************/
import { CheckHeaderCommand } from './commands/check-header';
import { CoverageReportCommand } from './commands/coverage-report';
import { ReleaseCommand } from './commands/release/release';
import { baseCommand } from './util/command-util';
export const COMMAND_VERSION = '1.1.0-next';

@@ -26,5 +28,6 @@

.name('glsp')
.addCommand(CoverageReportCommand)
.addCommand(ReleaseCommand)
.addCommand(CoverageReportCommand);
.addCommand(CheckHeaderCommand);
app.parse(process.argv);

@@ -24,3 +24,3 @@ /********************************************************************************

import { fatalExec, getShellConfig } from '../../util/command-util';
import { getLatestRelease, getLatestTag, hasGitChanges, isGitRepository } from '../../util/git-util';
import { getLatestGithubRelease, getLatestTag, hasGitChanges, isGitRepository } from '../../util/git-util';
import { LOGGER } from '../../util/logger';

@@ -138,4 +138,4 @@ import { validateVersion } from '../../util/validation-util';

sh.cd(directory);
if (options.checkoutDir !== 'master') {
sh.exec(`git switch ${options.branch} `);
if (options.branch !== 'master' && options.branch !== 'main') {
sh.exec(`git checkout ${options.branch} `);
}

@@ -180,3 +180,3 @@ return sh.pwd();

const latestReleaseTag = getLatestRelease();
const latestReleaseTag = getLatestGithubRelease();
const localTag = getLatestTag();

@@ -192,3 +192,3 @@ validateTag(latestReleaseTag, localTag);

const version = tagToVersion(tag);
const titleSuffix = preRelease ? ` Candiate ${version.substring(version.length - 1)}` : '';
const titleSuffix = preRelease ? ` Candidate ${version.substring(version.lastIndexOf('-RC') + 3)}` : '';
const title = `${version.replace(/-.*/, '')} Release${titleSuffix} `;

@@ -264,4 +264,4 @@ sh.exec(

export async function checkIfNpmVersionExists(pckgName: string, newVersion: string): Promise<void> {
LOGGER.debug(`Check if version exists on npm: ${newVersion}`);
export async function checkIfNpmVersionIsNew(pckgName: string, newVersion: string): Promise<void> {
LOGGER.debug(`Check that the release version is new i.e. does not exist on npm: ${newVersion}`);

@@ -268,0 +268,0 @@ const response = await fetch(`https://registry.npmjs.org/${pckgName}/${newVersion}`);

@@ -19,4 +19,2 @@ /********************************************************************************

import {
asMvnVersion,
checkJavaServerVersion,
checkoutAndCd,

@@ -28,3 +26,3 @@ commitAndTag,

updateLernaForDryRun,
updateServerConfig,
updateVersion,
yarnInstall

@@ -39,3 +37,3 @@ } from './common';

REPO_ROOT = checkoutAndCd(options);
await updateDownloadServerScript(options.version, options.force);
updateExternalGLSPDependencies(options.version);
generateChangeLog();

@@ -51,8 +49,6 @@ lernaSetVersion(REPO_ROOT, options.version);

async function updateDownloadServerScript(version: string, force: boolean): Promise<void> {
LOGGER.info('Update example server download config');
const mvnVersion = asMvnVersion(version);
checkJavaServerVersion(version, force);
sh.cd(`${REPO_ROOT}/examples/workflow-glsp/scripts`);
updateServerConfig('config.json', mvnVersion, false);
function updateExternalGLSPDependencies(version: string): void {
LOGGER.info('Update external GLSP dependencies (workflow example server)');
sh.cd(REPO_ROOT);
updateVersion({ name: '@eclipse-glsp-examples/workflow-server-bundled', version });
}

@@ -59,0 +55,0 @@

@@ -70,5 +70,5 @@ /********************************************************************************

fatalExec('mvn clean install -Pm2', 'M2 build failed', getShellConfig({ silent: false }));
console.log('');
LOGGER.newLine();
LOGGER.debug('P2');
fatalExec('mvn clean install -Pp2', 'P2 build failed', getShellConfig({ silent: false }));
}

@@ -20,6 +20,4 @@ /********************************************************************************

import {
asMvnVersion,
checkoutAndCd,
commitAndTag,
isExistingMavenVersion,
lernaSetVersion,

@@ -29,3 +27,2 @@ publish,

updateLernaForDryRun,
updateServerConfig,
updateVersion,

@@ -42,3 +39,2 @@ yarnInstall

updateExternalGLSPDependencies(options.version);
await updateDownloadServerScript(options.version);
generateChangeLog();

@@ -55,19 +51,11 @@ lernaSetVersion(REPO_ROOT, options.version);

function updateExternalGLSPDependencies(version: string): void {
LOGGER.info('Update external GLSP dependencies (Client and workflow example)');
LOGGER.info('Update external GLSP dependencies (Client and workflow example & server)');
sh.cd(REPO_ROOT);
updateVersion({ name: '@eclipse-glsp/client', version }, { name: '@eclipse-glsp-examples/workflow-glsp', version });
updateVersion(
{ name: '@eclipse-glsp/client', version },
{ name: '@eclipse-glsp-examples/workflow-glsp', version },
{ name: '@eclipse-glsp-examples/workflow-server', version }
);
}
async function updateDownloadServerScript(version: string): Promise<void> {
LOGGER.info('Update example server download config');
const mvnVersion = asMvnVersion(version);
if (!isExistingMavenVersion('org.eclipse.glsp', 'org.eclipse.glsp.server', mvnVersion)) {
LOGGER.warn(`No Java GLSP server with version ${mvnVersion} found on maven central!. Please release a new Java GLSP Server version
before publishing this release!`);
}
sh.cd(`${REPO_ROOT}/examples/workflow-theia/src/node`);
updateServerConfig('server-config.json', mvnVersion, false);
}
function build(): void {

@@ -74,0 +62,0 @@ LOGGER.info('Install & Build with yarn');

@@ -53,3 +53,4 @@ /********************************************************************************

{ name: '@eclipse-glsp/client', version },
{ name: '@eclipse-glsp-examples/workflow-glsp', version }
{ name: '@eclipse-glsp-examples/workflow-glsp', version },
{ name: '@eclipse-glsp-examples/workflow-server', version }
);

@@ -56,0 +57,0 @@ }

@@ -23,14 +23,13 @@ /********************************************************************************

import * as sh from 'shelljs';
import { BaseCmdOptions, baseCommand, fatalExec, getShellConfig, initialConfiguration } from '../../util/command-util';
import { isGithubCLIAuthenticated } from '../../util/git-util';
import { LOGGER } from '../../util/logger';
import { baseCommand, configureShell, fatalExec, getShellConfig } from '../../util/command-util';
import { LOGGER, configureLogger } from '../../util/logger';
import { validateDirectory, validateVersion } from '../../util/validation-util';
import {
asMvnVersion,
checkIfMavenVersionExists,
checkIfNpmVersionExists,
Component,
ReleaseOptions,
ReleaseType,
VERDACCIO_REGISTRY
VERDACCIO_REGISTRY,
asMvnVersion,
checkIfMavenVersionExists,
checkIfNpmVersionIsNew
} from './common';

@@ -44,3 +43,3 @@ import { releaseClient } from './release-client';

interface ReleaseCmdOptions extends BaseCmdOptions {
interface ReleaseCmdOptions {
checkoutDir: string;

@@ -52,2 +51,3 @@ branch: string;

draft: boolean;
verbose: boolean;
}

@@ -84,3 +84,4 @@

LOGGER.debug('Cli options:', cliOptions);
initialConfiguration(cliOptions.verbose);
configureShell({ silent: !cliOptions.verbose });
configureLogger(cliOptions.verbose);
checkGHCli();

@@ -97,15 +98,15 @@ const version = deriveVersion(releaseType, customVersion);

case 'server-node':
await checkIfNpmVersionExists('@eclipse-glsp/server-node', version);
await checkIfNpmVersionIsNew('@eclipse-glsp/server-node', version);
return releaseServerNode(options);
case 'client':
await checkIfNpmVersionExists('@eclipse-glsp/client', version);
await checkIfNpmVersionIsNew('@eclipse-glsp/client', version);
return releaseClient(options);
case 'theia-integration':
await checkIfNpmVersionExists('@eclipse-glsp/theia-integration', version);
await checkIfNpmVersionIsNew('@eclipse-glsp/theia-integration', version);
return releaseTheiaIntegration(options);
case 'vscode-integration':
await checkIfNpmVersionExists('@eclipse-glsp/vscode-integration', version);
await checkIfNpmVersionIsNew('@eclipse-glsp/vscode-integration', version);
return releaseVscodeIntegration(options);
case 'eclipse-integration':
await checkIfNpmVersionExists('@eclipse-glsp/ide', version);
await checkIfNpmVersionIsNew('@eclipse-glsp/ide', version);
return releaseEclipseIntegration(options);

@@ -130,2 +131,21 @@ }

function isGithubCLIAuthenticated(): boolean {
LOGGER.debug('Verify that Github CLI is installed');
fatalExec('which gh', 'Github CLI is not installed!');
const status = sh.exec('gh auth status', getShellConfig());
if (status.code !== 0) {
if (status.stderr.includes('You are not logged into any GitHub hosts')) {
return false;
}
throw new Error(status.stderr);
}
if (!status.stdout.trim().includes('Logged in to github.com')) {
LOGGER.debug("No user is logged in for host 'github.com'");
return false;
}
LOGGER.debug('Github CLI is authenticated and ready to use');
return true;
}
function launchVerdaccio(): Promise<void> {

@@ -132,0 +152,0 @@ LOGGER.debug('Verify that verdaccio is installed and start if necessary');

@@ -18,4 +18,4 @@ /********************************************************************************

import * as sh from 'shelljs';
import { configureLogger } from './logger';
// Commander.js utils
export function baseCommand(cmd = new Command()): Command {

@@ -28,7 +28,4 @@ return cmd //

export interface BaseCmdOptions {
verbose: boolean;
}
export const SH_CONFIG: sh.ExecOptions & { async: false } = {
export type ShellConfig = sh.ExecOptions & { async: false };
export const SH_CONFIG: ShellConfig = {
async: false,

@@ -39,3 +36,3 @@ fatal: true,

export function getShellConfig(options: Partial<Omit<sh.ExecOptions, 'async'>> = {}): sh.ExecOptions & { async: false } {
export function getShellConfig(options: Partial<Omit<ShellConfig, 'async'>> = {}): ShellConfig {
return {

@@ -47,14 +44,10 @@ ...SH_CONFIG,

export function initialConfiguration(verbose: boolean): void {
export function configureShell(config: Partial<sh.ShellConfig>): void {
sh.config.reset();
SH_CONFIG.silent = !verbose;
configureLogger(verbose);
getShellConfig({});
SH_CONFIG.silent = config.silent;
SH_CONFIG.fatal = config.fatal;
}
export function fatalExec(
command: string,
fatalErrorMessage: string,
options: Partial<Omit<sh.ExecOptions, 'async'>> = {}
): sh.ShellString {
export function fatalExec(command: string, fatalErrorMessage: string, options: Partial<Omit<ShellConfig, 'async'>> = {}): sh.ShellString {
const result = sh.exec(command, getShellConfig(options));

@@ -61,0 +54,0 @@ if (result.code !== 0) {

/********************************************************************************
* Copyright (c) 2022 EclipseSource and others.
* Copyright (c) 2022-2022 EclipseSource and others.
*

@@ -17,40 +17,138 @@ * This program and the accompanying materials are made available under the

import { resolve } from 'path';
import * as sh from 'shelljs';
import { fatalExec, getShellConfig } from './command-util';
import { LOGGER } from './logger';
import { validateGitDirectory } from './validation-util';
import { getShellConfig } from './command-util';
export function isGithubCLIAuthenticated(): boolean {
LOGGER.debug('Verify that Github CLI is installed');
fatalExec('which gh', 'Github CLI is not installed!');
export function isGitRepository(path?: string): boolean {
cdIfPresent(path);
const isGitRepo =
sh
.exec('git rev-parse --is-inside-work-tree', getShellConfig({ silent: true }))
.stdout.trim()
.toLocaleLowerCase() === 'true';
return isGitRepo;
}
const status = sh.exec('gh auth status', getShellConfig());
if (status.code !== 0) {
if (status.stderr.includes('You are not logged into any GitHub hosts')) {
return false;
}
throw new Error(status.stderr);
export function getGitRoot(path?: string): string {
cdIfPresent(path);
const fileString = sh.exec('git rev-parse --show-toplevel', getShellConfig()).stdout.trim();
return resolve(fileString);
}
export function hasGitChanges(path?: string): boolean {
return getUncommittedChanges(path).length > 0;
}
/**
* Returns the files that have uncommitted changes (staged, not staged and untracked) of a git repository.
* Filepaths are absolute.
*/
export function getUncommittedChanges(path?: string): string[] {
cdIfPresent(path);
return sh
.exec('git status --porcelain', getShellConfig())
.stdout.trim()
.split('\n')
.filter(value => value.trim().length !== 0)
.map(fileInfo =>
// Extract relative file path from the info string and convert to absolute path
resolve(path ?? process.cwd(), fileInfo.trim().split(' ').pop() ?? '')
);
}
/**
* Returns the files tha have been changed with the last commit (also includes currently staged but uncommitted changes)
* Filepaths are absolute.
*/
export function getChangesOfLastCommit(path?: string): string[] {
cdIfPresent(path);
return sh
.exec('git diff --name-only HEAD^', getShellConfig())
.stdout.trim()
.split('\n')
.map(file => resolve(path ?? process.cwd(), file));
}
/**
* Returns the last modification date of a file (or the last commit) in a git repo.
* @param filePath The file. If undefined the modification date of the last commit will be returned
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @param excludeMessage Only consider commits that don`t match the excludeMessage
* @returns The date or undefined if the file is outside of the git repo.
*/
export function getLastModificationDate(filePath?: string, repoRoot?: string, excludeMessage?: string): Date | undefined {
cdIfPresent(repoRoot);
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : '';
const result = sh.exec(`git log -1 ${additionalArgs} --pretty="format:%ci" ${filePath ?? ''}`, getShellConfig());
if (result.code !== 0) {
return undefined;
}
if (!status.stderr.trim().includes('Logged in to github.com')) {
LOGGER.debug("No user is logged in for host 'github.com'");
return false;
return new Date(result.stdout.trim());
}
/**
* Returns the last modification date of a file in a git repo.
* @param filePath The file
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @param excludeMessage Only consider commits that don`t match the excludeMessage
* @returns The date or undefined if the file is outside of the git repo.
*/
export function getFirstModificationDate(filePath: string, repoRoot?: string, excludeMessage?: string): Date | undefined {
cdIfPresent(repoRoot);
const additionalArgs = excludeMessage ? `--grep="${excludeMessage}" --invert-grep` : '';
const result = sh.exec(`git log ${additionalArgs} --pretty="format:%ci" --follow ${filePath}`, getShellConfig());
if (result.code !== 0) {
return undefined;
}
LOGGER.debug('Github CLI is authenticated and ready to use');
return true;
const datesString = result.stdout.trim();
if (datesString.length === 0) {
return new Date();
}
const date = datesString.split('\n').pop();
return date ? new Date(date) : undefined;
}
export function isGitRepository(path: string): boolean {
LOGGER.debug(`Check if the given directory is a git repo: ${path}`);
sh.cd(path);
return sh.exec('git rev-parse --is-inside-work-tree', getShellConfig()).stdout.trim().toLocaleLowerCase() === 'true';
export function getFilesOfCommit(commitHash: string, repoRoot?: string): string[] {
cdIfPresent(repoRoot);
const result = sh.exec(`git show --pretty="" --name-only ${commitHash}`, getShellConfig());
if (result.code !== 0) {
return [];
}
return result.stdout.trim().split('\n');
}
export function hasGitChanges(path?: string): boolean {
LOGGER.debug(`Check if the directory has git changes: ${asDebugArg(path)}`);
cdIfPresent(path);
return sh.exec('git status --porcelain').stdout.trim().length !== 0;
/**
* Returns the commit hash of the initial commit of the given repository
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @returns The commit hash or undefined if something went wrong.
*/
export function getInitialCommit(repoRoot?: string): string | undefined {
cdIfPresent(repoRoot);
const result = sh.exec('git log --pretty=oneline --reverse', getShellConfig());
if (result.code !== 0) {
return undefined;
}
const commits = result.stdout.trim();
if (commits.length === 0) {
return undefined;
}
return commits.substring(0, commits.indexOf(' '));
}
export function getLatestRelease(path?: string): string {
LOGGER.debug(`Retrieve latest release from repo: ${asDebugArg(path)}`);
/**
* Returns the commit hash of the first commit for a given file (across renames).
* @param repoRoot The path to the repo root. If undefined the current working directory is used.
* @returns The commit hash or undefined if something went wrong.
*/
export function getFirstCommit(filePath: string, repoRoot?: string): string | undefined {
cdIfPresent(repoRoot);
const result = sh.exec(`git log --follow --pretty=format:"%H" ${filePath}`, getShellConfig());
if (result.code !== 0) {
return undefined;
}
return result.stdout.trim().split('\n').pop();
}
export function getLatestGithubRelease(path?: string): string {
cdIfPresent(path);

@@ -62,3 +160,2 @@ const release = sh.exec('gh release list --exclude-drafts -L 1', getShellConfig()).stdout.trim().split('\t');

export function getLatestTag(path?: string): string {
LOGGER.debug(`Retrieve latest tag from local repo : ${asDebugArg(path)}`);
cdIfPresent(path);

@@ -69,3 +166,2 @@ return sh.exec('git describe --abbrev=0 --tags', getShellConfig()).stdout.trim();

export function hasBranch(branch: string, path?: string): boolean {
LOGGER.debug(`Check if branch exists: ${asDebugArg(path)}`);
cdIfPresent(path);

@@ -76,3 +172,2 @@ return sh.exec(`git branch --list ${branch}`, getShellConfig()).stdout.trim().length !== 0;

export function getRemoteUrl(path?: string): string {
LOGGER.debug(`Retrieve remote git url for: ${asDebugArg(path)}`);
cdIfPresent(path);

@@ -84,9 +179,4 @@ return sh.exec('git config --get remote.origin.url', getShellConfig()).stdout.trim();

if (path) {
validateGitDirectory(path);
sh.cd(path);
}
}
function asDebugArg(path?: string): string {
return path ?? sh.pwd().stdout;
}

@@ -16,24 +16,43 @@ /********************************************************************************

********************************************************************************/
let verbose = false;
export interface Logger extends Pick<Console, LogLevel> {
newLine(): void;
}
export type LogLevel = 'info' | 'debug' | 'error' | 'warn';
const levels: Record<LogLevel, { threshold: number; color: string }> = {
error: { threshold: 0, color: '\x1b[31m' }, // red
warn: { threshold: 1, color: '\x1b[33m' }, // yellow
info: { threshold: 2, color: '\x1b[0m' }, // default terminal color
debug: { threshold: 3, color: '\x1b[32m' } // green
};
let levelThreshold: number = levels.info.threshold;
export const LOGGER: Logger = {
info: (message, ...args) => console.info(`[INFO] ${message}`, ...args),
error: (message, ...args) => console.error(`[ERROR] ${message}`, ...args),
warn: (message, ...args) => console.warn(`[WARNING] ${message}`, ...args),
debug: (message, ...args) => {
if (verbose) {
console.log(`[DEBUG] ${message}`, ...args);
}
info: (...args) => log('info', ...args),
error: (...args) => log('error', ...args),
warn: (...args) => log('warn', ...args),
debug: (...args) => log('debug', ...args),
newLine: () => console.log('')
} as const;
function log(level: LogLevel, ...args: any[]): void {
const levelData = levels[level];
if (levelThreshold < levelData.threshold) {
return;
}
};
export function configureLogger(isVerbose: boolean): void {
verbose = isVerbose;
console[level](levelData.color, ...args, '\x1b[0m');
}
export interface Logger {
info(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
debug(message: string, ...args: any[]): void;
export function configureLogger(level: LogLevel): void;
export function configureLogger(verbose: boolean): void;
export function configureLogger(levelOrVerbose: LogLevel | boolean): void {
if (typeof levelOrVerbose === 'boolean') {
const level: LogLevel = levelOrVerbose ? 'debug' : 'info';
levelThreshold = levels[level].threshold;
} else {
levelThreshold = levels[levelOrVerbose].threshold;
}
}

@@ -20,3 +20,3 @@ /********************************************************************************

import * as semver from 'semver';
import { isGitRepository } from './git-util';
import { getGitRoot, isGitRepository } from './git-util';
import { LOGGER } from './logger';

@@ -37,6 +37,18 @@ export const COMMAND_VERSION = '1.1.0-next';

export function validateFile(filePath: string, hasToExist = false): string {
const path = resolve(filePath);
if (hasToExist && !fs.existsSync(path)) {
throw new InvalidArgumentError('Not a valid file path!');
}
if (!fs.statSync(path).isFile()) {
throw new InvalidArgumentError('Not a file!');
}
return path;
}
export function validateVersion(version: string): string {
LOGGER.debug(`Validate version format of: ${version}`);
if (!semver.valid(version)) {
throw new Error(`Not a valid version: ${version}`);
throw new InvalidArgumentError(`Not a valid version: ${version}`);
}

@@ -49,5 +61,6 @@ return version;

if (!isGitRepository(repoPath)) {
throw new Error('Not a valid git repository');
throw new InvalidArgumentError('Not a valid git repository');
}
return repoPath;
return getGitRoot(repository);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc