bref icon indicating copy to clipboard operation
bref copied to clipboard

fix: add missing chalk dependency

Open czubocha opened this issue 1 year ago • 2 comments

chalk is no longer a dependency for serverless v4. bref must install chalk on its own to use it.

czubocha avatar Jun 25 '24 23:06 czubocha

Hi, thanks for the PR!

As the tests show, this cannot work here: Bref is distributed via Packagist (equivalent of npmjs.com for PHP). The dependencies in package.json are not installed, which explains why the plugin has to do so many weird things to work.

And it cannot be externalized into a NPM package because the goal is to have a one-step experience for PHP developers (i.e. they don't have to install Bref via Composer and NPM).

Is chalk the only problematic dependency? If that's the case, we probably can adapt things here.

If not, then maybe supporting Serverless v4 needs to happen in a NPM-installable plugin, but the experience for v4 would be worse than v3 🤔

mnapoli avatar Jun 26 '24 11:06 mnapoli

Hey! As far as I’m concerned, chalk is the only problematic dependency. I pushed a change to the PR to remove chalk and use the new logger method available in v4 that prints messages in grey. This way, we keep the grey color in v4 without breaking v3 (though the message will be in the default color in v3). Let me know what you think.

czubocha avatar Jun 27 '24 13:06 czubocha

Replaced by #1837

Thanks!

mnapoli avatar Jul 02 '24 10:07 mnapoli