Skip to content

Commit

Permalink
Merge pull request #87 from ngx-rocket/feature/upgrade
Browse files Browse the repository at this point in the history
Upgraded angular-cli files and dependencies (close #86)
  • Loading branch information
sinedied authored Jun 23, 2017
2 parents 36105d3 + 3349246 commit a03f610
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 44 deletions.
33 changes: 18 additions & 15 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ng": "ng",
"build": "npm run env && ng build --aot --prod",
"start": "ng serve --proxy-config proxy.conf.js",
"lint": "ng lint && stylelint \"src/**/*.scss\" --syntax scss && htmlhint \"src\" --config .htmlhintrc",
"lint": "ng lint --type-check && stylelint \"src/**/*.scss\" --syntax scss && htmlhint \"src\" --config .htmlhintrc",
"test": "ng test",
"test:ci": "npm run lint && ng test --single-run --code-coverage",
"e2e": "ng e2e",
Expand All @@ -16,6 +16,7 @@
"generate": "ng generate"
},
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
Expand All @@ -25,7 +26,7 @@
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.25",
"@ngx-translate/core": "^6.0.0",
"@ngx-translate/core": "^7.0.0",
"bootstrap": "4.0.0-alpha.6",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
Expand All @@ -34,31 +35,33 @@
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "^1.0.0",
"@angular/cli": "^1.1.3",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@biesbjerg/ng2-translate-extract": "^0.6.0",
"@types/jasmine": "2.5.45",
"@types/jasmine": "^2.5.52",
"@types/jasminewd2": "^2.0.2",
"@types/lodash": "^4.14.52",
"@types/node": "^8.0.1",
"codelyzer": "~2.0.0",
"@types/node": "^8.0.0",
"codelyzer": "~3.1.1",
"env2json": "^1.0.0",
"hads": "^1.3.1",
"hads": "^1.3.4",
"htmlhint": "^0.9.13",
"https-proxy-agent": "^1.0.0",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "^3.2.0",
"karma": "~1.5.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "^4.1.0",
"karma": "~1.7.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.0.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "^1.1.0",
"karma-junit-reporter": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.2",
"phantomjs-prebuilt": "^2.1.14",
"protractor": "~5.1.0",
"protractor": "~5.1.2",
"stylelint": "^7.7.1",
"stylelint-config-standard": "^16.0.0",
"ts-node": "~3.0.2",
"tslint": "~4.5.1",
"typescript": "~2.2.1"
"ts-node": "^3.1.0",
"tslint": "~5.4.3",
"typescript": "~2.3.3"
}
}
3 changes: 2 additions & 1 deletion generators/app/templates/e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types":[
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
Expand Down
18 changes: 3 additions & 15 deletions generators/app/templates/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@ module.exports = function(config) {
require('@angular/cli/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
// List of files/patterns to load in the browser
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts', 'tsx']
clearContext: false, // leave Jasmine Spec Runner output visible in browser
captureConsole: false
},
junitReporter: {
outputDir: 'reports/junit/',
Expand All @@ -37,12 +28,9 @@ module.exports = function(config) {
fixWebpackSourcePaths: true
},
angularCli: {
config: './.angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'junit', 'coverage-istanbul']
: ['progress', 'junit'],
reporters: ['progress', 'junit'],
port: 9876,
colors: true,
// Level of logging, can be: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
Expand Down
4 changes: 1 addition & 3 deletions generators/app/templates/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ exports.config = {
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
// Better console spec reporter
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/src/_index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title><%= props.appName %></title>
Expand Down
8 changes: 7 additions & 1 deletion generators/app/templates/src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
Expand Down Expand Up @@ -31,6 +31,7 @@ import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

// IE10 and IE11 requires the following for NgClass support on SVG elements
Expand Down Expand Up @@ -60,3 +61,8 @@ import 'zone.js/dist/zone'; // Included with Angular-CLI.
// Date, currency, decimal and percent pipes.
// Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
// import 'intl'; // Run `npm install --save intl`.

/*
* Need to import at least one locale-data with intl.
*/
// import 'intl/locale-data/jsonp/en';
4 changes: 2 additions & 2 deletions generators/app/templates/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
} from '@angular/platform-browser-dynamic/testing';

// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
declare var require: any;
declare const __karma__: any;
declare const require: any;

// Prevent Karma from running prematurely.
__karma__.loaded = function () {};
Expand Down
6 changes: 6 additions & 0 deletions generators/app/templates/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@

// Allow .json files imports
declare module '*.json';

// SystemJS module definition
declare var module: NodeModule;
interface NodeModule {
id: string;
}
33 changes: 27 additions & 6 deletions generators/app/templates/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
Expand All @@ -12,7 +13,10 @@
"curly": true,
"eofline": true,
"forin": true,
"import-blacklist": [true, "rxjs"],
"import-blacklist": [
true,
"rxjs"
],
"import-spacing": true,
"indent": [
true,
Expand Down Expand Up @@ -44,16 +48,24 @@
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-duplicate-variable": [
true,
"check-parameters"
],
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [true, "ignore-params"],
"no-inferrable-types": [
true,
"ignore-params"
],
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
Expand Down Expand Up @@ -104,9 +116,18 @@
"check-separator",
"check-type"
],

"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"],
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
Expand Down

0 comments on commit a03f610

Please sign in to comment.