Skip to content

Commit b69ab9d

Browse files
committed
Add config option for custom name choices
1 parent 7a00374 commit b69ab9d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/atomicComponent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const atomicComponent = (
99
plop: NodePlopAPI
1010
) => {
1111
const defaultConfig: GeneratorConfig = {
12+
choices: ["Atoms", "Molecules", "Organisms", "Templates", "Pages"],
1213
createIndex: true,
1314
functional: true,
1415
basePath: "src/ui/components",
@@ -32,7 +33,7 @@ const atomicComponent = (
3233
type: "list",
3334
name: "type",
3435
message: "component type",
35-
choices: ["Atom", "Molecule", "Organism", "Template", "Page"],
36+
choices: fullConfig.choices,
3637
});
3738

3839
prompts.push({

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import atomicComponent from "./atomicComponent";
44
import { FileNameFormatters } from "./types";
55

66
export interface GeneratorConfig {
7+
choices: string[];
78
createIndex: boolean;
89
functional: boolean;
910
basePath: string;

0 commit comments

Comments
 (0)