Skip to content

Commit 4117b2e

Browse files
na-o-yswing328
authored andcommitted
[BUG][typescript-node] Generated package causes compilation errors (#1911)
* changed typescript-node build dir * fixed missed json * to pass integration test
1 parent e0137f6 commit 4117b2e

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

bin/typescript-node-petstore-npm.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"npmName": "@swagger/node-typescript-petstore",
3+
"npmVersion": "0.0.1",
4+
"npmRepository": "https://skimdb.npmjs.com/registry",
5+
"snapshot": false
6+
}

bin/typescript-node-petstore-with-npm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-node -c bin/typescript-petstore-npm.json -o samples/client/petstore/typescript-node/npm $@"
30+
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-node -c bin/typescript-node-petstore-npm.json -o samples/client/petstore/typescript-node/npm $@"
3131

3232
java $JAVA_OPTS -jar $executable $ags

bin/windows/typescript-node-petstore-with-npm.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ If Not Exist %executable% (
55
)
66

77
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
8-
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -g typescript-node -o samples\client\petstore\typescript-node\npm
8+
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-node-petstore-npm.json -g typescript-node -o samples\client\petstore\typescript-node\npm
99

1010
java %JAVA_OPTS% -jar %executable% %ags%

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"version": "{{npmVersion}}",
44
"description": "NodeJS client for {{npmName}}",
55
"repository": "{{gitUserId}}/{{gitRepoId}}",
6-
"main": "api.js",
7-
"types": "api.d.ts",
6+
"main": "dist/api.js",
7+
"types": "dist/api.d.ts",
88
"scripts": {
99
"clean": "rm -Rf node_modules/ *.js",
1010
"build": "tsc",
11-
"test": "npm run build && node client.js"
11+
"test": "npm run build && node dist/client.js"
1212
},
1313
"author": "OpenAPI-Generator Contributors",
1414
"license": "Unlicense",

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
"sourceMap": true,
1111
"noLib": false,
1212
"declaration": true,
13-
"lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"]
13+
"lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"],
14+
"outDir": "dist"
1415
},
1516
"exclude": [
17+
"dist",
1618
"node_modules"
1719
]
1820
}

samples/client/petstore/typescript-node/npm/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"name": "@swagger/angular2-typescript-petstore",
2+
"name": "@swagger/node-typescript-petstore",
33
"version": "0.0.1",
4-
"description": "NodeJS client for @swagger/angular2-typescript-petstore",
4+
"description": "NodeJS client for @swagger/node-typescript-petstore",
55
"repository": "GIT_USER_ID/GIT_REPO_ID",
6-
"main": "api.js",
7-
"types": "api.d.ts",
6+
"main": "dist/api.js",
7+
"types": "dist/api.d.ts",
88
"scripts": {
99
"clean": "rm -Rf node_modules/ *.js",
1010
"build": "tsc",
11-
"test": "npm run build && node client.js"
11+
"test": "npm run build && node dist/client.js"
1212
},
1313
"author": "OpenAPI-Generator Contributors",
1414
"license": "Unlicense",

samples/client/petstore/typescript-node/npm/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
"sourceMap": true,
1111
"noLib": false,
1212
"declaration": true,
13-
"lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"]
13+
"lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"],
14+
"outDir": "dist"
1415
},
1516
"exclude": [
17+
"dist",
1618
"node_modules"
1719
]
1820
}

0 commit comments

Comments
 (0)