diff options
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | gleam.toml | 1 | ||||
-rw-r--r-- | src/app/app.gleam | 5 |
3 files changed, 18 insertions, 4 deletions
@@ -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 + [](https://hex.pm/packages/wechat_dev_tools) [](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 +``` @@ -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 { |