From 9732527e54659ceca21b3bd8d89e6a70a83ff688 Mon Sep 17 00:00:00 2001 From: Mike Brocchi Date: Sat, 3 Dec 2016 22:22:09 -0500 Subject: [PATCH] chore: move the new wiki docs to main repo This move will allow other devs to contribute and allow for pull requests and reviews against docs changes. --- docs/documentation/build.md | 19 ++++ docs/documentation/config.md | 2 + docs/documentation/doc.md | 4 + docs/documentation/e2e.md | 4 + docs/documentation/generate.md | 14 +++ docs/documentation/generate/class.md | 7 ++ docs/documentation/generate/component.md | 21 ++++ docs/documentation/generate/directive.md | 13 +++ docs/documentation/generate/enum.md | 4 + docs/documentation/generate/interface.md | 8 ++ docs/documentation/generate/module.md | 9 ++ docs/documentation/generate/pipe.md | 11 ++ docs/documentation/generate/service.md | 9 ++ docs/documentation/init.md | 27 +++++ docs/documentation/new.md | 27 +++++ docs/documentation/overview.md | 125 +++++++++++++++++++++++ docs/documentation/serve.md | 37 +++++++ docs/documentation/test.md | 19 ++++ 18 files changed, 360 insertions(+) create mode 100644 docs/documentation/build.md create mode 100644 docs/documentation/config.md create mode 100644 docs/documentation/doc.md create mode 100644 docs/documentation/e2e.md create mode 100644 docs/documentation/generate.md create mode 100644 docs/documentation/generate/class.md create mode 100644 docs/documentation/generate/component.md create mode 100644 docs/documentation/generate/directive.md create mode 100644 docs/documentation/generate/enum.md create mode 100644 docs/documentation/generate/interface.md create mode 100644 docs/documentation/generate/module.md create mode 100644 docs/documentation/generate/pipe.md create mode 100644 docs/documentation/generate/service.md create mode 100644 docs/documentation/init.md create mode 100644 docs/documentation/new.md create mode 100644 docs/documentation/overview.md create mode 100644 docs/documentation/serve.md create mode 100644 docs/documentation/test.md diff --git a/docs/documentation/build.md b/docs/documentation/build.md new file mode 100644 index 000000000000..2ea2c32850e5 --- /dev/null +++ b/docs/documentation/build.md @@ -0,0 +1,19 @@ +# ng build + +## Overview +`ng build` compiles the application into an output directory + +## Options +`--target` (`-t`, `-dev`, `prod`) define the build target + +`--environment` (`-e`) + +`--output-path` (`-o`) path where output will be placed + +`--watch` (`-w`) flag to run builds when files change + +`--surpress-sizes` flag to suppress sizes from build output + +`--base-href` (`-bh`) base url for the application being built + +`--aot` flag whether to build using Ahead of Time compilation \ No newline at end of file diff --git a/docs/documentation/config.md b/docs/documentation/config.md new file mode 100644 index 000000000000..bf05ae0403e8 --- /dev/null +++ b/docs/documentation/config.md @@ -0,0 +1,2 @@ +`ng get` +`ng set` diff --git a/docs/documentation/doc.md b/docs/documentation/doc.md new file mode 100644 index 000000000000..db47d3baa66a --- /dev/null +++ b/docs/documentation/doc.md @@ -0,0 +1,4 @@ +# ng doc + +## Overview +`ng doc [search term]` searches documentation on [angular.io](https://angular.io) diff --git a/docs/documentation/e2e.md b/docs/documentation/e2e.md new file mode 100644 index 000000000000..792aae685b55 --- /dev/null +++ b/docs/documentation/e2e.md @@ -0,0 +1,4 @@ +# ng e2e + +## Overview +`ng e2e` executes end-to-end tests diff --git a/docs/documentation/generate.md b/docs/documentation/generate.md new file mode 100644 index 000000000000..57369efc3c45 --- /dev/null +++ b/docs/documentation/generate.md @@ -0,0 +1,14 @@ +# ng generate + +## Overview +`ng generate [name]` generates the specified blueprint + +## Available blueprints: + - [class](class) + - [component](component) + - [directive](directive) + - [enum](enum) + - [interface](interface) + - [module](module) + - [pipe](pipe) + - [service](service) \ No newline at end of file diff --git a/docs/documentation/generate/class.md b/docs/documentation/generate/class.md new file mode 100644 index 000000000000..f5999677c7ab --- /dev/null +++ b/docs/documentation/generate/class.md @@ -0,0 +1,7 @@ +# ng generate class + +## Overview +`ng generate class [name]` generates a class + +## Options +`--spec` specifies if a spec file is generated \ No newline at end of file diff --git a/docs/documentation/generate/component.md b/docs/documentation/generate/component.md new file mode 100644 index 000000000000..d31c36961681 --- /dev/null +++ b/docs/documentation/generate/component.md @@ -0,0 +1,21 @@ +# ng generate component + +## Overview +`ng generate component [name]` generates a component + +## Options +`--flat` flag to indicate if a dir is created + +`--inline-template` (`-it`) specifies if the template will be in the ts file + +`--inline-style` (`-is`) specifies if the style will be in the ts file + +`--prefix` specifies whether to use the prefix + +`--spec` specifies if a spec file is generated + +`--view-encapsulation` (`-ve`) set the view encapsulation strategy + +`--change-detection` (`-cd`) set the change detection strategy + +`--skip-import` allows for skipping the module import diff --git a/docs/documentation/generate/directive.md b/docs/documentation/generate/directive.md new file mode 100644 index 000000000000..b6250e110150 --- /dev/null +++ b/docs/documentation/generate/directive.md @@ -0,0 +1,13 @@ +# ng generate directive + +## Overview +`ng generate directive [name]` generates a directive + +## Options +`--flat` flag to indicate if a dir is created + +`--prefix` specifies whether to use the prefix + +`--spec` specifies if a spec file is generated + +`--skip-import` allows for skipping the module import diff --git a/docs/documentation/generate/enum.md b/docs/documentation/generate/enum.md new file mode 100644 index 000000000000..1fae1fa8a097 --- /dev/null +++ b/docs/documentation/generate/enum.md @@ -0,0 +1,4 @@ +# ng generate enum + +## Overview +`ng generate enum [name]` generates an enumeration diff --git a/docs/documentation/generate/interface.md b/docs/documentation/generate/interface.md new file mode 100644 index 000000000000..e8129d63abfb --- /dev/null +++ b/docs/documentation/generate/interface.md @@ -0,0 +1,8 @@ +# ng generate interface + +## Overview +`ng generate interface [name] ` generates an interface + +## Arguments + +`type` optional string to specify the type of interface diff --git a/docs/documentation/generate/module.md b/docs/documentation/generate/module.md new file mode 100644 index 000000000000..c981b9929889 --- /dev/null +++ b/docs/documentation/generate/module.md @@ -0,0 +1,9 @@ +# ng generate module + +## Overview +`ng generate module [name]` generates an NgModule + +## Options +`--spec` specifies if a spec file is generated + +`--routing` specifies if a routing module file should be generated diff --git a/docs/documentation/generate/pipe.md b/docs/documentation/generate/pipe.md new file mode 100644 index 000000000000..69bce664d76c --- /dev/null +++ b/docs/documentation/generate/pipe.md @@ -0,0 +1,11 @@ +# ng generate pipe + +## Overview +`ng generate pipe [name]` generates a pipe + +## Options +`--flat` flag to indicate if a dir is created + +`--spec` specifies if a spec file is generated + +`--skip-import` allows for skipping the module import diff --git a/docs/documentation/generate/service.md b/docs/documentation/generate/service.md new file mode 100644 index 000000000000..cc50dde25fe8 --- /dev/null +++ b/docs/documentation/generate/service.md @@ -0,0 +1,9 @@ +# ng generate service + +## Overview +`ng generate service [name]` generates a service + +## Options +`--flat` flag to indicate if a dir is created + +`--spec` specifies if a spec file is generated diff --git a/docs/documentation/init.md b/docs/documentation/init.md new file mode 100644 index 000000000000..9cc8ee6346f0 --- /dev/null +++ b/docs/documentation/init.md @@ -0,0 +1,27 @@ +# ng init + +## Overview +`ng init [name]` initializes, or re-initializes, an angular application. + +Initialization is done in-place, meaning that the generated application is initialized in the current directory. + +## Options +`--dry-run` (`-d`) run through without making any changes + +`--skip-npm` (`-sn`) skip installing npm packages + +`--skip-git` (`-sg`) skip initializing a git repository + +`--directory` (`-dir`) the directory name to create the app in + +`--source-dir` (`-sd`) the name of the source directory + +`--style` the style file default extension + +`--prefix` (`p`) the prefix to use for all component selectors + +`--routing` flag to indicate whether to generate a routing module + +`--inline-style` (`is`) flag to indicate if the app component should have an inline style + +`--inline-template` (`it`) flag to indicate if the app component should have an inline template \ No newline at end of file diff --git a/docs/documentation/new.md b/docs/documentation/new.md new file mode 100644 index 000000000000..d88018c400ad --- /dev/null +++ b/docs/documentation/new.md @@ -0,0 +1,27 @@ +# ng new + +## Overview +`ng new [name]` creates a new angular application. + +Default applications are created in a directory of the same name, with an initialized Angular application. + +## Options +`--dry-run` (`-d`) run through without making any changes + +`--skip-npm` (`-sn`) skip installing npm packages + +`--skip-git` (`-sg`) skip initializing a git repository + +`--directory` (`-dir`) the directory name to create the app in + +`--source-dir` (`-sd`) the name of the source directory + +`--style` the style file default extension + +`--prefix` (`p`) the prefix to use for all component selectors + +`--routing` flag to indicate whether to generate a routing module + +`--inline-style` (`is`) flag to indicate if the app component should have an inline style + +`--inline-template` (`it`) flag to indicate if the app component should have an inline template \ No newline at end of file diff --git a/docs/documentation/overview.md b/docs/documentation/overview.md new file mode 100644 index 000000000000..6286a25678a8 --- /dev/null +++ b/docs/documentation/overview.md @@ -0,0 +1,125 @@ +# Angular CLI + +### Overview +The Angular CLI is a tool to initialize, develop, scaffold and maintain [Angular](https://angular.io) applications + +### Getting Started +To install the angular-cli: +``` +npm install -g angular-cli +``` + +Generating and serving an Angular project via a development server +[Create](new) and [run](serve) a new project: +``` +ng new my-project +cd new-project +ng serve +``` +Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. + +### Build Targets and Environment Files + +`ng build` can specify both a build target (`--target=production` or `--target=development`) and an +environment file to be used with that build (`--environment=dev` or `--environment=prod`). +By default, the development build target and environment are used. + +The mapping used to determine which environment file is used can be found in `angular-cli.json`: + +```json +"environments": { + "source": "environments/environment.ts", + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" +} +``` + +These options also apply to the serve command. If you do not pass a value for `environment`, +it will default to `dev` for `development` and `prod` for `production`. + +### Bundling + +All builds make use of bundling, and using the `--prod` flag in `ng build --prod` +or `ng serve --prod` will also make use of uglifying and tree-shaking functionality. + +### Running unit tests + +```bash +ng test +``` + +Tests will execute after a build is executed via [Karma](http://karma-runner.github.io/0.13/index.html), and it will automatically watch your files for changes. You can run tests a single time via `--watch=false` or `--single-run`. + +### Running end-to-end tests + +```bash +ng e2e +``` + +Before running the tests make sure you are serving the app via `ng serve`. +End-to-end tests are run via [Protractor](https://angular.github.io/protractor/). + +### Global styles + +The `styles.css` file allows users to add global styles and supports +[CSS imports](https://developer.mozilla.org/en/docs/Web/CSS/@import). + +If the project is created with the `--style=sass` option, this will be a `.sass` +file instead, and the same applies to `scss/less/styl`. + +You can add more global styles via the `apps[0].styles` property in `angular-cli.json`. + +### Global Library Installation + +Some javascript libraries need to be added to the global scope, and loaded as if +they were in a script tag. We can do this using the `apps[0].scripts` and +`apps[0].styles` properties of `angular-cli.json`. + +As an example, to use [Bootstrap 4](http://v4-alpha.getbootstrap.com/) this is +what you need to do: + +First install Bootstrap from `npm`: + +```bash +npm install bootstrap@next +``` + +Then add the needed script files to `apps[0].scripts`: + +```json +"scripts": [ + "../node_modules/jquery/dist/jquery.js", + "../node_modules/tether/dist/js/tether.js", + "../node_modules/bootstrap/dist/js/bootstrap.js" +], +``` + +Finally add the Bootstrap CSS to the `apps[0].styles` array: +```json +"styles": [ + "../node_modules/bootstrap/dist/css/bootstrap.css", + "styles.css" +], +``` + +Restart `ng serve` if you're running it, and Bootstrap 4 should be working on +your app. + +### Additional Commands +* [ng new](new) +* [ng init](init) +* [ng serve](serve) +* [ng generate](generate) +* [ng test](test) +* [ng e2e](e2e) +* [ng build](build) +* [ng get/ng set](config) +* [ng docs](docs) + +### How to Guides +* Setup AngularFire _(coming soon)_ +* Include bootstrap (CSS) _(coming soon)_ +* Include Font Awesome _(coming soon)_ +* Setup of global styles _(coming soon)_ +* Setup bootstrap with SASS _(coming soon)_ +* Setup Angular Material 2 _(coming soon)_ diff --git a/docs/documentation/serve.md b/docs/documentation/serve.md new file mode 100644 index 000000000000..5dd8f5582feb --- /dev/null +++ b/docs/documentation/serve.md @@ -0,0 +1,37 @@ +# ng serve + +## Overview +`ng serve` builds the application and starts a web server + +## Options +`--port` (`-p`) port to serve the application on + +`--host` (`-H`) + +`--proxy-config` (`-pc`) + +`--watcher` (`-w`) provide a new watcher + +`--live-reload` (`-lr`) flag to turn off live reloading + +`--live-reload-host` (`-lrh`) specify the host for live reloading + +`--live-reload-base-url` (`-lrbu`) specify the base URL for live reloading + +`--live-reload-port` (`-lrp`) port for live reloading + +`--live-reload-live-css` flag to live reload CSS + +`--target` (`-t`, `-dev`, `-prod`) target environment + +`--environment` (`-e`) build environment + +`--ssl` flag to turn on SSL + +`--ssl-key` path to the SSL key + +`--ssl-cert` path to the SSL cert + +`--aot` flag to turn on Ahead of Time compilation + +`--open` (`-o`) opens the app in the default browser \ No newline at end of file diff --git a/docs/documentation/test.md b/docs/documentation/test.md new file mode 100644 index 000000000000..d71fce0d9982 --- /dev/null +++ b/docs/documentation/test.md @@ -0,0 +1,19 @@ +# ng test + +## Overview +`ng test` compiles the application into an output directory + +## Options +`--watch` (`-w`) flag to run builds when files change + +`--browsers` override which browsers tests are run against + +`--colors` enable or disable colors in the output (reporters and logs) + +`--log-level` level of logging + +`--port` port where the web server will be listening + +`--reporters` list of reporters to use + +`--build` flag to build prior to running tests \ No newline at end of file