UNPKG

2.1 kBMarkdownView Raw
1The goal of jspm is to enable an open and interoperable package management ecosystem.
2
3Packages loaded through jspm declare the `registry` property in their package.json, indicating which registry name is responsible for that package.
4
5This then enables jspm to know what is meant by the `dependencies` property in the package.json. A value of `"lodash": "^3.2.0"` has meaning for the npm registry, which can be very different from other registries.
6
7In addition, edge-case dependency values can then be converted into jspm values. For example, npm installs from GitHub repos with the syntax `git+ssh://git@github.com:npm/npm.git#v1.0.27`, which can then be converted internally into the jspm-compatible `github:npm/npm@1.0.27`.
8
9These dependency conversions are handled by the endpoint itself using the [processPackageConfig hook](https://github.com/jspm/jspm-cli/wiki/Endpoint-API#processpackageconfig-pjson-optional) of the Endpoint API.
10
11In future the `registry` property is planned to support [automated publishing workflows](https://github.com/jspm/jspm-cli/issues/249) as well.
12
13Some important edge cases of this registry handling are:
14
15* Packages without any `registry` property on GitHub will have their dependencies ignored.
16* Packages on GitHub that set `"registry": "npm"` will have their sources run through the npm conversion build process provided by the `build` hook of the npm registry endpoint in jspm. The same applies for linked packages.
17* Packages on GitHub that want to load dependencies from GitHub can set `"registry": "github"`.
18* A generic registry property, `"registry": "jspm"` allows packages simply to indicate to jspm that they are jspm-compatible. Non-canonical dependency names (eg `"jquery": "*"`) are then taken looked up in the jspm registry (through aliasing, resolves to `github:components/jquery`).
19
20The jspm registry itself is very much a convenience to fill a gap. Over time the goal is for this service to decrease in usage towards deprecation. In this way, the only servers one relies on are the servers one chooses to rely on as a publisher or consumer.
\No newline at end of file