Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
Closes #4. Created plugin now passes tests and JSHint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Feb 15, 2014
1 parent cd3751d commit e69171e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 35 deletions.
44 changes: 22 additions & 22 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@

module.exports = function (grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
release: {},
jshint: {
options: {
jshintrc: '.jshintrc'
},
lib: ['lib/**/*.js', 'Gruntfile.js'],
test: 'test/**/*.js'
},
simplemocha: {
all: {
src: ['test/**/*.test.js']
}
}
});
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
release: {},
jshint: {
options: {
jshintrc: '.jshintrc'
},
lib: ['lib/**/*.js', 'Gruntfile.js'],
test: 'test/**/*.js'
},
simplemocha: {
all: {
src: ['test/**/*.test.js']
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-simple-mocha');

grunt.registerTask('test', 'simplemocha');
grunt.registerTask('default', ['jshint', 'simplemocha']);
grunt.registerTask('test', 'simplemocha');
grunt.registerTask('default', ['jshint', 'simplemocha']);
};
2 changes: 2 additions & 0 deletions app/templates/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
The MIT License (MIT)

Copyright <%= currentYear %> <%= realname %>

Permission is hereby granted, free of charge, to any person obtaining
Expand Down
2 changes: 1 addition & 1 deletion app/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var plugin = require('<%= _.slugify(appname) %>');
// Setup
var app = feathers();
// Use Plugin
app.configure(plugin());
app.configure(plugin({ /* configuration */ }));
```

## Documentation
Expand Down
4 changes: 2 additions & 2 deletions app/templates/jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"strict": false,
"trailing": true,
"smarttabs": true,
"white": true,
"white": false,
"globals": {
"it": true,
"describe": true,
Expand Down
23 changes: 17 additions & 6 deletions app/templates/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@
'use strict';

module.exports = function(config) {
return function() {
var app = this;
var services = {};
return function() {
var app = this;
var services = {};

app.enable('feathers <%= pluginName %>');
// Enable the <%= pluginName %> Plugin
app.enable('feathers <%= pluginName %>');

};
};
// Check for configuration
if (config) {
// Apply configuration
}

// Optional: Register this plugin as a Feathers provider
app.providers.push(function(path, service) {
services[path] = service;
});

};
};
6 changes: 3 additions & 3 deletions app/templates/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var assert = require('assert');

describe('name_test.js test', function () {
it('does something', function () {
assert.ok(true, 'Done!');
});
it('does something', function () {
assert.ok(true, 'Done!');
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-feathers-plugin",
"version": "0.1.0",
"version": "0.1.1",
"description": "A generator for Feathersjs Plugins.",
"keywords": [
"yeoman-generator",
Expand Down

0 comments on commit e69171e

Please sign in to comment.