beemojs / beemo

πŸ€– Centralized configuration layer for dev tools. Beep boop.
https://beemo.dev
MIT License
143 stars 9 forks source link

Beemo binary name must be camelCase while docs use a kebab-case name in examples #81

Closed matchai closed 4 years ago

matchai commented 4 years ago

Hey Miles πŸ‘‹ Thank you for the excellent work on Beemo! πŸ˜„

When running through the examples, I have noticed that following them exactly and using dev-tools as a binary name, an error is thrown due to the binName in the Beemo constructor being invalid.

dev-tools
❯ ./packages/dev-tools/bin/dev-tools
/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:198
        throw new Error(prefix + ". " + error);
        ^

Error: Invalid Beemo field "configName". Config file name must be camel case without extension.
    at StringPredicate.invariant (/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:198:15)
    at StringPredicate.<anonymous> (/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:137:18)
    at /Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:333:28
    at Array.forEach (<anonymous>)
    at StringPredicate.validate (/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:332:17)
    at StringPredicate.run (/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:315:23)
    at /Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:520:39
    at Array.forEach (<anonymous>)
    at Schema.build (/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:511:33)
    at Object.optimal [as default] (/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:575:17)
/Users/matan/work/dev-tools/node_modules/optimal/lib/index.js:198
        throw new Error(prefix + ". " + error);

This traces back to the Tool definition which Beemo extends from @boost/core, found here: https://github.com/milesj/boost/blob/master/packages/core/src/Tool.ts#L135-L139

I don't know the context of why that is the case in @boost/core, so I'll hold off on making a PR there.

milesj commented 4 years ago

Is this when using a custom binary name? https://milesj.gitbook.io/beemo/tips#custom-executable-and-config-name

For the most part, the custom binary is only needed when you want to brand it, otherwise beemo works just fine. But yeah, the binary has to be camel case for now.

matchai commented 4 years ago

Correct, it is when using a custom binary name. πŸ‘ Just raising an issue in case others run into this too.

milesj commented 4 years ago

Thanks, updated the docs!