0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-13 22:48:31 -05:00

fix: emit warning for upgrade 5.x and publish on previous

This commit is contained in:
Juan Picado 2021-05-22 07:55:45 +02:00
parent e54a8871ea
commit a760e6814d
4 changed files with 1753 additions and 1179 deletions

View file

@ -27,3 +27,5 @@ test/functional/store/*
storage_default_storage/* storage_default_storage/*
docker-examples/ docker-examples/
.prettierignore .prettierignore
*.sh
.secrets-baseline

File diff suppressed because it is too large Load diff

View file

@ -10,4 +10,4 @@ echo "Bumping version to new tag: ${lastTag}"
echo "//$REGISTRY_URL/:_authToken=$REGISTRY_AUTH_TOKEN" > .npmrc echo "//$REGISTRY_URL/:_authToken=$REGISTRY_AUTH_TOKEN" > .npmrc
# Publish to NPM # Publish to NPM
npm publish --registry https://$REGISTRY_URL/ npm publish --registry https://$REGISTRY_URL/ --tag previous

View file

@ -13,21 +13,13 @@ import { parseConfigFile } from './utils';
require('pkginfo')(module); require('pkginfo')(module);
if (process.getuid && process.getuid() === 0) { if (process.getuid && process.getuid() === 0) {
global.console.warn( global.console.warn(bgYellow().red("*** WARNING: Verdaccio doesn't need superuser privileges. Don't run it under root! ***"));
bgYellow().red(
"*** WARNING: Verdaccio doesn't need superuser privileges. Don't run it under root! ***"
)
);
} }
const MIN_NODE_VERSION = '6.9.0'; const MIN_NODE_VERSION = '6.9.0';
if (semver.satisfies(process.version, `>=${MIN_NODE_VERSION}`) === false) { if (semver.satisfies(process.version, `>=${MIN_NODE_VERSION}`) === false) {
global.console.error( global.console.error(bgRed(`Verdaccio requires at least Node.js ${MIN_NODE_VERSION} or higher, please upgrade your Node.js distribution`));
bgRed(
`Verdaccio requires at least Node.js ${MIN_NODE_VERSION} or higher, please upgrade your Node.js distribution`
)
);
process.exit(1); process.exit(1);
} }
@ -67,20 +59,11 @@ function init() {
} }
logger.logger.warn({ file: configPathLocation }, 'config file - @{file}'); logger.logger.warn({ file: configPathLocation }, 'config file - @{file}');
process.emitWarning(`verdaccio 4.x is deprecated and won't longer recieve security support, please
startVerdaccio( update to 5.x or higher`);
verdaccioConfiguration, startVerdaccio(verdaccioConfiguration, cliListener, configPathLocation, pkgVersion, pkgName, listenDefaultCallback);
cliListener,
configPathLocation,
pkgVersion,
pkgName,
listenDefaultCallback
);
} catch (err) { } catch (err) {
logger.logger.fatal( logger.logger.fatal({ file: configPathLocation, err: err }, 'cannot open config file @{file}: @{!err.message}');
{ file: configPathLocation, err: err },
'cannot open config file @{file}: @{!err.message}'
);
process.exit(1); process.exit(1);
} }
} }
@ -94,7 +77,7 @@ if (commander.info) {
Binaries: ['Node', 'Yarn', 'npm'], Binaries: ['Node', 'Yarn', 'npm'],
Virtualization: ['Docker'], Virtualization: ['Docker'],
Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'], Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],
npmGlobalPackages: ['verdaccio'] npmGlobalPackages: ['verdaccio'],
}); });
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(data); console.log(data);
@ -113,7 +96,7 @@ if (commander.info) {
process.on('uncaughtException', function (err) { process.on('uncaughtException', function (err) {
logger.logger.fatal( logger.logger.fatal(
{ {
err: err err: err,
}, },
'uncaught exception, please report this\n@{err.stack}' 'uncaught exception, please report this\n@{err.stack}'
); );