Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Russian committed Nov 24, 2015
0 parents commit 1b49e77
Show file tree
Hide file tree
Showing 46 changed files with 875 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true
}
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo: false
language: node_js
node_js:
- 'iojs'
- '0.12'
- '0.10'
3 changes: 3 additions & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"generator-generator": {}
}
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# generator-miojo

A super app generator. Ready in 3 minutes :D

## Getting Started

To install generator-miojo from npm, run:

```bash
npm install -g generator-miojo
```

To scaffold initial project structure:

```bash
yo miojo
```

To generate a component:

```bash
yo miojo:component <component_name>
```

To generate a shared module:

```bash
yo miojo:module <module_name>
```
100 changes: 100 additions & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var _ = require("underscore");
var mkdirp = require('mkdirp');

module.exports = yeoman.generators.Base.extend({
prompting: function () {
var done = this.async();

this.log(yosay(
'Welcome to the wonderful ' + chalk.yellow('Miojo') + ' generator!'
));

var prompts = [
{
name: 'app_name',
message: 'What the name of your app?',
default: 'app'
},
{
name: 'app_description',
message: 'Type the description of your app.',
default: 'An awesome app!'
},
{
name: 'app_site',
message: 'Your app have a site?',
default: 'example.com'
},
{
name: 'author_name',
message: 'What\'s your name?',
default: 'Gandalf'
},
{
name: 'author_email',
message: 'What\'s your email?',
default: '[email protected]'
},
{
name: 'package_name',
message: 'Set the app package name.',
default: 'com.example.app'
},
];

this.prompt(prompts, function (props) {
this.app_name = props.app_name;
this.app_description = props.app_description;
this.app_site = props.app_site;
this.author_name = props.author_name;
this.author_email = props.author_email;
this.package_name = props.package_name;
done();
}.bind(this));
},

writing: {
projectfiles: function () {
this.template('_package.json', 'package.json');
this.template('editorconfig', '.editorconfig');
this.template('jshintrc', '.jshintrc');
this.template('_bower.json', 'bower.json');
this.template('gulpfile.js', 'gulpfile.js');
this.template('_config.xml', 'config.xml');
this.template('.bowerrc', '.bowerrc');
this.template('_ionic.project', '.ionic.project');
this.template('.gitignore', '.gitignore');
},

app: function () {

mkdirp('source');
mkdirp('source/assets');
mkdirp('source/assets/fonts');
mkdirp('source/assets/images');
mkdirp('source/assets/styles');

this.fs.copy(
this.templatePath('./source'),
this.destinationPath('./source')
);

this.fs.copy(
this.templatePath('./gulp_tasks'),
this.destinationPath('./gulp_tasks')
);

this.template('_index.jade', './source/index.jade');

},

},

install: function () {
// this.installDependencies();
}
});
3 changes: 3 additions & 0 deletions generators/app/templates/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
8 changes: 8 additions & 0 deletions generators/app/templates/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

bower_components/
node_modules/
platforms/
plugins/
www/
8 changes: 8 additions & 0 deletions generators/app/templates/_bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "<%= app_name %>",
"version": "0.0.0",
"private": "true",
"dependencies": {
"ionic": "driftyco/ionic-bower#1.1.1"
}
}
20 changes: 20 additions & 0 deletions generators/app/templates/_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="<%= package_name %>" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name><%= app_name %></name>
<description>
An Ionic Framework and Cordova project.
</description>
<author email="<%= author_email %>" href="<%= app_site %>">
<%= author_name %>
</author>
<content src="index.html"/>
<access origin="*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
</widget>
28 changes: 28 additions & 0 deletions generators/app/templates/_index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
doctype html
html
head
meta(charset='utf-8')
meta(name='viewport', content='initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width')

title <%= app_name %>

link(rel="stylesheet" href="application.min.css")

// bower:css
// endbower
// inject:css
// endinject
body(ng-app='app')
ion-nav-view

script(src='cordova.js')

// bower:js
// endbower
// inject:js
// endinject
script(src='application.js')
4 changes: 4 additions & 0 deletions generators/app/templates/_ionic.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "<%= app_name %>",
"app_id": ""
}
40 changes: 40 additions & 0 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "<%= app_name %>",
"version": "0.0.0",
"description": "<%= app_description %>",
"devDependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"bower": "^1.3.3",
"browser-sync": "^2.9.12",
"gulp-flatten": "^0.2.0",
"gulp-jade": "^1.1.0",
"gulp-minify-css": "^0.3.13",
"gulp-ng-annotate": "^1.1.0",
"gulp-plumber": "^1.0.1",
"gulp-sass": "^2.1.0",
"gulp-scss": "^1.3.15",
"gulp-sync": "^0.1.4",
"gulp-util": "^2.2.14",
"gulp-watch": "^4.3.5",
"main-bower-files": "^2.9.0",
"minimist": "^1.2.0",
"require-dir": "^0.3.0",
"shelljs": "^0.3.0",
"wiredep": "^2.2.2"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
"ios"
]
}
12 changes: 12 additions & 0 deletions generators/app/templates/editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
16 changes: 16 additions & 0 deletions generators/app/templates/gulp_tasks/assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var gulp = require('gulp'),
reload = require('browser-sync').get('app').reload;

gulp.task('images', function() {
gulp.src(gulp.paths.images)
.pipe(gulp.dest(gulp.paths.dist))
.pipe(reload({stream:true}));
});

gulp.task('fonts', function() {
gulp.src(gulp.paths.fonts)
.pipe(gulp.dest(gulp.paths.dist))
.pipe(reload({stream:true}));
});

gulp.task('assets', ['images','fonts']);
10 changes: 10 additions & 0 deletions generators/app/templates/gulp_tasks/bowerfiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var gulp = require('gulp'),
concat = require('gulp-concat'),
bowerFiles = require('main-bower-files')
reload = require('browser-sync').get('app').reload;;

gulp.task('bower-files', function() {
gulp.src(bowerFiles(), {base: 'bower_components'})
.pipe(gulp.dest(gulp.paths.dist+'/libs'))
.pipe(reload({stream:true}));
});
21 changes: 21 additions & 0 deletions generators/app/templates/gulp_tasks/browsersync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var gulp = require('gulp'),
browserSync = require('browser-sync'),
watch = require('gulp-watch');

gulp.task('browsersync', function () {

browserSync.get('app').init({
server: {
baseDir: "./"+gulp.paths.dist
}
});

watch('source/index.jade', function () { return gulp.start('index'); });
watch('source/**/*.js', function () { return gulp.start('concat'); });
watch('source/**/*.jade', function (file) { return gulp.jadeTask(file.history); });
watch('source/**/*.scss', function () { return gulp.start('sass'); });
watch('bower_components/**', function () { return gulp.start('bower-files'); });
watch('source/assets/images/**/*', function () { return gulp.start('images'); });
watch('source/assets/fonts/**/*', function () { return gulp.start('fonts'); });

});
14 changes: 14 additions & 0 deletions generators/app/templates/gulp_tasks/concat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
concat = require('gulp-concat')
ngAnnotate = require('gulp-ng-annotate');
reload = require('browser-sync').get('app').reload;

gulp.task('concat', function() {
return gulp.src(gulp.paths.scripts)
.pipe(plumber())
.pipe(concat('application.js'))
.pipe(ngAnnotate())
.pipe(gulp.dest(gulp.paths.dist))
.pipe(reload({stream:true}));
});
Loading

0 comments on commit 1b49e77

Please sign in to comment.