-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #588 from Shopify/lindadamus/add_multiclass_discounts
Add template code for multi-class discounts in rust
- Loading branch information
Showing
11 changed files
with
5,919 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/target | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "{{handle | replace: " ", "-" | downcase}}" | ||
version = "1.0.0" | ||
edition = "2021" | ||
rust-version = "1.84" | ||
|
||
[dependencies] | ||
serde = { version = "1.0.13", features = ["derive"] } | ||
serde_json = "1.0" | ||
shopify_function = "0.8.1" | ||
graphql_client = "0.14.0" | ||
|
||
[profile.release] | ||
lto = true | ||
opt-level = 'z' | ||
strip = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Shopify Function development with Rust | ||
|
||
## Dependencies | ||
|
||
- [Install Rust](https://www.rust-lang.org/tools/install) | ||
- 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. | ||
|
||
## Building the function | ||
|
||
You can build this individual function using `cargo build`. | ||
|
||
```shell | ||
cargo build --target=wasm32-wasip1 --release | ||
``` | ||
|
||
The Shopify CLI `build` command will also execute this, based on the configuration in `shopify.extension.toml`. |
4 changes: 4 additions & 0 deletions
4
discounts/rust/discounts/default/locales/en.default.json.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "{{name}}", | ||
"description": "{{name}}" | ||
} |
Oops, something went wrong.