diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/hooks/post_gen_project.sh b/plugins/scaffolder-backend/sample-templates/react-ssr-template/hooks/post_gen_project.sh deleted file mode 100644 index 1e302afa5e..0000000000 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/hooks/post_gen_project.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -echo "Could do something here?" diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.editorconfig b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.editorconfig similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.editorconfig rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.editorconfig diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.eslintignore b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.eslintignore similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.eslintignore rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.eslintignore diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.eslintrc.js b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.eslintrc.js similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.eslintrc.js rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.eslintrc.js diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.github/workflows/build.yml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.github/workflows/build.yml similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.github/workflows/build.yml rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.github/workflows/build.yml diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.gitignore b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.gitignore similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.gitignore rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/.gitignore diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/README.md b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/README.md similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/README.md rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/README.md diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/babel.config.js b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/babel.config.js similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/babel.config.js rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/babel.config.js diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/catalog-info.yaml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/catalog-info.yaml similarity index 51% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/catalog-info.yaml rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/catalog-info.yaml index 6197888f36..4e23c5ee91 100644 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/catalog-info.yaml +++ b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/catalog-info.yaml @@ -4,8 +4,8 @@ metadata: name: {{cookiecutter.component_id | jsonify}} description: {{cookiecutter.description | jsonify}} annotations: - github.com/project-slug: {{cookiecutter.destination.git.owner + "/" + cookiecutter.destination.git.name}} - backstage.io/techdocs-ref: url:{{cookiecutter.storePath}} + github.com/project-slug: {{cookiecutter.destination.owner + "/" + cookiecutter.destination.repo}} + backstage.io/techdocs-ref: url:{{cookiecutter.destination.host + "/" + cookiecutter.destination.owner + "/" + cookiecutter.destination.repo}} spec: type: website lifecycle: experimental diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/docs/index.md b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/docs/index.md similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/docs/index.md rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/docs/index.md diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/jest.config.js b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/jest.config.js similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/jest.config.js rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/jest.config.js diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/mkdocs.yml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/mkdocs.yml similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/mkdocs.yml rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/mkdocs.yml diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/next-env.d.ts b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/next-env.d.ts similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/next-env.d.ts rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/next-env.d.ts diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/next.config.js b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/next.config.js similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/next.config.js rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/next.config.js diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/package.json b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/package.json similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/package.json rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/package.json diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/prettier.config.js b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/prettier.config.js similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/prettier.config.js rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/prettier.config.js diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/public/static/fonts.css b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/public/static/fonts.css similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/public/static/fonts.css rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/public/static/fonts.css diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/__tests__/index.test.tsx b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/__tests__/index.test.tsx similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/__tests__/index.test.tsx rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/__tests__/index.test.tsx diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/components/Header.tsx b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/components/Header.tsx similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/components/Header.tsx rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/components/Header.tsx diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/_app.tsx b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/_app.tsx similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/_app.tsx rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/_app.tsx diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/_document.tsx b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/_document.tsx similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/_document.tsx rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/_document.tsx diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/api/ping.ts b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/api/ping.ts similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/api/ping.ts rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/api/ping.ts diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/index.tsx b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/index.tsx similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/src/pages/index.tsx rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/src/pages/index.tsx diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/tsconfig.json b/plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/tsconfig.json similarity index 100% rename from plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/tsconfig.json rename to plugins/scaffolder-backend/sample-templates/react-ssr-template/skeleton/tsconfig.json diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml index a667e6e6b6..49802a9d62 100644 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml @@ -1,4 +1,4 @@ -apiVersion: backstage.io/v1alpha1 +apiVersion: backstage.io/v1beta2 kind: Template metadata: name: react-ssr-template @@ -9,19 +9,69 @@ metadata: - react spec: owner: web@example.com - templater: cookiecutter type: website - path: '.' - schema: - required: - - component_id - - description - properties: - component_id: - title: Name - type: string - description: Unique name of the component - description: - title: Description - type: string - description: Help others understand what this website is for. + parameters: + - title: Provide some simple information + required: + - component_id + - owner + properties: + component_id: + title: Name + type: string + description: Unique name of the component + description: + title: Description + type: string + description: Help others understand what this website is for. + owner: + title: Owner + type: string + description: Owner of the component + ui:field: OwnerPicker + ui:options: + allowedKinds: + - Group + - title: Choose a location + required: + - repoUrl + properties: + repoUrl: + title: Repository Location + type: string + ui:field: RepoUrlPicker + ui:options: + allowedHosts: + - github.com + steps: + - id: template + name: Fetch Skeleton + Template + action: fetch:cookiecutter + input: + url: ./skeleton + copyWithoutRender: + - .github/workflows/* + values: + component_id: '{{ parameters.component_id }}' + description: '{{ parameters.description }}' + destination: '{{ parseRepoUrl parameters.repoUrl }}' + owner: '{{ parameters.owner }}' + + - id: publish + name: Publish + action: publish:github + input: + allowedHosts: ['github.com'] + description: 'This is {{ parameters.component_id }}' + repoUrl: '{{ parameters.repoUrl }}' + + - id: register + name: Register + action: catalog:register + input: + repoContentsUrl: '{{ steps.publish.output.repoContentsUrl }}' + catalogInfoPath: '/catalog-info.yaml' + + output: + remoteUrl: '{{ steps.publish.output.remoteUrl }}' + entityRef: '{{ steps.register.output.entityRef }}' diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.nvmrc b/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.nvmrc deleted file mode 100644 index b009dfb9d9..0000000000 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -lts/*