11import { Completion } from '../src/index.js' ;
22
3- export function setupCompletionForPackageManager ( packageManager : string , completion : Completion ) {
4- if ( packageManager === 'pnpm' ) {
5- setupPnpmCompletions ( completion ) ;
6- } else if ( packageManager === 'npm' ) {
7- setupNpmCompletions ( completion ) ;
8- } else if ( packageManager === 'yarn' ) {
9- setupYarnCompletions ( completion ) ;
10- } else if ( packageManager === 'bun' ) {
11- setupBunCompletions ( completion ) ;
12- }
3+ export function setupCompletionForPackageManager (
4+ packageManager : string ,
5+ completion : Completion
6+ ) {
7+ if ( packageManager === 'pnpm' ) {
8+ setupPnpmCompletions ( completion ) ;
9+ } else if ( packageManager === 'npm' ) {
10+ setupNpmCompletions ( completion ) ;
11+ } else if ( packageManager === 'yarn' ) {
12+ setupYarnCompletions ( completion ) ;
13+ } else if ( packageManager === 'bun' ) {
14+ setupBunCompletions ( completion ) ;
15+ }
1316}
1417
1518export function setupPnpmCompletions ( completion : Completion ) {
16- completion . addCommand ( 'add' , 'Install a package' , [ ] , async ( ) => [ ] ) ;
17- completion . addCommand ( 'remove' , 'Remove a package' , [ ] , async ( ) => [ ] ) ;
18- completion . addCommand ( 'install' , 'Install all dependencies' , [ ] , async ( ) => [ ] ) ;
19- completion . addCommand ( 'update' , 'Update packages' , [ ] , async ( ) => [ ] ) ;
20- completion . addCommand ( 'exec' , 'Execute a command' , [ ] , async ( ) => [ ] ) ;
21- completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
22- completion . addCommand ( 'publish' , 'Publish package' , [ ] , async ( ) => [ ] ) ;
23- completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
24- completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
19+ completion . addCommand ( 'add' , 'Install a package' , [ ] , async ( ) => [ ] ) ;
20+ completion . addCommand ( 'remove' , 'Remove a package' , [ ] , async ( ) => [ ] ) ;
21+ completion . addCommand (
22+ 'install' ,
23+ 'Install all dependencies' ,
24+ [ ] ,
25+ async ( ) => [ ]
26+ ) ;
27+ completion . addCommand ( 'update' , 'Update packages' , [ ] , async ( ) => [ ] ) ;
28+ completion . addCommand ( 'exec' , 'Execute a command' , [ ] , async ( ) => [ ] ) ;
29+ completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
30+ completion . addCommand ( 'publish' , 'Publish package' , [ ] , async ( ) => [ ] ) ;
31+ completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
32+ completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
2533}
2634
2735export function setupNpmCompletions ( completion : Completion ) {
28- completion . addCommand ( 'install' , 'Install a package' , [ ] , async ( ) => [ ] ) ;
29- completion . addCommand ( 'uninstall' , 'Uninstall a package' , [ ] , async ( ) => [ ] ) ;
30- completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
31- completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
32- completion . addCommand ( 'publish' , 'Publish package' , [ ] , async ( ) => [ ] ) ;
33- completion . addCommand ( 'update' , 'Update packages' , [ ] , async ( ) => [ ] ) ;
34- completion . addCommand ( 'start' , 'Start the application' , [ ] , async ( ) => [ ] ) ;
35- completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
36+ completion . addCommand ( 'install' , 'Install a package' , [ ] , async ( ) => [ ] ) ;
37+ completion . addCommand ( 'uninstall' , 'Uninstall a package' , [ ] , async ( ) => [ ] ) ;
38+ completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
39+ completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
40+ completion . addCommand ( 'publish' , 'Publish package' , [ ] , async ( ) => [ ] ) ;
41+ completion . addCommand ( 'update' , 'Update packages' , [ ] , async ( ) => [ ] ) ;
42+ completion . addCommand ( 'start' , 'Start the application' , [ ] , async ( ) => [ ] ) ;
43+ completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
3644}
3745
3846export function setupYarnCompletions ( completion : Completion ) {
39- completion . addCommand ( 'add' , 'Add a package' , [ ] , async ( ) => [ ] ) ;
40- completion . addCommand ( 'remove' , 'Remove a package' , [ ] , async ( ) => [ ] ) ;
41- completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
42- completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
43- completion . addCommand ( 'publish' , 'Publish package' , [ ] , async ( ) => [ ] ) ;
44- completion . addCommand ( 'install' , 'Install dependencies' , [ ] , async ( ) => [ ] ) ;
45- completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
47+ completion . addCommand ( 'add' , 'Add a package' , [ ] , async ( ) => [ ] ) ;
48+ completion . addCommand ( 'remove' , 'Remove a package' , [ ] , async ( ) => [ ] ) ;
49+ completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
50+ completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
51+ completion . addCommand ( 'publish' , 'Publish package' , [ ] , async ( ) => [ ] ) ;
52+ completion . addCommand ( 'install' , 'Install dependencies' , [ ] , async ( ) => [ ] ) ;
53+ completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
4654}
4755
4856export function setupBunCompletions ( completion : Completion ) {
49- completion . addCommand ( 'add' , 'Add a package' , [ ] , async ( ) => [ ] ) ;
50- completion . addCommand ( 'remove' , 'Remove a package' , [ ] , async ( ) => [ ] ) ;
51- completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
52- completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
53- completion . addCommand ( 'install' , 'Install dependencies' , [ ] , async ( ) => [ ] ) ;
54- completion . addCommand ( 'update' , 'Update packages' , [ ] , async ( ) => [ ] ) ;
55- completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
56- }
57+ completion . addCommand ( 'add' , 'Add a package' , [ ] , async ( ) => [ ] ) ;
58+ completion . addCommand ( 'remove' , 'Remove a package' , [ ] , async ( ) => [ ] ) ;
59+ completion . addCommand ( 'run' , 'Run a script' , [ ] , async ( ) => [ ] ) ;
60+ completion . addCommand ( 'test' , 'Run tests' , [ ] , async ( ) => [ ] ) ;
61+ completion . addCommand ( 'install' , 'Install dependencies' , [ ] , async ( ) => [ ] ) ;
62+ completion . addCommand ( 'update' , 'Update packages' , [ ] , async ( ) => [ ] ) ;
63+ completion . addCommand ( 'build' , 'Build project' , [ ] , async ( ) => [ ] ) ;
64+ }
0 commit comments