1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | export declare enum ProjectType {
|
---|
9 | Application = "application",
|
---|
10 | Library = "library"
|
---|
11 | }
|
---|
12 | export declare enum Builders {
|
---|
13 | AppShell = "@angular-devkit/build-angular:app-shell",
|
---|
14 | Server = "@angular-devkit/build-angular:server",
|
---|
15 | Browser = "@angular-devkit/build-angular:browser",
|
---|
16 | Karma = "@angular-devkit/build-angular:karma",
|
---|
17 | TsLint = "@angular-devkit/build-angular:tslint",
|
---|
18 | DeprecatedNgPackagr = "@angular-devkit/build-ng-packagr:build",
|
---|
19 | NgPackagr = "@angular-devkit/build-angular:ng-packagr",
|
---|
20 | DevServer = "@angular-devkit/build-angular:dev-server",
|
---|
21 | ExtractI18n = "@angular-devkit/build-angular:extract-i18n",
|
---|
22 | Protractor = "@angular-devkit/build-angular:protractor"
|
---|
23 | }
|
---|
24 | export interface FileReplacements {
|
---|
25 | replace: string;
|
---|
26 | with: string;
|
---|
27 | }
|
---|
28 | export interface BrowserBuilderBaseOptions {
|
---|
29 | main: string;
|
---|
30 | tsConfig: string;
|
---|
31 | fileReplacements?: FileReplacements[];
|
---|
32 | outputPath?: string;
|
---|
33 | index?: string;
|
---|
34 | polyfills: string;
|
---|
35 | assets?: (object | string)[];
|
---|
36 | styles?: (object | string)[];
|
---|
37 | scripts?: (object | string)[];
|
---|
38 | sourceMap?: boolean;
|
---|
39 | }
|
---|
40 | export declare type OutputHashing = 'all' | 'media' | 'none' | 'bundles';
|
---|
41 | export interface BrowserBuilderOptions extends BrowserBuilderBaseOptions {
|
---|
42 | serviceWorker?: boolean;
|
---|
43 | optimization?: boolean;
|
---|
44 | outputHashing?: OutputHashing;
|
---|
45 | resourcesOutputPath?: string;
|
---|
46 | extractCss?: boolean;
|
---|
47 | namedChunks?: boolean;
|
---|
48 | aot?: boolean;
|
---|
49 | extractLicenses?: boolean;
|
---|
50 | vendorChunk?: boolean;
|
---|
51 | buildOptimizer?: boolean;
|
---|
52 | ngswConfigPath?: string;
|
---|
53 | budgets?: {
|
---|
54 | type: string;
|
---|
55 | maximumWarning?: string;
|
---|
56 | maximumError?: string;
|
---|
57 | }[];
|
---|
58 | webWorkerTsConfig?: string;
|
---|
59 | }
|
---|
60 | export interface ServeBuilderOptions {
|
---|
61 | browserTarget: string;
|
---|
62 | }
|
---|
63 | export interface LibraryBuilderOptions {
|
---|
64 | tsConfig: string;
|
---|
65 | project: string;
|
---|
66 | }
|
---|
67 | export interface ServerBuilderOptions {
|
---|
68 | outputPath: string;
|
---|
69 | tsConfig: string;
|
---|
70 | main: string;
|
---|
71 | fileReplacements?: FileReplacements[];
|
---|
72 | optimization?: boolean | {
|
---|
73 | scripts?: boolean;
|
---|
74 | styles?: boolean;
|
---|
75 | };
|
---|
76 | sourceMap?: boolean | {
|
---|
77 | scripts?: boolean;
|
---|
78 | styles?: boolean;
|
---|
79 | hidden?: boolean;
|
---|
80 | vendor?: boolean;
|
---|
81 | };
|
---|
82 | }
|
---|
83 | export interface AppShellBuilderOptions {
|
---|
84 | browserTarget: string;
|
---|
85 | serverTarget: string;
|
---|
86 | route: string;
|
---|
87 | }
|
---|
88 | export interface TestBuilderOptions extends Partial<BrowserBuilderBaseOptions> {
|
---|
89 | karmaConfig: string;
|
---|
90 | }
|
---|
91 | export interface ExtractI18nOptions {
|
---|
92 | browserTarget: string;
|
---|
93 | }
|
---|
94 | export interface E2EOptions {
|
---|
95 | protractorConfig: string;
|
---|
96 | devServerTarget: string;
|
---|
97 | }
|
---|
98 | export interface BuilderTarget<TBuilder extends Builders, TOptions> {
|
---|
99 | builder: TBuilder;
|
---|
100 | options: TOptions;
|
---|
101 | configurations?: {
|
---|
102 | production: Partial<TOptions>;
|
---|
103 | [key: string]: Partial<TOptions>;
|
---|
104 | };
|
---|
105 | }
|
---|
106 | export declare type LibraryBuilderTarget = BuilderTarget<Builders.NgPackagr, LibraryBuilderOptions>;
|
---|
107 | export declare type BrowserBuilderTarget = BuilderTarget<Builders.Browser, BrowserBuilderOptions>;
|
---|
108 | export declare type ServerBuilderTarget = BuilderTarget<Builders.Server, ServerBuilderOptions>;
|
---|
109 | export declare type AppShellBuilderTarget = BuilderTarget<Builders.AppShell, AppShellBuilderOptions>;
|
---|
110 | export declare type TestBuilderTarget = BuilderTarget<Builders.Karma, TestBuilderOptions>;
|
---|
111 | export declare type ServeBuilderTarget = BuilderTarget<Builders.DevServer, ServeBuilderOptions>;
|
---|
112 | export declare type ExtractI18nBuilderTarget = BuilderTarget<Builders.ExtractI18n, ExtractI18nOptions>;
|
---|
113 | export declare type E2EBuilderTarget = BuilderTarget<Builders.Protractor, E2EOptions>;
|
---|
114 | export interface WorkspaceSchema {
|
---|
115 | version: 1;
|
---|
116 | defaultProject?: string;
|
---|
117 | cli?: {
|
---|
118 | warnings?: Record<string, boolean>;
|
---|
119 | };
|
---|
120 | projects: {
|
---|
121 | [key: string]: WorkspaceProject<ProjectType.Application | ProjectType.Library>;
|
---|
122 | };
|
---|
123 | }
|
---|
124 | export interface WorkspaceProject<TProjectType extends ProjectType = ProjectType.Application> {
|
---|
125 | /**
|
---|
126 | * Project type.
|
---|
127 | */
|
---|
128 | projectType: ProjectType;
|
---|
129 | root: string;
|
---|
130 | sourceRoot: string;
|
---|
131 | prefix: string;
|
---|
132 | cli?: {
|
---|
133 | warnings?: Record<string, boolean>;
|
---|
134 | };
|
---|
135 | /**
|
---|
136 | * Tool options.
|
---|
137 | */
|
---|
138 | architect?: WorkspaceTargets<TProjectType>;
|
---|
139 | /**
|
---|
140 | * Tool options.
|
---|
141 | */
|
---|
142 | targets?: WorkspaceTargets<TProjectType>;
|
---|
143 | }
|
---|
144 | export interface WorkspaceTargets<TProjectType extends ProjectType = ProjectType.Application> {
|
---|
145 | build?: TProjectType extends ProjectType.Library ? LibraryBuilderTarget : BrowserBuilderTarget;
|
---|
146 | server?: ServerBuilderTarget;
|
---|
147 | test?: TestBuilderTarget;
|
---|
148 | serve?: ServeBuilderTarget;
|
---|
149 | e2e?: E2EBuilderTarget;
|
---|
150 | 'app-shell'?: AppShellBuilderTarget;
|
---|
151 | 'extract-i18n'?: ExtractI18nBuilderTarget;
|
---|
152 | [key: string]: any;
|
---|
153 | }
|
---|