Skip to content

Commit

Permalink
Update to new plugin infrastructure and npm scopes (#51)
Browse files Browse the repository at this point in the history
* Update to new plugin infrastructure and npm scopes

* Update Codeclimate token
  • Loading branch information
daffl committed Aug 23, 2018
1 parent 20db191 commit a117118
Show file tree
Hide file tree
Showing 14 changed files with 803 additions and 3,234 deletions.
4 changes: 0 additions & 4 deletions packages/configuration/.babelrc

This file was deleted.

4 changes: 3 additions & 1 deletion packages/configuration/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_Store

# Logs
logs
*.log
Expand Down Expand Up @@ -27,4 +29,4 @@ node_modules
# Users Environment Variables
.lock-wscript

lib/
dist/
6 changes: 2 additions & 4 deletions packages/configuration/.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]
14 changes: 7 additions & 7 deletions packages/configuration/.npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.idea/
src/
test/
!lib/
.github/
coverage
.editorconfig
.jshintrc
.travis.yml
.istanbul.yml
.babelrc
.babelrc
.idea/
.vscode/
test/
coverage/
.github/
3 changes: 1 addition & 2 deletions packages/configuration/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ language: node_js
node_js:
- node
- '6'
- '4'
sudo: false
before_script:
- npm install -g codeclimate-test-reporter
after_script:
- codeclimate-test-reporter < coverage/lcov.info
addons:
code_climate:
repo_token: 06e01bb6c71ad2bef630598ab7802db681782f1900b09872efbb0950b92cc3a0
repo_token: 740faa053b40feb3e488294d03b405d9af40a604e424979fb78fb247e0de09d1
notifications:
email: false
slack:
Expand Down
134 changes: 67 additions & 67 deletions packages/configuration/CHANGELOG.md

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions packages/configuration/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# feathers-configuration
# @feathersjs/configuration

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

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

> A small configuration module for your Feathers application.
## About

The v0.4.x release of `feathers-configuration` is a breaking version and implementations that were made with earlier versions of the module may be required to make some minor changes. Please see the [migrating](#migrating) section for specifics.
The v0.4.x release of `@feathersjs/configuration` is a breaking version and implementations that were made with earlier versions of the module may be required to make some minor changes. Please see the [migrating](#migrating) section for specifics.

This module is a simple wrapper on [node-config](https://github.com/lorenwest/node-config) that adds a bit of convenience. By default this implementation will look in `config/*` for `default.json` which retains convention. As per the [config docs](https://github.com/lorenwest/node-config/wiki/Configuration-Files) you can organize *"hierarchical configurations for your app deployments"*. See the usage section below for better information how to implement this.

Expand All @@ -24,7 +24,7 @@ Please note: future releases will also include the ability to define adapters wh
Moving from 0.3.x to 0.4.x should be *mostly* backwards compatible. The main change is that instead of passing the location of your configuration into the module constructor like this:

```js
let config = require('feathers-configuration')(root, env, deepAssign);
let config = require('@feathersjs/configuration')(root, env, deepAssign);
```

The module now simply inherits from `NODE_ENV` and `NODE_CONFIG_DIR` as per the [node-config docs](https://github.com/lorenwest/node-config/wiki/Configuration-Files):
Expand All @@ -39,18 +39,18 @@ With the implementation of node-config we also now have the ability to set a `cu

## Usage

The `feathers-configuration` module is an app configuration function that takes a root directory (usually something like `__dirname` in your application) and the configuration folder (set to `config` by default):
The `@feathersjs/configuration` module is an app configuration function that takes a root directory (usually something like `__dirname` in your application) and the configuration folder (set to `config` by default):

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

// Use the current folder as the root and look configuration up in `settings`
let app = feathers().configure(configuration())
```
## Variable types

`feathers-configuration` uses the following variable mechanisms:
`@feathersjs/configuration` uses the following variable mechanisms:

- Given a root and configuration path load a `default.json` in that path
- When the `NODE_ENV` is not `development`, also try to load `<NODE_ENV>.json` in that path and merge both configurations
Expand Down Expand Up @@ -90,7 +90,7 @@ Now it can be used in our `app.js` like this:

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

let conf = configuration();

Expand Down
14 changes: 0 additions & 14 deletions packages/configuration/index.d.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import makeDebug from 'debug';
import path from 'path';
const makeDebug = require('debug');
const path = require('path');

const debug = makeDebug('feathers:configuration');
const debug = makeDebug('@feathersjs/configuration');
const config = require('config');
const separator = path.sep;

export default module.exports = function () {
module.exports = module.exports = function () {
return function () {
let app = this;

Expand Down Expand Up @@ -42,10 +42,11 @@ export default module.exports = function () {
};

const env = config.util.getEnv('NODE_ENV');
debug(`Initializing configuration for ${env} environment`);
const conf = convert(config);

if (!app) {
debug(`Initializing configuration for ${env} environment`);

if (!app || app === global) {
return conf;
}

Expand Down
1 change: 0 additions & 1 deletion packages/configuration/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
--recursive test/
--compilers js:babel-core/register
Loading

0 comments on commit a117118

Please sign in to comment.