From e2832d055c141ae2c5caa2075aba053444bfa13b Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 21 May 2021 10:25:43 +0200 Subject: [PATCH] chore: remove create-react-app- template and fix up the docs template Signed-off-by: blam --- .../create-react-app/template.yaml | 67 ------------------- .../catalog-info.yaml | 0 .../docs/index.md | 2 +- .../mkdocs.yml | 2 +- .../docs-template/template.yaml | 52 +++++++++----- 5 files changed, 37 insertions(+), 86 deletions(-) delete mode 100644 plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml rename plugins/scaffolder-backend/sample-templates/docs-template/{{{cookiecutter.component_id}} => skeleton}/catalog-info.yaml (100%) rename plugins/scaffolder-backend/sample-templates/docs-template/{{{cookiecutter.component_id}} => skeleton}/docs/index.md (96%) rename plugins/scaffolder-backend/sample-templates/docs-template/{{{cookiecutter.component_id}} => skeleton}/mkdocs.yml (69%) diff --git a/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml b/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml deleted file mode 100644 index 82fde335c5..0000000000 --- a/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml +++ /dev/null @@ -1,67 +0,0 @@ -apiVersion: backstage.io/v1alpha1 -kind: Template -metadata: - name: create-react-app-template - title: Create React App Template - description: Create a new CRA website project - tags: - - experimental - - react - - cra -spec: - owner: web@example.com - templater: cra - type: website - path: '.' - - schema: - required: - - component_id - - use_typescript - - description - - collaborators - properties: - component_id: - title: Name - type: string - pattern: ^[a-z0-9]+(-[a-z0-9]+)*$ - description: Unique name of the component. Lowercase, URL-safe characters only. - description: - title: Description - type: string - description: Help others understand what this website is for. - use_typescript: - title: Use TypeScript - type: boolean - description: Include TypeScript - default: true - use_github_actions: - title: Use Github Actions workflows to build this component - type: boolean - description: Use Github Actions - default: true - collaborators: - title: Collaborators - description: Provide users with permissions - type: array - ui:options: - orderable: false - items: - type: object - required: - - username - - access - properties: - access: - type: string - description: The type of access for the user - default: pull - enum: - - push - - pull - - admin - - maintain - - triage - username: - type: string - description: The username or group diff --git a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/catalog-info.yaml b/plugins/scaffolder-backend/sample-templates/docs-template/skeleton/catalog-info.yaml similarity index 100% rename from plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/catalog-info.yaml rename to plugins/scaffolder-backend/sample-templates/docs-template/skeleton/catalog-info.yaml diff --git a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/docs/index.md b/plugins/scaffolder-backend/sample-templates/docs-template/skeleton/docs/index.md similarity index 96% rename from plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/docs/index.md rename to plugins/scaffolder-backend/sample-templates/docs-template/skeleton/docs/index.md index 5352ef7801..b6f7344334 100644 --- a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/docs/index.md +++ b/plugins/scaffolder-backend/sample-templates/docs-template/skeleton/docs/index.md @@ -1,4 +1,4 @@ -## {{ cookiecutter.component_id }} +## {{ cookiecutter.name }} {{ cookiecutter.description }} diff --git a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml b/plugins/scaffolder-backend/sample-templates/docs-template/skeleton/mkdocs.yml similarity index 69% rename from plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml rename to plugins/scaffolder-backend/sample-templates/docs-template/skeleton/mkdocs.yml index 64f1e9ee8e..7e1c015f28 100644 --- a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml +++ b/plugins/scaffolder-backend/sample-templates/docs-template/skeleton/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: {{cookiecutter.component_id | jsonify}} +site_name: {{cookiecutter.name | jsonify}} site_description: {{cookiecutter.description | jsonify}} nav: diff --git a/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml b/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml index 168daffd20..dcfa667c9f 100644 --- a/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml @@ -1,4 +1,4 @@ -apiVersion: backstage.io/v1alpha1 +apiVersion: backstage.io/v1beta2 kind: Template metadata: name: docs-template @@ -10,21 +10,39 @@ metadata: - mkdocs spec: owner: backstage/techdocs-core - templater: cookiecutter type: documentation - path: '.' - schema: - required: - - component_id - - description - properties: - component_id: - title: Name - type: string - pattern: ^[a-z0-9A-Z_.-]{1,63}$ - description: Unique name of the component - description: - title: Description - type: string - description: Help others understand what these docs are about. + parameters: + - title: Fill in some steps + required: + - name + - description + properties: + name: + title: Name + type: string + description: Unique name of the component + ui:autofocus: true + ui:options: + rows: 5 + description: + title: Description + type: string + description: A description for the component + ui:autofocus: true + ui:options: + rows: 5 + + # This template is meant to be used on top of an existing tmeplate. + # By adding the following and fetching from an absolute URL you can + # add in the docs template + steps: + - id: fetch + name: Template Docs Skeleton + action: fetch:cookiecutter + input: + url: ./skeleton + values: + name: '{{ parameters.name }}' + description: '{{ parameters.description }}' +