Skip to content

Commit b16bcf0

Browse files
committed
chore(master) Merged master into webpack branch. Time to test changes.
2 parents a904905 + b90a110 commit b16bcf0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+430
-589
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ before_install:
1919
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source ~/.nvm/nvm-exec; fi
2020
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
2121
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap caskroom/cask; fi
22-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install google-chrome; fi
22+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install google-chrome --force; fi
2323
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0; fi
2424
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi
2525
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CHROME_BIN=chromium-browser; fi

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Always follow the [upgrade guide](https://github.com/angular/angular-cli#updating-angular-cli) when upgrading to a new version. The changelog does not list breaking changes that are fixed via the update procedure.
2+
3+
<a name="1.0.0-beta.6"></a>
4+
# 1.0.0-beta.6 (2016-06-13)
5+
6+
### Features
7+
- Admin elevation no longer required on Windows (https://github.com/angular/angular-cli/pull/905).
8+
- Automatically add SASS/Stylus if project is initialized with `--style={sass|scss|styl}` (https://github.com/angular/angular-cli/pull/998).
9+
- Allow any number of env files (https://github.com/angular/angular-cli/pull/913).
10+
11+
### Bug Fixes
12+
- Fix adding 3rd party libs without package format (https://github.com/angular/angular-cli/pull/1028/commits/065e98f40384f8b28dcaf84028c411043697ff11).
13+
- Fix github deploy deep links (https://github.com/angular/angular-cli/pull/1020).
14+
- Fix `ng e2e` exit code (https://github.com/angular/angular-cli/pull/1025).
15+
- Fix missing vendor file (https://github.com/angular/angular-cli/pull/972).
16+
- Fix github user pages base href (https://github.com/angular/angular-cli/pull/965).
17+
18+
### BREAKING CHANGES
19+
- `<PROJECT-NAME>AppComponent` is now simply `AppComponent`, and it's selector is now `app-root` (https://github.com/angular/angular-cli/pull/1042).
20+
21+
- Route generation is temporarily disabled while we move to the [recently announce router](http://angularjs.blogspot.ie/2016/06/improvements-coming-for-routing-in.html)(https://github.com/angular/angular-cli/pull/992). It is recommended that users manually move to this router in all new projects.
22+
23+
<a name="1.0.0-beta.5"></a>
24+
# 1.0.0-beta.5 (2016-05-19)
25+
26+
### Known Issues
27+
28+
- `ng new -mobile` fails npm install (https://github.com/angular/angular-cli/issues/958).
29+
- Adding 3rd party libs without SystemJS package format breaks prod mode (https://github.com/angular/angular-cli/issues/951).
30+
- Deep links do not work on Github pages deploys (https://github.com/angular/angular-cli/issues/995).
31+
- `ng e2e` doesn't return error exit code on test failures (https://github.com/angular/angular-cli/issues/1017).
32+
- `ng build -prod` fails on mobile projects due to missing vendor file (https://github.com/angular/angular-cli/issues/847).
33+
- Github deploy to user pages doesn't use correct base href (https://github.com/angular/angular-cli/pull/965).
34+
- `ng test` on windows hits the file discriptor limit (https://github.com/angular/angular-cli/issues/977).
35+
- `ng serve/build/test` need admin elevation on Windows (https://github.com/angular/angular-cli/issues/641).

README.md

+47-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Prototype of a CLI for Angular 2 applications based on the [ember-cli](http://ww
1313

1414
This project is very much still a work in progress.
1515

16-
We still have a long way before getting out of our alpha stage.
16+
The CLI is now in beta.
1717
If you wish to collaborate while the project is still young, check out [our issue list](https://github.com/angular/angular-cli/issues).
1818

1919
## Prerequisites
@@ -25,9 +25,10 @@ The generated project has dependencies that require **Node 4 or greater**.
2525
* [Installation](#installation)
2626
* [Usage](#usage)
2727
* [Generating a New Project](#generating-and-serving-an-angular2-project-via-a-development-server)
28-
* [Generating Components, Directives, Pipes and Services](#generating-other-scaffolds)
28+
* [Generating Components, Directives, Pipes and Services](#generating-components-directives-pipes-and-services)
2929
* [Generating a Route](#generating-a-route)
3030
* [Creating a Build](#creating-a-build)
31+
* [Environments](#environments)
3132
* [Running Unit Tests](#running-unit-tests)
3233
* [Running End-to-End Tests](#running-end-to-end-tests)
3334
* [Deploying the App via GitHub Pages](#deploying-the-app-via-github-pages)
@@ -36,7 +37,9 @@ The generated project has dependencies that require **Node 4 or greater**.
3637
* [Commands autocompletion](#commands-autocompletion)
3738
* [CSS preprocessor integration](#css-preprocessor-integration)
3839
* [3rd Party Library Installation](#3rd-party-library-installation)
40+
* [Updating angular-cli](#updating-angular-cli)
3941
* [Known Issues](#known-issues)
42+
* [Development Hints for hacking on angular-cli](#development-hints-for-hacking-on-angular-cli)
4043

4144
## Installation
4245

@@ -66,7 +69,7 @@ You can configure the default HTTP port and the one used by the LiveReload serve
6669
ng serve --port 4201 --live-reload-port 49153
6770
```
6871

69-
### Generating other scaffolds
72+
### Generating Components, Directives, Pipes and Services
7073

7174
You can use the `ng generate` (or just `ng g`) command to generate Angular components:
7275

@@ -90,6 +93,9 @@ Component | `ng g component my-new-component`
9093
Directive | `ng g directive my-new-directive`
9194
Pipe | `ng g pipe my-new-pipe`
9295
Service | `ng g service my-new-service`
96+
Class | `ng g class my-new-class`
97+
Interface | `ng g interface my-new-interface`
98+
Enum | `ng g enum my-new-enum`
9399

94100
### Generating a route
95101

@@ -102,7 +108,7 @@ ng generate route hero
102108

103109
This will create a folder which will contain the hero component and related test and style files.
104110

105-
The generated route will also be registered with the parent component's `@RouteConfig` decorator.
111+
The generated route will also be registered with the parent component's `@RouteConfig` decorator.
106112

107113
By default the route will be designated as a **lazy** route which means that it will be loaded into the browser when needed, not upfront as part of a bundle.
108114

@@ -130,16 +136,22 @@ current cli environment.
130136
Environment defaults to `dev`, but you can generate a production build via
131137
the `-prod` flag in either `ng build -prod` or `ng serve -prod`.
132138

139+
You can also add your own env files other than `dev` and `prod` by creating a
140+
`src/client/app/environment.{NAME}.ts` and use them by using the `--env=NAME`
141+
flag on the build/serve commands.
142+
133143
### Running unit tests
134144

135145
```bash
136146
ng test
137147
```
138148

139-
Tests will execute after a build is executed via [Karma](http://karma-runner.github.io/0.13/index.html)
149+
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.
150+
151+
You can run tests a single time via `--watch=false`, and turn off building of the app via `--build=false` (useful for running it at the same time as `ng serve`).
140152

141-
If run with the watch argument `--watch` (shorthand `-w`) builds will run when source files have changed
142-
and tests will run after each successful build
153+
**WARNING:** On Windows, `ng test` is hitting a file descriptor limit (see https://github.com/angular/angular-cli/issues/977).
154+
The solution for now is to instead run `ng serve` and `ng test --build=false` in separate console windows.
143155

144156

145157
### Running end-to-end tests
@@ -235,13 +247,39 @@ The `Angular2App`'s options argument has `sassCompiler`, `lessCompiler`, `stylus
235247

236248
The installation of 3rd party libraries are well described at our [Wiki Page](https://github.com/angular/angular-cli/wiki/3rd-party-libs)
237249

250+
### Updating angular-cli
251+
252+
To update `angular-cli` to a new version, you must update both the global package and your project's local package.
253+
254+
Global package:
255+
```
256+
npm uninstall -g angular-cli
257+
npm cache clean
258+
npm install -g angular-cli@latest
259+
```
260+
261+
Local project package:
262+
```
263+
rm -rf node_modules dist tmp
264+
npm install --save-dev angular-cli@latest
265+
ng init
266+
```
267+
268+
Running `ng init` will check for changes in all the auto-generated files created by `ng new` and allow you to update yours. You are offered four choices for each changed file: `y` (overwrite), `n` (don't overwrite), `d` (show diff between your file and the updated file) and `h` (help).
269+
270+
Carefully read the diffs for each code file, and either accept the changes or incorporate them manually after `ng init` finishes.
271+
272+
**The main cause of errors after an update is failing to incorporate these updates into your code**.
273+
274+
You can find more details about changes between versions in [CHANGELOG.md](https://github.com/angular/angular-cli/blob/master/CHANGELOG.md).
275+
276+
238277
## Known issues
239278

240279
This project is currently a prototype so there are many known issues. Just to mention a few:
241280

242281
- All blueprints/scaffolds are in TypeScript only, in the future blueprints in all dialects officially supported by Angular will be available.
243282
- On Windows you need to run the `build` and `serve` commands with Admin permissions, otherwise the performance is not good.
244-
- [Protractor](https://angular.github.io/protractor/) integration is missing.
245283
- The initial installation as well as `ng new` take too long because of lots of npm dependencies.
246284
- Many existing ember addons are not compatible with Angular apps built via angular-cli.
247285
- When you `ng serve` remember that the generated project has dependencies that require **Node 4 or greater**.
@@ -268,7 +306,7 @@ Now you can use `angular-cli` via the command line:
268306
ng new foo
269307
cd foo
270308
npm link angular-cli
271-
ng server
309+
ng serve
272310
```
273311

274312
`npm link angular-cli` is needed because by default the globally installed `angular-cli` just loads

addon/ng2/blueprints/class/files/__path__/__name__.spec.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
/* tslint:disable:no-unused-variable */
2+
13
import {
2-
describe,
3-
ddescribe,
4-
expect,
5-
iit,
6-
it
4+
beforeEach, beforeEachProviders,
5+
describe, xdescribe,
6+
expect, it, xit,
7+
async, inject
78
} from '@angular/core/testing';
89
import {<%= classifiedModuleName %>} from './<%= fileName %>';
910

Original file line numberDiff line numberDiff line change
@@ -1,46 +1,20 @@
1+
/* tslint:disable:no-unused-variable */
2+
3+
import { By } from '@angular/platform-browser';
4+
import { DebugElement } from '@angular/core';
5+
16
import {
2-
beforeEach,
3-
beforeEachProviders,
4-
describe,
5-
expect,
6-
it,
7-
inject,
7+
beforeEach, beforeEachProviders,
8+
describe, xdescribe,
9+
expect, it, xit,
10+
async, inject
811
} from '@angular/core/testing';
9-
import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
10-
import { Component } from '@angular/core';
11-
import { By } from '@angular/platform-browser';
12+
1213
import { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component';
1314

1415
describe('Component: <%= classifiedModuleName %>', () => {
15-
let builder: TestComponentBuilder;
16-
17-
beforeEachProviders(() => [<%= classifiedModuleName %>Component]);
18-
beforeEach(inject([TestComponentBuilder], function (tcb: TestComponentBuilder) {
19-
builder = tcb;
20-
}));
21-
22-
it('should inject the component', inject([<%= classifiedModuleName %>Component],
23-
(component: <%= classifiedModuleName %>Component) => {
16+
it('should create an instance', () => {
17+
let component = new <%= classifiedModuleName %>Component();
2418
expect(component).toBeTruthy();
25-
}));
26-
27-
it('should create the component', inject([], () => {
28-
return builder.createAsync(<%= classifiedModuleName %>ComponentTestController)
29-
.then((fixture: ComponentFixture<any>) => {
30-
let query = fixture.debugElement.query(By.directive(<%= classifiedModuleName %>Component));
31-
expect(query).toBeTruthy();
32-
expect(query.componentInstance).toBeTruthy();
33-
});
34-
}));
19+
});
3520
});
36-
37-
@Component({
38-
selector: 'test',
39-
template: `
40-
<<%= selector %>></<%= selector %>>
41-
`,
42-
directives: [<%= classifiedModuleName %>Component]
43-
})
44-
class <%= classifiedModuleName %>ComponentTestController {
45-
}
46-
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { <%= classifiedModuleName %>Component } from './<%= dasherizedModuleName %>.component';
1+
export * from './<%= dasherizedModuleName %>.component';
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1+
/* tslint:disable:no-unused-variable */
2+
13
import {
2-
async,
3-
beforeEachProviders,
4-
describe,
5-
ddescribe,
6-
expect,
7-
iit,
8-
it,
9-
inject
4+
beforeEach, beforeEachProviders,
5+
describe, xdescribe,
6+
expect, it, xit,
7+
async, inject
108
} from '@angular/core/testing';
11-
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
12-
import { provide, Component } from '@angular/core';
139
import { <%= classifiedModuleName %> } from './<%= dasherizedModuleName %>.directive';
1410

15-
@Component({
16-
selector: 'test-component',
17-
template: `<div <%= dasherizedModuleName %>></div>`
18-
})
19-
class TestComponent {}
20-
2111
describe('<%= classifiedModuleName %> Directive', () => {
22-
beforeEachProviders((): any[] => []);
23-
24-
it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => {
25-
return tcb.createAsync(TestComponent).then((fixture: ComponentFixture<any>) => {
26-
fixture.detectChanges();
27-
});
28-
})));
12+
it('should create an instance', () => {
13+
let directive = new <%= classifiedModuleName %>();
14+
expect(directive).toBeTruthy();
15+
});
2916
});
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>.directive';
1+
export * from './<%= dasherizedModuleName %>.directive';

addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { provide } from '@angular/core';
22
import { APP_BASE_HREF } from '@angular/common';
33
import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell';
4-
import { <%= jsComponentName %>AppComponent } from './app/';
4+
import { AppComponent } from './app/';
55
import {
66
REQUEST_URL,
77
ORIGIN_URL
@@ -10,7 +10,7 @@ import {
1010
export const options = {
1111
directives: [
1212
// The component that will become the main App Shell
13-
<%= jsComponentName %>AppComponent
13+
AppComponent
1414
],
1515
platformProviders: [
1616
APP_SHELL_BUILD_PROVIDERS,

addon/ng2/blueprints/ng2/files/.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# http://editorconfig.org
1+
# Editor configuration, see http://editorconfig.org
22
root = true
33

44
[*]
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# <%= jsComponentName %>
2+
3+
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version <%= version %>.
4+
5+
## Development server
6+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
8+
## Code scaffolding
9+
10+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/route/class`.
11+
12+
## Build
13+
14+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
15+
16+
## Running unit tests
17+
18+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
19+
20+
## Running end-to-end tests
21+
22+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
23+
Before running the tests make sure you are serving the app via `ng serve`.
24+
25+
## Deploying to Github Pages
26+
27+
Run `ng github-pages:deploy` to deploy to Github Pages.
28+
29+
## Further help
30+
31+
To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

addon/ng2/blueprints/ng2/files/__path__/app/__name__.component.spec.ts

-22
This file was deleted.

0 commit comments

Comments
 (0)