Skip to content

Commit

Permalink
Merge pull request #175 from fingerprintjs/fix-changesets-node22
Browse files Browse the repository at this point in the history
Fix changesets for node22
  • Loading branch information
ilfa authored Nov 19, 2024
2 parents 19a9a6f + 70f1988 commit b537cb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 10 additions & 7 deletions scripts/changeset.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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}
---
Expand All @@ -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`);
}

0 comments on commit b537cb6

Please sign in to comment.