thomvaill / log4brains

✍️ Log and publish your architecture decisions (ADR)
Apache License 2.0
1.13k stars 95 forks source link

docs: replace global install with npx #56

Open BearAlliance opened 2 years ago

BearAlliance commented 2 years ago

I had no trouble setting up a new project and creating ADRs without installing globally.

fire commented 2 years ago

Confirmed that at least npx log4brains preview worked.

thomvaill commented 2 years ago

Sorry for the delay. Thank you for your proposal! However, I am not sure about this one... What are the pros compared to a global install? Because I have a a cons that bothers me: it is longer to type "npx log4brains " compared to "log4brains " On the other hand, it enables you to use different versions of Log4brains more easily, I agree. Also, we have to think about the consequences in the CI pipelines: is it easily possible to cache npx installed packages?

Happy to have feedback on this!

Related ADR: https://thomvaill.github.io/log4brains/adr/adr/20210113-distribute-log4brains-as-a-global-npm-package/

BearAlliance commented 1 year ago

What are the pros compared to a global install?

the consequences in the CI pipelines: is it easily possible to cache npx installed packages?

If a project includes log4brains in its dependencies or devDependencies, it will be cached along with the other node_modules. npx will prefer the package already installed if there is one.

From the docs

Package names provided without a specifier will be matched with whatever version exists in the local project.