From 9a4e36bcbd42ecdbc7a2c8bdb2c9fdf85df608b5 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Sat, 28 Dec 2024 21:05:38 -0500 Subject: [PATCH] add `npm run deploy` target (#220) This only works for folks with SSH access to my website, i.e. me. Perhaps in the future we could deploy with a Github action! --- demos/web-editor/web/package.json | 7 ++++--- demos/web-editor/web/src/index.html | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/demos/web-editor/web/package.json b/demos/web-editor/web/package.json index aa7b70e7..43ae9220 100644 --- a/demos/web-editor/web/package.json +++ b/demos/web-editor/web/package.json @@ -2,10 +2,11 @@ "scripts": { "build-wasm": "cd ../crate && wasm-pack build --target web --release", "build-web": "webpack --mode production", - "build-static": "cp src/index.html serve.json dist/", + "build-static": "sed \"s/VERSION/$(git log --pretty=format:'%h' -n 1)/g;s/MOD/$(git diff --quiet --exit-code || echo +)/g\" src/index.html > dist/index.html && grep 'Header add' ../README.md > dist/.htaccess", "dist": "npm run build-wasm && npm run build-web && npm run build-static", - "serve": "npm run dist && serve -c serve.json dist", - "format": "prettier . --write" + "serve": "npm run dist && serve -c ../serve.json dist", + "format": "prettier . --write", + "deploy": "rm dist/* && npm run dist && rsync -avz --delete -e ssh ./dist/ mkeeter@mattkeeter.com:mattkeeter.com/projects/fidget/demo" }, "dependencies": { "@lezer/lr": "^1.0.0", diff --git a/demos/web-editor/web/src/index.html b/demos/web-editor/web/src/index.html index 7aa68583..ee6db76c 100644 --- a/demos/web-editor/web/src/index.html +++ b/demos/web-editor/web/src/index.html @@ -39,6 +39,9 @@ flex: 50%; max-width: calc(min(100%, 512px)); } + div#version { + font-family: monospace; + } @@ -57,6 +60,19 @@ +
+

+ Github | + Writeup +

+ +

+ Version: + + VERSIONMOD +

+