From 3fc19ea77bdbf09d764c2116eab20a32fe1f34eb Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 14 Jun 2016 10:16:40 +0100 Subject: [PATCH 001/847] Add missing lock to ensure thread-safe mutations of _activeInnerStreams in VirtualConnectionClient.cs --- .../VirtualConnections/VirtualConnectionClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/VirtualConnections/VirtualConnectionClient.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/VirtualConnections/VirtualConnectionClient.cs index 9f343033..f5e2d62e 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/VirtualConnections/VirtualConnectionClient.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/VirtualConnections/VirtualConnectionClient.cs @@ -46,7 +46,11 @@ public Stream OpenVirtualConnection() var id = Interlocked.Increment(ref _nextInnerStreamId); var newInnerStream = new VirtualConnection(id, this); - _activeInnerStreams.Add(id, newInnerStream); + lock (_activeInnerStreams) + { + _activeInnerStreams.Add(id, newInnerStream); + } + return newInnerStream; } From a881ca5b96e1c2d8253bb1c4cd18c42e8b0a1d8e Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 14 Jun 2016 10:43:03 +0100 Subject: [PATCH 002/847] Correctly set NODE_PATH when starting OutOfProcessNodeInstance --- .../HostingModels/OutOfProcessNodeInstance.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs index 1a8a5e10..296bb488 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/OutOfProcessNodeInstance.cs @@ -91,9 +91,9 @@ protected async Task EnsureReady() var nodePathValue = existingNodePath + Path.Combine(_projectPath, "node_modules"); #if NET451 - startInfo.EnvironmentVariables.Add("NODE_PATH", nodePathValue); + startInfo.EnvironmentVariables["NODE_PATH"] = nodePathValue; #else - startInfo.Environment.Add("NODE_PATH", nodePathValue); + startInfo.Environment["NODE_PATH"] = nodePathValue; #endif _nodeProcess = Process.Start(startInfo); From 2ffc31a7c6e174506392461b2f205933c8368911 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 14 Jun 2016 11:35:12 +0100 Subject: [PATCH 003/847] In ReactReduxSpa template, better report failure to match client-side routes --- templates/ReactReduxSpa/ClientApp/boot-server.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/ReactReduxSpa/ClientApp/boot-server.tsx b/templates/ReactReduxSpa/ClientApp/boot-server.tsx index 3c2355f0..fa3289ea 100644 --- a/templates/ReactReduxSpa/ClientApp/boot-server.tsx +++ b/templates/ReactReduxSpa/ClientApp/boot-server.tsx @@ -14,6 +14,11 @@ export default function (params: any): Promise<{ html: string }> { throw error; } + // If it didn't match any route, renderProps will be undefined + if (!renderProps) { + throw new Error(`The location '${ params.url }' doesn't match any route configured in react-router.`); + } + // Build an instance of the application const store = configureStore(); const app = ( From bb53a94cfa56908d880c282b968c9df9efae33a1 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 21 Jun 2016 10:58:17 +0100 Subject: [PATCH 004/847] Fix #139 by pinning Angular 2 template to RC1 --- templates/Angular2Spa/package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/Angular2Spa/package.json b/templates/Angular2Spa/package.json index 35309e4d..fe42e1d0 100644 --- a/templates/Angular2Spa/package.json +++ b/templates/Angular2Spa/package.json @@ -18,15 +18,15 @@ "webpack-hot-middleware": "^2.10.0" }, "dependencies": { - "@angular/common": "^2.0.0-rc.1", - "@angular/compiler": "^2.0.0-rc.1", - "@angular/core": "^2.0.0-rc.1", - "@angular/http": "^2.0.0-rc.1", - "@angular/platform-browser": "^2.0.0-rc.1", - "@angular/platform-browser-dynamic": "^2.0.0-rc.1", + "@angular/common": "2.0.0-rc.1", + "@angular/compiler": "2.0.0-rc.1", + "@angular/core": "2.0.0-rc.1", + "@angular/http": "2.0.0-rc.1", + "@angular/platform-browser": "2.0.0-rc.1", + "@angular/platform-browser-dynamic": "2.0.0-rc.1", "@angular/platform-server": "2.0.0-rc.1", - "@angular/router": "^2.0.0-rc.1", - "@angular/router-deprecated": "^2.0.0-rc.1", + "@angular/router": "2.0.0-rc.1", + "@angular/router-deprecated": "2.0.0-rc.1", "angular2-universal": "0.100.3", "aspnet-prerendering": "^1.0.1", "aspnet-webpack": "^1.0.1", From 1a534110463353dc0f1f97bec3c79de9dbd82700 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 21 Jun 2016 15:44:38 +0100 Subject: [PATCH 005/847] Fix some whitespace issues --- .../Content/Node/prerenderer.js | 2 +- .../Content/Node/webpack-dev-middleware.js | 2 +- src/Microsoft.AspNetCore.SpaServices/README.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.AspNetCore.SpaServices/Content/Node/prerenderer.js b/src/Microsoft.AspNetCore.SpaServices/Content/Node/prerenderer.js index 0929822a..b847a0ba 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Content/Node/prerenderer.js +++ b/src/Microsoft.AspNetCore.SpaServices/Content/Node/prerenderer.js @@ -7,6 +7,6 @@ module.exports.renderToString = function (callback) { callback('To use prerendering, you must install the \'aspnet-prerendering\' NPM package.'); return; } - + return aspNetPrerendering.renderToString.apply(this, arguments); }; diff --git a/src/Microsoft.AspNetCore.SpaServices/Content/Node/webpack-dev-middleware.js b/src/Microsoft.AspNetCore.SpaServices/Content/Node/webpack-dev-middleware.js index 8a0dd584..928c7fd1 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Content/Node/webpack-dev-middleware.js +++ b/src/Microsoft.AspNetCore.SpaServices/Content/Node/webpack-dev-middleware.js @@ -7,6 +7,6 @@ module.exports.createWebpackDevServer = function (callback) { callback('To use webpack dev middleware, you must install the \'aspnet-webpack\' NPM package.'); return; } - + return aspNetWebpack.createWebpackDevServer.apply(this, arguments); }; diff --git a/src/Microsoft.AspNetCore.SpaServices/README.md b/src/Microsoft.AspNetCore.SpaServices/README.md index 08171f9d..361b53a4 100644 --- a/src/Microsoft.AspNetCore.SpaServices/README.md +++ b/src/Microsoft.AspNetCore.SpaServices/README.md @@ -17,7 +17,7 @@ Behind the scenes, it uses the [`Microsoft.AspNetCore.NodeServices`](https://git * To test this is installed and can be found, run `node -v` on a command line * Note: If you're deploying to an Azure web site, you don't need to do anything here - Node is already installed and available in the server environments * [.NET Core](https://dot.net), version 1.0 RC2 or later - + ### Installation into existing projects * Add `Microsoft.AspNetCore.SpaServices` to the dependencies list in your `project.json` file @@ -28,10 +28,10 @@ Behind the scenes, it uses the [`Microsoft.AspNetCore.NodeServices`](https://git * For **webpack dev middleware**, install `aspnet-webpack` * For **webpack dev middleware with hot module replacement**, also install `webpack-hot-middleware` * For **webpack dev middleware with React hot module replacement**, also install `aspnet-webpack-react` - + For example, run `npm install --save aspnet-prerendering aspnet-webpack` to install `aspnet-prerendering` and `aspnet-webpack`. - + ### Creating entirely new projects If you're starting from scratch, you might prefer to use the `aspnetcore-spa` Yeoman generator to get a ready-to-go starting point using your choice of client-side framework. This includes `Microsoft.AspNetCore.SpaServices` along with everything configured for webpack middleware, server-side prerendering, etc. From ea0a32a15b814f7a8c23417eaffe1e9f86fd704c Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 21 Jun 2016 15:46:52 +0100 Subject: [PATCH 006/847] Implement and document asp-prerender-data --- .../Prerendering/PrerenderTagHelper.cs | 7 ++++- .../Prerendering/Prerenderer.cs | 6 ++-- .../README.md | 30 ++++++++++++++++++- .../npm/aspnet-prerendering/package.json | 2 +- .../aspnet-prerendering/src/Prerendering.ts | 8 +++-- 5 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderTagHelper.cs b/src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderTagHelper.cs index 6e364812..b09eaae7 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderTagHelper.cs +++ b/src/Microsoft.AspNetCore.SpaServices/Prerendering/PrerenderTagHelper.cs @@ -19,6 +19,7 @@ public class PrerenderTagHelper : TagHelper private const string PrerenderModuleAttributeName = "asp-prerender-module"; private const string PrerenderExportAttributeName = "asp-prerender-export"; private const string PrerenderWebpackConfigAttributeName = "asp-prerender-webpack-config"; + private const string PrerenderDataAttributeName = "asp-prerender-data"; private static INodeServices _fallbackNodeServices; // Used only if no INodeServices was registered with DI private readonly string _applicationBasePath; @@ -51,6 +52,9 @@ public PrerenderTagHelper(IServiceProvider serviceProvider) [HtmlAttributeName(PrerenderWebpackConfigAttributeName)] public string WebpackConfigPath { get; set; } + [HtmlAttributeName(PrerenderDataAttributeName)] + public object CustomDataParameter { get; set; } + [HtmlAttributeNotBound] [ViewContext] public ViewContext ViewContext { get; set; } @@ -67,7 +71,8 @@ public override async Task ProcessAsync(TagHelperContext context, TagHelperOutpu WebpackConfig = WebpackConfigPath }, request.GetEncodedUrl(), - request.Path + request.QueryString.Value); + request.Path + request.QueryString.Value, + CustomDataParameter); output.Content.SetHtmlContent(result.Html); // Also attach any specified globals to the 'window' object. This is useful for transferring diff --git a/src/Microsoft.AspNetCore.SpaServices/Prerendering/Prerenderer.cs b/src/Microsoft.AspNetCore.SpaServices/Prerendering/Prerenderer.cs index 3b08eff9..5e103226 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Prerendering/Prerenderer.cs +++ b/src/Microsoft.AspNetCore.SpaServices/Prerendering/Prerenderer.cs @@ -22,7 +22,8 @@ public static Task RenderToString( INodeServices nodeServices, JavaScriptModuleExport bootModule, string requestAbsoluteUrl, - string requestPathAndQuery) + string requestPathAndQuery, + object customDataParameter) { return nodeServices.InvokeExport( NodeScript.Value.FileName, @@ -30,7 +31,8 @@ public static Task RenderToString( applicationBasePath, bootModule, requestAbsoluteUrl, - requestPathAndQuery); + requestPathAndQuery, + customDataParameter); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.SpaServices/README.md b/src/Microsoft.AspNetCore.SpaServices/README.md index 361b53a4..291ce099 100644 --- a/src/Microsoft.AspNetCore.SpaServices/README.md +++ b/src/Microsoft.AspNetCore.SpaServices/README.md @@ -81,6 +81,34 @@ If you try running your app now, you should see the HTML snippet generated by yo As you can see, your JavaScript code receives context information (such as the URL being requested), and returns a `Promise` so that it can asynchronously supply the markup to be injected into the page. You can put whatever logic you like here, but typically you'll want to execute a component from your Angular 2 / React / etc. application. +**Passing data from .NET code into JavaScript code** + +If you want to supply additional data to the JavaScript function that performs your prerendering, you can use the `asp-prerender-data` attribute. You can give any value as long as it's JSON-serializable. Bear in mind that it will be serialized and sent as part of the remote procedure call (RPC) to Node.js, so avoid trying to pass massive amounts of data. + +For example, in your `cshtml`, + +
+ +Now in your JavaScript prerendering function, you can access this data by reading `params.data`, e.g.: + +```javascript +module.exports = function(params) { + return new Promise(function (resolve, reject) { + var result = '

Hello world!

' + + '

Is gold user: ' + params.data.isGoldUser + '

' + + '

Number of cookies: ' + params.data.cookies.length + '

'; + + resolve({ html: result }); + }); +}; +``` + +Notice that the property names are received in JavaScript-style casing (e.g., `isGoldUser`) even though they were sent in C#-style casing (e.g., `IsGoldUser`). This is because of how the JSON serialization is configured by default. + **Passing data from server-side to client-side code** If, as well as returning HTML, you also want to pass some contextual data from your server-side code to your client-side code, you can supply a `globals` object alongside the initial `html`, e.g.: @@ -245,7 +273,7 @@ At this stage, run `webpack` on the command line to build `wwwroot/dist/main.js` You can now run your React code on the client by adding the following to one of your MVC views: -
+
#### Running React code on the server diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/package.json b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/package.json index 186f11ed..2c0651b7 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/package.json +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/package.json @@ -1,6 +1,6 @@ { "name": "aspnet-prerendering", - "version": "1.0.1", + "version": "1.0.2", "description": "Helpers for server-side rendering of JavaScript applications in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.", "main": "index.js", "scripts": { diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/src/Prerendering.ts b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/src/Prerendering.ts index babc1d21..4d9269b2 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/src/Prerendering.ts +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-prerendering/src/Prerendering.ts @@ -24,6 +24,7 @@ export interface BootFuncParams { url: string; // e.g., '/some/path' absoluteUrl: string; // e.g., 'https://example.com:1234/some/path' domainTasks: Promise; + data: any; // any custom object passed through from .NET } export interface BootModuleInfo { @@ -32,7 +33,7 @@ export interface BootModuleInfo { webpackConfig?: string; } -export function renderToString(callback: RenderToStringCallback, applicationBasePath: string, bootModule: BootModuleInfo, absoluteRequestUrl: string, requestPathAndQuery: string) { +export function renderToString(callback: RenderToStringCallback, applicationBasePath: string, bootModule: BootModuleInfo, absoluteRequestUrl: string, requestPathAndQuery: string, customDataParameter: any) { findBootFunc(applicationBasePath, bootModule, (findBootFuncError, bootFunc) => { if (findBootFuncError) { callback(findBootFuncError, null); @@ -51,7 +52,8 @@ export function renderToString(callback: RenderToStringCallback, applicationBase origin: parsedAbsoluteRequestUrl.protocol + '//' + parsedAbsoluteRequestUrl.host, url: requestPathAndQuery, absoluteUrl: absoluteRequestUrl, - domainTasks: domainTaskCompletionPromise + domainTasks: domainTaskCompletionPromise, + data: customDataParameter }; // Open a new domain that can track all the async tasks involved in the app's execution @@ -86,7 +88,7 @@ function findBootModule(applicationBasePath: string, bootModule: BootModuleIn const bootModuleNameFullPath = path.resolve(applicationBasePath, bootModule.moduleName); if (bootModule.webpackConfig) { const webpackConfigFullPath = path.resolve(applicationBasePath, bootModule.webpackConfig); - + let aspNetWebpackModule: any; try { aspNetWebpackModule = require('aspnet-webpack'); From 9fabfd5c405008da2df96247fc3ab793b4906fef Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 21 Jun 2016 15:48:07 +0100 Subject: [PATCH 007/847] Fix typo --- src/Microsoft.AspNetCore.SpaServices/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.SpaServices/README.md b/src/Microsoft.AspNetCore.SpaServices/README.md index 291ce099..a1e109b1 100644 --- a/src/Microsoft.AspNetCore.SpaServices/README.md +++ b/src/Microsoft.AspNetCore.SpaServices/README.md @@ -91,7 +91,7 @@ For example, in your `cshtml`, asp-prerender-data="new { IsGoldUser = true, Cookies = ViewContext.HttpContext.Request.Cookies - }""> + }"> Now in your JavaScript prerendering function, you can access this data by reading `params.data`, e.g.: From 6f8055b7bc735c448e29dadfd950a9b91c56a95d Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 21 Jun 2016 16:26:14 +0100 Subject: [PATCH 008/847] Update Yeoman generators to use aspnet-prerendering 1.0.2+ and publish as version 0.1.5 --- templates/Angular2Spa/package.json | 2 +- templates/ReactReduxSpa/package.json | 2 +- templates/yeoman/src/generator/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/Angular2Spa/package.json b/templates/Angular2Spa/package.json index fe42e1d0..e76863d0 100644 --- a/templates/Angular2Spa/package.json +++ b/templates/Angular2Spa/package.json @@ -28,7 +28,7 @@ "@angular/router": "2.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.1", "angular2-universal": "0.100.3", - "aspnet-prerendering": "^1.0.1", + "aspnet-prerendering": "^1.0.2", "aspnet-webpack": "^1.0.1", "css": "^2.2.1", "isomorphic-fetch": "^2.2.1", diff --git a/templates/ReactReduxSpa/package.json b/templates/ReactReduxSpa/package.json index bc219ea3..1e7c3e4a 100644 --- a/templates/ReactReduxSpa/package.json +++ b/templates/ReactReduxSpa/package.json @@ -20,7 +20,7 @@ "webpack-hot-middleware": "^2.10.0" }, "dependencies": { - "aspnet-prerendering": "^1.0.0", + "aspnet-prerendering": "^1.0.2", "aspnet-webpack": "^1.0.2", "babel-core": "^6.5.2", "domain-task": "^1.0.0", diff --git a/templates/yeoman/src/generator/package.json b/templates/yeoman/src/generator/package.json index 7fa0dd34..cca237f9 100644 --- a/templates/yeoman/src/generator/package.json +++ b/templates/yeoman/src/generator/package.json @@ -1,6 +1,6 @@ { "name": "generator-aspnetcore-spa", - "version": "0.1.4", + "version": "0.1.5", "description": "Single-Page App templates for ASP.NET Core", "author": "Microsoft", "license": "Apache-2.0", From 7e51fc44801cfdb7d01c26e651f79c5ec0bbf261 Mon Sep 17 00:00:00 2001 From: Andrei Tserakhau Date: Tue, 21 Jun 2016 16:26:14 +0100 Subject: [PATCH 009/847] Update VS files (amended from laskoviymishka's commit 39f024) --- JavaScriptServices.sln | 38 +++++++++++++++++-- samples/misc/LatencyTest/LatencyTest.xproj | 19 ++++++++++ .../Webpack/Properties/launchSettings.json | 25 ++++++++++++ .../MusicStore/Properties/launchSettings.json | 25 ++++++++++++ 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 samples/misc/LatencyTest/LatencyTest.xproj create mode 100644 samples/misc/Webpack/Properties/launchSettings.json create mode 100644 samples/react/MusicStore/Properties/launchSettings.json diff --git a/JavaScriptServices.sln b/JavaScriptServices.sln index 9b150601..55338882 100644 --- a/JavaScriptServices.sln +++ b/JavaScriptServices.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E6E88944-4800-40BA-8AF5-069EA3ADFEB8}" EndProject @@ -34,6 +34,18 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactSpa", "templates\React EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.xproj", "{CB4398D6-B7F1-449A-AE02-828769679232}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{E0771531-BE20-40CD-A1B0-A57E09511060}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Webpack", "samples\misc\Webpack\Webpack.xproj", "{A8905301-8492-42FD-9E83-F715A0FDC3A2}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.xproj", "{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "React", "React", "{E0EBA813-4478-4C02-B11D-FB3793113FE4}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\react\MusicStore\MusicStore.xproj", "{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Angular", "Angular", "{4867A616-83D6-48DC-964D-6AE743596631}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -84,17 +96,35 @@ Global {CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.Build.0 = Release|Any CPU + {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.Build.0 = Release|Any CPU + {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.Build.0 = Release|Any CPU + {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {6D4BCDD6-7951-449B-BE55-CB7F014B7430} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} - {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} - {ABF90A5B-F4E0-438C-A6E4-9549FB43690B} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} + {6D4BCDD6-7951-449B-BE55-CB7F014B7430} = {E0771531-BE20-40CD-A1B0-A57E09511060} + {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B} = {4867A616-83D6-48DC-964D-6AE743596631} + {ABF90A5B-F4E0-438C-A6E4-9549FB43690B} = {E0EBA813-4478-4C02-B11D-FB3793113FE4} {8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11} = {727E6D58-6830-4792-96C6-E138A33959FB} {DBFC6DB0-A6D1-4694-A108-1C604B988DA3} = {727E6D58-6830-4792-96C6-E138A33959FB} {E9D1A695-F0E6-46F2-B5E3-72F4AF805387} = {727E6D58-6830-4792-96C6-E138A33959FB} {CB4398D6-B7F1-449A-AE02-828769679232} = {727E6D58-6830-4792-96C6-E138A33959FB} + {E0771531-BE20-40CD-A1B0-A57E09511060} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} + {A8905301-8492-42FD-9E83-F715A0FDC3A2} = {E0771531-BE20-40CD-A1B0-A57E09511060} + {A64AF9D9-72AA-4433-BE1D-DC2524B6808A} = {E0771531-BE20-40CD-A1B0-A57E09511060} + {E0EBA813-4478-4C02-B11D-FB3793113FE4} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} + {C870A92C-9E3F-4BF2-82B8-5758545A8B7C} = {E0EBA813-4478-4C02-B11D-FB3793113FE4} + {4867A616-83D6-48DC-964D-6AE743596631} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} EndGlobalSection EndGlobal diff --git a/samples/misc/LatencyTest/LatencyTest.xproj b/samples/misc/LatencyTest/LatencyTest.xproj new file mode 100644 index 00000000..310b3bac --- /dev/null +++ b/samples/misc/LatencyTest/LatencyTest.xproj @@ -0,0 +1,19 @@ + + + + 14.0.25123 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + a64af9d9-72aa-4433-be1d-dc2524b6808a + LatencyTest + .\obj + .\bin\ + + + + 2.0 + + + \ No newline at end of file diff --git a/samples/misc/Webpack/Properties/launchSettings.json b/samples/misc/Webpack/Properties/launchSettings.json new file mode 100644 index 00000000..f2904dc8 --- /dev/null +++ b/samples/misc/Webpack/Properties/launchSettings.json @@ -0,0 +1,25 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51463/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "dotnet cli": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/samples/react/MusicStore/Properties/launchSettings.json b/samples/react/MusicStore/Properties/launchSettings.json new file mode 100644 index 00000000..e4360431 --- /dev/null +++ b/samples/react/MusicStore/Properties/launchSettings.json @@ -0,0 +1,25 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51586/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "dotnet cli": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file From d3ded5bbdfb87873bc842266256dd3ae7f980573 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 10:57:00 +0100 Subject: [PATCH 010/847] Workaround for Yeoman generators not producing .gitignore files due to Yeoman issue #1862 --- .gitignore | 7 ++++++ .../{.gitignore => template_gitignore} | 0 .../{.gitignore => template_gitignore} | 0 .../{.gitignore => template_gitignore} | 0 .../{.gitignore => template_gitignore} | 0 .../{.gitignore => template_gitignore} | 0 templates/yeoman/src/build/build.ts | 25 +++++++++++-------- templates/yeoman/src/generator/app/index.ts | 15 +++++++---- templates/yeoman/src/generator/package.json | 2 +- 9 files changed, 32 insertions(+), 17 deletions(-) rename templates/Angular2Spa/{.gitignore => template_gitignore} (100%) rename templates/KnockoutSpa/{.gitignore => template_gitignore} (100%) rename templates/ReactReduxSpa/{.gitignore => template_gitignore} (100%) rename templates/ReactSpa/{.gitignore => template_gitignore} (100%) rename templates/WebApplicationBasic/{.gitignore => template_gitignore} (100%) diff --git a/.gitignore b/.gitignore index d60c9bfd..62ebab8f 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,10 @@ project.lock.json .vs/ npm-debug.log /.build/ + +# The templates can't contain their own .gitignore files, because Yeoman has strange default handling for +# files with that name (https://github.com/npm/npm/issues/1862). So, each template instead has a template_gitignore +# file which gets renamed after the files are copied. And so any files that need to be excluded in the source +# repo have to be excluded here. +/templates/*/node_modules/ +/templates/*/wwwroot/dist/ diff --git a/templates/Angular2Spa/.gitignore b/templates/Angular2Spa/template_gitignore similarity index 100% rename from templates/Angular2Spa/.gitignore rename to templates/Angular2Spa/template_gitignore diff --git a/templates/KnockoutSpa/.gitignore b/templates/KnockoutSpa/template_gitignore similarity index 100% rename from templates/KnockoutSpa/.gitignore rename to templates/KnockoutSpa/template_gitignore diff --git a/templates/ReactReduxSpa/.gitignore b/templates/ReactReduxSpa/template_gitignore similarity index 100% rename from templates/ReactReduxSpa/.gitignore rename to templates/ReactReduxSpa/template_gitignore diff --git a/templates/ReactSpa/.gitignore b/templates/ReactSpa/template_gitignore similarity index 100% rename from templates/ReactSpa/.gitignore rename to templates/ReactSpa/template_gitignore diff --git a/templates/WebApplicationBasic/.gitignore b/templates/WebApplicationBasic/template_gitignore similarity index 100% rename from templates/WebApplicationBasic/.gitignore rename to templates/WebApplicationBasic/template_gitignore diff --git a/templates/yeoman/src/build/build.ts b/templates/yeoman/src/build/build.ts index 91cf323b..ce071005 100644 --- a/templates/yeoman/src/build/build.ts +++ b/templates/yeoman/src/build/build.ts @@ -6,7 +6,7 @@ import * as _ from 'lodash'; import * as mkdirp from 'mkdirp'; import * as rimraf from 'rimraf'; -const textFileExtensions = ['.gitignore', '.config', '.cs', '.cshtml', 'Dockerfile', '.html', '.js', '.json', '.jsx', '.md', '.ts', '.tsx', '.xproj']; +const textFileExtensions = ['.gitignore', 'template_gitignore', '.config', '.cs', '.cshtml', 'Dockerfile', '.html', '.js', '.json', '.jsx', '.md', '.ts', '.tsx', '.xproj']; const templates = { 'angular-2': '../../templates/Angular2Spa/', @@ -33,12 +33,15 @@ function isTextFile(filename: string): boolean { function writeFileEnsuringDirExists(root: string, filename: string, contents: string | Buffer) { let fullPath = path.join(root, filename); - mkdirp.sync(path.dirname(fullPath)); + mkdirp.sync(path.dirname(fullPath)); fs.writeFileSync(fullPath, contents); } -function listFilesExcludingGitignored(root: string): string[] { - let gitIgnorePath = path.join(root, '.gitignore'); +function listFilesExcludingGitignored(root: string): string[] { + // Note that the gitignore files, prior to be written by the generator, are called 'template_gitignore' + // instead of '.gitignore'. This is a workaround for Yeoman doing strange stuff with .gitignore files + // (it renames them to .npmignore, which is not helpful). + let gitIgnorePath = path.join(root, 'template_gitignore'); let gitignoreEvaluator = fs.existsSync(gitIgnorePath) ? gitignore.compile(fs.readFileSync(gitIgnorePath, 'utf8')) : { accepts: () => true }; @@ -49,36 +52,36 @@ function listFilesExcludingGitignored(root: string): string[] { function writeTemplate(sourceRoot: string, destRoot: string) { listFilesExcludingGitignored(sourceRoot).forEach(fn => { let sourceContent = fs.readFileSync(path.join(sourceRoot, fn)); - + // For text files, replace hardcoded values with template tags if (isTextFile(fn)) { let sourceText = sourceContent.toString('utf8'); contentReplacements.forEach(replacement => { sourceText = sourceText.replace(replacement.from, replacement.to); }); - + sourceContent = new Buffer(sourceText, 'utf8'); } - + // Also apply replacements in filenames filenameReplacements.forEach(replacement => { fn = fn.replace(replacement.from, replacement.to); }); - + writeFileEnsuringDirExists(destRoot, fn, sourceContent); - }); + }); } function copyRecursive(sourceRoot: string, destRoot: string, matchGlob: string) { glob.sync(matchGlob, { cwd: sourceRoot, dot: true, nodir: true }) .forEach(fn => { - const sourceContent = fs.readFileSync(path.join(sourceRoot, fn)); + const sourceContent = fs.readFileSync(path.join(sourceRoot, fn)); writeFileEnsuringDirExists(destRoot, fn, sourceContent); }); } const outputRoot = './generator-aspnetcore-spa'; -const outputTemplatesRoot = path.join(outputRoot, 'app/templates'); +const outputTemplatesRoot = path.join(outputRoot, 'app/templates'); rimraf.sync(outputTemplatesRoot); // Copy template files diff --git a/templates/yeoman/src/generator/app/index.ts b/templates/yeoman/src/generator/app/index.ts index 7a7e95c6..ecb53667 100644 --- a/templates/yeoman/src/generator/app/index.ts +++ b/templates/yeoman/src/generator/app/index.ts @@ -22,7 +22,7 @@ class MyGenerator extends yeoman.Base { prompting() { const done = this.async(); - + this.prompt([{ type: 'list', name: 'framework', @@ -40,13 +40,18 @@ class MyGenerator extends yeoman.Base { done(); }); } - + writing() { var templateRoot = this.templatePath(this._answers.framework); glob.sync('**/*', { cwd: templateRoot, dot: true, nodir: true }).forEach(fn => { // Token replacement in filenames let outputFn = fn.replace(/tokenreplace\-([^\.\/]*)/g, (substr, token) => this._answers[token]); - + + // Rename template_gitignore to .gitignore in output + if (path.basename(fn) === 'template_gitignore') { + outputFn = path.join(path.dirname(fn), '.gitignore'); + } + this.fs.copyTpl( path.join(templateRoot, fn), this.destinationPath(outputFn), @@ -54,7 +59,7 @@ class MyGenerator extends yeoman.Base { ); }); } - + installingDeps() { this.installDependencies({ npm: true, @@ -62,7 +67,7 @@ class MyGenerator extends yeoman.Base { callback: () => { this.spawnCommandSync('dotnet', ['restore']); this.spawnCommandSync('./node_modules/.bin/webpack', ['--config', 'webpack.config.vendor.js']); - this.spawnCommandSync('./node_modules/.bin/webpack'); + this.spawnCommandSync('./node_modules/.bin/webpack'); } }); } diff --git a/templates/yeoman/src/generator/package.json b/templates/yeoman/src/generator/package.json index cca237f9..1f9063cb 100644 --- a/templates/yeoman/src/generator/package.json +++ b/templates/yeoman/src/generator/package.json @@ -1,6 +1,6 @@ { "name": "generator-aspnetcore-spa", - "version": "0.1.5", + "version": "0.1.6", "description": "Single-Page App templates for ASP.NET Core", "author": "Microsoft", "license": "Apache-2.0", From 6848e3a11d8b209cabb48397dc34d70bd9353644 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 12:48:54 +0100 Subject: [PATCH 011/847] Fix templates' project.json scripts for compatibility with dotnet RC2 tooling and Azure --- templates/Angular2Spa/project.json | 6 +++--- templates/KnockoutSpa/project.json | 6 +++--- templates/ReactReduxSpa/project.json | 6 +++--- templates/ReactSpa/project.json | 6 +++--- templates/WebApplicationBasic/project.json | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/Angular2Spa/project.json b/templates/Angular2Spa/project.json index c47a5d8d..a92513a0 100755 --- a/templates/Angular2Spa/project.json +++ b/templates/Angular2Spa/project.json @@ -46,11 +46,11 @@ ] }, "scripts": { - "prepare": [ + "prepublish": [ "npm install", - "webpack --config webpack.config.vendor.js" + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", + "node node_modules/webpack/bin/webpack.js" ], - "prepublish": [ "webpack" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } } diff --git a/templates/KnockoutSpa/project.json b/templates/KnockoutSpa/project.json index 2619c804..63f8a973 100755 --- a/templates/KnockoutSpa/project.json +++ b/templates/KnockoutSpa/project.json @@ -46,11 +46,11 @@ ] }, "scripts": { - "prepare": [ + "prepublish": [ "npm install", - "webpack --config webpack.config.vendor.js" + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", + "node node_modules/webpack/bin/webpack.js" ], - "prepublish": [ "webpack" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } } diff --git a/templates/ReactReduxSpa/project.json b/templates/ReactReduxSpa/project.json index 1aa6a786..59fea50b 100755 --- a/templates/ReactReduxSpa/project.json +++ b/templates/ReactReduxSpa/project.json @@ -46,11 +46,11 @@ ] }, "scripts": { - "prepare": [ + "prepublish": [ "npm install", - "webpack --config webpack.config.vendor.js" + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", + "node node_modules/webpack/bin/webpack.js" ], - "prepublish": [ "webpack" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } } diff --git a/templates/ReactSpa/project.json b/templates/ReactSpa/project.json index 1aa6a786..59fea50b 100755 --- a/templates/ReactSpa/project.json +++ b/templates/ReactSpa/project.json @@ -46,11 +46,11 @@ ] }, "scripts": { - "prepare": [ + "prepublish": [ "npm install", - "webpack --config webpack.config.vendor.js" + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", + "node node_modules/webpack/bin/webpack.js" ], - "prepublish": [ "webpack" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } } diff --git a/templates/WebApplicationBasic/project.json b/templates/WebApplicationBasic/project.json index dac23dbb..27c68eb1 100755 --- a/templates/WebApplicationBasic/project.json +++ b/templates/WebApplicationBasic/project.json @@ -45,10 +45,10 @@ ] }, "scripts": { - "prepare": [ + "prepublish": [ "npm install", - "webpack --config webpack.config.vendor.js", - "webpack" + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", + "node node_modules/webpack/bin/webpack.js" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } From 73879918d4451aed6dcad040d58669214ffd75fc Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 12:52:56 +0100 Subject: [PATCH 012/847] Add web.config to all templates (matching "yo aspnet" output) --- templates/Angular2Spa/web.config | 14 ++++++++++++++ templates/KnockoutSpa/web.config | 14 ++++++++++++++ templates/ReactReduxSpa/web.config | 14 ++++++++++++++ templates/ReactSpa/web.config | 14 ++++++++++++++ templates/WebApplicationBasic/web.config | 14 ++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 templates/Angular2Spa/web.config create mode 100644 templates/KnockoutSpa/web.config create mode 100644 templates/ReactReduxSpa/web.config create mode 100644 templates/ReactSpa/web.config create mode 100644 templates/WebApplicationBasic/web.config diff --git a/templates/Angular2Spa/web.config b/templates/Angular2Spa/web.config new file mode 100644 index 00000000..a8d66727 --- /dev/null +++ b/templates/Angular2Spa/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/templates/KnockoutSpa/web.config b/templates/KnockoutSpa/web.config new file mode 100644 index 00000000..a8d66727 --- /dev/null +++ b/templates/KnockoutSpa/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/templates/ReactReduxSpa/web.config b/templates/ReactReduxSpa/web.config new file mode 100644 index 00000000..a8d66727 --- /dev/null +++ b/templates/ReactReduxSpa/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/templates/ReactSpa/web.config b/templates/ReactSpa/web.config new file mode 100644 index 00000000..a8d66727 --- /dev/null +++ b/templates/ReactSpa/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/templates/WebApplicationBasic/web.config b/templates/WebApplicationBasic/web.config new file mode 100644 index 00000000..a8d66727 --- /dev/null +++ b/templates/WebApplicationBasic/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + From 7ddd4cacecad053b2395f05ae6459f849a7ffd16 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 13:14:00 +0100 Subject: [PATCH 013/847] Amend all templates' project.json files to match current "yo aspnet" template content (plus the SPA-specific stuff) --- templates/Angular2Spa/project.json | 82 ++++++++++++++-------- templates/KnockoutSpa/project.json | 82 ++++++++++++++-------- templates/ReactReduxSpa/project.json | 82 ++++++++++++++-------- templates/ReactSpa/project.json | 82 ++++++++++++++-------- templates/WebApplicationBasic/project.json | 75 ++++++++++++-------- 5 files changed, 259 insertions(+), 144 deletions(-) diff --git a/templates/Angular2Spa/project.json b/templates/Angular2Spa/project.json index a92513a0..0bd38bf9 100755 --- a/templates/Angular2Spa/project.json +++ b/templates/Angular2Spa/project.json @@ -1,33 +1,37 @@ { - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "WebApplicationBasic" - }, - "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0-rc2-3002702", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", - "Microsoft.AspNetCore.AngularServices": "1.0.0-*" + "Microsoft.AspNetCore.AngularServices": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + } }, + "frameworks": { "netcoreapp1.0": { "imports": [ @@ -37,14 +41,30 @@ ] } }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "gcServer": true + }, + "publishOptions": { - "exclude": [ - "node_modules", - "**.xproj", - "**.user", - "**.vspscc" + "include": [ + "appsettings.json", + "ClientApp", + "typings", + "Views", + "tsconfig.json", + "tsd.json", + "web.config", + "webpack.*.js", + "wwwroot" ] }, + "scripts": { "prepublish": [ "npm install", @@ -52,5 +72,9 @@ "node node_modules/webpack/bin/webpack.js" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" } } diff --git a/templates/KnockoutSpa/project.json b/templates/KnockoutSpa/project.json index 63f8a973..d4ca601a 100755 --- a/templates/KnockoutSpa/project.json +++ b/templates/KnockoutSpa/project.json @@ -1,33 +1,37 @@ { - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "WebApplicationBasic" - }, - "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0-rc2-3002702", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", - "Microsoft.AspNetCore.SpaServices": "1.0.0-*" + "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.SpaServices": "1.0.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + } }, + "frameworks": { "netcoreapp1.0": { "imports": [ @@ -37,14 +41,30 @@ ] } }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "gcServer": true + }, + "publishOptions": { - "exclude": [ - "node_modules", - "**.xproj", - "**.user", - "**.vspscc" + "include": [ + "appsettings.json", + "ClientApp", + "typings", + "Views", + "tsconfig.json", + "tsd.json", + "web.config", + "webpack.*.js", + "wwwroot" ] }, + "scripts": { "prepublish": [ "npm install", @@ -52,5 +72,9 @@ "node node_modules/webpack/bin/webpack.js" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" } } diff --git a/templates/ReactReduxSpa/project.json b/templates/ReactReduxSpa/project.json index 59fea50b..c2e364d5 100755 --- a/templates/ReactReduxSpa/project.json +++ b/templates/ReactReduxSpa/project.json @@ -1,33 +1,37 @@ { - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "WebApplicationBasic" - }, - "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0-rc2-3002702", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", - "Microsoft.AspNetCore.ReactServices": "1.0.0-*" + "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "type": "build" + }, + "Microsoft.AspNetCore.ReactServices": "1.0.0-*", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + } }, + "frameworks": { "netcoreapp1.0": { "imports": [ @@ -37,14 +41,30 @@ ] } }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "gcServer": true + }, + "publishOptions": { - "exclude": [ - "node_modules", - "**.xproj", - "**.user", - "**.vspscc" + "include": [ + "appsettings.json", + "ClientApp", + "typings", + "Views", + "tsconfig.json", + "tsd.json", + "web.config", + "webpack.*.js", + "wwwroot" ] }, + "scripts": { "prepublish": [ "npm install", @@ -52,5 +72,9 @@ "node node_modules/webpack/bin/webpack.js" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" } } diff --git a/templates/ReactSpa/project.json b/templates/ReactSpa/project.json index 59fea50b..c2e364d5 100755 --- a/templates/ReactSpa/project.json +++ b/templates/ReactSpa/project.json @@ -1,33 +1,37 @@ { - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "WebApplicationBasic" - }, - "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0-rc2-3002702", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", - "Microsoft.AspNetCore.ReactServices": "1.0.0-*" + "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "type": "build" + }, + "Microsoft.AspNetCore.ReactServices": "1.0.0-*", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + } }, + "frameworks": { "netcoreapp1.0": { "imports": [ @@ -37,14 +41,30 @@ ] } }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "gcServer": true + }, + "publishOptions": { - "exclude": [ - "node_modules", - "**.xproj", - "**.user", - "**.vspscc" + "include": [ + "appsettings.json", + "ClientApp", + "typings", + "Views", + "tsconfig.json", + "tsd.json", + "web.config", + "webpack.*.js", + "wwwroot" ] }, + "scripts": { "prepublish": [ "npm install", @@ -52,5 +72,9 @@ "node node_modules/webpack/bin/webpack.js" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" } } diff --git a/templates/WebApplicationBasic/project.json b/templates/WebApplicationBasic/project.json index 27c68eb1..59f19694 100755 --- a/templates/WebApplicationBasic/project.json +++ b/templates/WebApplicationBasic/project.json @@ -1,32 +1,36 @@ { - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "WebApplicationBasic" - }, - "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0-rc2-3002702", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*" + "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", + "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-preview1-final", + "imports": "portable-net45+win8+dnxcore50" + } }, + "frameworks": { "netcoreapp1.0": { "imports": [ @@ -36,14 +40,25 @@ ] } }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true + }, + + "runtimeOptions": { + "gcServer": true + }, + "publishOptions": { - "exclude": [ - "node_modules", - "**.xproj", - "**.user", - "**.vspscc" + "include": [ + "appsettings.json", + "Views", + "web.config", + "wwwroot" ] }, + "scripts": { "prepublish": [ "npm install", @@ -51,5 +66,9 @@ "node node_modules/webpack/bin/webpack.js" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" } } From 64caa7c86a2b6d7914e989f867e93632cec10257 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 13:14:12 +0100 Subject: [PATCH 014/847] Bump templates version to 0.1.7 for publishing --- templates/yeoman/src/generator/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/yeoman/src/generator/package.json b/templates/yeoman/src/generator/package.json index 1f9063cb..70af196d 100644 --- a/templates/yeoman/src/generator/package.json +++ b/templates/yeoman/src/generator/package.json @@ -1,6 +1,6 @@ { "name": "generator-aspnetcore-spa", - "version": "0.1.6", + "version": "0.1.7", "description": "Single-Page App templates for ASP.NET Core", "author": "Microsoft", "license": "Apache-2.0", From ce6cdfd2bcef76ab7f55c8e2a7828209a210a4c3 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 13:47:44 +0100 Subject: [PATCH 015/847] Templates should also publish node_modules, since it's used at runtime --- templates/Angular2Spa/project.json | 1 + templates/KnockoutSpa/project.json | 1 + templates/ReactReduxSpa/project.json | 1 + templates/ReactSpa/project.json | 1 + templates/yeoman/src/generator/package.json | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/Angular2Spa/project.json b/templates/Angular2Spa/project.json index 0bd38bf9..7c2ae8f5 100755 --- a/templates/Angular2Spa/project.json +++ b/templates/Angular2Spa/project.json @@ -55,6 +55,7 @@ "include": [ "appsettings.json", "ClientApp", + "node_modules", "typings", "Views", "tsconfig.json", diff --git a/templates/KnockoutSpa/project.json b/templates/KnockoutSpa/project.json index d4ca601a..893c2770 100755 --- a/templates/KnockoutSpa/project.json +++ b/templates/KnockoutSpa/project.json @@ -55,6 +55,7 @@ "include": [ "appsettings.json", "ClientApp", + "node_modules", "typings", "Views", "tsconfig.json", diff --git a/templates/ReactReduxSpa/project.json b/templates/ReactReduxSpa/project.json index c2e364d5..7149c369 100755 --- a/templates/ReactReduxSpa/project.json +++ b/templates/ReactReduxSpa/project.json @@ -55,6 +55,7 @@ "include": [ "appsettings.json", "ClientApp", + "node_modules", "typings", "Views", "tsconfig.json", diff --git a/templates/ReactSpa/project.json b/templates/ReactSpa/project.json index c2e364d5..7149c369 100755 --- a/templates/ReactSpa/project.json +++ b/templates/ReactSpa/project.json @@ -55,6 +55,7 @@ "include": [ "appsettings.json", "ClientApp", + "node_modules", "typings", "Views", "tsconfig.json", diff --git a/templates/yeoman/src/generator/package.json b/templates/yeoman/src/generator/package.json index 70af196d..a54ef5b1 100644 --- a/templates/yeoman/src/generator/package.json +++ b/templates/yeoman/src/generator/package.json @@ -1,6 +1,6 @@ { "name": "generator-aspnetcore-spa", - "version": "0.1.7", + "version": "0.1.8", "description": "Single-Page App templates for ASP.NET Core", "author": "Microsoft", "license": "Apache-2.0", From 8423233f445dc3929b46ede16a840a6936fee56c Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 17:02:11 +0100 Subject: [PATCH 016/847] Update to angular2-universal 0.103.0 and amend boot-server.ts to fix "there can only be one platform" issue --- .../Angular2Spa/ClientApp/boot-server.ts | 35 ++++++++++--------- templates/Angular2Spa/package.json | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/templates/Angular2Spa/ClientApp/boot-server.ts b/templates/Angular2Spa/ClientApp/boot-server.ts index 752337f0..959b90eb 100644 --- a/templates/Angular2Spa/ClientApp/boot-server.ts +++ b/templates/Angular2Spa/ClientApp/boot-server.ts @@ -1,32 +1,33 @@ import 'angular2-universal/polyfills'; import * as ngCore from '@angular/core'; -import * as ngRouter from '@angular/router-deprecated'; import * as ngUniversal from 'angular2-universal'; import { BASE_URL, ORIGIN_URL, REQUEST_URL } from 'angular2-universal/common'; import { App } from './components/app/app'; -export default function (params: any): Promise<{ html: string, globals?: any }> { - const serverBindings = [ - ngCore.provide(BASE_URL, { useValue: '/' }), - ngCore.provide(ORIGIN_URL, { useValue: params.origin }), - ngCore.provide(REQUEST_URL, { useValue: params.url }), - ...ngUniversal.NODE_PLATFORM_PIPES, - ...ngUniversal.NODE_ROUTER_PROVIDERS, - ...ngUniversal.NODE_HTTP_PROVIDERS, - ]; +const bootloader = ngUniversal.bootloader({ + async: true, + preboot: false, + platformProviders: [ + ngCore.provide(BASE_URL, { useValue: '/' }) + ] +}); - let bootloader = ngUniversal.bootloader({ +export default function (params: any): Promise<{ html: string, globals?: any }> { + const config: ngUniversal.AppConfig = { directives: [App], - componentProviders: serverBindings, - async: true, - preboot: false, + providers: [ + ngCore.provide(REQUEST_URL, { useValue: params.url }), + ngCore.provide(ORIGIN_URL, { useValue: params.origin }), + ...ngUniversal.NODE_PLATFORM_PIPES, + ...ngUniversal.NODE_ROUTER_PROVIDERS, + ...ngUniversal.NODE_HTTP_PROVIDERS, + ], // TODO: Render just the component instead of wrapping it inside an extra HTML document // Waiting on https://github.com/angular/universal/issues/347 template: '\n' - }); + }; - return bootloader.serializeApplication().then(html => { - bootloader.dispose(); + return bootloader.serializeApplication(config).then(html => { return { html }; }); } diff --git a/templates/Angular2Spa/package.json b/templates/Angular2Spa/package.json index e76863d0..690542d9 100644 --- a/templates/Angular2Spa/package.json +++ b/templates/Angular2Spa/package.json @@ -27,7 +27,7 @@ "@angular/platform-server": "2.0.0-rc.1", "@angular/router": "2.0.0-rc.1", "@angular/router-deprecated": "2.0.0-rc.1", - "angular2-universal": "0.100.3", + "angular2-universal": "0.103.0", "aspnet-prerendering": "^1.0.2", "aspnet-webpack": "^1.0.1", "css": "^2.2.1", From fc7097c2fe8e03cd71ff0ee6b72bb8377773c7fd Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Wed, 22 Jun 2016 17:02:41 +0100 Subject: [PATCH 017/847] Publish Yeoman generators as version 0.1.9 --- templates/yeoman/src/generator/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/yeoman/src/generator/package.json b/templates/yeoman/src/generator/package.json index a54ef5b1..37e7edda 100644 --- a/templates/yeoman/src/generator/package.json +++ b/templates/yeoman/src/generator/package.json @@ -1,6 +1,6 @@ { "name": "generator-aspnetcore-spa", - "version": "0.1.8", + "version": "0.1.9", "description": "Single-Page App templates for ASP.NET Core", "author": "Microsoft", "license": "Apache-2.0", From eebf5098464c5defbfe4aa305a90d72be0a7d2c1 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 28 Jun 2016 10:58:05 +0100 Subject: [PATCH 018/847] Update 'src' project dependencies for .NET Core 1.0 RTM --- .../project.json | 4 +-- .../project.json | 27 ++++++++++--------- .../project.json | 4 +-- .../project.json | 4 +-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.AspNetCore.AngularServices/project.json b/src/Microsoft.AspNetCore.AngularServices/project.json index 60be12cb..8b64b73e 100644 --- a/src/Microsoft.AspNetCore.AngularServices/project.json +++ b/src/Microsoft.AspNetCore.AngularServices/project.json @@ -9,13 +9,13 @@ "defaultNamespace": "Microsoft.AspNetCore.AngularServices" }, "dependencies": { - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", "Microsoft.AspNetCore.SpaServices": "1.0.0-*" }, "frameworks": { "net451": { }, - "netstandard1.0": { + "netstandard1.6": { "imports": [ "dotnet5.6", "dnxcore50", diff --git a/src/Microsoft.AspNetCore.NodeServices/project.json b/src/Microsoft.AspNetCore.NodeServices/project.json index b5b8897c..0da37feb 100644 --- a/src/Microsoft.AspNetCore.NodeServices/project.json +++ b/src/Microsoft.AspNetCore.NodeServices/project.json @@ -6,16 +6,16 @@ }, "authors": [ "Microsoft" ], "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*", - "Microsoft.Extensions.PlatformAbstractions": "1.0.0-*", - "Newtonsoft.Json": "8.0.3" + "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0", + "Microsoft.Extensions.PlatformAbstractions": "1.0.0", + "Newtonsoft.Json": "9.0.1" }, "frameworks": { "net451": { "frameworkAssemblies": { - "System.Net.Http": "4.0.0-*" + "System.Net.Http": "4.0.0" }, "dependencies": { "Microsoft.Tpl.Dataflow": "4.5.24" @@ -28,13 +28,14 @@ "portable-net45+win8" ], "dependencies": { - "System.Console": "4.0.0-*", - "System.Diagnostics.Process": "4.1.0-*", - "System.IO.Pipes": "4.0.0-*", - "System.Net.Http": "4.0.1-*", - "System.Net.Sockets": "4.1.0-*", - "System.Text.RegularExpressions": "4.0.12-*", - "System.Threading.Tasks.Dataflow": "4.5.25-*" + "System.Console": "4.0.0", + "System.Diagnostics.Process": "4.1.0", + "System.IO.Pipes": "4.0.0", + "System.Net.Http": "4.1.0", + "System.Net.Sockets": "4.1.0", + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0", + "System.Text.RegularExpressions": "4.1.0", + "System.Threading.Tasks.Dataflow": "4.5.25" } } }, diff --git a/src/Microsoft.AspNetCore.ReactServices/project.json b/src/Microsoft.AspNetCore.ReactServices/project.json index 79b2eb72..ca1ae6ff 100644 --- a/src/Microsoft.AspNetCore.ReactServices/project.json +++ b/src/Microsoft.AspNetCore.ReactServices/project.json @@ -9,13 +9,13 @@ "defaultNamespace": "Microsoft.AspNetCore.ReactServices" }, "dependencies": { - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", "Microsoft.AspNetCore.SpaServices": "1.0.0-*" }, "frameworks": { "net451": { }, - "netstandard1.0": { + "netstandard1.6": { "imports": [ "dotnet5.6", "dnxcore50", diff --git a/src/Microsoft.AspNetCore.SpaServices/project.json b/src/Microsoft.AspNetCore.SpaServices/project.json index 64011be6..1c55cd23 100644 --- a/src/Microsoft.AspNetCore.SpaServices/project.json +++ b/src/Microsoft.AspNetCore.SpaServices/project.json @@ -8,13 +8,13 @@ "Microsoft" ], "dependencies": { - "Microsoft.AspNetCore.Mvc": "1.0.0-*", + "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.NodeServices": "1.0.0-*" }, "frameworks": { "net451": { }, - "netstandard1.0": { + "netstandard1.6": { "imports": [ "dotnet5.6", "dnxcore50", From a986f8d2cc819d86d3dc83ab85d9e5a658bb4c46 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 28 Jun 2016 11:37:37 +0100 Subject: [PATCH 019/847] Update 'samples' projects for .NET Core 1.0 RTM --- samples/angular/MusicStore/Startup.cs | 7 +++-- samples/angular/MusicStore/project.json | 26 +++++++++---------- samples/misc/LatencyTest/project.json | 4 +-- .../misc/NodeServicesExamples/project.json | 22 ++++++++-------- samples/misc/Webpack/project.json | 22 ++++++++-------- samples/react/MusicStore/Startup.cs | 8 ++++-- samples/react/MusicStore/project.json | 26 +++++++++---------- samples/react/ReactGrid/project.json | 22 ++++++++-------- 8 files changed, 72 insertions(+), 65 deletions(-) diff --git a/samples/angular/MusicStore/Startup.cs b/samples/angular/MusicStore/Startup.cs index ed7e9d6f..3d5e2636 100755 --- a/samples/angular/MusicStore/Startup.cs +++ b/samples/angular/MusicStore/Startup.cs @@ -22,8 +22,11 @@ public class Startup // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMvc(); - + services.AddMvc().AddJsonOptions(options => + { + options.SerializerSettings.ContractResolver = null; + }); + // Add EF services to the service container services.AddEntityFramework() .AddEntityFrameworkSqlite() diff --git a/samples/angular/MusicStore/project.json b/samples/angular/MusicStore/project.json index d907a0fa..d341cf13 100755 --- a/samples/angular/MusicStore/project.json +++ b/samples/angular/MusicStore/project.json @@ -13,21 +13,21 @@ "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", - "Microsoft.EntityFrameworkCore.SQLite": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.EntityFrameworkCore.SQLite": "1.0.0", "Microsoft.AspNetCore.AngularServices": "1.0.0-*", "AutoMapper": "4.1.1" }, diff --git a/samples/misc/LatencyTest/project.json b/samples/misc/LatencyTest/project.json index 1dd7f9c0..33820b5d 100755 --- a/samples/misc/LatencyTest/project.json +++ b/samples/misc/LatencyTest/project.json @@ -5,9 +5,9 @@ }, "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0", "type": "platform" - }, + }, "Microsoft.AspNetCore.NodeServices": "1.0.0-*" }, "frameworks": { diff --git a/samples/misc/NodeServicesExamples/project.json b/samples/misc/NodeServicesExamples/project.json index de6a8d5f..eb168a66 100755 --- a/samples/misc/NodeServicesExamples/project.json +++ b/samples/misc/NodeServicesExamples/project.json @@ -12,19 +12,19 @@ }, "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.Extensions.Logging.Debug": "1.0.0", "Microsoft.AspNetCore.NodeServices": "1.0.0-*" }, "frameworks": { diff --git a/samples/misc/Webpack/project.json b/samples/misc/Webpack/project.json index 47ef89bd..1b02246b 100755 --- a/samples/misc/Webpack/project.json +++ b/samples/misc/Webpack/project.json @@ -12,19 +12,19 @@ }, "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.Extensions.Logging.Debug": "1.0.0", "Microsoft.AspNetCore.SpaServices": "1.0.0-*" }, "frameworks": { diff --git a/samples/react/MusicStore/Startup.cs b/samples/react/MusicStore/Startup.cs index 57d3ad06..4ea3fec3 100755 --- a/samples/react/MusicStore/Startup.cs +++ b/samples/react/MusicStore/Startup.cs @@ -15,6 +15,7 @@ using AutoMapper; using MusicStore.Apis; using MusicStore.Models; +using Newtonsoft.Json.Serialization; namespace MusicStore { @@ -23,8 +24,11 @@ public class Startup // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMvc(); - + services.AddMvc().AddJsonOptions(options => + { + options.SerializerSettings.ContractResolver = null; + }); + // Add EF services to the service container services.AddEntityFramework() .AddEntityFrameworkSqlite() diff --git a/samples/react/MusicStore/project.json b/samples/react/MusicStore/project.json index d0eaa908..faebf7ac 100755 --- a/samples/react/MusicStore/project.json +++ b/samples/react/MusicStore/project.json @@ -13,21 +13,21 @@ "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", - "Microsoft.EntityFrameworkCore.SQLite": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.EntityFrameworkCore.SQLite": "1.0.0", "Microsoft.AspNetCore.ReactServices": "1.0.0-*", "AutoMapper": "4.1.1" }, diff --git a/samples/react/ReactGrid/project.json b/samples/react/ReactGrid/project.json index 616f2dc5..dc5e79e6 100755 --- a/samples/react/ReactGrid/project.json +++ b/samples/react/ReactGrid/project.json @@ -9,19 +9,19 @@ }, "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-*", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Mvc": "1.0.0-*", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Configuration.Json": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.Extensions.Logging.Debug": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", + "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.NETCore.Platforms": "1.0.1", + "Microsoft.Extensions.Logging.Debug": "1.0.0", "Microsoft.AspNetCore.ReactServices": "1.0.0-*" }, "frameworks": { From f1325d0cf2fd7215d3675bec0c24a7eac33b1099 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 28 Jun 2016 11:51:45 +0100 Subject: [PATCH 020/847] Update 'templates' projects for .NET Core 1.0 RTM --- templates/Angular2Spa/project.json | 60 +++++++++++++++------ templates/KnockoutSpa/project.json | 62 ++++++++++++++++------ templates/ReactReduxSpa/project.json | 62 ++++++++++++++++------ templates/ReactSpa/project.json | 62 ++++++++++++++++------ templates/WebApplicationBasic/project.json | 60 +++++++++++++++------ 5 files changed, 228 insertions(+), 78 deletions(-) diff --git a/templates/Angular2Spa/project.json b/templates/Angular2Spa/project.json index 7c2ae8f5..1e09cd25 100755 --- a/templates/Angular2Spa/project.json +++ b/templates/Angular2Spa/project.json @@ -1,34 +1,61 @@ { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-3002702", + "version": "1.0.0", "type": "platform" }, + "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", "Microsoft.AspNetCore.AngularServices": "1.0.0-*", - "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "type": "build" }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { + "version": "1.0.0-preview2-final", + "type": "build" + } }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.EntityFrameworkCore.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] + }, + "Microsoft.Extensions.SecretManager.Tools": { + "version": "1.0.0-preview2-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] } }, @@ -43,12 +70,15 @@ }, "buildOptions": { + "debugType": "portable", "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/KnockoutSpa/project.json b/templates/KnockoutSpa/project.json index 893c2770..608da4b5 100755 --- a/templates/KnockoutSpa/project.json +++ b/templates/KnockoutSpa/project.json @@ -1,34 +1,61 @@ { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-3002702", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", + "Microsoft.AspNetCore.SpaServices": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "type": "build" }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", - "Microsoft.AspNetCore.SpaServices": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { + "version": "1.0.0-preview2-final", + "type": "build" + } }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.EntityFrameworkCore.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] + }, + "Microsoft.Extensions.SecretManager.Tools": { + "version": "1.0.0-preview2-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] } }, @@ -43,12 +70,15 @@ }, "buildOptions": { + "debugType": "portable", "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/ReactReduxSpa/project.json b/templates/ReactReduxSpa/project.json index 7149c369..d8106a71 100755 --- a/templates/ReactReduxSpa/project.json +++ b/templates/ReactReduxSpa/project.json @@ -1,34 +1,61 @@ { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-3002702", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", + "Microsoft.AspNetCore.ReactServices": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "type": "build" }, - "Microsoft.AspNetCore.ReactServices": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { + "version": "1.0.0-preview2-final", + "type": "build" + } }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.EntityFrameworkCore.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] + }, + "Microsoft.Extensions.SecretManager.Tools": { + "version": "1.0.0-preview2-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] } }, @@ -43,12 +70,15 @@ }, "buildOptions": { + "debugType": "portable", "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/ReactSpa/project.json b/templates/ReactSpa/project.json index 7149c369..d8106a71 100755 --- a/templates/ReactSpa/project.json +++ b/templates/ReactSpa/project.json @@ -1,34 +1,61 @@ { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-3002702", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", + "Microsoft.AspNetCore.ReactServices": "1.0.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "type": "build" }, - "Microsoft.AspNetCore.ReactServices": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { + "version": "1.0.0-preview2-final", + "type": "build" + } }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.EntityFrameworkCore.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] + }, + "Microsoft.Extensions.SecretManager.Tools": { + "version": "1.0.0-preview2-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] } }, @@ -43,12 +70,15 @@ }, "buildOptions": { + "debugType": "portable", "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/WebApplicationBasic/project.json b/templates/WebApplicationBasic/project.json index 59f19694..a28b4b39 100755 --- a/templates/WebApplicationBasic/project.json +++ b/templates/WebApplicationBasic/project.json @@ -1,33 +1,60 @@ { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-rc2-3002702", + "version": "1.0.0", "type": "platform" }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final", + "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", + "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "type": "build" }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final", - "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", + "Microsoft.Extensions.Configuration.Json": "1.0.0", + "Microsoft.Extensions.Logging": "1.0.0", + "Microsoft.Extensions.Logging.Console": "1.0.0", + "Microsoft.Extensions.Logging.Debug": "1.0.0", + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { + "version": "1.0.0-preview2-final", + "type": "build" + } }, "tools": { "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" }, "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview1-final", + "version": "1.0.0-preview2-final", "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.EntityFrameworkCore.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] + }, + "Microsoft.Extensions.SecretManager.Tools": { + "version": "1.0.0-preview2-final", + "imports": "portable-net45+win8+dnxcore50" + }, + "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { + "version": "1.0.0-preview2-final", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net45+win8" + ] } }, @@ -42,12 +69,15 @@ }, "buildOptions": { + "debugType": "portable", "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { From 8f2117cf895cc192480d57f4a0b88256ecb6c1f2 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 28 Jun 2016 12:40:14 +0100 Subject: [PATCH 021/847] Upgrade Angular template to Angular 2 RC3 and migrate to new @angular/router --- .../Angular2Spa/ClientApp/boot-client.ts | 11 ++++++++--- .../Angular2Spa/ClientApp/boot-server.ts | 11 +++++++---- .../ClientApp/components/app/app.ts | 13 ++----------- .../components/nav-menu/nav-menu.html | 14 +++++++------- .../ClientApp/components/nav-menu/nav-menu.ts | 4 ++-- templates/Angular2Spa/ClientApp/routes.ts | 12 ++++++++++++ .../Angular2Spa/ClientApp/styles/site.css | 6 +++--- templates/Angular2Spa/package.json | 19 +++++++++---------- .../Angular2Spa/webpack.config.vendor.js | 3 +-- 9 files changed, 51 insertions(+), 42 deletions(-) create mode 100644 templates/Angular2Spa/ClientApp/routes.ts diff --git a/templates/Angular2Spa/ClientApp/boot-client.ts b/templates/Angular2Spa/ClientApp/boot-client.ts index 50f71812..be3ca226 100644 --- a/templates/Angular2Spa/ClientApp/boot-client.ts +++ b/templates/Angular2Spa/ClientApp/boot-client.ts @@ -5,11 +5,16 @@ import './styles/site.css'; import { bootstrap } from '@angular/platform-browser-dynamic'; import { FormBuilder } from '@angular/common'; -import * as router from '@angular/router-deprecated'; -import { Http, HTTP_PROVIDERS } from '@angular/http'; +import { provideRouter } from '@angular/router'; +import { HTTP_PROVIDERS } from '@angular/http'; import { App } from './components/app/app'; +import { routes } from './routes'; -bootstrap(App, [router.ROUTER_PROVIDERS, HTTP_PROVIDERS, FormBuilder]); +bootstrap(App, [ + ...HTTP_PROVIDERS, + FormBuilder, + provideRouter(routes) +]); // 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. diff --git a/templates/Angular2Spa/ClientApp/boot-server.ts b/templates/Angular2Spa/ClientApp/boot-server.ts index 959b90eb..3549263b 100644 --- a/templates/Angular2Spa/ClientApp/boot-server.ts +++ b/templates/Angular2Spa/ClientApp/boot-server.ts @@ -1,14 +1,17 @@ import 'angular2-universal/polyfills'; import * as ngCore from '@angular/core'; +import { APP_BASE_HREF } from '@angular/common'; +import { provideRouter } from '@angular/router'; import * as ngUniversal from 'angular2-universal'; import { BASE_URL, ORIGIN_URL, REQUEST_URL } from 'angular2-universal/common'; import { App } from './components/app/app'; +import { routes } from './routes'; const bootloader = ngUniversal.bootloader({ async: true, preboot: false, platformProviders: [ - ngCore.provide(BASE_URL, { useValue: '/' }) + ngCore.provide(APP_BASE_HREF, { useValue: '/' }), ] }); @@ -16,11 +19,11 @@ export default function (params: any): Promise<{ html: string, globals?: any }> const config: ngUniversal.AppConfig = { directives: [App], providers: [ - ngCore.provide(REQUEST_URL, { useValue: params.url }), ngCore.provide(ORIGIN_URL, { useValue: params.origin }), - ...ngUniversal.NODE_PLATFORM_PIPES, - ...ngUniversal.NODE_ROUTER_PROVIDERS, + ngCore.provide(REQUEST_URL, { useValue: params.url }), ...ngUniversal.NODE_HTTP_PROVIDERS, + provideRouter(routes), + ...ngUniversal.NODE_LOCATION_PROVIDERS, ], // TODO: Render just the component instead of wrapping it inside an extra HTML document // Waiting on https://github.com/angular/universal/issues/347 diff --git a/templates/Angular2Spa/ClientApp/components/app/app.ts b/templates/Angular2Spa/ClientApp/components/app/app.ts index be0e6940..d6fc8b96 100644 --- a/templates/Angular2Spa/ClientApp/components/app/app.ts +++ b/templates/Angular2Spa/ClientApp/components/app/app.ts @@ -1,20 +1,11 @@ import * as ng from '@angular/core'; -import * as router from '@angular/router-deprecated'; -import { Http, HTTP_BINDINGS } from '@angular/http'; +import { ROUTER_DIRECTIVES } from '@angular/router'; import { NavMenu } from '../nav-menu/nav-menu'; -import { Home } from '../home/home'; -import { FetchData } from '../fetch-data/fetch-data'; -import { Counter } from '../counter/counter'; @ng.Component({ selector: 'app', template: require('./app.html'), - directives: [NavMenu, router.ROUTER_DIRECTIVES] + directives: [...ROUTER_DIRECTIVES, NavMenu] }) -@router.RouteConfig([ - { path: '/', component: Home, name: 'Home' }, - { path: '/counter', component: Counter, name: 'Counter' }, - { path: '/fetch-data', component: FetchData, name: 'FetchData' } -]) export class App { } diff --git a/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.html b/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.html index 7130edaf..4926cb82 100644 --- a/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.html +++ b/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.html @@ -7,23 +7,23 @@ - WebApplicationBasic + WebApplicationBasic