mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-14 08:08:05 -05:00
* 🐛 fix(package.json): change cli file extension from .cjs to .mjs
* 🐛 fix(githook.ts): change cli file path to match new extension
The cli file extension has been changed from .cjs to .mjs to improve compatibility with Node.js ESM modules. The file path in githook.ts has been updated to match the new extension.
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
],
|
||||
"main": "cli.js",
|
||||
"bin": {
|
||||
"opencommit": "./out/cli.cjs",
|
||||
"oc": "./out/cli.cjs"
|
||||
"opencommit": "./out/cli.mjs",
|
||||
"oc": "./out/cli.mjs"
|
||||
},
|
||||
"repository": {
|
||||
"url": "https://github.com/di-sukharev/opencommit"
|
||||
@@ -34,9 +34,9 @@
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "npm run -S build -- --sourcemap --watch",
|
||||
"start": "node ./out/cli.cjs",
|
||||
"start": "node ./out/cli.mjs",
|
||||
"dev": "ts-node ./src/cli.ts",
|
||||
"build": "rimraf out && esbuild ./src/cli.ts --bundle --outfile=out/cli.cjs --format=cjs --platform=node",
|
||||
"build": "rimraf out && esbuild ./src/cli.ts --bundle --outfile=out/cli.mjs --format=esm --platform=node --banner:js=\"import {createRequire} from 'module';const require=createRequire(import.meta.url);\"",
|
||||
"deploy": "npm run build && npm version patch && npm publish",
|
||||
"lint": "eslint src --ext ts && tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -20,9 +20,7 @@ export const hookCommand = command(
|
||||
parameters: ['<set/unset>']
|
||||
},
|
||||
async (argv) => {
|
||||
const HOOK_PATH = fileURLToPath(
|
||||
new URL('../../out/cli.cjs', import.meta.url)
|
||||
);
|
||||
const HOOK_PATH = fileURLToPath(new URL('cli.mjs', import.meta.url));
|
||||
|
||||
try {
|
||||
await assertGitRepo();
|
||||
|
||||
Reference in New Issue
Block a user