feat: add the eject and translate commands (#1668)

* feat: add the translations command

* feat: add eject command

* Update .changeset/short-panthers-smoke.md

Co-authored-by: Lorna Jane Mitchell <lorna.mitchell@redocly.com>

* Update packages/cli/src/index.ts

Co-authored-by: Lorna Jane Mitchell <lorna.mitchell@redocly.com>

* Update packages/cli/src/index.ts

Co-authored-by: Lorna Jane Mitchell <lorna.mitchell@redocly.com>

* update commands descriptions

* add the -p alias for preivew; update eject/contentDir description

* alighn option naming with the latest Realm changes

* resolve comments

* rename translations to translate

---------

Co-authored-by: Lorna Jane Mitchell <lorna.mitchell@redocly.com>
This commit is contained in:
Andrew Tatomyr
2024-08-23 10:25:26 +03:00
committed by GitHub
parent 325aa1db09
commit 78e08814aa
17 changed files with 199 additions and 56 deletions

View File

@@ -14,19 +14,19 @@ This command is for our pre-release products, currently open for early access to
redocly preview
redocly preview --product=revel
redocly preview --product=reef --plan=pro
redocly preview --product=reef --plan=pro --source-dir=./my-docs-project --port=4001
redocly preview --product=reef --plan=pro --project-dir=./my-docs-project --port=4001
```
## Options
| Option | Type | Description |
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| --help | boolean | Show help. |
| --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. |
| --source-dir, -d | string | Path to the project directory. The default value is `.` (current directory). |
| --port | number | The port to run the preview server on. The default value is `4000`. |
| --version | boolean | Show version number. |
| Option | Type | Description |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| --help | boolean | Show help. |
| --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`. |
| --version | boolean | Show version number. |
## Examples
@@ -50,10 +50,10 @@ redocly preview --plan=pro
### Specify project directory
By default, the preview command uses the current directory. To specify another directory, provide a path relative to the current directory using the `--source-dir` option:
By default, the preview command uses the current directory. To specify another directory, provide a path relative to the current directory using the `--project-dir` option:
```bash
redocly preview --source-dir=./path/to/my/docs/
redocly preview --project-dir=./path/to/my/docs/
```
### Use custom port for preview