plop: TypeScript - Missing type in ActionType
Hello,
I’m trying to use plop with TypeScript, and I’m getting the following error.
Type '{ type: string; path: string; templateFile: string; }' is not assignable to type 'ActionType'.
Type '{ type: string; path: string; templateFile: string; }' is missing the following properties from type 'AppendActionConfig': pattern, unique, separator, template, and 3 more.ts(2322)
My plopfile.ts
import { NodePlopAPI } from "plop";
export default function(plop: NodePlopAPI) {
// controller generator
plop.setGenerator("controller", {
description: "application controller logic",
prompts: [
{
type: "input",
name: "name",
message: "controller name please"
}
],
actions: [
{
type: "add",
path: "src/{{name}}.js",
templateFile: "plop-templates/controller.hbs"
}
]
});
}
Image
(GUESS) Apparently the ActionType
lacks the AddActionConfig
interface:
export type ActionType =
| ActionConfig
| AddManyActionConfig
| ModifyActionConfig
| AppendActionConfig
| CustomActionFunction;
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 20 (17 by maintainers)
Ok then, so that’s what I will do:
AddActionConfig
in theActionType
type;I will ping you when it’s done.
Work’s rough for me right now, so I can’t write PRs. I can probably review them.