@@ -4,6 +4,7 @@ import * as v from 'valibot';
4
4
import { exec } from 'tinyexec' ;
5
5
import { Command , Option } from 'commander' ;
6
6
import * as p from '@svelte-cli/clack-prompts' ;
7
+ import * as pkg from 'empathic/package' ;
7
8
import pc from 'picocolors' ;
8
9
import {
9
10
adderCategories ,
@@ -16,7 +17,6 @@ import {
16
17
import {
17
18
createOrUpdateFiles ,
18
19
createWorkspace ,
19
- findUp ,
20
20
installPackages ,
21
21
TESTING
22
22
} from '@svelte-cli/core/internal' ;
@@ -50,7 +50,7 @@ const addersOptions = getAdderOptionFlags();
50
50
const communityDetails : AdderWithoutExplicitArgs [ ] = [ ] ;
51
51
52
52
// infers the workspace cwd if a `package.json` resides in a parent directory
53
- const defaultPkgPath = findUp ( process . cwd ( ) , 'package.json' ) ;
53
+ const defaultPkgPath = pkg . up ( ) ;
54
54
const defaultCwd = defaultPkgPath ? path . dirname ( defaultPkgPath ) : undefined ;
55
55
56
56
export const add = new Command ( 'add' )
@@ -460,8 +460,8 @@ export async function runAddCommand(options: Options, adders: string[]): Promise
460
460
}
461
461
462
462
// install dependencies
463
- let depsStatus ;
464
- if ( options . install ) {
463
+ let depsStatus : 'installed' | 'skipped' | undefined ;
464
+ if ( options . install && selectedAdders . length > 0 ) {
465
465
depsStatus = await common . suggestInstallingDependencies ( options . cwd ) ;
466
466
}
467
467
@@ -635,7 +635,7 @@ function getOptionChoices(details: AdderWithoutExplicitArgs) {
635
635
const groups : Record < string , string [ ] > = { } ;
636
636
const options : Record < string , unknown > = { } ;
637
637
for ( const [ id , question ] of Object . entries ( details . config . options ) ) {
638
- let values = [ ] ;
638
+ let values : string [ ] = [ ] ;
639
639
const applyDefault = question . condition ?.( options ) !== false ;
640
640
if ( question . type === 'boolean' ) {
641
641
values = [ id , `no-${ id } ` ] ;
0 commit comments