From f7ac5e8c75bd21c7a462d968591ccdd4a7203dd9 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Fri, 8 Mar 2024 09:58:06 -0500 Subject: [PATCH] Fix experimental releases for pnpm (#9015) --- .github/workflows/release-experimental.yml | 2 +- scripts/publish.js | 8 +++++++- scripts/utils.js | 8 +++++++- scripts/version.js | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-experimental.yml b/.github/workflows/release-experimental.yml index 8f4c1ebea05..a4e7c9e2253 100644 --- a/.github/workflows/release-experimental.yml +++ b/.github/workflows/release-experimental.yml @@ -67,4 +67,4 @@ jobs: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc - name: 🚀 Publish - run: npm run publish + run: pnpm run publish diff --git a/scripts/publish.js b/scripts/publish.js index ac50c233c15..5a44db603a1 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -15,7 +15,13 @@ function getTaggedVersion() { * @param {string} tag */ function publish(dir, tag) { - execSync(`pnpm publish ${dir} --access public --tag ${tag}`, { + let args = ["--access public", `--tag ${tag}`]; + if (tag === "experimental") { + args.push(`--no-git-checks`); + } else { + args.push("--publish-branch release-next"); + } + execSync(`pnpm publish ${dir} ${args.join(" ")}`, { stdio: "inherit", }); } diff --git a/scripts/utils.js b/scripts/utils.js index 21b9655b44c..4119ec8831d 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -191,7 +191,7 @@ const updateDenoImportMap = async (importMapPath, nextVersion) => { /** * @param {string} nextVersion */ -async function incrementRemixVersion(nextVersion) { +async function incrementRemixVersion(nextVersion, syncLockFile = false) { // Update version numbers in package.json for all packages await updateRemixVersion("remix", nextVersion); await updateRemixVersion("create-remix", nextVersion); @@ -199,6 +199,12 @@ async function incrementRemixVersion(nextVersion) { await updateRemixVersion(`remix-${name}`, nextVersion); } + // Sync up the pnpm-lock.yaml file with the new experimental version + if (syncLockFile) { + console.log(chalk.green(" Syncing pnpm lockfile...")); + execSync("pnpm install --no-frozen-lockfile"); + } + // Update version numbers in Deno's import maps await Promise.all( [ diff --git a/scripts/version.js b/scripts/version.js index 6625da1d6b2..9c8d158acac 100644 --- a/scripts/version.js +++ b/scripts/version.js @@ -42,7 +42,7 @@ async function run(args) { if (answer === false) return 0; } - await incrementRemixVersion(nextVersion); + await incrementRemixVersion(nextVersion, givenVersion === "experimental"); } /**