Adds a number of examples for builtin functions

This patch also proposes:
- changing the pattern by which the examples are imported
- adds tests for the examples

Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
Brian Fletcher
2023-07-28 11:05:15 +01:00
parent 32f539dce2
commit 0b1d775be0
28 changed files with 1210 additions and 154 deletions
@@ -20,6 +20,12 @@ import { Schema } from 'jsonschema';
import zodToJsonSchema from 'zod-to-json-schema';
import { JsonObject } from '@backstage/types';
/** @public */
export type TemplateExample = {
description: string;
example: string;
};
/** @public */
export type TemplateActionOptions<
TActionInput extends JsonObject = {},
@@ -29,7 +35,7 @@ export type TemplateActionOptions<
> = {
id: string;
description?: string;
examples?: { description: string; example: string }[];
examples?: TemplateExample[];
supportsDryRun?: boolean;
schema?: {
input?: TInputSchema;
@@ -17,5 +17,6 @@
export {
createTemplateAction,
type TemplateActionOptions,
type TemplateExample,
} from './createTemplateAction';
export { type ActionContext, type TemplateAction } from './types';