Update "Requirements" and "Getting started" README sections (#205)

I hope this makes `README.md` a bit more friendly for our early adopters, but any feedback is welcome as usual 🙂
This commit is contained in:
Max Desiatov 2020-07-22 22:27:19 +01:00 committed by GitHub
parent ac50208447
commit f15f598d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 61 additions and 10 deletions

View File

@ -21,16 +21,6 @@ forget to check [the "Contributing" section](https://github.com/swiftwasm/Tokama
If you'd like to participate in the growing [SwiftWasm](https://swiftwasm.org) community, you're also very
welcome to join the `#webassembly` channel in [the SwiftPM Slack](https://swift-package-manager.herokuapp.com/).
## Getting started
Tokamak relies on [`carton`](https://carton.dev) as a primary build tool. Please follow
[installation instructions](https://github.com/swiftwasm/carton#requirements) for `carton` first.
After `carton` is successfully installed, type `carton dev --product TokamakDemo` in the
root directory of the cloned Tokamak repository. This will build the demo project and its
dependencies and launch a development HTTP server. You can then open
[http://127.0.0.1:8080/](http://127.0.0.1:8080/) in your browser to interact with the demo.
### Example code
Tokamak API attempts to resemble SwiftUI API as much as possible. The main difference is
@ -115,6 +105,67 @@ This way both [Semantic UI](https://semantic-ui.com/) styles and [moment.js](htt
localized date formatting (or any arbitrary style/script/font added that way) are available in your
app.
## Requirements for app developers
- macOS 10.15 and Xcode 11.4 or later for macOS.
- [Swift 5.2 or later](https://swift.org/download/) for Linux.
## Requirements for app users
Any browser that [supports WebAssembly](https://caniuse.com/#feat=wasm) should work, which currently includes:
- Edge 16+
- Firefox 53+
- Chrome 57+
- (Mobile) Safari 11+
Not all of these were tested though, compatibility reports are very welcome!
## Getting started
Tokamak relies on [`carton`](https://carton.dev) as a primary build tool. As a part of these steps
you'll install `carton` via [Homebrew](https://brew.sh/) on macOS (unfortunately you'll have to build
it manually on Linux). Assuming you already have Homebrew installed, you can create a new Tokamak
app by following these steps:
1. Install `carton`:
```
brew install swiftwasm/tap/carton
```
If you had `carton` installed before this, make sure you have version 0.4.1 or greater:
```
carton --version
```
2. Create a directory for your project and make it current:
```
mkdir TokamakApp && cd TokamakApp
```
3. Initialize the project from a template with `carton`:
```
carton init --template tokamak
```
4. Build the project and start the development server, `carton dev` can be kept running
during development:
```
carton dev
```
5. Open [http://127.0.0.1:8080/](http://127.0.0.1:8080/) in your browser to see the app
running. You can edit the app source code in your favorite editor and save it, `carton`
will immediately rebuild the app and reload all browser tabs that have the app open.
You can also clone this repository and run `carton dev` in its root directory. This
will build the demo app that shows almost all of the currently implemented APIs.
## Contributing
### Modular structure