diff --git a/Makefile b/Makefile index b3781ec..b09bc53 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,9 @@ js-asm: wasm-pack build --target web --out-name ${ASM_FILE_NAME} && \ cd .. && \ rm -rf "${WEB_ASM_PATH}/*" && \ - cp -a ${ASM_PATH}/pkg/* ${WEB_ASM_PATH} + cp -a ${ASM_PATH}/pkg/* ${WEB_ASM_PATH} && \ + echo "export const VERSION = \"${COMMIT_ID}\"" | cat > "${WEB_ASM_PATH}/version.ts" + ci-install: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh diff --git a/server/web/src/asm/version.ts b/server/web/src/asm/version.ts new file mode 100644 index 0000000..0410f26 --- /dev/null +++ b/server/web/src/asm/version.ts @@ -0,0 +1 @@ +export const VERSION = "c18ae9d" diff --git a/server/web/src/components/page/home.tsx b/server/web/src/components/page/home.tsx index 8d5d85a..9876c8f 100644 --- a/server/web/src/components/page/home.tsx +++ b/server/web/src/components/page/home.tsx @@ -26,10 +26,12 @@ import { Highlighter, HighlighterLang } from "../highlight"; import init, { show_detail_in_display as showDetailInDisplay, } from "asm"; +import { VERSION } from "asm/version" import { useToast } from "@timex/components/ui/use-toast"; import { Alert, AlertDescription, AlertTitle } from "../ui/alert"; async function Temp() { + console.log("web assembly version: ", VERSION) await init(); }