-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.ts
More file actions
executable file
·63 lines (60 loc) · 1.84 KB
/
index.ts
File metadata and controls
executable file
·63 lines (60 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/env node
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { coverageSetupBinding } from '@code-pushup/coverage-plugin';
import { eslintSetupBinding } from '@code-pushup/eslint-plugin';
import { jsPackagesSetupBinding } from '@code-pushup/js-packages-plugin';
import { typescriptSetupBinding } from '@code-pushup/typescript-plugin';
import { parsePluginSlugs, validatePluginSlugs } from './lib/setup/plugins.js';
import {
CI_PROVIDERS,
CONFIG_FILE_FORMATS,
type PluginSetupBinding,
SETUP_MODES,
} from './lib/setup/types.js';
import { runSetupWizard } from './lib/setup/wizard.js';
// TODO: create, import and pass remaining plugin bindings (lighthouse, jsdocs, axe)
const bindings: PluginSetupBinding[] = [
eslintSetupBinding,
coverageSetupBinding,
jsPackagesSetupBinding,
typescriptSetupBinding,
];
const argv = await yargs(hideBin(process.argv))
.option('dry-run', {
type: 'boolean',
default: false,
describe: 'Preview changes without writing files',
})
.option('yes', {
alias: 'y',
type: 'boolean',
default: false,
describe: 'Skip prompts and use defaults',
})
.option('config-format', {
type: 'string',
choices: CONFIG_FILE_FORMATS,
describe: 'Config file format (default: auto-detected from project)',
})
.option('plugins', {
type: 'string',
describe: 'Comma-separated plugin slugs to include (e.g. eslint,coverage)',
coerce: parsePluginSlugs,
})
.option('mode', {
type: 'string',
choices: SETUP_MODES,
describe: 'Setup mode (default: auto-detected from project)',
})
.option('ci', {
type: 'string',
choices: CI_PROVIDERS,
describe: 'CI/CD integration (github, gitlab, or none)',
})
.check(parsed => {
validatePluginSlugs(bindings, parsed.plugins);
return true;
})
.parse();
await runSetupWizard(bindings, argv);