Skip to content

Commit 04c42ec

Browse files
committed
Add skeleton for Firebase function
1 parent e63d124 commit 04c42ec

12 files changed

Lines changed: 4659 additions & 11 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ target
77
result
88
# Firebase cache
99
.firebase/
10+
node_modules
11+
ui-debug.log
1012
# Compiled site
1113
dist
1214

Cargo.lock

Lines changed: 246 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[workspace]
22
members = [
3-
"homotopy-core",
3+
"homotopy-cli",
44
"homotopy-common",
5-
"homotopy-model",
5+
"homotopy-core",
66
"homotopy-gl",
77
"homotopy-graphics",
8+
"homotopy-model",
9+
"homotopy-server",
810
"homotopy-web",
9-
"homotopy-cli",
1011
]
1112

1213
[profile.release]

Makefile.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ mkdir -p dist
2727
cp -f $(nix build .#highs --no-link --print-out-paths --extra-experimental-features flakes --extra-experimental-features nix-command)/highs.{js,wasm} dist/
2828
'''
2929

30+
[tasks.build-server]
31+
script = '''
32+
mkdir -p homotopy-server/dist
33+
cargo build -p homotopy-server --target wasm32-unknown-unknown --profile ${CARGO_MAKE_CARGO_PROFILE}
34+
wasm-bindgen --out-dir homotopy-server/dist --no-typescript --target nodejs target/wasm32-unknown-unknown/${TARGET_SUBDIRECTORY}/homotopy_server.wasm
35+
'''
36+
37+
[tasks.build-server-watch]
38+
run_task = { name = ["build-server"] }
39+
watch = { watch = ["homotopy-server/src", "homotopy-server/Cargo.toml"] }
40+
3041
[tasks.dist-static]
3142
script = '''
3243
mkdir -p dist
@@ -78,5 +89,17 @@ args = [
7889
"emulators:start"
7990
]
8091

92+
[tasks.firebase-emulator-functions]
93+
command = "firebase"
94+
args = [
95+
"emulators:start",
96+
"--only",
97+
"functions"
98+
]
99+
watch = { watch = ["homotopy-server/dist"] }
100+
81101
[tasks.serve]
82102
run_task = { name = ["build-highs", "dist-static-watch", "build-wasm-watch", "devserver"], fork = true, parallel = true }
103+
104+
[tasks.emulate-server]
105+
run_task = { name = ["build-server-watch", "firebase-emulator-functions"], fork = true, parallel = true }

firebase.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"functions": {
3+
"source": "homotopy-server/js"
4+
},
25
"hosting": {
36
"target": "homotopy-rs",
47
"public": "result",

0 commit comments

Comments
 (0)