Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Update to new plugin infrastructure and npm scope #92

Merged
merged 2 commits into from
Oct 21, 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
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

38 changes: 32 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
tmp*
node_modules/
npm-debug.log
.idea/
lib/
coverage
.DS_Store

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript

dist/
6 changes: 2 additions & 4 deletions .istanbul.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
verbose: false
instrumentation:
root: src/
excludes:
- lib/
root: ./lib/
include-all-sources: true
reporting:
print: summary
Expand All @@ -14,4 +12,4 @@ reporting:
statements: [50, 80]
lines: [50, 80]
functions: [50, 80]
branches: [50, 80]
branches: [50, 80]
8 changes: 4 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.editorconfig
.jshintrc
.travis.yml
.istanbul.yml
.babelrc
.idea/
src/
.vscode/
test/
!lib/
coverage/
.github/
coverage
.istanbul.yml
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ language: node_js
node_js:
- node
- '6'
- '4'
before_script:
- npm install -g codeclimate-test-reporter
after_script:
- codeclimate-test-reporter < coverage/lcov.info
addons:
code_climate:
repo_token: 79bf1da6311c0a60e481f617f3666ae4068535bca3f9e0cfaa5a1500758d986b
repo_token: 39c710513d49b85f9cd9360fae42a7019691b96d639a5e95caf3116a09f455f6
notifications:
email: false
slack:
Expand Down
330 changes: 165 additions & 165 deletions CHANGELOG.md

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# feathers-errors
# @feathersjs/errors

[![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs/feathers-errors.svg)](https://greenkeeper.io/)
[![Greenkeeper badge](https://badges.greenkeeper.io/feathersjs/errors.svg)](https://greenkeeper.io/)

[![Build Status](https://travis-ci.org/feathersjs/feathers-errors.png?branch=master)](https://travis-ci.org/feathersjs/feathers-errors)
[![Code Climate](https://codeclimate.com/github/feathersjs/feathers-errors.png)](https://codeclimate.com/github/feathersjs/feathers-errors)
[![Test Coverage](https://codeclimate.com/github/feathersjs/feathers-errors/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/feathers-errors/coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers-errors.svg?style=flat-square)](https://david-dm.org/feathersjs/feathers-errors)
[![Download Status](https://img.shields.io/npm/dm/feathers-errors.svg?style=flat-square)](https://www.npmjs.com/package/feathers-errors)
[![Slack Status](http://slack.feathersjs.com/badge.svg)](http://slack.feathersjs.com)
[![Build Status](https://travis-ci.org/feathersjs/errors.png?branch=master)](https://travis-ci.org/feathersjs/errors)
[![Test Coverage](https://codeclimate.com/github/feathersjs/errors/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/errors/coverage)
[![Dependency Status](https://img.shields.io/david/feathersjs/errors.svg?style=flat-square)](https://david-dm.org/feathersjs/errors)
[![Download Status](https://img.shields.io/npm/dm/@feathersjs/errors.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/errors)

> Common error types for feathers apps

Expand All @@ -18,7 +16,7 @@ Feathers errors come with feathers by default. So typically you don't need to in
In the event that you do need to install it:

```bash
npm install --save feathers-errors
npm install --save @feathersjs/errors
```

## Documentation
Expand Down Expand Up @@ -47,7 +45,7 @@ npm install --save feathers-errors
#### Usage:

```js
import errors from 'feathers-errors';
import errors from '@feathersjs/errors';

// If you were to create an error yourself.
var notFound = new errors.NotFound('User does not exist');
Expand Down
6 changes: 0 additions & 6 deletions handler.d.ts

This file was deleted.

97 changes: 0 additions & 97 deletions index.d.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/error-handler.js → lib/error-handler.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import path from 'path';
import errors from './index';
const path = require('path');
const errors = require('./index');

const defaults = {
public: path.resolve(__dirname, 'public')
};
const defaultError = path.resolve(defaults.public, 'default.html');

export default function (options = {}) {
module.exports = function (options = {}) {
options = Object.assign({}, defaults, options);

if (typeof options.html === 'undefined') {
Expand Down Expand Up @@ -84,4 +84,4 @@ export default function (options = {}) {
formatter['application/json'](error, req, res, next);
}
};
}
};
10 changes: 3 additions & 7 deletions src/index.js → lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const debug = require('debug')('feathers-errors');
const debug = require('debug')('@feathersjs/errors');

function FeathersError (msg, name, code, className, data) {
msg = msg || 'Error';
Expand All @@ -24,7 +24,7 @@ function FeathersError (msg, name, code, className, data) {
if (data) {
// NOTE(EK): To make sure that we are not messing
// with immutable data, just make a copy.
// https://github.com/feathersjs/feathers-errors/issues/19
// https://github.com/feathersjs/errors/issues/19
newData = JSON.parse(JSON.stringify(data));

if (newData.errors) {
Expand Down Expand Up @@ -241,8 +241,4 @@ function convert (error) {
return result;
}

export default Object.assign({
convert,
types: errors,
errors
}, errors);
module.exports = Object.assign({ convert }, errors);
6 changes: 3 additions & 3 deletions src/not-found-handler.js → lib/not-found-handler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import errors from './index';
const errors = require('./index');

export default function () {
module.exports = function () {
return function (req, res, next) {
next(new errors.NotFound('Page not found'));
};
}
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion mocha.opts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
--recursive test/
--compilers js:babel-core/register
6 changes: 0 additions & 6 deletions not-found.d.ts

This file was deleted.

Loading