@slaty/sync

store theme deployment utility

Usage no npm install needed!

<script type="module">
  import slatySync from 'https://cdn.skypack.dev/@slaty/sync';
</script>

README

@slaty/sync

Sync files between your local machine and a remote Store theme.

Install

npm i @slaty/sync -g

Getting Started

Create a slaty.config.js file, and define one or more themes:

module.exports = {
  themes: {
    development: {
      id: '12345...',
      password: 'abcde...',
      store: 'store-name.mystore.com',
      ignore: []
    },
    production: { ... }
  }
}

Then, use the CLI to sync or unsync files or directories:

slaty-sync sync snippets/header.liquid # file
slaty-sync sync snippets/ # directory
slaty-sync unsync snippets/header.liquid

Commands

sync

Sync a file or directory.

slaty-sync sync snippets/header.liquid # file
slaty-sync sync snippets/ # directory

unsync

Un-sync a file or directory.

slaty-sync unsync snippets/header.liquid # file
slaty-sync unsync snippets/ # directory

API

@slaty/sync can also be used in node, as it is in @slaty/cli.

const sync = require('@slaty/sync')

const theme = sync({
  id: '12345...',
  password: 'abcde...',
  store: 'store-name.mystore.com',
  ignore: []
})

Methods

sync

// single file
theme.sync('./build/snippets/nav.liquid')

// multiple files
theme.sync([
  './build/snippets/nav.liquid',
  './build/templates/index.liquid'
])

// or a directory
theme.sync([
  './build/snippets/'
])

unsync

theme.unsync([ 'templates/index.liquid' ])

License

MIT License ©