Update README.md

This commit is contained in:
Guy Bedford
2014-12-17 16:06:12 +02:00
parent 79fa13c239
commit 93e37d4fbe
+10 -35
View File
@@ -3,36 +3,19 @@ jspm Registry
[View the registry file here](https://github.com/jspm/registry/blob/master/registry.json) [View the registry file here](https://github.com/jspm/registry/blob/master/registry.json)
Pull requests welcome for `registry.json` to add or modify entries. Pull requests welcome for `registry.json` and the `package_overrides` folder.
All registry entries are managed here through Github, moderated by the registry maintainers. All registry entries are managed here through GitHub, moderated by the registry maintainers.
Registry Registry
--- ---
Modules are served from _endpoint servers_. Endpoints include `github:` and `npm:`. The currently supported endpoints are:
When requesting a module such as `github:twbs/bootstrap@3.0/js/bootstrap.js`, this corresponds to the URL * Github
`https://github.jspm.io/twbs/bootstrap@3.0/js/bootstrap.js` and the **GitHub endpoint**, returns the associated code. * npm
The registry simply remembers the `github:twbs/bootstrap` part, allowing the shortcut form: The registry provides a simple mapping in the file [`registry.json`](https://github.com/jspm/registry/blob/master/registry.json), which maps a shortname (`bootstrap`) to a canonical endpoint name (`github:twbs/bootstrap`). It is simply a convenience for installing through jspm.
```javascript
System.import('bootstrap@3.0/js/bootstrap');
```
The `registry.json` is just a collection of these mappings:
```javascript
"bootstrap": "github:twbs/bootstrap"
```
Anyone is welcome to submit a mapping.
The current supported endpoint servers are:
* Github (SPDY optimized)
* npm (SPDY optimized)
Package.json Overrides Package.json Overrides
--- ---
@@ -41,25 +24,20 @@ The registry also provides a service for overriding the `package.json` of existi
This is useful for enabling jspm functionality in the `package.json` when direct access to the underlying repo is not possible. This is useful for enabling jspm functionality in the `package.json` when direct access to the underlying repo is not possible.
This is because jspm uses the `package.json` for modular package configuration, including: jspm uses the `package.json` for modular package configuration, including:
* Setting the main entry point (`main`) * Setting the main entry point (`main`)
* Shim config for globals (`shim`) * Shim config for globals (`shim`)
* Map configuration (`map`) * Map configuration (`map`)
* Module format (`format`) * Module format (`format`)
* Auto-enabling minification (`buildOptions.minify`)
In this way, the right package options can make any package play well with jspm, without needing any manual configuration at all. In this way, the right package options can make any package play well with jspm, without needing any manual configuration at all.
Submitting a pull request to the original repo is still preferable to package overrides, this is a convenience service only and not a long term solution. > Submitting a pull request to the original repo should be done at the same time as this is designed as a temporary service only and not a long term solution to the configuration problem.
Read more about [configuring packages for jspm](https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm) in the wiki. Read more about [configuring packages for jspm](https://github.com/jspm/registry/wiki/Configuring-Packages-for-jspm) in the wiki.
Some examples of package.json overrides for common packages: Examples of jspm package.json files for common packages can be found in the [package overrides](https://github.com/jspm/registry/tree/master/package-overrides) section of the registry.
* [Bootstrap](https://github.com/jspm/registry/blob/master/package-overrides/github/twbs/bootstrap%403.0.2.json)
* [Backbone Marionette](https://github.com/jspm/registry/blob/master/package-overrides/github/marionettejs/backbone.marionette%401.2.2.json)
Further examples of jspm package.json files for common packages can be found in the [package overrides](https://github.com/jspm/registry/tree/master/package-overrides) section of the registry. Pull requests are encouraged.
### Testing Package Overrides ### Testing Package Overrides
@@ -76,7 +54,4 @@ To submit a new package override:
* Submit a pull request. * Submit a pull request.
* If the configuration is correct, this will be accepted and that will instantly enable the functionality on the endpoint. * If the configuration is correct, this will be accepted and that will instantly enable the functionality on the endpoint.
The overrides only apply to exact version, tag or branch names. When set to an exact semver version, the override will apply for all semver versions greater than that version. > The overrides will apply for all versions semver compatible with the override version, with the highest version override taking precedence.