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-mcfly-ng2

v1.1.6

Published

A yeoman generator for scaffolding an app using angular2 and webpack

Downloads

17

Readme

Join the chat

NPM version Downloads
Build Status Coverage percentage
Dependency Status Dependency Dev Status

NPM

generator-mcfly-ng2

A Yeoman generator for scaffolding an app using angular2 and webpack

Credits

This generator was inspired by this amazing repo: https://github.com/AngularClass/angular2-webpack-starter

Installation

First, install Yeoman and generator-mcfly-ng2 using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-mcfly-ng2

Then generate your new project:

yo mcfly-ng2 [project-name]

You then have access to the following sub generators:

  • yo mcfly-ng2:target (Creates a new target - you can think of it as another application)
  • yo mcfly-ng2:module (Creates a module)
  • yo mcfly-ng2:service (Creates a service)
  • yo mcfly-ng2:pipe (Creates a pipe)
  • yo mcfly-ng2:component (Creates a component)
  • yo mcfly-ng2:directive (Creates a directive)
  • yo mcfly-ng2:interface (Creates an interface)

NOTE:
When scaffolding a new target, the generator will ask you to choose between web, fuse, or ionic2.
web is a normal web project
fuse is a fusetools mobile app
ionic2 is an Ionic 2 mobile app (cordova)

You have access to the following npm scripts:

Clean & Build

  • npm run clean (clean the dist folder)
  • npm run build (build the code to the dist folder)
  • npm run browsersync (open a live browser on port 5000, recompiling the code on each change)
  • npm run webpack:server (same as browsersync but uses webpack-dev-server)

Test

  • npm run lint (run eslint and tslint)
  • npm run karma (run unit test)
  • npm run karma:watch (run unit test in watch mode)
  • npm run e2e (run e2e test - make sure that browsersync or webpack:server is running in another console window)
  • npm run e2e:live (run e2e test and stop to allow debug - make sure that browsersync or webpack:server is running in another console window)

Docs

  • npm run docs (run typedoc using the typedoc.json config file)

Note:
All fuse & ionic npm commands accept an optional OPTIONS=(...) variable to pass additional options to those clis. OPTIONS can either be a single plugin name or a space-separated bash/zsh list, i.e. enclosed in parens, (...), or in quotation marks "..."*

Fuse Commands

  • npm run fuse:clean (run uno clean to clean up generated resources in your fuse target)
  • npm run fuse:build[:platform] (build and run your ionic target on a device)
    • This command takes an optional platform (ios or android), if omitted the command will do both of the alternatives in this order.
  • npm run fuse:preview[:platform] (build and run your ionic target on a device)
    • This command takes an optional platform (ios or android), if omitted the command will do both of the alternatives in this order.

Ionic Commands

  • npm run ionic:platform[:operation][:platform] (remove or add platforms to your ionic target)
    • This command takes an optional operation (rm or add) and platform (ios or android), if either is omitted the command will do both of the alternatives in this order.
  • PLUGIN=(ionic-plugin1[ ionic-plugin2]) npm run ionic:plugin[:operation] (remove or add plugins to your ionic target)
    • This command takes an optional operation (rm or add), if it is omitted the command will attempt to remove and then add the plugin.
    • This command is often run without the operation parameter.
    • PLUGIN can either be a single plugin name or a space-separated bash/zsh list, i.e. enclosed in parens, (...), or in quotation marks "..."
  • npm run ionic:run[:platform] (build and run your ionic target on a device)
    • This command takes an optional platform (ios or android), if omitted the command will do both of the alternatives in this order.
  • npm run ionic:serve (run an ionic2 app in the browser)
  • npm run ionic:serve:lab (run an ionic2 app in the browser in lab mode)
  • npm run ionic:emulate (run an ionic2 app in the emulator)

Note:
Normally, the webpack ChangeMode plugin (plugins/ChangeModePlugin.js) should make sure that the ionic hooks in the dist folder are executable. If however you get errors like these:Running command: <path_to_hook_dir> <path_to_hook.js> <path_to_ionic_target_dist> Error: spawn EACCES use npm run ionic:hooks:chmodx to fix the hooks.

Distribution

Note that the code is distributed to the dist folder
You can pass a different TARGET or MODE using the following command:

[TARGET=newtarget MODE=dev] npm run build

Default TARGET is app, possible values will depends if you have scaffolded other targets
Default MODE is dev, can be either prod or dev

The same apply to the webpack:server task or browsersync task
npm run webpack:server: compile and open a the webpack reload browser
You can pass a different TARGET or MODE using the following command:

[TARGET=newtarget MODE=dev] npm run webpack:server

Launching

npm run webpack:server
# or
npm run browsersync

Visit your browser at http://localhost:5000

Testing

npm run test # lint + unit tests
npm run mocha # to run without linting first
npm run mocha.watch # to run in watch mode

License

MIT