Skip to content

Commit 3349ff8

Browse files
committed
Update lib and samples to Angular 4
1 parent 69656a4 commit 3349ff8

32 files changed

Lines changed: 1812 additions & 6780 deletions

e2e/app.e2e-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path');
22

33
import { browser, element, by } from 'protractor';
44

5-
// Using require instead of import until clodinary-core has typings and can be loaded by tsc
5+
// Using require instead of import until clodinary-core has typings and can be loaded by tsc
66
// Assumes CLOUDINARY_URL environment variable is set, see https://github.com/cloudinary/cloudinary_npm
77
const cloudinary = require('cloudinary');
88

@@ -42,7 +42,7 @@ describe('Sample photo upload E2E Tests', function () {
4242
it(`should upload a new image successfully`, () => {
4343
element(by.className('upload_link')).click();
4444

45-
expect(element(by.className('upload_button')).getText()).toEqual('Upload');
45+
expect<any>(element(by.className('upload_button')).getText()).toEqual('Upload');
4646

4747
// Set properties of file to upload
4848
element(by.className('form-control')).sendKeys(tag);

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@
4343
},
4444
"homepage": "https://github.com/cloudinary/cloudinary_angular",
4545
"dependencies": {
46-
"@angular/common": "^2.4.3",
47-
"@angular/compiler-cli": "^2.2.4",
48-
"@angular/core": "^2.4.3",
49-
"@angular/platform-server": "^2.4.3",
46+
"@angular/common": "^4.0.1",
47+
"@angular/compiler-cli": "^4.0.1",
48+
"@angular/core": "^4.0.1",
49+
"@angular/platform-server": "^4.0.1",
5050
"core-js": "^2.4.1",
51-
"reflect-metadata": "^0.1.8",
51+
"reflect-metadata": "^0.1.10",
5252
"rxjs": "^5.0.1",
53-
"zone.js": "^0.7.2"
53+
"zone.js": "^0.8.5"
5454
},
5555
"devDependencies": {
56-
"@angular/compiler": "^2.4.3",
57-
"@angular/platform-browser": "^2.4.3",
58-
"@angular/platform-browser-dynamic": "^2.4.3",
59-
"@types/jasmine": "^2.5.36",
60-
"@types/node": "^6.0.46",
61-
"@types/selenium-webdriver": "^2.53.36",
62-
"canonical-path": "0.0.2",
56+
"@angular/animations": "4.0.1",
57+
"@angular/compiler": "^4.0.1",
58+
"@angular/platform-browser": "^4.0.1",
59+
"@angular/platform-browser-dynamic": "^4.0.1",
60+
"@types/jasmine": "^2.5.47",
61+
"@types/node": "^7.0.12",
62+
"@types/selenium-webdriver": "^3.0.1",
63+
"canonical-path": "^0.0.2",
6364
"cloudinary": "^1.4.6",
6465
"cloudinary-core": "^2.1.9",
6566
"concurrently": "^3.1.0",
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
23
"project": {
3-
"name": "angular-cli-sample"
4+
"name": "angular4-cli-sample"
45
},
56
"apps": [
67
{
@@ -12,15 +13,15 @@
1213
],
1314
"index": "index.html",
1415
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
1517
"test": "test.ts",
16-
"tsconfig": "tsconfig.json",
17-
"testTsconfig": "tsconfig.json",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
1820
"prefix": "app",
1921
"styles": [
2022
"styles.css"
2123
],
22-
"scripts": [
23-
],
24+
"scripts": [],
2425
"environmentSource": "environments/environment.ts",
2526
"environments": {
2627
"dev": "environments/environment.ts",
@@ -33,20 +34,24 @@
3334
"config": "./protractor.conf.js"
3435
}
3536
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json"
40+
},
41+
{
42+
"project": "src/tsconfig.spec.json"
43+
},
44+
{
45+
"project": "e2e/tsconfig.e2e.json"
46+
}
47+
],
3648
"test": {
3749
"karma": {
3850
"config": "./karma.conf.js"
3951
}
4052
},
4153
"defaults": {
4254
"styleExt": "css",
43-
"class": {
44-
"spec": false
45-
},
46-
"component": {
47-
"spec": true,
48-
"inlineStyle": false,
49-
"inlineTemplate": false
50-
}
55+
"component": {}
5156
}
5257
}

samples/angular-cli-sample/.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

3-
# Exclude custom typings
4-
!src/typings.d.ts
5-
63
# compiled output
74
/dist
85
/tmp
6+
/out-tsc
97

108
# dependencies
119
/node_modules
@@ -17,6 +15,7 @@
1715
.c9/
1816
*.launch
1917
.settings/
18+
*.sublime-workspace
2019

2120
# IDE - VSCode
2221
.vscode/*
@@ -28,7 +27,7 @@
2827
# misc
2928
/.sass-cache
3029
/connect.lock
31-
/coverage/*
30+
/coverage
3231
/libpeerconnection.log
3332
npm-debug.log
3433
testem.log
@@ -38,6 +37,6 @@ testem.log
3837
/e2e/*.js
3938
/e2e/*.map
4039

41-
#System Files
40+
# System Files
4241
.DS_Store
4342
Thumbs.db

samples/angular-cli-sample/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# AngularCliSample
1+
# Angular4CliSample
22

3-
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.26.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
44

55
## Development server
6+
67
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.
78

89
## Code scaffolding
@@ -22,10 +23,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
2223
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
2324
Before running the tests make sure you are serving the app via `ng serve`.
2425

25-
## Deploying to GitHub Pages
26-
27-
Run `ng github-pages:deploy` to deploy to GitHub Pages.
28-
2926
## Further help
3027

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).
28+
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).

samples/angular-cli-sample/e2e/app.e2e-spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { AngularCliSamplePage } from './app.po';
1+
import { Angular4CliSamplePage } from './app.po';
22

3-
describe('angular-cli-sample App', function() {
4-
let page: AngularCliSamplePage;
3+
describe('angular4-cli-sample App', () => {
4+
let page: Angular4CliSamplePage;
55

66
beforeEach(() => {
7-
page = new AngularCliSamplePage();
7+
page = new Angular4CliSamplePage();
88
});
99

1010
it('should display message saying app works', () => {

samples/angular-cli-sample/e2e/app.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { browser, element, by } from 'protractor';
22

3-
export class AngularCliSamplePage {
3+
export class Angular4CliSamplePage {
44
navigateTo() {
55
return browser.get('/');
66
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types":[
8+
"jasmine",
9+
"node"
10+
]
11+
}
12+
}
Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,46 @@
11
{
2-
"name": "angular-cli-sample",
2+
"name": "angular4-cli-sample",
33
"version": "0.0.0",
44
"license": "MIT",
5-
"angular-cli": {},
65
"scripts": {
76
"ng": "ng",
8-
"start": "ng serve --aot --progres --target=production",
9-
"build": "ng build --aot --progres --target=production",
10-
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
7+
"start": "ng serve",
8+
"build": "ng build",
119
"test": "ng test",
12-
"pree2e": "webdriver-manager update --standalone false --gecko false",
13-
"e2e": "protractor"
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
1412
},
1513
"private": true,
1614
"dependencies": {
17-
"@angular/common": "^2.3.1",
18-
"@angular/compiler": "^2.3.1",
19-
"@angular/core": "^2.3.1",
20-
"@angular/forms": "^2.3.1",
21-
"@angular/http": "^2.3.1",
22-
"@angular/platform-browser": "^2.3.1",
23-
"@angular/platform-browser-dynamic": "^2.3.1",
24-
"@angular/router": "^3.3.1",
25-
"@cloudinary/angular": "^2.1.1",
26-
"cloudinary-core": "^2.3.0",
15+
"@angular/common": "^4.0.0",
16+
"@angular/compiler": "^4.0.0",
17+
"@angular/core": "^4.0.0",
18+
"@angular/forms": "^4.0.0",
19+
"@angular/http": "^4.0.0",
20+
"@angular/platform-browser": "^4.0.0",
21+
"@angular/platform-browser-dynamic": "^4.0.0",
22+
"@angular/router": "^4.0.0",
2723
"core-js": "^2.4.1",
28-
"lodash": "^4.17.4",
29-
"rxjs": "^5.0.1",
30-
"ts-helpers": "^1.1.1",
31-
"zone.js": "^0.7.2"
24+
"rxjs": "^5.1.0",
25+
"zone.js": "^0.8.4"
3226
},
3327
"devDependencies": {
34-
"@angular/cli": "^1.0.0-rc.1",
35-
"@angular/compiler-cli": "^2.3.1",
28+
"@angular/cli": "1.0.0",
29+
"@angular/compiler-cli": "^4.0.0",
3630
"@types/jasmine": "2.5.38",
37-
"@types/node": "^6.0.42",
38-
"codelyzer": "~2.0.0-beta.1",
39-
"jasmine-core": "2.5.2",
40-
"jasmine-spec-reporter": "2.5.0",
41-
"karma": "1.2.0",
42-
"karma-chrome-launcher": "^2.0.0",
43-
"karma-cli": "^1.0.1",
44-
"karma-jasmine": "^1.0.2",
45-
"karma-remap-istanbul": "^0.2.1",
46-
"protractor": "~4.0.13",
47-
"ts-node": "1.2.1",
48-
"tslint": "^4.3.0",
49-
"typescript": "~2.0.3"
31+
"@types/node": "~6.0.60",
32+
"codelyzer": "~2.0.0",
33+
"jasmine-core": "~2.5.2",
34+
"jasmine-spec-reporter": "~3.2.0",
35+
"karma": "~1.4.1",
36+
"karma-chrome-launcher": "~2.0.0",
37+
"karma-cli": "~1.0.1",
38+
"karma-jasmine": "~1.1.0",
39+
"karma-jasmine-html-reporter": "^0.2.2",
40+
"karma-coverage-istanbul-reporter": "^0.2.0",
41+
"protractor": "~5.1.0",
42+
"ts-node": "~2.0.0",
43+
"tslint": "~4.5.0",
44+
"typescript": "~2.2.0"
5045
}
5146
}

samples/angular-cli-sample/src/app/app.component.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
/* tslint:disable:no-unused-variable */
2-
31
import { TestBed, async } from '@angular/core/testing';
2+
43
import { AppComponent } from './app.component';
54

65
describe('AppComponent', () => {
7-
beforeEach(() => {
6+
beforeEach(async(() => {
87
TestBed.configureTestingModule({
98
declarations: [
109
AppComponent
1110
],
12-
});
13-
TestBed.compileComponents();
14-
});
11+
}).compileComponents();
12+
}));
1513

1614
it('should create the app', async(() => {
1715
const fixture = TestBed.createComponent(AppComponent);

0 commit comments

Comments
 (0)