From ca4d1e6e0973e9e55408cd343450c03ea5c02a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Zorro?= Date: Sat, 14 Dec 2024 08:22:46 -0500 Subject: [PATCH] feat(generators): added .gitattributes file and flagged workspace.json as binary saw as a suggestion on Structurizr Slack channel. Seemed easy to implement --- e2e/scfz.test.ts | 1 + lib/generators/workspace.ts | 5 +++++ lib/templates/.gitattributes | 1 + lib/templates/bundle.ts | 2 ++ lib/types.d.ts | 6 ++++++ 5 files changed, 15 insertions(+) create mode 100644 lib/templates/.gitattributes diff --git a/e2e/scfz.test.ts b/e2e/scfz.test.ts index 201ff46..51a11da 100644 --- a/e2e/scfz.test.ts +++ b/e2e/scfz.test.ts @@ -86,6 +86,7 @@ describe("e2e", () => { "environments", "docs", "decisions", + ".gitattributes", ".gitignore", "scripts", "containers", diff --git a/lib/generators/workspace.ts b/lib/generators/workspace.ts index 3e933eb..631ad0c 100644 --- a/lib/generators/workspace.ts +++ b/lib/generators/workspace.ts @@ -87,6 +87,11 @@ const generator: GeneratorDefinition = { path: "architecture/.gitignore", templateFile: "templates/.gitignore", } as AddAction, + { + type: "add", + path: "architecture/.gitattributes", + templateFile: "templates/.gitattributes", + } as AddAction, { type: "add", path: "architecture/.env-arch", diff --git a/lib/templates/.gitattributes b/lib/templates/.gitattributes new file mode 100644 index 0000000..d99c45d --- /dev/null +++ b/lib/templates/.gitattributes @@ -0,0 +1 @@ +workspace.json binary \ No newline at end of file diff --git a/lib/templates/bundle.ts b/lib/templates/bundle.ts index e51af36..e457529 100644 --- a/lib/templates/bundle.ts +++ b/lib/templates/bundle.ts @@ -1,4 +1,5 @@ import envArch from "./.env-arch.hbs"; +import gitattributes from "./.gitattributes"; import gitignore from "./.gitignore"; import componentsComponent from "./components/component.hbs"; import constant from "./constant.hbs"; @@ -24,6 +25,7 @@ import workspace from "./workspace.hbs"; const templatesMap = new Map([ ["templates/.env-arch", envArch], + ["templates/.gitattributes", gitattributes], ["templates/.gitignore", gitignore], ["templates/components/component.hbs", componentsComponent], ["templates/constant.hbs", constant], diff --git a/lib/types.d.ts b/lib/types.d.ts index 3b7ac9a..d88f8c6 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -10,6 +10,12 @@ declare module "*.gitignore" { export default content; } +declare module "*.gitattributes" { + const content: string; + + export default content; +} + declare module "*.sh" { const content: string;