aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2024-07-12 11:33:00 +0800
committerkaiwu <kaiwu2004@gmail.com>2024-07-12 11:33:00 +0800
commitcdcdc58d001d87e8430e1a4818252d3ce18daf2b (patch)
tree6ce6ed876a370ba9b3ae2efe914565cd79fe4098
downloadwechat_dev_tools-cdcdc58d001d87e8430e1a4818252d3ce18daf2b.tar.gz
wechat_dev_tools-cdcdc58d001d87e8430e1a4818252d3ce18daf2b.zip
git init
-rw-r--r--.github/workflows/test.yml23
-rw-r--r--.gitignore4
-rw-r--r--README.md24
-rw-r--r--gleam.toml22
-rw-r--r--manifest.toml17
-rw-r--r--src/wechat_dev_tools.gleam5
-rw-r--r--test/wechat_dev_tools_test.gleam12
7 files changed, 107 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..37da810
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,23 @@
+name: test
+
+on:
+ push:
+ branches:
+ - master
+ - main
+ pull_request:
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: erlef/setup-beam@v1
+ with:
+ otp-version: "26.0.2"
+ gleam-version: "1.3.0"
+ rebar3-version: "3"
+ # elixir-version: "1.15.4"
+ - run: gleam deps download
+ - run: gleam test
+ - run: gleam format --check src test
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..599be4e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.beam
+*.ez
+/build
+erl_crash.dump
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..cdc5700
--- /dev/null
+++ b/README.md
@@ -0,0 +1,24 @@
+# wechat_dev_tools
+
+[![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/)
+
+```sh
+gleam add wechat_dev_tools@1
+```
+```gleam
+import wechat_dev_tools
+
+pub fn main() {
+ // TODO: An example of the project in use
+}
+```
+
+Further documentation can be found at <https://hexdocs.pm/wechat_dev_tools>.
+
+## Development
+
+```sh
+gleam run # Run the project
+gleam test # Run the tests
+```
diff --git a/gleam.toml b/gleam.toml
new file mode 100644
index 0000000..5ffed8e
--- /dev/null
+++ b/gleam.toml
@@ -0,0 +1,22 @@
+name = "wechat_dev_tools"
+version = "0.1.0"
+description = "tools to develop wechat miniprogram in gleam"
+
+# Fill out these fields if you intend to generate HTML documentation or publish
+# your project to the Hex package manager.
+#
+licences = ["Apache-2.0"]
+repository = { type = "github", user = "kaiwu", repo = "wechat_dev_tools" }
+# links = [{ title = "Website", href = "" }]
+#
+# For a full reference of all the available options, you can have a look at
+# https://gleam.run/writing-gleam/gleam-toml/.
+
+[dependencies]
+gleam_stdlib = ">= 0.34.0 and < 2.0.0"
+gleam_javascript = ">= 0.11.0 and < 1.0.0"
+simplifile = ">= 2.0.1 and < 3.0.0"
+filepath = ">= 1.0.0 and < 2.0.0"
+
+[dev-dependencies]
+gleeunit = ">= 1.0.0 and < 2.0.0"
diff --git a/manifest.toml b/manifest.toml
new file mode 100644
index 0000000..8bd73b3
--- /dev/null
+++ b/manifest.toml
@@ -0,0 +1,17 @@
+# This file was generated by Gleam
+# You typically do not need to edit this file
+
+packages = [
+ { name = "filepath", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "EFB6FF65C98B2A16378ABC3EE2B14124168C0CE5201553DE652E2644DCFDB594" },
+ { name = "gleam_javascript", version = "0.11.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_javascript", source = "hex", outer_checksum = "483631D3001FCE8EB12ADEAD5E1B808440038E96F93DA7A32D326C82F480C0B2" },
+ { name = "gleam_stdlib", version = "0.39.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "2D7DE885A6EA7F1D5015D1698920C9BAF7241102836CE0C3837A4F160128A9C4" },
+ { name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
+ { name = "simplifile", version = "2.0.1", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "5FFEBD0CAB39BDD343C3E1CCA6438B2848847DC170BA2386DF9D7064F34DF000" },
+]
+
+[requirements]
+filepath = { version = ">= 1.0.0 and < 2.0.0"}
+gleam_javascript = { version = ">= 0.11.0 and < 1.0.0" }
+gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
+gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
+simplifile = { version = ">= 2.0.1 and < 3.0.0" }
diff --git a/src/wechat_dev_tools.gleam b/src/wechat_dev_tools.gleam
new file mode 100644
index 0000000..5d28b5d
--- /dev/null
+++ b/src/wechat_dev_tools.gleam
@@ -0,0 +1,5 @@
+import gleam/io
+
+pub fn main() {
+ io.println("Hello from wechat_dev_tools!")
+}
diff --git a/test/wechat_dev_tools_test.gleam b/test/wechat_dev_tools_test.gleam
new file mode 100644
index 0000000..3831e7a
--- /dev/null
+++ b/test/wechat_dev_tools_test.gleam
@@ -0,0 +1,12 @@
+import gleeunit
+import gleeunit/should
+
+pub fn main() {
+ gleeunit.main()
+}
+
+// gleeunit test functions end in `_test`
+pub fn hello_world_test() {
+ 1
+ |> should.equal(1)
+}