diff --git a/bin/typescript-node-petstore-npm.json b/bin/typescript-node-petstore-npm.json new file mode 100644 index 00000000000..28591ca64d5 --- /dev/null +++ b/bin/typescript-node-petstore-npm.json @@ -0,0 +1,6 @@ +{ + "npmName": "@swagger/node-typescript-petstore", + "npmVersion": "0.0.1", + "npmRepository": "https://skimdb.npmjs.com/registry", + "snapshot": false +} diff --git a/bin/typescript-node-petstore-with-npm.sh b/bin/typescript-node-petstore-with-npm.sh index 63e6b5663ca..0de70fcdbd2 100755 --- a/bin/typescript-node-petstore-with-npm.sh +++ b/bin/typescript-node-petstore-with-npm.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -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 $@" +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 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/typescript-node-petstore-with-npm.bat b/bin/windows/typescript-node-petstore-with-npm.bat index 67f78780a4e..6f0a62e708b 100755 --- a/bin/windows/typescript-node-petstore-with-npm.bat +++ b/bin/windows/typescript-node-petstore-with-npm.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -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 +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 java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/resources/typescript-node/package.mustache b/modules/openapi-generator/src/main/resources/typescript-node/package.mustache index 9c2274c8467..ff1c5c44519 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/package.mustache @@ -3,12 +3,12 @@ "version": "{{npmVersion}}", "description": "NodeJS client for {{npmName}}", "repository": "{{gitUserId}}/{{gitRepoId}}", - "main": "api.js", - "types": "api.d.ts", + "main": "dist/api.js", + "types": "dist/api.d.ts", "scripts": { "clean": "rm -Rf node_modules/ *.js", "build": "tsc", - "test": "npm run build && node client.js" + "test": "npm run build && node dist/client.js" }, "author": "OpenAPI-Generator Contributors", "license": "Unlicense", diff --git a/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache index 55d8509226f..456ee8e6334 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/tsconfig.mustache @@ -10,9 +10,11 @@ "sourceMap": true, "noLib": false, "declaration": true, - "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"] + "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"], + "outDir": "dist" }, "exclude": [ + "dist", "node_modules" ] } diff --git a/samples/client/petstore/typescript-node/npm/package.json b/samples/client/petstore/typescript-node/npm/package.json index cf13a928a79..ed79eb2f623 100644 --- a/samples/client/petstore/typescript-node/npm/package.json +++ b/samples/client/petstore/typescript-node/npm/package.json @@ -1,14 +1,14 @@ { - "name": "@swagger/angular2-typescript-petstore", + "name": "@swagger/node-typescript-petstore", "version": "0.0.1", - "description": "NodeJS client for @swagger/angular2-typescript-petstore", + "description": "NodeJS client for @swagger/node-typescript-petstore", "repository": "GIT_USER_ID/GIT_REPO_ID", - "main": "api.js", - "types": "api.d.ts", + "main": "dist/api.js", + "types": "dist/api.d.ts", "scripts": { "clean": "rm -Rf node_modules/ *.js", "build": "tsc", - "test": "npm run build && node client.js" + "test": "npm run build && node dist/client.js" }, "author": "OpenAPI-Generator Contributors", "license": "Unlicense", diff --git a/samples/client/petstore/typescript-node/npm/tsconfig.json b/samples/client/petstore/typescript-node/npm/tsconfig.json index 69087604ff5..ba2570a4bee 100644 --- a/samples/client/petstore/typescript-node/npm/tsconfig.json +++ b/samples/client/petstore/typescript-node/npm/tsconfig.json @@ -10,9 +10,11 @@ "sourceMap": true, "noLib": false, "declaration": true, - "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"] + "lib": ["dom", "es6", "es5", "dom.iterable", "scripthost"], + "outDir": "dist" }, "exclude": [ + "dist", "node_modules" ] }