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

Update plugin generator to new plugin infrastructure #44

Merged
merged 2 commits into from
Jul 7, 2017
Merged
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
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
sudo: false
language: node_js
node_js:
- node
- '6'
- '4'
- node
- '6'
notifications:
email: false
slack:
Expand Down
11 changes: 3 additions & 8 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = class FeathersPluginGenerator extends Generator {
};
this.fileMap = {
'package.json': 'package.json',
'index.js': 'src/index.js',
'index.js': 'lib/index.js',
'index.test.js': 'test/index.test.js',
'README.md': 'README.md',
'LICENSE': 'LICENSE',
Expand Down Expand Up @@ -61,20 +61,15 @@ module.exports = class FeathersPluginGenerator extends Generator {
);
}.bind(this));

this.npmInstall(['debug', 'feathers-errors'], {
this.npmInstall(['debug'], {
save: true
});

this.npmInstall([
'babel-core@^6.17.0',
'babel-cli@^6.16.0',
'babel-preset-es2015@^6.0.0',
'babel-plugin-add-module-exports',
'semistandard',
'mocha',
'istanbul@1.1.0-alpha.1',
'chai@^3.5.0',
'shx@^0.2.1'
'chai@^3.5.0'
], {
saveDev: true
});
Expand Down
2 changes: 1 addition & 1 deletion app/templates/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Feathers
Copyright (c) 2017 Feathers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion app/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ console.log('Feathers app started on 127.0.0.1:3030');

## License

Copyright (c) 2016
Copyright (c) 2017

Licensed under the [MIT license](LICENSE).
3 changes: 0 additions & 3 deletions app/templates/__gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ node_modules

# Users Environment Variables
.lock-wscript

# The compiled/babelified modules
lib/
3 changes: 1 addition & 2 deletions app/templates/__npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
.istanbul.yml
.babelrc
.idea/
src/
.vscode/
test/
!lib/
8 changes: 3 additions & 5 deletions app/templates/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// import errors from 'feathers-errors';
import makeDebug from 'debug';
const debug = require('debug')('<%= name %>');

const debug = makeDebug('<%= name %>');

export default function init () {
module.exports = function init () {
debug('Initializing <%= name %> plugin');
return '<%= name %>';
}
};
8 changes: 2 additions & 6 deletions app/templates/index.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { expect } from 'chai';
import plugin from '../src';
const { expect } = require('chai');
const plugin = require('../lib');

describe('<%= name %>', () => {
it('is CommonJS compatible', () => {
expect(typeof require('../lib')).to.equal('function');
});

it('basic functionality', () => {
expect(typeof plugin).to.equal('function', 'It worked');
expect(plugin()).to.equal('<%= name %>');
Expand Down
8 changes: 2 additions & 6 deletions app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,18 @@
"url": "https://github.com/<%= repository %>/issues"
},
"engines": {
"node": ">= 4.6.0"
"node": ">= 6.0.0"
},
"scripts": {
"prepublish": "npm run compile",
"publish": "git push origin --tags && npm run changelog && git push origin",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
"release:major": "npm version major && npm publish",
"changelog": "github_changelog_generator && git add CHANGELOG.md && git commit -am \"Updating changelog\"",
"compile": "shx rm -rf lib/ && babel -d lib/ src/",
"watch": "babel --watch -d lib/ src/",
"lint": "semistandard src/**/*.js test/**/*.js --fix",
"mocha": "mocha --opts mocha.opts",
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --opts mocha.opts",
"test": "npm run compile && npm run lint && npm run coverage",
"start": "npm run compile && node example/app"
"test": "npm run lint && npm run coverage"
},
"semistandard": {
"sourceType": "module",
Expand Down
4 changes: 0 additions & 4 deletions app/templates/static/.babelrc

This file was deleted.

3 changes: 1 addition & 2 deletions app/templates/static/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- 'node'
- '6'
- '4'
addons:
code_climate:
repo_token: 'your repo token'
Expand All @@ -11,4 +10,4 @@ notifications:
before_script:
- npm install -g codeclimate-test-reporter
after_script:
- codeclimate-test-reporter < coverage/lcov.info
- codeclimate-test-reporter < coverage/lcov.info
1 change: 0 additions & 1 deletion app/templates/static/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
--recursive test/
--compilers js:babel-core/register
Loading