Merge pull request #125 from strongloop/rename
Rename package and module
This commit is contained in:
commit
4f4e8079f0
|
@ -1,9 +1,9 @@
|
|||
### 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.
|
||||
|
||||
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
|
||||
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
|
||||
[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.
|
||||
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
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
|
||||
both is included below.
|
||||
|
||||
|
|
10
README.md
10
README.md
|
@ -1,4 +1,4 @@
|
|||
# loopback-explorer
|
||||
# loopback-component-explorer
|
||||
|
||||
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:
|
||||
|
||||
```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
|
||||
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
|
||||
loopback-explorer via `component-config.json`:
|
||||
loopback-component-explorer in `server/component-config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"loopback-explorer": {
|
||||
"loopback-component-explorer": {
|
||||
"mountPath": "/explorer"
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ Options are passed to `explorer(app, options)`.
|
|||
> Default: `null`
|
||||
|
||||
> 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
|
||||
> and thus needs to report its endpoints as `https`, even though incoming traffic is auto-detected
|
||||
> as `http`.
|
||||
|
|
6
index.js
6
index.js
|
@ -17,14 +17,14 @@ explorer.routes = routes;
|
|||
/**
|
||||
* Example usage:
|
||||
*
|
||||
* var explorer = require('loopback-explorer');
|
||||
* var explorer = require('loopback-component-explorer');
|
||||
* explorer(app, options);
|
||||
*/
|
||||
|
||||
function explorer(loopbackApplication, options) {
|
||||
options = _defaults({}, options, { mountPath: '/explorer' });
|
||||
loopbackApplication.use(options.mountPath, routes(loopbackApplication, options));
|
||||
loopbackApplication.set('loopback-explorer', options);
|
||||
loopbackApplication.set('loopback-component-explorer', options);
|
||||
}
|
||||
|
||||
function routes(loopbackApplication, options) {
|
||||
|
@ -33,7 +33,7 @@ function routes(loopbackApplication, options) {
|
|||
loopback.version.split('.')[0] || 1;
|
||||
|
||||
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, {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "loopback-explorer",
|
||||
"name": "loopback-component-explorer",
|
||||
"version": "2.0.1",
|
||||
"description": "Browse and test your LoopBack app's APIs",
|
||||
"main": "index.js",
|
||||
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/strongloop/loopback-explorer.git"
|
||||
"url": "git://github.com/strongloop/loopback-component-explorer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"loopback",
|
||||
|
@ -18,7 +18,7 @@
|
|||
"author": "Ritchie Martori",
|
||||
"readmeFilename": "README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/strongloop/loopback-explorer/issues"
|
||||
"url": "https://github.com/strongloop/loopback-component-explorer/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"loopback": "^2.19.1",
|
||||
|
@ -28,7 +28,7 @@
|
|||
},
|
||||
"license": {
|
||||
"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": {
|
||||
"cors": "^2.7.1",
|
||||
|
|
|
@ -12,8 +12,8 @@ describe('explorer', function() {
|
|||
describe('with default config', function() {
|
||||
beforeEach(givenLoopBackAppWithExplorer());
|
||||
|
||||
it('should register "loopback-explorer" to the app', function() {
|
||||
expect(this.app.get('loopback-explorer'))
|
||||
it('should register "loopback-component-explorer" to the app', function() {
|
||||
expect(this.app.get('loopback-component-explorer'))
|
||||
.to.have.property('mountPath', '/explorer');
|
||||
});
|
||||
|
||||
|
@ -55,8 +55,8 @@ describe('explorer', function() {
|
|||
describe('with custom explorer base', function() {
|
||||
beforeEach(givenLoopBackAppWithExplorer('/swagger'));
|
||||
|
||||
it('should register "loopback-explorer" to the app', function() {
|
||||
expect(this.app.get('loopback-explorer'))
|
||||
it('should register "loopback-component-explorer" to the app', function() {
|
||||
expect(this.app.get('loopback-component-explorer'))
|
||||
.to.have.property('mountPath', '/swagger');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue