Skip to content

Commit

Permalink
[WIP] Implement the importing of optics (#167)
Browse files Browse the repository at this point in the history
* Initial implementation of importing sites from an optic

* Removed unused import

* Updated button text

* Implemented client-side WASM to allow for parsing of imported .optic files

* Removed unneeded deps & updated `CONTRIBUTING.md` to reflect wasm-pack needs

* CI updates

* Added vite-plugin-wasm-pack to ensure wasm modules get copied over

* CI fix >:(

* More CI attempts

* agony - CSP fix & further wasm-pack fixes

* CSP updates

* Package update to prevent an unneccesary build of wasm

* reduce bloat in ci build log from wasm

* fix another non-determinsticly failing test

* only install wasm-pack as part of setup steps in CONTRIBUTING.md
./scripts/ci/check seems to fail if it tries to install wasm-pack while it is already installed (at least on my machine). as it is already added as a step in CONTRIBUTING.md we can assume it has been installed on the system

* add vite plugin to ensure changes to 'crates/client-wasm' gets reflected in the frontend.
adapted from #109

* run 'npm run format'

* propagate errors from wasm crate
  • Loading branch information
lamemakes authored Feb 28, 2024
1 parent 6b9d514 commit 25c0344
Show file tree
Hide file tree
Showing 22 changed files with 1,244 additions and 110 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Install liburing
run: |
sudo apt-get update
sudo apt-get install -y liburing-dev
sudo apt-get update
sudo apt-get install -y liburing-dev
- name: Install wasm-pack
run: cargo install wasm-pack
- uses: taiki-e/install-action@v2
with:
tool: cargo-about
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"rust-analyzer.linkedProjects": [
"Cargo.toml",
"./crates/optics-lsp/Cargo.toml",
"./crates/client-wasm/Cargo.toml",
"./crates/core/Cargo.toml"
]
}
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ if they take our code without making theirs open source, which would breach the
* Install clang and npm
* Update ulimit. RocksDB tends to exceed the max number of allowed open files, so you will have to run `ulimit -n 10240` to increase the allowed max number of open files.
* Install [just](https://github.com/casey/just) by running `cargo install just`. This allows you to run the scripts in the `justfile` file. A justfile is basically a simple Makefile.
* Install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) by running `cargo install wasm-pack`. This will allow for generation and packaging of client side WebAssembly code.
* Run the command `just configure` which should automatically configures the rest of your dev environment. The script creates a python virtual environment, installs relevant dependencies, traces and exports the ML models and creates a small local index which you can use for development.
* (Optional) Install [cargo-watch](https://github.com/watchexec/cargo-watch) by running `cargo install cargo-watch`. This makes frontend development easier.
* Install [cargo-watch](https://github.com/watchexec/cargo-watch) by running `cargo install cargo-watch`.
* (Optional) Install [abeye](https://github.com/oeb25/abeye) by running `cargo install --git https://github.com/oeb25/abeye --locked`. This is used for generating the API client used by the frontend by running `just openapi`.

After the non optional steps you can now run `cargo test` and should see all tests passing. If you have installced `cargo-watch`, you should be able to run `just dev` to start the search server and launch the frontend at `0.0.0.0:8000`.
1 change: 1 addition & 0 deletions crates/client-wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pkg/
Loading

0 comments on commit 25c0344

Please sign in to comment.