diff --git a/package.json b/package.json index d28f4ce4..4756b24e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "changeset-version": "node scripts/zipChangesets.js && pnpm exec changeset version" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" }, "devDependencies": { "@changesets/cli": "^2.27.7", diff --git a/scripts/changeset.js b/scripts/changeset.js index 66237731..01b815b3 100644 --- a/scripts/changeset.js +++ b/scripts/changeset.js @@ -1,5 +1,5 @@ import prompt from 'prompts'; -import pkg from '../package.json' assert { type: 'json' }; +import pkg from '../package.json' with { type: 'json' }; import { humanId } from 'human-id'; import fs from 'fs'; import yaml from 'js-yaml'; @@ -58,8 +58,8 @@ const data = await prompt([ ]); const description = data.scope ? `**${data.scope}**: ${data.description}` : data.description; - -const changeset = ` +if (description) { + const changeset = ` --- '${pkg.name}': ${data.version} --- @@ -68,9 +68,12 @@ ${description} `.trim(); -const fileName = `${humanId({ separator: '-', capitalize: false })}.md`; -const filePath = `.changeset/${fileName}`; + const fileName = `${humanId({ separator: '-', capitalize: false })}.md`; + const filePath = `.changeset/${fileName}`; -fs.writeFileSync(filePath, changeset, 'utf-8'); + fs.writeFileSync(filePath, changeset, 'utf-8'); -console.info(`✅ Created changeset ${fileName}. \n\n${changeset}`); + console.info(`✅ Created changeset ${fileName}. \n\n${changeset}`); +} else { + console.info(`❌ Changeset creation cancelled`); +}