feat(cli): Add optional build step to release flow and auto-format npmextra config when registries change
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import * as plugins from './mod.plugins.js';
|
||||
import { ReleaseConfig } from './classes.releaseconfig.js';
|
||||
import { runFormatter } from '../mod_format/index.js';
|
||||
|
||||
export { ReleaseConfig };
|
||||
|
||||
@@ -148,6 +149,7 @@ async function handleAdd(url?: string): Promise<void> {
|
||||
|
||||
if (added) {
|
||||
await config.save();
|
||||
await runFormatter('npmextra', { silent: true });
|
||||
plugins.logger.log('success', `Added registry: ${url}`);
|
||||
} else {
|
||||
plugins.logger.log('warn', `Registry already exists: ${url}`);
|
||||
@@ -183,6 +185,7 @@ async function handleRemove(url?: string): Promise<void> {
|
||||
|
||||
if (removed) {
|
||||
await config.save();
|
||||
await runFormatter('npmextra', { silent: true });
|
||||
plugins.logger.log('success', `Removed registry: ${url}`);
|
||||
} else {
|
||||
plugins.logger.log('warn', `Registry not found: ${url}`);
|
||||
@@ -209,6 +212,7 @@ async function handleClear(): Promise<void> {
|
||||
if (confirmed) {
|
||||
config.clearRegistries();
|
||||
await config.save();
|
||||
await runFormatter('npmextra', { silent: true });
|
||||
plugins.logger.log('success', 'All registries cleared.');
|
||||
} else {
|
||||
plugins.logger.log('info', 'Operation cancelled.');
|
||||
@@ -248,6 +252,7 @@ async function handleAccessLevel(level?: string): Promise<void> {
|
||||
|
||||
config.setAccessLevel(level as 'public' | 'private');
|
||||
await config.save();
|
||||
await runFormatter('npmextra', { silent: true });
|
||||
plugins.logger.log('success', `Access level set to: ${level}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user