You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal of this repo is to normalize different remote endpoints for Component into a unified API.
You can also create your own remote endpoints instead of shoehorning different APIs into a JSON file.
This also handles versions and git trees, which is a little more complicated than just github raw.
Example:
varRemotes=require('component-remotes');varremotes=Remotes();remotes.use(newRemotes.Local({dir: 'components'}));remotes.use(newRemotes.GitHub({auth: 'jonathanong:password'}));co(function*(){// get the correct remote from a list of remotesvarremote=yield*remotes.resolve('component/emitter');// return all the versions this remote hasvarversions=yield*remote.versions('component/emitter');// do stuff with the versions})
dir - local components path. Defaults to `process.cwd() + '/components'
local - use the local component.
remotes.use(remote)
Add a remote to this list of remotes. Note that order matters.
var remote = yield* remotes.resolve([names], repo, [ref])
Returns the first remote with <repo>@<ref> from the list of remotes. You may optionally pass names, a list of remote names, instead of searching all the remotes or to search in a different order.
Authentication
Some remotes, such as GitHub, require authentication. If you want to use authentication in your own remote implementation, we suggest you use camshaft/netrc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.