From 79d6058d3cd86b6271f7bc93b2b5283c23af9712 Mon Sep 17 00:00:00 2001 From: David Sheldrick Date: Thu, 14 Mar 2024 15:41:55 +0000 Subject: [PATCH] Fix release eliding (#3156) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow up to #3153, after testing some more I found some issues to fix. ### Change Type - [ ] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [x] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [x] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Add a step-by-step description of how to test your PR here. 2. - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Add a brief release note for your PR here. --- scripts/lib/didAnyPackageChange.ts | 10 ++++++++-- scripts/publish-patch.ts | 7 ++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/lib/didAnyPackageChange.ts b/scripts/lib/didAnyPackageChange.ts index b51ea7fb2..db4ad3872 100644 --- a/scripts/lib/didAnyPackageChange.ts +++ b/scripts/lib/didAnyPackageChange.ts @@ -58,7 +58,12 @@ function getTarballManifest(tarballPath: string): Promise onentry: (entry) => { entry.on('data', (data) => { // we could hash these to reduce memory but it's probably fine - manifest[entry.path] = data + const existing = manifest[entry.path] + if (existing) { + manifest[entry.path] = Buffer.concat([existing, data]) + } else { + manifest[entry.path] = data + } }) }, }, @@ -74,9 +79,10 @@ function getTarballManifest(tarballPath: string): Promise } export async function didAnyPackageChange() { - const details = getAllPackageDetails() + const details = await getAllPackageDetails() for (const pkg of Object.values(details)) { if (await hasPackageChanged(pkg)) { + console.log('Package changed:', pkg.name) return true } } diff --git a/scripts/publish-patch.ts b/scripts/publish-patch.ts index 53592ef56..4ca285c5e 100644 --- a/scripts/publish-patch.ts +++ b/scripts/publish-patch.ts @@ -18,9 +18,6 @@ async function main() { const latestVersionOnNpm = (await exec('npm', ['show', 'tldraw', 'version'])).trim() const isLatestVersion = latestVersionInBranch.format() === latestVersionOnNpm - if (process.env.GITHUB_OUTPUT) { - appendFileSync(process.env.GITHUB_OUTPUT, `is_latest_version=${isLatestVersion}\n`) - } const nextVersion = latestVersionInBranch.inc('patch').format() // check we're on the main branch on HEAD @@ -53,6 +50,10 @@ async function main() { return } + if (process.env.GITHUB_OUTPUT) { + appendFileSync(process.env.GITHUB_OUTPUT, `is_latest_version=${isLatestVersion}\n`) + } + nicelog('Releasing version', nextVersion) await setAllVersions(nextVersion)