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 type { ChangelogItem } from "./worldshaperStudio/changelogData";
|
||||||
import launcherBackground from "../background.png";
|
import launcherBackground from "../background.png";
|
||||||
|
|
||||||
|
declare const __APP_BUILD__: string;
|
||||||
|
|
||||||
type WorldDefaultPayload = {
|
type WorldDefaultPayload = {
|
||||||
worldId?: string;
|
worldId?: string;
|
||||||
world?: {
|
world?: {
|
||||||
|
|
@ -2257,6 +2259,7 @@ function WorldshaperLauncher() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<div className="launcher-build-stamp">Build {__APP_BUILD__}</div>
|
||||||
</div>
|
</div>
|
||||||
{adminPanelOpen && logsModalOpen ? (
|
{adminPanelOpen && logsModalOpen ? (
|
||||||
<div className="launcher-modal-backdrop" onClick={() => setLogsModalOpen(false)}>
|
<div className="launcher-modal-backdrop" onClick={() => setLogsModalOpen(false)}>
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,13 @@ body {
|
||||||
width: min(1440px, 100%);
|
width: min(1440px, 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.launcher-build-stamp {
|
||||||
|
color: #7f90ab;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.4;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.launcher-hero-window,
|
.launcher-hero-window,
|
||||||
.launcher-changelog-window {
|
.launcher-changelog-window {
|
||||||
border: 1px solid #4f79af;
|
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 { resolve } from "node:path";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
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/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
define: {
|
||||||
|
__APP_BUILD__: JSON.stringify(appBuildLabel),
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue