feat: add LAST_UPDATED environment variable, update VersionOverlay to display last updated timestamp, and introduce patch script
This commit is contained in:
parent
0bf874a991
commit
c6fecb54f2
4 changed files with 17 additions and 4 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
DATABASE_URI=postgres://ptfapp:polaristaskforcedb@127.0.0.1:5432/ptf-app-stg
|
DATABASE_URI=postgres://ptfapp:polaristaskforcedb@127.0.0.1:5432/ptf-app-stg
|
||||||
PAYLOAD_SECRET=b5ac11acc77ea8427d10fcd0
|
PAYLOAD_SECRET=b5ac11acc77ea8427d10fcd0
|
||||||
# Added by Payload
|
# Added by Payload
|
||||||
|
|
||||||
|
LAST_UPDATED=
|
||||||
0
bunfig.toml
Normal file
0
bunfig.toml
Normal file
|
|
@ -19,6 +19,7 @@
|
||||||
"test": "pnpm run test:int && pnpm run test:e2e",
|
"test": "pnpm run test:int && pnpm run test:e2e",
|
||||||
"test:e2e": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" pnpm exec playwright test",
|
"test:e2e": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" pnpm exec playwright test",
|
||||||
"test:int": "cross-env NODE_OPTIONS=--no-deprecation vitest run --config ./vitest.config.mts",
|
"test:int": "cross-env NODE_OPTIONS=--no-deprecation vitest run --config ./vitest.config.mts",
|
||||||
|
"patch": "bun pm version patch --message \"chore: update to %s\"",
|
||||||
"preversion": "bun run build",
|
"preversion": "bun run build",
|
||||||
"postversion": "bash ./build/deploy.sh"
|
"postversion": "bash ./build/deploy.sh"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,21 @@
|
||||||
const VersionOverlay = () => {
|
const VersionOverlay = () => {
|
||||||
const appVersion = process.env.version;
|
const appVersion = process.env.version;
|
||||||
|
const appLastUpdated = process.env.LAST_UPDATED;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed top-0 z-9999 text-white w-full flex flex-items-center justify-center pointer-events-none">
|
<div className="fixed top-0 z-9999 w-full flex justify-center">
|
||||||
<span className="text-center text-sm bg-rose-950 px-2 rounded-b">version {appVersion ?? "Unknown version"}</span>
|
<div className="text-white flex flex-col items-center justify-between bg-red-950 w-fit px-2 rounded-b group overflow-hidden">
|
||||||
|
<span className="text-center text-sm pointer-events-none">
|
||||||
|
version {appVersion ?? "Unknown version"}
|
||||||
|
</span>
|
||||||
|
{appLastUpdated && (
|
||||||
|
<span className="text-center text-xs h-0 group-hover:h-full pointer-events-none transition-all duration-100 ease-in-out">
|
||||||
|
last updated {new Date(Number(appLastUpdated) * 1000).toLocaleString()}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default VersionOverlay;
|
export default VersionOverlay;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue