Skip to content

Commit f7d70f7

Browse files
committed
app versioning
1 parent 19defa7 commit f7d70f7

File tree

2 files changed

+71
-62
lines changed

2 files changed

+71
-62
lines changed

MyMusicClientSveltePwa/src/App.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
1818
let intervalId;
1919
20+
// @ts-ignore
21+
const version = __APP_VERSION__;
22+
2023
onMount(() => {
2124
async function async() {
2225
await initStores();
@@ -61,7 +64,9 @@
6164

6265
<div class="app-layout bg-dark">
6366
<!-- Sticky Top Bar -->
64-
<header class="top-bar"><div class="container-fluid h-100">{$pathName}</div></header>
67+
<header class="top-bar">
68+
<div class="container-fluid h-100">{$pathName} <span style="font-size: 0.8rem;">(v{version})</span></div>
69+
</header>
6570

6671
<!-- Scrollable Content -->
6772
<main class="scrollable-content">
Lines changed: 65 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,77 @@
1-
import { defineConfig } from 'vite'
2-
import { svelte } from '@sveltejs/vite-plugin-svelte'
3-
import { VitePWA } from 'vite-plugin-pwa';
1+
import { defineConfig } from "vite";
2+
import { svelte } from "@sveltejs/vite-plugin-svelte";
3+
import pkg from "./package.json" with { type: "json" };
4+
import { VitePWA } from "vite-plugin-pwa";
45

56
// https://vite.dev/config/
67
export default defineConfig({
78
plugins: [
89
svelte(),
910
VitePWA({
10-
registerType: 'autoUpdate',
11-
includeAssets: ['favicon.ico', 'apple-touch-icon.png'],
11+
registerType: "autoUpdate",
12+
includeAssets: ["favicon.ico", "apple-touch-icon.png"],
1213
manifest: {
13-
name: 'MyMusic Client Svelte PWA',
14-
short_name: 'MyMusic Svelte PWA',
15-
description: 'A Progressive Web App for MyMusic Client built with Svelte',
16-
start_url: '/',
17-
theme_color: '#212529',
14+
name: "MyMusic Client Svelte PWA",
15+
short_name: "MyMusic Svelte PWA",
16+
description: "A Progressive Web App for MyMusic Client built with Svelte",
17+
start_url: "/",
18+
theme_color: "#212529",
1819
icons: [
19-
{
20-
"src": "icons/icon-48x48.png",
21-
"sizes": "48x48",
22-
"type": "image/png"
23-
},
24-
{
25-
"src": "icons/icon-72x72.png",
26-
"sizes": "72x72",
27-
"type": "image/png"
28-
},
29-
{
30-
"src": "icons/icon-96x96.png",
31-
"sizes": "96x96",
32-
"type": "image/png"
33-
},
34-
{
35-
"src": "icons/icon-128x128.png",
36-
"sizes": "128x128",
37-
"type": "image/png"
38-
},
39-
{
40-
"src": "icons/icon-144x144.png",
41-
"sizes": "144x144",
42-
"type": "image/png"
43-
},
44-
{
45-
"src": "icons/icon-152x152.png",
46-
"sizes": "152x152",
47-
"type": "image/png"
48-
},
49-
{
50-
"src": "icons/icon-192x192.png",
51-
"sizes": "192x192",
52-
"type": "image/png"
53-
},
54-
{
55-
"src": "icons/icon-256x256.png",
56-
"sizes": "256x256",
57-
"type": "image/png"
58-
},
59-
{
60-
"src": "icons/icon-384x384.png",
61-
"sizes": "384x384",
62-
"type": "image/png"
63-
},
64-
{
65-
"src": "icons/icon-512x512.png",
66-
"sizes": "512x512",
67-
"type": "image/png"
68-
}
69-
],
20+
{
21+
src: "icons/icon-48x48.png",
22+
sizes: "48x48",
23+
type: "image/png",
24+
},
25+
{
26+
src: "icons/icon-72x72.png",
27+
sizes: "72x72",
28+
type: "image/png",
29+
},
30+
{
31+
src: "icons/icon-96x96.png",
32+
sizes: "96x96",
33+
type: "image/png",
34+
},
35+
{
36+
src: "icons/icon-128x128.png",
37+
sizes: "128x128",
38+
type: "image/png",
39+
},
40+
{
41+
src: "icons/icon-144x144.png",
42+
sizes: "144x144",
43+
type: "image/png",
44+
},
45+
{
46+
src: "icons/icon-152x152.png",
47+
sizes: "152x152",
48+
type: "image/png",
49+
},
50+
{
51+
src: "icons/icon-192x192.png",
52+
sizes: "192x192",
53+
type: "image/png",
54+
},
55+
{
56+
src: "icons/icon-256x256.png",
57+
sizes: "256x256",
58+
type: "image/png",
59+
},
60+
{
61+
src: "icons/icon-384x384.png",
62+
sizes: "384x384",
63+
type: "image/png",
64+
},
65+
{
66+
src: "icons/icon-512x512.png",
67+
sizes: "512x512",
68+
type: "image/png",
69+
},
70+
],
7071
},
7172
}),
7273
],
74+
define: {
75+
__APP_VERSION__: JSON.stringify(pkg.version),
76+
},
7377
});

0 commit comments

Comments
 (0)