@@ -7,7 +7,7 @@ import * as pkg from 'empathic/package';
7
7
import * as p from '@clack/prompts' ;
8
8
import { Command } from 'commander' ;
9
9
import {
10
- officialAddons ,
10
+ officialAddons as _officialAddons ,
11
11
getAddonDetails ,
12
12
communityAddonIds ,
13
13
getCommunityAddon
@@ -28,6 +28,7 @@ import {
28
28
import { verifyCleanWorkingDirectory , verifyUnsupportedAddons } from './verifiers.ts' ;
29
29
import { type AddonMap , applyAddons , setupAddons } from '../../lib/install.ts' ;
30
30
31
+ const officialAddons = Object . values ( _officialAddons ) ;
31
32
const aliases = officialAddons . map ( ( c ) => c . alias ) . filter ( ( v ) => v !== undefined ) ;
32
33
const addonOptions = getAddonOptionFlags ( ) ;
33
34
const communityDetails : AddonWithoutExplicitArgs [ ] = [ ] ;
@@ -404,7 +405,7 @@ export async function runAddCommand(
404
405
}
405
406
406
407
for ( const id of selected ) {
407
- const addon = officialAddons . find ( ( addon ) => addon . id === id ) ! ;
408
+ const addon = getAddonDetails ( id ) ;
408
409
selectedAddons . push ( { type : 'official' , addon } ) ;
409
410
}
410
411
}
@@ -422,7 +423,7 @@ export async function runAddCommand(
422
423
423
424
for ( const depId of missingDependencies ) {
424
425
// TODO: this will have to be adjusted when we work on community add-ons
425
- const dependency = officialAddons . find ( ( a ) => a . id === depId ) ;
426
+ const dependency = getAddonDetails ( depId ) ;
426
427
if ( ! dependency ) throw new Error ( `'${ addon . id } ' depends on an invalid add-on: '${ depId } '` ) ;
427
428
428
429
// prompt to install the dependent
0 commit comments