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

empirical-angular-gulp-tasks

v0.6.0

Published

Gulp tasks (and configuration) for Empirical Angular apps"

Downloads

28

Readme

Empirical Angular Gulp Tasks Build Status

The purpose of this repository is to have a central location for all of the gulp tasks and development dependencies in one place for Empirical Angular Apps.

##Tasks

The different gulp tasks are found in /tasks

##Installation Configuration

In your application you will need to add empirical-angular-gulp-tasks and gulp as dependencies.

#Save as a development dependency
npm install empirical-angular-gulp-tasks gulp -D

or

#Save as a production dependency
npm install empirical-angular-gulp-tasks gulp --save

Also install gulp as a global module.

npm install gulp -g

Once you have the module installed, add or edit a file named gulpconfig.js.

In that file, use the following as a guide:

var utilities = require('empirical-angular-gulp-tasks/utilities');

module.exports = {
  src: './src',
  assets: 'assets',
  assets_images: 'images',
  scripts: 'scripts',
  scripts_app: 'app',
  scripts_app_entry: 'app.module.js',
  scripts_app_vendors: 'vendors.js',
  scripts_config: utilities.config.getFile() || (utilities.env.getEnv() + '.config.json'),
  scripts_index: 'index.jade',
  scripts_app_output: 'app.js',
  scripts_app_output_partial: 'app*',
  scripts_vendors_output: 'vendors.js',
  scripts_vendors_output_partial: 'vendors*',
  styles: 'styles',
  styles_main: 'main.scss',
  styles_output: 'app',
  build: './build',
  dist: './dist',
  tmp: './.tmp',
  tmp_config_module: 'quill-grammar.config',
  tmp_config_output: 'config',
  tmp_templates_module: 'quill-grammar.templates',
  tmp_templates_output: 'templates.js',
};

Then add or edit gulpfile.js

'use strict';

var config = require('./gulpconfig');
var gulp = require('gulp');

require('empirical-angular-gulp-tasks').defineTasks(gulp, config);

##Commands

Setting up these gulp tasks will give you:

  • gulp or gulp --env=development which will run your app on PORT 3000 and watch for file changes.
  • gulp --env=production will create a production build with in the ./dist folder by default.

##Environments

Our gulp tasks module provides the idea of building the application in different environments.

We support two environments fully:

  • development
  • production

And staging partially

###Environment Specific Variables

We use gulp-ng-constant to inject environment specific variables into your application. Because we use browserify you can require the specific path the generated contants module from your application code.

Here is an example from Quill Grammar

In https://github.com/empirical-org/Quill-Grammar/tree/master/src/scripts/development.config.json we define a few variables:

{
  "environment": "development",
  "firebaseUrl": "https://quillgrammarstaging.firebaseio.com/",
  "empiricalBaseURL": "https://staging.quill.org/api/v1/",
  "portholeProxy": "https://staging.quill.org/porthole_proxy"
}

Then we require the generated module from our custom gulp process:

In quill-grammar/src/scrips/app/core/core.module.js:

angular
  .module('quill-grammar.core', [
    'ui.router',
    'LocalStorageModule',
    'autofocus',
    'duScroll',
    'angulartics',
    'angulartics.mixpanel',
    require('../../../../.tmp/config').name,
    require('../../../../.tmp/templates').name,
    require('../../directives/index.js').name,
  ])
  .config(function ($analyticsProvider) {
    $analyticsProvider.virtualPageviews(false);
  });