From 0745266c17a842388c5e57bc3089668ad93f5296 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 21 Sep 2018 12:52:44 -0700 Subject: [PATCH 1/4] Razor->WebApp --- scripts/Run-Razor-Locally.ps1 | 2 +- .../RazorPagesWeb-CSharp/.template.config/template.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Run-Razor-Locally.ps1 b/scripts/Run-Razor-Locally.ps1 index 0b627f4251..0b9e613c08 100644 --- a/scripts/Run-Razor-Locally.ps1 +++ b/scripts/Run-Razor-Locally.ps1 @@ -6,4 +6,4 @@ param() . $PSScriptRoot\Custom-Hive.ps1 -Test-Template "razor" "razor -au Individual" "Microsoft.DotNet.Web.ProjectTemplates.2.2.2.2.0-preview3-t000.nupkg" $false +Test-Template "webapp" "webapp -au Individual" "Microsoft.DotNet.Web.ProjectTemplates.2.2.2.2.0-preview3-t000.nupkg" $false diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json b/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json index 1f0cdc54e1..de9a5a7f92 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json @@ -13,8 +13,8 @@ "precedence": "4000", "identity": "Microsoft.Web.RazorPages.CSharp.2.2", "shortName": [ - "razor", - "webapp" + "webapp", + "razor" ], "thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210", "tags": { @@ -364,4 +364,4 @@ "continueOnError": true } ] -} \ No newline at end of file +} From c6347f035fd9a40fd522c8365f9491603197e589 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 17 Sep 2018 15:10:26 -0700 Subject: [PATCH 2/4] Conditionally include RootNamespace --- .../EmptyWeb-CSharp.csproj.in | 1 + .../EmptyWeb-FSharp.fsproj.in | 1 + .../RazorClassLibrary-CSharp.csproj.in | 1 + .../RazorPagesWeb-CSharp.csproj.in | 1 + .../StarterWeb-CSharp.csproj.in | 1 + .../StarterWeb-FSharp.fsproj.in | 1 + .../WebApi-CSharp.csproj.in | 1 + .../WebApi-FSharp.fsproj.in | 1 + .../Angular-CSharp.csproj.in | 1 + .../React-CSharp.csproj.in | 1 + .../ReactRedux-CSharp.csproj.in | 1 + 11 files changed, 11 insertions(+) diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in index 336329f2e1..f1a998425c 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in @@ -5,6 +5,7 @@ TargetFrameworkOverride True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in index 909432c588..1bb5d1fcd5 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in @@ -5,6 +5,7 @@ TargetFrameworkOverride True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in index fb5155ba60..3131d24f0d 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in @@ -2,6 +2,7 @@ netstandard2.0 + Company.RazorClassLibrary1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in index fe3d3b1350..45d684133b 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in @@ -9,6 +9,7 @@ 1 True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in index 59dc844bd4..a1e17b4257 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in @@ -9,6 +9,7 @@ 1 True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in index 6a6532bdc7..1279787037 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in @@ -6,6 +6,7 @@ true True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in index 52b3089b42..23f19984ec 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in @@ -8,6 +8,7 @@ 1 True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in index e581a3a001..2a775f4c7d 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in @@ -5,6 +5,7 @@ TargetFrameworkOverride True inprocess + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in index 6756aa6ddc..8c4f03af77 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in @@ -12,6 +12,7 @@ false + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in index bff0b2ca85..eda4438c88 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in @@ -9,6 +9,7 @@ ClientApp\ $(DefaultItemExcludes);$(SpaRoot)node_modules\** True + Company.WebApplication1 diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in index 112d68b769..19b2a0bc02 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in @@ -9,6 +9,7 @@ ClientApp\ $(DefaultItemExcludes);$(SpaRoot)node_modules\** True + Company.WebApplication1 From b07338b6185dd2cfb0358b13370dde5766b27369 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 26 Sep 2018 12:50:24 -0700 Subject: [PATCH 3/4] Don't use depricated methods (#751) Don't use depricated methods --- scripts/Custom-Hive.ps1 | 12 +++++++----- .../ClientApp/src/components/NavMenu.js | 9 +++++---- .../ClientApp/src/components/FetchData.js | 17 ++++++++++------- .../ClientApp/src/components/NavMenu.js | 9 +++++---- 4 files changed, 27 insertions(+), 20 deletions(-) diff --git a/scripts/Custom-Hive.ps1 b/scripts/Custom-Hive.ps1 index 5c0e0b3f10..aeb7759614 100644 --- a/scripts/Custom-Hive.ps1 +++ b/scripts/Custom-Hive.ps1 @@ -14,18 +14,20 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) { try { Run-DotnetNew $templateArgs, "--no-restore" - if($templateArgs -match 'F#') - { + if ($templateArgs -match 'F#') { $extension = "fsproj" } - else - { + else { $extension = "csproj" } $proj = "$tmpDir/$templateName.$extension" $projContent = Get-Content -Path $proj -Raw - $projContent = $projContent -replace ('', "`n") + $projContent = $projContent -replace ('', " + + + + ") $projContent | Set-Content $proj dotnet publish --configuration Release diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/NavMenu.js b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/NavMenu.js index 07f5b2dbfc..30e2c7ee90 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/NavMenu.js +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/NavMenu.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; +import { Link } from 'react-router-dom'; import './NavMenu.css'; export class NavMenu extends Component { @@ -25,18 +26,18 @@ export class NavMenu extends Component {
- Company.WebApplication1 + Company.WebApplication1
    - Home + Home - Counter + Counter - Fetch data + Fetch data
diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/FetchData.js b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/FetchData.js index 63424996fb..73a98881ed 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/FetchData.js +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/FetchData.js @@ -5,15 +5,18 @@ import { Link } from 'react-router-dom'; import { actionCreators } from '../store/WeatherForecasts'; class FetchData extends Component { - componentWillMount() { - // This method runs when the component is first added to the page - const startDateIndex = parseInt(this.props.match.params.startDateIndex, 10) || 0; - this.props.requestWeatherForecasts(startDateIndex); + componentDidMount() { + // This method is called when the component is first added to the document + this.ensureDataFetched(); } - componentWillReceiveProps(nextProps) { - // This method runs when incoming props (e.g., route params) change - const startDateIndex = parseInt(nextProps.match.params.startDateIndex, 10) || 0; + componentDidUpdate() { + // This method is called when the route parameters change + this.ensureDataFetched(); + } + + ensureDataFetched() { + const startDateIndex = parseInt(this.props.match.params.startDateIndex, 10) || 0; this.props.requestWeatherForecasts(startDateIndex); } diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/NavMenu.js b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/NavMenu.js index 72c5282b5c..56966cd5f1 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/NavMenu.js +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/NavMenu.js @@ -1,5 +1,6 @@ import React from 'react'; import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap'; +import { Link } from 'react-router-dom'; import './NavMenu.css'; export default class NavMenu extends React.Component { @@ -21,18 +22,18 @@ export default class NavMenu extends React.Component {
- Company.WebApplication1 + Company.WebApplication1
    - Home + Home - Counter + Counter - Fetch data + Fetch data
From 9bda3a60a652f70b187f376de06e2b7b665bff49 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 28 Sep 2018 17:10:41 -0700 Subject: [PATCH 4/4] automated: bulk infrastructure updates. Update bootstrapper scripts and remove unnecessary signing properties --- run.ps1 | 6 +++--- run.sh | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/run.ps1 b/run.ps1 index 3b27382468..34604c7175 100644 --- a/run.ps1 +++ b/run.ps1 @@ -52,8 +52,8 @@ in the file are overridden by command line parameters. Example config file: ```json { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", + "channel": "master", "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" } ``` @@ -192,7 +192,7 @@ if (!$DotNetHome) { else { Join-Path $PSScriptRoot '.dotnet'} } -if (!$Channel) { $Channel = 'dev' } +if (!$Channel) { $Channel = 'master' } if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } # Execute diff --git a/run.sh b/run.sh index 02aac15874..4c1fed5646 100755 --- a/run.sh +++ b/run.sh @@ -220,7 +220,7 @@ if [ -f "$config_file" ]; then config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" else - _error "$config_file contains invalid JSON." + __error "$config_file contains invalid JSON." exit 1 fi elif __machine_has python ; then @@ -228,7 +228,7 @@ if [ -f "$config_file" ]; then config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" else - _error "$config_file contains invalid JSON." + __error "$config_file contains invalid JSON." exit 1 fi elif __machine_has python3 ; then @@ -236,11 +236,11 @@ if [ -f "$config_file" ]; then config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" else - _error "$config_file contains invalid JSON." + __error "$config_file contains invalid JSON." exit 1 fi else - _error 'Missing required command: jq or python. Could not parse the JSON file.' + __error 'Missing required command: jq or python. Could not parse the JSON file.' exit 1 fi @@ -248,7 +248,7 @@ if [ -f "$config_file" ]; then [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" fi -[ -z "$channel" ] && channel='dev' +[ -z "$channel" ] && channel='master' [ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' get_korebuild