redocly-cli
redocly-cli copied to clipboard
Core package should not depend on colorette
Describe the bug
The core package depends on colorette
to be able to color error messages using ANSI codes.
That package attempts to read process.env
during import time, which isn't a thing in browsers (unless transpiled), causing trouble trying to use @redocly/openapi-core
with e.g. https://vitejs.dev/.
(Another related issue is node-fetch
, which doesn't work OOTB in a Vite environment either.)
To Reproduce Steps to reproduce the behavior:
- Try to import
@redocly/openapi-core
1.0.0-beta.80 in a non-bundling browser environment. - See error
Expected behavior
The library should not depend on a console coloring library.
It also relates to https://github.com/Redocly/redoc/issues/1820.
Hello @akx
In 1.0.0-beta.108
was added browser support. We're still depending on colorette
but it is not used in browser env (replacement for node-fetch
is still in progress but you can provide customFetch
field with browser-compatible implementation).
Please let us know if you still have issues with it
I think this has been fixed, so I'll close the issue but please let us know if this still causes a problem.