npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-app-automation

v0.2.4

Published

Gulp automation suite for an angular app.

Downloads

22

Readme

Dependency Status

Gulp automation suite for an angular app.

It also works for an app without angular.

This package does certainly not cover all your needs.
Feel free to fork it and create pull request with your improvements.

Features

  • Compiles JavaScript modules into a single file (browserify) with source maps
  • Compiles Jade templates as javascript module if needed
  • Compiles CoffeeScript files as javascript module if needed
  • Uses ng-annotate before minification (UglifyJS2)
  • Compiles LESS into a single CSS file with source maps
  • Uses csso to minify CSS and postprocesses it with autoprefixer
  • Lint JS (jshint) and CSS (recess)
  • Runs unit tests using karma with jasmine
  • Generates coverage report with istanbul and complexity/maintainability reports (history) with plato
  • Provides a development server (express) with livereload capability
  • Fingerprints assets through lo-dash templates
  • Indicates size of distribution files
  • Provides a way to separate external libs from application (useful for huge project)

Installation

npm install --save-dev angular-app-automation

You need to have gulp:

npm install -g gulp

Usage

Take a look at angular-app-seed to see how to use this package.

// gulpfile.js

var gulp = require('gulp')
  , automation = require('angular-app-automation');

automation(gulp, /* options here */);

// no option
automation(gulp);

// inline options
automation(gulp, {jsSrc: './src/js/**/*.js', jsApp: './src/main.js'});

Fingerprinting

Simple technique (recommended by Google) to force browsers to download latest versions of assets.
Based on lo-dash templates and use the options version or create a random hash if version is not provided:

// index.html

// before
<link rel="stylesheet" type="text/css" href="/dist/app.css?<%= version %>">

// after
<link rel="stylesheet" type="text/css" href="/dist/app.css?49af3efc9ba0d83100858b883ce3001361a3244e">

Externals

Provides a list of externals will build a browserify bundle with externals and an other one for the application.

To declare an external:

//in gulpfile.js
externalsList: [
  {require: 'path/to/lib', expose: 'whatever you want to require this lib in your app'}
, {require: 'npm package', expose: '...'}
]

Configuration

Here are the available options:

option|purpose ---|--- name|name of the application, defaults to app port|port used by express, defaults to 5000 version|version used for fingerprinting lrport|livereload port, defaults to 5001 jsSrc|JavaScript source files, defaults to ./src/**/*.js jsApp|JavaScript entry point for browserify, defaults to ./src/app.js jsLint|JavaScript lint config object, defaults in jshint.default.cfg file jsUseLint|enable/disable jshint, default true jsJade|Indicates if browserify should use a Jade transformation, default false jsCoffee|Indicates if browserify should use a Coffee transformation, default false cssSrc|LESS & CSS source files, defaults to ./src/**/*.less{,.css} cssApp|LESS entry point for LESS compiler, defaults to ./src/app.less cssLint|CSS lint config object, defaults in recess.default.cfg file cssUseLint|enable/disable recess, default true externalsApp|JavaScript entry point for browserify, defaults to ./src/externals.js externalsList|List of external libs, default [], expect [{require: '', expose: ''}] htmlSrc|HTML source files, default to ./src/**/*.html testSrc|JavaScript unit test source files, defaults to ./src/**/*.unit.js testApp|JavaScript unit test entry point for browserify, defaults to ./src/app.unit.js buildDir|Directory of development builds, defaults to ./build distDir|Directory of distribution builds, defaults to ./dist karma|Karma config object, defaults in karma.default.cfg

Convention

The default configuration is motivated by a modular organization of the application:

  • src
    • app.js
    • app.less
    • index.html
    • module1
      • controller1.js
      • controller2.js
      • service1.js
      • view1.html
      • view2.html
      • style1.less
    • module2
      • ...

Take a look at this article for more details.

Task reference

tasks|purpose ---|--- dev|Builds application (browserify, less, lint) and watch source files dev:sm|dev task with sourcemap (sourcemaps double size of build files) dev:lr|dev task and serve it (express, livereload), sourcemap included dev:unit|Starts the dev environment with unit testing support (karma and jasmine) dist:build|Builds distribution (minification) dist:serve|Builds distribution and serve it for checking purpose complexity:report|Generates complexity/maintenability report (plato) complexity:serve|Serves plato report coverage:report|Generates coverage report (istanbul) coverage:serve|Serves coverage report ci|Continuous integration task used for travis & coveralls

Todo

  • Add images optimization

License

The MIT License (MIT)

Copyright (c) 2014 Nicolas Briemant

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.