aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md16
-rw-r--r--gleam.toml1
-rw-r--r--src/app/app.gleam5
3 files changed, 18 insertions, 4 deletions
diff --git a/README.md b/README.md
index 28a7cab..539a913 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,13 @@
# wechat_dev_tools
+wechat_dev_tools is a template which enables developing wechat miniprograms in [gleam](https://gleam.run).
+It uses [esbuild]() and [esbuild-plugin-less]() to build `*.json`, `*.wxml` and `.wxss` files
+
[![Package Version](https://img.shields.io/hexpm/v/wechat_dev_tools)](https://hex.pm/packages/wechat_dev_tools)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/wechat_dev_tools/)
-wechat_dev_tools is a template which enables developing wechat miniprograms in [gleam](https://gleam.run). It uses [esbuild]() and [esbuild-plugin-less]() to build `*.json`, `*.wxml` and `.wxss` files
-
```sh
-$ npm i
+$ npm install
$ gleam build
```
Further documentation can be found at <https://hexdocs.pm/wechat_dev_tools>.
@@ -14,7 +15,16 @@ Further documentation can be found at <https://hexdocs.pm/wechat_dev_tools>.
## Development
```sh
+$ npm run purge
$ npm run clean
$ npm run build
$ npm run watch
```
+
+One can use the excellent `watchexec` command to watch gleam file changes, such as
+
+```sh
+$ # a full continuous building process
+$ watchexec -e gleam gleam build
+$ npm run watch
+```
diff --git a/gleam.toml b/gleam.toml
index fbbbace..3855846 100644
--- a/gleam.toml
+++ b/gleam.toml
@@ -8,6 +8,7 @@ target = "javascript"
#
licences = ["Apache-2.0"]
repository = { type = "github", user = "kaiwu", repo = "wechat_dev_tools" }
+gleam = ">= 0.32.0"
# links = [{ title = "Website", href = "" }]
#
# For a full reference of all the available options, you can have a look at
diff --git a/src/app/app.gleam b/src/app/app.gleam
index 83a2f48..f926521 100644
--- a/src/app/app.gleam
+++ b/src/app/app.gleam
@@ -3,7 +3,10 @@ import gleam/string
import wechat/object.{type JsObject}
fn on_launch(o: JsObject) -> Nil {
- o |> object.stringify |> string.append("gleam app launched: ", _) |> io.println
+ o
+ |> object.stringify
+ |> string.append("gleam app launched: ", _)
+ |> io.println
}
fn on_show(_o: JsObject) -> Nil {