Merge pull request #805 from dotnet-maestro-bot/merge/release/2.2-to-master

[automated] Merge branch 'release/2.2' => 'master'
This commit is contained in:
Ryan Brandenburg 2018-10-25 16:23:28 -07:00 committed by GitHub
commit 89d493bac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 1502 additions and 1250 deletions

View File

@ -5,5 +5,7 @@
},
"[json]": {
"editor.tabSize": 2
}
},
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"javascript.format.insertSpaceAfterConstructor": true
}

View File

@ -7,6 +7,6 @@ param()
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\Custom-Hive.ps1
. $PSScriptRoot\Test-Template.ps1
Test-Template "angular" "angular" "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0.0-alpha1.nupkg" $true

View File

@ -4,6 +4,6 @@
[CmdletBinding(PositionalBinding = $false)]
param()
. $PSScriptRoot\Custom-Hive.ps1
. $PSScriptRoot\Test-Template.ps1
Test-Template "webapp" "webapp -au Individual" "Microsoft.DotNet.Web.ProjectTemplates.3.0.3.0.0-alpha1.nupkg" $false

View File

@ -7,6 +7,6 @@ param()
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\Custom-Hive.ps1
. $PSScriptRoot\Test-Template.ps1
Test-Template "react" "react" "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0.0-alpha1.nupkg" $true

View File

@ -7,6 +7,6 @@ param()
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\Custom-Hive.ps1
. $PSScriptRoot\Test-Template.ps1
Test-Template "reactredux" "reactredux" "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0.0-alpha1.nupkg" $true

View File

@ -7,6 +7,6 @@ param()
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\Custom-Hive.ps1
. $PSScriptRoot\Test-Template.ps1
Test-Template "mvc" "mvc -au Individual" "Microsoft.DotNet.Web.ProjectTemplates.3.0.3.0.0-alpha1.nupkg" $false

View File

@ -1,11 +1,7 @@
$customHive = "$PSScriptRoot/CustomHive"
function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) {
$tmpDir = "$PSScriptRoot/$templateName"
Remove-Item -Path $tmpDir -Recurse -ErrorAction Ignore
Create-Hive
& "$PSScriptRoot/../build.cmd" /t:Package
Run-DotnetNew "--install", "$PSScriptRoot/../artifacts/build/$templateNupkg"
@ -35,31 +31,11 @@ function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) {
}
finally {
Pop-Location
Run-DotnetNew "--debug:reinit"
}
}
function Create-Hive {
Write-Host "Creating custom hive"
Remove-Item -Path $customHive -Force -Recurse -ErrorAction Ignore
New-Item -Path $customHive -ItemType Directory | out-null
Clean-Hive
}
function Clean-Hive() {
$packageArray = Run-DotnetNew "--uninstall"
$packageStr = $packageArray -join [Environment]::NewLine
$packagesStr = ($packageStr -split "Currently installed items:")[1]
$packagesStr = $packagesStr.Trim()
$packages = $packagesStr -split [Environment]::NewLine
foreach ($package in $packages) {
$package = $package.Trim()
Run-DotnetNew "--uninstall", "$package" | out-null
}
Run-DotnetNew "--uninstall" | out-null
}
function Run-DotnetNew($arguments) {
$expression = "dotnet new $arguments --debug:custom-hive $customHive"
$expression = "dotnet new $arguments"
Invoke-Expression $expression
}

View File

@ -34,10 +34,10 @@
#endif*@
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Page1</a>
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Page2</a>
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
</ul>
</div>

View File

@ -34,10 +34,10 @@
#endif*@
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page1</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page2</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>

View File

@ -29,10 +29,10 @@
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page1</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page2</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>

View File

@ -183,9 +183,9 @@
}
},
"@angular/animations": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-6.0.5.tgz",
"integrity": "sha512-zW/qX3CvsuRDOcTNFFSf7uXktvq1jRrfKR8LdGQ/DER1GU3o8pR3z3H8gHy8lAFc3PESfETtzXinKUNzvTDfpA==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/animations/-/animations-6.1.10.tgz",
"integrity": "sha512-dd/lq7kw3uwfHPICan8psu2nthuUpp7PvMLuNIm0XxObZ4oNs0ls6uxKEDPnEkRKoGdiJpvmsyzZZN9ACMPEAA==",
"requires": {
"tslib": "^1.9.0"
}
@ -228,31 +228,31 @@
}
},
"@angular/common": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-6.0.5.tgz",
"integrity": "sha512-xL4Aq+uGQcmHYs90WSKsS9vBC1XO042hM5lSVz+zyYtYzYHdt/Qg1CIuR3zkP+8DG+mf1QZqbg5YtQx5XykmgA==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-6.1.10.tgz",
"integrity": "sha512-73xxTSYJNKfiJ7C1Ajg+sz5l8y+blb/vNgHYg7O3yem5zLBnfPpidJ1UGg4W4d2Y+jwUVJbZKh8SKJarqAJVUQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-6.0.5.tgz",
"integrity": "sha512-Oe0VRCyKfHLatalRuXjCdgaY6hhiMXEL/ueknMJFC0+xA73mEchmLYXj64/1ed753cjnLOM2qbVVwqhc26tmEg==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-6.1.10.tgz",
"integrity": "sha512-FPIb2j3zfoBwb6vo/u0gQeu70h8InGlSisBr3xMACs/35/pwB6kbQR+JQiUr0D7k6QApg7AuMkvq8aFNelg0aw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/compiler-cli": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-6.0.5.tgz",
"integrity": "sha512-onRlVLWo1mTdyxLMRtW4iPntTUglJl9T0hacRlscKKlAUT8jaSfqIyknCF3jEXJrTnfKdypen053U7g2ajifrA==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-6.1.10.tgz",
"integrity": "sha512-GCWdyeNQSnF4RfzO4A0+WHsNEgxKpl5arg4ldLSWMNkj/DrhMD4TnmxhR+IVY+7ieMkUBwpcuWRnjdOdnbmV+w==",
"dev": true,
"requires": {
"chokidar": "^1.4.2",
"minimist": "^1.2.0",
"reflect-metadata": "^0.1.2",
"tsickle": "^0.29.0"
"tsickle": "^0.32.1"
},
"dependencies": {
"anymatch": {
@ -383,25 +383,25 @@
}
},
"@angular/core": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-6.0.5.tgz",
"integrity": "sha512-yG4Qz5wHWgFYOCtX62F8MmJ1wZwZA1ALbyQC+WAZfi7Y8Asx8TShJ+3QKUDYwO1jj530pqNbfauDTCmPzzPvaQ==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-6.1.10.tgz",
"integrity": "sha512-61l3rIQTVdT45eOf6/fBJIeVmV10mcrxqS4N/1OWkuDT29YSJTZSxGcv8QjAyyutuhcqWWpO6gVRkN07rWmkPg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/forms": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-6.0.5.tgz",
"integrity": "sha512-d1SdhAQ/W1n3vtm1lp5y16EaUylcZ2wftLUj6MSne3bH/2MJ6JsxJKwX+MfPcQCo+DCfG5bF0UMCa1KAwUQthQ==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-6.1.10.tgz",
"integrity": "sha512-zAPx2kMV1/FbP5DrY472Sd/ze1m+GS6T5ullZCtP392r62p2RkwzDCXieR51YiRJjZj3M6c3AcRND7PWBdXT7A==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/http": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/http/-/http-6.0.5.tgz",
"integrity": "sha512-N9lx1s1h4wki1ob4qne3FdyAWG3TcCAGnUAjDmZ1+c/hhxtcv0iEJ22nBrGkPIsUxIPXg0JgsD1hKhu5DGEbWg==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/http/-/http-6.1.10.tgz",
"integrity": "sha512-LDsSqyexh8fj23y+G2oSGLWSZVhbxBBo2ehYHnRgH/jlp0pmZVLRaGgUMNSCVtZc1rxLzpEjZjtw+P+qlutAtw==",
"requires": {
"tslib": "^1.9.0"
}
@ -413,44 +413,35 @@
"dev": true
},
"@angular/platform-browser": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-6.0.5.tgz",
"integrity": "sha512-FSsA9C3cJa7S4SPUAhypKlTQf4uA4hiqx/h65v7frDiyRVHv22oWKX7aKmyyb9oP5FHN/TDeQiRn4m8XNqG6AQ==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-6.1.10.tgz",
"integrity": "sha512-CB7pqMwtgb7KjdHDAJlsXcs0rrU+2xQVaoOaqEfJtUrKhtGMLaZh8Qoic5l92SoGattkOw7SYarAOsWlAsVfvw==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/platform-browser-dynamic": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.0.5.tgz",
"integrity": "sha512-TTSLOMVrgRXI29xmBWsnSp8187vbWnbj0YEehuyup2FmltUl+H5Vms7poWV9/6fI3RnW3Yg9Ziv3T5iKqsiADQ==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-6.1.10.tgz",
"integrity": "sha512-DmBSUyFPoyKqkmBXyJ2CrP1oXDioeoBlPA8lmWUDUv2yBuoHIzIkdY/OkTZbdyu/QYa1hK2Jl9OlfoeoenKddg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@angular/platform-server": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@angular/platform-server/-/platform-server-6.0.0.tgz",
"integrity": "sha512-1dmaM3xpayBdZrkpmhPfpJ1CDNntxlizL1td2DMRUfFqMNyE7acbc7vRuV9BOgniPGsMKphYQXczERNfoVeuSw==",
"dev": true,
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/platform-server/-/platform-server-6.1.10.tgz",
"integrity": "sha512-OKcbDJOCYrk+z5BaTbAsunLazlvFZZqOtYKU8zSCVuTGnGRINchO2RxHezS2+npzY1oO1zl1AA47RR59Nxutww==",
"requires": {
"domino": "^2.0.1",
"tslib": "^1.9.0",
"xhr2": "^0.1.4"
},
"dependencies": {
"tslib": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==",
"dev": true
}
}
},
"@angular/router": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-6.0.5.tgz",
"integrity": "sha512-M3cb5CDX+WvkM2xmFeP64zPwLJ6by6cyzl5OCfEQjoTGKOFY7N2B4kHAOw5KJN3nIEd0PersSBgf11Y9g7GPwA==",
"version": "6.1.10",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-6.1.10.tgz",
"integrity": "sha512-tekI3dkdvd65oMoxjjgRA+16uDgPUBWHhYxids6pgO8vobZNtCo8VaVlcDyLUhdmtS5kONELx0iL5E2M0Y2Bag==",
"requires": {
"tslib": "^1.9.0"
}
@ -2527,8 +2518,7 @@
"diff": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
"optional": true
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA=="
},
"diffie-hellman": {
"version": "5.0.3",
@ -2677,10 +2667,9 @@
}
},
"domino": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/domino/-/domino-2.0.2.tgz",
"integrity": "sha512-vzykUakUw5s1p0RrN/vI2sShYo3pLRy/z7PM1PuOIZIlMOJ0XfOnrckGE5f4MxIQVe5XcrH7yG9mR+l77mgLVA==",
"dev": true
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/domino/-/domino-2.1.0.tgz",
"integrity": "sha512-xINSODvrnuQcm3eXJN4IkBR+JxqLrJN8Ge4fd00y1b7HsY0A4huKN5BflSS/oo8quBWmocTfWdFvrw2H8TjGqQ=="
},
"domutils": {
"version": "1.5.1",
@ -5474,6 +5463,15 @@
"integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=",
"dev": true
},
"jasmine-diff": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/jasmine-diff/-/jasmine-diff-0.1.3.tgz",
"integrity": "sha1-k8zC3MQQKMXd1GBlWAdIOfLe6qg=",
"dev": true,
"requires": {
"diff": "^3.2.0"
}
},
"jasmine-spec-reporter": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz",
@ -5489,6 +5487,11 @@
"integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=",
"optional": true
},
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg=="
},
"js-base64": {
"version": "2.4.9",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.9.tgz",
@ -7217,6 +7220,11 @@
}
}
},
"popper.js": {
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.4.tgz",
"integrity": "sha1-juwdj/AqWjoVLdQ0FKFce3n9abY="
},
"portfinder": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz",
@ -7558,9 +7566,9 @@
"dev": true
},
"randomatic": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz",
"integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
"integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==",
"dev": true,
"requires": {
"is-number": "^4.0.0",
@ -9236,11 +9244,12 @@
}
},
"tsickle": {
"version": "0.29.0",
"resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.29.0.tgz",
"integrity": "sha512-JpID0Lv8/irRtPmqJJxb5fCwfZhjZeKmav9Zna7UjqVuJoSbI49Wue/c2PPybX1SbRrjl7bbI/JsCl0dSUJygA==",
"version": "0.32.1",
"resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.32.1.tgz",
"integrity": "sha512-JW9j+W0SaMSZGejIFZBk0AiPfnhljK3oLx5SaqxrJhjlvzFyPml5zqG1/PuScUj6yTe1muEqwk5CnDK0cOZmKw==",
"dev": true,
"requires": {
"jasmine-diff": "^0.1.3",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"source-map": "^0.6.0",
@ -9254,9 +9263,9 @@
"dev": true
},
"source-map-support": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
"integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
"version": "0.5.9",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz",
"integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
@ -10233,8 +10242,7 @@
"xhr2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz",
"integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=",
"dev": true
"integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8="
},
"xml2js": {
"version": "0.4.19",

View File

@ -12,28 +12,30 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"@angular/animations": "6.1.10",
"@angular/common": "6.1.10",
"@angular/compiler": "6.1.10",
"@angular/core": "6.1.10",
"@angular/forms": "6.1.10",
"@angular/http": "6.1.10",
"@angular/platform-browser": "6.1.10",
"@angular/platform-browser-dynamic": "6.1.10",
"@angular/platform-server": "6.1.10",
"@angular/router": "6.1.10",
"@nguniversal/module-map-ngfactory-loader": "6.0.0",
"core-js": "^2.5.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26",
"aspnet-prerendering": "^3.0.1",
"bootstrap": "^4.1.3"
"bootstrap": "^4.1.3",
"jquery": "3.3.1",
"popper.js": "^1.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.0",
"@angular/cli": "~6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/compiler-cli": "6.1.10",
"@angular/language-service": "^6.0.0",
"@angular/platform-server": "6.0.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",

View File

@ -8,4 +8,4 @@ import { AppModule } from './app.module';
imports: [AppModule, ServerModule, ModuleMapLoaderModule],
bootstrap: [AppComponent]
})
export class AppServerModule { }
export class AppServerModule { }

View File

@ -28,4 +28,4 @@ module.exports = function (config) {
browsers: ['Chrome'],
singleRun: false
});
};
};

View File

@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"bootstrap": "^4.1.3",
"jquery": "^3.3.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-router-bootstrap": "^0.24.4",
@ -12,10 +13,25 @@
"reactstrap": "^6.3.0",
"rimraf": "^2.6.2"
},
"devDependencies": {
"ajv": "^6.0.0",
"babel-eslint": "^7.2.3",
"cross-env": "^5.2.0",
"eslint": "^4.1.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.11.1"
},
"eslintConfig": {
"extends": "react-app"
},
"scripts": {
"start": "rimraf ./build && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"test": "cross-env CI=true react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint": "eslint ./src/"
}
}

View File

@ -6,9 +6,9 @@ import { FetchData } from './components/FetchData';
import { Counter } from './components/Counter';
export default class App extends Component {
displayName = App.name
static displayName = App.name;
render() {
render () {
return (
<Layout>
<Route exact path='/' component={Home} />

View File

@ -1,21 +1,21 @@
import React, { Component } from 'react';
export class Counter extends Component {
displayName = Counter.name
static displayName = Counter.name;
constructor(props) {
constructor (props) {
super(props);
this.state = { currentCount: 0 };
this.incrementCounter = this.incrementCounter.bind(this);
}
incrementCounter() {
incrementCounter () {
this.setState({
currentCount: this.state.currentCount + 1
});
}
render() {
render () {
return (
<div>
<h1>Counter</h1>

View File

@ -1,9 +1,9 @@
import React, { Component } from 'react';
export class FetchData extends Component {
displayName = FetchData.name
static displayName = FetchData.name;
constructor(props) {
constructor (props) {
super(props);
this.state = { forecasts: [], loading: true };
@ -14,7 +14,7 @@ export class FetchData extends Component {
});
}
static renderForecastsTable(forecasts) {
static renderForecastsTable (forecasts) {
return (
<table className='table table-striped'>
<thead>
@ -39,7 +39,7 @@ export class FetchData extends Component {
);
}
render() {
render () {
let contents = this.state.loading
? <p><em>Loading...</em></p>
: FetchData.renderForecastsTable(this.state.forecasts);

View File

@ -1,9 +1,9 @@
import React, { Component } from 'react';
export class Home extends Component {
displayName = Home.name
static displayName = Home.name;
render() {
render () {
return (
<div>
<h1>Hello, world!</h1>
@ -13,7 +13,7 @@ export class Home extends Component {
<li><a href='https://facebook.github.io/react/'>React</a> for client-side code</li>
<li><a href='http://getbootstrap.com/'>Bootstrap</a> for layout and styling</li>
</ul>
<p>To help you get started, we've also set up:</p>
<p>To help you get started, we have also set up:</p>
<ul>
<li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li>
<li><strong>Development server integration</strong>. In development mode, the development server from <code>create-react-app</code> runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.</li>

View File

@ -3,9 +3,9 @@ import { Container } from 'reactstrap';
import { NavMenu } from './NavMenu';
export class Layout extends Component {
displayName = Layout.name
static displayName = Layout.name;
render() {
render () {
return (
<div>
<NavMenu />

View File

@ -1,12 +1,12 @@
import React, { Component } from 'react';
import React, { Component } from 'react';
import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import { Link } from 'react-router-dom';
import './NavMenu.css';
export class NavMenu extends Component {
displayName = NavMenu.name
static displayName = NavMenu.name;
constructor(props) {
constructor (props) {
super(props);
this.toggleNavbar = this.toggleNavbar.bind(this);
@ -15,13 +15,13 @@ export class NavMenu extends Component {
};
}
toggleNavbar() {
toggleNavbar () {
this.setState({
collapsed: !this.state.collapsed
});
}
render() {
render () {
return (
<header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" light>

View File

@ -10,15 +10,15 @@
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export default function register() {
export default function register () {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
@ -43,7 +43,7 @@ export default function register() {
}
}
function registerValidSW(swUrl) {
function registerValidSW (swUrl) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
@ -72,7 +72,7 @@ function registerValidSW(swUrl) {
});
}
function checkValidServiceWorker(swUrl) {
function checkValidServiceWorker (swUrl) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
@ -99,7 +99,7 @@ function checkValidServiceWorker(swUrl) {
});
}
export function unregister() {
export function unregister () {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();

View File

@ -219,14 +219,15 @@
"integrity": "sha512-z55ocwKBRLryBs394Sm3ushTtBeg6VAeuku7utSoSnsJKvKcnXFIyC6vh27n3rXyxSgkJBBCAvyOn7gSUcTYjg=="
},
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"version": "6.5.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz",
"integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==",
"dev": true,
"requires": {
"co": "^4.6.0",
"fast-deep-equal": "^1.0.0",
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0"
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-keywords": {
@ -2242,11 +2243,6 @@
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
},
"co": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
},
"coa": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/coa/-/coa-1.0.4.tgz",
@ -2415,7 +2411,8 @@
"contains-path": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo="
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
"dev": true
},
"content-disposition": {
"version": "0.5.2",
@ -2533,6 +2530,31 @@
"sha.js": "^2.4.8"
}
},
"cross-env": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz",
"integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.5",
"is-windows": "^1.0.0"
},
"dependencies": {
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
}
}
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
@ -3359,7 +3381,6 @@
"resolved": "https://registry.npmjs.org/eslint/-/eslint-4.10.0.tgz",
"integrity": "sha512-MMVl8P/dYUFZEvolL8PYt7qc5LNdS2lwheq9BYa5Y07FblhcZqFyaUqlS8TW5QITGex21tV4Lk0a3fK8lsJIkA==",
"requires": {
"ajv": "^5.2.0",
"babel-code-frame": "^6.22.0",
"chalk": "^2.1.0",
"concat-stream": "^1.6.0",
@ -3454,6 +3475,7 @@
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
"integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
"dev": true,
"requires": {
"debug": "^2.6.9",
"resolve": "^1.5.0"
@ -3475,6 +3497,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz",
"integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=",
"dev": true,
"requires": {
"debug": "^2.6.8",
"pkg-dir": "^1.0.0"
@ -3484,6 +3507,7 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"dev": true,
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
@ -3493,6 +3517,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"dev": true,
"requires": {
"pinkie-promise": "^2.0.0"
}
@ -3501,6 +3526,7 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
"integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
"dev": true,
"requires": {
"find-up": "^1.0.0"
}
@ -3508,34 +3534,37 @@
}
},
"eslint-plugin-flowtype": {
"version": "2.39.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.39.1.tgz",
"integrity": "sha512-RiQv+7Z9QDJuzt+NO8sYgkLGT+h+WeCrxP7y8lI7wpU41x3x/2o3PGtHk9ck8QnA9/mlbNcy/hG0eKvmd7npaA==",
"version": "2.50.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.3.tgz",
"integrity": "sha512-X+AoKVOr7Re0ko/yEXyM5SSZ0tazc6ffdIOocp2fFUlWoDt7DV0Bz99mngOkAFLOAWjqRA5jPwqUCbrx13XoxQ==",
"dev": true,
"requires": {
"lodash": "^4.15.0"
"lodash": "^4.17.10"
}
},
"eslint-plugin-import": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz",
"integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==",
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz",
"integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==",
"dev": true,
"requires": {
"builtin-modules": "^1.1.1",
"contains-path": "^0.1.0",
"debug": "^2.6.8",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.1",
"eslint-module-utils": "^2.1.1",
"eslint-module-utils": "^2.2.0",
"has": "^1.0.1",
"lodash.cond": "^4.3.0",
"lodash": "^4.17.4",
"minimatch": "^3.0.3",
"read-pkg-up": "^2.0.0"
"read-pkg-up": "^2.0.0",
"resolve": "^1.6.0"
},
"dependencies": {
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "^2.0.2",
"isarray": "^1.0.0"
@ -3544,12 +3573,14 @@
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
"load-json-file": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
@ -3561,6 +3592,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"dev": true,
"requires": {
"error-ex": "^1.2.0"
}
@ -3569,19 +3601,22 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
"dev": true,
"requires": {
"pify": "^2.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
},
"read-pkg": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
"dev": true,
"requires": {
"load-json-file": "^2.0.0",
"normalize-package-data": "^2.3.2",
@ -3592,6 +3627,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
"dev": true,
"requires": {
"find-up": "^2.0.0",
"read-pkg": "^2.0.0"
@ -3614,23 +3650,36 @@
}
},
"eslint-plugin-react": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz",
"integrity": "sha512-tvjU9u3VqmW2vVuYnE8Qptq+6ji4JltjOjJ9u7VAOxVYkUkyBZWRvNYKbDv5fN+L6wiA+4we9+qQahZ0m63XEA==",
"version": "7.11.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz",
"integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==",
"dev": true,
"requires": {
"doctrine": "^2.0.0",
"has": "^1.0.1",
"jsx-ast-utils": "^2.0.0",
"prop-types": "^15.5.10"
"array-includes": "^3.0.3",
"doctrine": "^2.1.0",
"has": "^1.0.3",
"jsx-ast-utils": "^2.0.1",
"prop-types": "^15.6.2"
},
"dependencies": {
"jsx-ast-utils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
"integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
"dev": true,
"requires": {
"array-includes": "^3.0.3"
}
},
"prop-types": {
"version": "15.6.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
"integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==",
"dev": true,
"requires": {
"loose-envify": "^1.3.1",
"object-assign": "^4.1.1"
}
}
}
},
@ -3888,9 +3937,10 @@
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
},
"fast-json-stable-stringify": {
"version": "2.0.0",
@ -4156,11 +4206,13 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true
"bundled": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4173,15 +4225,18 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true
"bundled": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -4284,7 +4339,8 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true
"bundled": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -4294,6 +4350,7 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4306,17 +4363,20 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true
"bundled": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -4333,6 +4393,7 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4405,7 +4466,8 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true
"bundled": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -4415,6 +4477,7 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4520,6 +4583,7 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -4814,7 +4878,6 @@
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz",
"integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==",
"requires": {
"ajv": "^5.3.0",
"har-schema": "^2.0.0"
}
},
@ -6103,9 +6166,10 @@
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
"integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"json-stable-stringify": {
"version": "1.0.1",
@ -6316,11 +6380,6 @@
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
"integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY="
},
"lodash.cond": {
"version": "4.5.2",
"resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz",
"integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU="
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
@ -6799,6 +6858,12 @@
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"no-case": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
@ -8915,10 +8980,7 @@
"eslint": "4.10.0",
"eslint-config-react-app": "^2.1.0",
"eslint-loader": "1.9.0",
"eslint-plugin-flowtype": "2.39.1",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-react": "7.4.0",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"fs-extra": "3.0.1",
@ -9478,10 +9540,7 @@
"schema-utils": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz",
"integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=",
"requires": {
"ajv": "^5.0.0"
}
"integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8="
},
"select-hose": {
"version": "2.0.0",
@ -10770,7 +10829,6 @@
"requires": {
"acorn": "^5.0.0",
"acorn-dynamic-import": "^2.0.0",
"ajv": "^5.1.5",
"ajv-keywords": "^2.0.0",
"async": "^2.1.2",
"enhanced-resolve": "^3.4.0",

View File

@ -16,10 +16,25 @@
"redux-thunk": "^2.2.0",
"rimraf": "^2.6.2"
},
"devDependencies": {
"ajv": "^6.0.0",
"babel-eslint": "^7.2.3",
"cross-env": "^5.2.0",
"eslint": "^4.1.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.11.1"
},
"eslintConfig": {
"extends": "react-app"
},
"scripts": {
"start": "rimraf ./build && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"test": "cross-env CI=true react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint": "eslint ./src/"
}
}

View File

@ -1,4 +1,4 @@
import React from 'react';
import React from 'react';
import { Route } from 'react-router';
import Layout from './components/Layout';
import Home from './components/Home';

View File

@ -1,10 +1,10 @@
import React from 'react';
import React from 'react';
import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import { Link } from 'react-router-dom';
import './NavMenu.css';
export default class NavMenu extends React.Component {
constructor(props) {
constructor (props) {
super(props);
this.toggle = this.toggle.bind(this);
@ -12,12 +12,12 @@ export default class NavMenu extends React.Component {
isOpen: false
};
}
toggle() {
toggle () {
this.setState({
isOpen: !this.state.isOpen
});
}
render() {
render () {
return (
<header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm border-bottom box-shadow mb-3" light >

View File

@ -1,4 +1,4 @@
const incrementCountType = 'INCREMENT_COUNT';
const incrementCountType = 'INCREMENT_COUNT';
const decrementCountType = 'DECREMENT_COUNT';
const initialState = { count: 0 };

View File

@ -1,9 +1,9 @@
const requestWeatherForecastsType = 'REQUEST_WEATHER_FORECASTS';
const requestWeatherForecastsType = 'REQUEST_WEATHER_FORECASTS';
const receiveWeatherForecastsType = 'RECEIVE_WEATHER_FORECASTS';
const initialState = { forecasts: [], isLoading: false };
export const actionCreators = {
requestWeatherForecasts: startDateIndex => async (dispatch, getState) => {
requestWeatherForecasts: startDateIndex => async (dispatch, getState) => {
if (startDateIndex === getState().weatherForecasts.startDateIndex) {
// Don't issue a duplicate request (we already have or are loading the requested data)
return;

View File

@ -1,10 +1,10 @@
import { applyMiddleware, combineReducers, compose, createStore } from 'redux';
import { applyMiddleware, combineReducers, compose, createStore } from 'redux';
import thunk from 'redux-thunk';
import { routerReducer, routerMiddleware } from 'react-router-redux';
import * as Counter from './Counter';
import * as WeatherForecasts from './WeatherForecasts';
export default function configureStore(history, initialState) {
export default function configureStore (history, initialState) {
const reducers = {
counter: Counter.reducer,
weatherForecasts: WeatherForecasts.reducer

View File

@ -1,7 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
@ -19,7 +21,7 @@ namespace Templates.Test
[Theory]
[InlineData("Microsoft.DotNet.Web.ProjectTemplates")]
[InlineData("Microsoft.DotNet.Web.Spa.ProjectTemplates")]
public void CheckForByteOrderMark_InJsonFiles_ForAllTemplates(string projectType)
public void CheckForByteOrderMark_ForAllTemplates(string projectType)
{
var currentDirectory = Directory.GetCurrentDirectory();
var repositoryPath = Directory.GetParent(currentDirectory).Parent.Parent.Parent.Parent.FullName;
@ -30,7 +32,8 @@ namespace Templates.Test
var filesWithBOMCharactersPresent = false;
foreach (var directory in directories)
{
var files = Directory.GetFiles(directory, "*.json");
var files = (IEnumerable<string>)Directory.GetFiles(directory, "*.json");
files = files.Concat(Directory.GetFiles(directory, "*.js"));
foreach (var file in files)
{
var filePath = Path.GetFullPath(file);

View File

@ -60,5 +60,14 @@ namespace Templates.Test.Helpers
ProcessEx.RunViaShell(output, workingDirectory, "npm install");
}
}
public static void Test(ITestOutputHelper outputHelper, string workingDirectory)
{
ProcessEx.RunViaShell(outputHelper, workingDirectory, "npm run lint");
if (!File.Exists(Path.Join(workingDirectory, "angular.json")))
{
ProcessEx.RunViaShell(outputHelper, workingDirectory, "npm run test");
}
}
}
}

View File

@ -36,14 +36,10 @@ namespace Templates.Test.SpaTemplateTest
// installs run concurrently which otherwise causes errors when tests run
// in parallel.
var clientAppSubdirPath = Path.Combine(TemplateOutputDir, "ClientApp");
if (File.Exists(Path.Combine(clientAppSubdirPath, "package.json")))
{
Npm.RestoreWithRetry(Output, clientAppSubdirPath);
}
else if (File.Exists(Path.Combine(TemplateOutputDir, "package.json")))
{
Npm.RestoreWithRetry(Output, TemplateOutputDir);
}
Assert.True(File.Exists(Path.Combine(clientAppSubdirPath, "package.json")), "Missing a package.json");
Npm.RestoreWithRetry(Output, clientAppSubdirPath);
Npm.Test(Output, clientAppSubdirPath);
TestApplication(targetFrameworkOverride, publish: false);
TestApplication(targetFrameworkOverride, publish: true);