UNPKG

4.98 kBTypeScriptView Raw
1import { virtualFs } from '@angular-devkit/core';
2import { ParsedCommandLine, ScriptTarget } from 'typescript';
3import { Logger, LogLevelString } from '../utils';
4import { AngularBuildConfig } from './angular-build-config';
5import { AppProjectConfig, AppProjectConfigBase } from './app-project-config';
6import { BuildOptions } from './build-options';
7import { LibBundleOptions, LibProjectConfig, LibProjectConfigBase, TsTranspilationOptions } from './lib-project-config';
8import { ProjectConfig, ProjectConfigBase } from './project-config';
9export interface BuildOptionInternal extends BuildOptions {
10 environment: {
11 [key: string]: boolean | string;
12 };
13}
14export interface DllParsedResult {
15 tsEntries: string[];
16 scriptEntries: string[];
17 styleEntries: string[];
18}
19export interface GlobalParsedEntry {
20 paths: string[];
21 entry: string;
22 lazy?: boolean;
23}
24export interface AngularBuildConfigInternal extends AngularBuildConfig {
25 libs: LibProjectConfigInternal[];
26 apps: AppProjectConfigInternal[];
27 _schema?: {
28 [key: string]: any;
29 };
30 _configPath: string;
31}
32export interface TsTranspilationOptionsInternal extends TsTranspilationOptions {
33 _index: number;
34 _tsConfigPath: string;
35 _tsConfigJson: {
36 [key: string]: any;
37 };
38 _tsCompilerConfig: ParsedCommandLine;
39 _declaration: boolean;
40 _scriptTarget: ScriptTarget;
41 _tsOutDirRootResolved: string;
42 _angularCompilerOptions?: {
43 [key: string]: any;
44 };
45 _detectedEntryName?: string;
46 _typingsOutDir?: string;
47 _customTsOutDir?: string;
48}
49export interface LibBundleOptionsInternal extends LibBundleOptions {
50 _index: number;
51 _entryFilePath: string;
52 _outputFilePath: string;
53 _tsConfigPath?: string;
54 _tsConfigJson?: {
55 [key: string]: any;
56 };
57 _tsCompilerConfig?: ParsedCommandLine;
58 _sourceScriptTarget?: ScriptTarget;
59 _destScriptTarget?: ScriptTarget;
60 _ecmaVersion?: number;
61 _supportES2015?: boolean;
62 _nodeResolveFields?: string[];
63}
64export interface PackageEntryPoints {
65 main?: string;
66 module?: string;
67 es2015?: string;
68 esm5?: string;
69 esm2015?: string;
70 fesm2015?: string;
71 fesm5?: string;
72 typings?: string;
73}
74export interface ProjectConfigInternal<TConfig extends ProjectConfigBase> extends ProjectConfig<TConfig> {
75 _configPath?: string;
76 _workspaceRoot?: string;
77 _nodeModulesPath?: string | null;
78 _projectRoot?: string;
79 _outputPath?: string;
80 _projectType?: 'app' | 'lib';
81 _index?: number;
82 _bannerText?: string;
83 _packageConfigPath?: string;
84 _rootPackageConfigPath?: string;
85 _packageJson?: {
86 [key: string]: any;
87 };
88 _rootPackageJson?: {
89 [key: string]: any;
90 };
91 _projectName?: string;
92 _packageNameWithoutScope?: string;
93 _projectVersion?: string;
94 _projectDescription?: string;
95 _projectAuthor?: string;
96 _projectHomePage?: string;
97 _packageScope?: string;
98 _isPackagePrivate?: boolean;
99 _isNestedPackage?: boolean;
100 _tsConfigPath?: string;
101 _tsConfigJson?: {
102 [key: string]: any;
103 };
104 _tsCompilerConfig?: ParsedCommandLine;
105 _angularCompilerOptions?: {
106 [key: string]: any;
107 };
108}
109export interface AppProjectConfigInternal extends AppProjectConfig, ProjectConfigInternal<AppProjectConfigBase> {
110 _outputHashing?: {
111 bundles?: boolean;
112 chunks?: boolean;
113 extractedAssets?: boolean;
114 };
115 _ecmaVersion?: number;
116 _supportES2015?: boolean;
117 _nodeResolveFields?: string[];
118 _isDll?: boolean;
119 _dllParsedResult?: DllParsedResult;
120 _polyfillParsedResult?: DllParsedResult;
121 _scriptParsedEntries?: GlobalParsedEntry[];
122 _styleParsedEntries?: GlobalParsedEntry[];
123}
124export interface LibProjectConfigInternal extends LibProjectConfig, ProjectConfigInternal<LibProjectConfigBase> {
125 _styleParsedEntries?: GlobalParsedEntry[];
126 _tsTranspilations?: TsTranspilationOptionsInternal[];
127 _prevTsTranspilationVersionReplaced?: boolean;
128 _prevTsTranspilationResourcesInlined?: boolean;
129 _bundles?: LibBundleOptionsInternal[];
130 _packageJsonOutDir?: string;
131 _packageEntryPoints?: PackageEntryPoints;
132}
133export interface BuildContextInstanceOptions<TConfig extends AppProjectConfigInternal | LibProjectConfigInternal> {
134 projectConfigWithoutEnvApplied: TConfig;
135 projectConfig: TConfig;
136 buildOptions: BuildOptionInternal;
137 host: virtualFs.Host;
138}
139export interface BuildContextStaticOptions {
140 workspaceRoot: string;
141 filteredConfigNames?: string[];
142 startTime?: number;
143 angularBuildConfig?: AngularBuildConfigInternal;
144 fromAngularBuildCli?: boolean;
145 cliRootPath?: string;
146 cliVersion?: string;
147 cliIsGlobal?: boolean;
148 logger?: Logger;
149 logLevel?: LogLevelString;
150}