GithubHelp home page GithubHelp logo

nigelvon / f2e-workflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tencent/tmt-workflow

0.0 2.0 0.0 234 KB

A f2e project workflow based on Yeoman, Grunt and Bower.

Home Page: f2e-workflow.com

License: MIT License

f2e-workflow's Introduction

f2e-workflow GitHub version devDependency Status

f2e-workflow is a cross-platform, efficient, smooth workflow for F2E project based on Grunt.

Chinese(zh_CN) README.md available.

###Table of contents

Quick Start

4 quick start options are available:

Read the Getting Started page and wiki list for more.

What's included

Within the download you'll find the following directories and files, you'll see something like this:

f2e-workflow/
│
├── package.json                // Project dependance
├── Gruntfile.js                // Grunt task config
├── .ftppass                    // FTP passwork(optional): grunt-ftp-deploy
│
├── node_modules                  // `npm install` generate package
│
├── html/                         // HTML files
│   └── index.html
├── css/                        // CSS source files(e.g., `Less`/`Sass`)
│   ├── lib-reset.less
│   ├── lib-mixins.less
│   └── style.less
├── img/                        // Images source [non-sprite] e.g, logo
│   ├── logo.png
│   └── background.png
├── slice/                      // Slice images source [Tobe-Sprite] e.g, Icons
│   ├── icon-github.png
│   ├── [email protected]      // Include 1x & 2x images
│   ├── icon-twitter.png
│   └── [email protected]
└── publish/                    // The target folder, The final F2E output
    ├── css/                    // The final CSS
    │   └── style.css
    ├── img/                    // just copy from `../img/`
    │   ├── logo.png
    │   └── background.png
    └── sprite/                 // Sprited automatically
        └── demo.png

After run f2e-workflow, you'll get ../publish which is the final output.

System Environment

Mac OS

  1. Recommended: install Node.js with Brew If not installed

  2. Install those two requirements via

     // install GraphicsMagick library
     // `Xcode Command Line Tools` may be needed, please agree.
     brew install GraphicsMagick
     
     // install Phantomjs library
     brew install phantomjs
     
     // re-install node_modules, e.g. `gm`
     npm install
    
  3. Run gm version & phantomjs --version to test if your environment is OK.

Windows

  1. Install Node.js If not installed
  2. Download, then Install GraphicsMagick & Phantomjs
  3. At last Set system variable

Both

  1. After install GraphicsMagick and Phantomjs successfully, run npm install to pull the dependance package.

Documentation

A full f2e-workflow include those Tasks below:

  • Compile Less/Sass to CSS
  • CSS Lint
  • CSS compression
  • Auto merge sprite images
  • Auto fit @2x retina images
  • Add timestamp after CSS files
  • Watch files changes
  • FTP deploy
  • ZIP package

Task Details

1. Default workflow grunt

grunt.registerTask('default', ['less:dev', 'copy:dev', 'clean:dev', 'watch']);
Output folder: ../publish/(css/ + img/ + slice/) 

Note: Only do Less/Sass -> CSS

2. Full workflow grunt all

Output folder: ../publish/(css/ + img/ + sprite/)
Note: Include Less/Sass Compile+Compression+Sprite+PNGmin, without file watch

3. Debug workflow grunt debug

Output folder: ../publish/(css/ + img/ + sprite/)
Note: Same as grunt all, but will not delete tmp/ folder, this is only for debug use(with file watch task inside)

4. FTP deploy workflow grunt push

Note: grunt push will push all the output to FTP server

5. ZIP package grunt zip

Note: grunt zip will package all the output files into .zip file

Rename init grunt sprite-cssmin

Note: copy files from slice/ to -> sprite -> CSS compression

Rename init grunt 2x2x

Note: @2x image to @1x image

Demo

Command line demo is below,
Also a GUI tools is ready, check Mobile-Team / spock

Demo

Know Issues

  • Images diff under Mac OS & Win is known from this [#issues]
  • No sprite task when you are doing a debug workflow, just run grunt debug if needed.

License

Released under MIT LICENSE

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.