Skip to content

Commit fcb01e2

Browse files
timdeschryverbrandonroberts
authored andcommitted
feat(schematics): add message prompts for individual schematics (#2143)
1 parent 6f40060 commit fcb01e2

File tree

7 files changed

+36
-18
lines changed

7 files changed

+36
-18
lines changed

modules/schematics/src/action/schema.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"$default": {
1111
"$source": "argv",
1212
"index": 0
13-
}
13+
},
14+
"x-prompt": "What should be the name of the action?"
1415
},
1516
"path": {
1617
"type": "string",
@@ -44,14 +45,16 @@
4445
"default": false,
4546
"description":
4647
"Specifies if api success and failure actions should be generated.",
47-
"aliases": ["a"]
48+
"aliases": ["a"],
49+
"x-prompt": "Should we generate success and failure actions?"
4850
},
4951
"creators": {
5052
"type": "boolean",
5153
"default": false,
5254
"description":
5355
"Specifies whether to use creator functions for handling actions and reducers.",
54-
"aliases": ["c"]
56+
"aliases": ["c"],
57+
"x-prompt": "Do you want to use the create function?"
5558
}
5659
},
5760
"required": []

modules/schematics/src/container/schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"$default": {
2222
"$source": "argv",
2323
"index": 0
24-
}
24+
},
25+
"x-prompt": "What should be the name of the container component?"
2526
},
2627
"inlineStyle": {
2728
"description": "Specifies if the style will be in the ts file.",

modules/schematics/src/effect/schema.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"$default": {
1111
"$source": "argv",
1212
"index": 0
13-
}
13+
},
14+
"x-prompt": "What should be the name of the Effect?"
1415
},
1516
"path": {
1617
"type": "string",
@@ -38,7 +39,8 @@
3839
"default": "",
3940
"description": "Allows specification of the declaring module.",
4041
"alias": "m",
41-
"subtype": "filepath"
42+
"subtype": "filepath",
43+
"x-prompt": "To which module (path) should the effect be registered in?"
4244
},
4345
"root": {
4446
"type": "boolean",
@@ -62,14 +64,16 @@
6264
"default": false,
6365
"description":
6466
"Specifies if effect has api success and failure actions wired up",
65-
"aliases": ["a"]
67+
"aliases": ["a"],
68+
"x-prompt": "Should we wire up success and failure actions?"
6669
},
6770
"creators": {
6871
"type": "boolean",
6972
"default": false,
7073
"description":
7174
"Specifies whether to use creator functions for handling actions, reducers, and effects.",
72-
"aliases": ["c"]
75+
"aliases": ["c"],
76+
"x-prompt": "Do you want to use the create function?"
7377
},
7478
"minimal": {
7579
"type": "boolean",

modules/schematics/src/entity/schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"$default": {
1111
"$source": "argv",
1212
"index": 0
13-
}
13+
},
14+
"x-prompt": "What should be the name of the entity?"
1415
},
1516
"path": {
1617
"type": "string",
@@ -55,7 +56,8 @@
5556
"default": false,
5657
"description":
5758
"Specifies whether to use creator functions for handling actions and reducers.",
58-
"aliases": ["c"]
59+
"aliases": ["c"],
60+
"x-prompt": "Do you want to use the create function?"
5961
}
6062
},
6163
"required": []

modules/schematics/src/feature/schema.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"$default": {
2222
"$source": "argv",
2323
"index": 0
24-
}
24+
},
25+
"x-prompt": "What should be the name of the feature?"
2526
},
2627
"flat": {
2728
"type": "boolean",
@@ -55,14 +56,16 @@
5556
"default": false,
5657
"description":
5758
"Specifies if api success and failure actions, reducer, and effects should be generated as part of this feature.",
58-
"aliases": ["a"]
59+
"aliases": ["a"],
60+
"x-prompt": "Should we generate and wire success and failure actions?"
5961
},
6062
"creators": {
6163
"type": "boolean",
6264
"default": false,
6365
"description":
6466
"Specifies if the actions, reducers, and effects should be created using creator functions",
65-
"aliases": ["c"]
67+
"aliases": ["c"],
68+
"x-prompt": "Do you want to use the create functions?"
6669
}
6770
},
6871
"required": []

modules/schematics/src/reducer/schema.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"$default": {
1111
"$source": "argv",
1212
"index": 0
13-
}
13+
},
14+
"x-prompt": "What should be the name of the reducer?"
1415
},
1516
"path": {
1617
"type": "string",
@@ -59,14 +60,16 @@
5960
"default": false,
6061
"description":
6162
"Specifies if api success and failure actions should be added to the reducer",
62-
"aliases": ["a"]
63+
"aliases": ["a"],
64+
"x-prompt": "Should we add success and failure actions to the reducer?"
6365
},
6466
"creators": {
6567
"type": "boolean",
6668
"default": false,
6769
"description":
6870
"Specifies whether to use creator functions for handling actions and reducers.",
69-
"aliases": ["c"]
71+
"aliases": ["c"],
72+
"x-prompt": "Do you want to use the create function?"
7073
}
7174
},
7275
"required": []

modules/schematics/src/store/schema.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"$default": {
1111
"$source": "argv",
1212
"index": 0
13-
}
13+
},
14+
"x-prompt": "What should be the name of the state?"
1415
},
1516
"path": {
1617
"type": "string",
@@ -38,7 +39,8 @@
3839
"default": "",
3940
"description": "Allows specification of the declaring module.",
4041
"alias": "m",
41-
"subtype": "filepath"
42+
"subtype": "filepath",
43+
"x-prompt": "To which module (path) should the state be registered in?"
4244
},
4345
"statePath": {
4446
"type": "string",

0 commit comments

Comments
 (0)