Skip to content

Commit c8bea6b

Browse files
committed
docs(upgrade) get project structure up to date with the latest in angular/angular-phonecat#289
1 parent d07ea04 commit c8bea6b

File tree

275 files changed

+455
-435
lines changed

Some content is hidden

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

275 files changed

+455
-435
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "src/bower_components"
2+
"directory": "app/bower_components"
33
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
src/app/**/*.js
2-
src/app/**/*.js.map
3-
src/test/unit/**/*.js
4-
src/test/unit/**/*.js.map
5-
src/test/e2e/**/*.js
6-
src/test/e2e/**/*.js.map
1+
app/**/*.js
2+
app/**/*.js.map
3+
test/unit/**/*.js
4+
test/unit/**/*.js.map
5+
test/e2e/**/*.js
6+
test/e2e/**/*.js.map

public/docs/_examples/upgrade/ts/classes/src/index.html renamed to public/docs/_examples/upgrade/ts/classes/app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<script src="bower_components/angular-resource/angular-resource.js"></script>
1616
<script>
1717
System.config({
18-
packages: {'app': {defaultExtension: 'js'}}
18+
packages: {'js': {defaultExtension: 'js'}}
1919
});
20-
System.import('app/app');
20+
System.import('js/app.module');
2121
</script>
2222
<!-- #enddocregion scripts -->
2323
</head>

public/docs/_examples/upgrade/ts/classes/src/app/app.ts renamed to public/docs/_examples/upgrade/ts/classes/app/js/app.module.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
/// <reference path="../../typings/angularjs/angular-route.d.ts" />
66
// #enddocregion
77

8-
import core from './core/core';
9-
import phoneList from './phone_list/phone_list';
10-
import phoneDetail from './phone_detail/phone_detail';
8+
import core from './core/core.module';
9+
import phoneList from './phone_list/phone_list.module';
10+
import phoneDetail from './phone_detail/phone_detail.module';
1111

1212
angular.module('phonecatApp', [
1313
'ngRoute',
@@ -21,12 +21,12 @@ configure.$inject = ['$routeProvider'];
2121
function configure($routeProvider) {
2222
$routeProvider.
2323
when('/phones', {
24-
templateUrl: 'app/phone_list/phone_list.html',
24+
templateUrl: 'js/phone_list/phone_list.html',
2525
controller: 'PhoneListCtrl',
2626
controllerAs: 'vm'
2727
}).
2828
when('/phones/:phoneId', {
29-
templateUrl: 'app/phone_detail/phone_detail.html',
29+
templateUrl: 'js/phone_detail/phone_detail.html',
3030
controller: 'PhoneDetailCtrl',
3131
controllerAs: 'vm'
3232
}).

public/docs/_examples/upgrade/ts/classes/src/app/core/core.ts renamed to public/docs/_examples/upgrade/ts/classes/app/js/core/core.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
2-
import Phone from './phone_factory';
3-
import checkmarkFilter from './checkmark_filter';
2+
import Phone from './phone.factory';
3+
import checkmarkFilter from './checkmark.filter';
44

55
export default angular.module('phonecat.core', [
66
'ngResource'

public/docs/_examples/upgrade/ts/ng2_initial/src/app/phone_detail/phone_detail.ts renamed to public/docs/_examples/upgrade/ts/classes/app/js/phone_detail/phone_detail.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion
2-
import PhoneDetailCtrl from './phone_detail_controller';
2+
import PhoneDetailCtrl from './phone_detail.controller';
33

44
export default angular.module('phonecat.detail', [
55
'ngRoute',
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion
2-
import PhoneListCtrl from './phone_list_controller';
2+
import PhoneListCtrl from './phone_list.controller';
33

44
export default angular.module('phonecat.list', ['phonecat.core'])
55
.controller('PhoneListCtrl', PhoneListCtrl);

public/docs/_examples/upgrade/ts/classes/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"start": "http-server -a 0.0.0.0 -p 8000",
2828

2929
"pretest": "npm install",
30-
"test": "node node_modules/karma/bin/karma start src/test/karma.conf.js",
31-
"test-single-run": "node node_modules/karma/bin/karma start src/test/karma.conf.js --single-run",
30+
"test": "node node_modules/karma/bin/karma start test/karma.conf.js",
31+
"test-single-run": "node node_modules/karma/bin/karma start test/karma.conf.js --single-run",
3232

3333
"preupdate-webdriver": "npm install",
3434
"update-webdriver": "webdriver-manager update",
3535

3636
"preprotractor": "npm run update-webdriver",
37-
"protractor": "protractor src/test/protractor-conf.js",
37+
"protractor": "protractor test/protractor-conf.js",
3838

39-
"tsc": "tsc -p src -w"
39+
"tsc": "tsc -p . -w"
4040
}
4141
}

public/docs/_examples/upgrade/ts/classes/src/test/test_helper.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

public/docs/_examples/upgrade/ts/classes/src/test/e2e/scenarios.ts renamed to public/docs/_examples/upgrade/ts/classes/test/e2e/scenarios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ declare var browser:any, element:any, by:any;
88
describe('PhoneCat App', function() {
99

1010
it('should redirect index.html to index.html#/phones', function() {
11-
browser.get('src/index.html');
11+
browser.get('app/index.html');
1212
browser.getLocationAbsUrl().then(function(url) {
1313
expect(url).toEqual('/phones');
1414
});
@@ -18,7 +18,7 @@ describe('PhoneCat App', function() {
1818
describe('Phone list view', function() {
1919

2020
beforeEach(function() {
21-
browser.get('src/index.html#/phones');
21+
browser.get('app/index.html#/phones');
2222
});
2323

2424

@@ -78,7 +78,7 @@ describe('PhoneCat App', function() {
7878
describe('Phone detail view', function() {
7979

8080
beforeEach(function() {
81-
browser.get('src/index.html#/phones/nexus-s');
81+
browser.get('app/index.html#/phones/nexus-s');
8282
});
8383

8484

public/docs/_examples/upgrade/ts/classes/src/test/karma.conf.js renamed to public/docs/_examples/upgrade/ts/classes/test/karma.conf.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module.exports = function(config){
22
config.set({
33

4-
basePath : '../..',
4+
basePath : '..',
55

66
// #docregion files
77
files : [
8-
'src/bower_components/angular/angular.js',
9-
'src/bower_components/angular-route/angular-route.js',
10-
'src/bower_components/angular-resource/angular-resource.js',
11-
'src/bower_components/angular-animate/angular-animate.js',
12-
'src/bower_components/angular-mocks/angular-mocks.js',
8+
'app/bower_components/angular/angular.js',
9+
'app/bower_components/angular-route/angular-route.js',
10+
'app/bower_components/angular-resource/angular-resource.js',
11+
'app/bower_components/angular-animate/angular-animate.js',
12+
'app/bower_components/angular-mocks/angular-mocks.js',
1313
'node_modules/systemjs/dist/system.src.js',
14-
'src/test/karma_test_shim.js',
15-
{pattern: 'src/app/**/*.js', included: false, watched: true},
16-
{pattern: 'src/test/unit/**/*.js', included: false, watched: true}
14+
'test/karma_test_shim.js',
15+
{pattern: 'app/js/**/*.js', included: false, watched: true},
16+
{pattern: 'test/unit/**/*.js', included: false, watched: true}
1717
],
1818
// #enddocregion files
1919

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ __karma__.loaded = function() {};
55

66
System.config({
77
packages: {
8-
'base/src/app': {
8+
'base/app/js': {
99
defaultExtension: false,
1010
format: 'register',
1111
map: Object.keys(window.__karma__.files).
1212
filter(onlyAppFiles).
1313
reduce(function createPathRecords(pathsMapping, appPath) {
1414
// creates local module name mapping to global path with karma's fingerprint in path, e.g.:
1515
// './hero.service': '/base/src/app/hero.service.js?f4523daf879cfb7310ef6242682ccf10b2041b3e'
16-
var moduleName = appPath.replace(/^\/base\/src\/app\//, './').replace(/\.js$/, '');
16+
var moduleName = appPath.replace(/^\/base\/app\/js\//, './').replace(/\.js$/, '');
1717
pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath]
1818
return pathsMapping;
1919
}, {})
@@ -36,9 +36,9 @@ Promise.all(
3636
});
3737

3838
function onlyAppFiles(filePath) {
39-
return /^\/base\/src\/app\/.*\.js$/.test(filePath)
39+
return /^\/base\/app\/js\/.*\.js$/.test(filePath)
4040
}
4141

4242
function onlySpecFiles(path) {
43-
return /_spec\.js$/.test(path);
43+
return /\.spec\.js$/.test(path);
4444
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// #docregion
2+
/// <reference path="../typings/jasmine/jasmine.d.ts" />
3+
/// <reference path="../typings/angularjs/angular-mocks.d.ts" />

public/docs/_examples/upgrade/ts/classes/src/test/unit/checkmark_filter_spec.ts renamed to public/docs/_examples/upgrade/ts/classes/test/unit/checkmark.filter.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion top
2-
import '../../app/core/core';
2+
import '../../app/js/core/core.module';
33
// #enddocregion top
44

55
describe('checkmarkFilter', function() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion top
2-
import '../../app/core/core';
2+
import '../../app/js/core/core.module';
33
// #enddocregion top
44

55
describe('phoneFactory', function() {

public/docs/_examples/upgrade/ts/classes/src/test/unit/phone_detail_controller_spec.ts renamed to public/docs/_examples/upgrade/ts/classes/test/unit/phone_detail.controller.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion top
2-
import '../../app/phone_detail/phone_detail';
2+
import '../../app/js/phone_detail/phone_detail.module';
33
// #enddocregion top
44

55
describe('PhoneDetailCtrl', function(){

public/docs/_examples/upgrade/ts/classes/src/test/unit/phone_list_controller_spec.ts renamed to public/docs/_examples/upgrade/ts/classes/test/unit/phone_list.controller.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion top
2-
import '../../app/phone_list/phone_list';
2+
import '../../app/js/phone_list/phone_list.module';
33
// #enddocregion top
44

55
describe('PhoneListCtrl', function(){

public/docs/_examples/upgrade/ts/classes/src/tsconfig.json renamed to public/docs/_examples/upgrade/ts/classes/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
"emitDecoratorMetadata": true,
77
"experimentalDecorators": true,
88
"removeComments": false
9-
}
9+
},
10+
"exclude": [
11+
"node_modules"
12+
]
1013
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "src/bower_components"
2+
"directory": "app/bower_components"
33
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
src/app/**/*.js
2-
src/app/**/*.js.map
3-
src/test/unit/**/*.js
4-
src/test/unit/**/*.js.map
5-
src/test/e2e/**/*.js
6-
src/test/e2e/**/*.js.map
1+
app/**/*.js
2+
app/**/*.js.map
3+
test/unit/**/*.js
4+
test/unit/**/*.js.map
5+
test/e2e/**/*.js
6+
test/e2e/**/*.js.map

public/docs/_examples/upgrade/ts/ng2_components/src/index.html renamed to public/docs/_examples/upgrade/ts/ng2_components/app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<script>
1818
System.config({
1919
packages: {
20-
'app': {
20+
'js': {
2121
defaultExtension: 'js'
2222
},
2323
'../node_modules/rxjs': {
@@ -29,7 +29,7 @@
2929
'rxjs/operator/*': '../node_modules/rxjs/add/operator/*.js'
3030
}
3131
});
32-
System.import('app/app');
32+
System.import('js/app.module');
3333
</script>
3434
</head>
3535
<body>

public/docs/_examples/upgrade/ts/ng2_components/src/app/app.ts renamed to public/docs/_examples/upgrade/ts/ng2_components/app/js/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import upgradeAdapter from './core/upgrade_adapter';
1111
// #docregion http-import
1212
import {HTTP_PROVIDERS} from 'angular2/http';
1313
// #enddocregion http-import
14-
import core from './core/core';
15-
import phoneList from './phone_list/phone_list';
16-
import phoneDetail from './phone_detail/phone_detail';
14+
import core from './core/core.module';
15+
import phoneList from './phone_list/phone_list.module';
16+
import phoneDetail from './phone_detail/phone_detail.module';
1717

1818
upgradeAdapter.addProvider(HTTP_PROVIDERS);
1919
// #docregion upgrade-route-params

public/docs/_examples/upgrade/ts/ng2_components/src/app/phone_detail/PhoneDetail.ts renamed to public/docs/_examples/upgrade/ts/ng2_components/app/js/phone_detail/PhoneDetail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface PhoneRouteParams {
1010

1111
@Component({
1212
selector: 'pc-phone-detail',
13-
templateUrl: 'app/phone_detail/phone_detail.html',
13+
templateUrl: 'js/phone_detail/phone_detail.html',
1414
pipes: [CheckmarkPipe]
1515
})
1616
class PhoneDetail {

public/docs/_examples/upgrade/ts/ng2_components/src/app/phone_detail/PhoneDetail_without_pipes.ts renamed to public/docs/_examples/upgrade/ts/ng2_components/app/js/phone_detail/PhoneDetail_without_pipes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface PhoneRouteParams {
88

99
@Component({
1010
selector: 'pc-phone-detail',
11-
templateUrl: 'app/phone_detail/phone_detail.html'
11+
templateUrl: 'js/phone_detail/phone_detail.html'
1212
})
1313
class PhoneDetail {
1414
phone:Phone = undefined;

public/docs/_examples/upgrade/ts/ng2_components/src/app/phone_list/PhoneList.ts renamed to public/docs/_examples/upgrade/ts/ng2_components/app/js/phone_list/PhoneList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import OrderByPipe from './OrderByPipe';
77

88
@Component({
99
selector: 'pc-phone-list',
10-
templateUrl: 'app/phone_list/phone_list.html',
10+
templateUrl: 'js/phone_list/phone_list.html',
1111
pipes: [PhoneFilterPipe, OrderByPipe],
1212
})
1313
class PhoneList {

public/docs/_examples/upgrade/ts/ng2_components/src/app/phone_list/PhoneList_without_pipes.ts renamed to public/docs/_examples/upgrade/ts/ng2_components/app/js/phone_list/PhoneList_without_pipes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {Phones, Phone} from '../core/Phones';
44

55
@Component({
66
selector: 'pc-phone-list',
7-
templateUrl: 'app/phone_list/phone_list.html'
7+
templateUrl: 'js/phone_list/phone_list.html'
88
})
99
class PhoneList {
1010
// #enddocregion top

public/docs/_examples/upgrade/ts/ng2_components/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
"start": "http-server -a 0.0.0.0 -p 8000",
2929

3030
"pretest": "npm install",
31-
"test": "node node_modules/karma/bin/karma start src/test/karma.conf.js",
32-
"test-single-run": "node node_modules/karma/bin/karma start src/test/karma.conf.js --single-run",
31+
"test": "node node_modules/karma/bin/karma start test/karma.conf.js",
32+
"test-single-run": "node node_modules/karma/bin/karma start test/karma.conf.js --single-run",
3333

3434
"preupdate-webdriver": "npm install",
3535
"update-webdriver": "webdriver-manager update",
3636

3737
"preprotractor": "npm run update-webdriver",
38-
"protractor": "protractor src/test/protractor-conf.js",
38+
"protractor": "protractor test/protractor-conf.js",
3939

40-
"tsc": "tsc -p src -w"
40+
"tsc": "tsc -p . -w"
4141
}
4242
}

public/docs/_examples/upgrade/ts/ng2_components/src/test/test_helper.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/docs/_examples/upgrade/ts/ng2_components/src/test/e2e/scenarios.ts renamed to public/docs/_examples/upgrade/ts/ng2_components/test/e2e/scenarios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe('PhoneCat App', function() {
66

77
it('should redirect index.html to index.html#/phones', function() {
8-
browser.get('src/index.html');
8+
browser.get('app/index.html');
99
browser.getLocationAbsUrl().then(function(url) {
1010
expect(url).toEqual('/phones');
1111
});
@@ -15,7 +15,7 @@ describe('PhoneCat App', function() {
1515
describe('Phone list view', function() {
1616

1717
beforeEach(function() {
18-
browser.get('src/index.html#/phones');
18+
browser.get('app/index.html#/phones');
1919
});
2020

2121
it('should filter the phone list as a user types into the search box', function() {
@@ -87,7 +87,7 @@ describe('PhoneCat App', function() {
8787
describe('Phone detail view', function() {
8888

8989
beforeEach(function() {
90-
browser.get('src/index.html#/phones/nexus-s');
90+
browser.get('app/index.html#/phones/nexus-s');
9191
});
9292

9393

0 commit comments

Comments
 (0)