diff --git a/packages/logger/src/define-package.ts b/packages/logger/src/define-package.ts index 877674f..54d133b 100644 --- a/packages/logger/src/define-package.ts +++ b/packages/logger/src/define-package.ts @@ -8,6 +8,7 @@ const logger = createLogger('logger'); setTimeout(() => { if ('registeredList' in Alwatr) { logger.accident?.('define-package', 'duplicate_old_package_defined', Alwatr.registeredList); + throw new Error('duplicate_old_package_defined'); } }, 2000); @@ -15,7 +16,7 @@ export const definePackage = (packageName: string, version: string) => { logger.logMethodArgs?.('define-package', {packageName, version}); if (packageName in Alwatr.packages) { - logger.error('define-package', 'duplicate_package_defined', { + logger.accident('define-package', 'duplicate_package_defined', { packageName, new: version, old: Alwatr.packages[packageName], @@ -24,7 +25,7 @@ export const definePackage = (packageName: string, version: string) => { } if (packageName.indexOf('@alwatr') === -1) { - logger.error('define-package', 'package_name_starts_with_alwatr_scope', { + logger.accident('define-package', 'package_name_starts_with_alwatr_scope', { packageName, }); throw new Error('package_name_starts_with_alwatr_scope');