From 5f3d8314f9e46f613c5d55646809cfdfff3d6306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Sun, 27 Nov 2022 12:34:39 -0300 Subject: [PATCH 1/2] Add app version provider --- package.json | 2 +- src/utils/env.js | 6 ++++++ vite.config.js | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/utils/env.js diff --git a/package.json b/package.json index 350b7c9..fe224fe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "embroidery-viewer", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src/utils/env.js b/src/utils/env.js new file mode 100644 index 0000000..9734172 --- /dev/null +++ b/src/utils/env.js @@ -0,0 +1,6 @@ +// @ts-nocheck +function appVersion() { + return APP_VERSION; +} + +export { appVersion }; diff --git a/vite.config.js b/vite.config.js index 5ac8ecf..338cb28 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,4 +4,7 @@ import { svelte } from "@sveltejs/vite-plugin-svelte"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [svelte()], + define: { + APP_VERSION: JSON.stringify(process.env.npm_package_version), + }, }); From d08b2956a2cfba06797d69151f336fad76434b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Sun, 27 Nov 2022 12:34:43 -0300 Subject: [PATCH 2/2] Extract footer, header and display app version --- src/App.svelte | 59 ++++++++----------------------------------- src/lib/Footer.svelte | 25 ++++++++++++++++++ src/lib/Header.svelte | 39 ++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 48 deletions(-) create mode 100644 src/lib/Footer.svelte create mode 100644 src/lib/Header.svelte diff --git a/src/App.svelte b/src/App.svelte index e9a1df1..effc214 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,28 +1,22 @@ - + -
- - - {@const configs = configsFor(matches)} - - - -
+
- +