Skip to content

Commit

Permalink
chore: patch releasing package
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael M committed May 10, 2022
1 parent 5430874 commit 9ff57a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"___ Miscellaneous ___": "",
"man:dev:update": "keep-updated update --audit-fix",
"man:nx:migrate": "npx nx migrate latest && npx nx migrate --run-migrations && npm run man:dev:update && rm -f migrations.json",
"postinstall": "node ./tools/patch-std-ver.mjs",
"prepare": "is-ci || husky install"
},
"private": true,
Expand Down
14 changes: 14 additions & 0 deletions tools/patch-std-ver.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { normalize } from 'node:path';

const filePath = normalize('node_modules/standard-version/lib/configuration.js');

if (existsSync(filePath)) {
const content = readFileSync(filePath, { encoding: 'utf8' })
.replace(`'.versionrc',`, `'.versionrc',\n '.versionrc.cjs',`)
.replace(
`if (path.extname(configPath) === '.js') {`,
`const ext = path.extname(configPath)\n if (ext === '.js' || ext === '.cjs') {`,
);
writeFileSync(filePath, content, { encoding: 'utf8' });
}

0 comments on commit 9ff57a6

Please sign in to comment.