Skip to content

Commit ec88480

Browse files
committed
Merge remote-tracking branch 'upstream/master' into custom-templates
2 parents 34a4ef5 + 3361658 commit ec88480

33 files changed

+5525
-18226
lines changed

.circleci/config.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
version: 2
22
jobs:
33
build:
4-
working_directory: ~/repo
54
docker:
65
- image: cimg/node:lts-browsers
6+
resource_class: large
7+
working_directory: ~/repo
78
steps:
89
- checkout
910
- restore_cache:
1011
keys:
11-
- v1-dependencies-{{ checksum "package.json" }}
12+
- v1-dependencies-{{ checksum "package-lock.json" }}
1213
- v1-dependencies-
1314
- run:
1415
name: Install dependencies
15-
command: npm install --force
16+
command: npm install
1617
- save_cache:
17-
key: v1-dependencies-{{ checksum "package.json" }}
18+
key: v1-dependencies-{{ checksum "package-lock.json" }}
1819
paths:
1920
- node_modules
2021
- run:
2122
name: Build library
2223
command: npm run release
2324
- run:
2425
name: Run unit tests
25-
command: npm run test:coverage
26-
- run:
27-
name: Run e2e tests
28-
command: npm run test:e2e
26+
command: npm run test
27+
# - run:
28+
# name: Run e2e tests
29+
# command: npm run test:e2e
2930
- run:
3031
name: Submit to Codecov
3132
command: npm run codecov

.github/workflows/codeql.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: "44 20 * * 3"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ javascript ]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
queries: +security-and-quality
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2
40+
with:
41+
category: "/language:${{ matrix.language }}"

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.24.0] - 2023-04-10
5+
### Fixed
6+
- Upgraded dependencies
7+
- Fixed issue with Cancelable promise
8+
- Fixed issue with escaping reserved keywords in schema names
9+
### Added
10+
- Added `--postfixModels` option
11+
412
## [0.23.0] - 2022-06-02
513
### Fixed
614
- Upgraded dependencies

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ To release a new version, run `npm run release` and push everything, including t
1717
[![NPM][npm-image]][npm-url]
1818
[![License][license-image]][license-url]
1919
[![Coverage][coverage-image]][coverage-url]
20-
[![Quality][quality-image]][quality-url]
21-
[![Code Climate][climate-image]][climate-url]
2220
[![Downloads][downloads-image]][downloads-url]
2321
[![Build][build-image]][build-url]
2422

@@ -28,7 +26,7 @@ To release a new version, run `npm run release` and push everything, including t
2826
- Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
2927
- Quick, lightweight, robust and framework-agnostic 🚀
3028
- Supports generation of TypeScript clients
31-
- Supports generations of Fetch, [Node-Fetch](#node-fetch-support), [Axios](#axios-support), [Angular](#angular-support) and XHR http clients
29+
- Supports generations of Fetch, Node-Fetch, Axios, Angular and XHR http clients
3230
- Supports OpenAPI specification v2.0 and v3.0
3331
- Supports JSON and YAML files for input
3432
- Supports generation through CLI, Node.js and NPX
@@ -62,7 +60,8 @@ $ openapi --help
6260
--exportModels <value> Write models to disk (default: true)
6361
--exportSchemas <value> Write schemas to disk (default: false)
6462
--indent <value> Indentation options [4, 2, tab] (default: "4")
65-
--postfix <value> Service name postfix (default: "Service")
63+
--postfixServices Service name postfix (default: "Service")
64+
--postfixModels Model name postfix
6665
--request <value> Path to custom request file
6766
--serviceTemplate Path to custom service handlebars template to generate the service files
6867
-h, --help display help for command
@@ -100,10 +99,6 @@ Support
10099
[license-image]: http://img.shields.io/npm/l/openapi-typescript-codegen.svg
101100
[coverage-url]: https://codecov.io/gh/ferdikoomen/openapi-typescript-codegen
102101
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg
103-
[quality-url]: https://lgtm.com/projects/g/ferdikoomen/openapi-typescript-codegen
104-
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/ferdikoomen/openapi-typescript-codegen.svg
105-
[climate-url]: https://codeclimate.com/github/ferdikoomen/openapi-typescript-codegen
106-
[climate-image]: https://img.shields.io/codeclimate/maintainability/ferdikoomen/openapi-typescript-codegen.svg
107102
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
108103
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
109104
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master

bin/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const params = program
2323
.option('--exportIndex <value>', 'Write Index to disk', true)
2424
.option('--exportSchemas <value>', 'Write schemas to disk', false)
2525
.option('--indent <value>', 'Indentation options [4, 2, tabs]', '4')
26-
.option('--postfix <value>', 'Service name postfix', 'Service')
26+
.option('--postfixServices <value>', 'Service name postfix', 'Service')
27+
.option('--postfixModels <value>', 'Model name postfix')
2728
.option('--request <value>', 'Path to custom request file')
2829
.option('--serviceTemplate <value>', 'Path to custom service handlebars template to generate the service files')
2930
.option('--clientTemplate <value>', 'Path to custom client handlebars template to generate the client file')
@@ -48,7 +49,8 @@ if (OpenAPI) {
4849
exportIndex: JSON.parse(params.exportIndex) === true,
4950
exportSchemas: JSON.parse(params.exportSchemas) === true,
5051
indent: params.indent,
51-
postfix: params.postfix,
52+
postfixServices: params.postfixServices,
53+
postfixModels: params.postfixModels,
5254
request: params.request,
5355
serviceTemplate: params.serviceTemplate,
5456
clientTemplate: params.clientTemplate,

bin/index.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ describe('bin', () => {
3434
'true',
3535
'--indent',
3636
'4',
37-
'--postfix',
37+
'--postfixServices',
3838
'Service',
39+
'--postfixModels',
40+
'Dto',
3941
]);
4042
expect(result.stdout.toString()).toBe('');
4143
expect(result.stderr.toString()).toBe('');

docs/angular-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ If you want to generate the Angular based client then you can specify `--client
99
The Angular client has been tested with the following versions:
1010

1111
```
12-
"@angular/common": "14.0.x",
13-
"@angular/core": "14.0.x",
12+
"@angular/common": "15.0.x",
13+
"@angular/core": "15.0.x",
1414
"rxjs": "7.5.x",
1515
```
1616

docs/basic-usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ $ openapi --help
1818
--exportModels <value> Write models to disk (default: true)
1919
--exportSchemas <value> Write schemas to disk (default: false)
2020
--indent <value> Indentation options [4, 2, tab] (default: "4")
21-
--postfix <value> Service name postfix (default: "Service")
21+
--postfixServices Service name postfix (default: "Service")
22+
--postfixModels Model name postfix
2223
--request <value> Path to custom request file
2324
-h, --help display help for command
2425

0 commit comments

Comments
 (0)