99import { logging , schema } from '@angular-devkit/core' ;
1010import { readFileSync } from 'node:fs' ;
1111import * as path from 'node:path' ;
12- import type {
13- ArgumentsCamelCase ,
14- Argv ,
15- CamelCaseKey ,
16- CommandModule as YargsCommandModule ,
17- } from 'yargs' ;
12+ import type { ArgumentsCamelCase , Argv , CommandModule as YargsCommandModule } from 'yargs' ;
1813import { Parser as yargsParser } from 'yargs/helpers' ;
1914import { getAnalyticsUserId } from '../analytics/analytics' ;
2015import { AnalyticsCollector } from '../analytics/analytics-collector' ;
@@ -23,42 +18,11 @@ import { considerSettingUpAutocompletion } from '../utilities/completion';
2318import { AngularWorkspace } from '../utilities/config' ;
2419import { memoize } from '../utilities/memoize' ;
2520import { PackageManagerUtils } from '../utilities/package-manager' ;
21+ import { CommandContext , CommandScope , Options , OtherOptions } from './definitions' ;
2622import { Option , addSchemaOptionsToCommand } from './utilities/json-schema' ;
2723
28- export type Options < T > = { [ key in keyof T as CamelCaseKey < key > ] : T [ key ] } ;
29-
30- export enum CommandScope {
31- /** Command can only run inside an Angular workspace. */
32- In ,
33-
34- /** Command can only run outside an Angular workspace. */
35- Out ,
36-
37- /** Command can run inside and outside an Angular workspace. */
38- Both ,
39- }
40-
41- export interface CommandContext {
42- currentDirectory : string ;
43- root : string ;
44- workspace ?: AngularWorkspace ;
45- globalConfiguration : AngularWorkspace ;
46- logger : logging . Logger ;
47- packageManager : PackageManagerUtils ;
48- yargsInstance : Argv < { } > ;
49-
50- /** Arguments parsed in free-from without parser configuration. */
51- args : {
52- positional : string [ ] ;
53- options : {
54- help : boolean ;
55- jsonHelp : boolean ;
56- getYargsCompletions : boolean ;
57- } & Record < string , unknown > ;
58- } ;
59- }
60-
61- export type OtherOptions = Record < string , unknown > ;
24+ export { CommandScope } ;
25+ export type { CommandContext , Options , OtherOptions } ;
6226
6327export interface CommandModuleImplementation < T extends { } = { } > extends Omit <
6428 YargsCommandModule < { } , T > ,
0 commit comments