This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
forked from 280north/narwhal
-
Notifications
You must be signed in to change notification settings - Fork 16
Organization of catalog.json
bryanwb edited this page Sep 13, 2010
·
13 revisions
This is a proposed structure for catalog.json, based on cdorn’s tusk-catalog fork http://github.com/cadorn/narwhal/tree/tusk-catalog/
It follows the schema
{
"name": // The name of the catalog
"type": // The type of catalog. Set to "sea" for sea catalogs.
"origin": {
"location": // The URL of where the catalog can be downloaded/was downloaded from
},
"packages": {
"template": [ // The name of a package
[ // A revision entry
"source", // A revision of the package
{ // A locator
"location": // Where to download the package
"package": // The name of the downloaded package
"revision": // The revision of the downloaded package
},
<package.json> // The contents of package.json
]
]
}
}
Packages are downloaded from a catalog by specifying a package name and revision. If no revision is specified latest is used by default.
A package can have entries for one or more revisions in the catalog. At this time entries are organized in a list. It may make sense to map them by revision instead since the order is irrelevant and each revision can only exist once per package. If we map them we will need to introduce another level of keys to separate from the locator.
Here is an example from http://github.com/cadorn/narwhal/blob/tusk-catalog/docs/tusk.md
{
"name": "com.github.tlrobinson.narwhal",
"type": "sea",
"origin": {
"location": "http://github.com/cadorn/narwhal/raw/master/catalog.json"
},
"packages": {
"narwhal": [
["source", {
"locate": "file://./",
"package": "narwhal",
"revision": "latest"
}],
["latest", {
"location": "http://github.com/tlrobinson/narwhal/zipball/master/",
"package": "narwhal",
"revision": "master"
}]
],
"template": [
["source", {
"location": "git://github.com/gmosx/template.git",
"package": "template",
"revision": "master"
}],
["latest", {
"location": "http://github.com/gmosx/template/zipball/master/",
"package": "template",
"revision": "master"
}]
]
}
}
{
"name": "com.github.tlrobinson.narwhal",
"type": "sea",
"origin": {
"location": "http://github.com/cadorn/narwhal/raw/master/catalog.json"
},
"packages": {
"narwhal": {
distros: [
{ distroName: "source",
distroInfo : {
"location": "file://./",
"package": "narwhal",
"revision": "latest"
}
},
{ distroName : "latest",
distroInfo: {
"location": "http://github.com/tlrobinson/narwhal/zipball/master/",
"package": "narwhal",
"revision": "master"
}
],
metadata : { /* contents of package's package.json file */}
},
}
}