deref / exo

A process manager & log viewer for dev

Home Page:https://exo.deref.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. fail if path exists
  2. create path as a directory
  3. If a template was provided:
    a. copy the templated files into the directory
    b. insert a relevant manifest file
  4. run the create-workspace command
  5. return the workspace ID

I'd like to propose a few tweaks to this interface.

  1. 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.
  2. 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;
}