npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@shopify/scripts-sdk-as

v11.0.0

Published

The AssemblyScript Shopify SDK

Downloads

34

Readme

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 status | Ongoing | | Owner | @Shopify/scripts-experience (Vault, Slack) | | Help | Ping 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