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-ionic1-basic

v1.0.0

Published

A Yeoman generator for basic Ionic 1.x projects

Downloads

6

Readme

A Yeoman generator for a basic Ionic 1.x Project

This is a yeoman generator for a basic Ionic 1.x Project. It is a basic Ionic app template that sets up everything to get you started with Ionic with ease. This generator is currently using Ionic 1.2.4 and Angular 1.4.3.

This is an alternative project structure for the Ionic Framework demonstrated with the ionic tabs starter.

Features

  • Gulp jobs for development, building, emulating and running your app
  • Compiles and concatenates your Sass
  • Local development server with live reload, even inside ios emulator
  • Automatically inject all your JS sources into index.html
  • Auto min-safe all Angular DI through ng-annotate, no need to use weird bracket notation
  • Easily customize Ionic styles from within your Sass
  • Comes already with ng-cordova and lodash included

Prerequisite

You should have Yeoman installed globally

npm install -g yo

How Use This Repo

Clone this repo

$ git clone https://github.com/flavordaaave/ionic_better_structure.git

How To Install Using Yeoman

To install generator-ionic1-basic from npm, run:

npm install -g generator-ionic1-basic

Create a new project folder (e.g. 'myApp') for your app and clone this repository into it.

$ cd mkdir myApp

Finally, initiate the generator:

yo ionic1-basic

just before creating a build, just run:

ionic state restore

to restore the Cordova plugins.

How this project is structured

All working files are underneath the 'src' folder trying to follow the angular styleguide created by johnpapa.

/src
    /app
    /images
    /lib
    /styles
    index.html

Everything is set up to serve from this src folder using

$ ionic serve

Build process

This project comes with a before_build hook to run the 'gulp build' task before actually building the app with cordova. The 'gulp build' task concatenates, minifies and copies the files into the 'www' folder from where cordova is loading the files. So you can just use the standard ionic build commands:

$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios

Included gulp tasks

A bunch of useful gulp tasks have been copied from the HotTowel yeoman generator created by johnpapa and modified to work with ionic.

Task Listing

  • gulp help

    Displays all of the available gulp tasks.

Code Analysis

  • gulp vet

    Performs static code analysis on all javascript files. Runs jshint and jscs.

  • gulp vet --verbose

    Displays all files affected and extended information about the code analysis.

Testing

  • gulp test

    Runs all unit tests using karma runner & jasmine with phantomjs. Depends on vet task, for code analysis.

Cleaning Up

  • gulp clean

    Remove all files from the build and temp folders

  • gulp clean-images

    Remove all images from the build folder

  • gulp clean-code

    Remove all javascript and html from the build folder

  • gulp clean-fonts

    Remove all fonts from the build folder

  • gulp clean-styles

    Remove all styles from the temp and build folders

Fonts and Images

  • gulp fonts

    Copy the ionic fonts from source to the build folder

  • gulp images

    Copy all images from source to the build folder

Styles

  • gulp styles

    Compile less files to CSS and copy to the build folder

Lib Files

  • gulp wiredep

    Looks up all bower components' main files and JavaScript source code, then adds them to the index.html. The .bowerrc file also runs this as a postinstall task whenever bower install is run.

    NOTE: wiredep will only grab the bower dependencies that are listed in you bower.json file. Use the --save flag when installing dependencies via bower to add them to automatically add them to you bower.json file.

Angular HTML Templates

  • gulp templatecache

    Create an Angular module that adds all HTML templates to Angular's $templateCache. This pre-fetches all HTML templates saving XHR calls for the HTML.

  • gulp templatecache --verbose

    Displays all files affected by the task.

Serving Development Code

  • ionic serve

    You can us the standard ionic serve task here.

Building Production Code

  • gulp optimize

    Optimize all javascript and styles, move to a build folder, and inject them into the new index.html

  • gulp build

    Copies the ionic fonts, copies images and runs gulp optimize to build the production code to the build folder.

NOTE: This project contains a before_build hook for cordova which so that the gulp build task is run automatically when building with cordova build [platfrom] or ionic build [platfrom]

License

MIT