feat: expose build info via new versions plugin (#9820)

This commit is contained in:
Vladimír Gorej
2024-04-15 11:55:20 +02:00
committed by GitHub
parent 68eb346a23
commit 463cd35d31
4 changed files with 33 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
/**
* @prettier
*/
import win from "core/window"
const afterLoad = () => {
// eslint-disable-next-line no-undef
const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, BUILD_TIME } = buildInfo
win.versions = win.versions || {}
win.versions.swaggerUI = {
version: PACKAGE_VERSION,
gitRevision: GIT_COMMIT,
gitDirty: GIT_DIRTY,
buildTimestamp: BUILD_TIME,
}
}
export default afterLoad

View File

@@ -0,0 +1,10 @@
/**
* @prettier
*/
import afterLoad from "./after-load.js"
const VersionsPlugin = () => ({
afterLoad,
})
export default VersionsPlugin