Skip to content

Commit 2473af7

Browse files
committed
build: fix issue in changesets with patch
changesets/changesets#397
1 parent 7f4153e commit 2473af7

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
"lint:styles": "node support/scripts/check-styles.js",
5656
"refresh": "pnpm run clean:all; pnpm install;",
5757
"prerelease": "pnpm run if-not-ci run-s checks:release",
58-
"release": "changeset publish",
58+
"release": "run-s release:patch release:changeset",
59+
"release:changeset": "changeset publish",
60+
"release:patch": "node support/scripts/patch-changesets.js",
5961
"repo:update": "pnpm update --latest --recursive -i",
6062
"reset": "pnpm run clean:all; rm pnpm-lock.yaml; pnpm install;",
6163
"run:prettier": "prettier --ignore-path .eslintignore \"**/*.{js,jsx,ts,tsx,md,mdx,json,html,css,yml,yaml,graphql}\"",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const path = require('path');
2+
const fs = require('fs');
3+
4+
const pnpmLocation = path.join(path.dirname(require.resolve('@changesets/cli')), 'cli.cjs.dev.js');
5+
6+
const contents = fs.readFileSync(pnpmLocation, 'utf-8');
7+
const updatedContents = contents.replace(/pnpm/gm, 'npm');
8+
9+
fs.writeFileSync(pnpmLocation, updatedContents);
10+
console.log(`\u001B[32mSuccessfully removed 'pnpm' from 'changesets'.\u001B[0m`);

‎support/scripts/symlink-root.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,6 @@ for (const { original, target } of targets) {
9797
fs.symlinkSync(original, target);
9898
}
9999

100-
console.log('\n\u001B[32mSuccessfully symlinked the `support/root` files to the root directory.\n');
100+
console.log(
101+
'\n\u001B[32mSuccessfully symlinked the `support/root` files to the root directory.\u001B[0m\n',
102+
);

0 commit comments

Comments
 (0)