From 9fd9004d0fa8982fa94966fb75f1654dd717e691 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 11 Feb 2025 11:47:33 +0100 Subject: [PATCH] cli/new: rename template.yaml -> portable-template.yaml Signed-off-by: Patrik Oldsberg --- docs/tooling/cli/04-templates.md | 10 +++++----- .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 .../{template.yaml => portable-template.yaml} | 0 10 files changed, 5 insertions(+), 5 deletions(-) rename packages/cli/templates/backend-plugin-module/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/backend-plugin/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/frontend-plugin/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/node-library/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/plugin-common-library/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/plugin-node-library/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/plugin-web-library/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/scaffolder-backend-module/{template.yaml => portable-template.yaml} (100%) rename packages/cli/templates/web-library/{template.yaml => portable-template.yaml} (100%) diff --git a/docs/tooling/cli/04-templates.md b/docs/tooling/cli/04-templates.md index c32fcd8278..5aa5fc30c4 100644 --- a/docs/tooling/cli/04-templates.md +++ b/docs/tooling/cli/04-templates.md @@ -71,7 +71,7 @@ Custom templates can be installed from local directories. To install a template } ``` -Each entry in the `templates` array should be relative path that points to a directory containing a `template.yaml` file. If the path starts with `./` it will be use as is, otherwise it will be resolved as a module within `node_modules`. +Each entry in the `templates` array should be relative path that points to a directory containing a `portable-template.yaml` file. If the path starts with `./` it will be use as is, otherwise it will be resolved as a module within `node_modules`. When defining the `templates` array it will override the default set of templates. If you want to keep using and of the build-in templates in the Backstage CLI you can reference them directly within the CLI package. This following is the full list of built-in templates: @@ -100,11 +100,11 @@ When defining the `templates` array it will override the default set of template ## Creating your own CLI templates -Each template lives in its own directory and must have a `template.yaml` file that describes the template. The template directory can also contain any files that should be templated or copied to the generated package. +Each template lives in its own directory and must have a `portable-template.yaml` file that describes the template. The template directory can also contain any files that should be templated or copied to the generated package. -Start by creating `template.yaml` in a new directory somewhere in your project, in this example we're using `./templates/custom-plugin/template.yaml`: +Start by creating `portable-template.yaml` in a new directory somewhere in your project, in this example we're using `./templates/custom-plugin/portable-template.yaml`: -```yaml title="in templates/custom-plugin/template.yaml" +```yaml title="in templates/custom-plugin/portable-template.yaml" name: custom-plugin role: frontend-plugin description: Description of my CLI template # optional @@ -119,7 +119,7 @@ The following properties are supported: - `description` - A description of the type of package that this template produces. - `values` - A map of additional values that will be present during templating. The values are themselves templated and can reference other values. If the key matches any of the user prompts, such as `pluginId`, the value will be used directly instead of prompting the user. -Next, add any other files you want to be part of the template to the same directory. All files will be copied as is, except any files with a `.hbs` extension. They will be treated as [Handlebars](https://handlebarsjs.com/) templates and will be rendered with the values from the `template.yaml` file as well as additional prompts such as `pluginId`. For example, you could create a `src/index.ts` file with the following content: +Next, add any other files you want to be part of the template to the same directory. All files will be copied as is, except any files with a `.hbs` extension. They will be treated as [Handlebars](https://handlebarsjs.com/) templates and will be rendered with the values from the `portable-template.yaml` file as well as additional prompts such as `pluginId`. For example, you could create a `src/index.ts` file with the following content: ```typescript title="in templates/custom-plugin/src/index.ts.hbs" export function getPluginId() { diff --git a/packages/cli/templates/backend-plugin-module/template.yaml b/packages/cli/templates/backend-plugin-module/portable-template.yaml similarity index 100% rename from packages/cli/templates/backend-plugin-module/template.yaml rename to packages/cli/templates/backend-plugin-module/portable-template.yaml diff --git a/packages/cli/templates/backend-plugin/template.yaml b/packages/cli/templates/backend-plugin/portable-template.yaml similarity index 100% rename from packages/cli/templates/backend-plugin/template.yaml rename to packages/cli/templates/backend-plugin/portable-template.yaml diff --git a/packages/cli/templates/frontend-plugin/template.yaml b/packages/cli/templates/frontend-plugin/portable-template.yaml similarity index 100% rename from packages/cli/templates/frontend-plugin/template.yaml rename to packages/cli/templates/frontend-plugin/portable-template.yaml diff --git a/packages/cli/templates/node-library/template.yaml b/packages/cli/templates/node-library/portable-template.yaml similarity index 100% rename from packages/cli/templates/node-library/template.yaml rename to packages/cli/templates/node-library/portable-template.yaml diff --git a/packages/cli/templates/plugin-common-library/template.yaml b/packages/cli/templates/plugin-common-library/portable-template.yaml similarity index 100% rename from packages/cli/templates/plugin-common-library/template.yaml rename to packages/cli/templates/plugin-common-library/portable-template.yaml diff --git a/packages/cli/templates/plugin-node-library/template.yaml b/packages/cli/templates/plugin-node-library/portable-template.yaml similarity index 100% rename from packages/cli/templates/plugin-node-library/template.yaml rename to packages/cli/templates/plugin-node-library/portable-template.yaml diff --git a/packages/cli/templates/plugin-web-library/template.yaml b/packages/cli/templates/plugin-web-library/portable-template.yaml similarity index 100% rename from packages/cli/templates/plugin-web-library/template.yaml rename to packages/cli/templates/plugin-web-library/portable-template.yaml diff --git a/packages/cli/templates/scaffolder-backend-module/template.yaml b/packages/cli/templates/scaffolder-backend-module/portable-template.yaml similarity index 100% rename from packages/cli/templates/scaffolder-backend-module/template.yaml rename to packages/cli/templates/scaffolder-backend-module/portable-template.yaml diff --git a/packages/cli/templates/web-library/template.yaml b/packages/cli/templates/web-library/portable-template.yaml similarity index 100% rename from packages/cli/templates/web-library/template.yaml rename to packages/cli/templates/web-library/portable-template.yaml