@eclipse-glsp/cli
Advanced tools
Comparing version 1.1.0-next.164cf99.124 to 1.1.0-next.1cd0682.136
@@ -84,3 +84,3 @@ "use strict"; | ||
}); | ||
return changedFiles; | ||
return changedFiles.filter(file => fs.existsSync(file)); | ||
} | ||
@@ -87,0 +87,0 @@ function validate(rootDir, files, options) { |
@@ -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; |
@@ -18,3 +18,3 @@ "use strict"; | ||
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; | ||
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 = require("fs"); | ||
@@ -115,4 +115,4 @@ const node_fetch_1 = require("node-fetch"); | ||
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} `); | ||
} | ||
@@ -225,4 +225,4 @@ return sh.pwd(); | ||
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}`); | ||
@@ -236,3 +236,3 @@ const data = await response.json(); | ||
} | ||
exports.checkIfNpmVersionExists = checkIfNpmVersionExists; | ||
exports.checkIfNpmVersionIsNew = checkIfNpmVersionIsNew; | ||
function checkIfMavenVersionExists(groupId, artifactId, newVersion) { | ||
@@ -239,0 +239,0 @@ logger_1.LOGGER.debug('Check if maven version exists'); |
@@ -27,3 +27,3 @@ "use strict"; | ||
REPO_ROOT = (0, common_1.checkoutAndCd)(options); | ||
await updateDownloadServerScript(options.version, options.force); | ||
updateExternalGLSPDependencies(options.version); | ||
generateChangeLog(); | ||
@@ -39,8 +39,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', version }); | ||
} | ||
@@ -47,0 +45,0 @@ function generateChangeLog() { |
@@ -28,3 +28,2 @@ "use strict"; | ||
updateExternalGLSPDependencies(options.version); | ||
await updateDownloadServerScript(options.version); | ||
generateChangeLog(); | ||
@@ -41,16 +40,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() { | ||
@@ -57,0 +46,0 @@ logger_1.LOGGER.info('Install & Build with yarn'); |
@@ -41,3 +41,3 @@ "use strict"; | ||
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 }); | ||
} | ||
@@ -44,0 +44,0 @@ function build() { |
@@ -51,15 +51,15 @@ "use strict"; | ||
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); | ||
@@ -66,0 +66,0 @@ } |
{ | ||
"name": "@eclipse-glsp/cli", | ||
"version": "1.1.0-next.164cf99.124+164cf99", | ||
"version": "1.1.0-next.1cd0682.136+1cd0682", | ||
"description": "CLI Tooling & scripts for GLSP components", | ||
@@ -52,3 +52,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@eclipse-glsp/config": "1.1.0-next.164cf99.124+164cf99", | ||
"@eclipse-glsp/config": "1.1.0-next.1cd0682.136+1cd0682", | ||
"@types/glob": "^8.0.0", | ||
@@ -64,3 +64,3 @@ "@types/node-fetch": "2.6.2", | ||
}, | ||
"gitHead": "164cf99bc0f8ea3e2232d19dbd89d880bed9a98c" | ||
"gitHead": "1cd0682fb2a2c5ae286e616755fdce20d922f09e" | ||
} |
@@ -126,3 +126,3 @@ /******************************************************************************** | ||
}); | ||
return changedFiles; | ||
return changedFiles.filter(file => fs.existsSync(file)); | ||
} | ||
@@ -129,0 +129,0 @@ |
@@ -137,4 +137,4 @@ /******************************************************************************** | ||
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} `); | ||
} | ||
@@ -261,4 +261,4 @@ return sh.pwd(); | ||
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}`); | ||
@@ -265,0 +265,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', version }); | ||
} | ||
@@ -59,0 +55,0 @@ |
@@ -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 @@ } |
@@ -24,12 +24,12 @@ /******************************************************************************** | ||
import { baseCommand, configureShell, fatalExec, getShellConfig } from '../../util/command-util'; | ||
import { configureLogger, LOGGER } from '../../util/logger'; | ||
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'; | ||
@@ -95,15 +95,15 @@ import { releaseClient } from './release-client'; | ||
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); | ||
@@ -110,0 +110,0 @@ } |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
262691
3471