| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474 |
- import { Rule, Tree } from '@angular-devkit/schematics';
- import { ProjectType, WorkspaceProject, WorkspaceSchema } from './workspace-models';
- export interface AppConfig {
- /**
- * Name of the app.
- */
- name?: string;
- /**
- * Directory where app files are placed.
- */
- appRoot?: string;
- /**
- * The root directory of the app.
- */
- root?: string;
- /**
- * The output directory for build results.
- */
- outDir?: string;
- /**
- * List of application assets.
- */
- assets?: (string | {
- /**
- * The pattern to match.
- */
- glob?: string;
- /**
- * The dir to search within.
- */
- input?: string;
- /**
- * The output path (relative to the outDir).
- */
- output?: string;
- })[];
- /**
- * URL where files will be deployed.
- */
- deployUrl?: string;
- /**
- * Base url for the application being built.
- */
- baseHref?: string;
- /**
- * The runtime platform of the app.
- */
- platform?: ('browser' | 'server');
- /**
- * The name of the start HTML file.
- */
- index?: string;
- /**
- * The name of the main entry-point file.
- */
- main?: string;
- /**
- * The name of the polyfills file.
- */
- polyfills?: string;
- /**
- * The name of the test entry-point file.
- */
- test?: string;
- /**
- * The name of the TypeScript configuration file.
- */
- tsconfig?: string;
- /**
- * The name of the TypeScript configuration file for unit tests.
- */
- testTsconfig?: string;
- /**
- * The prefix to apply to generated selectors.
- */
- prefix?: string;
- /**
- * Experimental support for a service worker from @angular/service-worker.
- */
- serviceWorker?: boolean;
- /**
- * Global styles to be included in the build.
- */
- styles?: (string | {
- input?: string;
- [name: string]: any;
- })[];
- /**
- * Options to pass to style preprocessors
- */
- stylePreprocessorOptions?: {
- /**
- * Paths to include. Paths will be resolved to project root.
- */
- includePaths?: string[];
- };
- /**
- * Global scripts to be included in the build.
- */
- scripts?: (string | {
- input: string;
- [name: string]: any;
- })[];
- /**
- * Source file for environment config.
- */
- environmentSource?: string;
- /**
- * Name and corresponding file for environment config.
- */
- environments?: {
- [name: string]: any;
- };
- appShell?: {
- app: string;
- route: string;
- };
- budgets?: {
- /**
- * The type of budget
- */
- type?: ('bundle' | 'initial' | 'allScript' | 'all' | 'anyScript' | 'any' | 'anyComponentStyle');
- /**
- * The name of the bundle
- */
- name?: string;
- /**
- * The baseline size for comparison.
- */
- baseline?: string;
- /**
- * The maximum threshold for warning relative to the baseline.
- */
- maximumWarning?: string;
- /**
- * The maximum threshold for error relative to the baseline.
- */
- maximumError?: string;
- /**
- * The minimum threshold for warning relative to the baseline.
- */
- minimumWarning?: string;
- /**
- * The minimum threshold for error relative to the baseline.
- */
- minimumError?: string;
- /**
- * The threshold for warning relative to the baseline (min & max).
- */
- warning?: string;
- /**
- * The threshold for error relative to the baseline (min & max).
- */
- error?: string;
- }[];
- }
- export interface CliConfig {
- $schema?: string;
- /**
- * The global configuration of the project.
- */
- project?: {
- /**
- * The name of the project.
- */
- name?: string;
- /**
- * Whether or not this project was ejected.
- */
- ejected?: boolean;
- };
- /**
- * Properties of the different applications in this project.
- */
- apps?: AppConfig[];
- /**
- * Configuration for end-to-end tests.
- */
- e2e?: {
- protractor?: {
- /**
- * Path to the config file.
- */
- config?: string;
- };
- };
- /**
- * Properties to be passed to TSLint.
- */
- lint?: {
- /**
- * File glob(s) to lint.
- */
- files?: (string | string[]);
- /**
- * Location of the tsconfig.json project file.
- * Will also use as files to lint if 'files' property not present.
- */
- project: string;
- /**
- * Location of the tslint.json configuration.
- */
- tslintConfig?: string;
- /**
- * File glob(s) to ignore.
- */
- exclude?: (string | string[]);
- }[];
- /**
- * Configuration for unit tests.
- */
- test?: {
- karma?: {
- /**
- * Path to the karma config file.
- */
- config?: string;
- };
- codeCoverage?: {
- /**
- * Globs to exclude from code coverage.
- */
- exclude?: string[];
- };
- };
- /**
- * Specify the default values for generating.
- */
- defaults?: {
- /**
- * The file extension to be used for style files.
- */
- styleExt?: string;
- /**
- * How often to check for file updates.
- */
- poll?: number;
- /**
- * Use lint to fix files after generation
- */
- lintFix?: boolean;
- /**
- * Options for generating a class.
- */
- class?: {
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- };
- /**
- * Options for generating a component.
- */
- component?: {
- /**
- * Flag to indicate if a directory is created.
- */
- flat?: boolean;
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- /**
- * Specifies if the style will be in the ts file.
- */
- inlineStyle?: boolean;
- /**
- * Specifies if the template will be in the ts file.
- */
- inlineTemplate?: boolean;
- /**
- * Specifies the view encapsulation strategy.
- */
- viewEncapsulation?: ('Emulated' | 'Native' | 'None');
- /**
- * Specifies the change detection strategy.
- */
- changeDetection?: ('Default' | 'OnPush');
- };
- /**
- * Options for generating a directive.
- */
- directive?: {
- /**
- * Flag to indicate if a directory is created.
- */
- flat?: boolean;
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- };
- /**
- * Options for generating a guard.
- */
- guard?: {
- /**
- * Flag to indicate if a directory is created.
- */
- flat?: boolean;
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- };
- /**
- * Options for generating an interface.
- */
- interface?: {
- /**
- * Prefix to apply to interface names. (i.e. I)
- */
- prefix?: string;
- };
- /**
- * Options for generating a module.
- */
- module?: {
- /**
- * Flag to indicate if a directory is created.
- */
- flat?: boolean;
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- };
- /**
- * Options for generating a pipe.
- */
- pipe?: {
- /**
- * Flag to indicate if a directory is created.
- */
- flat?: boolean;
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- };
- /**
- * Options for generating a service.
- */
- service?: {
- /**
- * Flag to indicate if a directory is created.
- */
- flat?: boolean;
- /**
- * Specifies if a spec file is generated.
- */
- spec?: boolean;
- };
- /**
- * Properties to be passed to the build command.
- */
- build?: {
- /**
- * Output sourcemaps.
- */
- sourcemaps?: boolean;
- /**
- * Base url for the application being built.
- */
- baseHref?: string;
- /**
- * The ssl key used by the server.
- */
- progress?: boolean;
- /**
- * Enable and define the file watching poll time period (milliseconds).
- */
- poll?: number;
- /**
- * Delete output path before build.
- */
- deleteOutputPath?: boolean;
- /**
- * Do not use the real path when resolving modules.
- */
- preserveSymlinks?: boolean;
- /**
- * Show circular dependency warnings on builds.
- */
- showCircularDependencies?: boolean;
- /**
- * Use a separate bundle containing code used across multiple bundles.
- */
- commonChunk?: boolean;
- /**
- * Use file name for lazy loaded chunks.
- */
- namedChunks?: boolean;
- };
- /**
- * Properties to be passed to the serve command.
- */
- serve?: {
- /**
- * The port the application will be served on.
- */
- port?: number;
- /**
- * The host the application will be served on.
- */
- host?: string;
- /**
- * Enables ssl for the application.
- */
- ssl?: boolean;
- /**
- * The ssl key used by the server.
- */
- sslKey?: string;
- /**
- * The ssl certificate used by the server.
- */
- sslCert?: string;
- /**
- * Proxy configuration file.
- */
- proxyConfig?: string;
- };
- /**
- * Properties about schematics.
- */
- schematics?: {
- /**
- * The schematics collection to use.
- */
- collection?: string;
- /**
- * The new app schematic.
- */
- newApp?: string;
- };
- };
- /**
- * Specify which package manager tool to use.
- */
- packageManager?: ('npm' | 'cnpm' | 'yarn' | 'default');
- /**
- * Allow people to disable console warnings.
- */
- warnings?: {
- /**
- * Show a warning when the user enabled the --hmr option.
- */
- hmrWarning?: boolean;
- /**
- * Show a warning when the node version is incompatible.
- */
- nodeDeprecation?: boolean;
- /**
- * Show a warning when the user installed angular-cli.
- */
- packageDeprecation?: boolean;
- /**
- * Show a warning when the global version is newer than the local one.
- */
- versionMismatch?: boolean;
- /**
- * Show a warning when the TypeScript version is incompatible
- */
- typescriptMismatch?: boolean;
- };
- }
- export declare function getWorkspacePath(host: Tree): string;
- export declare function getWorkspace(host: Tree): WorkspaceSchema;
- export declare function addProjectToWorkspace<TProjectType extends ProjectType = ProjectType.Application>(workspace: WorkspaceSchema, name: string, project: WorkspaceProject<TProjectType>): Rule;
- export declare function updateWorkspace(workspace: WorkspaceSchema): Rule;
- export declare const configPath = "/.angular-cli.json";
- export declare function getConfig(host: Tree): CliConfig;
- export declare function getAppFromConfig(config: CliConfig, appIndexOrName: string): AppConfig | null;
|