Skip to content

Theme Scripts is a collection of utility libraries which help theme developers with problems unique to Shopify Themes.

License

Notifications You must be signed in to change notification settings

jonnymets/theme-scripts

 
 

Repository files navigation

Build Status

Shopify Theme Scripts

⚠️ Shopify Theme Scripts is currently an Alpha release. You should expect breaking changes between updates and more bugs than a finalized release. We believe that by getting Theme Scripts in the hands of developer communtiy as soon as possible, we can gather critical feedback to make it an even bigger success.

Theme Scripts is a collection of handy utility libraries which help theme developers with problems unique to Shopify Themes.

The goal of each theme script is to be remain uncoupled from a particular UI. Typically, theme scripts should be used alongside a customized solution for a particular theme. For example, @shopify/theme-cart is a great way to interact with the Shopify Cart API and add and remove items, but it does not enforce a particular pattern to display or update the visual state of the cart.

Getting Started

Theme Scripts can be used in any theme project. To take advantage of semantic versioning and easy updates, we recommend using NPM or Yarn to include them in your project. For example, to use @shopify/theme-cart in your project:

yarn add @shopify/theme-cart

and then import the functions you wish to use through ES6 imports:

import {updateNote} from '@shopify/theme-cart`;

Explore each of packages for documentation on how to use each Theme Script.

CommonJS and ES Module Builds

Each Theme Script is transpiled to two versions:

  1. A CommonJS version which can be imported using require() syntax.
  2. A ES Module version which can be imported using import syntax.

Webpack detects the "modules" key when using importing via import so the correct version should automatically be imported for you.

Contributing

For help on setting up the repository locally, building, testing, and contributing please see CONTRIBUTING.md.

Code of Conduct

All developers who wish to contribute through code or issues, take a look at the Code of Conduct.

License

Copyright (c) 2018 Shopify. See LICENSE for further details.

About

Theme Scripts is a collection of utility libraries which help theme developers with problems unique to Shopify Themes.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%