File tree 3 files changed +6
-4
lines changed
libs/plugin/src/generators
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export async function addSobaGenerator(tree: Tree) {
25
25
logger . info ( 'Adding angular-three-soba...' ) ;
26
26
addMetadataJson ( tree , 'angular-three-soba/metadata.json' ) ;
27
27
28
- const { peerDependencies } = await prompt < { peerDependencies : string [ ] [ ] } > ( {
28
+ const { peerDependencies } = await prompt < { peerDependencies : string [ ] } > ( {
29
29
type : 'multiselect' ,
30
30
name : 'peerDependencies' ,
31
31
message : `To know which peer dependencies we need to add, please select the secondary entry points you are planning to use:` ,
@@ -49,11 +49,15 @@ export async function addSobaGenerator(tree: Tree) {
49
49
message : 'I am not sure. Let me add all the peer dependencies.' ,
50
50
} ,
51
51
] ,
52
+ // @ts -expect-error - result is typed for single select but we're using multi select
53
+ result ( values ) {
54
+ const mapped = this . map ( values ) ;
55
+ return ( values as unknown as string [ ] ) . flatMap ( ( value ) => mapped [ value ] ) ;
56
+ } ,
52
57
} ) ;
53
58
54
59
// flatten, dedupe peerDependencies, add to packagesToAdd
55
60
peerDependencies
56
- . flat ( )
57
61
. filter ( ( item , index , array ) => array . indexOf ( item ) === index )
58
62
. forEach ( ( item ) => {
59
63
if ( ! packagesToAdd . includes ( item ) ) {
Original file line number Diff line number Diff line change 1
1
{
2
- "$schema" : " https://json-schema.org/schema" ,
3
2
"$id" : " AddSoba" ,
4
3
"title" : " Add Soba"
5
4
}
Original file line number Diff line number Diff line change 1
1
{
2
- "$schema" : " http://json-schema.org/schema" ,
3
2
"cli" : " nx" ,
4
3
"$id" : " Init" ,
5
4
"title" : " Init Angular Three" ,
You can’t perform that action at this time.
0 commit comments