Skip to content

Commit

Permalink
chore: display of web assembly version
Browse files Browse the repository at this point in the history
  • Loading branch information
jawahar273 committed Feb 5, 2024
1 parent c18ae9d commit 24a72c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions server/web/src/asm/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const VERSION = "c18ae9d"
2 changes: 2 additions & 0 deletions server/web/src/components/page/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 24a72c5

Please sign in to comment.