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

generator-ng-gulp

v1.0.1

Published

generator for building an angular web app with gulp

Downloads

11

Readme

generator-ng-gulp

This generator aims to follow the best angular coding practices and make it easy to have a fully tested and deployable app.

Usage

Make sure you have yo and generator-ng-gulp installed

npm install -g generator-ng-gulp yo
yo ng-gulp <app-name>

You can replace <app-name> with your app's name, or it will use the name of the folder it is in when being run.

Options

These are limited right now, but plan to grow. These are the questions the generator asks

  • Use angular-material
  • Use a router (ngRoute/ui-router)
  • Use LESS
  • Commit bower_components
  • Use font-awesome

Gulpfile features

gulp serve

Serve the app in dev mode, with live css reloading injection as well as for all html/js. Uses the best live reload available with browser-sync.

gulp test

Run all unit tests

gulp test --debug

Run unit tests in debug mode so you can click the debug button in the browser that pops up.

gulp test --dev

Unit test dev mode where all spec and js files are watched and tests are re-run automatically. Also, your coverage is displayed with browser-sync and updated automatically as you work

gulp build

Build all js/css/html/images etc for production. Placed into dist/ folder.

gulp protractor

Run all e2e tests.

Sub Generators

There are a couple sub-generators to help with keeping your app structured

All components and sub-modules go in the app/modules folder. Inside this folder is a routes folder where all routes are kept.

You can generate sub-modules or routes with sub-generators

Module Generator

yo ng-gulp:module <module-path-with-name>

This generator will allow you to make the following angular components:

  • component
  • directive
  • value
  • constant
  • config
  • service
  • factory
  • filter
  • controller
  • decorator
  • run

You are presented with options as to which ones you want. If you decide later you want more, just re-run the sub-generator with the same <module-path-with-name> and choose the piece you want.

<module-path-with-name> looks something like this:

core/api/friends

This would make a friends module in the folder app/modules/core/api/friends

components/navbar

This would make a navbar module in the folder app/modules/components/navbar

table

This would make a table module in the folder app/modules/table

If these folder don't already exist, they are created. If you are making extra components in a folder already containing a *.module.js file, then it will only add the pieces needed. Each angular component asked for comes with associated test files, and these new scripts are attached to the index.html automatically.

Route Generator

Make sure you designate in the main generator that you want routing if you plan on using this generator

yo ng-gulp:route <route-name> <route-path-string>

<route-name> gives the route folder a name, as well as the state name if using ui-router.

<route-path-string> is the string to use for the path. (ie. /applications/:id, or /stuff/:stuffId/thing)

All routes get added to the app/modules/routes folder and automatically added to the index.html. If running gulp serve these routes should be immediately visitable.

A new e2e test is created for each route and placed in test/e2e.

Goals

  • [ ] Allow re-running generator to get updates
  • [ ] Allow for writing in es6 if desired (Look at generator-gulp-angular for how to handle. Will be tough with coverage)
  • [x] Should allow for creating components (even nested components)
  • [x] When making component, allow choosing (filter/service/controller) etc.
  • [x] Should generate test for each matching component piece
  • [ ] Should be fully tested

Think About

  • [ ] Improve gulp test --debug to not have to restart when files change
  • [ ] Check back in on protractor 2.0.0 to see if it will work with pages with no ng-app
  • [ ] When bower task occurs, write any main js files into karma.conf.js
  • [ ] Add new angular router option when available
  • [ ] Make provider component
  • [ ] Page reload after JS change occurs before files are completely written