Giter Site home page Giter Site logo

febp's Introduction

Frontend boilerplate ๐Ÿ’ฉ

NPM version Build Status

Test Coverage Code Climate Code Climate Issues

BitHound Dependency Status devDependency Status

Semantic Release

Javascripts

  • babel (preset-es2015)
  • eslint (babel-parser)
  • typescript
  • tslint
  • ng-annotate

Usage example:

import {helper} from './utils';

Styles

  • stylus
  • stylint

Usage example:

import './reset.styl;

Templates

  • jade-html-loader
  • ng-cache-loader

Importing in JS:

import template from './tpl.pug';
angular.component('foo', {template});

Importing in DOM:

import './dir1/dir2/dir3/dir4/tpl.pug';
div(ng-include="'tpl/dir3/dir4/tpl.pug'")

Static pages

  • pug-loader

Add new plugin to webpack config:

new HtmlPlugin({
  filename: '404.html',
  template: 'pages/error.pug'
})

Assets

  • url-loader
  • file-loader

Usage in JS:

import img from 'assets/logo.png';

Usage in styles:

.header-logo
  background: url('~/assets/logo.png')

Usage in templates:

img(src="assets/logo.png")

Usage in static pages:

img(src=require("assets/logo.png"))

Unit tests

  • karma
  • jasmine
test/unit/index.js
test/unit/**/*.js
src/**/*.spec.js

E2E tests

  • protractor
  • jasmine
test/e2e/index.js
test/e2e/**/*.js
src/**/*.e2e.js

Coverage

  • istanbul

Add your own settings to coverage:check script in package.json

istanbul check-coverage --statements 100 --branches 75 --functions 75 --lines 75

Reports

  • localhost:9000/report/unit
  • localhost:9000/report/coverage

Servers

Simple express SPA server

npm run serve

Livereload proxy-server (browser-sync)

npm run serve:dev

API mocks server (json-server)

npm run serve:mocks

Selenium server for protractor

npm run serve:webdriver

Development workflow

Incremental build + unit tests

npm run build:dev
npm run test:unit:dev

E2E tests

npm run test:e2e

Production workflow

npm run validate
npm run build 
npm run test

Environment

Create local version of .env file

mv .env.example .env 

For provide some env variables to client build via EnvironmentPlugin,

add variables names to config/build.js

CLIENT_ENV_VARS: ['API_ENDPOINT', 'API_TOKEN']

and values to .env file:

API_ENDPOINT=https://api.site.com
API_TOKEN=secret

TODO

  • e2e watch mode
  • e2e in travis
  • e2e in Sauce Labs
  • source-maps for units
  • documentation

Webpack 2

febp's People

Contributors

iboozyvoozy avatar greenkeeperio-bot 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.