An example of a simple App Builder template registry based on static files.
- Download the metadata.json
- Look at the
registry
property - Download the file pointed to by the
registry
property - Pass this url as the value for the
--experimental-registry
flag in theaio app template discover
command (currently in code review PR)
This is the metadata of the registry.
{
"name" // String
"registry" // String (http, https link to the initial registry json file)
}
This is just an array of RegistryRecords under the data
key, with optional url links to the previous and next pages.
Each payload will have a limit of 50 records.
{
"data": [
{ ... }, // RegistryRecord
{ ... }, // RegistryRecord
{ ... }, // RegistryRecord
{ ... } // RegistryRecord
],
"total": 20, // total number of records to return (not total in this response)
"links": {
"prev" // String, url to prev page (if any)
"next" // String, url to next page (if any)
}
}
This is similar to an npm package record.
Records are in the form (tentative schema):
{
"name" // String (equivalent to the package name without scope)
"scope" // String (equivalent to the scope of an npm package)
"url" // String (http, https link to a git repo - for download/clone)
"version" // String (semver) (equivalent to the package version)
"description" // String
"keywords" // Array of Strings (essentially 'tags')
"date" // String ISO-8601 Date (record last updated date)
"links" // Array of other links
"author" // String (equivalent to the package author)
"type" // String (this is an App Builder thing: the template type TBD)
}
A record can be extracted from the template's package.json
, when the template is added to this registry.
This can be accomplished by an App Builder app that has a front-end SPA that can gather input, then update the registry json via the Github API - there can also be a Runtime endpoint that serves the metadata.json
.
Think of the App Template Registry like a static website, it is re-generated each time without needing to be dynamic.
This can be similar to Azure Quickstart Templates: https://azure.microsoft.com/en-us/resources/templates/
- Download the template package contents from its url
- Parse the
package.json
of the package - Map the
package.json
properties to a RegistryRecord - Add in additional properties to the RegistryRecord
- Save the RegistryRecord to the registry json (paginated into multiple files, sorted descending by date)
Contributions are welcome! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.