Richard Köhl 2 rokov pred
commit
3387a9dbf4
6 zmenil súbory, kde vykonal 80 pridanie a 0 odobranie
  1. 12 0
      .editorconfig
  2. 2 0
      .gitignore
  3. 33 0
      deno.jsonc
  4. 13 0
      deno.lock
  5. 6 0
      src/main.ts
  6. 14 0
      test/test.ts

+ 12 - 0
.editorconfig

@@ -0,0 +1,12 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[.ts]
+quote_type = single

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+.vscode
+.env

+ 33 - 0
deno.jsonc

@@ -0,0 +1,33 @@
+{
+  "imports": {
+    "application/": "./src/application/",
+    "domain/": "./src/domain/",
+    "infrastructure/": "./src/infra/",
+
+    "dotenv/": "https://deno.land/std@0.191.0/dotenv/",
+    "testing/": "https://deno.land/std@0.191.0/testing/"
+  },
+  "tasks": {
+    "dev": "/home/koehlric/.deno/bin/deno run --allow-read --allow-env ./src/main.ts",
+    "test": "/home/koehlric/.deno/bin/deno test --allow-read --allow-run ./test/test.ts"
+  },
+  "lint": {
+    "files": {
+      "include": ["src/"]
+    },
+    "rules": {
+      "tags": ["recommended"]
+    }
+  },
+  "fmt": {
+    "files": {
+      "include": ["src/"]
+    },
+    "options": {
+      "useTabs": false,
+      "lineWidth": 80,
+      "indentWidth": 2,
+      "singleQuote": true
+    }
+  }
+}

+ 13 - 0
deno.lock

@@ -0,0 +1,13 @@
+{
+  "version": "2",
+  "remote": {
+    "https://deno.land/std@0.191.0/collections/filter_values.ts": "5b9feaf17b9a6e5ffccdd36cf6f38fa4ffa94cff2602d381c2ad0c2a97929652",
+    "https://deno.land/std@0.191.0/collections/without_all.ts": "a89f5da0b5830defed4f59666e188df411d8fece35a5f6ca69be6ca71a95c185",
+    "https://deno.land/std@0.191.0/dotenv/load.ts": "0636983549b98f29ab75c9a22a42d9723f0a389ece5498fe971e7bb2556a12e2",
+    "https://deno.land/std@0.191.0/dotenv/mod.ts": "f5a8123741d1561ae8184a7f043bc097b15132c5171c651142b804b6dbc21853",
+    "https://deno.land/std@0.191.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e",
+    "https://deno.land/std@0.191.0/testing/_diff.ts": "1a3c044aedf77647d6cac86b798c6417603361b66b54c53331b312caeb447aea",
+    "https://deno.land/std@0.191.0/testing/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7",
+    "https://deno.land/std@0.191.0/testing/asserts.ts": "e16d98b4d73ffc4ed498d717307a12500ae4f2cbe668f1a215632d19fcffc22f"
+  }
+}

+ 6 - 0
src/main.ts

@@ -0,0 +1,6 @@
+import 'dotenv/load.ts';
+
+// Learn more at https://deno.land/manual/examples/module_metadata#concepts
+if (import.meta.main) {
+  console.log(Deno.env.get('GREETING'));
+}

+ 14 - 0
test/test.ts

@@ -0,0 +1,14 @@
+import { assert, assertEquals } from "testing/asserts.ts";
+
+Deno.test("are we operational?", async () => {
+  const cmd = new Deno.Command(Deno.execPath(), {args: ["task", "dev"]});
+
+  const { success, stdout, stderr } = await cmd.output();
+  const errors = new TextDecoder().decode(stderr).split("\n");
+  errors.shift();
+  const output = new TextDecoder().decode(stdout).trim();
+
+  assert(success, "success");
+  assertEquals(errors.join("\n"), "", "no error output");
+  assertEquals(output, "hello world!", "correct stdout");
+});