+12
-9
src/views/home.tsx
+12
-9
src/views/home.tsx
···
42
<span>Query labels from moderation services.</span>
43
</div>
44
</div>
45
-
<div class="text-center text-sm italic">
46
-
Made by{" "}
47
-
<a
48
-
href="https://juli.ee"
49
-
class="font-pecita relative after:absolute after:bottom-0 after:left-0 after:h-px after:w-0 after:bg-current after:transition-[width] after:duration-300 after:ease-out hover:after:w-full"
50
-
>
51
-
Juliet
52
-
</a>{" "}
53
-
with love
54
</div>
55
</div>
56
);
···
42
<span>Query labels from moderation services.</span>
43
</div>
44
</div>
45
+
<div class="text-center text-sm text-neutral-600 dark:text-neutral-400">
46
+
<span class="italic">
47
+
Made by{" "}
48
+
<a
49
+
href="https://juli.ee"
50
+
class="font-pecita relative after:absolute after:bottom-0 after:left-0 after:h-px after:w-0 after:bg-current after:transition-[width] after:duration-300 after:ease-out hover:after:w-full"
51
+
>
52
+
Juliet
53
+
</a>{" "}
54
+
with love
55
+
</span>
56
+
<span> • {import.meta.env.VITE_APP_VERSION}</span>
57
</div>
58
</div>
59
);
+22
-1
vite.config.ts
+22
-1
vite.config.ts
···
1
import tailwindcss from "@tailwindcss/vite";
2
import { defineConfig } from "vite";
3
import solidPlugin from "vite-plugin-solid";
4
import metadata from "./public/oauth-client-metadata.json";
···
6
const SERVER_HOST = "127.0.0.1";
7
const SERVER_PORT = 13213;
8
9
export default defineConfig({
10
plugins: [
11
tailwindcss(),
12
solidPlugin(),
13
-
// Injects OAuth-related variables
14
{
15
name: "oauth",
16
config(_conf, { command }) {
···
35
36
process.env.VITE_CLIENT_URI = metadata.client_uri;
37
process.env.VITE_OAUTH_SCOPE = metadata.scope;
38
},
39
},
40
],
···
1
import tailwindcss from "@tailwindcss/vite";
2
+
import { execSync } from "child_process";
3
import { defineConfig } from "vite";
4
import solidPlugin from "vite-plugin-solid";
5
import metadata from "./public/oauth-client-metadata.json";
···
7
const SERVER_HOST = "127.0.0.1";
8
const SERVER_PORT = 13213;
9
10
+
const getVersion = (): string => {
11
+
try {
12
+
const describe = execSync("git describe --tags --long --dirty --always").toString().trim();
13
+
14
+
const match = describe.match(/^v?(.+?)-(\d+)-g([a-f0-9]+)(-dirty)?$/);
15
+
16
+
if (match) {
17
+
const [, version, commits, hash, dirty] = match;
18
+
if (commits === "0") {
19
+
return `v${version}${dirty ? "-dirty" : ""}`;
20
+
}
21
+
return `v${version}.dev${commits}+g${hash}${dirty ? "-dirty" : ""}`;
22
+
}
23
+
24
+
return `v0.0.0.dev+g${describe}`;
25
+
} catch {
26
+
return "v0.0.0-unknown";
27
+
}
28
+
};
29
+
30
export default defineConfig({
31
plugins: [
32
tailwindcss(),
33
solidPlugin(),
34
{
35
name: "oauth",
36
config(_conf, { command }) {
···
55
56
process.env.VITE_CLIENT_URI = metadata.client_uri;
57
process.env.VITE_OAUTH_SCOPE = metadata.scope;
58
+
process.env.VITE_APP_VERSION = getVersion();
59
},
60
},
61
],