-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add project preview command #1367
Conversation
|
|
Coverage report
Show new covered files 🐣
Test suite run success671 tests passing in 94 suites. Report generated by 🧪jest coverage report action from a26c262 |
Co-authored-by: Andrew Tatomyr <andrew.tatomyr@redocly.com>
This looks good. However, the solution seems to be fragile. I'm afraid of the future situation when a user has an older version of Redocly CLI with one config structure, and the |
If the user has the other package dependency installed, could that package be used instead of npx? I'm thinking of how we evolve changes that affect both packages, and how users can pin versions if they need to (either for software dependency process reasons, or because they aren't ready to accept a change in our newer releases). I'm not sure if the errors are coming through to the CLI correctly. If you supply a directory that is not a directory, it says it's launching the preview and then exits. |
A few comments on the command design:
I don't see any documentation for the preview command, but it should be included with the pull request, especially given the confusing naming with our existing |
@lornajane thank you for the extensive feedback!
If the user has one of the product packages in However, if the user specifies the product argument, that product's package will be used ignoring what's in
The CLI preview command only serves as an interface for launching previews using product NPM packages, all of the output from those packages is shown and the console is also interactive. The behavior you described seems to be the fault of the packages that are being launched and should be fixed on that side. I will look into that.
I was told that the docs should come in a separate PR because the docs are published right after PR merge and the CLI changes go through a different release process. I have the docs as a WIP and will open a PR and link it to this one later today or on Monday morning.
By default if the argument is not specified it tries to find a |
This should not be a problem. The |
Adjusted some naming and descriptions and linked a PR with documentation for the command. |
What/Why/How?
Add a
preview
command that allows to run a preview of Redocly projects.The command can accept the
product
to use for preview as an argument, deduce it fro the project'spackage.json
, or use Realm by default.The product package is executed via NPX.
The supported products are:
@redocly/redoc
@redocly/revel
@redocly/reef
@redocly/realm
@redocly/redoc-revel
@redocly/redoc-reef
@redocly/revel-reef
Reference
Docs PR: #1384
Testing
Screenshots (optional)
Check yourself
Security