How to use @shopify/themekit - 7 common examples

To help you get started, we’ve selected a few @shopify/themekit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DynamoMTL / shopify-pipeline / lib / shopify-deploy.js View on Github external
/* eslint-disable no-use-before-define */
const prompt = require('react-dev-utils/prompt')
const themekit = require('@shopify/themekit').command
const config = require('../config')
const promptIfMainTheme = require('./prompt-if-main-theme')

const settings = {
  env: 'development',
  deployRoot: config.paths.dist,
  defaultArgs: [
    '--no-update-notifier',
    '--config', config.paths.userShopifyConfig
  ]
}

let deploying = false
let filesToDeploy = []

function maybeDeploy() {
github the-couch / slater-cli / lib / watch.js View on Github external
process.env.SLATER_HMR = true

const fs = require('fs')
const path = require('path')
const http = require('https')
const watcher = require('node-watch')
const theme = require('@shopify/themekit').command
const io = require('socket.io')(http)
const colors = require('colors')
const app = require('express')()
const queue = require('function-rate-limit')
const ignore = require('gitignore-parser')
const gitignore = ignore.compile(fs.readFileSync(
  path.join(process.cwd(), '/.gitignore')
, 'utf8'))

const compiler = require('./webpack.js')
const webpackDevMiddleware = require('webpack-dev-middleware')
const webpackHotMiddleware = require('webpack-hot-middleware')

// @see https://github.com/webpack/webpack-dev-server/tree/master/examples/https
const ssl = {
  key: fs.readFileSync(__dirname + '/cert/server.key'),
github barrel / barrel-cli / lib / util.js View on Github external
const colors = require('colors')
const theme = require('@shopify/themekit').command
const config = require('./configure')

const sendToShopify = (action, src, cb) => {
  if (~config.get('ignore').indexOf(
    src.replace(/\/?dist\//, '')
  )) {
    console.log(`Ignoring: ${src}`.blue)
    return cb()
  }

  theme({
    args: [
      action, 
      '--env', process.env.ENV, 
      '--config', config.get('configPath'),
      src
github the-couch / slater-cli / lib / deploy.js View on Github external
const colors = require('colors')
const theme = require('@shopify/themekit').command
const compiler = require('./webpack.js')

module.exports = function deploy (program, config) {
  console.log('slater compiling javascript...'.grey)

  compiler.run((err, stats) => {
    if (err) {
      console.log(err)
      return
    }

    console.log('successfully compiled javascript...'.green)

    theme({
      args: [
        'replace', '--env', program.env || 'development'
github Shopify / slate / packages / slate-sync / index.js View on Github external
const chalk = require('chalk');
const figures = require('figures');
const https = require('https');
const themekit = require('@shopify/themekit').command;
const slateEnv = require('@shopify/slate-env');
const SlateConfig = require('@shopify/slate-config');

const config = new SlateConfig(require('./slate-sync.schema'));

let deploying = false;
let filesToDeploy = [];

function maybeDeploy() {
  if (deploying) {
    return Promise.reject(new Error('Deploy already in progress.'));
  }

  if (filesToDeploy.length) {
    const files = [...filesToDeploy];
    filesToDeploy = [];
github Shopify / slate / packages / slate-tools / src / tasks / deploy-utils.js View on Github external
return new Promise((resolve, reject) => {
    debug(`themekit cwd to: ${config.dist.root}`);

    themekit.command({
      args: ['replace', '--env', env],
      cwd: config.dist.root,
    }, (err) => {
      if (err) {
        reject(err);
      } else {
        resolve();
      }
    });
  }).catch((err) => {
    messages.logTransferFailed(err);
github Shopify / slate / packages / slate-tools / src / tasks / watchers.js View on Github external
return new Promise((resolve, reject) => {
    debug(`themekit cwd to: ${config.dist.root}`);

    themekit.command({
      args: [cmd, '--env', env].concat(files),
      cwd: config.dist.root,
    }, (err) => {
      if (err) {
        reject(err);
      } else {
        resolve();
      }
    });
  }).then(() => {
    activeDeploy = false;

@shopify/themekit

Node wrapper around Theme Kit

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis

Popular @shopify/themekit functions