Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.1 KB

File metadata and controls

46 lines (35 loc) · 1.1 KB

extensions-templates

This repo contains the templates used by @shopify/app CLI when generating extensions.

Local Functions Development

The following instructions are for building and testing Function templates, which follow the pattern functions-*-[rs|js].

Expand Liquid Templates

If you wish to build and test the functions templates, you must first expand any .liquid templates with the following command.

yarn
yarn expand-liquid [rust|vanilla-js|typescript] <project-name-without-suffix>
# example: yarn expand-liquid rust functions-cart-checkout-validation

# optionally specify only the language argument to expand all functions projects for that language
yarn expand-liquid rust
yarn expand-liquid typescript
yarn expand-liquid vanilla-js
yarn expand-liquid wasm

JavaScript / TypeScript

# Setup node workspaces
yarn
# Generate types from GraphQL schemas
yarn js-typegen
# Run tests
yarn js-test

Rust

# Lint
cargo fmt
cargo clippy -- -D warnings
# Run tests
cargo test
# Build .wasm packages
cargo build --release --target wasm32-unknown-unknown