Git Product home page Git Product logo

starterkit's Introduction

StarterKit aka UpGulp

StarterKit is our gulp module. It contains all of the configuration, setup, and tasks for processing.

Features

It's modular. Shocking, I know. But navigating one big-butt gulpfile.js is a pain in the backside.

Instead, we split our gulp tasks out in the app/gulp/tasks folder. The main file gulpfile.js then loads up all of the configuration (which is stored in config/gulp/config.js), plugins, and requirements. Then it calls each of the tasks. Think of it as your Controller or better yet, Task Manager.

It includes:

  • Scripts
    • Concatenates all the scripts found in app/js/*.js
    • Renames the combined file with a .min suffix
    • Minifies that file
    • And then stores it into the configured distribution folder, default is dist/
    • You can name the file whatever you want via the Configuration file
  • Styles
    • Uses gulp-sourcemaps - for debug ease
    • Process with gulp-sass
    • Runs postcss
    • Includes sass-rem
    • Autoprefix to ensure we get the cross-browser prefixes
    • Includes linting using gulp-sass-lint
    • Copy and rename the full stylesheet with a .min suffix
    • It minifies to optimize the stylesheet
    • If this is a theme, then it moves both the .css and .min.css files to the root of the theme folder.
  • Translations
    • i18n translations are included (NEEDS TESTING)
  • Sprites and icons optimizations
  • Imagine optimizations

Sass Features

This gulp starter has Sass REM baked into it. To use these in your style.scss file and project, do the following:

@import '../../node_modules/sass-rem/rem';

Using the sass-rem module lets us import the functionality we want. To convert pixels into rems, add the following into your Sass declaration:

@include rem( font-size, 18px );

You can learn more about the syntax in the documentation;

Installation:

  1. Open up terminal and navigate to the theme, plugin, or proper folder.
  2. Then type: git clone https://github.com/KnowTheCode/UpGulp.git. The repository is loaded into a new subfolder called UpGulp.
  3. Now it's time to move the contents of UpGulp folder into the root of your plugin or theme.
    • Move gulpfile.js, package.json, config/gulp, and app/gulp
    • Move these resources into the root of your theme or plugin
  4. Type npm install. It will automatically install all of the modules specified in the package.json file.
  5. Change the configuration parameters in the variable moduleSettings as found in config/gulp/config.js. You will want to change:
    • moduleSettings.package -> change to the package's name
    • moduleSettings.domain -> change to the domain name
    • moduleSettings.isTheme -> If this is a theme, then set it to true.
    • moduleSettings.i18n -> Define the i18n parameters

Run it

To run it, open terminal and type gulp watch. There are various watchers available including:

  • gulp scripts
  • gulp styles
  • gulp sass-lint
  • gulp sass-doc
  • gulp sprites
  • gulp i18n
  • gulp icons
  • gulp imagemin
  • gulp watch

Credit

This gulp setup is inspired by WebDev Studio's setup.

Contributions

All feedback, bug reports, and pull requests are welcome.

TODOs

There are things we need to improve and test in this starter module including:

  • Automate the installation process
  • Test sprites and translations

starterkit's People

Contributors

dannygsmith avatar

Watchers

James Cloos 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.