11#! /usr/bin/env node
2- import yargs from 'yargs' ;
32import { hideBin } from 'yargs/helpers' ;
43import { axeSetupBinding } from '@code-pushup/axe-plugin' ;
54import { coverageSetupBinding } from '@code-pushup/coverage-plugin' ;
@@ -8,13 +7,8 @@ import { jsPackagesSetupBinding } from '@code-pushup/js-packages-plugin';
87import { jsDocsSetupBinding } from '@code-pushup/jsdocs-plugin' ;
98import { lighthouseSetupBinding } from '@code-pushup/lighthouse-plugin' ;
109import { typescriptSetupBinding } from '@code-pushup/typescript-plugin' ;
11- import { parsePluginSlugs , validatePluginSlugs } from './lib/setup/plugins.js' ;
12- import {
13- CI_PROVIDERS ,
14- CONFIG_FILE_FORMATS ,
15- type PluginSetupBinding ,
16- SETUP_MODES ,
17- } from './lib/setup/types.js' ;
10+ import { yargsCli } from './lib/setup/cli-args.js' ;
11+ import type { PluginSetupBinding } from './lib/setup/types.js' ;
1812import { runSetupWizard } from './lib/setup/wizard.js' ;
1913
2014const bindings : PluginSetupBinding [ ] = [
@@ -27,42 +21,6 @@ const bindings: PluginSetupBinding[] = [
2721 jsDocsSetupBinding ,
2822] ;
2923
30- const argv = await yargs ( hideBin ( process . argv ) )
31- . option ( 'dry-run' , {
32- type : 'boolean' ,
33- default : false ,
34- describe : 'Preview changes without writing files' ,
35- } )
36- . option ( 'yes' , {
37- alias : 'y' ,
38- type : 'boolean' ,
39- default : false ,
40- describe : 'Skip prompts and use defaults' ,
41- } )
42- . option ( 'config-format' , {
43- type : 'string' ,
44- choices : CONFIG_FILE_FORMATS ,
45- describe : 'Config file format (default: auto-detected from project)' ,
46- } )
47- . option ( 'plugins' , {
48- type : 'string' ,
49- describe : 'Comma-separated plugin slugs to include (e.g. eslint,coverage)' ,
50- coerce : parsePluginSlugs ,
51- } )
52- . option ( 'mode' , {
53- type : 'string' ,
54- choices : SETUP_MODES ,
55- describe : 'Setup mode (default: auto-detected from project)' ,
56- } )
57- . option ( 'ci' , {
58- type : 'string' ,
59- choices : CI_PROVIDERS ,
60- describe : 'CI/CD integration (github, gitlab, or none)' ,
61- } )
62- . check ( parsed => {
63- validatePluginSlugs ( bindings , parsed . plugins ) ;
64- return true ;
65- } )
66- . parse ( ) ;
24+ const argv = await yargsCli ( bindings ) . parse ( hideBin ( process . argv ) ) ;
6725
6826await runSetupWizard ( bindings , argv ) ;
0 commit comments