Skip to content

Commit 50f918d

Browse files
committed
use changeset status
1 parent 9d3c6bf commit 50f918d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

scripts/release/version-packages.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,24 @@ async function versionPackages() {
2525
stdio: 'inherit',
2626
})
2727

28-
// Create empty changeset for `next` to bump canary version even if
29-
// there was no changeset.
30-
const res = await execa('pnpm', ['changeset', 'version'])
31-
if (res.stderr.includes('No unreleased changesets found, exiting.')) {
28+
console.log(
29+
'▲ Preparing to bump the canary version, checking if there are any changesets.'
30+
)
31+
// Create an empty changeset for `next` to bump the canary version
32+
// even if there are no changesets for `next`.
33+
const res = await execa('pnpm', ['changeset', 'status'], {
34+
// If there are no changesets, this will error. Set reject: false
35+
// to avoid trycatch and handle the rest based on the stdout.
36+
reject: false,
37+
})
38+
39+
console.log('▲ Changeset Status:')
40+
console.log({ ...res })
41+
42+
if (!res.stdout.includes('- next')) {
43+
console.log(
44+
'▲ No changesets found for `next`, creating an empty changeset.'
45+
)
3246
await writeFile(
3347
join(process.cwd(), '.changeset', `next-canary-${Date.now()}.md`),
3448
`---\n'next': patch\n---`

0 commit comments

Comments
 (0)