From 9b3393930c9fc40a79c8a8519771f441c69ff0d7 Mon Sep 17 00:00:00 2001 From: Omid Date: Tue, 4 Aug 2020 19:45:36 +0300 Subject: [PATCH] Fix publish problem --- .gitignore | 1 - Nuget.config | 11 - src/DotNetBlog.Core/DotNetBlog.Core.csproj | 4 - .../Properties/AssemblyInfo.cs | 18 - src/DotNetBlog.Web/DotNetBlog.Web.csproj | 19 +- .../PublishProfiles/publish-module.psm1 | 1231 - .../PublishProfiles/release-publish.ps1 | 19 - .../Properties/PublishProfiles/release.pubxml | 21 - .../Properties/launchSettings.json | 27 - .../ThemeResourceLocalizationFactory.cs | 4 +- src/DotNetBlog.Web/bundleconfig.json | 8 - src/DotNetBlog.Web/libman.json | 5 - .../runtimeconfig.template.json | 3 - src/DotNetBlog.Web/web.config | 14 - src/DotNetBlog.Web/wwwroot/dist/app.js | 112539 +++++++++++++++ 15 files changed, 112542 insertions(+), 1382 deletions(-) delete mode 100644 Nuget.config delete mode 100644 src/DotNetBlog.Core/Properties/AssemblyInfo.cs delete mode 100644 src/DotNetBlog.Web/Properties/PublishProfiles/publish-module.psm1 delete mode 100644 src/DotNetBlog.Web/Properties/PublishProfiles/release-publish.ps1 delete mode 100644 src/DotNetBlog.Web/Properties/PublishProfiles/release.pubxml delete mode 100644 src/DotNetBlog.Web/Properties/launchSettings.json delete mode 100644 src/DotNetBlog.Web/bundleconfig.json delete mode 100644 src/DotNetBlog.Web/libman.json delete mode 100644 src/DotNetBlog.Web/runtimeconfig.template.json delete mode 100644 src/DotNetBlog.Web/web.config create mode 100644 src/DotNetBlog.Web/wwwroot/dist/app.js diff --git a/.gitignore b/.gitignore index 185bf48..75f162b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ bld/ /src/DotNetBlog.Admin/node_modules /src/DotNetBlog.Admin/**/*.js.map /src/DotNetBlog.Web/wwwroot/app/**/*.js.map -/src/DotNetBlog.Web/wwwroot/dist /src/DotNetBlog.Web/wwwroot/upload /src/DotNetBlog.Web/wwwroot/app/dist !/src/DotNetBlog.Web/wwwroot/app/webpack.config.js diff --git a/Nuget.config b/Nuget.config deleted file mode 100644 index 49e1c77..0000000 --- a/Nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/DotNetBlog.Core/DotNetBlog.Core.csproj b/src/DotNetBlog.Core/DotNetBlog.Core.csproj index 08ad1a4..2bcb239 100644 --- a/src/DotNetBlog.Core/DotNetBlog.Core.csproj +++ b/src/DotNetBlog.Core/DotNetBlog.Core.csproj @@ -1,13 +1,9 @@  - 1.2.0 netstandard2.1 DotNetBlog.Core DotNetBlog.Core - false - false - false diff --git a/src/DotNetBlog.Core/Properties/AssemblyInfo.cs b/src/DotNetBlog.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 35c2196..0000000 --- a/src/DotNetBlog.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("DotNetBlog.Core")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("89065586-c5ef-4ef4-bcd5-63d47e6e3816")] diff --git a/src/DotNetBlog.Web/DotNetBlog.Web.csproj b/src/DotNetBlog.Web/DotNetBlog.Web.csproj index fff17b3..94c79ea 100644 --- a/src/DotNetBlog.Web/DotNetBlog.Web.csproj +++ b/src/DotNetBlog.Web/DotNetBlog.Web.csproj @@ -1,20 +1,10 @@  - 1.2.0 netcoreapp3.1 - true - true - false - DotNetBlog.Web - Exe - DotNetBlog.Web + 1.3.0 - - - - PreserveNewest @@ -26,7 +16,6 @@ PreserveNewest PreserveNewest - PreserveNewest PreserveNewest @@ -49,12 +38,6 @@ - - - - - - ResXFileCodeGenerator diff --git a/src/DotNetBlog.Web/Properties/PublishProfiles/publish-module.psm1 b/src/DotNetBlog.Web/Properties/PublishProfiles/publish-module.psm1 deleted file mode 100644 index adc6ada..0000000 --- a/src/DotNetBlog.Web/Properties/PublishProfiles/publish-module.psm1 +++ /dev/null @@ -1,1231 +0,0 @@ -# WARNING: DO NOT MODIFY this file. Visual Studio will override it. -param() - -$script:AspNetPublishHandlers = @{} - -<# -These settings can be overridden with environment variables. -The name of the environment variable should use "Publish" as a -prefix and the names below. For example: - - $env:PublishMSDeployUseChecksum = $true -#> -$global:AspNetPublishSettings = New-Object -TypeName PSCustomObject @{ - MsdeployDefaultProperties = @{ - 'MSDeployUseChecksum'=$false - 'SkipExtraFilesOnServer'=$true - 'retryAttempts' = 20 - 'EnableMSDeployBackup' = $false - 'DeleteExistingFiles' = $false - 'AllowUntrustedCertificate'= $false - 'MSDeployPackageContentFoldername'='website\' - 'EnvironmentName' = 'Production' - 'AuthType'='Basic' - 'MSDeployPublishMethod'='WMSVC' - } -} - -function InternalOverrideSettingsFromEnv{ - [cmdletbinding()] - param( - [Parameter(Position=0)] - [object[]]$settings = ($global:AspNetPublishSettings,$global:AspNetPublishSettings.MsdeployDefaultProperties), - - [Parameter(Position=1)] - [string]$prefix = 'Publish' - ) - process{ - foreach($settingsObj in $settings){ - if($settingsObj -eq $null){ - continue - } - - $settingNames = $null - if($settingsObj -is [hashtable]){ - $settingNames = $settingsObj.Keys - } - else{ - $settingNames = ($settingsObj | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name) - - } - - foreach($name in @($settingNames)){ - $fullname = ('{0}{1}' -f $prefix,$name) - if(Test-Path "env:$fullname"){ - $settingsObj.$name = ((get-childitem "env:$fullname").Value) - } - } - } - } -} - -InternalOverrideSettingsFromEnv -prefix 'Publish' -settings $global:AspNetPublishSettings,$global:AspNetPublishSettings.MsdeployDefaultProperties - -function Register-AspnetPublishHandler{ - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0)] - $name, - [Parameter(Mandatory=$true,Position=1)] - [ScriptBlock]$handler, - [switch]$force - ) - process{ - if(!($script:AspNetPublishHandlers[$name]) -or $force ){ - 'Adding handler for [{0}]' -f $name | Write-Verbose - $script:AspNetPublishHandlers[$name] = $handler - } - elseif(!($force)){ - 'Ignoring call to Register-AspnetPublishHandler for [name={0}], because a handler with that name exists and -force was not passed.' -f $name | Write-Verbose - } - } -} - -function Get-AspnetPublishHandler{ - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0)] - $name - ) - process{ - $foundHandler = $script:AspNetPublishHandlers[$name] - - if(!$foundHandler){ - throw ('AspnetPublishHandler with name "{0}" was not found' -f $name) - } - - $foundHandler - } -} - -function GetInternal-ExcludeFilesArg{ - [cmdletbinding()] - param( - $publishProperties - ) - process{ - $excludeFiles = $publishProperties['ExcludeFiles'] - foreach($exclude in $excludeFiles){ - if($exclude){ - [string]$objName = $exclude['objectname'] - - if([string]::IsNullOrEmpty($objName)){ - $objName = 'filePath' - } - - $excludePath = $exclude['absolutepath'] - - # output the result to the return list - ('-skip:objectName={0},absolutePath=''{1}''' -f $objName, $excludePath) - } - } - } -} - -function GetInternal-ReplacementsMSDeployArgs{ - [cmdletbinding()] - param( - $publishProperties - ) - process{ - foreach($replace in ($publishProperties['Replacements'])){ - if($replace){ - $typeValue = $replace['type'] - if(!$typeValue){ $typeValue = 'TextFile' } - - $file = $replace['file'] - $match = $replace['match'] - $newValue = $replace['newValue'] - - if($file -and $match -and $newValue){ - $setParam = ('-setParam:type={0},scope={1},match={2},value={3}' -f $typeValue,$file, $match,$newValue) - 'Adding setparam [{0}]' -f $setParam | Write-Verbose - - # return it - $setParam - } - else{ - 'Skipping replacement because its missing a required value.[file="{0}",match="{1}",newValue="{2}"]' -f $file,$match,$newValue | Write-Verbose - } - } - } - } -} - -<# -.SYNOPSIS -Returns an array of msdeploy arguments that are used across different providers. -For example this will handle useChecksum, AppOffline etc. -This will also add default properties if they are missing. -#> -function GetInternal-SharedMSDeployParametersFrom{ - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0)] - [HashTable]$publishProperties, - [Parameter(Mandatory=$true,Position=1)] - [System.IO.FileInfo]$packOutput - ) - process{ - $sharedArgs = New-Object psobject -Property @{ - ExtraArgs = @() - DestFragment = '' - EFMigrationData = @{} - } - - # add default properties if they are missing - foreach($propName in $global:AspNetPublishSettings.MsdeployDefaultProperties.Keys){ - if($publishProperties["$propName"] -eq $null){ - $defValue = $global:AspNetPublishSettings.MsdeployDefaultProperties["$propName"] - 'Adding default property to publishProperties ["{0}"="{1}"]' -f $propName,$defValue | Write-Verbose - $publishProperties["$propName"] = $defValue - } - } - - if($publishProperties['MSDeployUseChecksum'] -eq $true){ - $sharedArgs.ExtraArgs += '-usechecksum' - } - - if($publishProperties['EnableMSDeployAppOffline'] -eq $true){ - $sharedArgs.ExtraArgs += '-enablerule:AppOffline' - } - - if($publishProperties['WebPublishMethod'] -eq 'MSDeploy'){ - if($publishProperties['SkipExtraFilesOnServer'] -eq $true){ - $sharedArgs.ExtraArgs += '-enableRule:DoNotDeleteRule' - } - } - - if($publishProperties['WebPublishMethod'] -eq 'FileSystem'){ - if($publishProperties['DeleteExistingFiles'] -eq $false){ - $sharedArgs.ExtraArgs += '-enableRule:DoNotDeleteRule' - } - } - - if($publishProperties['retryAttempts']){ - $sharedArgs.ExtraArgs += ('-retryAttempts:{0}' -f ([int]$publishProperties['retryAttempts'])) - } - - if($publishProperties['EncryptWebConfig'] -eq $true){ - $sharedArgs.ExtraArgs += '-EnableRule:EncryptWebConfig' - } - - if($publishProperties['EnableMSDeployBackup'] -eq $false){ - $sharedArgs.ExtraArgs += '-disablerule:BackupRule' - } - - if($publishProperties['AllowUntrustedCertificate'] -eq $true){ - $sharedArgs.ExtraArgs += '-allowUntrusted' - } - - # add excludes - $sharedArgs.ExtraArgs += (GetInternal-ExcludeFilesArg -publishProperties $publishProperties) - # add replacements - $sharedArgs.ExtraArgs += (GetInternal-ReplacementsMSDeployArgs -publishProperties $publishProperties) - - # add EF Migration - if (($publishProperties['EfMigrations'] -ne $null) -and $publishProperties['EfMigrations'].Count -gt 0){ - if (!(Test-Path -Path $publishProperties['ProjectPath'])) { - throw 'ProjectPath property needs to be defined in the pubxml for EF migration.' - } - try { - # generate T-SQL files - $EFSqlFiles = GenerateInternal-EFMigrationScripts -projectPath $publishProperties['ProjectPath'] -packOutput $packOutput -EFMigrations $publishProperties['EfMigrations'] - $sharedArgs.EFMigrationData.Add('EFSqlFiles',$EFSqlFiles) - } - catch { - throw ('An error occurred while generating EF migrations. {0} {1}' -f $_.Exception,(Get-PSCallStack)) - } - } - # add connection string update - if (($publishProperties['DestinationConnectionStrings'] -ne $null) -and $publishProperties['DestinationConnectionStrings'].Count -gt 0) { - try { - # create/update appsettings.[environment].json - GenerateInternal-AppSettingsFile -packOutput $packOutput -environmentName $publishProperties['EnvironmentName'] -connectionStrings $publishProperties['DestinationConnectionStrings'] - } - catch { - throw ('An error occurred while generating the publish appsettings file. {0} {1}' -f $_.Exception,(Get-PSCallStack)) - } - } - - if(-not [string]::IsNullOrWhiteSpace($publishProperties['ProjectGuid'])) { - AddInternal-ProjectGuidToWebConfig -publishProperties $publishProperties -packOutput $packOutput - } - - # return the args - $sharedArgs - } -} - -<# -.SYNOPSIS -This will publish the folder based on the properties in $publishProperties - -.PARAMETER publishProperties -This is a hashtable containing the publish properties. See the examples here for more info on how to use this parameter. - -.PARAMETER packOutput -The folder path to the output of the dnu publish command. This folder contains the files -that will be published. - -.PARAMETER pubProfilePath -Path to a publish profile (.pubxml file) to import publish properties from. If the same property exists in -publishProperties and the publish profile then publishProperties will win. - -.EXAMPLE - Publish-AspNet -packOutput $packOutput -publishProperties @{ - 'WebPublishMethod'='MSDeploy' - 'MSDeployServiceURL'='contoso.scm.azurewebsites.net:443';` - 'DeployIisAppPath'='contoso';'Username'='$contoso';'Password'="$env:PublishPwd"} - -.EXAMPLE -Publish-AspNet -packOutput $packOutput -publishProperties @{ - 'WebPublishMethod'='FileSystem' - 'publishUrl'="$publishDest" - } - -.EXAMPLE -Publish-AspNet -packOutput $packOutput -publishProperties @{ - 'WebPublishMethod'='MSDeploy' - 'MSDeployServiceURL'='contoso.scm.azurewebsites.net:443';` -'DeployIisAppPath'='contoso';'Username'='$contoso';'Password'="$env:PublishPwd" - 'ExcludeFiles'=@( - @{'absolutepath'='test.txt'}, - @{'absolutepath'='references.js'} -)} - -.EXAMPLE -Publish-AspNet -packOutput $packOutput -publishProperties @{ - 'WebPublishMethod'='FileSystem' - 'publishUrl'="$publishDest" - 'ExcludeFiles'=@( - @{'absolutepath'='test.txt'}, - @{'absolutepath'='_references.js'}) - 'Replacements' = @( - @{'file'='test.txt$';'match'='REPLACEME';'newValue'='updatedValue'}) - } - -Publish-AspNet -packOutput $packOutput -publishProperties @{ - 'WebPublishMethod'='FileSystem' - 'publishUrl'="$publishDest" - 'ExcludeFiles'=@( - @{'absolutepath'='test.txt'}, - @{'absolutepath'='c:\\full\\path\\ok\\as\\well\\_references.js'}) - 'Replacements' = @( - @{'file'='test.txt$';'match'='REPLACEME';'newValue'='updatedValue'}) - } - -.EXAMPLE -Publish-AspNet -packOutput $packOutput -publishProperties @{ - 'WebPublishMethod'='FileSystem' - 'publishUrl'="$publishDest" - 'EnableMSDeployAppOffline'='true' - 'AppOfflineTemplate'='offline-template.html' - 'MSDeployUseChecksum'='true' -} -#> -function Publish-AspNet{ - param( - [Parameter(Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - [hashtable]$publishProperties = @{}, - - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - [System.IO.FileInfo]$packOutput, - - [Parameter(Position=2,ValueFromPipelineByPropertyName=$true)] - [System.IO.FileInfo]$pubProfilePath - ) - process{ - if($publishProperties['WebPublishMethodOverride']){ - 'Overriding publish method from $publishProperties[''WebPublishMethodOverride''] to [{0}]' -f ($publishProperties['WebPublishMethodOverride']) | Write-Verbose - $publishProperties['WebPublishMethod'] = $publishProperties['WebPublishMethodOverride'] - } - - if(-not [string]::IsNullOrWhiteSpace($pubProfilePath)){ - $profileProperties = Get-PropertiesFromPublishProfile -filepath $pubProfilePath - foreach($key in $profileProperties.Keys){ - if(-not ($publishProperties.ContainsKey($key))){ - 'Adding properties from publish profile [''{0}''=''{1}'']' -f $key,$profileProperties[$key] | Write-Verbose - $publishProperties.Add($key,$profileProperties[$key]) - } - } - } - - if(!([System.IO.Path]::IsPathRooted($packOutput))){ - $packOutput = [System.IO.Path]::GetFullPath((Join-Path $pwd $packOutput)) - } - - $pubMethod = $publishProperties['WebPublishMethod'] - 'Publishing with publish method [{0}]' -f $pubMethod | Write-Output - - # get the handler based on WebPublishMethod, and call it. - &(Get-AspnetPublishHandler -name $pubMethod) $publishProperties $packOutput - } -} - -<# -.SYNOPSIS - -Inputs: - -Example of $xmlDocument: '' -Example of $providerDataArray: - - [System.Collections.ArrayList]$providerDataArray = @() - - $iisAppSourceKeyValue=@{"iisApp" = @{"path"='c:\temp\pathtofiles';"appOfflineTemplate" ='offline-template.html'}} - $providerDataArray.Add($iisAppSourceKeyValue) - - $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile"}} - $providerDataArray.Add($dbfullsqlKeyValue) - - $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile2"}} - $providerDataArray.Add($dbfullsqlKeyValue) - - Manifest File content: - - - - - - -#> -function AddInternal-ProviderDataToManifest { - [cmdletbinding()] - param( - [Parameter(Mandatory=$true, Position=0)] - [XML]$xmlDocument, - [Parameter(Position=1)] - [System.Collections.ArrayList]$providerDataArray - ) - process { - $siteNode = $xmlDocument.SelectSingleNode("/sitemanifest") - if ($siteNode -eq $null) { - throw 'sitemanifest element is missing in the xml object' - } - foreach ($providerData in $providerDataArray) { - foreach ($providerName in $providerData.Keys) { - $providerValue = $providerData[$providerName] - $xmlNode = $xmlDocument.CreateElement($providerName) - foreach ($providerValueKey in $providerValue.Keys) { - $xmlNode.SetAttribute($providerValueKey, $providerValue[$providerValueKey]) | Out-Null - } - $siteNode.AppendChild($xmlNode) | Out-Null - } - } - } -} - -function AddInternal-ProjectGuidToWebConfig { - [cmdletbinding()] - param( - [Parameter(Position=0)] - [HashTable]$publishProperties, - [Parameter(Position=1)] - [System.IO.FileInfo]$packOutput - ) - process { - try { - [Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null - $webConfigPath = Join-Path $packOutput 'web.config' - $projectGuidCommentValue = 'ProjectGuid: {0}' -f $publishProperties['ProjectGuid'] - $xDoc = [System.Xml.Linq.XDocument]::Load($webConfigPath) - $allNodes = $xDoc.DescendantNodes() - $projectGuidComment = $allNodes | Where-Object { $_.NodeType -eq [System.Xml.XmlNodeType]::Comment -and $_.Value -eq $projectGuidCommentValue } | Select -First 1 - if($projectGuidComment -ne $null) { - if($publishProperties['IgnoreProjectGuid'] -eq $true) { - $projectGuidComment.Remove() | Out-Null - $xDoc.Save($webConfigPath) | Out-Null - } - } - else { - if(-not ($publishProperties['IgnoreProjectGuid'] -eq $true)) { - $projectGuidComment = New-Object -TypeName System.Xml.Linq.XComment -ArgumentList $projectGuidCommentValue - $xDoc.LastNode.AddAfterSelf($projectGuidComment) | Out-Null - $xDoc.Save($webConfigPath) | Out-Null - } - } - } - catch { - } - } -} - -<# -.SYNOPSIS - -Example of $EFMigrations: - $EFMigrations = @{'CarContext'='Car Context ConnectionString';'MovieContext'='Movie Context Connection String'} - -#> - -function GenerateInternal-EFMigrationScripts { - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0)] - [System.IO.FileInfo]$projectPath, - [Parameter(Mandatory=$true,Position=1)] - [System.IO.FileInfo]$packOutput, - [Parameter(Position=2)] - [HashTable]$EFMigrations - ) - process { - $files = @{} - $dotnetExePath = GetInternal-DotNetExePath - foreach ($dbContextName in $EFMigrations.Keys) { - try - { - $tempDir = GetInternal-PublishTempPath -packOutput $packOutput - $efScriptFile = Join-Path $tempDir ('{0}.sql' -f $dbContextName) - $arg = ('ef migrations script --idempotent --output {0} --context {1}' -f - $efScriptFile, - $dbContextName) - - Execute-Command $dotnetExePath $arg $projectPath | Out-Null - if (Test-Path -Path $efScriptFile) { - if (!($files.ContainsKey($dbContextName))) { - $files.Add($dbContextName, $efScriptFile) | Out-Null - } - } - } - catch - { - throw 'error occured when executing dotnet.exe to generate EF T-SQL file' - } - } - # return files object - $files - } -} - -<# -.SYNOPSIS - -Example of $connectionStrings: - $connectionStrings = @{'DefaultConnection'='Default ConnectionString';'CarConnection'='Car Connection String'} - -#> -function GenerateInternal-AppSettingsFile { - [cmdletbinding()] - param( - [Parameter(Mandatory = $true,Position=0)] - [System.IO.FileInfo]$packOutput, - [Parameter(Mandatory = $true,Position=1)] - [string]$environmentName, - [Parameter(Position=2)] - [HashTable]$connectionStrings - ) - process { - $configProdJsonFile = 'appsettings.{0}.json' -f $environmentName - $configProdJsonFilePath = Join-Path -Path $packOutput -ChildPath $configProdJsonFile - - if ([string]::IsNullOrEmpty($configProdJsonFilePath)) { - throw ('The path of {0} is empty' -f $configProdJsonFilePath) - } - - if(!(Test-Path -Path $configProdJsonFilePath)) { - # create new file - '{}' | out-file -encoding utf8 -filePath $configProdJsonFilePath -Force - } - - $jsonObj = ConvertFrom-Json -InputObject (Get-Content -Path $configProdJsonFilePath -Raw) - # update when there exists one or more connection strings - if ($connectionStrings -ne $null) { - foreach ($name in $connectionStrings.Keys) { - #check for hierarchy style - if ($jsonObj.ConnectionStrings.$name) { - $jsonObj.ConnectionStrings.$name = $connectionStrings[$name] - continue - } - #check for horizontal style - $horizontalName = 'ConnectionStrings.{0}:' -f $name - if ($jsonObj.$horizontalName) { - $jsonObj.$horizontalName = $connectionStrings[$name] - continue - } - # create new one - if (!($jsonObj.ConnectionStrings)) { - $contentForDefaultConnection = '{}' - $jsonObj | Add-Member -name 'ConnectionStrings' -value (ConvertFrom-Json -InputObject $contentForDefaultConnection) -MemberType NoteProperty | Out-Null - } - if (!($jsonObj.ConnectionStrings.$name)) { - $jsonObj.ConnectionStrings | Add-Member -name $name -value $connectionStrings[$name] -MemberType NoteProperty | Out-Null - } - } - } - - $jsonObj | ConvertTo-Json | out-file -encoding utf8 -filePath $configProdJsonFilePath -Force - - #return the path of config.[environment].json - $configProdJsonFilePath - } -} - -<# -.SYNOPSIS - -Inputs: -Example of $providerDataArray: - - [System.Collections.ArrayList]$providerDataArray = @() - - $iisAppSourceKeyValue=@{"iisApp" = @{"path"='c:\temp\pathtofiles';"appOfflineTemplate" ='offline-template.html'}} - $providerDataArray.Add($iisAppSourceKeyValue) - - $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile"}} - $providerDataArray.Add($dbfullsqlKeyValue) - - $dbfullsqlKeyValue=@{"dbfullsql" = @{"path"="c:\Temp\PathToSqlFile2"}} - $providerDataArray.Add($dbfullsqlKeyValue) - - Manifest File content: - - - - - - - -#> - -function GenerateInternal-ManifestFile { - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0)] - [System.IO.FileInfo]$packOutput, - [Parameter(Mandatory=$true,Position=1)] - $publishProperties, - [Parameter(Mandatory=$true,Position=2)] - [System.Collections.ArrayList]$providerDataArray, - [Parameter(Mandatory=$true,Position=3)] - [ValidateNotNull()] - $manifestFileName - ) - process{ - $xmlDocument = [xml]'' - AddInternal-ProviderDataToManifest -xmlDocument $xmlDocument -providerDataArray $providerDataArray | Out-Null - $publishTempDir = GetInternal-PublishTempPath -packOutput $packOutput - $XMLFile = Join-Path $publishTempDir $manifestFileName - $xmlDocument.OuterXml | out-file -encoding utf8 -filePath $XMLFile -Force - - # return - [System.IO.FileInfo]$XMLFile - } -} - -function GetInternal-PublishTempPath { - [cmdletbinding()] - param( - [Parameter(Mandatory=$true, Position=0)] - [System.IO.FileInfo]$packOutput - ) - process { - $tempDir = [io.path]::GetTempPath() - $packOutputFolderName = Split-Path $packOutput -Leaf - $publishTempDir = [io.path]::combine($tempDir,'PublishTemp','obj',$packOutputFolderName) - if (!(Test-Path -Path $publishTempDir)) { - New-Item -Path $publishTempDir -type directory | Out-Null - } - # return - [System.IO.FileInfo]$publishTempDir - } -} - -function Publish-AspNetMSDeploy{ - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - $publishProperties, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - $packOutput - ) - process{ - if($publishProperties){ - $publishPwd = $publishProperties['Password'] - - $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties -packOutput $packOutput - $iisAppPath = $publishProperties['DeployIisAppPath'] - - # create source manifest - - # e.g - # - # - # - # - # - # - - [System.Collections.ArrayList]$providerDataArray = @() - $iisAppValues = @{"path"=$packOutput}; - $iisAppSourceKeyValue=@{"iisApp" = $iisAppValues} - $providerDataArray.Add($iisAppSourceKeyValue) | Out-Null - - if ($sharedArgs.EFMigrationData -ne $null -and $sharedArgs.EFMigrationData.Contains('EFSqlFiles')) { - foreach ($sqlFile in $sharedArgs.EFMigrationData['EFSqlFiles'].Values) { - $dbFullSqlSourceKeyValue=@{"dbFullSql" = @{"path"=$sqlFile}} - $providerDataArray.Add($dbFullSqlSourceKeyValue) | Out-Null - } - } - - [System.IO.FileInfo]$sourceXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'SourceManifest.xml' - - $providerDataArray.Clear() | Out-Null - # create destination manifest - - # e.g - # - # - # - # - # - - $iisAppValues = @{"path"=$iisAppPath}; - if(-not [string]::IsNullOrWhiteSpace($publishProperties['AppOfflineTemplate'])){ - $iisAppValues.Add("appOfflineTemplate", $publishProperties['AppOfflineTemplate']) | Out-Null - } - - $iisAppDestinationKeyValue=@{"iisApp" = $iisAppValues} - $providerDataArray.Add($iisAppDestinationKeyValue) | Out-Null - - if ($publishProperties['EfMigrations'] -ne $null -and $publishProperties['EfMigrations'].Count -gt 0) { - foreach ($connectionString in $publishProperties['EfMigrations'].Values) { - $dbFullSqlDestinationKeyValue=@{"dbFullSql" = @{"path"=$connectionString}} - $providerDataArray.Add($dbFullSqlDestinationKeyValue) | Out-Null - } - } - - - [System.IO.FileInfo]$destXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'DestinationManifest.xml' - - <# - "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" - -source:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' - -dest:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\DestManifest.xml',ComputerName='https://contoso.scm.azurewebsites.net/msdeploy.axd',UserName='$contoso',Password='',IncludeAcls='False',AuthType='Basic' - -verb:sync - -enableRule:DoNotDeleteRule - -retryAttempts=2" - #> - - if(-not [string]::IsNullOrWhiteSpace($publishProperties['MSDeployPublishMethod'])){ - $serviceMethod = $publishProperties['MSDeployPublishMethod'] - } - - $msdeployComputerName= InternalNormalize-MSDeployUrl -serviceUrl $publishProperties['MSDeployServiceURL'] -siteName $iisAppPath -serviceMethod $publishProperties['MSDeployPublishMethod'] - if($publishProperties['UseMSDeployServiceURLAsIs'] -eq $true){ - $msdeployComputerName = $publishProperties['MSDeployServiceURL'] - } - - $publishArgs = @() - #use manifest to publish - $publishArgs += ('-source:manifest=''{0}''' -f $sourceXMLFile.FullName) - $publishArgs += ('-dest:manifest=''{0}'',ComputerName=''{1}'',UserName=''{2}'',Password=''{3}'',IncludeAcls=''False'',AuthType=''{4}''{5}' -f - $destXMLFile.FullName, - $msdeployComputerName, - $publishProperties['UserName'], - $publishPwd, - $publishProperties['AuthType'], - $sharedArgs.DestFragment) - $publishArgs += '-verb:sync' - $publishArgs += $sharedArgs.ExtraArgs - - $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') - - if (! [String]::IsNullOrEmpty($publishPwd)) { - $command.Replace($publishPwd,'{PASSWORD-REMOVED-FROM-LOG}') | Print-CommandString - } - Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') - } - else{ - throw 'publishProperties is empty, cannot publish' - } - } -} - -function Escape-TextForRegularExpressions{ - [cmdletbinding()] - param( - [Parameter(Position=0,Mandatory=$true)] - [string]$text - ) - process{ - [regex]::Escape($text) - } -} - -function Publish-AspNetMSDeployPackage{ - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - $publishProperties, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - $packOutput - ) - process{ - if($publishProperties){ - $packageDestinationFilepath = $publishProperties['DesktopBuildPackageLocation'] - - if(!$packageDestinationFilepath){ - throw ('The package destination property (DesktopBuildPackageLocation) was not found in the publish properties') - } - - if(!([System.IO.Path]::IsPathRooted($packageDestinationFilepath))){ - $packageDestinationFilepath = [System.IO.Path]::GetFullPath((Join-Path $pwd $packageDestinationFilepath)) - } - - # if the dir doesn't exist create it - $pkgDir = ((new-object -typename System.IO.FileInfo($packageDestinationFilepath)).Directory) - if(!(Test-Path -Path $pkgDir)) { - New-Item $pkgDir -type Directory | Out-Null - } - - <# - "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" - -source:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' - -dest:package=c:\temp\path\contosoweb.zip - -verb:sync - -enableRule:DoNotDeleteRule - -retryAttempts=2 - #> - - $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties -packOutput $packOutput - - # create source manifest - - # e.g - # - # - # - # - - [System.Collections.ArrayList]$providerDataArray = @() - $iisAppSourceKeyValue=@{"iisApp" = @{"path"=$packOutput}} - $providerDataArray.Add($iisAppSourceKeyValue) | Out-Null - - [System.IO.FileInfo]$sourceXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'SourceManifest.xml' - - $publishArgs = @() - $publishArgs += ('-source:manifest=''{0}''' -f $sourceXMLFile.FullName) - $publishArgs += ('-dest:package=''{0}''' -f $packageDestinationFilepath) - $publishArgs += '-verb:sync' - $packageContentFolder = $publishProperties['MSDeployPackageContentFoldername'] - if(!$packageContentFolder){ $packageContentFolder = 'website' } - $publishArgs += ('-replace:match=''{0}'',replace=''{1}''' -f (Escape-TextForRegularExpressions $packOutput), $packageContentFolder ) - $publishArgs += $sharedArgs.ExtraArgs - - $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') - $command | Print-CommandString - Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') - } - else{ - throw 'publishProperties is empty, cannot publish' - } - } -} - -function Publish-AspNetFileSystem{ - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - $publishProperties, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - $packOutput - ) - process{ - $pubOut = $publishProperties['publishUrl'] - - if([string]::IsNullOrWhiteSpace($pubOut)){ - throw ('publishUrl is a required property for FileSystem publish but it was empty.') - } - - # if it's a relative path then update it to a full path - if(!([System.IO.Path]::IsPathRooted($pubOut))){ - $pubOut = [System.IO.Path]::GetFullPath((Join-Path $pwd $pubOut)) - $publishProperties['publishUrl'] = "$pubOut" - } - - 'Publishing files to {0}' -f $pubOut | Write-Output - - # we use msdeploy.exe because it supports incremental publish/skips/replacements/etc - # msdeploy.exe -verb:sync -source:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' -dest:manifest='C:\Users\testuser\AppData\Local\Temp\PublishTemp\obj\DestManifest.xml' - - $sharedArgs = GetInternal-SharedMSDeployParametersFrom -publishProperties $publishProperties -packOutput $packOutput - - # create source manifest - - # e.g - # - # - # - # - - [System.Collections.ArrayList]$providerDataArray = @() - $contentPathValues = @{"path"=$packOutput}; - $contentPathSourceKeyValue=@{"contentPath" = $contentPathValues} - $providerDataArray.Add($contentPathSourceKeyValue) | Out-Null - - [System.IO.FileInfo]$sourceXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'SourceManifest.xml' - - $providerDataArray.Clear() | Out-Null - # create destination manifest - - # e.g - # - # - # - $contentPathValues = @{"path"=$publishProperties['publishUrl']}; - if(-not [string]::IsNullOrWhiteSpace($publishProperties['AppOfflineTemplate'])){ - $contentPathValues.Add("appOfflineTemplate", $publishProperties['AppOfflineTemplate']) | Out-Null - } - $contentPathDestinationKeyValue=@{"contentPath" = $contentPathValues} - $providerDataArray.Add($contentPathDestinationKeyValue) | Out-Null - - [System.IO.FileInfo]$destXMLFile = GenerateInternal-ManifestFile -packOutput $packOutput -publishProperties $publishProperties -providerDataArray $providerDataArray -manifestFileName 'DestinationManifest.xml' - - $publishArgs = @() - $publishArgs += ('-source:manifest=''{0}''' -f $sourceXMLFile.FullName) - $publishArgs += ('-dest:manifest=''{0}''{1}' -f $destXMLFile.FullName, $sharedArgs.DestFragment) - $publishArgs += '-verb:sync' - $publishArgs += $sharedArgs.ExtraArgs - - $command = '"{0}" {1}' -f (Get-MSDeploy),($publishArgs -join ' ') - $command | Print-CommandString - Execute-Command -exePath (Get-MSDeploy) -arguments ($publishArgs -join ' ') - - # copy sql script to script folder - if (($sharedArgs.EFMigrationData['EFSqlFiles'] -ne $null) -and ($sharedArgs.EFMigrationData['EFSqlFiles'].Count -gt 0)) { - $scriptsDir = Join-Path $pubOut 'efscripts' - - if (!(Test-Path -Path $scriptsDir)) { - New-Item -Path $scriptsDir -type directory | Out-Null - } - - foreach ($sqlFile in $sharedArgs.EFMigrationData['EFSqlFiles'].Values) { - Copy-Item $sqlFile -Destination $scriptsDir -Force -Recurse | Out-Null - } - } - } -} - -<# -.SYNOPSIS - This can be used to read a publish profile to extract the property values into a hashtable. - -.PARAMETER filepath - Path to the publish profile to get the properties from. Currenlty this only supports reading - .pubxml files. - -.EXAMPLE - Get-PropertiesFromPublishProfile -filepath c:\projects\publish\devpublish.pubxml -#> -function Get-PropertiesFromPublishProfile{ - [cmdletbinding()] - param( - [Parameter(Position=0,Mandatory=$true)] - [ValidateNotNull()] - [ValidateScript({Test-Path $_})] - [System.IO.FileInfo]$filepath - ) - begin{ - Add-Type -AssemblyName System.Core - Add-Type -AssemblyName Microsoft.Build - } - process{ - 'Reading publish properties from profile [{0}]' -f $filepath | Write-Verbose - # use MSBuild to get the project and read properties - $projectCollection = (New-Object Microsoft.Build.Evaluation.ProjectCollection) - if(!([System.IO.Path]::IsPathRooted($filepath))){ - $filepath = [System.IO.Path]::GetFullPath((Join-Path $pwd $filepath)) - } - $project = ([Microsoft.Build.Construction.ProjectRootElement]::Open([string]$filepath.Fullname, $projectCollection)) - - $properties = @{} - foreach($property in $project.Properties){ - $properties[$property.Name]=$property.Value - } - - $properties - } -} - -function Print-CommandString{ - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] - $command - ) - process{ - 'Executing command [{0}]' -f $command | Write-Output - } -} - -function Execute-CommandString{ - [cmdletbinding()] - param( - [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] - [string[]]$command, - - [switch] - $useInvokeExpression, - - [switch] - $ignoreErrors - ) - process{ - foreach($cmdToExec in $command){ - 'Executing command [{0}]' -f $cmdToExec | Write-Verbose - if($useInvokeExpression){ - try { - Invoke-Expression -Command $cmdToExec - } - catch { - if(-not $ignoreErrors){ - $msg = ('The command [{0}] exited with exception [{1}]' -f $cmdToExec, $_.ToString()) - throw $msg - } - } - } - else { - cmd.exe /D /C $cmdToExec - - if(-not $ignoreErrors -and ($LASTEXITCODE -ne 0)){ - $msg = ('The command [{0}] exited with code [{1}]' -f $cmdToExec, $LASTEXITCODE) - throw $msg - } - } - } - } -} - -function Execute-Command { - [cmdletbinding()] - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - [String]$exePath, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - [String]$arguments, - [Parameter(Position=2)] - [System.IO.FileInfo]$workingDirectory - ) - process{ - $psi = New-Object -TypeName System.Diagnostics.ProcessStartInfo - $psi.CreateNoWindow = $true - $psi.UseShellExecute = $false - $psi.RedirectStandardOutput = $true - $psi.RedirectStandardError=$true - $psi.FileName = $exePath - $psi.Arguments = $arguments - if($workingDirectory -and (Test-Path -Path $workingDirectory)) { - $psi.WorkingDirectory = $workingDirectory - } - - $process = New-Object -TypeName System.Diagnostics.Process - $process.StartInfo = $psi - $process.EnableRaisingEvents=$true - - # Register the event handler for error - $stdErrEvent = Register-ObjectEvent -InputObject $process -EventName 'ErrorDataReceived' -Action { - if (! [String]::IsNullOrEmpty($EventArgs.Data)) { - $EventArgs.Data | Write-Error - } - } - - # Starting process. - $process.Start() | Out-Null - $process.BeginErrorReadLine() | Out-Null - $output = $process.StandardOutput.ReadToEnd() - $process.WaitForExit() | Out-Null - $output | Write-Output - - # UnRegister the event handler for error - Unregister-Event -SourceIdentifier $stdErrEvent.Name | Out-Null - } -} - - -function GetInternal-DotNetExePath { - process { - $dotnetinstallpath = $env:dotnetinstallpath - if (!$dotnetinstallpath) { - $DotNetRegItem = Get-ItemProperty -Path 'hklm:\software\dotnet\setup\' - if ($env:DOTNET_HOME) { - $dotnetinstallpath = Join-Path $env:DOTNET_HOME -ChildPath 'dotnet.exe' - } - elseif ($DotNetRegItem -and $DotNetRegItem.InstallDir){ - $dotnetinstallpath = Join-Path $DotNetRegItem.InstallDir -ChildPath 'dotnet.exe' - } - } - if (!(Test-Path $dotnetinstallpath)) { - throw 'Unable to find dotnet.exe, please install it and try again' - } - # return - [System.IO.FileInfo]$dotnetinstallpath - } -} - -function Get-MSDeploy{ - [cmdletbinding()] - param() - process{ - $installPath = $env:msdeployinstallpath - - if(!$installPath){ - $keysToCheck = @('hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3','hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2','hklm:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1') - - foreach($keyToCheck in $keysToCheck){ - if(Test-Path $keyToCheck){ - $installPath = (Get-itemproperty $keyToCheck -Name InstallPath -ErrorAction SilentlyContinue | select -ExpandProperty InstallPath -ErrorAction SilentlyContinue) - } - - if($installPath){ - break; - } - } - } - - if(!$installPath){ - throw "Unable to find msdeploy.exe, please install it and try again" - } - - [string]$msdInstallLoc = (join-path $installPath 'msdeploy.exe') - - "Found msdeploy.exe at [{0}]" -f $msdInstallLoc | Write-Verbose - - $msdInstallLoc - } -} - -function InternalNormalize-MSDeployUrl{ - [cmdletbinding()] - param( - [Parameter(Position=0,Mandatory=$true)] - [string]$serviceUrl, - - [string] $siteName, - - [ValidateSet('WMSVC','RemoteAgent','InProc')] - [string]$serviceMethod = 'WMSVC' - ) - process{ - $tempUrl = $serviceUrl - $resultUrl = $serviceUrl - - $httpsStr = 'https://' - $httpStr = 'http://' - $msdeployAxd = 'msdeploy.axd' - - if(-not [string]::IsNullOrWhiteSpace($serviceUrl)){ - if([string]::Compare($serviceMethod,'WMSVC',[StringComparison]::OrdinalIgnoreCase) -eq 0){ - # if no http or https then add one - if(-not ($serviceUrl.StartsWith($httpStr,[StringComparison]::OrdinalIgnoreCase) -or - $serviceUrl.StartsWith($httpsStr,[StringComparison]::OrdinalIgnoreCase)) ){ - - $serviceUrl = [string]::Concat($httpsStr,$serviceUrl.TrimStart()) - } - [System.Uri]$serviceUri = New-Object -TypeName 'System.Uri' $serviceUrl - [System.UriBuilder]$serviceUriBuilder = New-Object -TypeName 'System.UriBuilder' $serviceUrl - - # if it's https and the port was not passed in override it to 8172 - if( ([string]::Compare('https',$serviceUriBuilder.Scheme,[StringComparison]::OrdinalIgnoreCase) -eq 0) -and - -not $serviceUrl.Contains((':{0}' -f $serviceUriBuilder.Port)) ) { - $serviceUriBuilder.Port = 8172 - } - - # if no path then add one - if([string]::Compare('/',$serviceUriBuilder.Path,[StringComparison]::OrdinalIgnoreCase) -eq 0){ - $serviceUriBuilder.Path = $msdeployAxd - } - - if ([string]::IsNullOrEmpty($serviceUriBuilder.Query) -and -not([string]::IsNullOrEmpty($siteName))) - { - $serviceUriBuilder.Query = "site=" + $siteName; - } - - $resultUrl = $serviceUriBuilder.Uri.AbsoluteUri - } - elseif([string]::Compare($serviceMethod,'RemoteAgent',[StringComparison]::OrdinalIgnoreCase) -eq 0){ - [System.UriBuilder]$serviceUriBuilder = New-Object -TypeName 'System.UriBuilder' $serviceUrl - # http://{computername}/MSDEPLOYAGENTSERVICE - # remote agent must use http - $serviceUriBuilder.Scheme = 'http' - $serviceUriBuilder.Path = '/MSDEPLOYAGENTSERVICE' - - $resultUrl = $serviceUriBuilder.Uri.AbsoluteUri - } - else{ - # see if it's for localhost - [System.Uri]$serviceUri = New-Object -TypeName 'System.Uri' $serviceUrl - $resultUrl = $serviceUri.AbsoluteUri - } - } - - # return the result to the caller - $resultUrl - } -} - -function InternalRegister-AspNetKnownPublishHandlers{ - [cmdletbinding()] - param() - process{ - 'Registering MSDeploy handler' | Write-Verbose - Register-AspnetPublishHandler -name 'MSDeploy' -force -handler { - [cmdletbinding()] - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - $publishProperties, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - $packOutput - ) - - Publish-AspNetMSDeploy -publishProperties $publishProperties -packOutput $packOutput - } - - 'Registering MSDeploy package handler' | Write-Verbose - Register-AspnetPublishHandler -name 'Package' -force -handler { - [cmdletbinding()] - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - $publishProperties, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - $packOutput - ) - - Publish-AspNetMSDeployPackage -publishProperties $publishProperties -packOutput $packOutput - } - - 'Registering FileSystem handler' | Write-Verbose - Register-AspnetPublishHandler -name 'FileSystem' -force -handler { - [cmdletbinding()] - param( - [Parameter(Mandatory = $true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] - $publishProperties, - [Parameter(Mandatory = $true,Position=1,ValueFromPipelineByPropertyName=$true)] - $packOutput - ) - - Publish-AspNetFileSystem -publishProperties $publishProperties -packOutput $packOutput - } - } -} - -<# -.SYNOPSIS - Used for testing purposes only. -#> -function InternalReset-AspNetPublishHandlers{ - [cmdletbinding()] - param() - process{ - $script:AspNetPublishHandlers = @{} - InternalRegister-AspNetKnownPublishHandlers - } -} - -Export-ModuleMember -function Get-*,Publish-*,Register-*,Enable-* -if($env:IsDeveloperMachine){ - # you can set the env var to expose all functions to importer. easy for development. - # this is required for executing pester test cases, it's set by build.ps1 - Export-ModuleMember -function * -} - -# register the handlers so that Publish-AspNet can be called -InternalRegister-AspNetKnownPublishHandlers - diff --git a/src/DotNetBlog.Web/Properties/PublishProfiles/release-publish.ps1 b/src/DotNetBlog.Web/Properties/PublishProfiles/release-publish.ps1 deleted file mode 100644 index e9dd5e3..0000000 --- a/src/DotNetBlog.Web/Properties/PublishProfiles/release-publish.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -[cmdletbinding(SupportsShouldProcess=$true)] -param($publishProperties=@{}, $packOutput, $pubProfilePath) - -# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 - -try{ - if ($publishProperties['ProjectGuid'] -eq $null){ - $publishProperties['ProjectGuid'] = '89f9b8c8-2f34-41cf-b39e-c23935afadc8' - } - - $publishModulePath = Join-Path (Split-Path $MyInvocation.MyCommand.Path) 'publish-module.psm1' - Import-Module $publishModulePath -DisableNameChecking -Force - - # call Publish-AspNet to perform the publish operation - Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput -pubProfilePath $pubProfilePath -} -catch{ - "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error -} \ No newline at end of file diff --git a/src/DotNetBlog.Web/Properties/PublishProfiles/release.pubxml b/src/DotNetBlog.Web/Properties/PublishProfiles/release.pubxml deleted file mode 100644 index f82aa4b..0000000 --- a/src/DotNetBlog.Web/Properties/PublishProfiles/release.pubxml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - FileSystem - Release - Any CPU - - True - False - netcoreapp1.0 - True - .\bin\Release\PublishOutput - True - netcoreapp2.0 - 89f9b8c8-2f34-41cf-b39e-c23935afadc8 - - \ No newline at end of file diff --git a/src/DotNetBlog.Web/Properties/launchSettings.json b/src/DotNetBlog.Web/Properties/launchSettings.json deleted file mode 100644 index 3bdaf19..0000000 --- a/src/DotNetBlog.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:10142/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "DotNetBlog.Web": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/DotNetBlog.Web/ViewEngines/ThemeResourceLocalizationFactory.cs b/src/DotNetBlog.Web/ViewEngines/ThemeResourceLocalizationFactory.cs index 3ab89a6..641cfff 100644 --- a/src/DotNetBlog.Web/ViewEngines/ThemeResourceLocalizationFactory.cs +++ b/src/DotNetBlog.Web/ViewEngines/ThemeResourceLocalizationFactory.cs @@ -6,8 +6,8 @@ namespace DotNetBlog.Web.ViewEngines { public class ThemeResourceLocalizationFactory : ResourceManagerStringLocalizerFactory { - private static string BaseThemeName = nameof(DotNetBlog.Web) + ".Themes."; - private static string BaseViewName = nameof(DotNetBlog.Web) + ".Views."; + private static string BaseThemeName = $"{nameof(DotNetBlog)}.{nameof(DotNetBlog.Web)}.Themes."; + private static string BaseViewName = $"{nameof(DotNetBlog)}.{nameof(DotNetBlog.Web)}.Views."; public ThemeResourceLocalizationFactory(IOptions localizationOptions, ILoggerFactory loggerFactory) : base(localizationOptions, loggerFactory) { diff --git a/src/DotNetBlog.Web/bundleconfig.json b/src/DotNetBlog.Web/bundleconfig.json deleted file mode 100644 index c27e267..0000000 --- a/src/DotNetBlog.Web/bundleconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "outputFileName": "wwwroot/lib/editor.md/editormd.min.js", - "inputFiles": [ - "wwwroot/lib/editor.md/editormd.js" - ] - } -] diff --git a/src/DotNetBlog.Web/libman.json b/src/DotNetBlog.Web/libman.json deleted file mode 100644 index ceee271..0000000 --- a/src/DotNetBlog.Web/libman.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": "1.0", - "defaultProvider": "cdnjs", - "libraries": [] -} \ No newline at end of file diff --git a/src/DotNetBlog.Web/runtimeconfig.template.json b/src/DotNetBlog.Web/runtimeconfig.template.json deleted file mode 100644 index 3dc8eba..0000000 --- a/src/DotNetBlog.Web/runtimeconfig.template.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gcServer": true -} \ No newline at end of file diff --git a/src/DotNetBlog.Web/web.config b/src/DotNetBlog.Web/web.config deleted file mode 100644 index dc0514f..0000000 --- a/src/DotNetBlog.Web/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/src/DotNetBlog.Web/wwwroot/dist/app.js b/src/DotNetBlog.Web/wwwroot/dist/app.js new file mode 100644 index 0000000..9f29bdc --- /dev/null +++ b/src/DotNetBlog.Web/wwwroot/dist/app.js @@ -0,0 +1,112539 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ var parentHotUpdateCallback = this["webpackHotUpdate"]; +/******/ this["webpackHotUpdate"] = +/******/ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars +/******/ hotAddUpdateChunk(chunkId, moreModules); +/******/ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); +/******/ } +/******/ +/******/ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars +/******/ var head = document.getElementsByTagName("head")[0]; +/******/ var script = document.createElement("script"); +/******/ script.type = "text/javascript"; +/******/ script.charset = "utf-8"; +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; +/******/ head.appendChild(script); +/******/ } +/******/ +/******/ function hotDownloadManifest(callback) { // eslint-disable-line no-unused-vars +/******/ if(typeof XMLHttpRequest === "undefined") +/******/ return callback(new Error("No browser support")); +/******/ try { +/******/ var request = new XMLHttpRequest(); +/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; +/******/ request.open("GET", requestPath, true); +/******/ request.timeout = 10000; +/******/ request.send(null); +/******/ } catch(err) { +/******/ return callback(err); +/******/ } +/******/ request.onreadystatechange = function() { +/******/ if(request.readyState !== 4) return; +/******/ if(request.status === 0) { +/******/ // timeout +/******/ callback(new Error("Manifest request to " + requestPath + " timed out.")); +/******/ } else if(request.status === 404) { +/******/ // no update available +/******/ callback(); +/******/ } else if(request.status !== 200 && request.status !== 304) { +/******/ // other failure +/******/ callback(new Error("Manifest request to " + requestPath + " failed.")); +/******/ } else { +/******/ // success +/******/ try { +/******/ var update = JSON.parse(request.responseText); +/******/ } catch(e) { +/******/ callback(e); +/******/ return; +/******/ } +/******/ callback(null, update); +/******/ } +/******/ }; +/******/ } + +/******/ +/******/ +/******/ // Copied from https://github.com/facebook/react/blob/bef45b0/src/shared/utils/canDefineProperty.js +/******/ var canDefineProperty = false; +/******/ try { +/******/ Object.defineProperty({}, "x", { +/******/ get: function() {} +/******/ }); +/******/ canDefineProperty = true; +/******/ } catch(x) { +/******/ // IE will fail on defineProperty +/******/ } +/******/ +/******/ var hotApplyOnUpdate = true; +/******/ var hotCurrentHash = "bf22283af45b77e92f53"; // eslint-disable-line no-unused-vars +/******/ var hotCurrentModuleData = {}; +/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars +/******/ +/******/ function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars +/******/ var me = installedModules[moduleId]; +/******/ if(!me) return __webpack_require__; +/******/ var fn = function(request) { +/******/ if(me.hot.active) { +/******/ if(installedModules[request]) { +/******/ if(installedModules[request].parents.indexOf(moduleId) < 0) +/******/ installedModules[request].parents.push(moduleId); +/******/ if(me.children.indexOf(request) < 0) +/******/ me.children.push(request); +/******/ } else hotCurrentParents = [moduleId]; +/******/ } else { +/******/ console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); +/******/ hotCurrentParents = []; +/******/ } +/******/ return __webpack_require__(request); +/******/ }; +/******/ for(var name in __webpack_require__) { +/******/ if(Object.prototype.hasOwnProperty.call(__webpack_require__, name)) { +/******/ if(canDefineProperty) { +/******/ Object.defineProperty(fn, name, (function(name) { +/******/ return { +/******/ configurable: true, +/******/ enumerable: true, +/******/ get: function() { +/******/ return __webpack_require__[name]; +/******/ }, +/******/ set: function(value) { +/******/ __webpack_require__[name] = value; +/******/ } +/******/ }; +/******/ }(name))); +/******/ } else { +/******/ fn[name] = __webpack_require__[name]; +/******/ } +/******/ } +/******/ } +/******/ +/******/ function ensure(chunkId, callback) { +/******/ if(hotStatus === "ready") +/******/ hotSetStatus("prepare"); +/******/ hotChunksLoading++; +/******/ __webpack_require__.e(chunkId, function() { +/******/ try { +/******/ callback.call(null, fn); +/******/ } finally { +/******/ finishChunkLoading(); +/******/ } +/******/ +/******/ function finishChunkLoading() { +/******/ hotChunksLoading--; +/******/ if(hotStatus === "prepare") { +/******/ if(!hotWaitingFilesMap[chunkId]) { +/******/ hotEnsureUpdateChunk(chunkId); +/******/ } +/******/ if(hotChunksLoading === 0 && hotWaitingFiles === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ } +/******/ } +/******/ }); +/******/ } +/******/ if(canDefineProperty) { +/******/ Object.defineProperty(fn, "e", { +/******/ enumerable: true, +/******/ value: ensure +/******/ }); +/******/ } else { +/******/ fn.e = ensure; +/******/ } +/******/ return fn; +/******/ } +/******/ +/******/ function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars +/******/ var hot = { +/******/ // private stuff +/******/ _acceptedDependencies: {}, +/******/ _declinedDependencies: {}, +/******/ _selfAccepted: false, +/******/ _selfDeclined: false, +/******/ _disposeHandlers: [], +/******/ +/******/ // Module API +/******/ active: true, +/******/ accept: function(dep, callback) { +/******/ if(typeof dep === "undefined") +/******/ hot._selfAccepted = true; +/******/ else if(typeof dep === "function") +/******/ hot._selfAccepted = dep; +/******/ else if(typeof dep === "object") +/******/ for(var i = 0; i < dep.length; i++) +/******/ hot._acceptedDependencies[dep[i]] = callback; +/******/ else +/******/ hot._acceptedDependencies[dep] = callback; +/******/ }, +/******/ decline: function(dep) { +/******/ if(typeof dep === "undefined") +/******/ hot._selfDeclined = true; +/******/ else if(typeof dep === "number") +/******/ hot._declinedDependencies[dep] = true; +/******/ else +/******/ for(var i = 0; i < dep.length; i++) +/******/ hot._declinedDependencies[dep[i]] = true; +/******/ }, +/******/ dispose: function(callback) { +/******/ hot._disposeHandlers.push(callback); +/******/ }, +/******/ addDisposeHandler: function(callback) { +/******/ hot._disposeHandlers.push(callback); +/******/ }, +/******/ removeDisposeHandler: function(callback) { +/******/ var idx = hot._disposeHandlers.indexOf(callback); +/******/ if(idx >= 0) hot._disposeHandlers.splice(idx, 1); +/******/ }, +/******/ +/******/ // Management API +/******/ check: hotCheck, +/******/ apply: hotApply, +/******/ status: function(l) { +/******/ if(!l) return hotStatus; +/******/ hotStatusHandlers.push(l); +/******/ }, +/******/ addStatusHandler: function(l) { +/******/ hotStatusHandlers.push(l); +/******/ }, +/******/ removeStatusHandler: function(l) { +/******/ var idx = hotStatusHandlers.indexOf(l); +/******/ if(idx >= 0) hotStatusHandlers.splice(idx, 1); +/******/ }, +/******/ +/******/ //inherit from previous dispose call +/******/ data: hotCurrentModuleData[moduleId] +/******/ }; +/******/ return hot; +/******/ } +/******/ +/******/ var hotStatusHandlers = []; +/******/ var hotStatus = "idle"; +/******/ +/******/ function hotSetStatus(newStatus) { +/******/ hotStatus = newStatus; +/******/ for(var i = 0; i < hotStatusHandlers.length; i++) +/******/ hotStatusHandlers[i].call(null, newStatus); +/******/ } +/******/ +/******/ // while downloading +/******/ var hotWaitingFiles = 0; +/******/ var hotChunksLoading = 0; +/******/ var hotWaitingFilesMap = {}; +/******/ var hotRequestedFilesMap = {}; +/******/ var hotAvailibleFilesMap = {}; +/******/ var hotCallback; +/******/ +/******/ // The update info +/******/ var hotUpdate, hotUpdateNewHash; +/******/ +/******/ function toModuleId(id) { +/******/ var isNumber = (+id) + "" === id; +/******/ return isNumber ? +id : id; +/******/ } +/******/ +/******/ function hotCheck(apply, callback) { +/******/ if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status"); +/******/ if(typeof apply === "function") { +/******/ hotApplyOnUpdate = false; +/******/ callback = apply; +/******/ } else { +/******/ hotApplyOnUpdate = apply; +/******/ callback = callback || function(err) { +/******/ if(err) throw err; +/******/ }; +/******/ } +/******/ hotSetStatus("check"); +/******/ hotDownloadManifest(function(err, update) { +/******/ if(err) return callback(err); +/******/ if(!update) { +/******/ hotSetStatus("idle"); +/******/ callback(null, null); +/******/ return; +/******/ } +/******/ +/******/ hotRequestedFilesMap = {}; +/******/ hotAvailibleFilesMap = {}; +/******/ hotWaitingFilesMap = {}; +/******/ for(var i = 0; i < update.c.length; i++) +/******/ hotAvailibleFilesMap[update.c[i]] = true; +/******/ hotUpdateNewHash = update.h; +/******/ +/******/ hotSetStatus("prepare"); +/******/ hotCallback = callback; +/******/ hotUpdate = {}; +/******/ var chunkId = 0; +/******/ { // eslint-disable-line no-lone-blocks +/******/ /*globals chunkId */ +/******/ hotEnsureUpdateChunk(chunkId); +/******/ } +/******/ if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ }); +/******/ } +/******/ +/******/ function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars +/******/ if(!hotAvailibleFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) +/******/ return; +/******/ hotRequestedFilesMap[chunkId] = false; +/******/ for(var moduleId in moreModules) { +/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { +/******/ hotUpdate[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(--hotWaitingFiles === 0 && hotChunksLoading === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ } +/******/ +/******/ function hotEnsureUpdateChunk(chunkId) { +/******/ if(!hotAvailibleFilesMap[chunkId]) { +/******/ hotWaitingFilesMap[chunkId] = true; +/******/ } else { +/******/ hotRequestedFilesMap[chunkId] = true; +/******/ hotWaitingFiles++; +/******/ hotDownloadUpdateChunk(chunkId); +/******/ } +/******/ } +/******/ +/******/ function hotUpdateDownloaded() { +/******/ hotSetStatus("ready"); +/******/ var callback = hotCallback; +/******/ hotCallback = null; +/******/ if(!callback) return; +/******/ if(hotApplyOnUpdate) { +/******/ hotApply(hotApplyOnUpdate, callback); +/******/ } else { +/******/ var outdatedModules = []; +/******/ for(var id in hotUpdate) { +/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { +/******/ outdatedModules.push(toModuleId(id)); +/******/ } +/******/ } +/******/ callback(null, outdatedModules); +/******/ } +/******/ } +/******/ +/******/ function hotApply(options, callback) { +/******/ if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status"); +/******/ if(typeof options === "function") { +/******/ callback = options; +/******/ options = {}; +/******/ } else if(options && typeof options === "object") { +/******/ callback = callback || function(err) { +/******/ if(err) throw err; +/******/ }; +/******/ } else { +/******/ options = {}; +/******/ callback = callback || function(err) { +/******/ if(err) throw err; +/******/ }; +/******/ } +/******/ +/******/ function getAffectedStuff(module) { +/******/ var outdatedModules = [module]; +/******/ var outdatedDependencies = {}; +/******/ +/******/ var queue = outdatedModules.slice(); +/******/ while(queue.length > 0) { +/******/ var moduleId = queue.pop(); +/******/ var module = installedModules[moduleId]; +/******/ if(!module || module.hot._selfAccepted) +/******/ continue; +/******/ if(module.hot._selfDeclined) { +/******/ return new Error("Aborted because of self decline: " + moduleId); +/******/ } +/******/ if(moduleId === 0) { +/******/ return; +/******/ } +/******/ for(var i = 0; i < module.parents.length; i++) { +/******/ var parentId = module.parents[i]; +/******/ var parent = installedModules[parentId]; +/******/ if(parent.hot._declinedDependencies[moduleId]) { +/******/ return new Error("Aborted because of declined dependency: " + moduleId + " in " + parentId); +/******/ } +/******/ if(outdatedModules.indexOf(parentId) >= 0) continue; +/******/ if(parent.hot._acceptedDependencies[moduleId]) { +/******/ if(!outdatedDependencies[parentId]) +/******/ outdatedDependencies[parentId] = []; +/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); +/******/ continue; +/******/ } +/******/ delete outdatedDependencies[parentId]; +/******/ outdatedModules.push(parentId); +/******/ queue.push(parentId); +/******/ } +/******/ } +/******/ +/******/ return [outdatedModules, outdatedDependencies]; +/******/ } +/******/ +/******/ function addAllToSet(a, b) { +/******/ for(var i = 0; i < b.length; i++) { +/******/ var item = b[i]; +/******/ if(a.indexOf(item) < 0) +/******/ a.push(item); +/******/ } +/******/ } +/******/ +/******/ // at begin all updates modules are outdated +/******/ // the "outdated" status can propagate to parents if they don't accept the children +/******/ var outdatedDependencies = {}; +/******/ var outdatedModules = []; +/******/ var appliedUpdate = {}; +/******/ for(var id in hotUpdate) { +/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { +/******/ var moduleId = toModuleId(id); +/******/ var result = getAffectedStuff(moduleId); +/******/ if(!result) { +/******/ if(options.ignoreUnaccepted) +/******/ continue; +/******/ hotSetStatus("abort"); +/******/ return callback(new Error("Aborted because " + moduleId + " is not accepted")); +/******/ } +/******/ if(result instanceof Error) { +/******/ hotSetStatus("abort"); +/******/ return callback(result); +/******/ } +/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; +/******/ addAllToSet(outdatedModules, result[0]); +/******/ for(var moduleId in result[1]) { +/******/ if(Object.prototype.hasOwnProperty.call(result[1], moduleId)) { +/******/ if(!outdatedDependencies[moduleId]) +/******/ outdatedDependencies[moduleId] = []; +/******/ addAllToSet(outdatedDependencies[moduleId], result[1][moduleId]); +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Store self accepted outdated modules to require them later by the module system +/******/ var outdatedSelfAcceptedModules = []; +/******/ for(var i = 0; i < outdatedModules.length; i++) { +/******/ var moduleId = outdatedModules[i]; +/******/ if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted) +/******/ outdatedSelfAcceptedModules.push({ +/******/ module: moduleId, +/******/ errorHandler: installedModules[moduleId].hot._selfAccepted +/******/ }); +/******/ } +/******/ +/******/ // Now in "dispose" phase +/******/ hotSetStatus("dispose"); +/******/ var queue = outdatedModules.slice(); +/******/ while(queue.length > 0) { +/******/ var moduleId = queue.pop(); +/******/ var module = installedModules[moduleId]; +/******/ if(!module) continue; +/******/ +/******/ var data = {}; +/******/ +/******/ // Call dispose handlers +/******/ var disposeHandlers = module.hot._disposeHandlers; +/******/ for(var j = 0; j < disposeHandlers.length; j++) { +/******/ var cb = disposeHandlers[j]; +/******/ cb(data); +/******/ } +/******/ hotCurrentModuleData[moduleId] = data; +/******/ +/******/ // disable module (this disables requires from this module) +/******/ module.hot.active = false; +/******/ +/******/ // remove module from cache +/******/ delete installedModules[moduleId]; +/******/ +/******/ // remove "parents" references from all children +/******/ for(var j = 0; j < module.children.length; j++) { +/******/ var child = installedModules[module.children[j]]; +/******/ if(!child) continue; +/******/ var idx = child.parents.indexOf(moduleId); +/******/ if(idx >= 0) { +/******/ child.parents.splice(idx, 1); +/******/ } +/******/ } +/******/ } +/******/ +/******/ // remove outdated dependency from module children +/******/ for(var moduleId in outdatedDependencies) { +/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { +/******/ var module = installedModules[moduleId]; +/******/ var moduleOutdatedDependencies = outdatedDependencies[moduleId]; +/******/ for(var j = 0; j < moduleOutdatedDependencies.length; j++) { +/******/ var dependency = moduleOutdatedDependencies[j]; +/******/ var idx = module.children.indexOf(dependency); +/******/ if(idx >= 0) module.children.splice(idx, 1); +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Not in "apply" phase +/******/ hotSetStatus("apply"); +/******/ +/******/ hotCurrentHash = hotUpdateNewHash; +/******/ +/******/ // insert new code +/******/ for(var moduleId in appliedUpdate) { +/******/ if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { +/******/ modules[moduleId] = appliedUpdate[moduleId]; +/******/ } +/******/ } +/******/ +/******/ // call accept handlers +/******/ var error = null; +/******/ for(var moduleId in outdatedDependencies) { +/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { +/******/ var module = installedModules[moduleId]; +/******/ var moduleOutdatedDependencies = outdatedDependencies[moduleId]; +/******/ var callbacks = []; +/******/ for(var i = 0; i < moduleOutdatedDependencies.length; i++) { +/******/ var dependency = moduleOutdatedDependencies[i]; +/******/ var cb = module.hot._acceptedDependencies[dependency]; +/******/ if(callbacks.indexOf(cb) >= 0) continue; +/******/ callbacks.push(cb); +/******/ } +/******/ for(var i = 0; i < callbacks.length; i++) { +/******/ var cb = callbacks[i]; +/******/ try { +/******/ cb(outdatedDependencies); +/******/ } catch(err) { +/******/ if(!error) +/******/ error = err; +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Load self accepted modules +/******/ for(var i = 0; i < outdatedSelfAcceptedModules.length; i++) { +/******/ var item = outdatedSelfAcceptedModules[i]; +/******/ var moduleId = item.module; +/******/ hotCurrentParents = [moduleId]; +/******/ try { +/******/ __webpack_require__(moduleId); +/******/ } catch(err) { +/******/ if(typeof item.errorHandler === "function") { +/******/ try { +/******/ item.errorHandler(err); +/******/ } catch(err) { +/******/ if(!error) +/******/ error = err; +/******/ } +/******/ } else if(!error) +/******/ error = err; +/******/ } +/******/ } +/******/ +/******/ // handle errors in accept handlers and self accepted module load +/******/ if(error) { +/******/ hotSetStatus("fail"); +/******/ return callback(error); +/******/ } +/******/ +/******/ hotSetStatus("idle"); +/******/ callback(null, outdatedModules); +/******/ } + +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false, +/******/ hot: hotCreateModule(moduleId), +/******/ parents: hotCurrentParents, +/******/ children: [] +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "http://localhost:8080/"; + +/******/ // __webpack_hash__ +/******/ __webpack_require__.h = function() { return hotCurrentHash; }; + +/******/ // Load entry module and return exports +/******/ return hotCreateRequire(0)(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + __webpack_require__(1); + __webpack_require__(75); + module.exports = __webpack_require__(77); + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(__resourceQuery) {var url = __webpack_require__(2); + var stripAnsi = __webpack_require__(10); + var socket = __webpack_require__(12); + + function getCurrentScriptSource() { + // `document.currentScript` is the most accurate way to find the current script, + // but is not supported in all browsers. + if(document.currentScript) + return document.currentScript.getAttribute("src"); + // Fall back to getting all scripts in the document. + var scriptElements = document.scripts || []; + var currentScript = scriptElements[scriptElements.length - 1]; + if(currentScript) + return currentScript.getAttribute("src"); + // Fail as there was no script to use. + throw new Error("[WDS] Failed to get current script source"); + } + + var urlParts; + if(true) { + // If this bundle is inlined, use the resource query to get the correct url. + urlParts = url.parse(__resourceQuery.substr(1)); + } else { + // Else, get the url from the