Escape-Technologies / mookme

A pre-commit tool designed for monorepos.
MIT License
99 stars 16 forks source link

v2.5.1 has a regression #133

Open rstreefland opened 1 month ago

rstreefland commented 1 month ago

Hi, I've noticed that v2.5.1 seems to have a regression that is caused by this commit.

On MacOS Sonoma (14.1.1) I get this error:

git commit -m test --allow-empty
error: required option '-t, --type <type>' not specified

The error goes away if I remove the -- that was added to the command in the pre-commit hook:

npx @escape.tech/mookme -- run --type pre-commit --args "$1"%
gorillanieto commented 1 month ago

This is happening to me using the pre-commit.json file. I am not sure if I need to add a flag to the init command

rezelute commented 1 month ago

I am new to mookme (coming from Husky), installed the latest version, followed the docs but ran into the same problem with the pre-commit. Glad its not just me.

alanmynah commented 3 weeks ago

this is what worked for me: root_dir

rm -rf node_modules
rm -rf ./git/hooks

went to package.json and updated "postinstall": "npx @escape.tech/mookme@2.5.0 init <rest of your settings> (needed to pin to 2.5.0)

then npm i and the error has gone away.

zackrossman commented 3 weeks ago

My team is seeing the same issue

LMaxence commented 2 weeks ago

Hello !

I didn't realize how breaking this change was... Sorry for the disagreement. My understanding is that npm 10 introduces the breaking change of the "--".

I'll need to figure out something for supporting both npm < 10 and npm 10. In the meantime I would suggest applying @alanmynah 's fix or upgrade to npm 10 ?