chore: migrate to new actions format

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-06-04 08:27:47 +02:00
parent 6c6fb4a73b
commit b392a34833
3 changed files with 27 additions and 32 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-yeoman': patch
---
Migrate to new actions format
@@ -4,18 +4,19 @@
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { JsonObject } from '@backstage/types';
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
// @public
export function createRunYeomanAction(): TemplateAction<
{
namespace: string;
args?: string[];
options?: JsonObject;
args?: string[] | undefined;
options?: Record<string, any> | undefined;
},
JsonObject,
'v1'
{
[x: string]: any;
},
'v2'
>;
// @public
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/types';
import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
import { yeomanRun } from './yeomanRun';
import { examples } from './yeoman.examples';
@@ -29,38 +28,28 @@ import { examples } from './yeoman.examples';
* @public
*/
export function createRunYeomanAction() {
return createTemplateAction<{
namespace: string;
args?: string[];
options?: JsonObject;
}>({
return createTemplateAction({
id: 'run:yeoman',
description: 'Runs Yeoman on an installed Yeoman generator',
examples,
schema: {
input: {
type: 'object',
required: ['namespace'],
properties: {
namespace: {
title: 'Generator Namespace',
namespace: z =>
z.string({
description: 'Yeoman generator namespace, e.g: node:app',
type: 'string',
},
args: {
title: 'Generator Arguments',
description: 'Arguments to pass on to Yeoman for templating',
type: 'array',
items: {
type: 'string',
},
},
options: {
title: 'Generator Options',
description: 'Options to pass on to Yeoman for templating',
type: 'object',
},
},
}),
args: z =>
z
.array(z.string(), {
description: 'Arguments to pass on to Yeoman for templating',
})
.optional(),
options: z =>
z
.record(z.any(), {
description: 'Options to pass on to Yeoman for templating',
})
.optional(),
},
},
supportsDryRun: true,