Remove WebPack and let Vue CLI handle WASM. Project restructuring fixes. Add Vue SVG Loader. Fixes #29.

This commit is contained in:
Keavon Chambers
2021-03-23 01:09:29 -07:00
parent 76043cebcb
commit fb5ce7e388
26 changed files with 314 additions and 649 deletions
+20 -12
View File
@@ -66,27 +66,35 @@ We are also focusing initial feature development on a destructive SVG vector edi
## Running the code
The project is split between a Rust crates in `/packages` and web-based frontend in `/web-frontend` (this will be replaced by a native GUI system in the future in order to compile Graphite for Windows, Mac, and Linux). Currently the Vue.js frontend runs with the Vue CLI but the WASM bindings HTML/JS is built with WebPack (see [issue #29](https://github.com/GraphiteEditor/Graphite/issues/29)).
The project is split clients and core libraries (which use the clients). Currently the only important client is the web frontend (`/client/web`). There's also a CLI client that may be useful for testing. The only core library so far is the Editor Core Library (`/core/editor`). The web client's Vue code lives in `/client/web/vue` and a Rust wrapper for the Editor Core Library (which exposes functions to JavaScript through bindings generated by wasm-bindgen) lives in `/client/web/wasm`.
### Running the web frontend
A good starting point for learning about the code structure and architecture is reading the [documentation](docs/index.md).
### Web client
This is the primary means of running and developing the project. You may need to download and install [Rust](https://www.rust-lang.org/), [Node.js](https://nodejs.org/) and [wasm-pack](https://rustwasm.github.io/wasm-pack/).
```
cd web-frontend
cd client
cd web
npm install
npm run serve
```
### Running the WASM binding generator
### CLI client
PREREQUISITE: [Download and install](https://rustwasm.github.io/wasm-pack/) wasm-pack first.
```
cd web-frontend
npm install
npm run webpack-start
```
### Running the Rust code
This may be useful for testing at some point.
```
cargo run
```
### Editor core library
This will be run and tested mainly through the web frontend, which builds the Rust code into WebAssembly automatically. But if you need to build the code on its own:
```
cd core
cd editor
cargo build
```