From 5e2af7203a9773e9abfb47ea88f8a4b9d34e64ac Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Fri, 27 Sep 2024 07:39:59 +0100 Subject: [PATCH] feat(typescript): generate `.gitattributes` file (#19698) * feat(typescript): generate `.gitattributes` file * sample generation * highlight the gitattributes mustache template * highlight the gitattributes mustache template * Revert "highlight the gitattributes mustache template" This reverts commit 95119979833c2835f004db27805506b76785385a. * highlight the gitattributes mustache template * Revert "highlight the gitattributes mustache template" This reverts commit 0f67ec2e4fec30fad209fae20ace97ea7f9d4eea. * Revert "highlight the gitattributes mustache template" This reverts commit 1f68b42368c959bc63dff76db791e4149280283a. --- .../codegen/languages/TypeScriptClientCodegen.java | 1 + .../src/main/resources/typescript/.gitattributes.mustache | 8 ++++++++ .../typescript/builds/array-of-lists/.gitattributes | 8 ++++++++ .../builds/array-of-lists/.openapi-generator/FILES | 1 + .../typescript/builds/with-unique-items/.gitattributes | 8 ++++++++ .../builds/with-unique-items/.openapi-generator/FILES | 1 + .../others/typescript/encode-decode/build/.gitattributes | 8 ++++++++ .../encode-decode/build/.openapi-generator/FILES | 1 + .../petstore/typescript/builds/browser/.gitattributes | 8 ++++++++ .../typescript/builds/browser/.openapi-generator/FILES | 1 + .../typescript/builds/composed-schemas/.gitattributes | 8 ++++++++ .../builds/composed-schemas/.openapi-generator/FILES | 1 + .../petstore/typescript/builds/default/.gitattributes | 8 ++++++++ .../typescript/builds/default/.openapi-generator/FILES | 1 + .../client/petstore/typescript/builds/deno/.gitattributes | 8 ++++++++ .../typescript/builds/deno/.openapi-generator/FILES | 1 + .../typescript/builds/deno_object_params/.gitattributes | 8 ++++++++ .../builds/deno_object_params/.openapi-generator/FILES | 1 + .../typescript/builds/explode-query/.gitattributes | 8 ++++++++ .../builds/explode-query/.openapi-generator/FILES | 1 + .../petstore/typescript/builds/inversify/.gitattributes | 8 ++++++++ .../typescript/builds/inversify/.openapi-generator/FILES | 1 + .../petstore/typescript/builds/jquery/.gitattributes | 8 ++++++++ .../typescript/builds/jquery/.openapi-generator/FILES | 1 + .../typescript/builds/nullable-enum/.gitattributes | 8 ++++++++ .../builds/nullable-enum/.openapi-generator/FILES | 1 + .../typescript/builds/object_params/.gitattributes | 8 ++++++++ .../builds/object_params/.openapi-generator/FILES | 1 + 28 files changed, 126 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/typescript/.gitattributes.mustache create mode 100644 samples/client/others/typescript/builds/array-of-lists/.gitattributes create mode 100644 samples/client/others/typescript/builds/with-unique-items/.gitattributes create mode 100644 samples/client/others/typescript/encode-decode/build/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/browser/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/composed-schemas/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/default/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/deno/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/deno_object_params/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/explode-query/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/inversify/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/jquery/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/nullable-enum/.gitattributes create mode 100644 samples/openapi3/client/petstore/typescript/builds/object_params/.gitattributes diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java index 1ab5a61e5fd..f35c40b7677 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptClientCodegen.java @@ -140,6 +140,7 @@ public class TypeScriptClientCodegen extends AbstractTypeScriptClientCodegen imp supportModelPropertyNaming(CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.camelCase); // Git + supportingFiles.add(new SupportingFile(".gitattributes.mustache", "", ".gitattributes")); supportingFiles.add(new SupportingFile(".gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); diff --git a/modules/openapi-generator/src/main/resources/typescript/.gitattributes.mustache b/modules/openapi-generator/src/main/resources/typescript/.gitattributes.mustache new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript/.gitattributes.mustache @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/client/others/typescript/builds/array-of-lists/.gitattributes b/samples/client/others/typescript/builds/array-of-lists/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/client/others/typescript/builds/array-of-lists/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/client/others/typescript/builds/array-of-lists/.openapi-generator/FILES b/samples/client/others/typescript/builds/array-of-lists/.openapi-generator/FILES index 5158c35dc75..01213762e79 100644 --- a/samples/client/others/typescript/builds/array-of-lists/.openapi-generator/FILES +++ b/samples/client/others/typescript/builds/array-of-lists/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore DefaultApi.md README.md diff --git a/samples/client/others/typescript/builds/with-unique-items/.gitattributes b/samples/client/others/typescript/builds/with-unique-items/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/client/others/typescript/builds/with-unique-items/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES index c1e2d850dd8..e770a65f9ad 100644 --- a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES +++ b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore DefaultApi.md README.md diff --git a/samples/client/others/typescript/encode-decode/build/.gitattributes b/samples/client/others/typescript/encode-decode/build/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/client/others/typescript/encode-decode/build/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES b/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES index 0e8a14dc863..b8c07c76c07 100644 --- a/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES +++ b/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore DefaultApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/browser/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/browser/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/browser/.openapi-generator/FILES index 4137d52d1cd..125c3a493a1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/browser/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES index fe4c653da42..9648ceadb6e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore DefaultApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/default/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/default/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES index 4137d52d1cd..125c3a493a1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/deno/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/FILES index 156ef7ba37f..ab37481dc8e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md StoreApi.md diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.openapi-generator/FILES index 156ef7ba37f..ab37481dc8e 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md StoreApi.md diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/explode-query/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES index d10bffa8f06..8a9627dabd2 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore AnotherFakeApi.md DefaultApi.md diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/inversify/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES index 2546d613ef9..6ea98493524 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/jquery/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES index dfa2fadc5b0..40e160f71b6 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.openapi-generator/FILES index c1e2d850dd8..e770a65f9ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore DefaultApi.md README.md diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.gitattributes b/samples/openapi3/client/petstore/typescript/builds/object_params/.gitattributes new file mode 100644 index 00000000000..7bf5a17b22f --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.gitattributes @@ -0,0 +1,8 @@ +**/* linguist-generated +*.md linguist-documentation + +.gitattributes text +.gitattributes export-ignore + +.gitignore text +.gitignore export-ignore diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES index 4137d52d1cd..125c3a493a1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitattributes .gitignore PetApi.md README.md