Skip to content

Commit 4198c23

Browse files
committed
undo typescript change
1 parent 37dae59 commit 4198c23

File tree

31 files changed

+50
-36
lines changed

31 files changed

+50
-36
lines changed

modules/openapi-generator/src/main/resources/typescript/api/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {Configuration} from '../configuration{{importFileExtension}}';
44
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http{{importFileExtension}}';
55
{{#platforms}}
66
{{#node}}
7-
import FormData from "form-data";
7+
import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data";
88
import { URLSearchParams } from 'url';
99
{{/node}}
1010
{{/platforms}}

modules/openapi-generator/src/main/resources/typescript/http/http.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{#platforms}}
22
{{#node}}
33
// TODO: evaluate if we can easily get rid of this library
4-
import FormData from "form-data{{importFileExtension}}";
4+
import {{^supportsES6}}* as{{/supportsES6}} FormData from "form-data{{importFileExtension}}";
55
import { URL, URLSearchParams } from 'url{{importFileExtension}}';
66
import * as http from 'http{{importFileExtension}}';
77
import * as https from 'https{{importFileExtension}}';

modules/openapi-generator/src/main/resources/typescript/package.mustache

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,21 @@
1515
],
1616
"license": "Unlicense",
1717
"main": "./dist/index.js",
18-
{{#supportTypeModule}}
18+
{{#supportsES6}}
1919
"type": "module",
2020
"module": "./dist/index.js",
21-
{{/supportTypeModule}}
21+
{{/supportsES6}}
22+
{{^supportsES6}}
23+
"type": "commonjs",
24+
{{/supportsES6}}
2225
"exports": {
2326
".": {
27+
{{#supportsES6}}
2428
"import": "./dist/index.js",
29+
{{/supportsES6}}
30+
{{^supportsES6}}
31+
"require": "./dist/index.js",
32+
{{/supportsES6}}
2533
"types": "./dist/index.d.js"
2634
}
2735
},

modules/openapi-generator/src/main/resources/typescript/tsconfig.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"compilerOptions": {
33
"strict": true,
44
/* Basic Options */
5+
{{#supportsES6}}
56
"target": "es6",
67
"esModuleInterop": true,
8+
{{/supportsES6}}
9+
{{^supportsES6}}
10+
"target": "es5",
11+
{{/supportsES6}}
712
"moduleResolution": "node",
813
"declaration": true,
914

samples/client/others/typescript/builds/with-unique-items/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
],
1616
"license": "Unlicense",
1717
"main": "./dist/index.js",
18+
"type": "commonjs",
1819
"exports": {
1920
".": {
20-
"import": "./dist/index.js",
21+
"require": "./dist/index.js",
2122
"types": "./dist/index.d.js"
2223
}
2324
},

samples/client/others/typescript/builds/with-unique-items/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"compilerOptions": {
33
"strict": true,
44
/* Basic Options */
5-
"target": "es6",
6-
"esModuleInterop": true,
5+
"target": "es5",
76
"moduleResolution": "node",
87
"declaration": true,
98

samples/openapi3/client/petstore/typescript/builds/browser/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
],
1616
"license": "Unlicense",
1717
"main": "./dist/index.js",
18+
"type": "module",
19+
"module": "./dist/index.js",
1820
"exports": {
1921
".": {
2022
"import": "./dist/index.js",

samples/openapi3/client/petstore/typescript/builds/composed-schemas/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
],
1616
"license": "Unlicense",
1717
"main": "./dist/index.js",
18+
"type": "commonjs",
1819
"exports": {
1920
".": {
20-
"import": "./dist/index.js",
21+
"require": "./dist/index.js",
2122
"types": "./dist/index.d.js"
2223
}
2324
},

samples/openapi3/client/petstore/typescript/builds/composed-schemas/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"compilerOptions": {
33
"strict": true,
44
/* Basic Options */
5-
"target": "es6",
6-
"esModuleInterop": true,
5+
"target": "es5",
76
"moduleResolution": "node",
87
"declaration": true,
98

samples/openapi3/client/petstore/typescript/builds/default/apis/PetApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
33
import {Configuration} from '../configuration';
44
import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
5-
import FormData from "form-data";
5+
import * as FormData from "form-data";
66
import { URLSearchParams } from 'url';
77
import {ObjectSerializer} from '../models/ObjectSerializer';
88
import {ApiException} from './exception';

0 commit comments

Comments
 (0)