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 all dependencies #410

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 40 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"scripts": {
"start": "npm run server",
"build": "NODE_ENV=production webpack --config webpack-build.config.js",
"build:dev": "webpack --progress --profile --colors --display-error-details --display-cached",
"build:dev": "webpack --progress --profile --colors",
"test": "karma start",
"test:ci": "karma start --browsers Firefox",
"test:watch": "npm run test -- --auto-watch --no-single-run",
"clean": "rimraf doc/ coverage/ dist/",
"server": "webpack-dev-server --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/"
"server": "webpack-dev-server --inline --progress --profile --colors --watch --content-base src/"
},
"keywords": [],
"contributors": [
Expand All @@ -24,54 +24,53 @@
],
"license": "ISC",
"dependencies": {
"@types/angular": "1.5.22",
"@types/core-js": "0.9.35",
"angular": "1.6.1",
"angular": "1.6.4",
"core-js": "2.4.1",
"ng-metadata": "4.0.0",
"reflect-metadata": "0.1.9",
"rxjs": "5.0.2",
"tslib": "1.4.0"
"ng-metadata": "4.0.1",
"rxjs": "5.4.1",
"tslib": "1.7.1",
"zone.js": "0.8.12"
},
"devDependencies": {
"@angular/compiler": "2.4.1",
"@angular/core": "2.4.1",
"@types/angular-mocks": "1.5.8",
"@types/jasmine": "2.5.38",
"@types/lodash": "4.14.37",
"@types/node": "6.0.53",
"angular-mocks": "1.6.1",
"awesome-typescript-loader": "3.0.0-beta.17",
"codelyzer": "2.0.0-beta.4",
"@angular/compiler": "4.2.4",
"@angular/core": "4.2.4",
"@types/angular": "1.6.22",
"@types/angular-mocks": "1.5.10",
"@types/core-js": "0.9.42",
"@types/jasmine": "2.5.53",
"@types/lodash": "4.14.66",
"@types/node": "8.0.3",
"angular-mocks": "1.6.4",
"awesome-typescript-loader": "3.1.3",
"codelyzer": "3.1.1",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.26.1",
"html-webpack-plugin": "2.24.1",
"istanbul-instrumenter-loader": "1.2.0",
"jasmine-core": "2.5.2",
"css-loader": "0.28.4",
"html-webpack-plugin": "2.29.0",
"istanbul-instrumenter-loader": "2.0.0",
"jasmine-core": "2.6.4",
"json-loader": "0.5.4",
"karma": "1.3.0",
"karma-chrome-launcher": "2.0.0",
"karma": "1.7.0",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.1",
"karma-firefox-launcher": "1.0.0",
"karma-firefox-launcher": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-mocha-reporter": "2.2.1",
"karma-phantomjs-launcher": "1.0.2",
"karma-mocha-reporter": "2.2.3",
"karma-phantomjs-launcher": "1.0.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "1.8.1",
"lodash": "4.17.3",
"node-sass": "4.1.1",
"karma-webpack": "2.0.3",
"lodash": "4.17.4",
"node-sass": "4.5.3",
"raw-loader": "0.5.1",
"remap-istanbul": "0.8.4",
"rimraf": "2.5.4",
"sass-loader": "4.1.1",
"source-map-loader": "0.1.5",
"style-loader": "0.13.1",
"tslint": "4.2.0",
"tslint-loader": "3.3.0",
"typescript": "2.1.4",
"webpack": "1.14.0",
"webpack-dev-server": "1.16.2",
"zone.js": "0.7.4"
"remap-istanbul": "0.9.5",
"rimraf": "2.6.1",
"sass-loader": "6.0.6",
"source-map-loader": "0.2.1",
"style-loader": "0.18.2",
"tslint": "5.4.3",
"tslint-loader": "3.5.3",
"typescript": "2.3.4",
"webpack": "3.0.0",
"webpack-dev-server": "2.5.0"
},
"engines": {
"node": ">= 6.x",
Expand Down
16 changes: 8 additions & 8 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE html>
<html lang="<%= webpackConfig.metadata.lang %>">
<html lang="<%= htmlWebpackPlugin.options.metadata.lang %>">
<head>

<title><%= webpackConfig.metadata.title %></title>
<title><%= htmlWebpackPlugin.options.metadata.title %></title>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%= webpackConfig.metadata.title %>">
<meta name="description" content="<%= htmlWebpackPlugin.options.metadata.title %>">

<!-- base url -->
<base href="<%= webpackConfig.metadata.baseUrl %>">
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">

</head>

Expand All @@ -22,16 +22,16 @@

<img src="images/pluto-the-planet.jpg">

<% if (webpackConfig.metadata.googleAnalytics) { %>
<% if (htmlWebpackPlugin.options.metadata.googleAnalytics) { %>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
<% if (webpackConfig.metadata.googleAnalytics.trackingId) { %>
ga('create', '<%= webpackConfig.metadata.googleAnalytics.trackingId%>', 'auto');
<% if (htmlWebpackPlugin.options.metadata.googleAnalytics.trackingId) { %>
ga('create', '<%= htmlWebpackPlugin.options.metadata.googleAnalytics.trackingId%>', 'auto');
<% } else { throw new Error("html-webpack-template requires googleAnalytics.trackingId config"); }%>
<% if (webpackConfig.metadata.googleAnalytics.pageViewOnLoad) { %>
<% if (htmlWebpackPlugin.options.metadata.pageViewOnLoad) { %>
ga('send', 'pageview');
<% } %>
</script>
Expand Down
3 changes: 1 addition & 2 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'core-js/es6/weak-map';
import 'core-js/es6/weak-set';
import 'core-js/es6/typed';
import 'core-js/es6/reflect';

import 'reflect-metadata';
import 'core-js/es7/reflect';

import 'tslib';
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"pretty": true,
"stripInternal": true,
"noEmitHelpers": true,
"outDir": "ts-out"
"importHelpers": true,
"outDir": "ts-out",
"lib": ["dom", "es6", "es2015", "es2016", "es2017"]
},
"exclude": [
"node_modules"
],
"compileOnSave": false
}
}
28 changes: 2 additions & 26 deletions webpack-build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,10 @@ const webpack = require( 'webpack' );

const webpackConfig = require( './webpack.config' );

/**
* Static analysis linter for TypeScript advanced options configuration
* Description: An extensible linter for the TypeScript language.
*
* See: https://github.com/wbuchwalter/tslint-loader
*/
const tslintConfig = {
emitErrors: true,
failOnHint: true
};

const webpackConfigPlugins = [
// Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin
// Only emit files when there are no errors
new webpack.NoErrorsPlugin(),

// Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin
// Dedupe modules in the output
new webpack.optimize.DedupePlugin(),

// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
// Minify all javascript, switch loaders to minimizing mode
new webpack.optimize.UglifyJsPlugin( {
compress: {
warnings: false
}
} )
new webpack.NoEmitOnErrorsPlugin()
];

webpackConfig.plugins.push.apply( webpackConfig.plugins, webpackConfigPlugins );
Expand All @@ -38,8 +15,7 @@ Object.assign( webpackConfig, {
output: Object.assign( webpackConfig.output, {
// Path where bundle files will be served on production env
publicPath: '/'
} ),
tslint: Object.assign( webpackConfig.tslint, tslintConfig )
} )
} );

module.exports = webpackConfig;
101 changes: 67 additions & 34 deletions webpack-test.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
const webpack = require( 'webpack' );
const webpackConfig = require( './webpack.config' );

/**
* Webpack Plugins
*/
const DefinePlugin = require('webpack/lib/DefinePlugin');

/**
* Webpack Constants
*/
const ENV = (process.env.NODE_ENV || 'development');

/**
* Source map for Karma from the help of karma-sourcemap-loader & karma-webpack
Expand All @@ -10,47 +19,71 @@ const webpackConfig = require( './webpack.config' );
*/
const webpackDevtool = 'inline-source-map';

const webpackPostLoaders = [

/**
* Instruments JS files with Istanbul for subsequent code coverage reporting.
* Instrument only testing sources.
*
* See: https://github.com/deepsweet/istanbul-instrumenter-loader
*/
{
test: /\.(js|ts)$/,
loader: 'istanbul-instrumenter-loader',
include: webpackConfig.resolve.root,
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/,
// @TODO this is temporary, will remove when typescript-helpers will be extracted to separate package
/(polyfills|vendor)\.ts$/
]
}
];
const webpackLoaders = [

/**
* Instruments JS files with Istanbul for subsequent code coverage reporting.
* Instrument only testing sources.
*
* See: https://github.com/deepsweet/istanbul-instrumenter-loader
*/
{
test: /\.(js|ts)$/,
loader: 'istanbul-instrumenter-loader',
enforce: 'post',
include: webpackConfig.resolve.root,
exclude: [
/\.(e2e|spec)\.ts$/,
/node_modules/,
// @TODO this is temporary, will remove when typescript-helpers will be extracted to separate package
/(polyfills|vendor)\.ts$/
]
}
];

const webpackConfigPlugins = [

/**
* Plugin: DefinePlugin
* Description: Define free variables.
* Useful for having development builds with debug logging or adding global constants.
*
* Environment helpers
*
* See: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
*/
// NOTE: when adding more properties, make sure you include them in globals.d.ts
new DefinePlugin({
ENV : ENV,
'process.env' : {
ENV : ENV,
NODE_ENV : ENV
}
})

];

const webpackNode = {
/**
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
process: false
/**
* Include polyfills or mocks for various node stuff
* Description: Node configuration
*
* See: https://webpack.github.io/docs/configuration.html#node
*/
process: false
};

Object.assign( webpackConfig, {
entry: {},
output: {},
devtool: webpackDevtool,
watch: false,
plugins: [],
node: Object.assign( webpackConfig.node, webpackNode )
devtool: webpackDevtool,
watch: false,
plugins: [], // clear plugins
node: Object.assign( webpackConfig.node, webpackNode )
} );
Object.assign( webpackConfig, {
plugins: webpackConfigPlugins
} );
Object.assign( webpackConfig.module, {
postLoaders: webpackPostLoaders
loaders: Object.assign( webpackConfig.module.loaders, webpackLoaders )
} );

module.exports = webpackConfig;
Loading