GithubHelp home page GithubHelp logo

tomcornall / grunt-lemonsync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from af19/grunt-lemonsync

0.0 2.0 0.0 30 KB

A grunt plugin for working on LemonStand themes locally and pushing changes to stores.

License: MIT License

JavaScript 100.00%

grunt-lemonsync's Introduction

grunt-lemonsync

A grunt plugin for working on LemonStand themes locally and pushing changes to stores.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-lemonsync --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-lemonsync');

The "lemonsync" task

Overview

In your project's Gruntfile, add a section named lemonsync to the data object passed into grunt.initConfig().

grunt.initConfig({
  lemonsync: {
    options: {
      // Options specific to your LemonStand store go here.
    },
    src: {
      // Local theme files go here.
    },
  },
});

Options

options.access_token (required)

Type: String

The LemonStand API Token. You can load it via JSON as shown in the example (remember, the token is a private credentia, and should not checked in to your Git repository).

options.store_host (required)

Type: String

The domain name of your LemonStand store. E.G. my-store.lemonstand.com.

options.theme_api_code (required)

Type: String

A unique code to identify your theme in LemonStand's backend. The code can contain only Latin symbols, digits and the hyphen symbol.

options.theme_repository (required)

Type: String

The git repository to clone the theme from. A /theme directory will be added to to your project.

options.clean (optional)

Type: String

Values:

  • local - replaces local theme files with store theme files
  • remote - deletes theme files from store that do not exist locally

You can use a flag to indicate whether you'd like to traget the local or remote theme. E.G. grunt --clean=local

Basic Usage Examples

In this example, the LemonStand Access Token is loaded via a JSON file.

{
  "lsAccessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "lsStore": "my-store.lemonstand.com"
}
var target = grunt.option('clean') || false;

grunt.initConfig({

  lsConfig: grunt.file.readJSON('lemonstand-config.json'),

  lemonsync: {
      options: {
        access_token: '<%= lsConfig.lsAccessToken %>',
        store_host: '<%= lsConfig.lsStore %>',
        theme_api_code: 'my-first-custom-theme',
        theme_repository: 'https://github.com/lemonstand/ls2-theme-zest',
        clean: target
      },
      src: [
        'theme/content/**', 
        'theme/pages/**', 
        'theme/partials/**', 
        'theme/resources/**', 
        'theme/templates/**', 
        'theme/theme.yaml'
      ]
    }
});

Release History

  • 2016-11-14   v1.3.3   Bug fixes
  • 2016-11-14   v1.3.2   Doc updates
  • 2016-11-14   v1.3.1   Doc updates
  • 2016-11-14   v1.3.0   Download modified files from LS store
  • 2016-10-11   v1.2.1   Bug fixes
  • 2016-10-10   v1.2.0   Performance improvements
  • 2016-10-10   v1.1.0   Clone themes from git repository
  • 2016-09-06   v1.0.0   Download and install themes from git repository
  • 2016-09-04   v0.1.2   Added MIME type detection
  • 2016-09-04   v0.1.1   Updated package.json
  • 2016-09-04   v0.1.0   First release

grunt-lemonsync's People

Contributors

af19 avatar robotpony avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.