Skip to content
This repository was archived by the owner on Nov 19, 2021. It is now read-only.

Commit 27a724f

Browse files
joshwienskyleledbetter
authored andcommitted
chore(package): upgrade to @angular/cli beta.31 (#38)
* chore(package): upgrade to @angular/cli beta.31 * refactor(form): remove deprecated lazy loading prefix * build(cli): use CLI e2e and lint tasks - linting globs are now defined in angular-cli.json
1 parent 60e1d70 commit 27a724f

23 files changed

+169
-100
lines changed

.editorconfig

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

44
[*]
5+
charset = utf-8
56
indent_style = space
67
indent_size = 2
7-
end_of_line = lf
8-
charset = utf-8
9-
trim_trailing_whitespace = true
108
insert_final_newline = true
9+
trim_trailing_whitespace = true
1110

1211
[*.md]
13-
trim_trailing_whitespace = false
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@
77

88
# dependencies
99
/node_modules
10-
/bower_components
1110

1211
# IDEs and editors
1312
/.idea
14-
/.vscode
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
19+
# IDE - VSCode
20+
.vscode/*
21+
!.vscode/settings.json
22+
!.vscode/tasks.json
23+
!.vscode/launch.json
24+
!.vscode/extensions.json
1525

1626
# misc
1727
/.sass-cache
@@ -29,3 +39,4 @@ testem.log
2939

3040
#System Files
3141
.DS_Store
42+
Thumbs.db

angular-cli.json

+25-5
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-
"version": "1.0.0-beta.26",
4+
"version": "1.0.0-beta.31",
45
"name": "covalent-quickstart"
56
},
67
"apps": [
@@ -14,10 +15,10 @@
1415
],
1516
"index": "index.html",
1617
"main": "main.ts",
18+
"polyfills": "polyfills.ts",
1719
"test": "test.ts",
1820
"tsconfig": "tsconfig.json",
1921
"prefix": "app",
20-
"mobile": false,
2122
"styles": [
2223
"styles.scss",
2324
"theme.scss",
@@ -35,13 +36,21 @@
3536
}
3637
}
3738
],
38-
"addons": [],
39-
"packages": [],
4039
"e2e": {
4140
"protractor": {
4241
"config": "./protractor.conf.js"
4342
}
4443
},
44+
"lint": [
45+
{
46+
"files": "src/**/*.ts",
47+
"project": "src/tsconfig.json"
48+
},
49+
{
50+
"files": "e2e/**/*.ts",
51+
"project": "e2e/tsconfig.json"
52+
}
53+
],
4554
"test": {
4655
"karma": {
4756
"config": "./karma.conf.js"
@@ -50,6 +59,17 @@
5059
"defaults": {
5160
"styleExt": "scss",
5261
"prefixInterfaces": false,
53-
"lazyRoutePrefix": "+"
62+
"inline": {
63+
"style": false,
64+
"template": false
65+
},
66+
"spec": {
67+
"class": false,
68+
"component": true,
69+
"directive": true,
70+
"module": false,
71+
"pipe": true,
72+
"service": true
73+
}
5474
}
5575
}

e2e/dashboard.e2e.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { browser, element, by, $, protractor } from 'protractor/globals';
1+
import { browser, by, protractor, $,element } from 'protractor';
22

33
describe('basic e2e test with loading', function(): void {
44
let EC = protractor.ExpectedConditions;

e2e/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"declaration": false,
55
"emitDecoratorMetadata": true,
66
"experimentalDecorators": true,
7+
"lib": [
8+
"es2016"
9+
],
710
"module": "commonjs",
811
"moduleResolution": "node",
912
"outDir": "../dist/out-tsc-e2e",

karma.conf.js

+16-20
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// https://karma-runner.github.io/0.13/config/configuration-file.html
33

44
module.exports = function (config) {
5-
var configuration = {
6-
basePath: '.',
7-
frameworks: ['jasmine', 'angular-cli'],
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular/cli'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
11+
require('karma-coverage-istanbul-reporter'),
1112
require('karma-firefox-launcher'),
12-
require('karma-remap-istanbul'),
13-
require('angular-cli/plugins/karma')
13+
require('@angular/cli/plugins/karma')
1414
],
1515
customLaunchers: {
1616
// chrome setup for travis CI using chromium
@@ -23,31 +23,27 @@ module.exports = function (config) {
2323
{ pattern: './src/test.ts', watched: false }
2424
],
2525
preprocessors: {
26-
'./src/test.ts': ['angular-cli']
26+
'./src/test.ts': ['@angular/cli']
2727
},
28-
remapIstanbulReporter: {
29-
reports: {
30-
html: 'coverage',
31-
lcovonly: './coverage/coverage.lcov'
32-
}
28+
mime: {
29+
'text/x-typescript': ['ts','tsx']
30+
},
31+
coverageIstanbulReporter: {
32+
reports: [ 'html', 'lcovonly' ],
33+
fixWebpackSourcePaths: true
3334
},
3435
angularCli: {
3536
config: './angular-cli.json',
3637
environment: 'dev'
3738
},
38-
mime: {
39-
'text/x-typescript': ['ts','tsx']
40-
},
41-
reporters: ['progress', 'karma-remap-istanbul'],
39+
reporters: config.angularCli && config.angularCli.codeCoverage
40+
? ['progress', 'coverage-istanbul']
41+
: ['progress'],
4242
port: 9876,
4343
colors: true,
4444
logLevel: config.LOG_INFO,
4545
autoWatch: true,
4646
browsers: ['Chrome'],
4747
singleRun: false
48-
};
49-
if (process.env.TRAVIS) {
50-
configuration.browsers = ['Chrome_travis_ci'];
51-
}
52-
config.set(configuration);
48+
});
5349
};

package.json

+8-12
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
"reusable"
1010
],
1111
"scripts": {
12-
"e2e": "protractor",
13-
"e2e-test": "protractor ./protractor.conf.js",
14-
"lint": "tslint -c ./tslint.json \"./src/**/*.ts\" -e \"./src/**/typings.d.ts\" -e \"./src/environments/**\"",
12+
"e2e": "ng e2e",
13+
"lint": "ng lint",
1514
"reinstall": "rm -rf node_modules tmp deploy dist && npm i",
1615
"postinstall": "webdriver-manager update",
1716
"start-api": "cd mock-api && covalent-data &",
@@ -68,25 +67,22 @@
6867
"devDependencies": {
6968
"@angular/compiler-cli": "2.4.5",
7069
"@types/hammerjs": "2.0.30",
71-
"@types/jasmine": "2.2.31",
72-
"@types/node": "6.0.34",
70+
"@types/jasmine": "2.5.38",
71+
"@types/node": "^6.0.42",
7372
"@types/selenium-webdriver": "2.53.36",
74-
"angular-cli": "1.0.0-beta.26",
73+
"@angular/cli": "1.0.0-beta.31",
7574
"codelyzer": "2.0.0-beta.4",
76-
"ember-cli-inject-live-reload": "1.4.0",
77-
"jasmine-core": "2.4.1",
75+
"jasmine-core": "2.5.2",
7876
"jasmine-spec-reporter": "2.5.0",
7977
"karma": "1.2.0",
8078
"karma-chrome-launcher": "2.0.0",
8179
"karma-cli": "1.0.1",
8280
"karma-jasmine": "1.0.2",
83-
"karma-remap-istanbul": "0.2.1",
81+
"karma-coverage-istanbul-reporter": "^0.2.0",
8482
"karma-firefox-launcher": "1.0.0",
8583
"karma-phantomjs-launcher": "1.0.1",
86-
"node-sass": "3.8.0",
8784
"phantomjs-prebuilt": "2.1.7",
88-
"protractor": "4.0.5",
89-
"sass-loader": "^4.0.2",
85+
"protractor": "~5.1.0",
9086
"ts-node": "1.2.1",
9187
"tslint": "^4.3.1",
9288
"typescript": "2.1.5"

protractor.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Protractor configuration file, see link for more information
2-
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
33

44
/*global jasmine */
55
var SpecReporter = require('jasmine-spec-reporter');

src/app/app.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { AppComponent } from './app.component';
1111
import { MainComponent } from './main/main.component';
1212
import { DashboardComponent } from './dashboard/dashboard.component';
1313
import { UsersComponent } from './users/users.component';
14-
import { UsersFormComponent } from './users/+form/form.component';
14+
import { UsersFormComponent } from './users/form/form.component';
1515
import { LogsComponent } from './logs/logs.component';
1616
import { FormComponent } from './form/form.component';
1717
import { DetailComponent } from './detail/detail.component';
@@ -20,7 +20,7 @@ import { DashboardProductComponent } from './dashboard-product/dashboard-product
2020
import { ProductOverviewComponent } from './dashboard-product/overview/overview.component';
2121
import { ProductStatsComponent } from './dashboard-product/stats/stats.component';
2222
import { ProductFeaturesComponent } from './dashboard-product/features/features.component';
23-
import { FeaturesFormComponent } from './dashboard-product/features/+form/form.component';
23+
import { FeaturesFormComponent } from './dashboard-product/features/form/form.component';
2424
import { TemplatesComponent } from './templates/templates.component';
2525
import { DashboardTemplateComponent } from './templates/dashboard/dashboard.component';
2626
import { EmailTemplateComponent } from './templates/email/email.component';

src/app/app.routes.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { DashboardProductComponent } from './dashboard-product/dashboard-product
66
import { ProductOverviewComponent } from './dashboard-product/overview/overview.component';
77
import { ProductStatsComponent } from './dashboard-product/stats/stats.component';
88
import { ProductFeaturesComponent } from './dashboard-product/features/features.component';
9-
import { FeaturesFormComponent } from './dashboard-product/features/+form/form.component';
9+
import { FeaturesFormComponent } from './dashboard-product/features/form/form.component';
1010
import { UsersComponent } from './users/users.component';
11-
import { UsersFormComponent } from './users/+form/form.component';
11+
import { UsersFormComponent } from './users/form/form.component';
1212
import { LogsComponent } from './logs/logs.component';
1313
import { DetailComponent } from './detail/detail.component';
1414
import { LoginComponent } from './login/login.component';

src/app/environment.ts

-7
This file was deleted.

src/app/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export {environment} from './environment';
21
export {AppModule} from './app.module';
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/environments/environment.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// The file contents for the current environment will overwrite these during build.
2+
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3+
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4+
// The list of which env maps to which file can be found in `angular-cli.json`.
5+
16
export const environment = {
27
production: false
38
};

src/main.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import './polyfills.ts';
2-
31
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
42
import { enableProdMode } from '@angular/core';
53
import { environment } from './environments/environment';

src/polyfills.ts

+66-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,69 @@
1-
// This file includes polyfills needed by Angular 2 and is loaded before
2-
// the app. You can add your own extra polyfills to this file.
3-
import 'core-js/es6/symbol';
4-
import 'core-js/es6/object';
5-
import 'core-js/es6/function';
6-
import 'core-js/es6/parse-int';
7-
import 'core-js/es6/parse-float';
8-
import 'core-js/es6/number';
9-
import 'core-js/es6/math';
10-
import 'core-js/es6/string';
11-
import 'core-js/es6/date';
12-
import 'core-js/es6/array';
13-
import 'core-js/es6/regexp';
14-
import 'core-js/es6/map';
15-
import 'core-js/es6/set';
16-
import 'core-js/es6/reflect';
1+
/*tslint:disable*/
2+
/**
3+
* This file includes polyfills needed by Angular and is loaded before the app.
4+
* You can add your own extra polyfills to this file.
5+
*
6+
* This file is divided into 2 sections:
7+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
8+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
9+
* file.
10+
*
11+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
12+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
13+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
14+
*
15+
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
16+
*/
17+
18+
/***************************************************************************************************
19+
* BROWSER POLYFILLS
20+
*/
21+
22+
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
23+
// import 'core-js/es6/symbol';
24+
// import 'core-js/es6/object';
25+
// import 'core-js/es6/function';
26+
// import 'core-js/es6/parse-int';
27+
// import 'core-js/es6/parse-float';
28+
// import 'core-js/es6/number';
29+
// import 'core-js/es6/math';
30+
// import 'core-js/es6/string';
31+
// import 'core-js/es6/date';
32+
// import 'core-js/es6/array';
33+
// import 'core-js/es6/regexp';
34+
// import 'core-js/es6/map';
35+
// import 'core-js/es6/set';
36+
37+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
38+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
1739

40+
/** IE10 and IE11 requires the following to support `@angular/animation`. */
41+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
42+
43+
44+
/** Evergreen browsers require these. **/
45+
import 'core-js/es6/reflect';
1846
import 'core-js/es7/reflect';
19-
import 'zone.js/dist/zone';
2047

21-
import 'rxjs/Rx';
48+
49+
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
50+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
51+
52+
53+
54+
/***************************************************************************************************
55+
* Zone JS is required by Angular itself.
56+
*/
57+
import 'zone.js/dist/zone'; // Included with Angular-CLI.
58+
59+
60+
61+
/***************************************************************************************************
62+
* APPLICATION IMPORTS
63+
*/
64+
65+
/**
66+
* Date, currency, decimal and percent pipes.
67+
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
68+
*/
69+
// import 'intl'; // Run `npm install --save intl`.

0 commit comments

Comments
 (0)