From 821ad85e41d2dfd18a87e9dc4e66016c5e93c1b4 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 01:17:49 -0800 Subject: [PATCH 001/432] Fixup MSBuild conversion (#721) * Replace makefile.shade with repo.targets * Remove web site projects as these are not yet supported by MSBuild for .NET Core cref https://github.com/Microsoft/msbuild/issues/1767 --- JavaScriptServices.sln | 54 ------------------------------------------ build.ps1 | 16 ++++++------- build.sh | 22 ++++++++--------- build/repo.targets | 12 ++++++++++ makefile.shade | 14 ----------- 5 files changed, 31 insertions(+), 87 deletions(-) create mode 100644 build/repo.targets delete mode 100755 makefile.shade diff --git a/JavaScriptServices.sln b/JavaScriptServices.sln index f4c55cc1..15e23dde 100644 --- a/JavaScriptServices.sln +++ b/JavaScriptServices.sln @@ -56,50 +56,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactReduxSpa", "templates\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.csproj", "{86911E07-C733-4C18-B49F-9A007A651246}" EndProject -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "package-builder", "templates\package-builder\", "{1389D9BF-402E-4639-8573-8340EFB8FBD0}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/localhost_57758" - Debug.AspNetCompiler.PhysicalPath = "templates\package-builder\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_57758\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/localhost_57758" - Release.AspNetCompiler.PhysicalPath = "templates\package-builder\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_57758\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "57758" - SlnRelativePath = "templates\package-builder\" - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{BDE761D9-8E1C-4FB1-BB86-110393C59176}" -EndProject -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "test", "test\", "{A01B46C2-53D8-499D-8CDE-68E3E7B52804}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/localhost_54430" - Debug.AspNetCompiler.PhysicalPath = "test\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_54430\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/localhost_54430" - Release.AspNetCompiler.PhysicalPath = "test\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_54430\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "54430" - SlnRelativePath = "test\" - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E415FE14-13B0-469F-836D-95059E6BAA6E}" ProjectSection(SolutionItems) = preProject src\build\common.props = src\build\common.props @@ -180,14 +136,6 @@ Global {86911E07-C733-4C18-B49F-9A007A651246}.Debug|Any CPU.Build.0 = Debug|Any CPU {86911E07-C733-4C18-B49F-9A007A651246}.Release|Any CPU.ActiveCfg = Release|Any CPU {86911E07-C733-4C18-B49F-9A007A651246}.Release|Any CPU.Build.0 = Release|Any CPU - {1389D9BF-402E-4639-8573-8340EFB8FBD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1389D9BF-402E-4639-8573-8340EFB8FBD0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1389D9BF-402E-4639-8573-8340EFB8FBD0}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {1389D9BF-402E-4639-8573-8340EFB8FBD0}.Release|Any CPU.Build.0 = Debug|Any CPU - {A01B46C2-53D8-499D-8CDE-68E3E7B52804}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A01B46C2-53D8-499D-8CDE-68E3E7B52804}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A01B46C2-53D8-499D-8CDE-68E3E7B52804}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {A01B46C2-53D8-499D-8CDE-68E3E7B52804}.Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -213,8 +161,6 @@ Global {868A630E-C61B-4807-B7A8-7EB53BE1C28A} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D} {9D4D15A1-A25B-44EC-AB63-F1CE9986712E} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D} {86911E07-C733-4C18-B49F-9A007A651246} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D} - {1389D9BF-402E-4639-8573-8340EFB8FBD0} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D} - {A01B46C2-53D8-499D-8CDE-68E3E7B52804} = {BDE761D9-8E1C-4FB1-BB86-110393C59176} {E415FE14-13B0-469F-836D-95059E6BAA6E} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C} EndGlobalSection EndGlobal diff --git a/build.ps1 b/build.ps1 index 8f2f9969..7356a228 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,6 +1,6 @@ $ErrorActionPreference = "Stop" -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) +function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) { while($true) { @@ -19,7 +19,7 @@ function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $ret Start-Sleep -Seconds 10 } - else + else { $exception = $_.Exception throw $exception @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP @@ -43,18 +43,18 @@ $buildFolder = ".build" $buildFile="$buildFolder\KoreBuild.ps1" if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - + Write-Host "Downloading KoreBuild from $koreBuildZip" + $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() New-Item -Path "$tempFolder" -Type directory | Out-Null $localZipFile="$tempFolder\korebuild.zip" - + DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - + New-Item -Path "$buildFolder" -Type directory | Out-Null copy-item "$tempFolder\**\build\*" $buildFolder -Recurse @@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) { } } -&"$buildFile" $args \ No newline at end of file +&"$buildFile" $args diff --git a/build.sh b/build.sh index f4208100..cac797d6 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi @@ -12,12 +12,12 @@ buildFile="$buildFolder/KoreBuild.sh" if test ! -d $buildFolder; then echo "Downloading KoreBuild from $koreBuildZip" - - tempFolder="/tmp/KoreBuild-$(uuidgen)" + + tempFolder="/tmp/KoreBuild-$(uuidgen)" mkdir $tempFolder - + localZipFile="$tempFolder/korebuild.zip" - + retries=6 until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) do @@ -29,18 +29,18 @@ if test ! -d $buildFolder; then echo "Waiting 10 seconds before retrying. Retries left: $retries" sleep 10s done - + unzip -q -d $tempFolder $localZipFile - + mkdir $buildFolder cp -r $tempFolder/**/build/** $buildFolder - + chmod +x $buildFile - + # Cleanup if test ! -d $tempFolder; then - rm -rf $tempFolder + rm -rf $tempFolder fi fi -$buildFile -r $repoFolder "$@" \ No newline at end of file +$buildFile -r $repoFolder "$@" diff --git a/build/repo.targets b/build/repo.targets new file mode 100644 index 00000000..6a84c060 --- /dev/null +++ b/build/repo.targets @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/makefile.shade b/makefile.shade deleted file mode 100755 index ca63dd8c..00000000 --- a/makefile.shade +++ /dev/null @@ -1,14 +0,0 @@ - -var VERSION='0.1' -var FULL_VERSION='0.1' -var AUTHORS='Microsoft Open Technologies, Inc.' -var TEST_PROJECT_GLOB='templates/*/project.json' -var SAMPLES_PROJECT_GLOB='samples/misc/*/project.json' - -@{ - // The build quality values are set in each of the project.json files - BuildQuality = ""; -} - -use-standard-lifecycle -k-standard-goals From 3058c050bb3a9df1bdf3a7060e5efcbf2a00f207 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 09:28:11 +0000 Subject: [PATCH 002/432] Unify dependency versions across all non-template projects --- {src/build => build}/Key.snk | Bin {src/build => build}/common.props | 9 +++--- build/dependencies.props | 13 +++++++++ samples/angular/MusicStore/MusicStore.csproj | 18 ++++++------ samples/misc/LatencyTest/LatencyTest.csproj | 4 ++- .../NodeServicesExamples.csproj | 12 ++++---- samples/misc/Webpack/Webpack.csproj | 10 ++++--- samples/react/MusicStore/MusicStore.csproj | 20 ++++++++------ samples/react/ReactGrid/ReactGrid.csproj | 8 ++++-- ...icrosoft.AspNetCore.AngularServices.csproj | 4 +-- ...oft.AspNetCore.NodeServices.Sockets.csproj | 8 +++--- .../Microsoft.AspNetCore.NodeServices.csproj | 16 +++++------ .../Microsoft.AspNetCore.ReactServices.csproj | 4 +-- .../Microsoft.AspNetCore.SpaServices.csproj | 4 +-- .../WebApplicationBasic.csproj | 26 ++++++++++-------- 15 files changed, 91 insertions(+), 65 deletions(-) rename {src/build => build}/Key.snk (100%) rename {src/build => build}/common.props (82%) create mode 100644 build/dependencies.props diff --git a/src/build/Key.snk b/build/Key.snk similarity index 100% rename from src/build/Key.snk rename to build/Key.snk diff --git a/src/build/common.props b/build/common.props similarity index 82% rename from src/build/common.props rename to build/common.props index 2c73df14..4bc9e508 100644 --- a/src/build/common.props +++ b/build/common.props @@ -1,4 +1,7 @@ + + + Microsoft ASP.NET Core https://github.com/aspnet/javascriptservices @@ -6,14 +9,10 @@ $(MSBuildThisFileDirectory)Key.snk true true - - - - 1.6.1-* true - \ No newline at end of file + diff --git a/build/dependencies.props b/build/dependencies.props new file mode 100644 index 00000000..cc5ad903 --- /dev/null +++ b/build/dependencies.props @@ -0,0 +1,13 @@ + + + 1.1.0 + 1.1.1 + 1.0.0-msbuild3-final + 5.0.2 + 4.3.0 + 9.0.1 + 4.5.24 + 1.6.1 + 4.7.0 + + diff --git a/samples/angular/MusicStore/MusicStore.csproj b/samples/angular/MusicStore/MusicStore.csproj index 60b14425..61b754bd 100644 --- a/samples/angular/MusicStore/MusicStore.csproj +++ b/samples/angular/MusicStore/MusicStore.csproj @@ -1,5 +1,7 @@  + + netcoreapp1.1 true @@ -11,14 +13,14 @@ - - - - - - - - + + + + + + + + diff --git a/samples/misc/LatencyTest/LatencyTest.csproj b/samples/misc/LatencyTest/LatencyTest.csproj index b4d33f0b..630d6e25 100644 --- a/samples/misc/LatencyTest/LatencyTest.csproj +++ b/samples/misc/LatencyTest/LatencyTest.csproj @@ -1,5 +1,7 @@  + + netcoreapp1.1 false @@ -11,7 +13,7 @@ - + diff --git a/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj b/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj index 6c1ba9df..62343096 100644 --- a/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj +++ b/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj @@ -1,5 +1,7 @@ + + netcoreapp1.1 true @@ -10,11 +12,11 @@ - - - - - + + + + + diff --git a/samples/misc/Webpack/Webpack.csproj b/samples/misc/Webpack/Webpack.csproj index a7c74ba6..2f5b7d72 100644 --- a/samples/misc/Webpack/Webpack.csproj +++ b/samples/misc/Webpack/Webpack.csproj @@ -1,5 +1,7 @@ + + netcoreapp1.1 true @@ -11,10 +13,10 @@ - - - - + + + + diff --git a/samples/react/MusicStore/MusicStore.csproj b/samples/react/MusicStore/MusicStore.csproj index bd3a2d80..388bcc73 100644 --- a/samples/react/MusicStore/MusicStore.csproj +++ b/samples/react/MusicStore/MusicStore.csproj @@ -1,5 +1,7 @@ + + netcoreapp1.1 true @@ -15,14 +17,14 @@ - - - - - - - - + + + + + + + + @@ -31,7 +33,7 @@ - + diff --git a/samples/react/ReactGrid/ReactGrid.csproj b/samples/react/ReactGrid/ReactGrid.csproj index a317f3c8..55717763 100644 --- a/samples/react/ReactGrid/ReactGrid.csproj +++ b/samples/react/ReactGrid/ReactGrid.csproj @@ -1,5 +1,7 @@ + + netcoreapp1.1 true @@ -11,9 +13,9 @@ - - - + + + diff --git a/src/Microsoft.AspNetCore.AngularServices/Microsoft.AspNetCore.AngularServices.csproj b/src/Microsoft.AspNetCore.AngularServices/Microsoft.AspNetCore.AngularServices.csproj index 67817e92..89171417 100644 --- a/src/Microsoft.AspNetCore.AngularServices/Microsoft.AspNetCore.AngularServices.csproj +++ b/src/Microsoft.AspNetCore.AngularServices/Microsoft.AspNetCore.AngularServices.csproj @@ -1,6 +1,6 @@  - + Helpers for building Angular 2 applications on ASP.NET Core. @@ -16,7 +16,7 @@ - + diff --git a/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj b/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj index 067a5905..476bc293 100644 --- a/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj +++ b/src/Microsoft.AspNetCore.NodeServices.Sockets/Microsoft.AspNetCore.NodeServices.Sockets.csproj @@ -1,6 +1,6 @@  - + Socket-based RPC for Microsoft.AspNetCore.NodeServices. @@ -20,12 +20,12 @@ - + - - + + diff --git a/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj b/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj index bed6d1b6..cf98c736 100644 --- a/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj +++ b/src/Microsoft.AspNetCore.NodeServices/Microsoft.AspNetCore.NodeServices.csproj @@ -1,6 +1,6 @@  - + Invoke Node.js modules at runtime in ASP.NET Core applications. @@ -16,15 +16,15 @@ - - - + + + - + - - - + + + diff --git a/src/Microsoft.AspNetCore.ReactServices/Microsoft.AspNetCore.ReactServices.csproj b/src/Microsoft.AspNetCore.ReactServices/Microsoft.AspNetCore.ReactServices.csproj index 9b8d04f9..f9c6b8ee 100644 --- a/src/Microsoft.AspNetCore.ReactServices/Microsoft.AspNetCore.ReactServices.csproj +++ b/src/Microsoft.AspNetCore.ReactServices/Microsoft.AspNetCore.ReactServices.csproj @@ -1,6 +1,6 @@  - + Helpers for building React applications on ASP.NET Core. @@ -16,7 +16,7 @@ - + diff --git a/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj b/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj index 2b829f86..9fdde2e7 100644 --- a/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj +++ b/src/Microsoft.AspNetCore.SpaServices/Microsoft.AspNetCore.SpaServices.csproj @@ -1,6 +1,6 @@  - + Helpers for building single-page applications on ASP.NET MVC Core. @@ -14,7 +14,7 @@ - + diff --git a/templates/WebApplicationBasic/WebApplicationBasic.csproj b/templates/WebApplicationBasic/WebApplicationBasic.csproj index 50bef0da..eba7c6c2 100644 --- a/templates/WebApplicationBasic/WebApplicationBasic.csproj +++ b/templates/WebApplicationBasic/WebApplicationBasic.csproj @@ -1,5 +1,7 @@ + + netcoreapp1.1 true @@ -11,18 +13,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + From 684a77430c69110701d81ec47929f77908e1109d Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 09:10:37 -0800 Subject: [PATCH 003/432] Add CI feed to NuGet.config --- NuGet.config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NuGet.config b/NuGet.config index df0491be..8e656956 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,8 @@ - + + - \ No newline at end of file + From 13fb00a71e5a7bad351ec18c6ce97aa5775485c2 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 18:44:16 -0800 Subject: [PATCH 004/432] Update KoreBuild to dev --- .travis.yml | 2 +- appveyor.yml | 2 +- build.ps1 | 4 ++-- build.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2d8dfdd..3e87fe07 100755 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ os: - osx osx_image: xcode7.1 script: - - ./build.sh verify + - ./build.sh diff --git a/appveyor.yml b/appveyor.yml index 2223a284..2878fd5b 100755 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,7 +28,7 @@ artifacts: - path: templates\package-builder\dist\artifacts\*.nupkg name: Microsoft.AspNetCore.SpaTemplates type: NuGetPackage -# - build.cmd verify +# - ps: .\build.ps1 clone_depth: 1 test_script: # - dotnet restore ./src diff --git a/build.ps1 b/build.ps1 index 7356a228..5bf0e2c1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP @@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) { } } -&"$buildFile" $args +&"$buildFile" @args diff --git a/build.sh b/build.sh index cac797d6..4f7b3dd3 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 94d47a391753cfe0f629847e541f977efa501dae Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 10 Mar 2017 00:15:39 -0800 Subject: [PATCH 005/432] No mono --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e87fe07..33cfe66b 100755 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,7 @@ addons: - libssl-dev - libunwind8 - zlib1g -mono: - - 4.0.5 +mono: none os: - linux - osx From 8d27d9d5832692a36b6803f9123ec314210b353b Mon Sep 17 00:00:00 2001 From: Kyle Summers Date: Sat, 11 Mar 2017 00:36:37 +1100 Subject: [PATCH 006/432] Updates Aurelia project url (#741) aurealia.io doesn't appear to support https currently --- templates/AureliaSpa/ClientApp/app/components/home/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/AureliaSpa/ClientApp/app/components/home/home.html b/templates/AureliaSpa/ClientApp/app/components/home/home.html index 9d0474db..50437ca2 100644 --- a/templates/AureliaSpa/ClientApp/app/components/home/home.html +++ b/templates/AureliaSpa/ClientApp/app/components/home/home.html @@ -3,7 +3,7 @@

Hello, world!

Welcome to your new single-page application, built with:

From 0a1ac6a70adcbbdadad17bba81b87e084d4591a3 Mon Sep 17 00:00:00 2001 From: Maciej Lelito Date: Sat, 11 Feb 2017 18:22:33 +0100 Subject: [PATCH 007/432] Added missing import in boot.ts in Aurelia template --- templates/AureliaSpa/ClientApp/boot.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/AureliaSpa/ClientApp/boot.ts b/templates/AureliaSpa/ClientApp/boot.ts index e03d3f22..da3bbf7f 100644 --- a/templates/AureliaSpa/ClientApp/boot.ts +++ b/templates/AureliaSpa/ClientApp/boot.ts @@ -1,3 +1,4 @@ +import 'isomorphic-fetch'; import { Aurelia } from 'aurelia-framework'; import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap'; From 360688f78b3d9f1e0ee6abf47e6509f6d3dcf11f Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 9 Mar 2017 10:04:54 +0000 Subject: [PATCH 008/432] Add Vue template --- templates/VueSpa/.deployment | 2 + templates/VueSpa/ClientApp/boot-client.ts | 11 + .../VueSpa/ClientApp/components/app/app.ts | 10 + .../ClientApp/components/app/app.vue.html | 15 ++ .../ClientApp/components/counter/counter.ts | 11 + .../components/counter/counter.vue.html | 13 + .../components/fetchdata/fetchdata.ts | 22 ++ .../components/fetchdata/fetchdata.vue.html | 30 +++ .../ClientApp/components/home/home.vue.html | 20 ++ .../components/navmenu/navmenu.vue.html | 35 +++ templates/VueSpa/ClientApp/css/site.css | 66 +++++ templates/VueSpa/ClientApp/router.ts | 13 + .../VueSpa/Controllers/HomeController.cs | 21 ++ .../Controllers/SampleDataController.cs | 44 ++++ templates/VueSpa/Program.cs | 24 ++ templates/VueSpa/Startup.cs | 67 +++++ templates/VueSpa/Views/Home/Index.cshtml | 9 + templates/VueSpa/Views/Shared/Error.cshtml | 6 + templates/VueSpa/Views/Shared/_Layout.cshtml | 19 ++ templates/VueSpa/Views/_ViewImports.cshtml | 3 + templates/VueSpa/Views/_ViewStart.cshtml | 3 + templates/VueSpa/VueSpa.csproj | 33 +++ templates/VueSpa/VueSpa.xproj | 20 ++ templates/VueSpa/appsettings.json | 10 + templates/VueSpa/global.json | 3 + templates/VueSpa/package.json | 26 ++ templates/VueSpa/project.json | 79 ++++++ templates/VueSpa/template_gitignore | 245 ++++++++++++++++++ templates/VueSpa/tsconfig.json | 16 ++ templates/VueSpa/web.config | 14 + templates/VueSpa/webpack.config.js | 49 ++++ templates/VueSpa/webpack.config.vendor.js | 47 ++++ templates/VueSpa/wwwroot/favicon.ico | Bin 0 -> 32038 bytes templates/package-builder/src/build/build.ts | 3 +- 34 files changed, 988 insertions(+), 1 deletion(-) create mode 100644 templates/VueSpa/.deployment create mode 100644 templates/VueSpa/ClientApp/boot-client.ts create mode 100644 templates/VueSpa/ClientApp/components/app/app.ts create mode 100644 templates/VueSpa/ClientApp/components/app/app.vue.html create mode 100644 templates/VueSpa/ClientApp/components/counter/counter.ts create mode 100644 templates/VueSpa/ClientApp/components/counter/counter.vue.html create mode 100644 templates/VueSpa/ClientApp/components/fetchdata/fetchdata.ts create mode 100644 templates/VueSpa/ClientApp/components/fetchdata/fetchdata.vue.html create mode 100644 templates/VueSpa/ClientApp/components/home/home.vue.html create mode 100644 templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html create mode 100644 templates/VueSpa/ClientApp/css/site.css create mode 100644 templates/VueSpa/ClientApp/router.ts create mode 100644 templates/VueSpa/Controllers/HomeController.cs create mode 100644 templates/VueSpa/Controllers/SampleDataController.cs create mode 100644 templates/VueSpa/Program.cs create mode 100644 templates/VueSpa/Startup.cs create mode 100644 templates/VueSpa/Views/Home/Index.cshtml create mode 100644 templates/VueSpa/Views/Shared/Error.cshtml create mode 100644 templates/VueSpa/Views/Shared/_Layout.cshtml create mode 100644 templates/VueSpa/Views/_ViewImports.cshtml create mode 100644 templates/VueSpa/Views/_ViewStart.cshtml create mode 100644 templates/VueSpa/VueSpa.csproj create mode 100644 templates/VueSpa/VueSpa.xproj create mode 100644 templates/VueSpa/appsettings.json create mode 100644 templates/VueSpa/global.json create mode 100644 templates/VueSpa/package.json create mode 100644 templates/VueSpa/project.json create mode 100644 templates/VueSpa/template_gitignore create mode 100644 templates/VueSpa/tsconfig.json create mode 100644 templates/VueSpa/web.config create mode 100644 templates/VueSpa/webpack.config.js create mode 100644 templates/VueSpa/webpack.config.vendor.js create mode 100644 templates/VueSpa/wwwroot/favicon.ico diff --git a/templates/VueSpa/.deployment b/templates/VueSpa/.deployment new file mode 100644 index 00000000..4ad366cc --- /dev/null +++ b/templates/VueSpa/.deployment @@ -0,0 +1,2 @@ +[config] +SCM_SCRIPT_GENERATOR_ARGS=--aspNetCore project.json diff --git a/templates/VueSpa/ClientApp/boot-client.ts b/templates/VueSpa/ClientApp/boot-client.ts new file mode 100644 index 00000000..b86ea2a1 --- /dev/null +++ b/templates/VueSpa/ClientApp/boot-client.ts @@ -0,0 +1,11 @@ +import './css/site.css'; +import Vue from 'vue'; +import router from './router'; + +const App = require('./components/app/app.vue.html'); + +new Vue({ + el: 'app', + render: h => h(App, { props: {} }), + router: router +}); diff --git a/templates/VueSpa/ClientApp/components/app/app.ts b/templates/VueSpa/ClientApp/components/app/app.ts new file mode 100644 index 00000000..75eaa8d8 --- /dev/null +++ b/templates/VueSpa/ClientApp/components/app/app.ts @@ -0,0 +1,10 @@ +import Vue from 'vue'; +import { Component } from 'av-ts'; + +@Component({ + components: { + MenuComponent: require('../navmenu/navmenu.vue.html') + } +}) +export default class AppComponent extends Vue { +} diff --git a/templates/VueSpa/ClientApp/components/app/app.vue.html b/templates/VueSpa/ClientApp/components/app/app.vue.html new file mode 100644 index 00000000..65a2ff9a --- /dev/null +++ b/templates/VueSpa/ClientApp/components/app/app.vue.html @@ -0,0 +1,15 @@ + + + diff --git a/templates/VueSpa/ClientApp/components/counter/counter.ts b/templates/VueSpa/ClientApp/components/counter/counter.ts new file mode 100644 index 00000000..76f9a921 --- /dev/null +++ b/templates/VueSpa/ClientApp/components/counter/counter.ts @@ -0,0 +1,11 @@ +import Vue from 'vue'; +import { Component } from 'av-ts'; + +@Component +export default class CounterComponent extends Vue { + currentcount: number = 0; + + incrementCounter() { + this.currentcount++; + } +} diff --git a/templates/VueSpa/ClientApp/components/counter/counter.vue.html b/templates/VueSpa/ClientApp/components/counter/counter.vue.html new file mode 100644 index 00000000..570d1a2e --- /dev/null +++ b/templates/VueSpa/ClientApp/components/counter/counter.vue.html @@ -0,0 +1,13 @@ + + + diff --git a/templates/VueSpa/ClientApp/components/fetchdata/fetchdata.ts b/templates/VueSpa/ClientApp/components/fetchdata/fetchdata.ts new file mode 100644 index 00000000..c648f021 --- /dev/null +++ b/templates/VueSpa/ClientApp/components/fetchdata/fetchdata.ts @@ -0,0 +1,22 @@ +import Vue from 'vue'; +import { Component, Lifecycle } from 'av-ts'; + +interface WeatherForecast { + dateFormatted: string; + temperatureC: number; + temperatureF: number; + summary: string; +} + +@Component +export default class FetchDataComponent extends Vue { + forecasts: WeatherForecast[] = []; + + @Lifecycle mounted() { + fetch('https://github.com/api/SampleData/WeatherForecasts') + .then(response => response.json() as Promise) + .then(data => { + this.forecasts = data; + }); + } +} diff --git a/templates/VueSpa/ClientApp/components/fetchdata/fetchdata.vue.html b/templates/VueSpa/ClientApp/components/fetchdata/fetchdata.vue.html new file mode 100644 index 00000000..1b647748 --- /dev/null +++ b/templates/VueSpa/ClientApp/components/fetchdata/fetchdata.vue.html @@ -0,0 +1,30 @@ + + + diff --git a/templates/VueSpa/ClientApp/components/home/home.vue.html b/templates/VueSpa/ClientApp/components/home/home.vue.html new file mode 100644 index 00000000..9e4b1ea4 --- /dev/null +++ b/templates/VueSpa/ClientApp/components/home/home.vue.html @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html b/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html new file mode 100644 index 00000000..33a6e50e --- /dev/null +++ b/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html @@ -0,0 +1,35 @@ + diff --git a/templates/VueSpa/ClientApp/css/site.css b/templates/VueSpa/ClientApp/css/site.css new file mode 100644 index 00000000..b57445c8 --- /dev/null +++ b/templates/VueSpa/ClientApp/css/site.css @@ -0,0 +1,66 @@ +.main-nav li .glyphicon { + margin-right: 10px; +} + +/* Highlighting rules for nav menu items */ +.main-nav li a.router-link-active, +.main-nav li a.router-link-active:hover, +.main-nav li a.router-link-active:focus { + background-color: #4189C7; + color: white; +} + +/* Keep the nav menu independent of scrolling and on top of other items */ +.main-nav { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 1; +} + +@media (max-width: 767px) { + /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ + body { + padding-top: 50px; + } +} + +@media (min-width: 768px) { + /* On small screens, convert the nav menu to a vertical sidebar */ + .main-nav { + height: 100%; + width: calc(25% - 20px); + } + .main-nav .navbar { + border-radius: 0px; + border-width: 0px; + height: 100%; + } + .main-nav .navbar-header { + float: none; + } + .main-nav .navbar-collapse { + border-top: 1px solid #444; + padding: 0px; + } + .main-nav .navbar ul { + float: none; + } + .main-nav .navbar li { + float: none; + font-size: 15px; + margin: 6px; + } + .main-nav .navbar li a { + padding: 10px 16px; + border-radius: 4px; + } + .main-nav .navbar a { + /* If a menu item's text is too long, truncate it */ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} diff --git a/templates/VueSpa/ClientApp/router.ts b/templates/VueSpa/ClientApp/router.ts new file mode 100644 index 00000000..748b93de --- /dev/null +++ b/templates/VueSpa/ClientApp/router.ts @@ -0,0 +1,13 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; + +Vue.use(VueRouter); + +export default new VueRouter({ + mode: 'history', + routes: [ + { path: '/', component: require('./components/home/home.vue.html') }, + { path: '/counter', component: require('./components/counter/counter.vue.html') }, + { path: '/fetchdata', component: require('./components/fetchdata/fetchdata.vue.html') } + ] +}); diff --git a/templates/VueSpa/Controllers/HomeController.cs b/templates/VueSpa/Controllers/HomeController.cs new file mode 100644 index 00000000..9d75da88 --- /dev/null +++ b/templates/VueSpa/Controllers/HomeController.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace WebApplicationBasic.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return View(); + } + + public IActionResult Error() + { + return View(); + } + } +} diff --git a/templates/VueSpa/Controllers/SampleDataController.cs b/templates/VueSpa/Controllers/SampleDataController.cs new file mode 100644 index 00000000..0f1aa37a --- /dev/null +++ b/templates/VueSpa/Controllers/SampleDataController.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace WebApplicationBasic.Controllers +{ + [Route("api/[controller]")] + public class SampleDataController : Controller + { + private static string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + [HttpGet("[action]")] + public IEnumerable WeatherForecasts() + { + var rng = new Random(); + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + DateFormatted = DateTime.Now.AddDays(index).ToString("d"), + TemperatureC = rng.Next(-20, 55), + Summary = Summaries[rng.Next(Summaries.Length)] + }); + } + + public class WeatherForecast + { + public string DateFormatted { get; set; } + public int TemperatureC { get; set; } + public string Summary { get; set; } + + public int TemperatureF + { + get + { + return 32 + (int)(TemperatureC / 0.5556); + } + } + } + } +} diff --git a/templates/VueSpa/Program.cs b/templates/VueSpa/Program.cs new file mode 100644 index 00000000..193f1e2a --- /dev/null +++ b/templates/VueSpa/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; + +namespace WebApplicationBasic +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/templates/VueSpa/Startup.cs b/templates/VueSpa/Startup.cs new file mode 100644 index 00000000..e5d73ed6 --- /dev/null +++ b/templates/VueSpa/Startup.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.SpaServices.Webpack; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace WebApplicationBasic +{ + public class Startup + { + public Startup(IHostingEnvironment env) + { + var builder = new ConfigurationBuilder() + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) + .AddEnvironmentVariables(); + Configuration = builder.Build(); + } + + public IConfigurationRoot Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services.AddMvc(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddDebug(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { + HotModuleReplacement = true + }); + } + else + { + app.UseExceptionHandler("/Home/Error"); + } + + app.UseStaticFiles(); + + app.UseMvc(routes => + { + routes.MapRoute( + name: "default", + template: "{controller=Home}/{action=Index}/{id?}"); + + routes.MapSpaFallbackRoute( + name: "spa-fallback", + defaults: new { controller = "Home", action = "Index" }); + }); + } + } +} diff --git a/templates/VueSpa/Views/Home/Index.cshtml b/templates/VueSpa/Views/Home/Index.cshtml new file mode 100644 index 00000000..693b74f7 --- /dev/null +++ b/templates/VueSpa/Views/Home/Index.cshtml @@ -0,0 +1,9 @@ +@{ + ViewData["Title"] = "Home Page"; +} + +Loading... + +@section scripts { + +} diff --git a/templates/VueSpa/Views/Shared/Error.cshtml b/templates/VueSpa/Views/Shared/Error.cshtml new file mode 100644 index 00000000..473b35d6 --- /dev/null +++ b/templates/VueSpa/Views/Shared/Error.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

diff --git a/templates/VueSpa/Views/Shared/_Layout.cshtml b/templates/VueSpa/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000..a770ceb4 --- /dev/null +++ b/templates/VueSpa/Views/Shared/_Layout.cshtml @@ -0,0 +1,19 @@ + + + + + + @ViewData["Title"] - WebApplicationBasic + + + + + + + + @RenderBody() + + + @RenderSection("scripts", required: false) + + diff --git a/templates/VueSpa/Views/_ViewImports.cshtml b/templates/VueSpa/Views/_ViewImports.cshtml new file mode 100644 index 00000000..e7b4f83f --- /dev/null +++ b/templates/VueSpa/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using WebApplicationBasic +@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" +@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/VueSpa/Views/_ViewStart.cshtml b/templates/VueSpa/Views/_ViewStart.cshtml new file mode 100644 index 00000000..820a2f6e --- /dev/null +++ b/templates/VueSpa/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/templates/VueSpa/VueSpa.csproj b/templates/VueSpa/VueSpa.csproj new file mode 100644 index 00000000..db423e26 --- /dev/null +++ b/templates/VueSpa/VueSpa.csproj @@ -0,0 +1,33 @@ + + + netcoreapp1.1 + true + false + + + + + + + + + + + + + + + + + + + + + + + %(DistFiles.Identity) + PreserveNewest + + + + \ No newline at end of file diff --git a/templates/VueSpa/VueSpa.xproj b/templates/VueSpa/VueSpa.xproj new file mode 100644 index 00000000..724c8110 --- /dev/null +++ b/templates/VueSpa/VueSpa.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + true + + + + 85231b41-6998-49ae-abd2-5124c83dbef2 + VueSpa + .\obj + .\bin\ + v4.5.2 + + + 2.0 + + + \ No newline at end of file diff --git a/templates/VueSpa/appsettings.json b/templates/VueSpa/appsettings.json new file mode 100644 index 00000000..723c096a --- /dev/null +++ b/templates/VueSpa/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/templates/VueSpa/global.json b/templates/VueSpa/global.json new file mode 100644 index 00000000..5a3dc985 --- /dev/null +++ b/templates/VueSpa/global.json @@ -0,0 +1,3 @@ +{ + "sdk": { "version": "1.0.0-preview2-1-003177" } +} diff --git a/templates/VueSpa/package.json b/templates/VueSpa/package.json new file mode 100644 index 00000000..a8716eb5 --- /dev/null +++ b/templates/VueSpa/package.json @@ -0,0 +1,26 @@ +{ + "name": "WebApplicationBasic", + "version": "0.0.0", + "devDependencies": { + "@types/requirejs": "^2.1.28", + "aspnet-webpack": "^1.0.27", + "av-ts": "^0.7.1", + "awesome-typescript-loader": "^3.0.0", + "bootstrap": "^3.3.6", + "css-loader": "^0.25.0", + "event-source-polyfill": "^0.0.7", + "extract-text-webpack-plugin": "^2.0.0-rc", + "file-loader": "^0.9.0", + "isomorphic-fetch": "^2.2.1", + "jquery": "^3.1.1", + "style-loader": "^0.13.1", + "typescript": "^2.2.1", + "url-loader": "^0.5.7", + "vue": "^2.2.2", + "vue-loader": "^11.1.4", + "vue-router": "^2.3.0", + "vue-template-compiler": "^2.2.2", + "webpack": "^2.2.0", + "webpack-hot-middleware": "^2.12.2" + } +} diff --git a/templates/VueSpa/project.json b/templates/VueSpa/project.json new file mode 100644 index 00000000..32ca9b94 --- /dev/null +++ b/templates/VueSpa/project.json @@ -0,0 +1,79 @@ +{ + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.1.0", + "type": "platform" + }, + "Microsoft.AspNetCore.SpaServices": "1.1.0-*", + "Microsoft.AspNetCore.Diagnostics": "1.1.0", + "Microsoft.AspNetCore.Mvc": "1.1.0", + "Microsoft.AspNetCore.Razor.Tools": { + "version": "1.0.0-preview2-final", + "type": "build" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", + "Microsoft.AspNetCore.StaticFiles": "1.1.0", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", + "Microsoft.Extensions.Configuration.Json": "1.1.0", + "Microsoft.Extensions.Configuration.CommandLine": "1.1.0", + "Microsoft.Extensions.Logging": "1.1.0", + "Microsoft.Extensions.Logging.Console": "1.1.0", + "Microsoft.Extensions.Logging.Debug": "1.1.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0" + }, + + "tools": { + "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", + "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" + }, + + "frameworks": { + "netcoreapp1.1": { + "imports": [ + "dotnet5.6", + "portable-net45+win8" + ] + } + }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true, + "compile": { + "exclude": ["node_modules"] + } + }, + + "runtimeOptions": { + "configProperties": { + "System.GC.Server": true + } + }, + + "publishOptions": { + "include": [ + "appsettings.json", + "Views", + "web.config", + "wwwroot" + ], + "exclude": [ + "wwwroot/dist/*.map" + ] + }, + + "scripts": { + "prepublish": [ + "npm install", + "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod", + "node node_modules/webpack/bin/webpack.js --env.prod" + ], + "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + }, + + "tooling": { + "defaultNamespace": "WebApplicationBasic" + } +} diff --git a/templates/VueSpa/template_gitignore b/templates/VueSpa/template_gitignore new file mode 100644 index 00000000..893db26a --- /dev/null +++ b/templates/VueSpa/template_gitignore @@ -0,0 +1,245 @@ +/Properties/launchSettings.json + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +bin/ +Bin/ +obj/ +Obj/ + +# Visual Studio 2015 cache/options directory +.vs/ +/wwwroot/dist/** + +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +!/wwwroot/dist/_placeholder.txt + +/yarn.lock + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Microsoft Azure ApplicationInsights config file +ApplicationInsights.config + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +orleans.codegen.cs + +# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 +/node_modules/** +!/node_modules/_placeholder.txt + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ diff --git a/templates/VueSpa/tsconfig.json b/templates/VueSpa/tsconfig.json new file mode 100644 index 00000000..fb41fd37 --- /dev/null +++ b/templates/VueSpa/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "module": "es2015", + "moduleResolution": "node", + "target": "es5", + "sourceMap": true, + "skipDefaultLibCheck": true, + "types": ["requirejs"] + }, + "exclude": [ + "bin", + "node_modules" + ] +} diff --git a/templates/VueSpa/web.config b/templates/VueSpa/web.config new file mode 100644 index 00000000..a8d66727 --- /dev/null +++ b/templates/VueSpa/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/templates/VueSpa/webpack.config.js b/templates/VueSpa/webpack.config.js new file mode 100644 index 00000000..edf88810 --- /dev/null +++ b/templates/VueSpa/webpack.config.js @@ -0,0 +1,49 @@ +const path = require('path'); +const webpack = require('webpack'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); +const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin; +const bundleOutputDir = './wwwroot/dist'; + +module.exports = (env) => { + const isDevBuild = !(env && env.prod); + return [{ + stats: { modules: false }, + entry: { 'main': './ClientApp/boot-client.ts' }, + resolve: { extensions: [ '.js', '.ts' ] }, + output: { + path: path.join(__dirname, bundleOutputDir), + filename: '[name].js', + publicPath: '/dist/' + }, + module: { + rules: [ + { test: /\.vue\.html$/, include: /ClientApp/, loader: 'vue-loader', options: { loaders: { js: 'awesome-typescript-loader?silent=true' } } }, + { test: /\.ts$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, + { test: /\.css$/, use: isDevBuild ? ['style-loader', 'css-loader'] : ExtractTextPlugin.extract({ use: 'css-loader' }) }, + { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' } + ] + }, + plugins: [ + new CheckerPlugin(), + new webpack.DllReferencePlugin({ + context: __dirname, + manifest: require('./wwwroot/dist/vendor-manifest.json') + }), + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(isDevBuild ? 'development' : 'production') + } + }) + ].concat(isDevBuild ? [ + // Plugins that apply in development builds only + new webpack.SourceMapDevToolPlugin({ + filename: '[file].map', // Remove this line if you prefer inline source maps + moduleFilenameTemplate: path.relative(bundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk + }) + ] : [ + // Plugins that apply in production builds only + new webpack.optimize.UglifyJsPlugin(), + new ExtractTextPlugin('site.css') + ]) + }]; +}; diff --git a/templates/VueSpa/webpack.config.vendor.js b/templates/VueSpa/webpack.config.vendor.js new file mode 100644 index 00000000..424295c4 --- /dev/null +++ b/templates/VueSpa/webpack.config.vendor.js @@ -0,0 +1,47 @@ +const path = require('path'); +const webpack = require('webpack'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); + +module.exports = (env) => { + const isDevBuild = !(env && env.prod); + const extractCSS = new ExtractTextPlugin('vendor.css'); + return [{ + stats: { modules: false }, + resolve: { + extensions: [ '.js' ] + }, + module: { + rules: [ + { test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' }, + { test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) } + ] + }, + entry: { + vendor: [ + 'bootstrap', + 'bootstrap/dist/css/bootstrap.css', + 'event-source-polyfill', + 'isomorphic-fetch', + 'jquery', + 'vue', + 'vue-router' + ], + }, + output: { + path: path.join(__dirname, 'wwwroot', 'dist'), + publicPath: '/dist/', + filename: '[name].js', + library: '[name]_[hash]', + }, + plugins: [ + extractCSS, + new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) + new webpack.DllPlugin({ + path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), + name: '[name]_[hash]' + }) + ].concat(isDevBuild ? [] : [ + new webpack.optimize.UglifyJsPlugin() + ]) + }]; +}; diff --git a/templates/VueSpa/wwwroot/favicon.ico b/templates/VueSpa/wwwroot/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a3a799985c43bc7309d701b2cad129023377dc71 GIT binary patch literal 32038 zcmeHwX>eTEbtY7aYbrGrkNjgie?1jXjZ#zP%3n{}GObKv$BxI7Sl;Bwl5E+Qtj&t8 z*p|m4DO#HoJC-FyvNnp8NP<{Na0LMnTtO21(rBP}?EAiNjWgeO?z`{3ZoURUQlV2d zY1Pqv{m|X_oO91|?^z!6@@~od!@OH>&BN;>c@O+yUfy5w>LccTKJJ&`-k<%M^Zvi( z<$dKp=jCnNX5Qa+M_%6g|IEv~4R84q9|7E=|Ho(Wz3f-0wPjaRL;W*N^>q%^KGRr7 zxbjSORb_c&eO;oV_DZ7ua!sPH=0c+W;`vzJ#j~-x3uj};50#vqo*0w4!LUqs*UCh9 zvy2S%$#8$K4EOa&e@~aBS65_hc~Mpu=454VT2^KzWqEpBA=ME|O;1cn?8p<+{MKJf zbK#@1wzL44m$k(?85=Obido7=C|xWKe%66$z)NrzRwR>?hK?_bbwT z@Da?lBrBL}Zemo1@!9pYRau&!ld17h{f+UV0sY(R{ET$PBB|-=Nr@l-nY6w8HEAw* zRMIQU`24Jl_IFEPcS=_HdrOP5yf81z_?@M>83Vv65$QFr9nPg(wr`Ke8 zaY4ogdnMA*F7a4Q1_uXadTLUpCk;$ZPRRJ^sMOch;rlbvUGc1R9=u;dr9YANbQ<4Z z#P|Cp9BP$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t7w~K%_E<8`zS;V- zKTho*>;UQQul^1GT^HCt@I-q?)&4!QDgBndn?3sNKYKCQFU4LGKJ$n@Je$&w9@E$X z^p@iJ(v&`1(tq~1zc>0Vow-KR&vm!GUzT?Eqgnc)leZ9p)-Z*C!zqb=-$XG0 z^!8RfuQs5s>Q~qcz92(a_Q+KH?C*vCTr~UdTiR`JGuNH8v(J|FTiSEcPrBpmHRtmd zI2Jng0J=bXK);YY^rM?jzn?~X-Pe`GbAy{D)Y6D&1GY-EBcy%Bq?bKh?A>DD9DD!p z?{q02wno2sraGUkZv5dx+J8)&K$)No43Zr(*S`FEdL!4C)}WE}vJd%{S6-3VUw>Wp z?Aasv`T0^%P$2vE?L+Qhj~qB~K%eW)xH(=b_jU}TLD&BP*Pc9hz@Z=e0nkpLkWl}> z_5J^i(9Z7$(XG9~I3sY)`OGZ#_L06+Dy4E>UstcP-rU@xJ$&rxvo!n1Ao`P~KLU-8 z{zDgN4-&A6N!kPSYbQ&7sLufi`YtE2uN$S?e&5n>Y4(q#|KP!cc1j)T^QrUXMPFaP z_SoYO8S8G}Z$?AL4`;pE?7J5K8yWqy23>cCT2{=-)+A$X^-I9=e!@J@A&-;Ufc)`H}c(VI&;0x zrrGv()5mjP%jXzS{^|29?bLNXS0bC%p!YXI!;O457rjCEEzMkGf~B3$T}dXBO23tP z+Ci>;5UoM?C@bU@f9G1^X3=ly&ZeFH<@|RnOG--A&)fd)AUgjw?%izq{p(KJ`EP0v z2mU)P!+3t@X14DA=E2RR-|p${GZ9ETX=d+kJRZL$nSa0daI@&oUUxnZg0xd_xu>Vz lzF#z5%kSKX?YLH3ll^(hI(_`L*t#Iva2Ede*Z;>H_ Date: Fri, 10 Mar 2017 10:51:47 +0000 Subject: [PATCH 009/432] Add server-side rendering (via bundleRenderer, as this is what the Vue docs recommend, and apparently the only way it does encapsulation) --- templates/VueSpa/ClientApp/boot-client.ts | 13 ++--- .../VueSpa/ClientApp/boot-server-bundle.ts | 16 ++++++ templates/VueSpa/ClientApp/boot-server.ts | 18 ++++++ .../ClientApp/components/app/app.vue.html | 3 +- .../navmenu/navmenu.css} | 0 .../components/navmenu/navmenu.vue.html | 2 + templates/VueSpa/ClientApp/router.ts | 13 ----- templates/VueSpa/ClientApp/routes.ts | 5 ++ templates/VueSpa/Views/Home/Index.cshtml | 6 +- templates/VueSpa/Views/Shared/_Layout.cshtml | 3 - templates/VueSpa/package.json | 6 +- templates/VueSpa/tsconfig.json | 3 +- templates/VueSpa/webpack.config.js | 56 +++++++++++++++---- templates/VueSpa/webpack.config.vendor.js | 24 ++++---- 14 files changed, 117 insertions(+), 51 deletions(-) create mode 100644 templates/VueSpa/ClientApp/boot-server-bundle.ts create mode 100644 templates/VueSpa/ClientApp/boot-server.ts rename templates/VueSpa/ClientApp/{css/site.css => components/navmenu/navmenu.css} (100%) delete mode 100644 templates/VueSpa/ClientApp/router.ts create mode 100644 templates/VueSpa/ClientApp/routes.ts diff --git a/templates/VueSpa/ClientApp/boot-client.ts b/templates/VueSpa/ClientApp/boot-client.ts index b86ea2a1..aa5e0a8e 100644 --- a/templates/VueSpa/ClientApp/boot-client.ts +++ b/templates/VueSpa/ClientApp/boot-client.ts @@ -1,11 +1,10 @@ -import './css/site.css'; import Vue from 'vue'; -import router from './router'; - -const App = require('./components/app/app.vue.html'); +import VueRouter from 'vue-router'; +import { routes } from './routes'; +Vue.use(VueRouter); new Vue({ - el: 'app', - render: h => h(App, { props: {} }), - router: router + el: '#app-root', + router: new VueRouter({ mode: 'history', routes: routes }), + render: h => h(require('./components/app/app.vue.html')) }); diff --git a/templates/VueSpa/ClientApp/boot-server-bundle.ts b/templates/VueSpa/ClientApp/boot-server-bundle.ts new file mode 100644 index 00000000..ad2a7cb2 --- /dev/null +++ b/templates/VueSpa/ClientApp/boot-server-bundle.ts @@ -0,0 +1,16 @@ +import Vue from 'vue'; +import VueRouter from 'vue-router'; +import { createServerRenderer, RenderResult } from 'aspnet-prerendering'; +import { createBundleRenderer } from 'vue-server-renderer'; +import { routes } from './routes'; +Vue.use(VueRouter); + +export default function(context: any) { + const router = new VueRouter({ mode: 'history', routes: routes }) + router.push(context.url); + + return new Vue({ + render: h => h(require('./components/app/app.vue.html')), + router: router + }); +} diff --git a/templates/VueSpa/ClientApp/boot-server.ts b/templates/VueSpa/ClientApp/boot-server.ts new file mode 100644 index 00000000..bbe4e4cd --- /dev/null +++ b/templates/VueSpa/ClientApp/boot-server.ts @@ -0,0 +1,18 @@ +import { createServerRenderer, RenderResult } from 'aspnet-prerendering'; +import { createBundleRenderer } from 'vue-server-renderer'; +const path = require('path'); +const bundleRenderer = createBundleRenderer(path.resolve('ClientApp/dist/vue-ssr-bundle.json'), { + template: '' +}); + +export default createServerRenderer(params => { + return new Promise((resolve, reject) => { + bundleRenderer.renderToString(params, (error, html) => { + if (error) { + reject(error); + } else { + resolve({ html: html }); + } + }); + }); +}); diff --git a/templates/VueSpa/ClientApp/components/app/app.vue.html b/templates/VueSpa/ClientApp/components/app/app.vue.html index 65a2ff9a..6a108b8a 100644 --- a/templates/VueSpa/ClientApp/components/app/app.vue.html +++ b/templates/VueSpa/ClientApp/components/app/app.vue.html @@ -1,5 +1,5 @@ diff --git a/templates/VueSpa/ClientApp/css/site.css b/templates/VueSpa/ClientApp/components/navmenu/navmenu.css similarity index 100% rename from templates/VueSpa/ClientApp/css/site.css rename to templates/VueSpa/ClientApp/components/navmenu/navmenu.css diff --git a/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html b/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html index 33a6e50e..642a5221 100644 --- a/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html +++ b/templates/VueSpa/ClientApp/components/navmenu/navmenu.vue.html @@ -33,3 +33,5 @@ + +