From d2f1e54761a5cdc194e273d9ec52c646935c1d2f Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 30 Apr 2018 18:29:29 -0700 Subject: [PATCH] docs: add workspace docs --- docs/documentation/angular-cli.md | 102 ------------------- docs/documentation/angular-workspace.md | 34 +++++++ docs/documentation/home.md | 4 +- packages/@angular/cli/lib/config/schema.json | 16 +-- 4 files changed, 46 insertions(+), 110 deletions(-) delete mode 100644 docs/documentation/angular-cli.md create mode 100644 docs/documentation/angular-workspace.md diff --git a/docs/documentation/angular-cli.md b/docs/documentation/angular-cli.md deleted file mode 100644 index ec1c2716d17a..000000000000 --- a/docs/documentation/angular-cli.md +++ /dev/null @@ -1,102 +0,0 @@ - - -# Angular CLI Config Schema - -## Options - -- **project**: The global configuration of the project. - - *name* (`string`): The name of the project. - - *ejected*(`boolean`): Whether or not this project was ejected. Default is `false`. - - -- **apps** (`array`): Properties of the different applications in this project. - - *name* (`string`): Name of the app. - - *root* (`string`): The root directory of the app. - - *outDir* (`string`): The output directory for build results. Default is `dist/`. - - *assets* (`array`): List of application assets. - - *deployUrl* (`string`): URL where files will be deployed. - - *index* (`string`): The name of the start HTML file. Default is `index.html` - - *main* (`string`): The name of the main entry-point file. - - *polyfills* (`string`): The name of the polyfills entry-point file. Loaded before the app. - - *test* (`string`): The name of the test entry-point file. - - *tsconfig* (`string`): The name of the TypeScript configuration file. Default is `tsconfig.app.json`. - - *testTsconfig* (`string`): The name of the TypeScript configuration file for unit tests. - - *prefix* (`string`): The prefix to apply to generated selectors. - - *serviceWorker* (`boolean`): Experimental support for a service worker from @angular/service-worker. Default is `false`. - - *showCircularDependencies* (`boolean`): Show circular dependency warnings on builds. Default is `true`. - - *styles* (`string|array`): Global styles to be included in the build. - - *stylePreprocessorOptions* : Options to pass to style preprocessors. - - *includePaths* (`array`): Paths to include. Paths will be resolved to project root. - - *scripts* (`array`): Global scripts to be included in the build. - - *environmentSource* (`string`): Source file for environment config. - - *environments* (`object`): Name and corresponding file for environment config. - -- **e2e**: Configuration for end-to-end tests. - - *protractor* - - *config* (`string`): Path to the config file. - -- **lint** (`array`): Properties to be passed to TSLint. - - *files* (`string|array`): File glob(s) to lint. - - *project* (`string`): Location of the tsconfig.json project file. Will also use as files to lint if 'files' property not present. - - *tslintConfig* (`string`): Location of the tslint.json configuration. Default is `tslint.json`. - - *exclude* (`string|array`): File glob(s) to ignore. - - -- **test**: Configuration for unit tests. - - *karma* - - *config* (`string`): Path to the karma config file. - - *codeCoverage* - - *exclude* (`array`): Globs to exclude from code coverage. - -- **defaults**: Specify the default values for generating. - - *styleExt* (`string`): The file extension to be used for style files. - - *poll* (`number`): How often to check for file updates. - - *class*: Options for generating a class. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `false`. - - *component*: Options for generating a component. - - *flat* (`boolean`): Flag to indicate if a dir is created. Default is `false`. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `true`. - - *inlineStyle* (`boolean`): Specifies if the style will be in the ts file. Default is `false`. - - *inlineTemplate* (`boolean`): Specifies if the template will be in the ts file. Default is `false`. - - *viewEncapsulation* (`string`): Specifies the view encapsulation strategy. Can be one of `Emulated`, `Native` or `None`. - - *changeDetection* (`string`): Specifies the change detection strategy. Can be one of `Default` or `OnPush`. - - *directive*: Options for generating a directive. - - *flat* (`boolean`): Flag to indicate if a dir is created. Default is `true`. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `true`. - - *guard*: Options for generating a guard. - - *flat* (`boolean`): Flag to indicate if a dir is created. Default is `true`. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `true`. - - *interface*: Options for generating a interface. - - *prefix* (`string`): Prefix to apply to interface names. (i.e. I) - - *module*: Options for generating a module. - - *flat* (`boolean`): Flag to indicate if a dir is created. Default is `false`. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `false`. - - *pipe*: Options for generating a pipe. - - *flat* (`boolean`): Flag to indicate if a dir is created. Default is `true`. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `true`. - - *service*: Options for generating a service. - - *flat* (`boolean`): Flag to indicate if a dir is created. Default is `true`. - - *spec* (`boolean`): Specifies if a spec file is generated. Default is `true`. - - *build*: Properties to be passed to the build command. - - *sourcemaps* (`boolean`): Output sourcemaps. - - *baseHref* (`string`): Base url for the application being built. - - *progress* (`boolean`): Log progress to the console while building. Default is `true`. - - *poll* (`number`): Enable and define the file watching poll time period (milliseconds). - - *deleteOutputPath* (`boolean`): Delete output path before build. Default is `true`. - - *preserveSymlinks* (`boolean`): Do not use the real path when resolving modules. Default is `false`. - - *showCircularDependencies* (`boolean`): Show circular dependency warnings on builds. Default is `true`. - - *namedChunks* (`boolean`): Use file name for lazy loaded chunks. - - *serve*: Properties to be passed to the serve command - - *port* (`number`): The port the application will be served on. Default is `4200`. - - *host* (`string`): The host the application will be served on. Default is `localhost`. - - *ssl* (`boolean`): Enables ssl for the application. Default is `false`. - - *sslKey* (`string`): The ssl key used by the server. Default is `ssl/server.key`. - - *sslCert* (`string`): The ssl certificate used by the server. Default is `ssl/server.crt`. - - *proxyConfig* (`string`): Proxy configuration file. - -- **packageManager** (`string`): Specify which package manager tool to use. Options include `npm`, `cnpm` and `yarn`. - -- **warnings**: Allow people to disable console warnings. - - *nodeDeprecation* (`boolean`): Show a warning when the node version is incompatible. Default is `true`. - - *packageDeprecation* (`boolean`): Show a warning when the user installed angular-cli. Default is `true`. - - *versionMismatch* (`boolean`): Show a warning when the global version is newer than the local one. Default is `true`. diff --git a/docs/documentation/angular-workspace.md b/docs/documentation/angular-workspace.md new file mode 100644 index 000000000000..61ebed0000a7 --- /dev/null +++ b/docs/documentation/angular-workspace.md @@ -0,0 +1,34 @@ + + +# Angular CLI workspace file (angular.json) schema + +## Properties + +- **version** (`integer`): File format version. This is currently `"1"`. + +- **newProjectRoot** (`string`): Path where new projects will be created. + +- **defaultProject** (`string`): Default project name used in commands. + +- **cli**: Workspace configuration options for Angular CLI. + - *defaultCollection* (`string`): The default schematics collection to use. + - *packageManager* (`string`): Specify which package manager tool to use. + - *warnings* (`object`): Warning configuration. + - *versionMismatch* (`boolean`): Show a warning when the global version is newer than the local one. + - *typescriptMismatch* (`boolean`): The name of the project. + +- **schematics** (`object`): Workspace configuration options for Schematics. + - *schematic-package:schematic-name* (`string`): Object containing options for this schematic. + +- **projects**: Configuration options for each project in the workspace. + - *root* (`string`): Root of the project files. + - *sourceRoot* (`string`): The root of the source files, assets and index.html file structure.. + - *projectType* (`string`): the type of this project, `application` or `library`. + - *prefix* (`string`): The prefix to apply to generated selectors. + - *schematics* (`object`): Project configuration options for Schematics. Has the same format as top level Schematics configuration). + - *architect* (`string`): Project configuration for Architect targets. + - *targetName* (`string`): Name of this target. + - *builder* (`string`): Builder for this target, in the format `package-name:builder-name`. + - *options* (`string`): Options for this builder. + - *configurations* (`object`): A map of alternative target options. + - *configurationName* (`object`): Partial options override for this builder. diff --git a/docs/documentation/home.md b/docs/documentation/home.md index 1ca5dc8ebd49..29abe3f2f263 100644 --- a/docs/documentation/home.md +++ b/docs/documentation/home.md @@ -56,8 +56,8 @@ End-to-end tests are run via [Protractor](https://angular.github.io/protractor/) * [ng xi18n](xi18n) * [ng update](update) -## Angular CLI Config Schema -* [Config Schema](angular-cli) +## Angular CLI Workspace Schema +* [Angular CLI workspace file (angular.json) schema](angular-workspace) ### Additional Information There are several [stories](stories) which will walk you through setting up diff --git a/packages/@angular/cli/lib/config/schema.json b/packages/@angular/cli/lib/config/schema.json index 6a5cbe6e2772..f484e6379129 100644 --- a/packages/@angular/cli/lib/config/schema.json +++ b/packages/@angular/cli/lib/config/schema.json @@ -17,11 +17,12 @@ "$ref": "#/definitions/schematicOptions" }, "newProjectRoot": { - "type": "string" + "type": "string", + "description": "Path where new projects will be created." }, "defaultProject": { "type": "string", - "description": "Default project name used in commands" + "description": "Default project name used in commands." }, "projects": { "type": "object", @@ -59,7 +60,7 @@ "type": "boolean" }, "typescriptMismatch": { - "description": "Show a warning when the TypeScript version is incompatible", + "description": "Show a warning when the TypeScript version is incompatible.", "type": "boolean" } } @@ -297,13 +298,16 @@ }, "prefix": { "type": "string", - "format": "html-selector" + "format": "html-selector", + "description": "The prefix to apply to generated selectors." }, "root": { - "type": "string" + "type": "string", + "description": "Root of the project files." }, "sourceRoot": { - "type": "string" + "type": "string", + "description": "The root of the source files, assets and index.html file structure." }, "projectType": { "type": "string",