From 433fd4d045fd8e4bce4ae60db7bf147e830afb53 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 17 Oct 2022 14:11:26 +0530 Subject: [PATCH] chore: ENV types, mindmap rc4 --- package.json | 2 +- src/env.d.ts | 14 ++++++++++++++ src/lib/components/actions.svelte | 3 ++- src/lib/util/env.ts | 19 +++++++++---------- src/lib/util/mermaid.ts | 12 ++++++------ 5 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 src/env.d.ts diff --git a/package.json b/package.json index 9516861d..b9bf43eb 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "scripts": { "dev": "vite dev", - "dev:force": "yarn dev --force", + "dev:force": "MERMAID_LOCAL=true yarn dev --force", "dev:test": "yarn dev", "build": "vite build", "preview": "vite preview", diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 00000000..571447df --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1,14 @@ +/// + +interface ImportMetaEnv { + readonly MERMAID_RENDERER_URL: string; + readonly MERMAID_KROKI_RENDERER_URL: string; + readonly MERMAID_CDN_URL: string; + readonly MERMAID_BASE_URL: string; + readonly MERMAID_LOCAL: boolean; + // more env variables... +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} diff --git a/src/lib/components/actions.svelte b/src/lib/components/actions.svelte index c31128b7..d1980e9d 100644 --- a/src/lib/components/actions.svelte +++ b/src/lib/components/actions.svelte @@ -1,12 +1,13 @@