Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Angular CLI 1.0.0-beta.32.3 #19

Merged
merged 3 commits into from Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 6 additions & 16 deletions angular-cli.json → .angular-cli.json
@@ -1,6 +1,7 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"version": "1.0.0-beta.28.3",
"version": "1.0.0-beta.32.3",
"name": "ng-demo"
},
"apps": [
Expand All @@ -9,7 +10,8 @@
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
"favicon.ico",
"app/**.json"
],
"index": "index.html",
"main": "main.ts",
Expand All @@ -21,8 +23,8 @@
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
Expand Down Expand Up @@ -50,18 +52,6 @@
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
"component": {}
}
}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -15,6 +15,7 @@
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -18,13 +18,12 @@ apt:
- google-chrome-stable
- google-chrome-beta
before_install:
- npm install -g angular-cli
- npm install -g @angular/cli
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script:
- ng test --watch false
- ng serve &
- ng e2e
notifications:
webhooks:
Expand Down
54 changes: 27 additions & 27 deletions README.adoc
Expand Up @@ -2,7 +2,7 @@

:author: Matt Raible
:email: matt@raibledesigns.com
:revnumber: 1.3
:revnumber: 1.4
:revdate: {docdate}
:subject: Angular CLI
:keywords: Angular CLI, Angular, Angular 2, JavaScript, TypeScript, node, npm, Jasmine, Protractor
Expand Down Expand Up @@ -56,7 +56,7 @@ application with search and edit features.
* A favorite text editor or IDE. I recommend https://www.jetbrains.com/idea/[IntelliJ IDEA] and its
https://plugins.jetbrains.com/plugin/8395?pr=idea[Angular TypeScript Live Templates plugin].
* http://nodejs.org/[Node.js] and npm installed. I recommend using https://github.com/creationix/nvm[nvm].
* https://github.com/angular/angular-cli[Angular CLI] installed. If you don't have Angular CLI installed, install it using `npm install -g angular-cli@latest`.
* https://github.com/angular/angular-cli[Angular CLI] installed. If you don't have Angular CLI installed, install it using `npm install -g @angular/cli`.

TIP: https://augury.angular.io/[Angular Augury] is a Google Chrome Dev Tools extension for debugging Angular applications.
I haven't needed it much myself, but I can see how it might come in handy.
Expand Down Expand Up @@ -92,7 +92,7 @@ installing ng2
create src/styles.css
create src/test.ts
create src/tsconfig.json
create angular-cli.json
create .angular-cli.json
create e2e/app.e2e-spec.ts
create e2e/app.po.ts
create e2e/tsconfig.json
Expand All @@ -102,27 +102,29 @@ installing ng2
create protractor.conf.js
create tslint.json
Successfully initialized git.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
[mraible:~/dev] 1m17s $
Installing packages for tooling via yarn.
Installed packages for tooling via yarn.
Project 'ng-demo' successfully created.
[mraible:~] 46s $
----

You can see the what version of Angular CLI you're using with `ng --version`.

----
$ ng --version
angular-cli: 1.0.0-beta.24
node: 6.9.1
@angular/cli: 1.0.0-beta.32.3
node: 6.9.5
os: darwin x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-beta.32.3
@angular/compiler-cli: 2.4.8
----

== Run the application
Expand All @@ -149,13 +151,11 @@ Chrome 55.0.2883 (Mac OS X 10.12.2): Executed 3 of 3 SUCCESS (0.257 secs / 0.252

== Add a search feature

To add a search feature, open the project in an IDE or your favorite text editor. For IntelliJ IDEA, use
File > New Project > Static Web and point to the `ng-demo` directory.
To add a search feature, open the project in an IDE or your favorite text editor. For IntelliJ IDEA, use File > New Project > Static Web and point to the `ng-demo` directory.

=== The Basics

In a terminal window, cd into your project's directory and run the following command. This will create a search
component.
In a terminal window, cd into your project's directory and run the following command. This will create a search component.

[source]
----
Expand Down Expand Up @@ -260,10 +260,10 @@ installing service

Move the generated `search.service.ts` and its test to `app/shared/search`. You will need to create this directory.

Create `src/app/shared/search/data/people.json` to hold your data.
Create `src/assets/data/people.json` to hold your data.

[source,json]
.src/app/shared/search/data/people.json
.src/assets/data/people.json
----
[
{
Expand Down Expand Up @@ -318,7 +318,7 @@ export class SearchService {
constructor(private http: Http) {}

getAll() {
return this.http.get('app/shared/search/data/people.json').map((res: Response) => res.json());
return this.http.get('assets/data/people.json').map((res: Response) => res.json());
}
}

Expand Down Expand Up @@ -934,7 +934,7 @@ it('should retrieve all search results',
inject([SearchService, MockBackend], fakeAsync((searchService: SearchService, mockBackend: MockBackend) => {
let res: Response;
mockBackend.connections.subscribe(c => {
expect(c.request.url).toBe('app/shared/search/data/people.json');
expect(c.request.url).toBe('assets/data/people.json');
let response = new ResponseOptions({body: '[{"name": "John Elway"}, {"name": "Gary Kubiak"}]'});
c.mockRespond(new Response(response));
});
Expand All @@ -959,7 +959,7 @@ it('should filter by search term',
inject([SearchService, MockBackend], fakeAsync((searchService: SearchService, mockBackend: MockBackend) => {
let res;
mockBackend.connections.subscribe(c => {
expect(c.request.url).toBe('app/shared/search/data/people.json');
expect(c.request.url).toBe('assets/data/people.json');
let response = new ResponseOptions({body: '[{"name": "John Elway"}, {"name": "Gary Kubiak"}]'});
c.mockRespond(new Response(response));
});
Expand All @@ -975,7 +975,7 @@ it('should fetch by id',
inject([SearchService, MockBackend], fakeAsync((searchService: SearchService, mockBackend: MockBackend) => {
let res;
mockBackend.connections.subscribe(c => {
expect(c.request.url).toBe('app/shared/search/data/people.json');
expect(c.request.url).toBe('assets/data/people.json');
let response = new ResponseOptions({body: '[{"id": 1, "name": "John Elway"}, {"id": 2, "name": "Gary Kubiak"}]'});
c.mockRespond(new Response(response));
});
Expand Down
8 changes: 2 additions & 6 deletions README.md
@@ -1,6 +1,6 @@
# NgDemo

This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.28.3.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0-beta.32.3.

## Development server
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.
Expand All @@ -22,10 +22,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Deploying to GitHub Pages

Run `ng github-pages:deploy` to deploy to GitHub Pages.

## Further help

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).
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).
2 changes: 1 addition & 1 deletion e2e/app.e2e-spec.ts
@@ -1,6 +1,6 @@
import { NgDemoPage } from './app.po';

describe('ng-demo App', function() {
describe('ng-demo App', () => {
let page: NgDemoPage;

beforeEach(() => {
Expand Down
5 changes: 4 additions & 1 deletion e2e/tsconfig.json
Expand Up @@ -4,11 +4,14 @@
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016"
],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../dist/out-tsc-e2e",
"sourceMap": true,
"target": "es5",
"target": "es6",
"typeRoots": [
"../node_modules/@types"
]
Expand Down
26 changes: 14 additions & 12 deletions karma.conf.js
Expand Up @@ -4,35 +4,37 @@
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-remap-istanbul'),
require('angular-cli/plugins/karma')
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['angular-cli']
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
remapIstanbulReporter: {
reports: {
html: 'coverage',
lcovonly: './coverage/coverage.lcov'
}
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
config: './angular-cli.json',
config: './.angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'karma-remap-istanbul']
: ['progress'],
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
Expand Down
61 changes: 30 additions & 31 deletions package.json
@@ -1,49 +1,48 @@
{
"name": "ng-demo",
"version": "2.0.0",
"version": "2.1.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "http-server-spa public index.html 8080",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"lint": "ng lint",
"e2e": "ng e2e",
"preinstall": "npm install -g http-server-spa",
"postinstall": "ng build -prod --aot && cp -r dist/* public/. && mkdir -p public/app/shared/search/data && cp src/app/shared/search/data/people.json public/app/shared/search/data"
"postinstall": "ng build -prod --aot && cp -r dist/* public/."
},
"private": true,
"dependencies": {
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"@angular/common": "^2.4.0",
"@angular/compiler": "^2.4.0",
"@angular/core": "^2.4.0",
"@angular/forms": "^2.4.0",
"@angular/http": "^2.4.0",
"@angular/platform-browser": "^2.4.0",
"@angular/platform-browser-dynamic": "^2.4.0",
"@angular/router": "^3.4.0",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
"rxjs": "^5.1.0",
"zone.js": "^0.7.6"
},
"devDependencies": {
"@angular/compiler-cli": "^2.3.1",
"@angular/cli": "1.0.0-beta.32.3",
"@angular/compiler-cli": "^2.4.0",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.28.3",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0",
"typescript": "~2.0.3"
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0-beta.4",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.4.2",
"typescript": "~2.0.0"
}
}