GithubHelp home page GithubHelp logo

jjviscomi / es2015-project-template Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 60 KB

This is a skeleton of a default es2015 (es6) project. It includes most reasonable defaults.

License: MIT License

JavaScript 100.00%

es2015-project-template's Introduction

ES2015 & ES6 Package/Project Skeleton

Prerecs

  1. node & npm configured and installed
  2. npm install -g gulp
  3. phantomjs (brew install phantomjs, not required but recommended)
  4. ... ???

Setup

  1. fork repo
  2. cd into directory
  3. update package.json (name, version, description, main, author)
  4. npm install
  5. resolve any issues.

Run Gulp Default task

  1. gulp

Project Structure

/
|
|-- /libs  #Supporting External Libs, Not to be compiled with your project.
|
|-- /src   #Project source files, globbed /**/*.js.
|
|-- /docs  #Project YUIDocs generated documentation.
|
|-- /tests #Jasmine test files, globbed *.js.
|   |
|   |- /tests/helpers #Helpers required for your tests, globbed *.js.
|
|-- /dist  #Output of the compilation process.
|   |
|   |- /dist/development/ #Non-minified compiled results.
|   |
|   |- /dist/production/  #Minified compiled results to use in production.
|
|- /karma.conf.js
|
|- /gulpfile.babel.js
|
|- /package.json

Build Steps & Info

Linting

The first step in the build process is passing your source files 'src/**/*.js', 'tests/*.spec.js', 'tests/helpers/*.js' through ESLint. It only has a basic config located at /.eslintrc.

Style Guidline & Presets

The next step is the JavaScript Code & Style we are using the presets as defined by AirBnB while they are strict they have been adopted widley by the industry.

Testing With Karma & Jasmine

The next step applies the tests in 'tests/*.spec.js', it does this by using the Karma Server to spin up a PhantomJS environment and run your Jasmine tests. You should have well covered code, and all new code must have a test in order to be pulled in.

Transcompiling with Babel (ES2015 preset)

Gulp the prefered build system / task runner is already configured to transcompile down to js. It uses Babel please check it out if you are not familiar with it. This step also concats all the files specified in 'src/**/*.js' to /dist/development/{package.json.main}, so make sure you update main. A good info page for people coming from CoffeeScript is Here, I recommend it!

YUIDocs generation

The document generation is done automatically using the YUIDocs so make sure to check out their syntax. It is simple and generates a highquality documentation in /docs/index.html which you can pull up in any browser. YUIDocs Syntax Refrence.

Minification

Minification is done wtih Uglify to perform basic compression and removing of comments. The output is placed /dist/production/{package.json.main} except the extension is renamed to .min.js from .js.

es2015-project-template's People

Contributors

jjviscomi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

greplytix

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.