forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefinitions.ts
More file actions
47 lines (39 loc) · 1.25 KB
/
definitions.ts
File metadata and controls
47 lines (39 loc) · 1.25 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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { logging } from '@angular-devkit/core';
import type { Argv, CamelCaseKey } from 'yargs';
import { AngularWorkspace } from '../utilities/config';
import { PackageManagerUtils } from '../utilities/package-manager';
export enum CommandScope {
/** Command can only run inside an Angular workspace. */
In,
/** Command can only run outside an Angular workspace. */
Out,
/** Command can run inside and outside an Angular workspace. */
Both,
}
export interface CommandContext {
currentDirectory: string;
root: string;
workspace?: AngularWorkspace;
globalConfiguration: AngularWorkspace;
logger: logging.Logger;
packageManager: PackageManagerUtils;
yargsInstance: Argv<{}>;
/** Arguments parsed in free-from without parser configuration. */
args: {
positional: string[];
options: {
help: boolean;
jsonHelp: boolean;
getYargsCompletions: boolean;
} & Record<string, unknown>;
};
}
export type Options<T> = { [key in keyof T as CamelCaseKey<key>]: T[key] };
export type OtherOptions = Record<string, unknown>;