Skip to content

Commit 77efe7a

Browse files
Merge pull request #588 from Shopify/lindadamus/add_multiclass_discounts
Add template code for multi-class discounts in rust
2 parents 2ae226e + a258837 commit 77efe7a

File tree

11 files changed

+5919
-0
lines changed

11 files changed

+5919
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
Cargo.lock
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "{{handle | replace: " ", "-" | downcase}}"
3+
version = "1.0.0"
4+
edition = "2021"
5+
rust-version = "1.84"
6+
7+
[dependencies]
8+
serde = { version = "1.0.13", features = ["derive"] }
9+
serde_json = "1.0"
10+
shopify_function = "0.8.1"
11+
graphql_client = "0.14.0"
12+
13+
[profile.release]
14+
lto = true
15+
opt-level = 'z'
16+
strip = true
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Shopify Function development with Rust
2+
3+
## Dependencies
4+
5+
- [Install Rust](https://www.rust-lang.org/tools/install)
6+
- On Windows, Rust requires the [Microsoft C++ Build Tools](https://docs.microsoft.com/en-us/windows/dev-environment/rust/setup). Be sure to select the _Desktop development with C++_ workload when installing them.
7+
8+
## Building the function
9+
10+
You can build this individual function using `cargo build`.
11+
12+
```shell
13+
cargo build --target=wasm32-wasip1 --release
14+
```
15+
16+
The Shopify CLI `build` command will also execute this, based on the configuration in `shopify.extension.toml`.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "{{name}}",
3+
"description": "{{name}}"
4+
}

0 commit comments

Comments
 (0)