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

@tora-dev/themekit

v1.2.0

Published

Node wrapper around Theme Kit

Downloads

1,228

Readme

npm version

@shopify/themekit

Node wrapper for Theme Kit.

Table Of Contents

Installation

$ npm install @shopify/themekit

Usage

const themeKit = require('@shopify/themekit');

await themeKit.command('version');
//=> ThemeKit 0.8.1 darwin/amd64

Examples

Run commands

This wrapper exposes a single function in its API which allows it to run any command available in the original Theme Kit CLI. Here are a collection of examples to run Theme Kit commands.

For a complete list of commands and args: shopify.github.io/themekit/commands.

Example 1

Remove specific files from development environment.

const themeKit = require('@shopify/themekit');

await themeKit.command('remove', {
  env: 'development',
  files: ['snippets/pagination.liquid', 'snippets/date.liquid']
});

Example 3

Deploy all files to staging environment.

const themeKit = require('@shopify/themekit');

themeKit.command('deploy', {
  env: 'staging'
});

Example 4

Deploy theme to production via NPM scripts.

Warning: This example will overwrite the theme based on your config.yml.

"dependencies": {
  "@shopify/themekit": "1.0.0"
},
"scripts": {
  "deploy": "shopify-themekit replace --env production"
}

API

command(command[, flags][, options)

Executes command with arguments using the Theme Kit binary.

  • command <String>

    Theme Kit command to run.

  • flags <Object>

    Flags to pass into the command.

    All flags specified in the Theme Kit documentation are available, but in camelCase rather than in --flagform.

    {
      noIgnore: true, // --no-ignore
      env: 'development' // --env=development
    }

    Additional flags:

    • files: Specify an array of target files to upload.
    • ignoredFiles: Like ignoredFile, but takes in an array of files to ignore.
  • options <Object>

    {
      cwd: <String>,      // Hard-code a working directory to run the binary from
      logLevel: <String> // Set level additional output info | 'silent', 'error', 'all', 'silly'
    }

For a complete list of commands and flags, see the Theme Kit documentation.

CLI

$ shopify-themekit <args>

This CLI component of this package is intended to be used with NPM scripts. It functions exactly the same as the original Theme Kit binary. If you plan on using the command line interface heavily, please refer to the original Theme Kit repository.

Contributing

Releases

This information is for project maintainers:

Instructions

  • Use npm version <major|minor|patch> to update the version in package.json and package-lock.json.
  • Push the changes and the tag with git push --follow-tags
  • Open new PR corresponding to the new release, and merge once approved.
  • Release to npmjs.com by triggering a Shipit deploy of the master branch.
  • Visit https://www.npmjs.com/package/@shopify/themekit to confirm the new version is listed.
  • Create a release on GitHub.

License

MIT, see LICENSE.md for details.