Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript-node: clean up require and import #6947

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

- 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
ree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
/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
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)
- 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`.
Expand Down
3 changes: 1 addition & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

- 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
ree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
/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
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)
- 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`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>licenseInfo}}
import localVarRequest = require('request');
import http = require('http');

import localVarRequest from 'request';
import http from 'http';

/* tslint:disable:no-unused-locals */
{{#imports}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export * from '{{{ classFilename }}}';
{{/model}}
{{/models}}

import localVarRequest = require('request');
import localVarRequest from 'request';

{{#models}}
{{#model}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strict": true,
"moduleResolution": "node",
"removeComments": true,
Expand Down
5 changes: 3 additions & 2 deletions samples/client/petstore/typescript-node/default/api/petApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* 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 */
import { ApiResponse } from '../model/apiResponse';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* 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 */
import { Order } from '../model/order';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* 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 */
import { User } from '../model/user';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export * from './pet';
export * from './tag';
export * from './user';

import localVarRequest = require('request');
import localVarRequest from 'request';

import { ApiResponse } from './apiResponse';
import { Category } from './category';
Expand Down
5 changes: 3 additions & 2 deletions samples/client/petstore/typescript-node/npm/api/petApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* 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 */
import { ApiResponse } from '../model/apiResponse';
Expand Down
5 changes: 3 additions & 2 deletions samples/client/petstore/typescript-node/npm/api/storeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* 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 */
import { Order } from '../model/order';
Expand Down
5 changes: 3 additions & 2 deletions samples/client/petstore/typescript-node/npm/api/userApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* 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 */
import { User } from '../model/user';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export * from './pet';
export * from './tag';
export * from './user';

import localVarRequest = require('request');
import localVarRequest from 'request';

import { ApiResponse } from './apiResponse';
import { Category } from './category';
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/typescript-node/npm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"target": "ES5",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strict": true,
"moduleResolution": "node",
"removeComments": true,
Expand Down