Skip to content

Commit 7287693

Browse files
committed
update
1 parent 4408d79 commit 7287693

File tree

3 files changed

+33
-37
lines changed

3 files changed

+33
-37
lines changed

README.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,36 @@
1-
# OpenAPI Interface Generator
1+
# Next OpenAPI Interface Generator
22

3-
Provides an npm command to generate TypeScript code for services defined in a source JSON file.
3+
![GitHub](https://img.shields.io/github/license/omermecitoglu/next-openapi-interface-generator)
4+
![GitHub package.json version](https://img.shields.io/github/package-json/v/omermecitoglu/next-openapi-interface-generator)
5+
6+
This script automates the generation of documentation and TypeScript interfaces for a service, making it easier to maintain and interact with the service in a TypeScript environment.
47

58
## Installation
69

710
```bash
8-
npm install @omer-x/ts-openapi-interface-generator
11+
npm install @omer-x/next-openapi-interface-generator
912
```
1013

1114
## Usage
1215

13-
1. Ensure you have a `source.json` file in the root directory of your project with the following structure:
14-
15-
```json
16-
{
17-
"services": [
18-
{
19-
"name": "ExampleService",
20-
"url": "https://example.com/api",
21-
"specs": "/swagger"
22-
}
23-
]
24-
}
16+
```bash
17+
generate-service-interface --source <source_directory> --output <output_directory>
2518
```
2619

27-
2. Run the following command to generate code for each service defined in `source.json`:
20+
### Options
2821

29-
```bash
30-
npx generate-service-interfaces
31-
```
22+
- `--source`, `-s`: Specify the source directory. Default: `src`
23+
- `--output`, `-o`: Specify the output directory. Default: `dist`
3224

33-
This will generate code in the `src` folder for each service.
25+
## Example
3426

35-
## Configuration
27+
```bash
28+
generate-service-interface --source src/app --output dist
29+
```
3630

37-
You can customize the source JSON file by specifying additional properties for each service:
31+
## Contributing
3832

39-
- `name`: The name of the service.
40-
- `url`: The URL of the service.
41-
- `specs` (optional): The path to the OpenAPI specifications. Default value is "/swagger".
33+
Contributions are welcome! Please feel free to submit a pull request or open an issue if you find any bugs or have any suggestions for improvement.
4234

4335
## License
4436

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
2-
"name": "@omer-x/ts-openapi-interface-generator",
3-
"version": "1.0.0",
4-
"description": "OpenAPI interface generator for TypeScript",
2+
"name": "@omer-x/next-openapi-interface-generator",
3+
"version": "0.0.0",
4+
"description": "OpenAPI interface generator for Next.js",
55
"keywords": [
6+
"next",
7+
"nextjs",
68
"typescript",
79
"openapi",
10+
"swagger",
811
"interface",
912
"generator",
1013
"codegen"
1114
],
1215
"repository": {
1316
"type": "git",
14-
"url": "git+https://github.com/omermecitoglu/ts-openapi-interface-generator.git"
17+
"url": "git+https://github.com/omermecitoglu/next-openapi-interface-generator.git"
1518
},
1619
"bugs": {
17-
"url": "https://github.com/omermecitoglu/ts-openapi-interface-generator/issues"
20+
"url": "https://github.com/omermecitoglu/next-openapi-interface-generator/issues"
1821
},
19-
"homepage": "https://github.com/omermecitoglu/ts-openapi-interface-generator#readme",
22+
"homepage": "https://github.com/omermecitoglu/next-openapi-interface-generator#readme",
2023
"private": false,
2124
"publishConfig": {
2225
"access": "public"
@@ -27,8 +30,9 @@
2730
"url": "https://omermecitoglu.github.io"
2831
},
2932
"license": "MIT",
33+
"main": "bin/index.js",
3034
"bin": {
31-
"generate-service-interfaces": "./bin/index.js"
35+
"generate-service-interface": "./bin/index.js"
3236
},
3337
"files": [
3438
"bin/"

0 commit comments

Comments
 (0)