Skip to content

Commit 12009e4

Browse files
authored
Merge branch 'ferdikoomen:main' into master
2 parents 2a988d8 + 42feab7 commit 12009e4

File tree

145 files changed

+13871
-24574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+13871
-24574
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [ferdikoomen]

.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: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.29.0] - 2024-04-05
5+
> Please migrate your projects to use [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts)
6+
7+
The `@hey-api/openapi-ts`
8+
project started as a fork with the goal to resolve the most pressing issues. going forward they are planning to
9+
maintain the OpenAPI generator and give it the love it deserves. Please support them with their work and make
10+
sure to migrate your projects: https://heyapi.vercel.app/openapi-ts/migrating.html
11+
12+
### Fixed
13+
- Upgraded dependencies
14+
15+
16+
## [0.28.0] - 2024-03-19
17+
### Fixed
18+
- Upgraded dependencies
19+
- Windows issue when resolving external spec files
20+
- Media-type for falsy bodies except 'undefined'
21+
- Updated typo in generated header
22+
### Added
23+
- Enabled `withXSRFToken` for Axios
24+
25+
## [0.27.0] - 2024-01-15
26+
### Fixed
27+
- Reverted `@apidevtools/json-schema-ref-parser` to version 10.1.0
28+
29+
## [0.26.0] - 2024-01-07
30+
### Fixed
31+
- Upgraded dependencies
32+
33+
## [0.25.0] - 2023-07-05
34+
### Fixed
35+
- Upgraded dependencies
36+
### Added
37+
- Allow usage of a custom axios instance
38+
- Added message in generated files
39+
40+
## [0.24.0] - 2023-04-10
41+
### Fixed
42+
- Upgraded dependencies
43+
- Fixed issue with Cancelable promise
44+
- Fixed issue with escaping reserved keywords in schema names
45+
### Added
46+
- Added `--postfixModels` option
47+
448
## [0.23.0] - 2022-06-02
549
### Fixed
650
- Upgraded dependencies

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ https://help.github.com/articles/using-pull-requests
2020

2121
## Submitting a Pull Request
2222

23-
1. Make your changes in a new git branch: `git checkout -b my-fix-branch master`
23+
1. Make your changes in a new git branch: `git checkout -b my-fix-branch main`
2424
2. Create your patch or feature
2525
3. Ensure the builds work by running: `npm run build`
2626
4. Ensure the tests will pass by running: `npm run test`

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:alpine
2+
WORKDIR /usr/src/openapi
3+
COPY . /usr/src/openapi
4+
RUN npm install
5+
RUN npm run release
6+
ENTRYPOINT [ "node", "/usr/src/openapi/bin/index.js" ]
7+
CMD "--help"

README.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
# Important announcement
2+
3+
> [!IMPORTANT]
4+
> Please migrate your projects to use [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts)
5+
6+
Due to time limitations on my end, this project has been unmaintained for a while now. The `@hey-api/openapi-ts`
7+
project started as a fork with the goal to resolve the most pressing issues. going forward they are planning to
8+
maintain the OpenAPI generator and give it the love it deserves. Please support them with their work and make
9+
sure to migrate your projects: https://heyapi.vercel.app/openapi-ts/migrating.html
10+
11+
- All open PR's and issues will be archived on the 1st of May 2024
12+
- All versions of this package will be deprecated in NPM
13+
14+
👋 Thanks for all the support, downloads and love! Cheers Ferdi.
15+
16+
---
17+
118
# OpenAPI Typescript Codegen
219

320
[![NPM][npm-image]][npm-url]
421
[![License][license-image]][license-url]
5-
[![Coverage][coverage-image]][coverage-url]
6-
[![Quality][quality-image]][quality-url]
7-
[![Code Climate][climate-image]][climate-url]
822
[![Downloads][downloads-image]][downloads-url]
923
[![Build][build-image]][build-url]
1024

@@ -14,7 +28,7 @@
1428
- Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
1529
- Quick, lightweight, robust and framework-agnostic 🚀
1630
- Supports generation of TypeScript clients
17-
- Supports generations of Fetch, [Node-Fetch](#node-fetch-support), [Axios](#axios-support), [Angular](#angular-support) and XHR http clients
31+
- Supports generations of Fetch, Node-Fetch, Axios, Angular and XHR http clients
1832
- Supports OpenAPI specification v2.0 and v3.0
1933
- Supports JSON and YAML files for input
2034
- Supports generation through CLI, Node.js and NPX
@@ -60,37 +74,27 @@ $ openapi-typescript-codegen --help
6074

6175
Documentation
6276
===
63-
- [Basic usage](docs/basic-usage.md)
64-
- [OpenAPI object](docs/openapi-object.md)
65-
- [Client instances](docs/client-instances.md) `--name`
66-
- [Argument vs. Object style](docs/arguments-vs-object-style.md) `--useOptions`
67-
- [Enums vs. Union types](docs/enum-vs-union-types.md) `--useUnionTypes`
68-
- [Runtime schemas](docs/runtime-schemas.md) `--exportSchemas`
69-
- [Enum with custom names and descriptions](docs/custom-enums.md)
70-
- [Nullable props (OpenAPI v2)](docs/nullable-props.md)
71-
- [Authorization](docs/authorization.md)
72-
- [External references](docs/external-references.md)
73-
- [Canceling requests](docs/canceling-requests.md)
74-
- [Custom request file](docs/custom-request-file.md)
75-
76-
Support
77+
78+
The main documentation can be found in the [openapi-typescript-codegen/wiki](https://github.com/ferdikoomen/openapi-typescript-codegen/wiki)
79+
80+
Sponsors
7781
===
78-
- [Babel support](docs/babel-support.md)
79-
- [Axios support](docs/axios-support.md)
80-
- [Angular support](docs/angular-support.md)
81-
- [Node-Fetch support](docs/node-fetch-support.md)
82+
83+
If you or your company use the OpenAPI Typescript Codegen, please consider supporting me. By sponsoring I can free up time to give this project some love! Details can be found here: https://github.com/sponsors/ferdikoomen
84+
85+
If you're from an enterprise looking for a fully managed SDK generation, please consider our sponsor:
86+
87+
<a href="https://speakeasyapi.dev/?utm_source=ferdi+repo&utm_medium=github+sponsorship">
88+
<img alt="speakeasy" src="https://storage.googleapis.com/speakeasy-design-assets/ferdi-sponsorship.png" width="640"/>
89+
</a>
8290

8391
[npm-url]: https://npmjs.org/package/openapi-typescript-codegen
8492
[npm-image]: https://img.shields.io/npm/v/openapi-typescript-codegen.svg
8593
[license-url]: LICENSE
8694
[license-image]: http://img.shields.io/npm/l/openapi-typescript-codegen.svg
8795
[coverage-url]: https://codecov.io/gh/ferdikoomen/openapi-typescript-codegen
8896
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg
89-
[quality-url]: https://lgtm.com/projects/g/ferdikoomen/openapi-typescript-codegen
90-
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/ferdikoomen/openapi-typescript-codegen.svg
91-
[climate-url]: https://codeclimate.com/github/ferdikoomen/openapi-typescript-codegen
92-
[climate-image]: https://img.shields.io/codeclimate/maintainability/ferdikoomen/openapi-typescript-codegen.svg
9397
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
9498
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
95-
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master
96-
[build-image]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master.svg?style=svg
99+
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/main
100+
[build-image]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/main.svg?style=svg

bin/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const params = program
2121
.option('--exportModels <value>', 'Write models to disk', true)
2222
.option('--exportSchemas <value>', 'Write schemas to disk', false)
2323
.option('--indent <value>', 'Indentation options [4, 2, tabs]', '4')
24-
.option('--postfix <value>', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Service')
2524
.option('--postfixServices <value>', 'Service name postfix', 'Service')
2625
.option('--postfixModels <value>', 'Model name postfix')
2726
.option('--request <value>', 'Path to custom request file')
@@ -43,7 +42,7 @@ if (OpenAPI) {
4342
exportModels: JSON.parse(params.exportModels) === true,
4443
exportSchemas: JSON.parse(params.exportSchemas) === true,
4544
indent: params.indent,
46-
postfixServices: params.postfixServices ?? params.postfix,
45+
postfixServices: params.postfixServices,
4746
postfixModels: params.postfixModels,
4847
request: params.request,
4948
})

bin/index.spec.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,4 @@ describe('bin', () => {
6969
expect(result.stdout.toString()).toContain(`-o, --output <value>`);
7070
expect(result.stderr.toString()).toBe('');
7171
});
72-
73-
it('should still support the deprecated --postfix parameter', () => {
74-
const result = crossSpawn.sync('node', [
75-
'./bin/index.js',
76-
'--input',
77-
'./test/spec/v3.json',
78-
'--output',
79-
'./test/generated/bin',
80-
'--postfix',
81-
'Service',
82-
]);
83-
expect(result.stdout.toString()).toBe('');
84-
expect(result.stderr.toString()).toBe('');
85-
});
8672
});

docs/angular-support.md

Lines changed: 0 additions & 89 deletions
This file was deleted.

docs/arguments-vs-object-style.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)