From 9e659d13ed42faa2f630511deac8f3230f74c82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Tue, 6 Aug 2019 10:08:38 -0400 Subject: [PATCH] Fix NPM build for Typescript-fetch (#3403) * -Fix bug in fetch -> Missing "runtime" -Move fetch files to an "src" folder instead of doing everything at the root which removes the bugs when using the library itself -Fix the distribution of fetch using npm * Move the .ts files to an `src` folder which is more common in npm package * Add missing mustache * Add missing .npmignore --- .../languages/TypeScriptFetchClientCodegen.java | 11 ++++++----- .../resources/typescript-fetch/npmignore.mustache | 1 + .../main/resources/typescript-fetch/package.mustache | 2 +- .../main/resources/typescript-fetch/tsconfig.mustache | 1 - .../builds/default/{ => src}/apis/PetApi.ts | 0 .../builds/default/{ => src}/apis/StoreApi.ts | 0 .../builds/default/{ => src}/apis/UserApi.ts | 0 .../builds/default/{ => src}/apis/index.ts | 0 .../builds/default/{ => src}/index.ts | 0 .../builds/default/{ => src}/models/Category.ts | 0 .../default/{ => src}/models/ModelApiResponse.ts | 0 .../builds/default/{ => src}/models/Order.ts | 0 .../builds/default/{ => src}/models/Pet.ts | 0 .../builds/default/{ => src}/models/Tag.ts | 0 .../builds/default/{ => src}/models/User.ts | 0 .../builds/default/{ => src}/models/index.ts | 0 .../builds/default/{ => src}/runtime.ts | 0 .../typescript-fetch/builds/default/tsconfig.json | 1 - .../typescript-fetch/builds/es6-target/.npmignore | 1 + .../typescript-fetch/builds/es6-target/package.json | 2 +- .../builds/es6-target/{ => src}/apis/PetApi.ts | 0 .../builds/es6-target/{ => src}/apis/StoreApi.ts | 0 .../builds/es6-target/{ => src}/apis/UserApi.ts | 0 .../builds/es6-target/{ => src}/apis/index.ts | 0 .../builds/es6-target/{ => src}/index.ts | 0 .../builds/es6-target/{ => src}/models/Category.ts | 0 .../es6-target/{ => src}/models/ModelApiResponse.ts | 0 .../builds/es6-target/{ => src}/models/Order.ts | 0 .../builds/es6-target/{ => src}/models/Pet.ts | 0 .../builds/es6-target/{ => src}/models/Tag.ts | 0 .../builds/es6-target/{ => src}/models/User.ts | 0 .../builds/es6-target/{ => src}/models/index.ts | 0 .../builds/es6-target/{ => src}/runtime.ts | 0 .../typescript-fetch/builds/es6-target/tsconfig.json | 1 - .../multiple-parameters/{ => src}/apis/PetApi.ts | 0 .../multiple-parameters/{ => src}/apis/StoreApi.ts | 0 .../multiple-parameters/{ => src}/apis/UserApi.ts | 0 .../multiple-parameters/{ => src}/apis/index.ts | 0 .../builds/multiple-parameters/{ => src}/index.ts | 0 .../multiple-parameters/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../multiple-parameters/{ => src}/models/Order.ts | 0 .../multiple-parameters/{ => src}/models/Pet.ts | 0 .../multiple-parameters/{ => src}/models/Tag.ts | 0 .../multiple-parameters/{ => src}/models/User.ts | 0 .../multiple-parameters/{ => src}/models/index.ts | 0 .../builds/multiple-parameters/{ => src}/runtime.ts | 0 .../builds/multiple-parameters/tsconfig.json | 1 - .../builds/with-interfaces/{ => src}/apis/PetApi.ts | 0 .../builds/with-interfaces/{ => src}/apis/StoreApi.ts | 0 .../builds/with-interfaces/{ => src}/apis/UserApi.ts | 0 .../builds/with-interfaces/{ => src}/apis/index.ts | 0 .../builds/with-interfaces/{ => src}/index.ts | 0 .../with-interfaces/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../builds/with-interfaces/{ => src}/models/Order.ts | 0 .../builds/with-interfaces/{ => src}/models/Pet.ts | 0 .../builds/with-interfaces/{ => src}/models/Tag.ts | 0 .../builds/with-interfaces/{ => src}/models/User.ts | 0 .../builds/with-interfaces/{ => src}/models/index.ts | 0 .../builds/with-interfaces/{ => src}/runtime.ts | 0 .../builds/with-interfaces/tsconfig.json | 1 - .../builds/with-npm-version/.npmignore | 1 + .../builds/with-npm-version/package.json | 2 +- .../builds/with-npm-version/{ => src}/apis/PetApi.ts | 0 .../with-npm-version/{ => src}/apis/StoreApi.ts | 0 .../builds/with-npm-version/{ => src}/apis/UserApi.ts | 0 .../builds/with-npm-version/{ => src}/apis/index.ts | 0 .../builds/with-npm-version/{ => src}/index.ts | 0 .../with-npm-version/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../builds/with-npm-version/{ => src}/models/Order.ts | 0 .../builds/with-npm-version/{ => src}/models/Pet.ts | 0 .../builds/with-npm-version/{ => src}/models/Tag.ts | 0 .../builds/with-npm-version/{ => src}/models/User.ts | 0 .../builds/with-npm-version/{ => src}/models/index.ts | 0 .../builds/with-npm-version/{ => src}/runtime.ts | 0 .../builds/with-npm-version/tsconfig.json | 1 - 78 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/runtime.ts (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/runtime.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/runtime.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/runtime.ts (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/runtime.ts (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index f66340956104..41986aa24fc1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -50,9 +50,9 @@ public TypeScriptFetchClientCodegen() { outputFolder = "generated-code/typescript-fetch"; embeddedTemplateDir = templateDir = "typescript-fetch"; - this.apiPackage = "apis"; + this.apiPackage = "src" + File.separator +"apis"; + this.modelPackage = "src" + File.separator + "models"; this.apiTemplateFiles.put("apis.mustache", ".ts"); - this.modelPackage = "models"; this.modelTemplateFiles.put("models.mustache", ".ts"); this.addExtraReservedWords(); @@ -84,8 +84,8 @@ public void processOpts() { super.processOpts(); additionalProperties.put("isOriginalModelPropertyNaming", getModelPropertyNaming().equals("original")); additionalProperties.put("modelPropertyNaming", getModelPropertyNaming()); - supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts")); - supportingFiles.add(new SupportingFile("runtime.mustache", "", "runtime.ts")); + supportingFiles.add(new SupportingFile("index.mustache", "src", "index.ts")); + supportingFiles.add(new SupportingFile("runtime.mustache", "src", "runtime.ts")); supportingFiles.add(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); @@ -188,6 +188,7 @@ private void addNpmPackageGeneration() { //Files for building our lib supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("package.mustache", "", "package.json")); + supportingFiles.add(new SupportingFile("npmignore.mustache", "", ".npmignore")); } @Override @@ -216,7 +217,7 @@ private void addOperationModelImportInfomation(Map operations) { // models for a given operation. List> imports = (List>) operations.get("imports"); for (Map im : imports) { - im.put("className", im.get("import").toString().replace("models.", "")); + im.put("className", im.get("import").toString().replace(modelPackage() + ".", "")); } } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache index 5bfbc1a92368..1c9d9e55bbf6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache index 328c7d4e141a..420c3a44f883 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", {{^supportsES6}} "lib": [ "es6", diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore b/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json index 84e82f3f158d..3ea8a1ec7069 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/User.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json index 6cc02878fb79..250280d9ab0e 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "typeRoots": [ "node_modules/@types" ] diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore new file mode 100644 index 000000000000..42061c01a1c7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json index 84e82f3f158d..3ea8a1ec7069 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json index d65f2a95afc1..4567ec19899a 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom"