atproto explorer pdsls.dev
atproto tool

semantic versioning

juli.ee 0ee79770 aeb11dbb

verified
Changed files
+34 -10
src
views
+12 -9
src/views/home.tsx
···
<span>Query labels from moderation services.</span>
</div>
</div>
-
<div class="text-center text-sm italic">
-
Made by{" "}
-
<a
-
href="https://juli.ee"
-
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"
-
>
-
Juliet
-
</a>{" "}
-
with love
+
<div class="text-center text-sm text-neutral-600 dark:text-neutral-400">
+
<span class="italic">
+
Made by{" "}
+
<a
+
href="https://juli.ee"
+
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"
+
>
+
Juliet
+
</a>{" "}
+
with love
+
</span>
+
<span> • {import.meta.env.VITE_APP_VERSION}</span>
</div>
</div>
);
+22 -1
vite.config.ts
···
import tailwindcss from "@tailwindcss/vite";
+
import { execSync } from "child_process";
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import metadata from "./public/oauth-client-metadata.json";
···
const SERVER_HOST = "127.0.0.1";
const SERVER_PORT = 13213;
+
const getVersion = (): string => {
+
try {
+
const describe = execSync("git describe --tags --long --dirty --always").toString().trim();
+
+
const match = describe.match(/^v?(.+?)-(\d+)-g([a-f0-9]+)(-dirty)?$/);
+
+
if (match) {
+
const [, version, commits, hash, dirty] = match;
+
if (commits === "0") {
+
return `v${version}${dirty ? "-dirty" : ""}`;
+
}
+
return `v${version}.dev${commits}+g${hash}${dirty ? "-dirty" : ""}`;
+
}
+
+
return `v0.0.0.dev+g${describe}`;
+
} catch {
+
return "v0.0.0-unknown";
+
}
+
};
+
export default defineConfig({
plugins: [
tailwindcss(),
solidPlugin(),
-
// Injects OAuth-related variables
{
name: "oauth",
config(_conf, { command }) {
···
process.env.VITE_CLIENT_URI = metadata.client_uri;
process.env.VITE_OAUTH_SCOPE = metadata.scope;
+
process.env.VITE_APP_VERSION = getVersion();
},
},
],