mateodelnorte / meta

tool for turning many repos into a meta repo. why choose many repos or a monolithic repo, when you can have both with a meta repo?
MIT License
2.03k stars 95 forks source link

commander is outdated #299

Open jtzero opened 2 years ago

jtzero commented 2 years ago

🐛 Bug Report

when I install a plugin meta can find the source of the plugin but not the bin.

To Reproduce

Expected behavior

resolve

because find-module-bin does not look for a bin dir within either npm prefix -g or npm bin -g the bin file for meta search isn't found

root@8e6eb90be27e:/# npm prefix -g
/usr/local
root@8e6eb90be27e:/# npm bin -g
/usr/local/bin
root@8e6eb90be27e:/# which meta-search
/usr/local/bin/meta-search

symlinking it into one of the dir's it is checking, resolves the issue

root@8e6eb90be27e:/usr/local/lib/node_modules/meta-search/bin# ln -nfs /usr/local/lib/node_modules/meta-search/bin/meta-search /usr/local/lib/node_modules/.bin/meta-search
root@8e6eb90be27e:/usr/local/lib/node_modules/meta-search/bin# meta search
  meta
  meta Resolving plugins: +0ms
  meta   /usr/local/lib/node_modules/meta-search/bin/node_modules +1ms
  meta   /usr/local/lib/node_modules/meta-search/node_modules +0ms
  meta   /usr/local/lib/node_modules/node_modules +1ms
  meta   /usr/local/lib/node_modules +1ms
  meta     + meta-bump +0ms
  meta     + meta-project +0ms
  meta     + meta-search +0ms
  meta   /usr/local/node_modules +0ms
  meta   /usr/node_modules +0ms
  meta   /node_modules +1ms
  meta   /usr/local/lib/node_modules +268ms
  meta     + meta-bump (skip) +0ms
  meta     + meta-project (skip) +0ms
  meta     + meta-search (skip) +0ms
  meta
  meta Loading plugins: +0ms
  meta   + meta-bump /usr/local/lib/node_modules/meta-bump +0ms
  meta   + meta-project /usr/local/lib/node_modules/meta-project +0ms
  meta   + meta-search /usr/local/lib/node_modules/meta-search +1ms
  meta
  meta Loading core plugins: +3ms
  meta   + meta-git /usr/local/lib/node_modules/meta/node_modules/meta-git +1ms
  meta   + meta-init /usr/local/lib/node_modules/meta/node_modules/meta-init +0ms
  meta   + meta-loop /usr/local/lib/node_modules/meta/node_modules/meta-loop +34ms
  meta   + meta-project (skip) +35ms
  find-module-bin looking for meta-search at /usr/local/lib/node_modules/meta-search/bin/node_modules/.bin/meta-search +0ms
  find-module-bin looking for meta-search at /usr/local/lib/node_modules/meta-search/node_modules/.bin/meta-search +0ms
  find-module-bin looking for meta-search at /usr/local/lib/node_modules/.bin/meta-search +0ms
  find-module-bin found meta-search at /usr/local/lib/node_modules/.bin/meta-search +0ms
Usage: meta-search [options] [command]

Options:
  -h, --help      display help for command

Commands:
  package         Find packages in package.json that match given criteria
  help [command]  display help for command
jtzero commented 2 years ago

I would post this in https://github.com/mateodelnorte/find-module-bin however based on the name I'm under assumption it is working as designed, finding the bin under the node_modules.

jtzero commented 1 year ago

My mistake, 1. turns out this was a commander issue and 2. it's actually resolved, my version of it was old, apologies.

jtzero commented 1 year ago

Actually it turns out this bug exists because commander is old

mateodelnorte commented 1 year ago

Up for opening a pr?

patrickleet commented 1 year ago

We have a forked version of commander - @mateodelnorte I know you made this commander fork but I am not clear on what the reason was for that or if the newest version of commander ever resolved this?

https://github.com/mateodelnorte/meta/blob/master/package.json#L55

It's currently 594 commits behind mainline

This branch is 18 commits ahead, 594 commits behind tj:master.

If the mainline version of commander is still not adequate for what we need maybe there's another tool we could replace it with?

mateodelnorte commented 1 year ago

Yeah, commander at some point made changes causing default behavior to no longer work. I created a PR to fix it and it went unmerged for ages, long enough for them to completely change their dev ethos around dependencies. Eventually they closed the PR. Unfortunate.

https://github.com/tj/commander.js/pull/604

patrickleet commented 1 year ago

There was some more conversation about this here in the past as well: https://github.com/mateodelnorte/meta/issues/77