Merge pull request #125 from strongloop/rename

Rename package and module
This commit is contained in:
Miroslav Bajtoš 2015-09-17 10:56:01 +02:00
commit 4f4e8079f0
6 changed files with 20 additions and 20 deletions

View File

@ -1,9 +1,9 @@
### Contributing ### ### Contributing ###
Thank you for your interest in `loopback-explorer`, an open source project Thank you for your interest in `loopback-component-explorer`, an open source project
administered by StrongLoop. administered by StrongLoop.
Contributing to `loopback-explorer` is easy. In a few simple steps: Contributing to `loopback-component-explorer` is easy. In a few simple steps:
* Ensure that your effort is aligned with the project's roadmap by * Ensure that your effort is aligned with the project's roadmap by
talking to the maintainers, especially if you are going to spend a talking to the maintainers, especially if you are going to spend a
@ -14,7 +14,7 @@ Contributing to `loopback-explorer` is easy. In a few simple steps:
* Adhere to code style outlined in the [Google C++ Style Guide][] and * Adhere to code style outlined in the [Google C++ Style Guide][] and
[Google Javascript Style Guide][]. [Google Javascript Style Guide][].
* Sign the [Contributor License Agreement](https://cla.strongloop.com/agreements/strongloop/loopback-explorer) * Sign the [Contributor License Agreement](https://cla.strongloop.com/agreements/strongloop/loopback-component-explorer)
* Submit a pull request through Github. * Submit a pull request through Github.

View File

@ -1,6 +1,6 @@
Copyright (c) 2013-2014 StrongLoop, Inc. Copyright (c) 2013-2014 StrongLoop, Inc.
loopback-explorer uses a 'dual license' model. Users may use loopback-explorer loopback-component-explorer uses a 'dual license' model. Users may use loopback-explorer
under the terms of the MIT license, or under the StrongLoop License. The text of under the terms of the MIT license, or under the StrongLoop License. The text of
both is included below. both is included below.

View File

@ -1,4 +1,4 @@
# loopback-explorer # loopback-component-explorer
Browse and test your LoopBack app's APIs. Browse and test your LoopBack app's APIs.
@ -34,7 +34,7 @@ To upgrade your application using loopback-explorer version 1.x, just replace
`explorer()` with `explorer.routes()` in your server script: `explorer()` with `explorer.routes()` in your server script:
```js ```js
var explorer = require('loopback-explorer'); var explorer = require('loopback-component-explorer'); // Module was loopback-explorer in v. 2.0.1 and earlier
// v1.x - does not work anymore // v1.x - does not work anymore
app.use('/explorer', explorer(app, options); app.use('/explorer', explorer(app, options);
@ -43,11 +43,11 @@ app.use('/explorer', explorer.routes(app, options));
``` ```
In applications scaffolded by `slc loopback`, the idiomatic way is to register In applications scaffolded by `slc loopback`, the idiomatic way is to register
loopback-explorer via `component-config.json`: loopback-component-explorer in `server/component-config.json`:
```json ```json
{ {
"loopback-explorer": { "loopback-component-explorer": {
"mountPath": "/explorer" "mountPath": "/explorer"
} }
} }
@ -101,7 +101,7 @@ Options are passed to `explorer(app, options)`.
> Default: `null` > Default: `null`
> A hard override for the outgoing protocol (`http` or `https`) that is designated in Swagger > A hard override for the outgoing protocol (`http` or `https`) that is designated in Swagger
> resource documents. By default, `loopback-explorer` will write the protocol that was used to retrieve > resource documents. By default, `loopback-component-explorer` will write the protocol that was used to retrieve
> the doc. This option is useful if, for instance, your API sits behind an SSL terminator > the doc. This option is useful if, for instance, your API sits behind an SSL terminator
> and thus needs to report its endpoints as `https`, even though incoming traffic is auto-detected > and thus needs to report its endpoints as `https`, even though incoming traffic is auto-detected
> as `http`. > as `http`.

View File

@ -17,14 +17,14 @@ explorer.routes = routes;
/** /**
* Example usage: * Example usage:
* *
* var explorer = require('loopback-explorer'); * var explorer = require('loopback-component-explorer');
* explorer(app, options); * explorer(app, options);
*/ */
function explorer(loopbackApplication, options) { function explorer(loopbackApplication, options) {
options = _defaults({}, options, { mountPath: '/explorer' }); options = _defaults({}, options, { mountPath: '/explorer' });
loopbackApplication.use(options.mountPath, routes(loopbackApplication, options)); loopbackApplication.use(options.mountPath, routes(loopbackApplication, options));
loopbackApplication.set('loopback-explorer', options); loopbackApplication.set('loopback-component-explorer', options);
} }
function routes(loopbackApplication, options) { function routes(loopbackApplication, options) {
@ -33,7 +33,7 @@ function routes(loopbackApplication, options) {
loopback.version.split('.')[0] || 1; loopback.version.split('.')[0] || 1;
if (loopbackMajor < 2) { if (loopbackMajor < 2) {
throw new Error('loopback-explorer requires loopback 2.0 or newer'); throw new Error('loopback-component-explorer requires loopback 2.0 or newer');
} }
options = _defaults({}, options, { options = _defaults({}, options, {

View File

@ -1,5 +1,5 @@
{ {
"name": "loopback-explorer", "name": "loopback-component-explorer",
"version": "2.0.1", "version": "2.0.1",
"description": "Browse and test your LoopBack app's APIs", "description": "Browse and test your LoopBack app's APIs",
"main": "index.js", "main": "index.js",
@ -8,7 +8,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/strongloop/loopback-explorer.git" "url": "git://github.com/strongloop/loopback-component-explorer.git"
}, },
"keywords": [ "keywords": [
"loopback", "loopback",
@ -18,7 +18,7 @@
"author": "Ritchie Martori", "author": "Ritchie Martori",
"readmeFilename": "README.md", "readmeFilename": "README.md",
"bugs": { "bugs": {
"url": "https://github.com/strongloop/loopback-explorer/issues" "url": "https://github.com/strongloop/loopback-component-explorer/issues"
}, },
"devDependencies": { "devDependencies": {
"loopback": "^2.19.1", "loopback": "^2.19.1",
@ -28,7 +28,7 @@
}, },
"license": { "license": {
"name": "Dual MIT/StrongLoop", "name": "Dual MIT/StrongLoop",
"url": "https://github.com/strongloop/loopback-explorer/blob/master/LICENSE" "url": "https://github.com/strongloop/loopback-component-explorer/blob/master/LICENSE"
}, },
"dependencies": { "dependencies": {
"cors": "^2.7.1", "cors": "^2.7.1",

View File

@ -12,8 +12,8 @@ describe('explorer', function() {
describe('with default config', function() { describe('with default config', function() {
beforeEach(givenLoopBackAppWithExplorer()); beforeEach(givenLoopBackAppWithExplorer());
it('should register "loopback-explorer" to the app', function() { it('should register "loopback-component-explorer" to the app', function() {
expect(this.app.get('loopback-explorer')) expect(this.app.get('loopback-component-explorer'))
.to.have.property('mountPath', '/explorer'); .to.have.property('mountPath', '/explorer');
}); });
@ -55,8 +55,8 @@ describe('explorer', function() {
describe('with custom explorer base', function() { describe('with custom explorer base', function() {
beforeEach(givenLoopBackAppWithExplorer('/swagger')); beforeEach(givenLoopBackAppWithExplorer('/swagger'));
it('should register "loopback-explorer" to the app', function() { it('should register "loopback-component-explorer" to the app', function() {
expect(this.app.get('loopback-explorer')) expect(this.app.get('loopback-component-explorer'))
.to.have.property('mountPath', '/swagger'); .to.have.property('mountPath', '/swagger');
}); });