diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ea410acd6..9d60ca462 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,7 +47,7 @@ npm install # or npm i To compile the code, run `npm run compile`. To do that on the fly, run `npm run watch` in a separate thread. -To run a specific CLI command, use `npm run cli`, e.g. `npm run cli -- lint resources/museum.yaml --format=stylish`. Please notice that the extra `--` is required to pass arguments to the CLI rather than the NPM itself. +To run a specific CLI command, use `npm run cli`, e.g. `npm run cli -- lint resources/museum.yaml --format=stylish`. Please notice that the extra `--` is required to pass arguments to the CLI rather than to NPM itself. Format your code with `npm run prettier` before committing. @@ -57,6 +57,8 @@ There are some other scripts available in the `scripts` section of the `package. ## Local source code usage +There are two options for testing local changes in other local applications: NPM linking and local packing and installing from the `redocly-cli.tgz` file. + ### NPM linking To test the local source code of the packages in other local applications, you can use npm linking. See the [docs](https://docs.npmjs.com/cli/v9/commands/npm-link). @@ -148,6 +150,9 @@ The application maintains the following exit codes. ## Tests +When running tests, make sure the code is compiled (`npm run compile` or `npm run watch`). +Having `redocly.yaml` in the root of the project affects the unit tests, and console logs affect the e2e tests, so make sure to get rid of both before running tests. + ### Unit tests Run unit tests with this command: `npm run test`. @@ -212,7 +217,7 @@ After merging a PR with a changeset, the release PR is automatically created. If the pipelines are not starting, close and reopen the PR. Merging that PR triggers the release process. -## Revert a release +### Revert a release There's no possibility to revert a release itself. However, you can release a new version with a problematic commit reverted. diff --git a/docs/commands/join.md b/docs/commands/join.md index 5e5c52115..e19cc7d62 100644 --- a/docs/commands/join.md +++ b/docs/commands/join.md @@ -60,15 +60,13 @@ Use the [lint command](./lint.md) separately to lint your APIs before joining. ### Array of paths -{% tabs %} -{% tab label="Command" %} +**Command** ```bash redocly join first-api.yaml second-api.json ``` -{% /tab %} -{% tab label="Output" %} +**Output** ```bash redocly join first-api.yaml second-api.json @@ -76,8 +74,6 @@ redocly join first-api.yaml second-api.json openapi.yaml: join processed in 56ms ``` -{% /tab %} -{% /tabs %} The command creates the output `openapi.yaml` file in the working directory. The order of input files affects how their content is processed. The first provided file is always treated as the "main" file, and its content has precedence over other input files when combining them. Specifically, the following properties of the API description are always taken only from the first input file: @@ -152,15 +148,13 @@ The output file preserves the original tag names as the value of the `x-displayN #### Usage -{% tabs %} -{% tab label="Command" %} +**Command** ```bash redocly join first-api.yaml second-api.json --prefix-tags-with-info-prop title ``` -{% /tab %} -{% tab label="Output file example" %} +**Output file example** ```yaml - name: First Document title_endpoints @@ -172,9 +166,6 @@ redocly join first-api.yaml second-api.json --prefix-tags-with-info-prop title x-displayName: events ``` -{% /tab %} -{% /tabs %} - ### prefix-tags-with-filename If any of the input files contain the `tags` object, tags in the output file are prefixed by the filename of the corresponding input file. @@ -183,15 +174,13 @@ The output file preserves the original tag names as the value of the `x-displayN #### Usage -{% tabs %} -{% tab label="Command" %} +**Command** ```bash redocly join first-api.yaml second-api.json --prefix-tags-with-filename true ``` -{% /tab %} -{% tab label="Output file example" %} +**Output file example** ```yaml - name: first-api_endpoints @@ -203,9 +192,6 @@ redocly join first-api.yaml second-api.json --prefix-tags-with-filename true x-displayName: events ``` -{% /tab %} -{% /tabs %} - ### without-x-tag-groups If you have the same tags in multiple API descriptions, you can allow tag duplication by using the `without-x-tag-groups` option. In this case, the `x-tagGroups` property is not created in the joined file. @@ -230,12 +216,13 @@ If any of the input files have conflicting component names, this option can be u #### Usage +**Command** + ```bash redocly join museum_v1.yaml museum_v2.json --prefix-components-with-info-prop version ``` -{% /tab %} -{% tab label="Output file example" %} +**Output file example** ```yaml components: @@ -287,9 +274,6 @@ components: ``` -{% /tab %} -{% /tabs %} - ### Custom output file By default, the CLI tool writes the joined file as `openapi.yaml` or `openapi.json` in the current working directory. Use the optional `--output` argument to provide an alternative output file path.