11.0.0 • Published 4 years ago

@shopify/scripts-sdk-as v11.0.0

Weekly downloads
186
License
UNLICENSED
Repository
github
Last release
4 years ago

Scripts AssemblyScript SDK

Build status

About this repo | Commands | How to use this repo | Contribute to this repo | Resources

About this repo

The Scripts AssemblyScript SDK is a library of useful classes and functions that are available for all script extension point authors to use when building their extension point API. Their purpose is to provide a standardized set of models to be shared across extension points. This saves extension point authors time and maintains consistency across different script extension point APIs.

Some examples of the models:

  • Money - A representation of a Shopify Money object with operations such as rounding and calculations.
  • Int, Float, OverflowableInteger - Numeric types support
  • Configuration - A representation of a script's configuration.

The exported models are distributed as part of the @shopify/scripts-sdk-as NPM package.

Current statusOngoing
Owner@Shopify/scripts-experience (Vault, Slack)
HelpPing us in #scripts-v2-experience

Commands

Unit tests

dev test runs all unit tests.

Update docs

npm run docs:update regenerates the TypeDoc API docs. This generally needs to be done whenever an API or doc comment changes.

Build currencies

npm run build:currencies regenerates the assembly/Money/Currency/Currencies.ts file based on the contents of scripts/currencies/currencies.json. This needs to be done whenever the currencies.json file is updated.

Formatting

npm run fmt will format all AssemblyScript files according to the Prettier config.

npm run fmt:check will validate all AssemblyScript files are formatted properly according to the Prettier config. This command is useful for CI checks.

Linting

npm run lint will run ESLint across the codebase.

How to use this repo

Requirements

  • NPM
  • An AssemblyScript project, such as an extension point project or a Shopify script

Installation

Installing this package into your AssemblyScript project can be done with the following NPM command:

npm install @shopify/scripts-sdk-as

Usage

Once included in your project, you can import classes and functions from this package using the ES6 import command. For example:

import {Money} from '@shopify/scripts-sdk-as`;

Documentation

API documentation can be found here: https://shopify.github.io/scripts-sdk-as/api/

Contribute to this repo

Setup

Just dev up and you're good to go 🎉

Testing

Code changes to this repository needs to be accompanied by unit tests. To write unit tests, create a corresponding test file to your source file in the test directory. Your test file needs to have the same filename as your source file except with a .spec.ts extension.

Requesting PR reviews

Add @Shopify/scripts as a reviewer to your PR for a review. All code needs to be reviewed before merging to master.

Deploying

To release a new version of the SDK, perform the following steps:

  1. In a new branch, increment the version in package.json with the appropriate bump based on the changes (major, minor, or patch).
  2. Run npm install to update the package-lock.json file.
  3. Put up a PR for the version bump.
  4. Once your PR is approved and merged, create a release. Name the release with v{versionNumber} where versionNumber is the version in package.json.
  5. Go to Shipit and hit deploy. This will release the package to NPM.

Resources

11.0.0

4 years ago

10.1.0

4 years ago

10.0.0

4 years ago

9.2.0

4 years ago

9.1.0

4 years ago

9.0.1

4 years ago

8.1.0

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.0.1

4 years ago

7.0.0

4 years ago

6.3.0

4 years ago

6.2.1

5 years ago

6.2.0

5 years ago

6.1.0

5 years ago

6.0.0

5 years ago

5.0.3

5 years ago

4.0.3

5 years ago

4.0.0

5 years ago

4.0.2

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.1.4

5 years ago

1.1.0

5 years ago