Skip to content

Commit 2d83f94

Browse files
committed
initial commit
1 parent bb06b42 commit 2d83f94

31 files changed

+8690
-225
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.eslintrc

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2018,
6+
"sourceType": "module",
7+
"project": "./tsconfig.*?.json"
8+
},
9+
"ignorePatterns": ["**/*"],
10+
"plugins": ["@typescript-eslint", "@nrwl/nx"],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/eslint-recommended",
14+
"plugin:@typescript-eslint/recommended",
15+
"prettier",
16+
"prettier/@typescript-eslint"
17+
],
18+
"rules": {
19+
"@typescript-eslint/explicit-member-accessibility": "off",
20+
"@typescript-eslint/explicit-function-return-type": "off",
21+
"@typescript-eslint/no-parameter-properties": "off",
22+
"@nrwl/nx/enforce-module-boundaries": [
23+
"error",
24+
{
25+
"enforceBuildableLibDependency": true,
26+
"allow": [],
27+
"depConstraints": [
28+
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
29+
]
30+
}
31+
]
32+
},
33+
"overrides": [
34+
{
35+
"files": ["*.tsx"],
36+
"rules": {
37+
"@typescript-eslint/no-unused-vars": "off"
38+
}
39+
}
40+
]
41+
}

.gitignore

+39-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1-
.idea
2-
dist/
3-
node_modules/
4-
bin/openapi-generator.jar
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
4+
/coverage

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

README.md

+90-172
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,90 @@
1-
# @openapitools/openapi-generator-cli
2-
3-
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM)
4-
5-
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovateapp.com/)
6-
[![Build Status](https://travis-ci.org/openapitools/openapi-generator-cli.svg?branch=master)](https://travis-ci.org/OpenAPITools/openapi-generator-cli)
7-
[![HitCount](http://hits.dwyl.io/openapitools/openapi-generator-cli.svg)](http://hits.dwyl.com/openapitools/openapi-generator-cli)
8-
9-
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and
10-
configuration automatically given an OpenAPI Spec (both 2.0 and 3.0 are supported). Please see
11-
[OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator)
12-
13-
---
14-
15-
This project checks the [maven repository](https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli)
16-
once a day for a new version and will publish this new version automatically as an npm package.
17-
18-
**Thanks [openapitools.org](https://openapitools.org) for this awesome CLI!**
19-
20-
## Installation
21-
22-
There are several ways to install the package.
23-
24-
#### Global Mode
25-
26-
In global mode (ie, with -g or --global appended to the command), it installs the package as a global package. This
27-
means that you'll get the `openapi-generator` command available on your command line interface (CLI) as well.
28-
29-
```sh
30-
# install the latest version of "openapi-generator-cli"
31-
npm install @openapitools/openapi-generator-cli -g
32-
33-
# install a specific version of "openapi-generator-cli"
34-
npm install @openapitools/[email protected] -g
35-
```
36-
37-
After the installation has finished you can type for example:
38-
39-
```sh
40-
# this shall print the correct version number
41-
openapi-generator version
42-
```
43-
44-
#### Package Mode
45-
46-
It is recommended to install the package as development dependency, because normally you only need this dependency
47-
during the development process. To do that you can type the following:
48-
49-
```sh
50-
# install the latest version of "openapi-generator-cli"
51-
npm install @openapitools/openapi-generator-cli -D
52-
53-
# install a specific version of "openapi-generator-cli"
54-
npm install @openapitools/[email protected] -D
55-
```
56-
57-
After the installation has finished you can add a script like this:
58-
59-
```json
60-
// package.json
61-
{
62-
"name": "my-cool-package",
63-
"version": "0.0.0",
64-
"scripts": {
65-
"my-awesome-script-name": "openapi-generator generate -i docs/openapi.yaml -g typescript-angular -o generated-sources/openapi --additional-properties=ngVersion=6.1.7,npmName=restClient,supportsES6=true,npmVersion=6.9.0,withInterfaces=true",
66-
}
67-
}
68-
```
69-
Note the whitespace sensitivity when using mulitiple additional-properties.
70-
71-
#### Configuration File
72-
73-
It is also possible to store configurations for code generation in the package.json:
74-
75-
```json
76-
// package.json
77-
{
78-
"name": "my-cool-package",
79-
"version": "0.0.0",
80-
"scripts": {
81-
"my-awesome-script-name": "openapi-generator"
82-
},
83-
"openapi-generator": {
84-
"docs/*.yaml": [
85-
{
86-
"generator-name": "typescript-angular",
87-
"output": "#{root}/generated-sources/openapi/typescript-angular/#{name}",
88-
"additional-properties": {
89-
"fileNaming": "kebab-case",
90-
"apiModulePrefix": "#{Name}",
91-
"npmName": "#{name}RestClient",
92-
"supportsES6": true,
93-
"withInterfaces": true
94-
}
95-
},
96-
{
97-
"generator-name": "typescript-fetch",
98-
"output": "#{root}/generated-sources/openapi/typescript-fetch/#{name}"
99-
}
100-
]
101-
}
102-
}
103-
```
104-
105-
If you don't want to do the configuration in the package.json, you can put it into a separate file:
106-
107-
```json
108-
// package.json
109-
{
110-
"name": "my-cool-package",
111-
"version": "0.0.0",
112-
"scripts": {
113-
"my-awesome-script-name": "openapi-generator openapi-generator.json"
114-
}
115-
}
116-
117-
// openapi-generator.json
118-
{
119-
"docs/*.yaml": [
120-
{
121-
"generator-name": "typescript-angular",
122-
"output": "#{root}/generated-sources/openapi/typescript-angular/#{name}",
123-
"additional-properties": {
124-
"fileNaming": "kebab-case",
125-
"apiModulePrefix": "#{Name}",
126-
"npmName": "#{name}RestClient",
127-
"supportsES6": true,
128-
"withInterfaces": true
129-
}
130-
},
131-
{
132-
"generator-name": "typescript-fetch",
133-
"output": "#{root}/generated-sources/openapi/typescript-fetch/#{name}"
134-
}
135-
]
136-
}
137-
```
138-
139-
##### Executing Command Placeholders
140-
141-
| placeholder | description | example |
142-
|--------------|---------------------------------------------------------------|-------------------------------------------------------|
143-
| name | just file name | auth |
144-
| Name | just file name, but starting with a capital letter | Auth |
145-
| root | file root | /Users/some-user/projects/some-project |
146-
| base | file name and extension | auth.yaml |
147-
| path | full path and filename | /Users/some-user/projects/some-project/docs/auth.yaml |
148-
| dir | path without the filename | /Users/some-user/projects/some-project/docs |
149-
| reldir | directory name of file relative to the glob provided | docs |
150-
| relpath | file name and extension of file relative to the glob provided | docs/auth.yaml |
151-
| ext | just file extension | yaml |
152-
153-
## Usage Example
154-
155-
Mac/Linux:
156-
```
157-
openapi-generator generate -g ruby -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /var/tmp/ruby-client
158-
```
159-
160-
Windows:
161-
```
162-
openapi-generator generate -g ruby -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o C:\temp\ruby-client
163-
```
164-
165-
## Further Documentation
166-
167-
Please refer to the [official openapi-generator docs](https://github.com/OpenAPITools/openapi-generator#3---usage) for
168-
more information about the possible arguments and a detailed usage manual of the command line interface.
169-
170-
## You like the package?
171-
172-
Please leave a star.
1+
# Openapitools
2+
3+
This project was generated using [Nx](https://nx.dev).
4+
5+
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="450"></p>
6+
7+
🔎 **Nx is a set of Extensible Dev Tools for Monorepos.**
8+
9+
## Adding capabilities to your workspace
10+
11+
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
12+
13+
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.
14+
15+
Below are our core plugins:
16+
17+
- [React](https://reactjs.org)
18+
- `npm install --save-dev @nrwl/react`
19+
- Web (no framework frontends)
20+
- `npm install --save-dev @nrwl/web`
21+
- [Angular](https://angular.io)
22+
- `npm install --save-dev @nrwl/angular`
23+
- [Nest](https://nestjs.com)
24+
- `npm install --save-dev @nrwl/nest`
25+
- [Express](https://expressjs.com)
26+
- `npm install --save-dev @nrwl/express`
27+
- [Node](https://nodejs.org)
28+
- `npm install --save-dev @nrwl/node`
29+
30+
There are also many [community plugins](https://nx.dev/nx-community) you could add.
31+
32+
## Generate an application
33+
34+
Run `nx g @nrwl/react:app my-app` to generate an application.
35+
36+
> You can use any of the plugins above to generate applications as well.
37+
38+
When using Nx, you can create multiple applications and libraries in the same workspace.
39+
40+
## Generate a library
41+
42+
Run `nx g @nrwl/react:lib my-lib` to generate a library.
43+
44+
> You can also use any of the plugins above to generate libraries as well.
45+
46+
Libraries are sharable across libraries and applications. They can be imported from `@openapitools/mylib`.
47+
48+
## Development server
49+
50+
Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
51+
52+
## Code scaffolding
53+
54+
Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component.
55+
56+
## Build
57+
58+
Run `nx build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
59+
60+
## Running unit tests
61+
62+
Run `nx test my-app` to execute the unit tests via [Jest](https://jestjs.io).
63+
64+
Run `nx affected:test` to execute the unit tests affected by a change.
65+
66+
## Running end-to-end tests
67+
68+
Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).
69+
70+
Run `nx affected:e2e` to execute the end-to-end tests affected by a change.
71+
72+
## Understand your workspace
73+
74+
Run `nx dep-graph` to see a diagram of the dependencies of your projects.
75+
76+
## Further help
77+
78+
Visit the [Nx Documentation](https://nx.dev) to learn more.
79+
80+
## ☁ Nx Cloud
81+
82+
### Computation Memoization in the Cloud
83+
84+
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-cloud-card.png"></p>
85+
86+
Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly.
87+
88+
Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nx’s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers.
89+
90+
Visit [Nx Cloud](https://nx.app/) to learn more.

apps/.gitkeep

Whitespace-only changes.

apps/generator-cli/.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }

apps/generator-cli/jest.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
name: 'generator-cli',
3+
preset: '../../jest.config.js',
4+
globals: {
5+
'ts-jest': {
6+
tsConfig: '<rootDir>/tsconfig.spec.json',
7+
},
8+
},
9+
transform: {
10+
'^.+\\.[tj]s$': 'ts-jest',
11+
},
12+
moduleFileExtensions: ['ts', 'js', 'html'],
13+
coverageDirectory: '../../coverage/apps/generator-cli',
14+
};

apps/generator-cli/src/app/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)