mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 21:07:48 +00:00
[tests] Deprecate "now" npm package in favor of "vercel" (#5119)
We deprecated all the `now` scoped packages in favor of the `vercel` equivalents, however the deprecation message disappears after each publish, so we must to run `npm deprecate` after `npm publish` for legacy packages.
This commit is contained in:
9
utils/update-legacy-name.js
vendored
9
utils/update-legacy-name.js
vendored
@@ -29,7 +29,8 @@ if (!packageDir) {
|
||||
|
||||
const pkgJsonPath = join(packagesDir, packageDir, 'package.json');
|
||||
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
||||
const originalName = pkg.name;
|
||||
const oldName = pkg.name;
|
||||
const version = pkg.version;
|
||||
|
||||
if (pkg.name === '@vercel/client') {
|
||||
// The legacy name for `@vercel/client` is `now-client` (global scope)
|
||||
@@ -42,10 +43,12 @@ if (pkg.name === '@vercel/client') {
|
||||
}
|
||||
}
|
||||
|
||||
console.error(`Updated package name: "${originalName}" -> "${pkg.name}"`);
|
||||
const newName = pkg.name;
|
||||
console.error(`Updated package name: "${oldName}" -> "${newName}"`);
|
||||
|
||||
fs.writeFileSync(pkgJsonPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
||||
|
||||
// Log the directory name to stdout for the `publish-legacy.sh`
|
||||
// script to consume for the `npm publish` that happens next.
|
||||
console.log(packageDir);
|
||||
const IFS = '|';
|
||||
console.log([packageDir, oldName, newName, version].join(IFS));
|
||||
|
||||
Reference in New Issue
Block a user