Skip to content

Updates chalk to 1.0.0. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 56 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,73 @@
# generator-madlib-apicore
[![Build Status](https://travis-ci.org/Qwerios/generator-madlib-apicore.svg?branch=master)](https://travis-ci.org/Qwerios/generator-madlib-apicore) [![NPM version](https://badge.fury.io/js/generator-madlib-apicore.png)](http://badge.fury.io/js/generator-madlib-apicore)
# generator-iqlib-apicore
[![NPM version](https://badge.fury.io/js/generator-iqlib-apicore.png)](http://badge.fury.io/js/generator-iqlib-apicore)

[![Npm Downloads](https://nodei.co/npm/generator-madlib-apicore.png?downloads=true&stars=true)](https://nodei.co/npm/generator-madlib-apicore.png?downloads=true&stars=true)
[![Npm Downloads](https://nodei.co/npm/generator-iqlib-apicore.png?downloads=true&stars=true)](https://nodei.co/npm/generator-iqlib-apicore.png?downloads=true&stars=true)

A [Yeoman](http://yeoman.io) based generator for madlib based webapps.


## Getting Started
First make sure yo and and the generator are installed:
```bash
$ npm install -g yo generator-madlib-apicore
$ npm install -g yo generator-iqlib-apicore
```

You may need to have sudo permissions to install globally.
After that you can create a new madlib module by creating a folder and then using the following command:
```bash
$ mkdir madlib-my-webapp
$ cd madlib-my-webapp
$ yo madlib-apicore
$ yo iqlib-apicore
```

Yeoman will appear and ask you a few questions. Once they have been answered he will generate the required files to get started.

## Using the api
When you want to use the api you need to supply it with a madlib-settings which contains the following settings:

* You can leave out the hostMapping if you want, then you will need to supply the setting:

overrideMapping: "environment" ( hostConfig option, for example testing )

```bash
settings.init( "hostMapping",
"www.myhost.nl": "production"

# Testing
#
"test.myhost.nl": "testing"

# Development
#
"localhost": "testing"

# For local development purposes
# Set this up in your /etc/hosts or equivalent to point to localhost
#
"localhost.myhost.nl": "production"
)

settings.init( "hostConfig",
"production":
"api": "https://api.myhost.nl"

"testing":
"api": "http://test-api.myhost.nl:8080"
)

# Setup XHR host settings
#
settings.init( "xdmConfig",
"api.myhost.nl":
cors: false
xdmVersion: 3
xdmProvider: "https://api.myhost.nl/xdm/v3/index.html"

"test-api.myhost.nl":
cors: false
xdmVersion: 3
xdmProvider: "https://test-api.myhost.nl/xdm/v3/index.html"
)
```


### What is Yeoman?

Expand All @@ -41,16 +87,16 @@ $ npm install -g yo

Yeoman travels light. He didn't pack any generators when he moved in. You can think of a generator like a plug-in. You get to choose what type of application you wish to create, such as a Backbone application or even a Chrome extension.

To install generator-madlib-apicore from npm, run:
To install generator-iqlib-apicore from npm, run:

```
$ npm install -g generator-madlib-apicore
$ npm install -g generator-iqlib-apicore
```

Finally, initiate the generator:

```
$ yo madlib-apicore
$ yo iqlib-apicore
```

### Getting To Know Yeoman
Expand Down
13 changes: 6 additions & 7 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var fullPath = process.cwd();
var packageName = fullPath.split( path.sep ).pop()

var MadlibApicoreGenerator = module.exports = function MadlibApicoreGenerator( args, options, config )
var IqLibApicoreGenerator = module.exports = function IqLibApicoreGenerator( args, options, config )
{
yeoman.generators.Base.apply( this, arguments );

Expand All @@ -27,9 +27,9 @@
this.currentYear = new Date().getFullYear()
};

util.inherits( MadlibApicoreGenerator, yeoman.generators.Base );
util.inherits( IqLibApicoreGenerator, yeoman.generators.Base );

MadlibApicoreGenerator.prototype.askFor = function askFor( )
IqLibApicoreGenerator.prototype.askFor = function askFor( )
{
var callback = this.async();

Expand Down Expand Up @@ -78,7 +78,7 @@
}.bind( this ) );
};

MadlibApicoreGenerator.prototype.app = function app( )
IqLibApicoreGenerator.prototype.app = function app( )
{
// Create base folders
//
Expand All @@ -92,14 +92,13 @@

this.copy( 'GruntFile.coffee', 'GruntFile.coffee' );
this.copy( 'src/index.coffee', 'src/' + this._.slugify( this.mainName ) + '.coffee' );
this.copy( 'src/api-settings.coffee', 'src/api-settings.coffee' );
this.copy( 'src/api/base.coffee', 'src/api/base.coffee' );
};

MadlibApicoreGenerator.prototype.projectfiles = function projectfiles( )
IqLibApicoreGenerator.prototype.projectfiles = function projectfiles( )
{
this.copy( 'editorconfig', '.editorconfig' );
this.copy( 'jshintrc', '.jshintrc' );
this.copy( 'gitignore', '.gitignore' );
};
} )();
} )();
17 changes: 13 additions & 4 deletions app/templates/GruntFile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ module.exports = (grunt) ->
files: [ "src/**/*.coffee" ]
tasks: [ "coffee" ]

coffeelint:
options:
configFile: 'coffeelint.json'

default:
files:
src: [ "src/**/*.coffee" ]

mochaTest:
test:
options:
Expand All @@ -34,13 +42,14 @@ module.exports = (grunt) ->

# These plugins provide the necessary tasks
#
grunt.loadNpmTasks "grunt-coffeelint"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-compress"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-mocha-test"
grunt.loadNpmTasks "grunt-contrib-compress"
grunt.loadNpmTasks "grunt-contrib-clean"

# Default tasks
#
grunt.registerTask "default", [ "clean", "coffee" ]
grunt.registerTask "test", [ "clean", "coffee", "mochaTest" ]
grunt.registerTask "default", [ "clean", "coffeelint", "coffee" ]
grunt.registerTask "test", [ "clean", "coffeelint", "coffee", "mochaTest" ]
39 changes: 20 additions & 19 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@
"author": {
"email": "<%= authorEmail %>",
"name": "<%= authorName %>",
"url": "https://github.com/Qwerios"
},
"contributors": [],
"browser": {
"madlib-xhr": "madlib-xhr-xdm"
},
"devDependencies": {
"grunt-contrib-watch": "~0.3.1",
"grunt-contrib-coffee": "~0.6.0",
"grunt": "~0.4.1",
"grunt-mocha-test": "~0.8.2",
"coffee-script": "~1.6.3",
"chai": "~1.8.1",
"grunt-contrib-compress": "~0.6.0",
"grunt-contrib-clean": "~0.5.0"
"chai": "~1.9.1",
"coffee-script": "~1.7.1",
"grunt": "~0.4.5",
"grunt-coffeelint": "0.0.13",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-coffee": "~0.10.1",
"grunt-contrib-compress": "~0.10.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-mocha-test": "~0.11.0"
},
"dependencies": {
"madlib-console": "~0.1.2",
"madlib-hostmapping": "~0.1.6",
"madlib-object-utils": "^0.1.2",
"madlib-settings": "~0.1.5",
"madlib-xhr": "^0.1.9",
"madlib-xhr-xdm": "^0.1.12",
"moment": "^2.6.0",
"q": "~1.0.0",
"http-custom-errors": "^8.0.0",
"madlib-console": "~0.1.4",
"madlib-hostmapping": "~0.1.7",
"madlib-object-utils": "^0.1.6",
"madlib-settings": "~0.1.7",
"madlib-xhr": "^0.1.13",
"madlib-xhr-xdm": "^0.1.17",
"moment": "^2.8.1",
"q": "~1.0.1",
"underscore": "^1.6.0"
},
"description": "<%= packageDescription %>",
Expand All @@ -38,8 +39,8 @@
"main": "lib/<%= _.slugify(mainName) %>.js",
"name": "<%= _.slugify(packageName) %>",
"scripts": {
"test": "command -v grunt >/dev/null 2>&1 && grunt test || { echo >&2 'Grunt is not installed'; }",
"prepublish": "command -v grunt >/dev/null 2>&1 && grunt || { echo >&2 'Grunt is not installed'; }"
"test": "command -v grunt >/dev/null 2>&1 && grunt test || { echo >&2 'Grunt is not installed'; }",
"prepublish": "command -v grunt >/dev/null 2>&1 && grunt || { echo >&2 'Grunt is not installed'; }"
},
"version": "0.1.0"
}
103 changes: 103 additions & 0 deletions app/templates/coffeelint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"arrow_spacing": {
"level": "error"
},
"camel_case_classes": {
"level": "error"
},
"coffeescript_error": {
"level": "error"
},
"colon_assignment_spacing": {
"level": "ignore",
"spacing": {
"left": 0,
"right": 0
}
},
"cyclomatic_complexity": {
"value": 10,
"level": "ignore"
},
"duplicate_key": {
"level": "error"
},
"empty_constructor_needs_parens": {
"level": "error"
},
"indentation": {
"value": 4,
"level": "error"
},
"line_endings": {
"level": "error",
"value": "unix"
},
"max_line_length": {
"value": 160,
"level": "warn",
"limitComments": true
},
"missing_fat_arrows": {
"level": "warn"
},
"newlines_after_classes": {
"value": 3,
"level": "ignore"
},
"no_backticks": {
"level": "error"
},
"no_debugger": {
"level": "warn"
},
"no_empty_functions": {
"level": "error"
},
"no_empty_param_list": {
"level": "ignore"
},
"no_implicit_braces": {
"level": "ignore",
"strict": true
},
"no_implicit_parens": {
"strict": true,
"level": "error"
},
"no_interpolation_in_single_quotes": {
"level": "error"
},
"no_plusplus": {
"level": "ignore"
},
"no_stand_alone_at": {
"level": "ignore"
},
"no_tabs": {
"level": "error"
},
"no_throwing_strings": {
"level": "error"
},
"no_trailing_semicolons": {
"level": "error"
},
"no_trailing_whitespace": {
"level": "error",
"allowed_in_comments": false,
"allowed_in_empty_lines": false
},
"no_unnecessary_double_quotes": {
"level": "ignore"
},
"no_unnecessary_fat_arrows": {
"level": "warn"
},
"non_empty_constructor_needs_parens": {
"level": "error"
},
"space_operators": {
"level": "error"
}
}
15 changes: 13 additions & 2 deletions app/templates/gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
*~
*.log
.*.swp
._*

.DS_Store
.sass-cache
.svn
node_modules
dist
npm-debug.log
bower_components

/build
/dist
/lib
Loading