Create project templating backend
BenElgar opened this issue · comments
Should provide the following interface for creating a project:
api.kernel.createProject(path: string, templateName?: string): Promise<string>
where the return result is a workspace ID.
And the following for listing available templates:
api.kernel.listTemplates(): Promise<string[]>;
where the return result is a list of template names.
This command should:
- fail if
path
exists - create
path
as a directory - If a template was provided:
a. copy the templated files into the directory
b. insert a relevant manifest file - run the
create-workspace
command - return the workspace ID
I'd like to propose a few tweaks to this interface.
- In
createProject
: specify templates by URL, not by name. This way external templates can be supported someday. This way the template ID is just the path to the root of the directory on github or something like that. - Extend the return value of
listTemplates
to a richer structure, so that we can add metadata. For example, the template picker UI probably wants a display name:
interface TemplateDescription {
url: string;
displayName: string;
}