From 630bb03d9c84e6885dc5db1559d41efce7d52dcd Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 22 Apr 2022 00:47:04 +0800 Subject: [PATCH] Update package-lock.json during release process --- extra/beta/update-version.js | 4 ++++ extra/update-version.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/extra/beta/update-version.js b/extra/beta/update-version.js index b8de95df6..df2cb40a6 100644 --- a/extra/beta/update-version.js +++ b/extra/beta/update-version.js @@ -20,6 +20,10 @@ if (! exists) { // Process package.json pkg.version = version; fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n"); + + // Also update package-lock.json + childProcess.spawnSync("npm", [ "install" ]); + commit(version); tag(version); diff --git a/extra/update-version.js b/extra/update-version.js index f17ad2007..d5c2ee5ca 100644 --- a/extra/update-version.js +++ b/extra/update-version.js @@ -25,6 +25,9 @@ if (! exists) { pkg.scripts.setup = pkg.scripts.setup.replace(/(git checkout )([^\s]+)/, `$1${newVersion}`); fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n"); + // Also update package-lock.json + childProcess.spawnSync("npm", [ "install" ]); + commit(newVersion); tag(newVersion);