Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
FROM debian:bookworm-slim
ENV SHELL /bin/bash
ARG user_id=1000
ARG group_id=1000

# install packages
RUN apt-get update --fix-missing && DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends \
build-essential \
pkg-config \
libssl-dev \
lsb-release \
ca-certificates \
curl \
git-core \
gnupg \
nano \
nodejs \
npm \
openssh-client \
procps \
python3 \
python3-selenium \
python3-watchdog \
sudo \
&& rm -rf /var/lib/apt/lists/*

# install latest binaryen 116 (September 2023)
RUN curl -fsSL https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz | \
tar xvz --strip-components 1 --directory /usr

# Create a developer user
RUN groupadd --gid $group_id developer && useradd --uid $user_id --gid $group_id -m developer
# Add developer user to the sudo file
RUN echo developer ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer
# Switch the developer user
USER developer

# install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target wasm32-unknown-unknown
ENV PATH=/home/developer/.cargo/bin:$PATH
RUN cargo install --git https://github.com/rustwasm/wasm-bindgen.git --tag 0.2.91 wasm-bindgen-cli
FROM debian:bookworm-slim
ENV SHELL /bin/bash
ARG user_id=1000
ARG group_id=1000
# install packages
RUN apt-get update --fix-missing && DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends \
build-essential \
pkg-config \
libssl-dev \
lsb-release \
ca-certificates \
curl \
git-core \
gnupg \
nano \
nodejs \
npm \
openssh-client \
procps \
python3 \
python3-selenium \
python3-watchdog \
sudo \
&& rm -rf /var/lib/apt/lists/*
# install latest binaryen 116 (September 2023)
RUN curl -fsSL https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz | \
tar xvz --strip-components 1 --directory /usr
# Create a developer user
RUN groupadd --gid $group_id developer && useradd --uid $user_id --gid $group_id -m developer
# Add developer user to the sudo file
RUN echo developer ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer
# Switch the developer user
USER developer
# install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target wasm32-unknown-unknown
ENV PATH=/home/developer/.cargo/bin:$PATH
RUN cargo install --git https://github.com/rustwasm/wasm-bindgen.git --tag 0.2.91 wasm-bindgen-cli
30 changes: 15 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "ide",
"build": { "dockerfile": "Dockerfile" },
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
},
"remoteUser": "developer",
"runArgs": [
"--network=host"
]
}
{
"name": "ide",
"build": { "dockerfile": "Dockerfile" },
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
},
"remoteUser": "developer",
"runArgs": [
"--network=host"
]
}
6 changes: 3 additions & 3 deletions crates/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build]
target = "wasm32-unknown-unknown"
target-dir = "../build/crates"
[build]
target = "wasm32-unknown-unknown"
target-dir = "../build/crates"
9 changes: 5 additions & 4 deletions crates/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions crates/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[workspace]
resolver = "2"
members = [
"frontend"
]

default-members = [
"frontend"
]

[profile.release]
lto = true
codegen-units = 1
opt-level = "s" # 3 => fast, s/z => small

[workspace]
resolver = "2"
members = [
"frontend"
]
default-members = [
"frontend"
]
[profile.release]
lto = true
codegen-units = 1
opt-level = "s" # 3 => fast, s/z => small
73 changes: 37 additions & 36 deletions crates/frontend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
[package]
name = "frontend"
version = "0.1.0"
description = "Web Development"
authors = ["Michael Allwright <[email protected]>"]
license = "Closed"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
console_error_panic_hook = "0.1.6"
chrono = "0.4.24"
strum_macros = "0.24"
strum = { version = "0.24", features = ["derive"] }
dominator = "0.5.33"
dominator-bulma = { git = "https://github.com/rustifybe/dominator-bulma.git" }
codemirror-sys = { git = "https://github.com/rustifybe/codemirror-sys.git" }
futures = "0.3.26"
futures-signals = "0.3.31"
getrandom = { version = "0.2.8", features = ["js"] }
gloo-timers = { version = "0.2.6", features = ["futures"] }
gloo-net = { version = "0.2.6", features = ["http", "websocket", "json"] }
js-sys = "0.3.55"
tracing = { version = "0.1.37", default-features = false }
tracing-web = "0.1.2"
tracing-subscriber = { version = "0.3.16", features = ["time", "env-filter", "std"] }
regex = "1.10.6"
once_cell = "1.19.0"

wasm-bindgen = "=0.2.91"
wasm-bindgen-futures = "0.4.28"
[dependencies.web-sys]
version = "0.3.55"
features = ["HtmlHtmlElement"]
[package]
name = "frontend"
version = "0.1.0"
description = "Web Development"
authors = ["Michael Allwright <[email protected]>"]
license = "Closed"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
console_error_panic_hook = "0.1.6"
chrono = "0.4.24"
strum_macros = "0.24"
strum = { version = "0.24", features = ["derive"] }
dominator = "0.5.33"
dominator-bulma = { git = "https://github.com/rustifybe/dominator-bulma.git" }
codemirror-sys = { git = "https://github.com/rustifybe/codemirror-sys.git" }
futures = "0.3.26"
futures-signals = "0.3.31"
getrandom = { version = "0.2.8", features = ["js"] }
gloo-timers = { version = "0.2.6", features = ["futures"] }
gloo-net = { version = "0.2.6", features = ["http", "websocket", "json"] }
js-sys = "0.3.55"
tracing = { version = "0.1.37", default-features = false }
tracing-web = "0.1.2"
tracing-subscriber = { version = "0.3.16", features = ["time", "env-filter", "std"] }
regex = "1.10.6"
once_cell = "1.19.0"
time = "0.3.35"

wasm-bindgen = "=0.2.91"
wasm-bindgen-futures = "0.4.28"
[dependencies.web-sys]
version = "0.3.55"
features = ["HtmlHtmlElement"]
17 changes: 17 additions & 0 deletions crates/frontend/src/contextmenu/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use std::rc::Rc;
use futures_signals::signal::Mutable;

pub struct ContextMenuState {
pub show_menu: Mutable<bool>,
pub menu_position: Mutable<(i32, i32)>,
}


impl ContextMenuState {
pub fn new() -> Rc<Self> {
Rc::new(Self {
show_menu: Mutable::new(false),
menu_position: Mutable::new((0, 0)),
})
}
}
Loading