mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
typescript-node: clean up require and import (#6947)
* Fix for issue 4656 typescript-node generate invalid require statement instead of import statement * Fixed broken link under testing templates * Result of run generate-samples.sh / typescript-node* * import stmt depending on flag supportsES6 * Update petstore sample for typescript-node * import ... from stmt for http/request module * update samples * update doc Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
parent
0f3edb13f5
commit
b838e1885f
@ -87,8 +87,7 @@ To add test cases (optional) covering the change in the code generator, please r
|
|||||||
To test the templates, please perform the following:
|
To test the templates, please perform the following:
|
||||||
|
|
||||||
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
|
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
|
||||||
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/t
|
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
|
||||||
ree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
|
|
||||||
enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro
|
enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro
|
||||||
m time to time. If you've questions or concerns, please open a ticket to start a discussion)
|
m time to time. If you've questions or concerns, please open a ticket to start a discussion)
|
||||||
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
|
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
|
||||||
|
@ -91,8 +91,7 @@ To add test cases (optional) covering the change in the code generator, please r
|
|||||||
To test the templates, please perform the following:
|
To test the templates, please perform the following:
|
||||||
|
|
||||||
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
|
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
|
||||||
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/t
|
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
|
||||||
ree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
|
|
||||||
enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro
|
enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro
|
||||||
m time to time. If you've questions or concerns, please open a ticket to start a discussion)
|
m time to time. If you've questions or concerns, please open a ticket to start a discussion)
|
||||||
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
|
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{{>licenseInfo}}
|
{{>licenseInfo}}
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
{{#imports}}
|
{{#imports}}
|
||||||
|
@ -4,7 +4,7 @@ export * from '{{{ classFilename }}}';
|
|||||||
{{/model}}
|
{{/model}}
|
||||||
{{/models}}
|
{{/models}}
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
import localVarRequest from 'request';
|
||||||
|
|
||||||
{{#models}}
|
{{#models}}
|
||||||
{{#model}}
|
{{#model}}
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}",
|
"target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}",
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
import { ApiResponse } from '../model/apiResponse';
|
import { ApiResponse } from '../model/apiResponse';
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
import { Order } from '../model/order';
|
import { Order } from '../model/order';
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
import { User } from '../model/user';
|
import { User } from '../model/user';
|
||||||
|
@ -5,7 +5,7 @@ export * from './pet';
|
|||||||
export * from './tag';
|
export * from './tag';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
import localVarRequest from 'request';
|
||||||
|
|
||||||
import { ApiResponse } from './apiResponse';
|
import { ApiResponse } from './apiResponse';
|
||||||
import { Category } from './category';
|
import { Category } from './category';
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
import { ApiResponse } from '../model/apiResponse';
|
import { ApiResponse } from '../model/apiResponse';
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
import { Order } from '../model/order';
|
import { Order } from '../model/order';
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
|
||||||
import http = require('http');
|
import localVarRequest from 'request';
|
||||||
|
import http from 'http';
|
||||||
|
|
||||||
/* tslint:disable:no-unused-locals */
|
/* tslint:disable:no-unused-locals */
|
||||||
import { User } from '../model/user';
|
import { User } from '../model/user';
|
||||||
|
@ -5,7 +5,7 @@ export * from './pet';
|
|||||||
export * from './tag';
|
export * from './tag';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
|
|
||||||
import localVarRequest = require('request');
|
import localVarRequest from 'request';
|
||||||
|
|
||||||
import { ApiResponse } from './apiResponse';
|
import { ApiResponse } from './apiResponse';
|
||||||
import { Category } from './category';
|
import { Category } from './category';
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "ES5",
|
"target": "ES5",
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user