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

@centipod/cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@centipod/cli - npm Package Compare versions

Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4

14

dist/cmd/semantic-release.d.ts

@@ -1,6 +0,8 @@

export declare const semanticRelease: (identifier?: string | undefined) => Promise<void>;
export declare const semanticReleaseInit: (options: {
yes: boolean;
access: string;
dry: boolean;
}) => Promise<void>;
interface IPublishOptions {
yes?: boolean;
access?: string;
dry?: boolean;
}
export declare const semanticRelease: (identifier: string, options: IPublishOptions) => Promise<void>;
export declare const semanticReleaseInit: (options: IPublishOptions) => Promise<void>;
export {};

@@ -12,6 +12,62 @@ "use strict";

const print_publish_events_1 = require("../utils/print-publish-events");
const semanticRelease = (identifier) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const printSummary = (publisher) => {
print_actions_1.printActions(publisher.actions);
logger_1.logger.seperator();
if (publisher.actions.actions.filter((a) => a.error).length) {
logger_1.logger.lf();
logger_1.logger.info('Cannot publish packages, errors were found when preparing releases');
process.exit(1);
}
if (!publisher.actions.actions.filter((a) => a.changed).length) {
logger_1.logger.lf();
logger_1.logger.info('Nothing to publish');
process.exit(0);
}
};
const doPublish = (publisher, options) => {
publisher.release({
access: options.access,
dry: options.dry || false,
}).subscribe((evt) => print_publish_events_1.printEvent(evt), (err) => {
logger_1.logger.error(err);
process.exit(1);
}, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
yield core_1.createSemanticReleaseTag();
logger_1.logger.lf();
logger_1.logger.info(logger_1.logger.centipod, logger_1.logger.success, chalk_1.default.green.bold(`Successfully initialized semantic release and published packages`, options.dry ? chalk_1.default.bgBlueBright.white(' DRY RUN ') : ''));
process.exit(0);
}));
};
const promptPublishConfirmation = (publisher, options) => {
if (options.yes) {
doPublish(publisher, options);
}
else {
const rl = readline_1.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Do you want to publish (y/N) ? ', (confirm) => {
if (confirm === 'y' || confirm === 'yes') {
logger_1.logger.seperator();
doPublish(publisher, options);
}
else {
logger_1.logger.error('\nAborted by user');
process.exit(1);
}
});
}
};
const semanticRelease = (identifier, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const project = yield core_1.Project.loadProject(core_1.resloveProjectRoot());
logger_1.logger.lf();
logger_1.logger.info(logger_1.logger.centipod, chalk_1.default.white.bold('Initializing new semantic-release update'));
logger_1.logger.seperator();
try {
logger_1.logger.info(identifier);
yield core_1.semanticRelease();
logger_1.logger.info('Based on conventional commit messages analysis, the following updates are advised :');
logger_1.logger.lf();
const publisher = yield core_1.semanticRelease(project, identifier);
printSummary(publisher);
promptPublishConfirmation(publisher, options);
}

@@ -43,47 +99,4 @@ catch (e) {

const publisher = yield project.publishAll();
print_actions_1.printActions(publisher.actions);
logger_1.logger.seperator();
if (publisher.actions.actions.filter((a) => a.error).length) {
logger_1.logger.lf();
logger_1.logger.info('Cannot publish packages, errors were found when preparing releases');
process.exit(1);
}
if (!publisher.actions.actions.filter((a) => a.changed).length) {
logger_1.logger.lf();
logger_1.logger.info('Nothing to publish');
process.exit(0);
}
const doPublish = () => {
publisher.release({
access: options.access,
dry: options.dry,
}).subscribe((evt) => print_publish_events_1.printEvent(evt), (err) => {
logger_1.logger.error(err);
process.exit(1);
}, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
yield core_1.createSemanticReleaseTag();
logger_1.logger.lf();
logger_1.logger.info(logger_1.logger.centipod, logger_1.logger.success, chalk_1.default.green.bold(`Successfully initialized semantic release and published packages`, options.dry ? chalk_1.default.bgBlueBright.white(' DRY RUN ') : ''));
process.exit(0);
}));
};
if (options.yes) {
doPublish();
}
else {
const rl = readline_1.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Do you want to publish (y/N) ? ', (confirm) => {
if (confirm === 'y' || confirm === 'yes') {
logger_1.logger.seperator();
doPublish();
}
else {
logger_1.logger.error('\nAborted by user');
process.exit(1);
}
});
}
printSummary(publisher);
promptPublishConfirmation(publisher, options);
}

@@ -90,0 +103,0 @@ catch (e) {

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

.description('publish affected packages using semantic versioning based on coventional changelog')
.action((identifier) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
.action((identifier, _options, cmd) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
return yield commandWrapper(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
semantic_release_1.semanticRelease(identifier);
semantic_release_1.semanticRelease(identifier, cmd._optionValues);
}), true);

@@ -87,0 +87,0 @@ }));

{
"name": "@centipod/cli",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.4",
"description": "Monorepo utils",

@@ -17,3 +17,3 @@ "author": "Mario Arnautou",

"dependencies": {
"@centipod/core": "0.0.1-alpha.3",
"@centipod/core": "0.0.1-alpha.4",
"chalk": "^4.1.1",

@@ -20,0 +20,0 @@ "commander": "^7.2.0"

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