@shopify/themekit
Node version of ThemeKit
Last updated 2 months ago by wizardlyhel .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @shopify/themekit 
SYNC missed versions from official npm registry.

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:

Requirements

  • Have access to npmjs Shopify organization
  • Yarn must be installed

Instructions

  • Bump the version in package.json
  • Create a release on Github as well as tagging the release
  • Publish the package on npmjs

License

MIT, see LICENSE.md for details.

Current Tags

  • 1.1.4                                ...           latest (2 months ago)

19 Versions

  • 1.1.4                                ...           2 months ago
  • 1.1.3                                ...           6 months ago
  • 1.1.2                                ...           9 months ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.6.12                                ...           3 years ago
  • 0.6.11                                ...           3 years ago
  • 0.6.6                                ...           3 years ago
  • 0.6.4                                ...           3 years ago
  • 0.6.3                                ...           3 years ago
  • 0.6.1                                ...           3 years ago
  • 0.6.0                                ...           4 years ago
  • 0.5.3                                ...           4 years ago
  • 0.5.1                                ...           4 years ago
  • 0.5.0                                ...           4 years ago
  • 0.4.7                                ...           4 years ago
  • 0.4.3                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |