Skip to content

Optional Templates Scaffolding #3

@ykholm

Description

@ykholm

Create the system for scaffolding a project from templates that are placed in https://github.com/lancer-kit/forge-templates repo.

image

Each template is expected to be in separate directory.
Specification for the templates will be placed in schema.yml file.

The schema for such template system will be defined by:

  • template key
  • template folder name prefix
  • necessary template fields spec
    • field name
    • field type

Expected schema.yml file structure:
image

Expected .forge directory structure:
image

As a result Scaffold will have such algorithm of project generation:

  1. read schema.yml file in .forge directory;
  2. read CLI flag values (Go Modules, Git Repository integration etc.) and validate them;
  3. form map[string]interface{} struct for template population;
  4. validate the templates with template schema fields spec;
  5. generate the project to the CLI flag --outpath.

The schema file, along with templates directories and predefined Bindata code will be placed in .forge directory.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions