Skip to content

Commit 4c56a5e

Browse files
committed
feat: Support node 20
1 parent 5bbb87f commit 4c56a5e

7 files changed

Lines changed: 33 additions & 11 deletions

File tree

.github/workflows/main_build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
- name: Configure NodeJS
14-
uses: actions/setup-node@v2
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: '14'
16+
node-version-file: '.nvmrc'
17+
cache: npm
1718
- name: Install Dependencies
1819
run: npm ci
1920
- name: Lint

.github/workflows/pull_request_build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
- name: Configure NodeJS
14-
uses: actions/setup-node@v2
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: '14'
16+
node-version-file: '.nvmrc'
17+
cache: npm
1718
- name: Install Dependencies
1819
run: npm ci
1920
- name: Lint

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
- name: Configure NodeJS
14-
uses: actions/setup-node@v2
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: '14'
16+
node-version-file: '.nvmrc'
1717
registry-url: https://registry.npmjs.org
18+
cache: npm
1819
- name: Install Dependencies
1920
run: npm ci
2021
- name: Get the version

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/iron

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@
22

33
Generate typed request handlers from an OpenApi spec.
44

5-
See `src/cli.ts` for usage.
5+
```sh
6+
$ express-typescript-codegen generate -h
7+
8+
Usage: cli generate [options] <spec-filename-or-url>
9+
10+
Generates typescript code from the spec.
11+
12+
Options:
13+
--template <template> the type to output. client, server or types. Default client
14+
--filename <filename> the file to output. Defaults to <service-name><output-type>.generated.ts
15+
--service-name <name> the name of the service. Defaults to info.title from the open api document
16+
--not-required-type <nullable|optional|both> what type fields should be if they are not in the required list. Defaults to undefined (default: "optional")
17+
--readonly-dtos specifies that fields in DTOs, and array types therein should be prefixed with `readonly`. Defaults to false (default: "optional")
18+
-h, --help display help for command
19+
```

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,8 @@
8989
},
9090
"peerDependencies": {
9191
"tslib": "^2.2.0"
92+
},
93+
"engines": {
94+
"node": ">=16"
9295
}
9396
}

src/lib/cli-logging/processLogger.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-console */
22
import chalk from 'chalk';
3+
import readline from 'readline';
34
import { LogFn, Logger } from './types';
45

56
const o = process.stdout;
@@ -9,7 +10,7 @@ const progressLogger = (start: number): LogFn => {
910
let last = 0;
1011

1112
return m => {
12-
o.cursorTo(start);
13+
readline.cursorTo(o, start);
1314
o.write(m);
1415

1516
if (m.length < last) {

0 commit comments

Comments
 (0)