Upgrade to angular-cli and Angular 4pull/223/head
@ -0,0 +1,58 @@ | |||
{ | |||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |||
"project": { | |||
"name": "WebSPA" | |||
}, | |||
"apps": [ | |||
{ | |||
"root": "Client", | |||
"outDir": "wwwroot", | |||
"assets": [ | |||
"assets", | |||
"favicon.ico" | |||
], | |||
"index": "index.html", | |||
"main": "main.ts", | |||
"polyfills": "polyfills.ts", | |||
"test": "test.ts", | |||
"tsconfig": "tsconfig.app.json", | |||
"testTsconfig": "tsconfig.spec.json", | |||
"prefix": "app", | |||
"styles": [ | |||
"globals.scss", | |||
"../node_modules/bootstrap/scss/bootstrap.scss" | |||
], | |||
"scripts": [], | |||
"environmentSource": "environments/environment.ts", | |||
"environments": { | |||
"dev": "environments/environment.ts", | |||
"prod": "environments/environment.prod.ts" | |||
} | |||
} | |||
], | |||
"e2e": { | |||
"protractor": { | |||
"config": "./protractor.conf.js" | |||
} | |||
}, | |||
"lint": [ | |||
{ | |||
"project": "Client/tsconfig.app.json" | |||
}, | |||
{ | |||
"project": "Client/tsconfig.spec.json" | |||
}, | |||
{ | |||
"project": "e2e/tsconfig.e2e.json" | |||
} | |||
], | |||
"test": { | |||
"karma": { | |||
"config": "./karma.conf.js" | |||
} | |||
}, | |||
"defaults": { | |||
"styleExt": "scss", | |||
"component": {} | |||
} | |||
} |
@ -1,2 +0,0 @@ | |||
// Extra variables that live on Global that will be replaced by webpack DefinePlugin | |||
// declare var process: any; |
@ -0,0 +1,3 @@ | |||
export const environment = { | |||
production: true | |||
}; |
@ -0,0 +1,8 @@ | |||
// The file contents for the current environment will overwrite these during build. | |||
// The build system defaults to the dev environment which uses `environment.ts`, but if you do | |||
// `ng build --env=prod` then `environment.prod.ts` will be used instead. | |||
// The list of which env maps to which file can be found in `.angular-cli.json`. | |||
export const environment = { | |||
production: false | |||
}; |
@ -0,0 +1,18 @@ | |||
<!doctype html> | |||
<html> | |||
<head> | |||
<meta charset="utf-8"> | |||
<title>eShopConContainers.WebSPA</title> | |||
<base href="/"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | |||
</head> | |||
<body> | |||
<esh-app> | |||
<div class="preloading"> | |||
<i class="fa fa-spinner fa-spin fa-5x" aria-hidden="true"></i> | |||
</div> | |||
</esh-app> | |||
</body> | |||
</html> |
@ -1,23 +1,11 @@ | |||
import './polyfills'; | |||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |||
import { enableProdMode } from '@angular/core'; | |||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |||
import { AppModule } from './modules/app.module'; | |||
import { AppModule } from './modules/app.module'; | |||
import { environment } from './environments/environment'; | |||
if (process.env.ENV === 'Development') { | |||
// Development | |||
} else { | |||
// Production | |||
if (environment.production) { | |||
enableProdMode(); | |||
} | |||
platformBrowserDynamic().bootstrapModule(AppModule); | |||
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time | |||
// you modify source files. This will not preserve any application state other than the URL. | |||
declare var module: any; | |||
if (module.hot) { | |||
module.hot.accept(); | |||
} |
@ -0,0 +1,14 @@ | |||
import {IOrderItem} from './orderItem.model'; | |||
export interface IOrderDetail { | |||
ordernumber: string; | |||
status: string; | |||
street: string; | |||
date: Date; | |||
city: number; | |||
state: string; | |||
zipcode: string; | |||
country: number; | |||
total: number; | |||
orderitems: IOrderItem[]; | |||
} |
@ -1,23 +1,68 @@ | |||
// Added parts of es6 which are necessary for your project or your browser support requirements. | |||
import 'core-js/es6/symbol'; | |||
import 'core-js/es6/object'; | |||
import 'core-js/es6/function'; | |||
import 'core-js/es6/parse-int'; | |||
import 'core-js/es6/parse-float'; | |||
import 'core-js/es6/number'; | |||
import 'core-js/es6/math'; | |||
import 'core-js/es6/string'; | |||
import 'core-js/es6/date'; | |||
import 'core-js/es6/array'; | |||
import 'core-js/es6/regexp'; | |||
import 'core-js/es6/map'; | |||
import 'core-js/es6/set'; | |||
import 'core-js/es6/weak-map'; | |||
import 'core-js/es6/weak-set'; | |||
import 'core-js/es6/typed'; | |||
import 'core-js/es6/reflect'; | |||
// see issue https://github.com/AngularClass/angular2-webpack-starter/issues/709 | |||
// import 'core-js/es6/promise'; | |||
/** | |||
* This file includes polyfills needed by Angular and is loaded before the app. | |||
* You can add your own extra polyfills to this file. | |||
* | |||
* This file is divided into 2 sections: | |||
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. | |||
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main | |||
* file. | |||
* | |||
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that | |||
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), | |||
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. | |||
* | |||
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html | |||
*/ | |||
/*************************************************************************************************** | |||
* BROWSER POLYFILLS | |||
*/ | |||
/** IE9, IE10 and IE11 requires all of the following polyfills. **/ | |||
// import 'core-js/es6/symbol'; | |||
// import 'core-js/es6/object'; | |||
// import 'core-js/es6/function'; | |||
// import 'core-js/es6/parse-int'; | |||
// import 'core-js/es6/parse-float'; | |||
// import 'core-js/es6/number'; | |||
// import 'core-js/es6/math'; | |||
// import 'core-js/es6/string'; | |||
// import 'core-js/es6/date'; | |||
// import 'core-js/es6/array'; | |||
// import 'core-js/es6/regexp'; | |||
// import 'core-js/es6/map'; | |||
// import 'core-js/es6/set'; | |||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */ | |||
// import 'classlist.js'; // Run `npm install --save classlist.js`. | |||
/** IE10 and IE11 requires the following to support `@angular/animation`. */ | |||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. | |||
/** Evergreen browsers require these. **/ | |||
import 'core-js/es6/reflect'; | |||
import 'core-js/es7/reflect'; | |||
import 'zone.js/dist/zone'; | |||
/** ALL Firefox browsers require the following to support `@angular/animation`. **/ | |||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. | |||
/*************************************************************************************************** | |||
* Zone JS is required by Angular itself. | |||
*/ | |||
import 'zone.js/dist/zone'; // Included with Angular CLI. | |||
/*************************************************************************************************** | |||
* APPLICATION IMPORTS | |||
*/ | |||
/** | |||
* Date, currency, decimal and percent pipes. | |||
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 | |||
*/ | |||
// import 'intl'; // Run `npm install --save intl`. |
@ -0,0 +1,32 @@ | |||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files | |||
import 'zone.js/dist/long-stack-trace-zone'; | |||
import 'zone.js/dist/proxy.js'; | |||
import 'zone.js/dist/sync-test'; | |||
import 'zone.js/dist/jasmine-patch'; | |||
import 'zone.js/dist/async-test'; | |||
import 'zone.js/dist/fake-async-test'; | |||
import { getTestBed } from '@angular/core/testing'; | |||
import { | |||
BrowserDynamicTestingModule, | |||
platformBrowserDynamicTesting | |||
} 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; | |||
// Prevent Karma from running prematurely. | |||
__karma__.loaded = function () {}; | |||
// First, initialize the Angular testing environment. | |||
getTestBed().initTestEnvironment( | |||
BrowserDynamicTestingModule, | |||
platformBrowserDynamicTesting() | |||
); | |||
// Then we find all the tests. | |||
const context = require.context('./', true, /\.spec\.ts$/); | |||
// And load the modules. | |||
context.keys().map(context); | |||
// Finally, start Karma to run the tests. | |||
__karma__.start(); |
@ -0,0 +1,13 @@ | |||
{ | |||
"extends": "../tsconfig.json", | |||
"compilerOptions": { | |||
"outDir": "../out-tsc/app", | |||
"module": "es2015", | |||
"baseUrl": "", | |||
"types": [] | |||
}, | |||
"exclude": [ | |||
"test.ts", | |||
"**/*.spec.ts" | |||
] | |||
} |
@ -0,0 +1,20 @@ | |||
{ | |||
"extends": "../tsconfig.json", | |||
"compilerOptions": { | |||
"outDir": "../out-tsc/spec", | |||
"module": "commonjs", | |||
"target": "es5", | |||
"baseUrl": "", | |||
"types": [ | |||
"jasmine", | |||
"node" | |||
] | |||
}, | |||
"files": [ | |||
"test.ts" | |||
], | |||
"include": [ | |||
"**/*.spec.ts", | |||
"**/*.d.ts" | |||
] | |||
} |
@ -0,0 +1,5 @@ | |||
/* SystemJS module definition */ | |||
declare var module: NodeModule; | |||
interface NodeModule { | |||
id: string; | |||
} |
@ -1,20 +0,0 @@ | |||
// For vendors for example jQuery, Lodash, angular2-jwt just import them here unless you plan on | |||
// chunking vendors files for async loading. You would need to import the async loaded vendors | |||
// at the entry point of the async loaded file. Also see custom-typings.d.ts as you also need to | |||
// run `typings install x` where `x` is your module | |||
// Angular 2 | |||
import '@angular/platform-browser'; | |||
import '@angular/platform-browser-dynamic'; | |||
import '@angular/core'; | |||
import '@angular/common'; | |||
import '@angular/forms'; | |||
import '@angular/http'; | |||
import '@angular/router'; | |||
// RxJS | |||
import 'rxjs/add/operator/map'; | |||
import 'rxjs/add/operator/mergeMap'; | |||
import 'rxjs/add/operator/catch'; | |||
import 'rxjs/add/operator/finally'; | |||
import 'rxjs/add/observable/throw'; |
@ -1,12 +0,0 @@ | |||
<esh-app class="esh-app" asp-prerender-webpack-config="config/webpack.config.js"> | |||
<div class="preloading"> | |||
<i class="fa fa-spinner fa-spin fa-5x" aria-hidden="true"></i> | |||
</div> | |||
</esh-app> | |||
<script> | |||
window.user = '@ViewBag.user'; | |||
</script> | |||
<script src="~/dist/vendor.js" asp-append-version="true"></script> | |||
<script src="~/dist/@ViewBag.HashedMain" asp-append-version="true"></script> |
@ -1,16 +0,0 @@ | |||
<!DOCTYPE html> | |||
<html> | |||
<head> | |||
<meta charset="utf-8" /> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |||
<title>eShopConContainers.WebSPA</title> | |||
<base href="/" /> | |||
<link rel="stylesheet" href="~/dist/vendor.css" asp-append-version="true" /> | |||
</head> | |||
<body> | |||
@RenderBody() | |||
</body> | |||
</html> |
@ -1,3 +0,0 @@ | |||
@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" | |||
@addTagHelper "*, Microsoft.AspNetCore.SpaServices" |
@ -1,3 +0,0 @@ | |||
@{ | |||
Layout = "_Layout"; | |||
} |
@ -1,23 +0,0 @@ | |||
/** | |||
* @author: @AngularClass | |||
*/ | |||
var path = require('path'); | |||
// Helper functions | |||
var ROOT = path.resolve(__dirname, '..'); | |||
console.log('root directory:', root() + '\n'); | |||
function hasProcessFlag(flag) { | |||
return process.argv.join('').indexOf(flag) > -1; | |||
} | |||
function root(args) { | |||
args = Array.prototype.slice.call(arguments, 0); | |||
return path.join.apply(path, [ROOT].concat(args)); | |||
} | |||
exports.hasProcessFlag = hasProcessFlag; | |||
exports.root = root; |
@ -1,3 +0,0 @@ | |||
module.exports = { | |||
//devtool: 'cheap-module-source-map' | |||
}; |
@ -1,77 +0,0 @@ | |||
var path = require('path'); | |||
var webpack = require('webpack'); | |||
var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); | |||
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |||
var extractCSS = new ExtractTextPlugin('styles.css'); | |||
var ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; | |||
var devConfig = require('./webpack.config.dev'); | |||
var prodConfig = require('./webpack.config.prod'); | |||
var CopyWebpackPlugin = require('copy-webpack-plugin'); | |||
var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; | |||
console.log("==========Dev Mode = " + isDevelopment + " ============" ) | |||
module.exports = merge({ | |||
resolve: { | |||
extensions: ['.js', '.ts'] | |||
}, | |||
module: { | |||
rules: [ | |||
{ | |||
test: /\.ts$/, exclude: [/\.(spec|e2e)\.ts$/], | |||
loaders: ['awesome-typescript-loader?forkChecker=true ', 'angular2-template-loader', 'angular2-router-loader'] | |||
}, | |||
{ test: /\.html$/, loader: "html" }, | |||
{ test: /\.scss$/, loader: 'exports-loader?module.exports.toString()!css-loader!sass-loader' }, | |||
{ test: /\.json$/, loader: 'json-loader' }, | |||
{ | |||
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, | |||
loader: "file-loader" | |||
}, { | |||
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, | |||
loader: "file-loader" | |||
}, { | |||
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, | |||
loader: "file-loader" | |||
}, { | |||
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, | |||
loader: "file-loader" | |||
}, | |||
{ | |||
test: /\.(png|jpg|gif|svg)$/, | |||
loader: "file-loader?name=images/[name].[ext]" | |||
} | |||
] | |||
}, | |||
entry: { | |||
'main': './Client/main.ts' | |||
}, | |||
output: { | |||
path: path.join(__dirname, '../wwwroot', 'dist'), | |||
filename: '[name].js', | |||
publicPath: '/dist/' | |||
}, | |||
profile: true, | |||
plugins: [ | |||
extractCSS, | |||
new webpack.DllReferencePlugin({ | |||
context: __dirname, | |||
manifest: require('../wwwroot/dist/vendor-manifest.json') | |||
}), | |||
// To eliminate warning | |||
// https://github.com/AngularClass/angular2-webpack-starter/issues/993 | |||
new webpack.ContextReplacementPlugin( | |||
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, | |||
__dirname | |||
), | |||
new ForkCheckerPlugin(), | |||
new webpack.DefinePlugin({ | |||
'process.env': { | |||
'ENV': JSON.stringify(process.env.ASPNETCORE_ENVIRONMENT) | |||
} | |||
}), | |||
new CopyWebpackPlugin([ | |||
{ from: 'Client/fonts', to: 'fonts' } | |||
]) | |||
] | |||
}, isDevelopment ? devConfig : prodConfig); |
@ -1,23 +0,0 @@ | |||
var webpack = require('webpack'); | |||
const WebpackMd5Hash = require('webpack-md5-hash'); | |||
module.exports = { | |||
devtool: 'source-map', | |||
output: { | |||
filename: '[name].[chunkhash].bundle.js', | |||
sourceMapFilename: '[name].[chunkhash].bundle.map', | |||
chunkFilename: '[id].[chunkhash].chunk.js' | |||
}, | |||
plugins: [ | |||
// new webpack.LoaderOptionsPlugin({ | |||
// minimize: true, | |||
// debug: false | |||
// }), | |||
new WebpackMd5Hash(), | |||
new webpack.optimize.UglifyJsPlugin({ | |||
beautify: false, | |||
comments: false, | |||
sourceMap: true | |||
}) | |||
] | |||
}; |
@ -1,74 +0,0 @@ | |||
var path = require('path'); | |||
var webpack = require('webpack'); | |||
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |||
var extractCSS = new ExtractTextPlugin('vendor.css'); | |||
var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; | |||
module.exports = { | |||
resolve: { | |||
extensions: ['.js'] | |||
}, | |||
module: { | |||
rules: [ | |||
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, | |||
{ test: /\.scss$/i, loader: extractCSS.extract(['css?minimize', 'sass']) }, | |||
{ test: /\.json$/, loader: 'json-loader' } | |||
] | |||
}, | |||
entry: { | |||
// polyfills: [ | |||
// 'core-js/es6/symbol', | |||
// 'core-js/es6/object', | |||
// 'core-js/es6/function', | |||
// 'core-js/es6/parse-int', | |||
// 'core-js/es6/parse-float', | |||
// 'core-js/es6/number', | |||
// 'core-js/es6/math', | |||
// 'core-js/es6/string', | |||
// 'core-js/es6/date', | |||
// 'core-js/es6/array', | |||
// 'core-js/es6/regexp', | |||
// 'core-js/es6/map', | |||
// 'core-js/es6/set', | |||
// 'core-js/es6/reflect', | |||
// 'core-js/es7/reflect', | |||
// 'zone.js/dist/zone' | |||
// ], | |||
vendor: [ | |||
'font-awesome/scss/font-awesome.scss', | |||
'bootstrap/scss/bootstrap.scss', | |||
'@angular/common', | |||
'@angular/compiler', | |||
'@angular/core', | |||
'@angular/http', | |||
'@angular/forms', | |||
'@angular/platform-browser', | |||
'@angular/platform-browser-dynamic', | |||
'@angular/router', | |||
'./Client/globals.scss' | |||
] | |||
}, | |||
output: { | |||
path: path.join(__dirname, '../wwwroot', 'dist'), | |||
filename: '[name].js', | |||
library: '[name]_[hash]', | |||
}, | |||
plugins: [ | |||
extractCSS, | |||
// To eliminate warning | |||
// https://github.com/AngularClass/angular2-webpack-starter/issues/993 | |||
new webpack.ContextReplacementPlugin( | |||
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, | |||
__dirname | |||
), | |||
new webpack.DllPlugin({ | |||
path: path.join(__dirname, '../wwwroot', 'dist', '[name]-manifest.json'), | |||
name: '[name]_[hash]' | |||
}) | |||
].concat(isDevelopment ? [] : [ | |||
new webpack.optimize.UglifyJsPlugin({ | |||
beautify: false, | |||
comments: false | |||
}) | |||
]) | |||
}; |
@ -1,42 +1,20 @@ | |||
{ | |||
"compileOnSave": false, | |||
"compilerOptions": { | |||
"target": "es5", | |||
"module": "commonjs", | |||
"moduleResolution": "node", | |||
"outDir": "./dist/out-tsc", | |||
"baseUrl": "src", | |||
"sourceMap": true, | |||
"declaration": false, | |||
"moduleResolution": "node", | |||
"emitDecoratorMetadata": true, | |||
"experimentalDecorators": true, | |||
"allowSyntheticDefaultImports": true, | |||
"sourceMap": true, | |||
"strictNullChecks": false, | |||
"baseUrl": "./src", | |||
"paths": {}, | |||
"lib": [ | |||
"dom", | |||
"es6" | |||
"target": "es5", | |||
"typeRoots": [ | |||
"node_modules/@types" | |||
], | |||
"types": [ | |||
"hammerjs", | |||
"jasmine", | |||
"node", | |||
"protractor", | |||
"selenium-webdriver", | |||
"source-map", | |||
"uglify-js", | |||
"webpack" | |||
"lib": [ | |||
"es2016", | |||
"dom" | |||
] | |||
}, | |||
"exclude": [ | |||
"node_modules", | |||
"wwwroot" | |||
], | |||
"awesomeTypescriptLoaderOptions": { | |||
"forkChecker": true, | |||
"useWebpackText": true | |||
}, | |||
"compileOnSave": false, | |||
"buildOnSave": false, | |||
"atom": { | |||
"rewriteTsconfig": false | |||
} | |||
} | |||
} |
@ -1,9 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<configuration> | |||
<system.webServer> | |||
<handlers> | |||
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/> | |||
</handlers> | |||
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/> | |||
</system.webServer> | |||
</configuration> |