-
Notifications
You must be signed in to change notification settings - Fork 148
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 the eject and translate commands #1668
Conversation
🦋 Changeset detectedLatest commit: 46595da The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Coverage report
Show new covered files 🐣
Test suite run success765 tests passing in 108 suites. Report generated by 🧪jest coverage report action from 46595da |
068767b
to
04f3a21
Compare
If we are shipping this CLI update without docs (I assume we are, since time is pressing), please open one issue per command for documentation, and link those issues to this pull request. I'll pick them up (we sort of have some old translations docs, but they're not ready to publish as they are) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments of things to tidy up before we can publish, trying to make things clear and consistent with existing CLI patterns.
40446ea
to
67e9b69
Compare
Co-authored-by: Lorna Jane Mitchell <[email protected]>
Co-authored-by: Lorna Jane Mitchell <[email protected]>
Co-authored-by: Lorna Jane Mitchell <[email protected]>
4e61e6e
to
cf81199
Compare
| --plan | string | Product plan to use in preview. <br/> **Possible values:** `pro`, `enterprise`. The default value is `enterprise`. For more details, see [plans](https://redocly.com/pricing/). | | ||
| --product | string | Name of a product to preview the project with. <br/> **Possible values:** `redoc`, `revel`, `reef`, `realm`, `redoc-revel`, `redoc-reef`, `revel-reef`. <br/> `redoc` is the flagship product for generating API documentation from OpenAPI specifications. <br/> `revel` is a specialized product designed for external API applications. <br/> `reef` is a specialized product designed for internal API needs. <br/> `realm` is a balanced product combining `redoc`, `revel`, and `reef`. <br/> `redoc-revel` is a blended product combining `redoc` and `revel`. <br/> `redoc-reef` is a blended product combining `redoc` and `reef`. <br/> `revel-reef` is a blended product combining `revel` and `reef`. <br/> The default value is autodetected from the project's `package.json` or `realm` is used. | | ||
| --project-dir, -d | string | Path to the project directory. The default value is `.` (current directory). | | ||
| --port, -p | number | The port to run the preview server on. The default value is `4000`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be a helpful change for a command that has port, plan and product parameters. Not a blocking request for change, but a general note that we did discuss this at the time that the command was implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the problem with that at all.
Here is an example of a psql
(Postgress client) CLI docs:
They have multiple args that start with letter p
but still use -p
as --port
.
I also see this very common to in linux CLI tools, e.g. curl -i
where -i is an alias for --show-headers
while curl has many other arguments starting with letter i
: --include
, --insecure
, --interface
.
.changeset/short-panthers-smoke.md
Outdated
"@redocly/cli": minor | ||
--- | ||
|
||
Added the `eject` and `translations` commands for use with the new Reunite-hosted product family. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to be annoying in the final hour. I think we should rename the translations
command to translate
. Most of our commands are in verb format:
- lint
- bundle
- eject
- preview
Why not translate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the corresponding PR for the original source: https://github.com/Redocly/redocly/pull/10425
const npxExecutableName = process.platform === 'win32' ? 'npx.cmd' : 'npx'; | ||
spawn( | ||
npxExecutableName, | ||
['-y', '@redocly/realm', 'translations', argv.locale, `--project-dir=${argv['project-dir']}`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also recommend we rename it in the original source to translate
too.
What/Why/How?
Added the
translate
andeject
commands.Also, refactored types.
Open questions: https://github.com/Redocly/redocly/issues/9612#issuecomment-2298159934 .Another question: do we want to use options in camel case like--configDir
? We mostly use kebab-case for options (except for--outDir
in thesplit
command and some options in thebuild-docs
command which is legacy of redoc-cli I believe).Reference
Resolves #1629
The eject docs PR: https://github.com/Redocly/redocly/pull/10344
Testing
Screenshots (optional)
Check yourself
Security