Skip to content

Commit e2a401d

Browse files
authored
docs: fix example commands (#373)
corrects the example commands in `npm2yarn` blocks to use the `npm` format, such that it renders the right thing for all package managers :facepalm:
1 parent f7e374f commit e2a401d

6 files changed

Lines changed: 34 additions & 34 deletions

File tree

packages/documentation/src/app/getting-started/quick-start/page.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ You can check the version we develop and test against [here](https://github.com/
2626
{<h3>Install dependencies</h3>}
2727
First install the CLI and the required runtime packages to your project:
2828
```sh npm2yarn
29-
npm i --dev @nahkies/openapi-code-generator
30-
npm i @nahkies/typescript-fetch-runtime
29+
npm i --save-dev @nahkies/openapi-code-generator
30+
npm i --save @nahkies/typescript-fetch-runtime
3131
```
3232

3333
You could also run the cli through `npx`, or install it globally if you prefer, but it's recommended to pin its
@@ -38,7 +38,7 @@ You can check the version we develop and test against [here](https://github.com/
3838

3939
You can provide either a local file path or url for the input file.
4040
```sh npm2yarn
41-
npm run openapi-code-generator \
41+
npm exec -- openapi-code-generator \
4242
--input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
4343
--output ./src/generated/clients/some-service \
4444
--template typescript-fetch
@@ -56,8 +56,8 @@ You can check the version we develop and test against [here](https://github.com/
5656
{<h3>Install dependencies</h3>}
5757
First install the CLI and the required runtime packages to your project:
5858
```sh npm2yarn
59-
npm i --dev @nahkies/openapi-code-generator
60-
npm i axios @nahkies/typescript-axios-runtime
59+
npm i --save-dev @nahkies/openapi-code-generator
60+
npm i --save axios @nahkies/typescript-axios-runtime
6161
```
6262

6363
You could also run the cli through `npx`, or install it globally if you prefer, but it's recommended to pin its
@@ -68,7 +68,7 @@ You can check the version we develop and test against [here](https://github.com/
6868

6969
You can provide either a local file path or url for the input file.
7070
```sh npm2yarn
71-
npm run openapi-code-generator \
71+
npm exec -- openapi-code-generator \
7272
--input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
7373
--output ./src/generated/clients/some-service \
7474
--template typescript-axios
@@ -87,8 +87,8 @@ You can check the version we develop and test against [here](https://github.com/
8787
{<h3>Install dependencies</h3>}
8888
First install the CLI and the required runtime packages to your project:
8989
```sh npm2yarn
90-
npm i --dev @nahkies/openapi-code-generator @types/koa @types/koa__router
91-
npm i @nahkies/typescript-koa-runtime @koa/cors @koa/router koa koa-body zod
90+
npm i --save-dev @nahkies/openapi-code-generator @types/koa @types/koa__router
91+
npm i --save @nahkies/typescript-koa-runtime @koa/cors @koa/router koa koa-body zod
9292
```
9393

9494
You could also run the cli through `npx`, or install it globally if you prefer, but it's recommended to pin its
@@ -99,7 +99,7 @@ You can check the version we develop and test against [here](https://github.com/
9999
{<h3>Run generation</h3>}
100100
This will generate the server router and validation logic to `./src/generated`
101101
```sh npm2yarn
102-
npm run openapi-code-generator \
102+
npm exec -- openapi-code-generator \
103103
--input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
104104
--output ./src/generated \
105105
--template typescript-koa
@@ -120,8 +120,8 @@ You can check the version we develop and test against [here](https://github.com/
120120
{<h3>Install dependencies</h3>}
121121
First install the CLI and the required runtime packages to your project:
122122
```sh npm2yarn
123-
npm i --dev @nahkies/openapi-code-generator @types/express
124-
npm i @nahkies/typescript-express-runtime express zod
123+
npm i --save-dev @nahkies/openapi-code-generator @types/express
124+
npm i --save @nahkies/typescript-express-runtime express zod
125125
```
126126

127127
You could also run the cli through `npx`, or install it globally if you prefer, but it's recommended to pin its
@@ -132,7 +132,7 @@ You can check the version we develop and test against [here](https://github.com/
132132
{<h3>Run generation</h3>}
133133
This will generate the server router and validation logic to `./src/generated`
134134
```sh npm2yarn
135-
npm run openapi-code-generator \
135+
npm exec -- openapi-code-generator \
136136
--input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
137137
--output ./src/generated \
138138
--template typescript-express
@@ -152,23 +152,23 @@ You can check the version we develop and test against [here](https://github.com/
152152
## CLI options
153153
See the [cli reference](../reference/cli-options) for the full range of supported options, or try
154154
```sh npm2yarn
155-
npm run openapi-code-generator --help
155+
npm exec -- openapi-code-generator --help
156156
```
157157

158158
## Typespec specifications
159159
If you want to use [typespec](https://typespec.io/) instead of [openapi3](https://spec.openapis.org/oas/latest.html)
160160
as your input specifications, additionally install the typespec compiler and supporting packages.
161161

162162
```sh npm2yarn
163-
npm i --dev @typespec/compiler @typespec/http @typespec/openapi @typespec/openapi3 @typespec/versioning
163+
npm i --save-dev @typespec/compiler @typespec/http @typespec/openapi @typespec/openapi3 @typespec/versioning
164164
```
165165

166166
Depending on how your `typespec` specification is written, you may need to install additional packages such
167167
as `@typespec/rest`.
168168

169169
You can then generate like so:
170170
```sh npm2yarn
171-
npm run openapi-code-generator \
171+
npm exec -- openapi-code-generator \
172172
--input ./some-service.tsp \ # or https://example.com/some-service.tsp
173173
--input-type=typespec \
174174
--output ./src/generated/clients/some-service \

packages/documentation/src/app/guides/client-templates/typescript-angular/page.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ See [integration-tests/typescript-angular](https://github.com/mnahkies/openapi-c
2121
### Install dependencies
2222
First install the CLI to your project:
2323
```sh npm2yarn
24-
npm i --dev @nahkies/openapi-code-generator
24+
npm i --save-dev @nahkies/openapi-code-generator
2525
```
2626

2727
See also [quick start](../../getting-started/quick-start) guide
@@ -32,7 +32,7 @@ See also [quick start](../../getting-started/quick-start) guide
3232

3333
<Tabs.Tab>
3434
```sh npm2yarn
35-
npm run openapi-code-generator \
35+
npm exec -- openapi-code-generator \
3636
--input ./openapi.yaml \
3737
--input-type openapi3 \
3838
--output ./src/app/clients/some-service \
@@ -42,7 +42,7 @@ See also [quick start](../../getting-started/quick-start) guide
4242
</Tabs.Tab>
4343
<Tabs.Tab>
4444
```sh npm2yarn
45-
npm run openapi-code-generator \
45+
npm exec -- openapi-code-generator \
4646
--input ./typespec.tsp \
4747
--input-type typespec \
4848
--output ./src/app/clients/some-service \

packages/documentation/src/app/guides/client-templates/typescript-axios/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ See [integration-tests/typescript-axios](https://github.com/mnahkies/openapi-cod
2222
### Install dependencies
2323
First install the CLI and the required runtime packages to your project:
2424
```sh npm2yarn
25-
npm i --dev @nahkies/openapi-code-generator
26-
npm i axios @nahkies/typescript-axios-runtime
25+
npm i --save-dev @nahkies/openapi-code-generator
26+
npm i --save axios @nahkies/typescript-axios-runtime
2727
```
2828

2929
See also [quick start](../../getting-started/quick-start) guide
@@ -38,7 +38,7 @@ See also [quick start](../../getting-started/quick-start) guide
3838

3939
<Tabs.Tab>
4040
```sh npm2yarn
41-
npm run openapi-code-generator \
41+
npm exec -- openapi-code-generator \
4242
--input ./openapi.yaml \
4343
--input-type openapi3 \
4444
--output ./src/clients/some-service \
@@ -48,7 +48,7 @@ See also [quick start](../../getting-started/quick-start) guide
4848
</Tabs.Tab>
4949
<Tabs.Tab>
5050
```sh npm2yarn
51-
npm run openapi-code-generator \
51+
npm exec -- openapi-code-generator \
5252
--input ./typespec.tsp \
5353
--input-type typespec \
5454
--output ./src/clients/some-service \

packages/documentation/src/app/guides/client-templates/typescript-fetch/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Dependencies:
2222
### Install dependencies
2323
First install the CLI and the required runtime packages to your project:
2424
```sh npm2yarn
25-
npm i --dev @nahkies/openapi-code-generator
26-
npm i @nahkies/typescript-fetch-runtime
25+
npm i --save-dev @nahkies/openapi-code-generator
26+
npm i --save @nahkies/typescript-fetch-runtime
2727
```
2828

2929
See also [quick start](../../getting-started/quick-start) guide
@@ -43,7 +43,7 @@ See also [quick start](../../getting-started/quick-start) guide
4343

4444
<Tabs.Tab>
4545
```sh npm2yarn
46-
npm run openapi-code-generator \
46+
npm exec -- openapi-code-generator \
4747
--input ./openapi.yaml \
4848
--input-type openapi3 \
4949
--output ./src/clients/some-service \
@@ -54,7 +54,7 @@ See also [quick start](../../getting-started/quick-start) guide
5454

5555
<Tabs.Tab>
5656
```sh npm2yarn
57-
npm run openapi-code-generator \
57+
npm exec -- openapi-code-generator \
5858
--input ./typespec.tsp \
5959
--input-type typespec \
6060
--output ./src/clients/some-service \

packages/documentation/src/app/guides/server-templates/typescript-express/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ See [integration-tests/typescript-express](https://github.com/mnahkies/openapi-c
1818
### Install dependencies
1919
First install the CLI and the required runtime packages to your project:
2020
```sh npm2yarn
21-
npm i --dev @nahkies/openapi-code-generator @types/express
22-
npm i @nahkies/typescript-express-runtime express zod
21+
npm i --save-dev @nahkies/openapi-code-generator @types/express
22+
npm i --save @nahkies/typescript-express-runtime express zod
2323
```
2424

2525
See also [quick start](../../getting-started/quick-start) guide
@@ -29,7 +29,7 @@ See also [quick start](../../getting-started/quick-start) guide
2929

3030
<Tabs.Tab>
3131
```sh npm2yarn
32-
npm run openapi-code-generator \
32+
npm exec -- openapi-code-generator \
3333
--input ./openapi.yaml \
3434
--input-type openapi3 \
3535
--output ./src/generated \
@@ -39,7 +39,7 @@ See also [quick start](../../getting-started/quick-start) guide
3939
</Tabs.Tab>
4040
<Tabs.Tab>
4141
```sh npm2yarn
42-
npm run openapi-code-generator \
42+
npm exec -- openapi-code-generator \
4343
--input ./typespec.tsp \
4444
--input-type typespec \
4545
--output ./src/generated \

packages/documentation/src/app/guides/server-templates/typescript-koa/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ See [integration-tests/typescript-koa](https://github.com/mnahkies/openapi-code-
1919
### Install dependencies
2020
First install the CLI and the required runtime packages to your project:
2121
```sh npm2yarn
22-
npm i --dev @nahkies/openapi-code-generator @types/koa @types/koa__router
23-
npm i @nahkies/typescript-koa-runtime @koa/cors @koa/router koa koa-body zod
22+
npm i --save-dev @nahkies/openapi-code-generator @types/koa @types/koa__router
23+
npm i --save @nahkies/typescript-koa-runtime @koa/cors @koa/router koa koa-body zod
2424
```
2525

2626
See also [quick start](../../getting-started/quick-start) guide
@@ -30,7 +30,7 @@ See also [quick start](../../getting-started/quick-start) guide
3030

3131
<Tabs.Tab>
3232
```sh npm2yarn
33-
npm run openapi-code-generator \
33+
npm exec -- openapi-code-generator \
3434
--input ./openapi.yaml \
3535
--input-type openapi3 \
3636
--output ./src \
@@ -40,7 +40,7 @@ See also [quick start](../../getting-started/quick-start) guide
4040
</Tabs.Tab>
4141
<Tabs.Tab>
4242
```sh npm2yarn
43-
npm run openapi-code-generator \
43+
npm exec -- openapi-code-generator \
4444
--input ./typespec.tsp \
4545
--input-type typespec \
4646
--output ./src \

0 commit comments

Comments
 (0)