Expose launcher build stamp
This commit is contained in:
parent
e40a596258
commit
a20d298be2
3 changed files with 29 additions and 0 deletions
|
|
@ -11,6 +11,8 @@ import {
|
|||
import type { ChangelogItem } from "./worldshaperStudio/changelogData";
|
||||
import launcherBackground from "../background.png";
|
||||
|
||||
declare const __APP_BUILD__: string;
|
||||
|
||||
type WorldDefaultPayload = {
|
||||
worldId?: string;
|
||||
world?: {
|
||||
|
|
@ -2257,6 +2259,7 @@ function WorldshaperLauncher() {
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div className="launcher-build-stamp">Build {__APP_BUILD__}</div>
|
||||
</div>
|
||||
{adminPanelOpen && logsModalOpen ? (
|
||||
<div className="launcher-modal-backdrop" onClick={() => setLogsModalOpen(false)}>
|
||||
|
|
|
|||
|
|
@ -77,6 +77,13 @@ body {
|
|||
width: min(1440px, 100%);
|
||||
}
|
||||
|
||||
.launcher-build-stamp {
|
||||
color: #7f90ab;
|
||||
font-size: 11px;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.launcher-hero-window,
|
||||
.launcher-changelog-window {
|
||||
border: 1px solid #4f79af;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,29 @@
|
|||
import { execSync } from "node:child_process";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
const packageJson = JSON.parse(readFileSync(resolve(__dirname, "package.json"), "utf8")) as { version?: string };
|
||||
|
||||
function readGitCommit(): string {
|
||||
try {
|
||||
return execSync("git rev-parse --short HEAD", { cwd: __dirname, stdio: ["ignore", "pipe", "ignore"] })
|
||||
.toString()
|
||||
.trim();
|
||||
} catch {
|
||||
return "dev";
|
||||
}
|
||||
}
|
||||
|
||||
const appBuildLabel = `v${packageJson.version || "0.0.0"}-${readGitCommit()}`;
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
define: {
|
||||
__APP_BUILD__: JSON.stringify(appBuildLabel),
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue