Code Monkey home page Code Monkey logo

polygulp's Introduction

polygulp

Indirect gulpfile for Polymer applications.

Getting Started

If you haven't used Gulp before, be sure to check out the Getting Started guide and how to use Gulp plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install polygulp --save-dev

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

module.exports = function(gulp) {

    // Init main modular gulpfile
    var gulp = require('gulp');

    require('polygulp')(gulp);

};

Usage

Tasks

gulp serve

Runs server for development.

gulp serve:dist

Runs server displaying optimized application for production.

gulp dist

Generates optimized application for production in dist folder.

You can use custom configuration using command line in gulp serve, gulp serve:dist, gulp dist and default tasks:

Custom environment

Provide environment variable by command line to use environment config.json if exits in main project.

gulp --environment=integration
Custom endpoints configuration

Provide endpoints variables by command line to use them instead those provided in config.json.

gulp --endpoint.urlBase=https://my-url-base/{{module}}/ --endpoint.version=v1 --endpoint.domain=my:domain

gulp release

Bumps bower & npm version, commits changed files and creates a new tag with the specified version.

NOTE: You must specific a branch name with --branch

task version
gulp release --patch --branch branchName v0.0.1 -> v0.0.2
gulp release --minor --branch branchName v0.0.1 -> v0.1.0
gulp release --major --branch branchName v0.0.1 -> v1.0.1
gulp release --version 1.1.1 --branch branchName v0.0.1 -> v1.1.1

Task targets, files and options may be specified according to the gulp Recipes guide.

Configuration

You can provide a default config file in app/resources/config/config.json and polygulp will set an object in app.common.config namespace.

app/resources/config/config.json:

{
    "debug": "true",
    "appName": "my-app-name",
    "version": "0.0.1",
    "analyticsID": ["UA-XXXXXXXX-YY"],
    "smartBanner": {
        "id": "com.my.app",
        "daysHidden": 15,
        "daysReminder": 90
        },
    "backend": {
        "urlBase": "https://my-url-base/{{module}}/",
        "version": "v8",
        "domain": "my:domain",
        "endpoints": {
            "login": "loginuser",
            "logout": "logoutuser",
            "feedback": "feedback"
        }
    },
    "webfs": {
        "name": "webfs",
        "version": "v1.0",
        "domain": "/books:Book/"
    },
    "routes": {
        "home": "/route_home",
        "movie": "/route_movie/:id"
    }
}

Provide environment config files to extend the default config file.

app/resources/config/{{my-environment}}/config.json:

{
    "analyticsID": ["UA-ZZZZZZZ-YY"],
    "smartBanner": {
        "id": "com.my.another.app"
        },
    "backend": {
        "urlBase": "https://my-environment-url-base/{{module}}/",
        "version": "v10",
        "domain": "my:another:domain"
    }
}

polygulp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

polygulp's Issues

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.