This commit is contained in:
@@ -1,11 +1,30 @@
|
||||
# Vue 3 + Typescript + Vite
|
||||
# Covergen Frontend
|
||||
|
||||
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||||
## Quick startup
|
||||
|
||||
## Recommended IDE Setup
|
||||
For the frontend to function, the `covergen` wasm blob needs to be made available.
|
||||
This is not present in-tree but is easily prepared by running `make prepare-frontend` in the parent directory
|
||||
(i.e. the repo root).
|
||||
This will also do prepare the cross-cli's, but those are optional (you can run `make wasm-frontend` to just do the wasm).
|
||||
|
||||
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
|
||||
After this the usual `vite` / `vue3` commands apply:
|
||||
|
||||
## Type Support For `.vue` Imports in TS
|
||||
```shell
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
|
||||
To prepare a proper final build:
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
|
||||
## A note on `wasm_exec.js`
|
||||
|
||||
Go WASM requires a 'helper' library, `wasm_exec.js` to help with the bridging memory from Go <-> JS.
|
||||
This file is **different for each Go (1.XX) version**. The version bundled in-tree is for Go 1.16.
|
||||
If you run a different version, you might need to copy it from your local golang dist folder,
|
||||
usually `/usr/local/go/misc/wasm/wasm_exec.js`.
|
||||
|
||||
If your distribution doesn't provide this file (e.g. Fedora) you can just copy it from the go main repo by going to
|
||||
[https://github.com/golang/go/blob/master/misc/wasm/wasm_exec.js](https://github.com/golang/go/blob/master/misc/wasm/wasm_exec.js)
|
||||
and using the GitHub branch selector to select the `release-branch.go1.XX` that matches your version of go (run `go version` to find out).
|
||||
|
||||
Reference in New Issue
Block a user