Replace an existing prerelease before publishing the refreshed candidate. Verdaccio remains mutable for validation while npmjs release versions stay immutable. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
4 files changed
+6
-48
No files matched your search
@@ -1,13 +0,0 @@
|
||||
export type StagingAction = 'publish' | 'skip';
|
||||
|
||||
export function decideStagingPublish(localIntegrity: string, existingIntegrity?: string): StagingAction {
|
||||
if (existingIntegrity === undefined) return 'publish';
|
||||
if (existingIntegrity === localIntegrity) return 'skip';
|
||||
|
||||
throw new Error('Version already exists in Verdaccio with different contents');
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
const [, , localIntegrity, existingIntegrity] = process.argv;
|
||||
console.log(decideStagingPublish(localIntegrity, existingIntegrity));
|
||||
}
|
||||
Reference in new issue
Block a user