mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 10:40:23 +00:00
Compare commits
1 Commits
angular2-l
...
angular2-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b60cdae77 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -13,6 +13,7 @@ PublishProfiles/
|
|||||||
*.docstates
|
*.docstates
|
||||||
_ReSharper.*
|
_ReSharper.*
|
||||||
nuget.exe
|
nuget.exe
|
||||||
|
project.lock.json
|
||||||
*net45.csproj
|
*net45.csproj
|
||||||
*net451.csproj
|
*net451.csproj
|
||||||
*k10.csproj
|
*k10.csproj
|
||||||
@@ -36,7 +37,4 @@ npm-debug.log
|
|||||||
/templates/*/node_modules/
|
/templates/*/node_modules/
|
||||||
/templates/*/wwwroot/dist/
|
/templates/*/wwwroot/dist/
|
||||||
/templates/*/ClientApp/dist/
|
/templates/*/ClientApp/dist/
|
||||||
/templates/*/yarn.lock
|
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
/templates/*/Properties/launchSettings.json
|
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ addons:
|
|||||||
- libssl-dev
|
- libssl-dev
|
||||||
- libunwind8
|
- libunwind8
|
||||||
- zlib1g
|
- zlib1g
|
||||||
mono: none
|
mono:
|
||||||
|
- 4.0.5
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
osx_image: xcode7.1
|
osx_image: xcode7.1
|
||||||
script:
|
script:
|
||||||
- ./build.sh
|
- ./build.sh verify
|
||||||
|
|||||||
@@ -1,68 +1,50 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 14
|
||||||
VisualStudioVersion = 15.0.26228.4
|
VisualStudioVersion = 14.0.25123.0
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{27304DDE-AFB2-4F8B-B765-E3E2F11E886C}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E6E88944-4800-40BA-8AF5-069EA3ADFEB8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices", "src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.csproj", "{66B77203-1469-41DF-92F2-2BE6900BD36F}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.NodeServices", "src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.xproj", "{B0FA4175-8B29-4904-9780-28B3C24B0567}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices.Sockets", "src\Microsoft.AspNetCore.NodeServices.Sockets\Microsoft.AspNetCore.NodeServices.Sockets.csproj", "{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NodeServicesExamples", "samples\misc\NodeServicesExamples\NodeServicesExamples.xproj", "{6D4BCDD6-7951-449B-BE55-CB7F014B7430}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices", "src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.csproj", "{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{78DAC76C-1092-45AB-BF0D-594B8C7B6569}"
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.AngularServices", "src\Microsoft.AspNetCore.AngularServices\Microsoft.AspNetCore.AngularServices.csproj", "{58AAABB6-9D21-42F6-BC97-3DD282B55FD6}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.ReactServices", "src\Microsoft.AspNetCore.ReactServices\Microsoft.AspNetCore.ReactServices.csproj", "{F1081B9A-8D67-4A5E-80C6-615F9A975D4F}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{99EAF1FE-22C8-4526-BE78-74B24125D37F}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitignore = .gitignore
|
|
||||||
global.json = global.json
|
global.json = global.json
|
||||||
README.md = README.md
|
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{23836492-E7F4-4376-85BF-A635C304AC46}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\angular\MusicStore\MusicStore.xproj", "{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{E6A161EA-646C-4033-9090-95BE809AB8D9}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactGrid", "samples\react\ReactGrid\ReactGrid.xproj", "{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.csproj", "{1931B19A-EC42-4D56-B2D0-FB06D17244DA}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.AngularServices", "src\Microsoft.AspNetCore.AngularServices\Microsoft.AspNetCore.AngularServices.xproj", "{421807E6-B62C-417B-B901-46C5DEDAA8F1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webpack", "samples\misc\Webpack\Webpack.csproj", "{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.ReactServices", "src\Microsoft.AspNetCore.ReactServices\Microsoft.AspNetCore.ReactServices.xproj", "{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NodeServicesExamples", "samples\misc\NodeServicesExamples\NodeServicesExamples.csproj", "{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.SpaServices", "src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.xproj", "{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "angular", "angular", "{B54435EB-D5E8-4CEC-A02E-DDCB0C750E34}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{727E6D58-6830-4792-96C6-E138A33959FB}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicStore", "samples\angular\MusicStore\MusicStore.csproj", "{63FC66E7-559B-4426-93E1-2D951EFC8293}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Angular2Spa", "templates\Angular2Spa\Angular2Spa.xproj", "{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "react", "react", "{BD77E73E-13BC-4550-99DA-51869BD8DFC4}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactReduxSpa", "templates\ReactReduxSpa\ReactReduxSpa.xproj", "{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactGrid", "samples\react\ReactGrid\ReactGrid.csproj", "{3B023106-88DB-4C3A-B01F-C1AECB02D80B}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactSpa", "templates\ReactSpa\ReactSpa.xproj", "{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicStore", "samples\react\MusicStore\MusicStore.csproj", "{6E898586-79CA-4AA8-946E-943B3682F376}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.xproj", "{CB4398D6-B7F1-449A-AE02-828769679232}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{1598B415-73F1-4B37-B3B4-0A10677ABB2D}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{E0771531-BE20-40CD-A1B0-A57E09511060}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KnockoutSpa", "templates\KnockoutSpa\KnockoutSpa.csproj", "{F60248B1-940E-43FB-BEA0-589362AA6320}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Webpack", "samples\misc\Webpack\Webpack.xproj", "{A8905301-8492-42FD-9E83-F715A0FDC3A2}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Angular2Spa", "templates\Angular2Spa\Angular2Spa.csproj", "{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.xproj", "{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AureliaSpa", "templates\AureliaSpa\AureliaSpa.csproj", "{4D57B6E1-7141-48ED-959E-872BDD4A2F72}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "React", "React", "{E0EBA813-4478-4C02-B11D-FB3793113FE4}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactSpa", "templates\ReactSpa\ReactSpa.csproj", "{868A630E-C61B-4807-B7A8-7EB53BE1C28A}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\react\MusicStore\MusicStore.xproj", "{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactReduxSpa", "templates\ReactReduxSpa\ReactReduxSpa.csproj", "{9D4D15A1-A25B-44EC-AB63-F1CE9986712E}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Angular", "Angular", "{4867A616-83D6-48DC-964D-6AE743596631}"
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.csproj", "{86911E07-C733-4C18-B49F-9A007A651246}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E415FE14-13B0-469F-836D-95059E6BAA6E}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
src\build\common.props = src\build\common.props
|
|
||||||
src\build\Key.snk = src\build\Key.snk
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VueSpa", "templates\VueSpa\VueSpa.csproj", "{49D7665A-20EC-43FC-B8E8-EA0204F2D8C3}"
|
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -70,104 +52,79 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{66B77203-1469-41DF-92F2-2BE6900BD36F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{66B77203-1469-41DF-92F2-2BE6900BD36F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{66B77203-1469-41DF-92F2-2BE6900BD36F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{66B77203-1469-41DF-92F2-2BE6900BD36F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Release|Any CPU.Build.0 = Release|Any CPU
|
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Release|Any CPU.Build.0 = Release|Any CPU
|
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{63FC66E7-559B-4426-93E1-2D951EFC8293}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{63FC66E7-559B-4426-93E1-2D951EFC8293}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{63FC66E7-559B-4426-93E1-2D951EFC8293}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{63FC66E7-559B-4426-93E1-2D951EFC8293}.Release|Any CPU.Build.0 = Release|Any CPU
|
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{6E898586-79CA-4AA8-946E-943B3682F376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{6E898586-79CA-4AA8-946E-943B3682F376}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6E898586-79CA-4AA8-946E-943B3682F376}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6E898586-79CA-4AA8-946E-943B3682F376}.Release|Any CPU.Build.0 = Release|Any CPU
|
{CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F60248B1-940E-43FB-BEA0-589362AA6320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{F60248B1-940E-43FB-BEA0-589362AA6320}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{F60248B1-940E-43FB-BEA0-589362AA6320}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F60248B1-940E-43FB-BEA0-589362AA6320}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{86911E07-C733-4C18-B49F-9A007A651246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{86911E07-C733-4C18-B49F-9A007A651246}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{86911E07-C733-4C18-B49F-9A007A651246}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{86911E07-C733-4C18-B49F-9A007A651246}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{49D7665A-20EC-43FC-B8E8-EA0204F2D8C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{49D7665A-20EC-43FC-B8E8-EA0204F2D8C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{49D7665A-20EC-43FC-B8E8-EA0204F2D8C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{49D7665A-20EC-43FC-B8E8-EA0204F2D8C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{66B77203-1469-41DF-92F2-2BE6900BD36F} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
|
{6D4BCDD6-7951-449B-BE55-CB7F014B7430} = {E0771531-BE20-40CD-A1B0-A57E09511060}
|
||||||
{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
|
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B} = {4867A616-83D6-48DC-964D-6AE743596631}
|
||||||
{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
|
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B} = {E0EBA813-4478-4C02-B11D-FB3793113FE4}
|
||||||
{58AAABB6-9D21-42F6-BC97-3DD282B55FD6} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
|
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11} = {727E6D58-6830-4792-96C6-E138A33959FB}
|
||||||
{F1081B9A-8D67-4A5E-80C6-615F9A975D4F} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
|
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3} = {727E6D58-6830-4792-96C6-E138A33959FB}
|
||||||
{E6A161EA-646C-4033-9090-95BE809AB8D9} = {23836492-E7F4-4376-85BF-A635C304AC46}
|
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387} = {727E6D58-6830-4792-96C6-E138A33959FB}
|
||||||
{1931B19A-EC42-4D56-B2D0-FB06D17244DA} = {E6A161EA-646C-4033-9090-95BE809AB8D9}
|
{CB4398D6-B7F1-449A-AE02-828769679232} = {727E6D58-6830-4792-96C6-E138A33959FB}
|
||||||
{DE479DC3-1461-4EAD-A188-4AF7AA4AE344} = {E6A161EA-646C-4033-9090-95BE809AB8D9}
|
{E0771531-BE20-40CD-A1B0-A57E09511060} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8}
|
||||||
{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE} = {E6A161EA-646C-4033-9090-95BE809AB8D9}
|
{A8905301-8492-42FD-9E83-F715A0FDC3A2} = {E0771531-BE20-40CD-A1B0-A57E09511060}
|
||||||
{B54435EB-D5E8-4CEC-A02E-DDCB0C750E34} = {23836492-E7F4-4376-85BF-A635C304AC46}
|
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A} = {E0771531-BE20-40CD-A1B0-A57E09511060}
|
||||||
{63FC66E7-559B-4426-93E1-2D951EFC8293} = {B54435EB-D5E8-4CEC-A02E-DDCB0C750E34}
|
{E0EBA813-4478-4C02-B11D-FB3793113FE4} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8}
|
||||||
{BD77E73E-13BC-4550-99DA-51869BD8DFC4} = {23836492-E7F4-4376-85BF-A635C304AC46}
|
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C} = {E0EBA813-4478-4C02-B11D-FB3793113FE4}
|
||||||
{3B023106-88DB-4C3A-B01F-C1AECB02D80B} = {BD77E73E-13BC-4550-99DA-51869BD8DFC4}
|
{4867A616-83D6-48DC-964D-6AE743596631} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8}
|
||||||
{6E898586-79CA-4AA8-946E-943B3682F376} = {BD77E73E-13BC-4550-99DA-51869BD8DFC4}
|
|
||||||
{F60248B1-940E-43FB-BEA0-589362AA6320} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
{4D57B6E1-7141-48ED-959E-872BDD4A2F72} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
{868A630E-C61B-4807-B7A8-7EB53BE1C28A} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
{9D4D15A1-A25B-44EC-AB63-F1CE9986712E} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
{86911E07-C733-4C18-B49F-9A007A651246} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
{E415FE14-13B0-469F-836D-95059E6BAA6E} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
|
|
||||||
{49D7665A-20EC-43FC-B8E8-EA0204F2D8C3} = {1598B415-73F1-4B37-B3B4-0A10677ABB2D}
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<packageSources>
|
|
||||||
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
|
|
||||||
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
|
|
||||||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
|
||||||
</packageSources>
|
|
||||||
</configuration>
|
|
||||||
8
NuGet.master.config
Executable file
8
NuGet.master.config
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<clear />
|
||||||
|
<add key="AspNetVNext" value="https://www.myget.org/f/aspnetmaster/api/v3/index.json" />
|
||||||
|
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
# JavaScriptServices
|
# JavaScriptServices
|
||||||
|
|
||||||
AppVeyor: [](https://ci.appveyor.com/project/aspnetci/javascriptservices/branch/dev)
|
|
||||||
|
|
||||||
This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.
|
This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.
|
||||||
|
|
||||||
## What is this?
|
## What is this?
|
||||||
|
|||||||
44
appveyor.yml
44
appveyor.yml
@@ -1,47 +1,7 @@
|
|||||||
init:
|
init:
|
||||||
- git config --global core.autocrlf true
|
- git config --global core.autocrlf true
|
||||||
install:
|
|
||||||
- ps: Install-Product node 6.9.2 x64
|
|
||||||
# .NET Core SDK binaries
|
|
||||||
# Download .NET Core SDK and add to PATH
|
|
||||||
- ps: $urlCurrent = "https://go.microsoft.com/fwlink/?LinkID=834991"
|
|
||||||
- ps: $urlPreview = "https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.zip"
|
|
||||||
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
|
|
||||||
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
|
|
||||||
- ps: $tempFileCurrent = [System.IO.Path]::GetTempFileName()
|
|
||||||
- ps: $tempFilePreview = [System.IO.Path]::GetTempFileName()
|
|
||||||
- ps: (New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent)
|
|
||||||
- ps: (New-Object System.Net.WebClient).DownloadFile($urlPreview, $tempFilePreview)
|
|
||||||
- ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR)
|
|
||||||
- ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFilePreview, $env:DOTNET_INSTALL_DIR + "preview")
|
|
||||||
- ps: Copy-Item "${env:DOTNET_INSTALL_DIR}preview\*" "${env:DOTNET_INSTALL_DIR}" -Force -Recurse
|
|
||||||
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
|
|
||||||
build_script:
|
build_script:
|
||||||
- ps: Push-Location
|
- build.cmd verify
|
||||||
- cd templates/package-builder
|
|
||||||
- npm install
|
|
||||||
- npm run build
|
|
||||||
- ps: Pop-Location
|
|
||||||
artifacts:
|
|
||||||
- path: templates\package-builder\dist\artifacts\generator-aspnetcore-spa.tar.gz
|
|
||||||
name: generator-aspnetcore-spa
|
|
||||||
- path: templates\package-builder\dist\artifacts\*.nupkg
|
|
||||||
name: Microsoft.AspNetCore.SpaTemplates
|
|
||||||
type: NuGetPackage
|
|
||||||
# - ps: .\build.ps1
|
|
||||||
clone_depth: 1
|
clone_depth: 1
|
||||||
test_script:
|
test: off
|
||||||
# - dotnet restore ./src
|
|
||||||
# - npm install -g selenium-standalone
|
|
||||||
# - selenium-standalone install
|
|
||||||
# The nosys flag is needed for selenium to work on Appveyor
|
|
||||||
# - ps: Start-Process selenium-standalone 'start','--','-Djna.nosys=true'
|
|
||||||
# - ps: Push-Location
|
|
||||||
# - cd test
|
|
||||||
# - npm install
|
|
||||||
# - npm test
|
|
||||||
on_finish :
|
|
||||||
# - ps: Pop-Location
|
|
||||||
# After running tests, upload results to Appveyor
|
|
||||||
# - ps: (new-object net.webclient).UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\tmp\junit\*.xml))
|
|
||||||
deploy: off
|
deploy: off
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ cd $PSScriptRoot
|
|||||||
$repoFolder = $PSScriptRoot
|
$repoFolder = $PSScriptRoot
|
||||||
$env:REPO_FOLDER = $repoFolder
|
$env:REPO_FOLDER = $repoFolder
|
||||||
|
|
||||||
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
|
$koreBuildZip="https://codeload.github.com/aspnet/KoreBuild/zip/stevesa/npm-in-series"
|
||||||
if ($env:KOREBUILD_ZIP)
|
if ($env:KOREBUILD_ZIP)
|
||||||
{
|
{
|
||||||
$koreBuildZip=$env:KOREBUILD_ZIP
|
$koreBuildZip=$env:KOREBUILD_ZIP
|
||||||
@@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&"$buildFile" @args
|
&"$buildFile" $args
|
||||||
2
build.sh
2
build.sh
@@ -2,7 +2,7 @@
|
|||||||
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
cd $repoFolder
|
cd $repoFolder
|
||||||
|
|
||||||
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
|
koreBuildZip="https://codeload.github.com/aspnet/KoreBuild/zip/stevesa/npm-in-series"
|
||||||
if [ ! -z $KOREBUILD_ZIP ]; then
|
if [ ! -z $KOREBUILD_ZIP ]; then
|
||||||
koreBuildZip=$KOREBUILD_ZIP
|
koreBuildZip=$KOREBUILD_ZIP
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
<Project>
|
|
||||||
|
|
||||||
<Import Project="dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Product>Microsoft ASP.NET Core</Product>
|
|
||||||
<RepositoryUrl>https://github.com/aspnet/javascriptservices</RepositoryUrl>
|
|
||||||
<RepositoryType>git</RepositoryType>
|
|
||||||
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Key.snk</AssemblyOriginatorKeyFile>
|
|
||||||
<SignAssembly>true</SignAssembly>
|
|
||||||
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
|
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Internal.AspNetCore.Sdk" Version="1.0.1-*" PrivateAssets="All" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<AspNetCoreVersion>1.1.0</AspNetCoreVersion>
|
|
||||||
<AspNetCoreMvcVersion>1.1.1</AspNetCoreMvcVersion>
|
|
||||||
<AspNetCoreToolsVersion>1.0.0-msbuild3-final</AspNetCoreToolsVersion>
|
|
||||||
<AutoMapperVersion>5.0.2</AutoMapperVersion>
|
|
||||||
<CoreFxVersion>4.3.0</CoreFxVersion>
|
|
||||||
<JsonNetVersion>10.0.1</JsonNetVersion>
|
|
||||||
<MicrosoftDataflowVersion>4.5.24</MicrosoftDataflowVersion>
|
|
||||||
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
|
|
||||||
<ThreadingDataflowVersion>4.7.0</ThreadingDataflowVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<Project>
|
|
||||||
<Target Name="NpmRestore" AfterTargets="Restore" Condition="'$(PreflightRestore)' != 'true'">
|
|
||||||
<ItemGroup>
|
|
||||||
<NpmModules Include="$(RepositoryRoot)**\package.json"
|
|
||||||
Exclude="$(RepositoryRoot)**\node_modules\**\*" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Message Text="Restoring NPM modules for: %0A - @(NpmModules -> '%(FullPath)','%0A - ')" Importance="high" />
|
|
||||||
|
|
||||||
<Exec Command="npm install" WorkingDirectory="%(NpmModules.RootDir)%(Directory)" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
3
global.json
Normal file
3
global.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"projects": ["src"]
|
||||||
|
}
|
||||||
8
makefile.shade
Executable file
8
makefile.shade
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
var VERSION='0.1'
|
||||||
|
var FULL_VERSION='0.1'
|
||||||
|
var AUTHORS='Microsoft Open Technologies, Inc.'
|
||||||
|
var SAMPLES_PROJECT_GLOB='templates/*/project.json'
|
||||||
|
|
||||||
|
use-standard-lifecycle
|
||||||
|
k-standard-goals
|
||||||
22
pack-local.sh
Executable file
22
pack-local.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
versionSuffix=$1
|
||||||
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
projects=(
|
||||||
|
./src/Microsoft.AspNetCore.NodeServices
|
||||||
|
./src/Microsoft.AspNetCore.SpaServices
|
||||||
|
./src/Microsoft.AspNetCore.AngularServices
|
||||||
|
./src/Microsoft.AspNetCore.ReactServices
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ -z "$versionSuffix" ]; then
|
||||||
|
echo "Usage: pack-local.sh <versionsuffix>"
|
||||||
|
echo "Example: pack-local.sh beta-000001"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $dir > /dev/null
|
||||||
|
|
||||||
|
for proj in "${projects[@]}"; do
|
||||||
|
dotnet pack $proj --version-suffix $versionSuffix -o ./artifacts/
|
||||||
|
done
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
1
samples/angular/MusicStore/.gitignore
vendored
1
samples/angular/MusicStore/.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
/node_modules/
|
/node_modules/
|
||||||
/wwwroot/lib/
|
/wwwroot/lib/
|
||||||
/wwwroot/ng-app/**/*.js
|
/wwwroot/ng-app/**/*.js
|
||||||
|
/project.lock.json
|
||||||
/music-db.sqlite
|
/music-db.sqlite
|
||||||
/Properties/launchSettings.json
|
/Properties/launchSettings.json
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.AngularServices\Microsoft.AspNetCore.AngularServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="AutoMapper" Version="$(AutoMapperVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
|
||||||
<Exec Command="npm install" />
|
|
||||||
<Exec Command="gulp" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
20
samples/angular/MusicStore/MusicStore.xproj
Normal file
20
samples/angular/MusicStore/MusicStore.xproj
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>1a74148f-9dc0-435d-b5ac-7d1b0d3d5e0b</ProjectGuid>
|
||||||
|
<RootNamespace>MusicStore</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<DevelopmentServerPort>5068</DevelopmentServerPort>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
@@ -5,8 +5,6 @@
|
|||||||
"angular2": "2.0.0-beta.15",
|
"angular2": "2.0.0-beta.15",
|
||||||
"angular2-aspnet": "^0.0.6",
|
"angular2-aspnet": "^0.0.6",
|
||||||
"angular2-universal": "0.98.1",
|
"angular2-universal": "0.98.1",
|
||||||
"angular2-express-engine": "0.11.1",
|
|
||||||
"angular2-hapi-engine": "0.11.1",
|
|
||||||
"aspnet-prerendering": "^1.0.1",
|
"aspnet-prerendering": "^1.0.1",
|
||||||
"bootstrap": "^3.3.5",
|
"bootstrap": "^3.3.5",
|
||||||
"css": "^2.2.1",
|
"css": "^2.2.1",
|
||||||
|
|||||||
79
samples/angular/MusicStore/project.json
Executable file
79
samples/angular/MusicStore/project.json
Executable file
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
|
},
|
||||||
|
"runtimeOptions": {
|
||||||
|
"configProperties": {
|
||||||
|
"System.GC.Server": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tooling": {
|
||||||
|
"defaultNamespace": "MusicStore"
|
||||||
|
},
|
||||||
|
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"type": "platform"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.AngularServices": "1.0.0-*",
|
||||||
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc": "1.0.1",
|
||||||
|
"Microsoft.AspNetCore.Razor.Tools": {
|
||||||
|
"version": "1.0.0-preview2-final",
|
||||||
|
"type": "build"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
|
||||||
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
|
||||||
|
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
|
||||||
|
"AutoMapper": "5.0.2"
|
||||||
|
},
|
||||||
|
|
||||||
|
"tools": {
|
||||||
|
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
|
||||||
|
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
|
||||||
|
"Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final"
|
||||||
|
},
|
||||||
|
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"portable-net45+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"publishOptions": {
|
||||||
|
"include": [
|
||||||
|
"appsettings.json",
|
||||||
|
"ClientApp",
|
||||||
|
"node_modules",
|
||||||
|
"typings",
|
||||||
|
"Views",
|
||||||
|
"tsconfig.json",
|
||||||
|
"tsd.json",
|
||||||
|
"web.config",
|
||||||
|
"webpack.*.js",
|
||||||
|
"wwwroot"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": [
|
||||||
|
"npm install",
|
||||||
|
"gulp"
|
||||||
|
],
|
||||||
|
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.NodeServices.Sockets\Microsoft.AspNetCore.NodeServices.Sockets.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
19
samples/misc/LatencyTest/LatencyTest.xproj
Normal file
19
samples/misc/LatencyTest/LatencyTest.xproj
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>a64af9d9-72aa-4433-be1d-dc2524b6808a</ProjectGuid>
|
||||||
|
<RootNamespace>LatencyTest</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
@@ -3,7 +3,6 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.NodeServices;
|
using Microsoft.AspNetCore.NodeServices;
|
||||||
using Microsoft.AspNetCore.NodeServices.Sockets;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace ConsoleApplication
|
namespace ConsoleApplication
|
||||||
@@ -17,10 +16,7 @@ namespace ConsoleApplication
|
|||||||
// Set up the DI system
|
// Set up the DI system
|
||||||
var services = new ServiceCollection();
|
var services = new ServiceCollection();
|
||||||
services.AddNodeServices(options => {
|
services.AddNodeServices(options => {
|
||||||
// To compare with Socket hosting, uncomment the following line
|
options.HostingModel = NodeServicesOptions.DefaultNodeHostingModel;
|
||||||
// Since .NET Core 1.1, the HTTP hosting model has become basically as fast as the Socket hosting model
|
|
||||||
//options.UseSocketHosting();
|
|
||||||
|
|
||||||
options.ProjectPath = Directory.GetCurrentDirectory();
|
options.ProjectPath = Directory.GetCurrentDirectory();
|
||||||
options.WatchFileExtensions = new string[] {}; // Don't watch anything
|
options.WatchFileExtensions = new string[] {}; // Don't watch anything
|
||||||
});
|
});
|
||||||
|
|||||||
19
samples/misc/LatencyTest/project.json
Executable file
19
samples/misc/LatencyTest/project.json
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "platform"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.NodeServices": "1.0.0-*",
|
||||||
|
"Microsoft.Extensions.DependencyInjection": "1.0.0"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"imports": "dnxcore50"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.NodeServices;
|
|
||||||
|
|
||||||
namespace NodeServicesExamples.Controllers
|
namespace NodeServicesExamples.Controllers
|
||||||
{
|
{
|
||||||
@@ -16,21 +15,8 @@ namespace NodeServicesExamples.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IActionResult> Chart([FromServices] INodeServices nodeServices)
|
public IActionResult ImageResizing()
|
||||||
{
|
{
|
||||||
var options = new { width = 400, height = 200, showArea = true, showPoint = true, fullWidth = true };
|
|
||||||
var data = new
|
|
||||||
{
|
|
||||||
labels = new[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" },
|
|
||||||
series = new[] {
|
|
||||||
new[] { 1, 5, 2, 5, 4, 3 },
|
|
||||||
new[] { 2, 3, 4, 8, 1, 2 },
|
|
||||||
new[] { 5, 4, 3, 2, 1, 0 }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ViewData["ChartMarkup"] = await nodeServices.InvokeAsync<string>("./Node/renderChart", "line", options, data);
|
|
||||||
|
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
64
samples/misc/NodeServicesExamples/Controllers/ResizeImage.cs
Normal file
64
samples/misc/NodeServicesExamples/Controllers/ResizeImage.cs
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.NodeServices;
|
||||||
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
|
|
||||||
|
namespace NodeServicesExamples.Controllers
|
||||||
|
{
|
||||||
|
public class ResizeImageController : Controller
|
||||||
|
{
|
||||||
|
private const int MaxDimension = 1000;
|
||||||
|
private static string[] AllowedMimeTypes = new[] { "image/jpeg", "image/png", "image/gif" };
|
||||||
|
|
||||||
|
private IHostingEnvironment _environment;
|
||||||
|
private INodeServices _nodeServices;
|
||||||
|
|
||||||
|
public ResizeImageController(IHostingEnvironment environment, INodeServices nodeServices)
|
||||||
|
{
|
||||||
|
_environment = environment;
|
||||||
|
_nodeServices = nodeServices;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("resize/{*imagePath}")]
|
||||||
|
public async Task<IActionResult> Index(string imagePath, int maxWidth, int maxHeight)
|
||||||
|
{
|
||||||
|
// Validate incoming params
|
||||||
|
if (maxWidth < 0 || maxHeight < 0 || maxWidth > MaxDimension || maxHeight > MaxDimension
|
||||||
|
|| (maxWidth + maxHeight) == 0)
|
||||||
|
{
|
||||||
|
return BadRequest("Invalid dimensions");
|
||||||
|
}
|
||||||
|
|
||||||
|
var mimeType = GetContentType(imagePath);
|
||||||
|
if (Array.IndexOf(AllowedMimeTypes, mimeType) < 0)
|
||||||
|
{
|
||||||
|
return BadRequest("Disallowed image format");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Locate source image on disk
|
||||||
|
var fileInfo = _environment.WebRootFileProvider.GetFileInfo(imagePath);
|
||||||
|
if (!fileInfo.Exists)
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Invoke Node and pipe the result to the response
|
||||||
|
var imageStream = await _nodeServices.InvokeAsync<Stream>(
|
||||||
|
"./Node/resizeImage",
|
||||||
|
fileInfo.PhysicalPath,
|
||||||
|
mimeType,
|
||||||
|
maxWidth,
|
||||||
|
maxHeight);
|
||||||
|
return File(imageStream, mimeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetContentType(string path)
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
return new FileExtensionContentTypeProvider().TryGetContentType(path, out result) ? result : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
var generate = require('node-chartist');
|
|
||||||
|
|
||||||
module.exports = function (callback, type, options, data) {
|
|
||||||
generate(type, options, data).then(
|
|
||||||
result => callback(null, result), // Success case
|
|
||||||
error => callback(error) // Error case
|
|
||||||
);
|
|
||||||
};
|
|
||||||
8
samples/misc/NodeServicesExamples/Node/resizeImage.js
Normal file
8
samples/misc/NodeServicesExamples/Node/resizeImage.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
var sharp = require('sharp');
|
||||||
|
|
||||||
|
module.exports = function(result, physicalPath, mimeType, maxWidth, maxHeight) {
|
||||||
|
// Invoke the 'sharp' NPM module, and have it pipe the resulting image data back to .NET
|
||||||
|
sharp(physicalPath)
|
||||||
|
.resize(maxWidth || null, maxHeight || null)
|
||||||
|
.pipe(result.stream);
|
||||||
|
}
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(AspNetCoreVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
|
||||||
<Exec Command="npm install" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
20
samples/misc/NodeServicesExamples/NodeServicesExamples.xproj
Normal file
20
samples/misc/NodeServicesExamples/NodeServicesExamples.xproj
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>6d4bcdd6-7951-449b-be55-cb7f014b7430</ProjectGuid>
|
||||||
|
<RootNamespace>NodeServicesExamples</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<DevelopmentServerPort>2018</DevelopmentServerPort>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<h1>Server-rendered chart</h1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This sample demonstrates how arbitrary NPM modules can be invoked from .NET code.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
In this case, we use <code>node-chartist</code> to render the following chart on the server. The output is
|
|
||||||
identical to what you'd get if you used <a href='https://gionkunz.github.io/chartist-js/'>chartist.js</a>
|
|
||||||
on the client, except that in this example, we're not executing any client-side code at all.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
@Html.Raw(ViewData["ChartMarkup"])
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<h1>Image Resizing</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This sample shows how the NPM module <a href="https://www.npmjs.com/package/sharp"><code>sharp</code></a>
|
||||||
|
can be used for dynamic image resizing from within an ASP.NET Core application. There is one copy of the
|
||||||
|
following image on disk, but we can set up an MVC action method that returns it resized to fit within an
|
||||||
|
arbitrary width and height.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<strong>Dependencies:</strong> On Windows and Linux, there are no native dependencies. Just running
|
||||||
|
<code>npm install</code> is enough. On OS X, however, you need to have <code>libvips</code> installed,
|
||||||
|
which you can get through <a href="http://brew.sh/">Homebrew</a> by running
|
||||||
|
<code>brew install homebrew/science/vips</code>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h3>100px wide [<a href="/resize/images/parrot.jpg?maxWidth=100">open</a>]</h3>
|
||||||
|
<img src="/resize/images/parrot.jpg?maxWidth=100" />
|
||||||
|
|
||||||
|
<h3>200px wide [<a href="/resize/images/parrot.jpg?maxWidth=200">open</a>]</h3>
|
||||||
|
<img src="/resize/images/parrot.jpg?maxWidth=200" />
|
||||||
|
|
||||||
|
<h3>400px wide [<a href="/resize/images/parrot.jpg?maxWidth=400">open</a>]</h3>
|
||||||
|
<img src="/resize/images/parrot.jpg?maxWidth=400" />
|
||||||
|
|
||||||
|
<h3>800px wide [<a href="/resize/images/parrot.jpg?maxWidth=800">open</a>]</h3>
|
||||||
|
<img src="/resize/images/parrot.jpg?maxWidth=800" />
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<strong>Credit:</strong>
|
||||||
|
<em><a href="https://www.flickr.com/photos/dcoetzee/3572948635">Parrot</a>
|
||||||
|
by <a href="https://www.flickr.com/photos/dcoetzee/">D Coetzee</a>
|
||||||
|
is dedicated to the <a href="http://creativecommons.org/publicdomain/zero/1.0/">public domain (CC0)</a></em>
|
||||||
|
</p>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a asp-action="ES2015Transpilation">ES2015 transpilation</a></li>
|
<li><a asp-action="ES2015Transpilation">ES2015 transpilation</a>
|
||||||
<li><a asp-action="Chart">Server-side chart rendering</a></li>
|
<li><a asp-action="ImageResizing">Image resizing</a>
|
||||||
</ul>
|
</li>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>NodeServices Examples</title>
|
<title>NodeServices Examples</title>
|
||||||
<link rel="stylesheet" href="~/css/chartist.min.css" />
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@RenderBody()
|
@RenderBody()
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-core": "^6.7.4",
|
"babel-core": "^6.7.4",
|
||||||
"babel-preset-es2015": "^6.6.0",
|
"babel-preset-es2015": "^6.6.0",
|
||||||
"node-chartist": "^1.0.2"
|
"sharp": "^0.15.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
50
samples/misc/NodeServicesExamples/project.json
Executable file
50
samples/misc/NodeServicesExamples/project.json
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"tooling": {
|
||||||
|
"defaultNamespace": "NodeServicesExamples"
|
||||||
|
},
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
|
},
|
||||||
|
"runtimeOptions": {
|
||||||
|
"gcServer": true
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "platform"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
||||||
|
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||||
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.NodeServices": "1.0.0-*"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net45+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"publishExclude": [
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"**.xproj",
|
||||||
|
"**.user",
|
||||||
|
"**.vspscc"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": [ "npm install" ],
|
||||||
|
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
BIN
samples/misc/NodeServicesExamples/wwwroot/images/parrot.jpg
Normal file
BIN
samples/misc/NodeServicesExamples/wwwroot/images/parrot.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
7
samples/misc/Webpack/.gitignore
vendored
7
samples/misc/Webpack/.gitignore
vendored
@@ -1,9 +1,6 @@
|
|||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
yarn.lock
|
|
||||||
wwwroot/dist
|
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
@@ -43,6 +40,10 @@ TestResult.xml
|
|||||||
[Rr]eleasePS/
|
[Rr]eleasePS/
|
||||||
dlldata.c
|
dlldata.c
|
||||||
|
|
||||||
|
# DNX
|
||||||
|
project.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
*_i.c
|
*_i.c
|
||||||
*_p.c
|
*_p.c
|
||||||
*_i.h
|
*_i.h
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ namespace Webpack.ActionResults
|
|||||||
request.GetEncodedUrl(),
|
request.GetEncodedUrl(),
|
||||||
request.Path + request.QueryString.Value,
|
request.Path + request.QueryString.Value,
|
||||||
_dataToSupply,
|
_dataToSupply,
|
||||||
/* timeoutMilliseconds */ 30000,
|
/* timeoutMilliseconds */ 30000
|
||||||
/* requestPathBase */ "/"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
response.ContentType = "text/html";
|
response.ContentType = "text/html";
|
||||||
|
|||||||
11
samples/misc/Webpack/Dockerfile
Normal file
11
samples/misc/Webpack/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM microsoft/aspnet:1.0.0-rc1-update1
|
||||||
|
|
||||||
|
RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
|
||||||
|
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
RUN ["dnu", "restore"]
|
||||||
|
|
||||||
|
EXPOSE 5000/tcp
|
||||||
|
ENTRYPOINT ["dnx", "-p", "project.json", "web"]
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(AspNetCoreVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
|
||||||
<Exec Command="npm install" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
20
samples/misc/Webpack/Webpack.xproj
Normal file
20
samples/misc/Webpack/Webpack.xproj
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>a8905301-8492-42fd-9e83-f715a0fdc3a2</ProjectGuid>
|
||||||
|
<RootNamespace>Webpack</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<DevelopmentServerPort>2018</DevelopmentServerPort>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
@@ -11,10 +11,9 @@
|
|||||||
"webpack-hot-middleware": "^2.7.1"
|
"webpack-hot-middleware": "^2.7.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"aspnet-prerendering": "^1.0.4",
|
|
||||||
"aspnet-webpack": "^1.0.3",
|
"aspnet-webpack": "^1.0.3",
|
||||||
|
"aspnet-prerendering": "^1.0.4",
|
||||||
"ts-loader": "^0.8.1",
|
"ts-loader": "^0.8.1",
|
||||||
"typescript": "^2.0.0",
|
"typescript": "^1.7.5"
|
||||||
"webpack": "^1.13.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
52
samples/misc/Webpack/project.json
Executable file
52
samples/misc/Webpack/project.json
Executable file
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
|
},
|
||||||
|
"runtimeOptions": {
|
||||||
|
"gcServer": true
|
||||||
|
},
|
||||||
|
"tooling": {
|
||||||
|
"defaultNamespace": "Webpack"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "platform"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
||||||
|
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||||
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.SpaServices": "1.0.0-*"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net45+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"publishOptions": {
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"**.xproj",
|
||||||
|
"**.user",
|
||||||
|
"**.vspscc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": [ "npm install" ],
|
||||||
|
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,10 +2,9 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "es5",
|
"target": "es6",
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"sourceMap": true,
|
"sourceMap": true
|
||||||
"lib": ["es6", "dom"]
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module.exports = {
|
|||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' }
|
{ test: /\.less$/, loader: 'style!css!less' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ var extractLESS = new ExtractTextPlugin('my-styles.css');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{ test: /\.less$/, loader: extractLESS.extract(['css-loader', 'less-loader']) },
|
{ test: /\.less$/, loader: extractLESS.extract(['css', 'less']) },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
extractLESS,
|
extractLESS,
|
||||||
new webpack.optimize.UglifyJsPlugin({ minimize: true, compressor: { warnings: false } })
|
new webpack.optimize.UglifyJsPlugin({ minimize: true })
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
1
samples/react/MusicStore/.gitignore
vendored
1
samples/react/MusicStore/.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
music-db.sqlite
|
music-db.sqlite
|
||||||
/wwwroot/dist/
|
/wwwroot/dist/
|
||||||
/node_modules/
|
/node_modules/
|
||||||
yarn.lock
|
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Remove="node_modules\**\*" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.ReactServices\Microsoft.AspNetCore.ReactServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="AutoMapper" Version="$(AutoMapperVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
|
||||||
<Exec Command="npm install" />
|
|
||||||
<Exec Command="node node_modules/webpack/bin/webpack.js" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="$(AspNetCoreToolsVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
20
samples/react/MusicStore/MusicStore.xproj
Normal file
20
samples/react/MusicStore/MusicStore.xproj
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>c870a92c-9e3f-4bf2-82b8-5758545a8b7c</ProjectGuid>
|
||||||
|
<RootNamespace>MusicStore</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<DevelopmentServerPort>2018</DevelopmentServerPort>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
@@ -5,29 +5,19 @@ import { match, RouterContext } from 'react-router';
|
|||||||
import createMemoryHistory from 'history/lib/createMemoryHistory';
|
import createMemoryHistory from 'history/lib/createMemoryHistory';
|
||||||
import { routes } from './routes';
|
import { routes } from './routes';
|
||||||
import configureStore from './configureStore';
|
import configureStore from './configureStore';
|
||||||
type BootResult = { html?: string, globals?: { [key: string]: any }, redirectUrl?: string};
|
React;
|
||||||
|
|
||||||
export default function (params: any): Promise<{ html: string }> {
|
export default function (params: any): Promise<{ html: string }> {
|
||||||
return new Promise<BootResult>((resolve, reject) => {
|
return new Promise<{ html: string, globals: { [key: string]: any } }>((resolve, reject) => {
|
||||||
// Match the incoming request against the list of client-side routes
|
// Match the incoming request against the list of client-side routes
|
||||||
match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => {
|
match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there's a redirection, just send this information back to the host application
|
|
||||||
if (redirectLocation) {
|
|
||||||
resolve({ redirectUrl: redirectLocation.pathname });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it didn't match any route, renderProps will be undefined
|
|
||||||
if (!renderProps) {
|
|
||||||
throw new Error(`The location '${ params.url }' doesn't match any route configured in react-router.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build an instance of the application
|
// Build an instance of the application
|
||||||
const store = configureStore();
|
const history = createMemoryHistory(params.url);
|
||||||
|
const store = configureStore(history);
|
||||||
const app = (
|
const app = (
|
||||||
<Provider store={ store }>
|
<Provider store={ store }>
|
||||||
<RouterContext {...renderProps} />
|
<RouterContext {...renderProps} />
|
||||||
|
|||||||
@@ -1,25 +1,21 @@
|
|||||||
import './styles/styles.css';
|
|
||||||
import 'bootstrap/dist/css/bootstrap.css';
|
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as ReactDOM from 'react-dom';
|
import * as ReactDOM from 'react-dom';
|
||||||
import { browserHistory, Router } from 'react-router';
|
import { browserHistory, Router } from 'react-router';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { syncHistoryWithStore } from 'react-router-redux';
|
React; // Need this reference otherwise TypeScript doesn't think we're using it and ignores the import
|
||||||
import { routes } from './routes';
|
|
||||||
|
import './styles/styles.css';
|
||||||
|
import 'bootstrap/dist/css/bootstrap.css';
|
||||||
import configureStore from './configureStore';
|
import configureStore from './configureStore';
|
||||||
|
import { routes } from './routes';
|
||||||
import { ApplicationState } from './store';
|
import { ApplicationState } from './store';
|
||||||
|
|
||||||
// Get the application-wide store instance, prepopulating with state from the server where available.
|
|
||||||
const initialState = (window as any).initialReduxState as ApplicationState;
|
const initialState = (window as any).initialReduxState as ApplicationState;
|
||||||
const store = configureStore(initialState);
|
const store = configureStore(browserHistory, initialState);
|
||||||
const history = syncHistoryWithStore(browserHistory, store);
|
|
||||||
|
|
||||||
// This code starts up the React app when it runs in a browser. It sets up the routing configuration
|
|
||||||
// and injects the app into a DOM element.
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Provider store={ store }>
|
<Provider store={ store }>
|
||||||
<Router history={ history } children={ routes } />
|
<Router history={ browserHistory } children={ routes } />
|
||||||
</Provider>,
|
</Provider>,
|
||||||
document.getElementById('react-app')
|
document.getElementById('react-app')
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
import { createStore, applyMiddleware, compose, combineReducers, GenericStoreEnhancer, Store as ReduxStore } from 'redux';
|
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
|
||||||
import thunk from 'redux-thunk';
|
import * as thunkModule from 'redux-thunk';
|
||||||
import { routerReducer } from 'react-router-redux';
|
import { syncHistory, routeReducer } from 'react-router-redux';
|
||||||
import * as Store from './store';
|
import * as Store from './store';
|
||||||
import { typedToPlain } from 'redux-typed';
|
import { typedToPlain } from 'redux-typed';
|
||||||
|
|
||||||
export default function configureStore(initialState?: Store.ApplicationState) {
|
export default function configureStore(history: HistoryModule.History, initialState?: Store.ApplicationState) {
|
||||||
// Build middleware. These are functions that can process the actions before they reach the store.
|
// Build middleware
|
||||||
const windowIfDefined = typeof window === 'undefined' ? null : window as any;
|
const thunk = (thunkModule as any).default; // Workaround for TypeScript not importing thunk module as expected
|
||||||
// If devTools is installed, connect to it
|
const reduxRouterMiddleware = syncHistory(history);
|
||||||
const devToolsExtension = windowIfDefined && windowIfDefined.devToolsExtension as () => GenericStoreEnhancer;
|
const middlewares = [thunk, reduxRouterMiddleware, typedToPlain];
|
||||||
const createStoreWithMiddleware = compose(
|
const devToolsExtension = null;//(window as any).devToolsExtension; // If devTools is installed, connect to it
|
||||||
applyMiddleware(thunk, typedToPlain),
|
|
||||||
devToolsExtension ? devToolsExtension() : f => f
|
|
||||||
)(createStore);
|
|
||||||
|
|
||||||
// Combine all reducers and instantiate the app-wide store instance
|
const finalCreateStore = compose(
|
||||||
|
applyMiddleware(...middlewares),
|
||||||
|
devToolsExtension ? devToolsExtension() : f => f
|
||||||
|
)(createStore)
|
||||||
|
|
||||||
|
// Combine all reducers
|
||||||
const allReducers = buildRootReducer(Store.reducers);
|
const allReducers = buildRootReducer(Store.reducers);
|
||||||
const store = createStoreWithMiddleware(allReducers, initialState) as ReduxStore<Store.ApplicationState>;
|
|
||||||
|
const store = finalCreateStore(allReducers, initialState) as Redux.Store;
|
||||||
|
|
||||||
|
// Required for replaying actions from devtools to work
|
||||||
|
reduxRouterMiddleware.listenForReplays(store);
|
||||||
|
|
||||||
// Enable Webpack hot module replacement for reducers
|
// Enable Webpack hot module replacement for reducers
|
||||||
if (module.hot) {
|
if (module.hot) {
|
||||||
@@ -30,5 +36,5 @@ export default function configureStore(initialState?: Store.ApplicationState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildRootReducer(allReducers) {
|
function buildRootReducer(allReducers) {
|
||||||
return combineReducers<Store.ApplicationState>(Object.assign({}, allReducers, { routing: routerReducer }));
|
return combineReducers(Object.assign({}, allReducers, { routing: routeReducer })) as Redux.Reducer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +1,45 @@
|
|||||||
{
|
{
|
||||||
"name": "music-store",
|
"name": "MusicStore",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"@types/history": "^2.0.0",
|
"babel-loader": "^6.2.1",
|
||||||
"@types/react": "^0.14.29",
|
"babel-plugin-react-transform": "^2.0.0",
|
||||||
"@types/react-bootstrap": "^0.0.35",
|
"babel-preset-es2015": "^6.3.13",
|
||||||
"@types/react-dom": "^0.14.14",
|
"babel-preset-react": "^6.3.13",
|
||||||
"@types/react-redux": "^4.4.29",
|
|
||||||
"@types/react-router": "^2.0.30",
|
|
||||||
"@types/react-router-bootstrap": "^0.0.27",
|
|
||||||
"@types/react-router-redux": "^4.0.30",
|
|
||||||
"@types/redux-thunk": "^2.1.28",
|
|
||||||
"@types/source-map": "^0.1.28",
|
|
||||||
"@types/uglify-js": "^2.0.27",
|
|
||||||
"@types/webpack": "^1.12.35",
|
|
||||||
"@types/webpack-env": "^1.12.1",
|
|
||||||
"@types/whatwg-fetch": "0.0.28",
|
|
||||||
"aspnet-prerendering": "^1.0.7",
|
|
||||||
"aspnet-webpack": "^1.0.17",
|
|
||||||
"aspnet-webpack-react": "^1.0.2",
|
|
||||||
"babel-core": "^6.5.2",
|
|
||||||
"babel-loader": "^6.2.3",
|
|
||||||
"babel-preset-es2015": "^6.5.0",
|
|
||||||
"babel-preset-react": "^6.5.0",
|
|
||||||
"bootstrap": "^3.3.6",
|
|
||||||
"css-loader": "^0.23.1",
|
"css-loader": "^0.23.1",
|
||||||
"domain-task": "^2.0.1",
|
"express": "^4.13.4",
|
||||||
"event-source-polyfill": "^0.0.7",
|
|
||||||
"extract-text-webpack-plugin": "^1.0.1",
|
"extract-text-webpack-plugin": "^1.0.1",
|
||||||
"file-loader": "^0.8.5",
|
"file-loader": "^0.8.5",
|
||||||
"jquery": "^2.2.1",
|
"react-transform-hmr": "^1.0.2",
|
||||||
"react": "^15.3.2",
|
|
||||||
"react-bootstrap": "^0.30.6",
|
|
||||||
"react-dom": "^15.3.2",
|
|
||||||
"react-redux": "^4.4.5",
|
|
||||||
"react-router": "^2.8.1",
|
|
||||||
"react-router-bootstrap": "^0.23.1",
|
|
||||||
"react-router-redux": "^4.0.6",
|
|
||||||
"redux": "^3.6.0",
|
|
||||||
"redux-thunk": "^2.1.0",
|
|
||||||
"redux-typed": "^2.0.0",
|
|
||||||
"style-loader": "^0.13.0",
|
"style-loader": "^0.13.0",
|
||||||
"ts-loader": "^0.8.1",
|
"ts-loader": "^0.8.0",
|
||||||
"typescript": "^2.0.3",
|
"typescript": "^1.7.5",
|
||||||
"url-loader": "^0.5.7",
|
"url-loader": "^0.5.7",
|
||||||
"webpack": "^1.13.2",
|
"webpack": "^1.12.12",
|
||||||
"webpack-hot-middleware": "^2.12.2",
|
"webpack-dev-middleware": "^1.5.1",
|
||||||
"webpack-merge": "^0.14.1",
|
"webpack-hot-middleware": "^2.6.4"
|
||||||
"webpack-node-externals": "^1.4.3"
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"aspnet-prerendering": "^1.0.0",
|
||||||
|
"aspnet-webpack": "^1.0.3",
|
||||||
|
"aspnet-webpack-react": "^1.0.1",
|
||||||
|
"bootstrap": "^3.3.6",
|
||||||
|
"domain-context": "^0.5.1",
|
||||||
|
"domain-task": "^2.0.0",
|
||||||
|
"history": "^2.0.0",
|
||||||
|
"isomorphic-fetch": "^2.2.1",
|
||||||
|
"memory-fs": "^0.3.0",
|
||||||
|
"react": "^0.14.7",
|
||||||
|
"react-bootstrap": "^0.28.2",
|
||||||
|
"react-dom": "^0.14.7",
|
||||||
|
"react-redux": "^4.2.1",
|
||||||
|
"react-router": "^2.0.0-rc5",
|
||||||
|
"react-router-bootstrap": "^0.20.1",
|
||||||
|
"react-router-redux": "^2.1.0",
|
||||||
|
"redux": "^3.2.1",
|
||||||
|
"redux-thunk": "^1.0.3",
|
||||||
|
"redux-typed": "^1.0.0",
|
||||||
|
"require-from-string": "^1.1.0",
|
||||||
|
"webpack-externals-plugin": "^1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
56
samples/react/MusicStore/project.json
Executable file
56
samples/react/MusicStore/project.json
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
|
},
|
||||||
|
"runtimeOptions": {
|
||||||
|
"gcServer": true
|
||||||
|
},
|
||||||
|
"tooling": {
|
||||||
|
"defaultNamespace": "MusicStore"
|
||||||
|
},
|
||||||
|
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "platform"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
||||||
|
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||||
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
|
"Microsoft.EntityFrameworkCore.SQLite": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.ReactServices": "1.0.0-*",
|
||||||
|
"AutoMapper": "5.0.2"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net45+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"publishOptions": {
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"**.xproj",
|
||||||
|
"**.user",
|
||||||
|
"**.vspscc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": [ "npm install" ],
|
||||||
|
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +1,10 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true
|
||||||
"types": [ "webpack-env", "whatwg-fetch" ],
|
|
||||||
"paths": {
|
|
||||||
// Fix "Duplicate identifier" errors caused by multiple dependencies fetching their own copies of type definitions.
|
|
||||||
// We tell TypeScript which type definitions module to treat as the canonical one (instead of combining all of them).
|
|
||||||
"history": ["./node_modules/@types/history/index"],
|
|
||||||
"redux": ["./node_modules/@types/redux/index"],
|
|
||||||
"react": ["./node_modules/@types/react/index"]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|||||||
45
samples/react/MusicStore/tsd.json
Normal file
45
samples/react/MusicStore/tsd.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"version": "v4",
|
||||||
|
"repo": "borisyankov/DefinitelyTyped",
|
||||||
|
"ref": "master",
|
||||||
|
"path": "typings",
|
||||||
|
"bundle": "typings/tsd.d.ts",
|
||||||
|
"installed": {
|
||||||
|
"react/react.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"react/react-dom.d.ts": {
|
||||||
|
"commit": "86dbea8fc37d9473fee465da4f0a21bea4f8cbd9"
|
||||||
|
},
|
||||||
|
"redux/redux.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"webpack/webpack-env.d.ts": {
|
||||||
|
"commit": "717a5fdb079f8dd7c19f1b22f7f656dd990f0ccf"
|
||||||
|
},
|
||||||
|
"react-redux/react-redux.d.ts": {
|
||||||
|
"commit": "717a5fdb079f8dd7c19f1b22f7f656dd990f0ccf"
|
||||||
|
},
|
||||||
|
"react-bootstrap/react-bootstrap.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"react-router/react-router.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"react-router/history.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"react-router-bootstrap/react-router-bootstrap.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"react-router-redux/react-router-redux.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"redux-thunk/redux-thunk.d.ts": {
|
||||||
|
"commit": "e69fe60f2d6377ea4fae539493997b098f52cad1"
|
||||||
|
},
|
||||||
|
"whatwg-fetch/whatwg-fetch.d.ts": {
|
||||||
|
"commit": "f4b1797c1201b6c575668f5d7ea12d9b1ab21846"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
976
samples/react/MusicStore/typings/react-bootstrap/react-bootstrap.d.ts
vendored
Normal file
976
samples/react/MusicStore/typings/react-bootstrap/react-bootstrap.d.ts
vendored
Normal file
@@ -0,0 +1,976 @@
|
|||||||
|
// Type definitions for react-bootstrap
|
||||||
|
// Project: https://github.com/react-bootstrap/react-bootstrap
|
||||||
|
// Definitions by: Walker Burgin <https://github.com/walkerburgin>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
///<reference path="../react/react.d.ts"/>
|
||||||
|
|
||||||
|
declare module "react-bootstrap" {
|
||||||
|
// Import React
|
||||||
|
import React = require("react");
|
||||||
|
|
||||||
|
|
||||||
|
// <Button />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ButtonProps extends React.Props<ButtonClass>{
|
||||||
|
|
||||||
|
// Optional
|
||||||
|
active?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
|
block?: boolean;
|
||||||
|
bsStyle?: string;
|
||||||
|
bsSize?: string;
|
||||||
|
className?: string;
|
||||||
|
navItem?: boolean;
|
||||||
|
navDropdown?: boolean;
|
||||||
|
componentClass?: string;
|
||||||
|
href?: string;
|
||||||
|
onClick?: Function; // Add more specific type
|
||||||
|
target?: string;
|
||||||
|
type?: string;
|
||||||
|
}
|
||||||
|
interface Button extends React.ReactElement<ButtonProps> { }
|
||||||
|
interface ButtonClass extends React.ComponentClass<ButtonProps> { }
|
||||||
|
var Button: ButtonClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <ButtonToolbar />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ButtonToolbarProps extends React.Props<ButtonToolbarClass> {
|
||||||
|
|
||||||
|
// Optional
|
||||||
|
block?: boolean;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
justified?: boolean;
|
||||||
|
vertical?: boolean;
|
||||||
|
}
|
||||||
|
interface ButtonToolbar extends React.ReactElement<ButtonToolbarProps> { }
|
||||||
|
interface ButtonToolbarClass extends React.ComponentClass<ButtonToolbarProps> { }
|
||||||
|
var ButtonToolbar: ButtonToolbarClass;
|
||||||
|
|
||||||
|
// <ButtonGroup />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ButtonGroupProps extends React.Props<ButtonGroupClass> {
|
||||||
|
// Optional
|
||||||
|
block?: boolean;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
justified?: boolean;
|
||||||
|
vertical?: boolean;
|
||||||
|
}
|
||||||
|
interface ButtonGroup extends React.ReactElement<ButtonGroupProps> { }
|
||||||
|
interface ButtonGroupClass extends React.ComponentClass<ButtonGroupProps> { }
|
||||||
|
var ButtonGroup: ButtonGroupClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <DropdownButton />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface DropdownButtonProps extends React.Props<DropdownButtonClass> {
|
||||||
|
bsStyle?: string;
|
||||||
|
bsSize?: string;
|
||||||
|
buttonClassName?: string;
|
||||||
|
className?: string;
|
||||||
|
dropup?: boolean;
|
||||||
|
href?: string;
|
||||||
|
id?: string | number;
|
||||||
|
navItem?: boolean;
|
||||||
|
noCaret?: boolean;
|
||||||
|
onClick?: Function; // TODO: Add more specifc type
|
||||||
|
onSelect?: Function; // TODO: Add more specific type
|
||||||
|
pullRight?: boolean;
|
||||||
|
title?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface DropdownButton extends React.ReactElement<DropdownButtonProps> { }
|
||||||
|
interface DropdownButtonClass extends React.ComponentClass<DropdownButtonProps> { }
|
||||||
|
var DropdownButton: DropdownButtonClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <SplitButton />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface SplitButtonProps extends React.Props<SplitButtonClass>{
|
||||||
|
bsStyle?: string;
|
||||||
|
bsSize?: string;
|
||||||
|
className?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
dropdownTitle?: any; // TODO: Add more specific type
|
||||||
|
dropup?: boolean;
|
||||||
|
href?: string;
|
||||||
|
id?: string;
|
||||||
|
onClick?: Function; // TODO: Add more specific type
|
||||||
|
onSelect?: Function; // TODO: Add more specific type
|
||||||
|
pullRight?: boolean;
|
||||||
|
target?: string;
|
||||||
|
title?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface SplitButton extends React.ReactElement<SplitButtonProps> { }
|
||||||
|
interface SplitButtonClass extends React.ComponentClass<SplitButtonProps> { }
|
||||||
|
var SplitButton: SplitButtonClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <MenuItem />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface MenuItemProps extends React.Props<MenuItemClass> {
|
||||||
|
active?: boolean;
|
||||||
|
className?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
divider?: boolean;
|
||||||
|
eventKey?: any;
|
||||||
|
header?: boolean;
|
||||||
|
href?: string;
|
||||||
|
onClick?: Function;
|
||||||
|
onKeyDown?: Function;
|
||||||
|
onSelect?: Function;
|
||||||
|
target?: string;
|
||||||
|
title?: string;
|
||||||
|
}
|
||||||
|
interface MenuItem extends React.ReactElement<MenuItemProps> { }
|
||||||
|
interface MenuItemClass extends React.ComponentClass<MenuItemProps> { }
|
||||||
|
var MenuItem: MenuItemClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Panel />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PanelProps extends React.Props<PanelClass> {
|
||||||
|
className?: string;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
collapsible?: boolean;
|
||||||
|
defaultExpanded?: boolean;
|
||||||
|
eventKey?: any;
|
||||||
|
expanded?: boolean;
|
||||||
|
footer?: any; // TODO: Add more specific type
|
||||||
|
header?: any; // TODO: Add more specific type
|
||||||
|
id?: string;
|
||||||
|
onSelect?: Function; // TODO: Add more specific type
|
||||||
|
onClick?: Function; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Panel extends React.ReactElement<PanelProps> { }
|
||||||
|
interface PanelClass extends React.ComponentClass<PanelProps> { }
|
||||||
|
var Panel: PanelClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Accordion />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface AccordionProps extends React.Props<AccordionClass> {
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
collapsible?: boolean;
|
||||||
|
defaultExpanded?: boolean;
|
||||||
|
eventKey?: any;
|
||||||
|
expanded?: boolean;
|
||||||
|
footer?: any; // TODO: Add more specific type
|
||||||
|
header?: any; // TODO: Add more specific type
|
||||||
|
id?: string;
|
||||||
|
onSelect?: Function; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Accordion extends React.ReactElement<AccordionProps> { }
|
||||||
|
interface AccordionClass extends React.ComponentClass<AccordionProps> { }
|
||||||
|
var Accordion: AccordionClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <PanelGroup />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PanelGroupProps extends React.Props<PanelGroupClass> {
|
||||||
|
accordion?: boolean;
|
||||||
|
activeKey?: any;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
defaultActiveKey?: any;
|
||||||
|
onSelect?: Function;
|
||||||
|
}
|
||||||
|
interface PanelGroup extends React.ReactElement<PanelGroupProps> { }
|
||||||
|
interface PanelGroupClass extends React.ComponentClass<PanelGroupProps> { }
|
||||||
|
var PanelGroup: PanelGroupClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Modal.Dialog />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ModalDialogProps extends React.Props<ModalDialogClass> {
|
||||||
|
// TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface ModalDialog extends React.ReactElement<ModalDialogProps> { }
|
||||||
|
interface ModalDialogClass extends React.ComponentClass<ModalHeaderProps> { }
|
||||||
|
|
||||||
|
|
||||||
|
// <Modal.Header />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ModalHeaderProps extends React.Props<ModalHeaderClass> {
|
||||||
|
className?: string;
|
||||||
|
closeButton?: boolean;
|
||||||
|
modalClassName?: string;
|
||||||
|
onHide?: Function;
|
||||||
|
// undefined?: string;
|
||||||
|
}
|
||||||
|
interface ModalHeader extends React.ReactElement<ModalHeaderProps> { }
|
||||||
|
interface ModalHeaderClass extends React.ComponentClass<ModalHeaderProps> { }
|
||||||
|
|
||||||
|
|
||||||
|
// <Modal.Title/>
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ModalTitleProps extends React.Props<ModalTitleClass> {
|
||||||
|
className?: string;
|
||||||
|
modalClassName?: string;
|
||||||
|
}
|
||||||
|
interface ModalTitle extends React.ReactElement<ModalTitleProps> { }
|
||||||
|
interface ModalTitleClass extends React.ComponentClass<ModalTitleProps> { }
|
||||||
|
|
||||||
|
|
||||||
|
// <Modal.Body />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ModalBodyProps extends React.Props<ModalBodyClass> {
|
||||||
|
className?: string;
|
||||||
|
modalClassName?: string;
|
||||||
|
}
|
||||||
|
interface ModalBody extends React.ReactElement<ModalBodyProps> { }
|
||||||
|
interface ModalBodyClass extends React.ComponentClass<ModalBodyProps> { }
|
||||||
|
|
||||||
|
|
||||||
|
// <Modal.Footer />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ModalFooterProps extends React.Props<ModalFooterClass> {
|
||||||
|
className?: string;
|
||||||
|
modalClassName?: string;
|
||||||
|
}
|
||||||
|
interface ModalFooter extends React.ReactElement<ModalFooterProps> { }
|
||||||
|
interface ModalFooterClass extends React.ComponentClass<ModalFooterProps> { }
|
||||||
|
|
||||||
|
|
||||||
|
// <Modal />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ModalProps extends React.Props<ModalClass> {
|
||||||
|
// Required
|
||||||
|
onHide: Function;
|
||||||
|
|
||||||
|
// Optional
|
||||||
|
animation?: boolean;
|
||||||
|
autoFocus?: boolean;
|
||||||
|
backdrop?: boolean|string;
|
||||||
|
bsSize?: string;
|
||||||
|
container?: any; // TODO: Add more specific type
|
||||||
|
dialogClassName?: string;
|
||||||
|
dialogComponent?: any; // TODO: Add more specific type
|
||||||
|
enforceFocus?: boolean;
|
||||||
|
keyboard?: boolean;
|
||||||
|
show?: boolean;
|
||||||
|
}
|
||||||
|
interface Modal extends React.ReactElement<ModalProps> { }
|
||||||
|
interface ModalClass extends React.ComponentClass<ModalProps> {
|
||||||
|
Header: ModalHeaderClass;
|
||||||
|
Title: ModalTitleClass;
|
||||||
|
Body: ModalBodyClass;
|
||||||
|
Footer: ModalFooterClass;
|
||||||
|
Dialog: ModalDialogClass;
|
||||||
|
}
|
||||||
|
var Modal: ModalClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <OverlayTrigger />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface OverlayTriggerProps extends React.Props<OverlayTriggerClass> {
|
||||||
|
// Required
|
||||||
|
overlay: any; // TODO: Add more specific type
|
||||||
|
|
||||||
|
// Optional
|
||||||
|
animation?: any; // TODO: Add more specific type
|
||||||
|
container?: any; // TODO: Add more specific type
|
||||||
|
containerPadding?: number;
|
||||||
|
defaultOverlayShown?: boolean;
|
||||||
|
delay?: number;
|
||||||
|
delayHide?: number;
|
||||||
|
delayShow?: number;
|
||||||
|
onEnter?: Function;
|
||||||
|
onEntered?: Function;
|
||||||
|
onEntering?: Function;
|
||||||
|
onExit?: Function;
|
||||||
|
onExited?: Function;
|
||||||
|
onExiting?: Function;
|
||||||
|
placement?: string;
|
||||||
|
rootClose?: boolean;
|
||||||
|
trigger?: string;
|
||||||
|
}
|
||||||
|
interface OverlayTrigger extends React.ReactElement<OverlayTriggerProps> { }
|
||||||
|
interface OverlayTriggerClass extends React.ComponentClass<OverlayTriggerProps> { }
|
||||||
|
var OverlayTrigger: OverlayTriggerClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Tooltip />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface TooltipProps extends React.Props<TooltipClass> {
|
||||||
|
// Optional
|
||||||
|
arrowOffsetLeft?: number | string;
|
||||||
|
arrowOffsetTop?: number | string;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
id?: string;
|
||||||
|
placement?: string;
|
||||||
|
positionLeft?: number;
|
||||||
|
positionTop?: number;
|
||||||
|
title?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Tooltip extends React.ReactElement<TooltipProps> { }
|
||||||
|
interface TooltipClass extends React.ComponentClass<TooltipProps> { }
|
||||||
|
var Tooltip: TooltipClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Popover/>
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PopoverProps extends React.Props<PopoverClass> {
|
||||||
|
// Optional
|
||||||
|
arrowOffsetLeft?: number | string;
|
||||||
|
arrowOffsetTop?: number | string;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
id?: string;
|
||||||
|
placement?: string;
|
||||||
|
positionLeft?: number;
|
||||||
|
positionTop?: number;
|
||||||
|
title?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Popover extends React.ReactElement<PopoverProps> { }
|
||||||
|
interface PopoverClass extends React.ComponentClass<PopoverProps> { }
|
||||||
|
var Popover: PopoverClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Overlay />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface OverlayProps extends React.Props<OverlayClass> {
|
||||||
|
// Optional
|
||||||
|
animation?: any; // TODO: Add more specific type
|
||||||
|
container?: any; // TODO: Add more specific type
|
||||||
|
containerPadding?: number; // TODO: Add more specific type
|
||||||
|
onEnter?: Function;
|
||||||
|
onEntered?: Function;
|
||||||
|
onEntering?: Function;
|
||||||
|
onExit?: Function;
|
||||||
|
onExited?: Function;
|
||||||
|
onExiting?: Function;
|
||||||
|
onHide?: Function;
|
||||||
|
placement?: string;
|
||||||
|
rootClose?: boolean;
|
||||||
|
show?: boolean;
|
||||||
|
target?: Function;
|
||||||
|
}
|
||||||
|
interface Overlay extends React.ReactElement<OverlayProps> { }
|
||||||
|
interface OverlayClass extends React.ComponentClass<OverlayProps> { }
|
||||||
|
var Overlay: OverlayClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <ProgressBar />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ProgressBarProps extends React.Props<ProgressBarClass> {
|
||||||
|
// Optional
|
||||||
|
active?: boolean;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
interpolatedClass?: any; // TODO: Add more specific type
|
||||||
|
label?: any; // TODO: Add more specific type
|
||||||
|
max?: number;
|
||||||
|
min?: number;
|
||||||
|
now?: number;
|
||||||
|
srOnly?: boolean;
|
||||||
|
striped?: boolean;
|
||||||
|
}
|
||||||
|
interface ProgressBar extends React.ReactElement<ProgressBarProps> { }
|
||||||
|
interface ProgressBarClass extends React.ComponentClass<ProgressBarProps> { }
|
||||||
|
var ProgressBar: ProgressBarClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Nav />
|
||||||
|
// ----------------------------------------
|
||||||
|
// TODO: This one turned into a union of two different types
|
||||||
|
interface NavProps extends React.Props<NavClass> {
|
||||||
|
// Optional
|
||||||
|
activeHref?: string;
|
||||||
|
activeKey?: any;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
collapsible?: boolean;
|
||||||
|
eventKey?: any;
|
||||||
|
expanded?: boolean;
|
||||||
|
id?: string;
|
||||||
|
justified?: boolean;
|
||||||
|
navbar?: boolean;
|
||||||
|
onSelect?: Function;
|
||||||
|
pullRight?: boolean;
|
||||||
|
right?: boolean;
|
||||||
|
stacked?: boolean;
|
||||||
|
ulClassName?: string;
|
||||||
|
ulId?: string;
|
||||||
|
}
|
||||||
|
interface Nav extends React.ReactElement<NavProps> { }
|
||||||
|
interface NavClass extends React.ComponentClass<NavProps> { }
|
||||||
|
var Nav: NavClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <NavItem />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavItemProps extends React.Props<NavItemClass> {
|
||||||
|
active?: boolean;
|
||||||
|
brand?: any; // TODO: Add more specific type
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
componentClass?: any; // TODO: Add more specific type
|
||||||
|
defaultNavExpanded?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
|
eventKey?: any;
|
||||||
|
fixedBottom?: boolean;
|
||||||
|
fixedTop?: boolean;
|
||||||
|
fluid?: boolean;
|
||||||
|
href?: string;
|
||||||
|
inverse?: boolean;
|
||||||
|
linkId?: string;
|
||||||
|
navExpanded?: boolean;
|
||||||
|
onClick?: Function;
|
||||||
|
onSelect?: Function;
|
||||||
|
onToggle?: Function;
|
||||||
|
role?: string;
|
||||||
|
staticTop?: boolean;
|
||||||
|
target?: string;
|
||||||
|
title?: string;
|
||||||
|
toggleButton?: any; // TODO: Add more specific type
|
||||||
|
toggleNavKey?: string | number;
|
||||||
|
}
|
||||||
|
interface NavItem extends React.ReactElement<NavItemProps> { }
|
||||||
|
interface NavItemClass extends React.ComponentClass<NavItemProps> { }
|
||||||
|
var NavItem: NavItemClass;
|
||||||
|
|
||||||
|
// <Navbar.Brand />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavbarBrandProps extends React.Props<NavbarBrandClass> {
|
||||||
|
}
|
||||||
|
interface NavbarBrand extends React.ReactElement<NavbarBrandProps> { }
|
||||||
|
interface NavbarBrandClass extends React.ComponentClass<NavbarBrandProps> { }
|
||||||
|
|
||||||
|
// <Navbar.Collapse />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavbarCollapseProps extends React.Props<NavbarCollapseClass> {
|
||||||
|
}
|
||||||
|
interface NavbarCollapse extends React.ReactElement<NavbarCollapseProps> { }
|
||||||
|
interface NavbarCollapseClass extends React.ComponentClass<NavbarCollapseProps> { }
|
||||||
|
|
||||||
|
// <Navbar.Header />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavbarHeaderProps extends React.Props<NavbarHeaderClass> {
|
||||||
|
}
|
||||||
|
interface NavbarHeader extends React.ReactElement<NavbarHeaderProps> { }
|
||||||
|
interface NavbarHeaderClass extends React.ComponentClass<NavbarHeaderProps> { }
|
||||||
|
|
||||||
|
// <Navbar.Toggle />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavbarToggleProps extends React.Props<NavbarToggleClass> {
|
||||||
|
}
|
||||||
|
interface NavbarToggle extends React.ReactElement<NavbarToggleProps> { }
|
||||||
|
interface NavbarToggleClass extends React.ComponentClass<NavbarToggleProps> { }
|
||||||
|
|
||||||
|
// <Navbar />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavbarProps extends React.Props<NavbarClass> {
|
||||||
|
brand?: any; // TODO: Add more specific type
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
componentClass?: any; // TODO: Add more specific type
|
||||||
|
defaultNavExpanded?: boolean;
|
||||||
|
fixedBottom?: boolean;
|
||||||
|
fixedTop?: boolean;
|
||||||
|
fluid?: boolean;
|
||||||
|
inverse?: boolean;
|
||||||
|
navExpanded?: boolean;
|
||||||
|
onToggle?: Function;
|
||||||
|
role?: string;
|
||||||
|
staticTop?: boolean;
|
||||||
|
toggleButton?: any; // TODO: Add more specific type
|
||||||
|
toggleNavKey?: string | number;
|
||||||
|
}
|
||||||
|
interface Navbar extends React.ReactElement<NavbarProps> { }
|
||||||
|
interface NavbarClass extends React.ComponentClass<NavbarProps> {
|
||||||
|
Brand: NavbarBrandClass;
|
||||||
|
Collapse: NavbarCollapseClass;
|
||||||
|
Header: NavbarHeaderClass;
|
||||||
|
Toggle: NavbarToggleClass;
|
||||||
|
}
|
||||||
|
var Navbar: NavbarClass;
|
||||||
|
|
||||||
|
// <NavBrand />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavBrandProps {
|
||||||
|
|
||||||
|
}
|
||||||
|
interface NavBrand extends React.ReactElement<NavbarProps> { }
|
||||||
|
interface NavBrandClass extends React.ComponentClass<NavbarProps> { }
|
||||||
|
var NavBrand: NavBrandClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <NavDropdown />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface NavDropdownProps extends React.Props<NavDropdownClass> {
|
||||||
|
className?: string;
|
||||||
|
eventKey?: any;
|
||||||
|
title?: string;
|
||||||
|
id?: string;
|
||||||
|
}
|
||||||
|
interface NavDropdown extends React.ReactElement<NavDropdownProps> { }
|
||||||
|
interface NavDropdownClass extends React.ComponentClass<NavDropdownProps> { }
|
||||||
|
var NavDropdown: NavDropdownClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Tabs />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface TabsProps extends React.Props<TabsClass> {
|
||||||
|
activeKey?: any;
|
||||||
|
animation?: boolean;
|
||||||
|
bsStyle?: string;
|
||||||
|
defaultActiveKey?: any;
|
||||||
|
id?: string | number;
|
||||||
|
onSelect?: Function;
|
||||||
|
paneWidth?: any; // TODO: Add more specific type
|
||||||
|
position?: string;
|
||||||
|
tabWidth?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Tabs extends React.ReactElement<TabsProps> { }
|
||||||
|
interface TabsClass extends React.ComponentClass<TabsProps> { }
|
||||||
|
var Tabs: TabsClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Tab />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface TabProps extends React.Props<TabClass> {
|
||||||
|
animation?: boolean;
|
||||||
|
className?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
eventKey?: any; // TODO: Add more specific type
|
||||||
|
title?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Tab extends React.ReactElement<TabProps> { }
|
||||||
|
interface TabClass extends React.ComponentClass<TabProps> { }
|
||||||
|
var Tab: TabClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Pager />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PagerProps extends React.Props<PagerClass> {
|
||||||
|
className?: string;
|
||||||
|
onSelect?: Function;
|
||||||
|
}
|
||||||
|
interface Pager extends React.ReactElement<PagerProps> { }
|
||||||
|
interface PagerClass extends React.ComponentClass<PagerProps> { }
|
||||||
|
var Pager: PagerClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <PageItem />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PageItemProps extends React.Props<PageItemClass> {
|
||||||
|
className?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
eventKey?: any;
|
||||||
|
href?: string;
|
||||||
|
next?: boolean;
|
||||||
|
onSelect?: Function;
|
||||||
|
previous?: boolean;
|
||||||
|
target?: string;
|
||||||
|
title?: string;
|
||||||
|
}
|
||||||
|
interface PageItem extends React.ReactElement<PageItemProps> { }
|
||||||
|
interface PageItemClass extends React.ComponentClass<PageItemProps> { }
|
||||||
|
var PageItem: PageItemClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Pagination />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PaginationProps extends React.Props<PaginationClass> {
|
||||||
|
activePage?: number;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
buttonComponentClass?: any; // TODO: Add more specific type
|
||||||
|
className?: string;
|
||||||
|
ellipsis?: boolean;
|
||||||
|
first?: boolean;
|
||||||
|
items?: number;
|
||||||
|
last?: boolean;
|
||||||
|
maxButtons?: number;
|
||||||
|
next?: boolean;
|
||||||
|
onSelect?: Function;
|
||||||
|
prev?: boolean;
|
||||||
|
}
|
||||||
|
interface Pagination extends React.ReactElement<PaginationProps> { }
|
||||||
|
interface PaginationClass extends React.ComponentClass<PaginationProps> { }
|
||||||
|
var Pagination: PaginationClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Alert />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface AlertProps extends React.Props<AlertClass> {
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
closeLabel?: string;
|
||||||
|
dismissAfter?: number;
|
||||||
|
onDismiss?: Function;
|
||||||
|
}
|
||||||
|
interface Alert extends React.ReactElement<AlertProps> { }
|
||||||
|
interface AlertClass extends React.ComponentClass<AlertProps> { }
|
||||||
|
var Alert: AlertClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Carousel />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface CarouselProps extends React.Props<CarouselClass> {
|
||||||
|
activeIndex?: number;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
controls?: boolean;
|
||||||
|
defaultActiveIndex?: number;
|
||||||
|
direction?: string;
|
||||||
|
indicators?: boolean;
|
||||||
|
interval?: number;
|
||||||
|
nextIcon?: any; // TODO: Add more specific type
|
||||||
|
onSelect?: Function;
|
||||||
|
onSlideEnd?: Function;
|
||||||
|
pauseOnHover?: boolean;
|
||||||
|
prevIcon?: any; // TODO: Add more specific type
|
||||||
|
slide?: boolean;
|
||||||
|
wrap?: boolean;
|
||||||
|
}
|
||||||
|
interface Carousel extends React.ReactElement<CarouselProps> { }
|
||||||
|
interface CarouselClass extends React.ComponentClass<CarouselProps> { }
|
||||||
|
var Carousel: CarouselClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <CarouselItem />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface CarouselItemProps extends React.Props<CarouselItemClass> {
|
||||||
|
active?: boolean;
|
||||||
|
animtateIn?: boolean;
|
||||||
|
animateOut?: boolean;
|
||||||
|
caption?: any; // TODO: Add more specific type
|
||||||
|
className?: string;
|
||||||
|
direction?: string;
|
||||||
|
index?: number;
|
||||||
|
onAnimateOutEnd?: Function;
|
||||||
|
}
|
||||||
|
interface CarouselItem extends React.ReactElement<CarouselItemProps> { }
|
||||||
|
interface CarouselItemClass extends React.ComponentClass<CarouselItemProps> { }
|
||||||
|
var CarouselItem: CarouselItemClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Grid />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface GridProps extends React.Props<GridClass> {
|
||||||
|
className?: string;
|
||||||
|
componentClass?: any; // TODO: Add more specific type
|
||||||
|
fluid?: boolean;
|
||||||
|
}
|
||||||
|
interface Grid extends React.ReactElement<GridProps> { }
|
||||||
|
interface GridClass extends React.ComponentClass<GridProps> { }
|
||||||
|
var Grid: GridClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Row />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface RowProps extends React.Props<RowClass> {
|
||||||
|
className?: string;
|
||||||
|
componentClass?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Row extends React.ReactElement<RowProps> { }
|
||||||
|
interface RowClass extends React.ComponentClass<RowProps> { }
|
||||||
|
var Row: RowClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Col />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ColProps extends React.Props<ColClass> {
|
||||||
|
className?: string;
|
||||||
|
componentClass?: any; // TODO: Add more specific type
|
||||||
|
lg?: number;
|
||||||
|
lgOffset?: number;
|
||||||
|
lgPull?: number;
|
||||||
|
lgPush?: number;
|
||||||
|
md?: number;
|
||||||
|
mdOffset?: number;
|
||||||
|
mdPull?: number;
|
||||||
|
mdPush?: number;
|
||||||
|
sm?: number;
|
||||||
|
smOffset?: number;
|
||||||
|
smPull?: number;
|
||||||
|
smPush?: number;
|
||||||
|
xs?: number;
|
||||||
|
xsOffset?: number;
|
||||||
|
xsPull?: number;
|
||||||
|
xsPush?: number;
|
||||||
|
}
|
||||||
|
interface Col extends React.ReactElement<ColProps> { }
|
||||||
|
interface ColClass extends React.ComponentClass<ColProps> { }
|
||||||
|
var Col: ColClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Thumbnail />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ThumbnailProps extends React.Props<ThumbnailClass> {
|
||||||
|
alt?: string;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
href?: string;
|
||||||
|
src?: string;
|
||||||
|
}
|
||||||
|
interface Thumbnail extends React.ReactElement<ThumbnailProps> { }
|
||||||
|
interface ThumbnailClass extends React.ComponentClass<ThumbnailProps> { }
|
||||||
|
var Thumbnail: ThumbnailClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <ListGroup />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ListGroupProps extends React.Props<ListGroupClass> {
|
||||||
|
className?: string;
|
||||||
|
id?: string | number;
|
||||||
|
fill?: boolean; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface ListGroup extends React.ReactElement<ListGroupProps> { }
|
||||||
|
interface ListGroupClass extends React.ComponentClass<ListGroupProps> { }
|
||||||
|
var ListGroup: ListGroupClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <ListGroupItem />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ListGroupItemProps extends React.Props<ListGroupItemClass> {
|
||||||
|
active?: any;
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
disabled?: any;
|
||||||
|
eventKey?: any;
|
||||||
|
header?: any; // TODO: Add more specific type
|
||||||
|
href?: string;
|
||||||
|
key?: any; // TODO: Add more specific type
|
||||||
|
listItem?: boolean;
|
||||||
|
onClick?: Function; // TODO: Add more specific type
|
||||||
|
target?: string;
|
||||||
|
}
|
||||||
|
interface ListGroupItem extends React.ReactElement<ListGroupItemProps> { }
|
||||||
|
interface ListGroupItemClass extends React.ComponentClass<ListGroupItemProps> { }
|
||||||
|
var ListGroupItem: ListGroupItemClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Label />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface LabelProps extends React.Props<LabelClass> {
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
interface Label extends React.ReactElement<LabelProps> { }
|
||||||
|
interface LabelClass extends React.ComponentClass<LabelProps> { }
|
||||||
|
var Label: LabelClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Badge />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface BadgeProps extends React.Props<BadgeClass> {
|
||||||
|
className?: string;
|
||||||
|
pullRight?: boolean;
|
||||||
|
}
|
||||||
|
interface Badge extends React.ReactElement<BadgeProps> { }
|
||||||
|
interface BadgeClass extends React.ComponentClass<BadgeProps> { }
|
||||||
|
var Badge: BadgeClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Jumbotron />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface JumbotronProps extends React.Props<JumbotronClass> {
|
||||||
|
className?: string;
|
||||||
|
componentClass?: any; // TODO: Add more specific type
|
||||||
|
}
|
||||||
|
interface Jumbotron extends React.ReactElement<JumbotronProps> { }
|
||||||
|
interface JumbotronClass extends React.ComponentClass<JumbotronProps> { }
|
||||||
|
var Jumbotron: JumbotronClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <PageHeader />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PageHeaderProps extends React.Props<PageHeaderClass> {
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
interface PageHeader extends React.ReactElement<PageHeaderProps> { }
|
||||||
|
interface PageHeaderClass extends React.ComponentClass<PageHeaderProps> { }
|
||||||
|
var PageHeader: PageHeaderClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Well />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface WellProps extends React.Props<WellClass> {
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
interface Well extends React.ReactElement<WellProps> { }
|
||||||
|
interface WellClass extends React.ComponentClass<WellProps> { }
|
||||||
|
var Well: WellClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Glyphicon />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface GlyphiconProps extends React.Props<GlyphiconClass> {
|
||||||
|
className?: string;
|
||||||
|
// Required
|
||||||
|
glyph: string;
|
||||||
|
}
|
||||||
|
interface Glyphicon extends React.ReactElement<GlyphiconProps> { }
|
||||||
|
interface GlyphiconClass extends React.ComponentClass<GlyphiconProps> { }
|
||||||
|
var Glyphicon: GlyphiconClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Table />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface TableProps extends React.Props<TableClass> {
|
||||||
|
bordered?: boolean;
|
||||||
|
className?: string;
|
||||||
|
condensed?: boolean;
|
||||||
|
hover?: boolean;
|
||||||
|
responsive?: boolean;
|
||||||
|
striped?: boolean;
|
||||||
|
}
|
||||||
|
interface Table extends React.ReactElement<TableProps> { }
|
||||||
|
interface TableClass extends React.ComponentClass<TableProps> { }
|
||||||
|
var Table: TableClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Input />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface InputProps extends React.Props<InputClass> {
|
||||||
|
defaultValue?:string;
|
||||||
|
addonAfter?: any; // TODO: Add more specific type
|
||||||
|
addonBefore?: any; // TODO: Add more specific type
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
buttonAfter?: any; // TODO: Add more specific type
|
||||||
|
buttonBefore?: any; // TODO: Add more specific type
|
||||||
|
className?: string;
|
||||||
|
checked?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
|
feedbackIcon?: any; // TODO: Add more specific type
|
||||||
|
groupClassName?: string;
|
||||||
|
hasFeedback?: boolean;
|
||||||
|
help?: any; // TODO: Add more specific type
|
||||||
|
id?: string | number;
|
||||||
|
label?: any; // TODO: Add more specific type
|
||||||
|
labelClassName?: string;
|
||||||
|
multiple?: boolean;
|
||||||
|
placeholder?: string;
|
||||||
|
readOnly?: boolean;
|
||||||
|
type?: string;
|
||||||
|
onChange?: Function; // TODO: Add more specific type
|
||||||
|
onKeyDown?: Function; // TODO: Add more specific type
|
||||||
|
onKeyUp?: Function; // TODO: Add more specific type
|
||||||
|
onKeyPress?: Function; // TODO: Add more specific type
|
||||||
|
value?: any; // TODO: Add more specific type
|
||||||
|
wrapperClassName?: string;
|
||||||
|
}
|
||||||
|
interface Input extends React.ReactElement<InputProps> { }
|
||||||
|
interface InputClass extends React.ComponentClass<InputProps> { }
|
||||||
|
var Input: InputClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <ButtonInput />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface ButtonInputProps extends React.Props<ButtonInputClass> {
|
||||||
|
addonAfter?: any; // TODO: Add more specific type
|
||||||
|
addonBefore?: any; // TODO: Add more specific type
|
||||||
|
bsSize?: string;
|
||||||
|
bsStyle?: string;
|
||||||
|
buttonAfter?: any; // TODO: Add more specific type
|
||||||
|
buttonBefore?: any; // TODO: Add more specific type
|
||||||
|
className?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
feedbackIcon?: any; // TODO: Add more specific type
|
||||||
|
groupClassName?: string;
|
||||||
|
hasFeedback?: boolean;
|
||||||
|
help?: any; // TODO: Add more specific type
|
||||||
|
id?: string | number;
|
||||||
|
label?: any; // TODO: Add more specific type
|
||||||
|
labelClassName?: string;
|
||||||
|
multiple?: boolean;
|
||||||
|
onClick?: Function; // TODO: Add more specific type
|
||||||
|
type?: string;
|
||||||
|
value?: any; // TODO: Add more specific type
|
||||||
|
wrapperClassName?: string;
|
||||||
|
}
|
||||||
|
interface ButtonInput extends React.ReactElement<ButtonInputProps> { }
|
||||||
|
interface ButtonInputClass extends React.ComponentClass<ButtonInputProps> { }
|
||||||
|
var ButtonInput: ButtonInputClass;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: FormControls.Static
|
||||||
|
|
||||||
|
|
||||||
|
// <Portal />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PortalProps extends React.Props<PortalClass> {
|
||||||
|
dimension?: string | Function;
|
||||||
|
getDimensionValue?: Function;
|
||||||
|
in?: boolean;
|
||||||
|
onEnter?: Function;
|
||||||
|
onEntered?: Function;
|
||||||
|
onEntering?: Function;
|
||||||
|
onExit?: Function;
|
||||||
|
onExited?: Function;
|
||||||
|
onExiting?: Function;
|
||||||
|
role?: string;
|
||||||
|
timeout?: number;
|
||||||
|
transitionAppear?: boolean;
|
||||||
|
unmountOnExit?: boolean;
|
||||||
|
}
|
||||||
|
interface Portal extends React.ReactElement<PortalProps> { }
|
||||||
|
interface PortalClass extends React.ComponentClass<PortalProps> { }
|
||||||
|
var Portal: PortalClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Position />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface PositionProps extends React.Props<PositionClass> {
|
||||||
|
dimension?: string | Function;
|
||||||
|
getDimensionValue?: Function;
|
||||||
|
in?: boolean;
|
||||||
|
onEnter?: Function;
|
||||||
|
onEntered?: Function;
|
||||||
|
onEntering?: Function;
|
||||||
|
onExit?: Function;
|
||||||
|
onExited?: Function;
|
||||||
|
onExiting?: Function;
|
||||||
|
role?: string;
|
||||||
|
timeout?: number;
|
||||||
|
transitionAppear?: boolean;
|
||||||
|
unmountOnExit?: boolean;
|
||||||
|
}
|
||||||
|
interface Position extends React.ReactElement<PositionProps> { }
|
||||||
|
interface PositionClass extends React.ComponentClass<PositionProps> { }
|
||||||
|
var Position: PositionClass;
|
||||||
|
|
||||||
|
|
||||||
|
// <Fade />
|
||||||
|
// ----------------------------------------
|
||||||
|
interface FadeProps extends React.Props<FadeClass> {
|
||||||
|
in?: boolean;
|
||||||
|
onEnter?: Function;
|
||||||
|
onEntered?: Function;
|
||||||
|
onEntering?: Function;
|
||||||
|
onExit?: Function;
|
||||||
|
onExited?: Function;
|
||||||
|
onExiting?: Function;
|
||||||
|
timeout?: number;
|
||||||
|
transitionAppear?: boolean;
|
||||||
|
unmountOnExit?: boolean;
|
||||||
|
}
|
||||||
|
interface Fade extends React.ReactElement<FadeProps> { }
|
||||||
|
interface FadeClass extends React.ComponentClass<FadeProps> { }
|
||||||
|
var Fade: FadeClass;
|
||||||
|
}
|
||||||
69
samples/react/MusicStore/typings/react-redux/react-redux.d.ts
vendored
Normal file
69
samples/react/MusicStore/typings/react-redux/react-redux.d.ts
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
// Type definitions for react-redux 2.1.2
|
||||||
|
// Project: https://github.com/rackt/react-redux
|
||||||
|
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference path="../react/react.d.ts" />
|
||||||
|
/// <reference path="../redux/redux.d.ts" />
|
||||||
|
|
||||||
|
declare module "react-redux" {
|
||||||
|
import { Component } from 'react';
|
||||||
|
import { Store, Dispatch, ActionCreator } from 'redux';
|
||||||
|
|
||||||
|
export class ElementClass extends Component<any, any> { }
|
||||||
|
export interface ClassDecorator {
|
||||||
|
<T extends (typeof ElementClass)>(component: T): T
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connects a React component to a Redux store.
|
||||||
|
* @param mapStateToProps
|
||||||
|
* @param mapDispatchToProps
|
||||||
|
* @param mergeProps
|
||||||
|
* @param options
|
||||||
|
*/
|
||||||
|
export function connect(mapStateToProps?: MapStateToProps,
|
||||||
|
mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject,
|
||||||
|
mergeProps?: MergeProps,
|
||||||
|
options?: Options): ClassDecorator;
|
||||||
|
|
||||||
|
interface MapStateToProps {
|
||||||
|
(state: any, ownProps?: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MapDispatchToPropsFunction {
|
||||||
|
(dispatch: Dispatch, ownProps?: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MapDispatchToPropsObject {
|
||||||
|
[name: string]: ActionCreator;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MergeProps {
|
||||||
|
(stateProps: any, dispatchProps: any, ownProps: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Options {
|
||||||
|
/**
|
||||||
|
* If true, implements shouldComponentUpdate and shallowly compares the result of mergeProps,
|
||||||
|
* preventing unnecessary updates, assuming that the component is a “pure” component
|
||||||
|
* and does not rely on any input or state other than its props and the selected Redux store’s state.
|
||||||
|
* Defaults to true.
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
pure: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Property {
|
||||||
|
/**
|
||||||
|
* The single Redux store in your application.
|
||||||
|
*/
|
||||||
|
store?: Store;
|
||||||
|
children?: Function;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes the Redux store available to the connect() calls in the component hierarchy below.
|
||||||
|
*/
|
||||||
|
export class Provider extends Component<Property, {}> { }
|
||||||
|
}
|
||||||
46
samples/react/MusicStore/typings/react-router-bootstrap/react-router-bootstrap.d.ts
vendored
Normal file
46
samples/react/MusicStore/typings/react-router-bootstrap/react-router-bootstrap.d.ts
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// Type definitions for react-router-bootstrap
|
||||||
|
// Project: https://github.com/react-bootstrap/react-router-bootstrap
|
||||||
|
// Definitions by: Vincent Lesierse <https://github.com/vlesierse>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
///<reference path="../react/react.d.ts"/>
|
||||||
|
///<reference path="../react-router/react-router.d.ts"/>
|
||||||
|
|
||||||
|
declare namespace ReactRouterBootstrap {
|
||||||
|
// Import React
|
||||||
|
import React = __React;
|
||||||
|
|
||||||
|
interface LinkContainerProps extends ReactRouter.LinkProps {
|
||||||
|
disabled?: boolean
|
||||||
|
}
|
||||||
|
interface LinkContainer extends React.ComponentClass<LinkContainerProps> {}
|
||||||
|
interface LinkContainerElement extends React.ReactElement<LinkContainerProps> {}
|
||||||
|
const LinkContainer: LinkContainer
|
||||||
|
|
||||||
|
const IndexLinkContainer: LinkContainer
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router-bootstrap/lib/LinkContainer" {
|
||||||
|
|
||||||
|
export default ReactRouterBootstrap.LinkContainer
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router-bootstrap/lib/IndexLinkContainer" {
|
||||||
|
|
||||||
|
export default ReactRouterBootstrap.IndexLinkContainer
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router-bootstrap" {
|
||||||
|
|
||||||
|
import LinkContainer from "react-router-bootstrap/lib/LinkContainer"
|
||||||
|
|
||||||
|
import IndexLinkContainer from "react-router-bootstrap/lib/IndexLinkContainer"
|
||||||
|
|
||||||
|
export {
|
||||||
|
LinkContainer,
|
||||||
|
IndexLinkContainer
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
samples/react/MusicStore/typings/react-router-redux/react-router-redux.d.ts
vendored
Normal file
48
samples/react/MusicStore/typings/react-router-redux/react-router-redux.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
// Type definitions for react-router-redux v2.1.0
|
||||||
|
// Project: https://github.com/rackt/react-router-redux
|
||||||
|
// Definitions by: Isman Usoh <http://github.com/isman-usoh>, Noah Shipley <https://github.com/noah79>, Dimitri Rosenberg <https://github.com/rosendi>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference path="../redux/redux.d.ts" />
|
||||||
|
/// <reference path="../react-router/react-router.d.ts"/>
|
||||||
|
|
||||||
|
declare namespace ReactRouterRedux {
|
||||||
|
import R = Redux;
|
||||||
|
import H = HistoryModule;
|
||||||
|
|
||||||
|
const TRANSITION: string;
|
||||||
|
const UPDATE_LOCATION: string;
|
||||||
|
|
||||||
|
const push: PushAction;
|
||||||
|
const replace: ReplaceAction;
|
||||||
|
const go: GoAction;
|
||||||
|
const goBack: GoForwardAction;
|
||||||
|
const goForward: GoBackAction;
|
||||||
|
const routeActions: RouteActions;
|
||||||
|
|
||||||
|
type LocationDescriptor = H.Location | H.Path;
|
||||||
|
type PushAction = (nextLocation: LocationDescriptor) => void;
|
||||||
|
type ReplaceAction = (nextLocation: LocationDescriptor) => void;
|
||||||
|
type GoAction = (n: number) => void;
|
||||||
|
type GoForwardAction = () => void;
|
||||||
|
type GoBackAction = () => void;
|
||||||
|
|
||||||
|
interface RouteActions {
|
||||||
|
push: PushAction;
|
||||||
|
replace: ReplaceAction;
|
||||||
|
go: GoAction;
|
||||||
|
goForward: GoForwardAction;
|
||||||
|
goBack: GoBackAction;
|
||||||
|
}
|
||||||
|
interface HistoryMiddleware extends R.Middleware {
|
||||||
|
listenForReplays(store: R.Store, selectLocationState?: Function): void;
|
||||||
|
unsubscribe(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function routeReducer(state?: any, options?: any): R.Reducer;
|
||||||
|
function syncHistory(history: H.History): HistoryMiddleware;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router-redux" {
|
||||||
|
export = ReactRouterRedux;
|
||||||
|
}
|
||||||
192
samples/react/MusicStore/typings/react-router/history.d.ts
vendored
Normal file
192
samples/react/MusicStore/typings/react-router/history.d.ts
vendored
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
// Type definitions for history v1.13.1
|
||||||
|
// Project: https://github.com/rackt/history
|
||||||
|
// Definitions by: Sergey Buturlakin <http://github.com/sergey-buturlakin>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
|
||||||
|
declare namespace HistoryModule {
|
||||||
|
|
||||||
|
// types based on https://github.com/rackt/history/blob/master/docs/Terms.md
|
||||||
|
|
||||||
|
type Action = string
|
||||||
|
|
||||||
|
type BeforeUnloadHook = () => string | boolean
|
||||||
|
|
||||||
|
type CreateHistory<T> = (options?: HistoryOptions) => T
|
||||||
|
|
||||||
|
type CreateHistoryEnhancer<T, E> = (createHistory: CreateHistory<T>) => CreateHistory<T & E>
|
||||||
|
|
||||||
|
interface History {
|
||||||
|
listenBefore(hook: TransitionHook): Function
|
||||||
|
listen(listener: LocationListener): Function
|
||||||
|
transitionTo(location: Location): void
|
||||||
|
pushState(state: LocationState, path: Path): void
|
||||||
|
replaceState(state: LocationState, path: Path): void
|
||||||
|
push(path: Path): void
|
||||||
|
replace(path: Path): void
|
||||||
|
go(n: number): void
|
||||||
|
goBack(): void
|
||||||
|
goForward(): void
|
||||||
|
createKey(): LocationKey
|
||||||
|
createPath(path: Path): Path
|
||||||
|
createHref(path: Path): Href
|
||||||
|
createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location
|
||||||
|
|
||||||
|
/** @deprecated use location.key to save state instead */
|
||||||
|
setState(state: LocationState): void
|
||||||
|
/** @deprecated use listenBefore instead */
|
||||||
|
registerTransitionHook(hook: TransitionHook): void
|
||||||
|
/** @deprecated use the callback returned from listenBefore instead */
|
||||||
|
unregisterTransitionHook(hook: TransitionHook): void
|
||||||
|
}
|
||||||
|
|
||||||
|
type HistoryOptions = Object
|
||||||
|
|
||||||
|
type Href = string
|
||||||
|
|
||||||
|
type Location = {
|
||||||
|
pathname: Pathname
|
||||||
|
search: QueryString
|
||||||
|
query: Query
|
||||||
|
state: LocationState
|
||||||
|
action: Action
|
||||||
|
key: LocationKey
|
||||||
|
}
|
||||||
|
|
||||||
|
type LocationKey = string
|
||||||
|
|
||||||
|
type LocationListener = (location: Location) => void
|
||||||
|
|
||||||
|
type LocationState = Object
|
||||||
|
|
||||||
|
type Path = string // Pathname + QueryString
|
||||||
|
|
||||||
|
type Pathname = string
|
||||||
|
|
||||||
|
type Query = Object
|
||||||
|
|
||||||
|
type QueryString = string
|
||||||
|
|
||||||
|
type TransitionHook = (location: Location, callback: Function) => any
|
||||||
|
|
||||||
|
|
||||||
|
interface HistoryBeforeUnload {
|
||||||
|
listenBeforeUnload(hook: BeforeUnloadHook): Function
|
||||||
|
}
|
||||||
|
|
||||||
|
interface HistoryQueries {
|
||||||
|
pushState(state: LocationState, pathname: Pathname | Path, query?: Query): void
|
||||||
|
replaceState(state: LocationState, pathname: Pathname | Path, query?: Query): void
|
||||||
|
createPath(path: Path, query?: Query): Path
|
||||||
|
createHref(path: Path, query?: Query): Href
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Global usage, without modules, needs the small trick, because lib.d.ts
|
||||||
|
// already has `history` and `History` global definitions:
|
||||||
|
// var createHistory = ((window as any).History as HistoryModule.Module).createHistory;
|
||||||
|
interface Module {
|
||||||
|
createHistory: CreateHistory<History>
|
||||||
|
createHashHistory: CreateHistory<History>
|
||||||
|
createMemoryHistory: CreateHistory<History>
|
||||||
|
createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location
|
||||||
|
useBasename<T>(createHistory: CreateHistory<T>): CreateHistory<T>
|
||||||
|
useBeforeUnload<T>(createHistory: CreateHistory<T>): CreateHistory<T & HistoryBeforeUnload>
|
||||||
|
useQueries<T>(createHistory: CreateHistory<T>): CreateHistory<T & HistoryQueries>
|
||||||
|
actions: {
|
||||||
|
PUSH: string
|
||||||
|
REPLACE: string
|
||||||
|
POP: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/createBrowserHistory" {
|
||||||
|
|
||||||
|
export default function createBrowserHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/createHashHistory" {
|
||||||
|
|
||||||
|
export default function createHashHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/createMemoryHistory" {
|
||||||
|
|
||||||
|
export default function createMemoryHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/createLocation" {
|
||||||
|
|
||||||
|
export default function createLocation(path?: HistoryModule.Path, state?: HistoryModule.LocationState, action?: HistoryModule.Action, key?: HistoryModule.LocationKey): HistoryModule.Location
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/useBasename" {
|
||||||
|
|
||||||
|
export default function useBasename<T>(createHistory: HistoryModule.CreateHistory<T>): HistoryModule.CreateHistory<T>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/useBeforeUnload" {
|
||||||
|
|
||||||
|
export default function useBeforeUnload<T>(createHistory: HistoryModule.CreateHistory<T>): HistoryModule.CreateHistory<T & HistoryModule.HistoryBeforeUnload>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/useQueries" {
|
||||||
|
|
||||||
|
export default function useQueries<T>(createHistory: HistoryModule.CreateHistory<T>): HistoryModule.CreateHistory<T & HistoryModule.HistoryQueries>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history/lib/actions" {
|
||||||
|
|
||||||
|
export const PUSH: string
|
||||||
|
|
||||||
|
export const REPLACE: string
|
||||||
|
|
||||||
|
export const POP: string
|
||||||
|
|
||||||
|
export default {
|
||||||
|
PUSH,
|
||||||
|
REPLACE,
|
||||||
|
POP
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "history" {
|
||||||
|
|
||||||
|
export { default as createHistory } from "history/lib/createBrowserHistory"
|
||||||
|
|
||||||
|
export { default as createHashHistory } from "history/lib/createHashHistory"
|
||||||
|
|
||||||
|
export { default as createMemoryHistory } from "history/lib/createMemoryHistory"
|
||||||
|
|
||||||
|
export { default as createLocation } from "history/lib/createLocation"
|
||||||
|
|
||||||
|
export { default as useBasename } from "history/lib/useBasename"
|
||||||
|
|
||||||
|
export { default as useBeforeUnload } from "history/lib/useBeforeUnload"
|
||||||
|
|
||||||
|
export { default as useQueries } from "history/lib/useQueries"
|
||||||
|
|
||||||
|
import * as Actions from "history/lib/actions"
|
||||||
|
|
||||||
|
export { Actions }
|
||||||
|
|
||||||
|
}
|
||||||
474
samples/react/MusicStore/typings/react-router/react-router.d.ts
vendored
Normal file
474
samples/react/MusicStore/typings/react-router/react-router.d.ts
vendored
Normal file
@@ -0,0 +1,474 @@
|
|||||||
|
// Type definitions for react-router v2.0.0-rc5
|
||||||
|
// Project: https://github.com/rackt/react-router
|
||||||
|
// Definitions by: Sergey Buturlakin <http://github.com/sergey-buturlakin>, Yuichi Murata <https://github.com/mrk21>, Václav Ostrožlík <https://github.com/vasek17>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
|
||||||
|
/// <reference path="../react/react.d.ts" />
|
||||||
|
/// <reference path="./history.d.ts"/>
|
||||||
|
|
||||||
|
|
||||||
|
declare namespace ReactRouter {
|
||||||
|
|
||||||
|
import React = __React
|
||||||
|
|
||||||
|
import H = HistoryModule
|
||||||
|
|
||||||
|
// types based on https://github.com/rackt/react-router/blob/master/docs/Glossary.md
|
||||||
|
|
||||||
|
type Component = React.ReactType
|
||||||
|
|
||||||
|
type EnterHook = (nextState: RouterState, replaceState: RedirectFunction, callback?: Function) => any
|
||||||
|
|
||||||
|
type LeaveHook = () => any
|
||||||
|
|
||||||
|
type Params = Object
|
||||||
|
|
||||||
|
type ParseQueryString = (queryString: H.QueryString) => H.Query
|
||||||
|
|
||||||
|
type RedirectFunction = (state: H.LocationState, pathname: H.Pathname | H.Path, query?: H.Query) => void
|
||||||
|
|
||||||
|
type RouteComponent = Component
|
||||||
|
|
||||||
|
// use the following interface in an app code to get access to route param values, history, location...
|
||||||
|
// interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {}
|
||||||
|
// somewhere in MyComponent
|
||||||
|
// ...
|
||||||
|
// let id = this.props.routeParams.id
|
||||||
|
// ...
|
||||||
|
// this.props.history. ...
|
||||||
|
// ...
|
||||||
|
interface RouteComponentProps<P, R> {
|
||||||
|
history?: History
|
||||||
|
location?: H.Location
|
||||||
|
params?: P
|
||||||
|
route?: PlainRoute
|
||||||
|
routeParams?: R
|
||||||
|
routes?: PlainRoute[]
|
||||||
|
children?: React.ReactElement<any>
|
||||||
|
}
|
||||||
|
|
||||||
|
type RouteComponents = { [key: string]: RouteComponent }
|
||||||
|
|
||||||
|
type RouteConfig = React.ReactNode | PlainRoute | PlainRoute[]
|
||||||
|
|
||||||
|
type RouteHook = (nextLocation?: H.Location) => any
|
||||||
|
|
||||||
|
type RoutePattern = string
|
||||||
|
|
||||||
|
type StringifyQuery = (queryObject: H.Query) => H.QueryString
|
||||||
|
|
||||||
|
type RouterListener = (error: Error, nextState: RouterState) => void
|
||||||
|
|
||||||
|
interface RouterState {
|
||||||
|
location: H.Location
|
||||||
|
routes: PlainRoute[]
|
||||||
|
params: Params
|
||||||
|
components: RouteComponent[]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface HistoryBase extends H.History {
|
||||||
|
routes: PlainRoute[]
|
||||||
|
parseQueryString?: ParseQueryString
|
||||||
|
stringifyQuery?: StringifyQuery
|
||||||
|
}
|
||||||
|
|
||||||
|
type History = HistoryBase & H.HistoryQueries & HistoryRoutes
|
||||||
|
const browserHistory: History;
|
||||||
|
const hashHistory: History;
|
||||||
|
|
||||||
|
/* components */
|
||||||
|
|
||||||
|
interface RouterProps extends React.Props<Router> {
|
||||||
|
history?: H.History
|
||||||
|
routes?: RouteConfig // alias for children
|
||||||
|
createElement?: (component: RouteComponent, props: Object) => any
|
||||||
|
onError?: (error: any) => any
|
||||||
|
onUpdate?: () => any
|
||||||
|
parseQueryString?: ParseQueryString
|
||||||
|
stringifyQuery?: StringifyQuery
|
||||||
|
}
|
||||||
|
interface Router extends React.ComponentClass<RouterProps> {}
|
||||||
|
interface RouterElement extends React.ReactElement<RouterProps> {}
|
||||||
|
const Router: Router
|
||||||
|
|
||||||
|
|
||||||
|
interface LinkProps extends React.HTMLAttributes, React.Props<Link> {
|
||||||
|
activeStyle?: React.CSSProperties
|
||||||
|
activeClassName?: string
|
||||||
|
onlyActiveOnIndex?: boolean
|
||||||
|
to: RoutePattern
|
||||||
|
query?: H.Query
|
||||||
|
state?: H.LocationState
|
||||||
|
}
|
||||||
|
interface Link extends React.ComponentClass<LinkProps> {}
|
||||||
|
interface LinkElement extends React.ReactElement<LinkProps> {}
|
||||||
|
const Link: Link
|
||||||
|
|
||||||
|
|
||||||
|
const IndexLink: Link
|
||||||
|
|
||||||
|
|
||||||
|
interface RouterContextProps extends React.Props<RouterContext> {
|
||||||
|
history?: H.History
|
||||||
|
router: Router
|
||||||
|
createElement: (component: RouteComponent, props: Object) => any
|
||||||
|
location: H.Location
|
||||||
|
routes: RouteConfig
|
||||||
|
params: Params
|
||||||
|
components?: RouteComponent[]
|
||||||
|
}
|
||||||
|
interface RouterContext extends React.ComponentClass<RouterContextProps> {}
|
||||||
|
interface RouterContextElement extends React.ReactElement<RouterContextProps> {
|
||||||
|
history?: H.History
|
||||||
|
location: H.Location
|
||||||
|
router?: Router
|
||||||
|
}
|
||||||
|
const RouterContext: RouterContext
|
||||||
|
|
||||||
|
|
||||||
|
/* components (configuration) */
|
||||||
|
|
||||||
|
interface RouteProps extends React.Props<Route> {
|
||||||
|
path?: RoutePattern
|
||||||
|
component?: RouteComponent
|
||||||
|
components?: RouteComponents
|
||||||
|
getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void
|
||||||
|
getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void
|
||||||
|
onEnter?: EnterHook
|
||||||
|
onLeave?: LeaveHook
|
||||||
|
getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void
|
||||||
|
getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void
|
||||||
|
}
|
||||||
|
interface Route extends React.ComponentClass<RouteProps> {}
|
||||||
|
interface RouteElement extends React.ReactElement<RouteProps> {}
|
||||||
|
const Route: Route
|
||||||
|
|
||||||
|
|
||||||
|
interface PlainRoute {
|
||||||
|
path?: RoutePattern
|
||||||
|
component?: RouteComponent
|
||||||
|
components?: RouteComponents
|
||||||
|
getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void
|
||||||
|
getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void
|
||||||
|
onEnter?: EnterHook
|
||||||
|
onLeave?: LeaveHook
|
||||||
|
indexRoute?: PlainRoute
|
||||||
|
getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void
|
||||||
|
childRoutes?: PlainRoute[]
|
||||||
|
getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface RedirectProps extends React.Props<Redirect> {
|
||||||
|
path?: RoutePattern
|
||||||
|
from?: RoutePattern // alias for path
|
||||||
|
to: RoutePattern
|
||||||
|
query?: H.Query
|
||||||
|
state?: H.LocationState
|
||||||
|
}
|
||||||
|
interface Redirect extends React.ComponentClass<RedirectProps> {}
|
||||||
|
interface RedirectElement extends React.ReactElement<RedirectProps> {}
|
||||||
|
const Redirect: Redirect
|
||||||
|
|
||||||
|
|
||||||
|
interface IndexRouteProps extends React.Props<IndexRoute> {
|
||||||
|
component?: RouteComponent
|
||||||
|
components?: RouteComponents
|
||||||
|
getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void
|
||||||
|
getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void
|
||||||
|
onEnter?: EnterHook
|
||||||
|
onLeave?: LeaveHook
|
||||||
|
}
|
||||||
|
interface IndexRoute extends React.ComponentClass<IndexRouteProps> {}
|
||||||
|
interface IndexRouteElement extends React.ReactElement<IndexRouteProps> {}
|
||||||
|
const IndexRoute: IndexRoute
|
||||||
|
|
||||||
|
|
||||||
|
interface IndexRedirectProps extends React.Props<IndexRedirect> {
|
||||||
|
to: RoutePattern
|
||||||
|
query?: H.Query
|
||||||
|
state?: H.LocationState
|
||||||
|
}
|
||||||
|
interface IndexRedirect extends React.ComponentClass<IndexRedirectProps> {}
|
||||||
|
interface IndexRedirectElement extends React.ReactElement<IndexRedirectProps> {}
|
||||||
|
const IndexRedirect: IndexRedirect
|
||||||
|
|
||||||
|
|
||||||
|
/* mixins */
|
||||||
|
|
||||||
|
interface HistoryMixin {
|
||||||
|
history: History
|
||||||
|
}
|
||||||
|
const History: React.Mixin<any, any>
|
||||||
|
|
||||||
|
|
||||||
|
interface LifecycleMixin {
|
||||||
|
routerWillLeave(nextLocation: H.Location): string | boolean
|
||||||
|
}
|
||||||
|
const Lifecycle: React.Mixin<any, any>
|
||||||
|
|
||||||
|
|
||||||
|
const RouteContext: React.Mixin<any, any>
|
||||||
|
|
||||||
|
|
||||||
|
/* utils */
|
||||||
|
|
||||||
|
interface HistoryRoutes {
|
||||||
|
listen(listener: RouterListener): Function
|
||||||
|
listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void
|
||||||
|
match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void
|
||||||
|
isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
function useRoutes<T>(createHistory: HistoryModule.CreateHistory<T>): HistoryModule.CreateHistory<T & HistoryRoutes>
|
||||||
|
|
||||||
|
|
||||||
|
function createRoutes(routes: RouteConfig): PlainRoute[]
|
||||||
|
|
||||||
|
|
||||||
|
interface MatchArgs {
|
||||||
|
routes?: RouteConfig
|
||||||
|
history?: H.History
|
||||||
|
location?: H.Location
|
||||||
|
parseQueryString?: ParseQueryString
|
||||||
|
stringifyQuery?: StringifyQuery
|
||||||
|
}
|
||||||
|
interface MatchState extends RouterState {
|
||||||
|
history: History
|
||||||
|
}
|
||||||
|
function match(args: MatchArgs, cb: (error: any, nextLocation: H.Location, nextState: MatchState) => void): void
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/Router" {
|
||||||
|
|
||||||
|
export default ReactRouter.Router
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/Link" {
|
||||||
|
|
||||||
|
export default ReactRouter.Link
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/IndexLink" {
|
||||||
|
|
||||||
|
export default ReactRouter.IndexLink
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/IndexRedirect" {
|
||||||
|
|
||||||
|
export default ReactRouter.IndexRedirect
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/IndexRoute" {
|
||||||
|
|
||||||
|
export default ReactRouter.IndexRoute
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/Redirect" {
|
||||||
|
|
||||||
|
export default ReactRouter.Redirect
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/Route" {
|
||||||
|
|
||||||
|
export default ReactRouter.Route
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/History" {
|
||||||
|
|
||||||
|
export default ReactRouter.History
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/Lifecycle" {
|
||||||
|
|
||||||
|
export default ReactRouter.Lifecycle
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/RouteContext" {
|
||||||
|
|
||||||
|
export default ReactRouter.RouteContext
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/useRoutes" {
|
||||||
|
|
||||||
|
export default ReactRouter.useRoutes
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router/lib/PatternUtils" {
|
||||||
|
|
||||||
|
export function formatPattern(pattern: string, params: {}): string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router/lib/RouteUtils" {
|
||||||
|
|
||||||
|
type E = __React.ReactElement<any>
|
||||||
|
|
||||||
|
export function isReactChildren(object: E | E[]): boolean
|
||||||
|
|
||||||
|
export function createRouteFromReactElement(element: E): ReactRouter.PlainRoute
|
||||||
|
|
||||||
|
export function createRoutesFromReactChildren(children: E | E[], parentRoute: ReactRouter.PlainRoute): ReactRouter.PlainRoute[]
|
||||||
|
|
||||||
|
export import createRoutes = ReactRouter.createRoutes
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/RouterContext" {
|
||||||
|
|
||||||
|
export default ReactRouter.RouterContext
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router/lib/PropTypes" {
|
||||||
|
|
||||||
|
import React = __React
|
||||||
|
|
||||||
|
export function falsy(props: any, propName: string, componentName: string): Error;
|
||||||
|
|
||||||
|
export const history: React.Requireable<any>
|
||||||
|
|
||||||
|
export const location: React.Requireable<any>
|
||||||
|
|
||||||
|
export const component: React.Requireable<any>
|
||||||
|
|
||||||
|
export const components: React.Requireable<any>
|
||||||
|
|
||||||
|
export const route: React.Requireable<any>
|
||||||
|
|
||||||
|
export const routes: React.Requireable<any>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
falsy,
|
||||||
|
history,
|
||||||
|
location,
|
||||||
|
component,
|
||||||
|
components,
|
||||||
|
route
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router/lib/browserHistory" {
|
||||||
|
export default ReactRouter.browserHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router/lib/hashHistory" {
|
||||||
|
export default ReactRouter.hashHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-router/lib/match" {
|
||||||
|
|
||||||
|
export default ReactRouter.match
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare module "react-router" {
|
||||||
|
|
||||||
|
import Router from "react-router/lib/Router"
|
||||||
|
|
||||||
|
import Link from "react-router/lib/Link"
|
||||||
|
|
||||||
|
import IndexLink from "react-router/lib/IndexLink"
|
||||||
|
|
||||||
|
import IndexRedirect from "react-router/lib/IndexRedirect"
|
||||||
|
|
||||||
|
import IndexRoute from "react-router/lib/IndexRoute"
|
||||||
|
|
||||||
|
import Redirect from "react-router/lib/Redirect"
|
||||||
|
|
||||||
|
import Route from "react-router/lib/Route"
|
||||||
|
|
||||||
|
import History from "react-router/lib/History"
|
||||||
|
|
||||||
|
import Lifecycle from "react-router/lib/Lifecycle"
|
||||||
|
|
||||||
|
import RouteContext from "react-router/lib/RouteContext"
|
||||||
|
|
||||||
|
import browserHistory from "react-router/lib/browserHistory"
|
||||||
|
|
||||||
|
import hashHistory from "react-router/lib/hashHistory"
|
||||||
|
|
||||||
|
import useRoutes from "react-router/lib/useRoutes"
|
||||||
|
|
||||||
|
import { createRoutes } from "react-router/lib/RouteUtils"
|
||||||
|
|
||||||
|
import { formatPattern } from "react-router/lib/PatternUtils"
|
||||||
|
|
||||||
|
import RouterContext from "react-router/lib/RouterContext"
|
||||||
|
|
||||||
|
import PropTypes from "react-router/lib/PropTypes"
|
||||||
|
|
||||||
|
import match from "react-router/lib/match"
|
||||||
|
|
||||||
|
// PlainRoute is defined in the API documented at:
|
||||||
|
// https://github.com/rackt/react-router/blob/master/docs/API.md
|
||||||
|
// but not included in any of the .../lib modules above.
|
||||||
|
export type PlainRoute = ReactRouter.PlainRoute
|
||||||
|
|
||||||
|
// The following definitions are also very useful to export
|
||||||
|
// because by using these types lots of potential type errors
|
||||||
|
// can be exposed:
|
||||||
|
export type EnterHook = ReactRouter.EnterHook
|
||||||
|
export type LeaveHook = ReactRouter.LeaveHook
|
||||||
|
export type ParseQueryString = ReactRouter.ParseQueryString
|
||||||
|
export type RedirectFunction = ReactRouter.RedirectFunction
|
||||||
|
export type RouteComponentProps<P,R> = ReactRouter.RouteComponentProps<P,R>;
|
||||||
|
export type RouteHook = ReactRouter.RouteHook
|
||||||
|
export type StringifyQuery = ReactRouter.StringifyQuery
|
||||||
|
export type RouterListener = ReactRouter.RouterListener
|
||||||
|
export type RouterState = ReactRouter.RouterState
|
||||||
|
export type HistoryBase = ReactRouter.HistoryBase
|
||||||
|
|
||||||
|
export {
|
||||||
|
Router,
|
||||||
|
Link,
|
||||||
|
IndexLink,
|
||||||
|
IndexRedirect,
|
||||||
|
IndexRoute,
|
||||||
|
Redirect,
|
||||||
|
Route,
|
||||||
|
History,
|
||||||
|
browserHistory,
|
||||||
|
hashHistory,
|
||||||
|
Lifecycle,
|
||||||
|
RouteContext,
|
||||||
|
useRoutes,
|
||||||
|
createRoutes,
|
||||||
|
formatPattern,
|
||||||
|
RouterContext,
|
||||||
|
PropTypes,
|
||||||
|
match
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Router
|
||||||
|
|
||||||
|
}
|
||||||
66
samples/react/MusicStore/typings/react/react-dom.d.ts
vendored
Normal file
66
samples/react/MusicStore/typings/react/react-dom.d.ts
vendored
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// Type definitions for React v0.14 (react-dom)
|
||||||
|
// Project: http://facebook.github.io/react/
|
||||||
|
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference path="react.d.ts" />
|
||||||
|
|
||||||
|
declare namespace __React {
|
||||||
|
namespace __DOM {
|
||||||
|
function findDOMNode<E extends Element>(instance: ReactInstance): E;
|
||||||
|
function findDOMNode(instance: ReactInstance): Element;
|
||||||
|
|
||||||
|
function render<P>(
|
||||||
|
element: DOMElement<P>,
|
||||||
|
container: Element,
|
||||||
|
callback?: (element: Element) => any): Element;
|
||||||
|
function render<P, S>(
|
||||||
|
element: ClassicElement<P>,
|
||||||
|
container: Element,
|
||||||
|
callback?: (component: ClassicComponent<P, S>) => any): ClassicComponent<P, S>;
|
||||||
|
function render<P, S>(
|
||||||
|
element: ReactElement<P>,
|
||||||
|
container: Element,
|
||||||
|
callback?: (component: Component<P, S>) => any): Component<P, S>;
|
||||||
|
|
||||||
|
function unmountComponentAtNode(container: Element): boolean;
|
||||||
|
|
||||||
|
var version: string;
|
||||||
|
|
||||||
|
function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
|
||||||
|
function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
|
||||||
|
function unstable_batchedUpdates(callback: () => any): void;
|
||||||
|
|
||||||
|
function unstable_renderSubtreeIntoContainer<P>(
|
||||||
|
parentComponent: Component<any, any>,
|
||||||
|
nextElement: DOMElement<P>,
|
||||||
|
container: Element,
|
||||||
|
callback?: (element: Element) => any): Element;
|
||||||
|
function unstable_renderSubtreeIntoContainer<P, S>(
|
||||||
|
parentComponent: Component<any, any>,
|
||||||
|
nextElement: ClassicElement<P>,
|
||||||
|
container: Element,
|
||||||
|
callback?: (component: ClassicComponent<P, S>) => any): ClassicComponent<P, S>;
|
||||||
|
function unstable_renderSubtreeIntoContainer<P, S>(
|
||||||
|
parentComponent: Component<any, any>,
|
||||||
|
nextElement: ReactElement<P>,
|
||||||
|
container: Element,
|
||||||
|
callback?: (component: Component<P, S>) => any): Component<P, S>;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace __DOMServer {
|
||||||
|
function renderToString(element: ReactElement<any>): string;
|
||||||
|
function renderToStaticMarkup(element: ReactElement<any>): string;
|
||||||
|
var version: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-dom" {
|
||||||
|
import DOM = __React.__DOM;
|
||||||
|
export = DOM;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "react-dom/server" {
|
||||||
|
import DOMServer = __React.__DOMServer;
|
||||||
|
export = DOMServer;
|
||||||
|
}
|
||||||
2274
samples/react/MusicStore/typings/react/react.d.ts
vendored
Normal file
2274
samples/react/MusicStore/typings/react/react.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
samples/react/MusicStore/typings/redux-thunk/redux-thunk.d.ts
vendored
Normal file
18
samples/react/MusicStore/typings/redux-thunk/redux-thunk.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
// Type definitions for redux-thunk
|
||||||
|
// Project: https://github.com/gaearon/redux-thunk
|
||||||
|
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
/// <reference path="../redux/redux.d.ts" />
|
||||||
|
|
||||||
|
declare module ReduxThunk {
|
||||||
|
export interface Thunk extends Redux.Middleware {}
|
||||||
|
export interface ThunkInterface {
|
||||||
|
<T>(dispatch: Redux.Dispatch, getState?: () => T): any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "redux-thunk" {
|
||||||
|
var thunk: ReduxThunk.Thunk;
|
||||||
|
export = thunk;
|
||||||
|
}
|
||||||
52
samples/react/MusicStore/typings/redux/redux.d.ts
vendored
Normal file
52
samples/react/MusicStore/typings/redux/redux.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
// Type definitions for Redux v1.0.0
|
||||||
|
// Project: https://github.com/rackt/redux
|
||||||
|
// Definitions by: William Buchwalter <https://github.com/wbuchwalter/>, Vincent Prouillet <https://github.com/Keats/>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
declare module Redux {
|
||||||
|
|
||||||
|
interface ActionCreator extends Function {
|
||||||
|
(...args: any[]): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Reducer extends Function {
|
||||||
|
(state: any, action: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Dispatch extends Function {
|
||||||
|
(action: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface StoreMethods {
|
||||||
|
dispatch: Dispatch;
|
||||||
|
getState(): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface MiddlewareArg {
|
||||||
|
dispatch: Dispatch;
|
||||||
|
getState: Function;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Middleware extends Function {
|
||||||
|
(obj: MiddlewareArg): Function;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Store {
|
||||||
|
getReducer(): Reducer;
|
||||||
|
replaceReducer(nextReducer: Reducer): void;
|
||||||
|
dispatch(action: any): any;
|
||||||
|
getState(): any;
|
||||||
|
subscribe(listener: Function): Function;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStore(reducer: Reducer, initialState?: any): Store;
|
||||||
|
function bindActionCreators<T>(actionCreators: T, dispatch: Dispatch): T;
|
||||||
|
function combineReducers(reducers: any): Reducer;
|
||||||
|
function applyMiddleware(...middlewares: Middleware[]): Function;
|
||||||
|
function compose<T extends Function>(...functions: Function[]): T;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "redux" {
|
||||||
|
export = Redux;
|
||||||
|
}
|
||||||
12
samples/react/MusicStore/typings/tsd.d.ts
vendored
Normal file
12
samples/react/MusicStore/typings/tsd.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/// <reference path="react-redux/react-redux.d.ts" />
|
||||||
|
/// <reference path="react/react-dom.d.ts" />
|
||||||
|
/// <reference path="react/react.d.ts" />
|
||||||
|
/// <reference path="redux/redux.d.ts" />
|
||||||
|
/// <reference path="webpack/webpack-env.d.ts" />
|
||||||
|
/// <reference path="react-bootstrap/react-bootstrap.d.ts" />
|
||||||
|
/// <reference path="react-router/history.d.ts" />
|
||||||
|
/// <reference path="react-router/react-router.d.ts" />
|
||||||
|
/// <reference path="react-router-bootstrap/react-router-bootstrap.d.ts" />
|
||||||
|
/// <reference path="react-router-redux/react-router-redux.d.ts" />
|
||||||
|
/// <reference path="redux-thunk/redux-thunk.d.ts" />
|
||||||
|
/// <reference path="whatwg-fetch/whatwg-fetch.d.ts" />
|
||||||
232
samples/react/MusicStore/typings/webpack/webpack-env.d.ts
vendored
Normal file
232
samples/react/MusicStore/typings/webpack/webpack-env.d.ts
vendored
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
// Type definitions for webpack 1.12.2 (module API)
|
||||||
|
// Project: https://github.com/webpack/webpack
|
||||||
|
// Definitions by: use-strict <https://github.com/use-strict>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Webpack module API - variables and global functions available inside modules
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare namespace __WebpackModuleApi {
|
||||||
|
interface RequireContext {
|
||||||
|
keys(): string[];
|
||||||
|
<T>(id: string): T;
|
||||||
|
resolve(id: string): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RequireFunction {
|
||||||
|
/**
|
||||||
|
* Returns the exports from a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available.
|
||||||
|
*/
|
||||||
|
<T>(path: string): T;
|
||||||
|
/**
|
||||||
|
* Behaves similar to require.ensure, but the callback is called with the exports of each dependency in the paths array. There is no option to provide a chunk name.
|
||||||
|
*/
|
||||||
|
(paths: string[], callback: (...modules: any[]) => void): void;
|
||||||
|
/**
|
||||||
|
* Download additional dependencies on demand. The paths array lists modules that should be available. When they are, callback is called. If the callback is a function expression, dependencies in that source part are extracted and also loaded on demand. A single request is fired to the server, except if all modules are already available.
|
||||||
|
*
|
||||||
|
* This creates a chunk. The chunk can be named. If a chunk with this name already exists, the dependencies are merged into that chunk and that chunk is used.
|
||||||
|
*/
|
||||||
|
ensure: (paths: string[], callback: (require: <T>(path: string) => T) => void, chunkName?: string) => void;
|
||||||
|
context: (path: string, deep?: boolean, filter?: RegExp) => RequireContext;
|
||||||
|
/**
|
||||||
|
* Returns the module id of a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available.
|
||||||
|
*
|
||||||
|
* The module id is a number in webpack (in contrast to node.js where it is a string, the filename).
|
||||||
|
*/
|
||||||
|
resolve(path: string): number;
|
||||||
|
/**
|
||||||
|
* Like require.resolve, but doesn’t include the module into the bundle. It’s a weak dependency.
|
||||||
|
*/
|
||||||
|
resolveWeak(path: string): number;
|
||||||
|
/**
|
||||||
|
* Ensures that the dependency is available, but don’t execute it. This can be use for optimizing the position of a module in the chunks.
|
||||||
|
*/
|
||||||
|
include(path: string): void;
|
||||||
|
/**
|
||||||
|
* Multiple requires to the same module result in only one module execution and only one export. Therefore a cache in the runtime exists. Removing values from this cache cause new module execution and a new export. This is only needed in rare cases (for compatibility!).
|
||||||
|
*/
|
||||||
|
cache: {
|
||||||
|
[id: string]: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Module {
|
||||||
|
exports: any;
|
||||||
|
require(id: string): any;
|
||||||
|
id: string;
|
||||||
|
filename: string;
|
||||||
|
loaded: boolean;
|
||||||
|
parent: any;
|
||||||
|
children: any[];
|
||||||
|
hot: Hot;
|
||||||
|
}
|
||||||
|
type ModuleId = string|number;
|
||||||
|
|
||||||
|
interface Hot {
|
||||||
|
/**
|
||||||
|
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
|
||||||
|
* @param dependencies
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
accept(dependencies: string[], callback: (updatedDependencies: ModuleId[]) => void): void;
|
||||||
|
/**
|
||||||
|
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
|
||||||
|
* @param dependency
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
accept(dependency: string, callback: () => void): void;
|
||||||
|
/**
|
||||||
|
* Accept code updates for this module without notification of parents.
|
||||||
|
* This should only be used if the module doesn’t export anything.
|
||||||
|
* The errHandler can be used to handle errors that occur while loading the updated module.
|
||||||
|
* @param errHandler
|
||||||
|
*/
|
||||||
|
accept(errHandler?: (err: Error) => void): void;
|
||||||
|
/**
|
||||||
|
* Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
|
||||||
|
*/
|
||||||
|
decline(dependencies: string[]): void;
|
||||||
|
/**
|
||||||
|
* Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline".
|
||||||
|
*/
|
||||||
|
decline(dependency: string): void;
|
||||||
|
/**
|
||||||
|
* Flag the current module as not update-able. If updated the update code would fail with code "decline".
|
||||||
|
*/
|
||||||
|
decline(): void;
|
||||||
|
/**
|
||||||
|
* Add a one time handler, which is executed when the current module code is replaced.
|
||||||
|
* Here you should destroy/remove any persistent resource you have claimed/created.
|
||||||
|
* If you want to transfer state to the new module, add it to data object.
|
||||||
|
* The data will be available at module.hot.data on the new module.
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
dispose<T>(callback: (data: T) => void): void;
|
||||||
|
/**
|
||||||
|
* Add a one time handler, which is executed when the current module code is replaced.
|
||||||
|
* Here you should destroy/remove any persistent resource you have claimed/created.
|
||||||
|
* If you want to transfer state to the new module, add it to data object.
|
||||||
|
* The data will be available at module.hot.data on the new module.
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
addDisposeHandler<T>(callback: (data: T) => void): void;
|
||||||
|
/**
|
||||||
|
* Remove a handler.
|
||||||
|
* This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function.
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
removeDisposeHandler<T>(callback: (data: T) => void): void;
|
||||||
|
/**
|
||||||
|
* Throws an exceptions if status() is not idle.
|
||||||
|
* Check all currently loaded modules for updates and apply updates if found.
|
||||||
|
* If no update was found, the callback is called with null.
|
||||||
|
* If autoApply is truthy the callback will be called with all modules that were disposed.
|
||||||
|
* apply() is automatically called with autoApply as options parameter.
|
||||||
|
* If autoApply is not set the callback will be called with all modules that will be disposed on apply().
|
||||||
|
* @param autoApply
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
check(autoApply: boolean, callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||||
|
/**
|
||||||
|
* Throws an exceptions if status() is not idle.
|
||||||
|
* Check all currently loaded modules for updates and apply updates if found.
|
||||||
|
* If no update was found, the callback is called with null.
|
||||||
|
* The callback will be called with all modules that will be disposed on apply().
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
check(callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||||
|
/**
|
||||||
|
* If status() != "ready" it throws an error.
|
||||||
|
* Continue the update process.
|
||||||
|
* @param options
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
apply(options: AcceptOptions, callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||||
|
/**
|
||||||
|
* If status() != "ready" it throws an error.
|
||||||
|
* Continue the update process.
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
apply(callback: (err: Error, outdatedModules: ModuleId[]) => void): void;
|
||||||
|
/**
|
||||||
|
* Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail.
|
||||||
|
*/
|
||||||
|
status(): string;
|
||||||
|
/** Register a callback on status change. */
|
||||||
|
status(callback: (status: string) => void): void;
|
||||||
|
/** Register a callback on status change. */
|
||||||
|
addStatusHandler(callback: (status: string) => void): void;
|
||||||
|
/**
|
||||||
|
* Remove a registered status change handler.
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
removeStatusHandler(callback: (status: string) => void): void;
|
||||||
|
|
||||||
|
active: boolean;
|
||||||
|
data: {};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AcceptOptions {
|
||||||
|
/**
|
||||||
|
* If true the update process continues even if some modules are not accepted (and would bubble to the entry point).
|
||||||
|
*/
|
||||||
|
ignoreUnaccepted?: boolean;
|
||||||
|
/**
|
||||||
|
* Indicates that apply() is automatically called by check function
|
||||||
|
*/
|
||||||
|
autoApply?: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare var require: __WebpackModuleApi.RequireFunction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource query of the current module.
|
||||||
|
*
|
||||||
|
* e.g. __resourceQuery === "?test" // Inside "file.js?test"
|
||||||
|
*/
|
||||||
|
declare var __resourceQuery: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equals the config options output.publicPath.
|
||||||
|
*/
|
||||||
|
declare var __webpack_public_path__: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The raw require function. This expression isn’t parsed by the Parser for dependencies.
|
||||||
|
*/
|
||||||
|
declare var __webpack_require__: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The internal chunk loading function
|
||||||
|
*
|
||||||
|
* @param chunkId The id for the chunk to load.
|
||||||
|
* @param callback A callback function called once the chunk is loaded.
|
||||||
|
*/
|
||||||
|
declare var __webpack_chunk_load__: (chunkId: any, callback: (require: (id: string) => any) => void) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access to the internal object of all modules.
|
||||||
|
*/
|
||||||
|
declare var __webpack_modules__: any[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access to the hash of the compilation.
|
||||||
|
*
|
||||||
|
* Only available with the HotModuleReplacementPlugin or the ExtendedAPIPlugin
|
||||||
|
*/
|
||||||
|
declare var __webpack_hash__: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a require function that is not parsed by webpack. Can be used to do cool stuff with a global require function if available.
|
||||||
|
*/
|
||||||
|
declare var __non_webpack_require__: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equals the config option debug
|
||||||
|
*/
|
||||||
|
declare var DEBUG: boolean;
|
||||||
|
|
||||||
|
declare var module: __WebpackModuleApi.Module;
|
||||||
85
samples/react/MusicStore/typings/whatwg-fetch/whatwg-fetch.d.ts
vendored
Normal file
85
samples/react/MusicStore/typings/whatwg-fetch/whatwg-fetch.d.ts
vendored
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
// Type definitions for fetch API
|
||||||
|
// Project: https://github.com/github/fetch
|
||||||
|
// Definitions by: Ryan Graham <https://github.com/ryan-codingintrigue>
|
||||||
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||||
|
|
||||||
|
declare class Request extends Body {
|
||||||
|
constructor(input: string|Request, init?:RequestInit);
|
||||||
|
method: string;
|
||||||
|
url: string;
|
||||||
|
headers: Headers;
|
||||||
|
context: string|RequestContext;
|
||||||
|
referrer: string;
|
||||||
|
mode: string|RequestMode;
|
||||||
|
credentials: string|RequestCredentials;
|
||||||
|
cache: string|RequestCache;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RequestInit {
|
||||||
|
method?: string;
|
||||||
|
headers?: HeaderInit|{ [index: string]: string };
|
||||||
|
body?: BodyInit;
|
||||||
|
mode?: string|RequestMode;
|
||||||
|
credentials?: string|RequestCredentials;
|
||||||
|
cache?: string|RequestCache;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare enum RequestContext {
|
||||||
|
"audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch",
|
||||||
|
"font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import",
|
||||||
|
"internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script",
|
||||||
|
"serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker",
|
||||||
|
"xmlhttprequest", "xslt"
|
||||||
|
}
|
||||||
|
declare enum RequestMode { "same-origin", "no-cors", "cors" }
|
||||||
|
declare enum RequestCredentials { "omit", "same-origin", "include" }
|
||||||
|
declare enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" }
|
||||||
|
|
||||||
|
declare class Headers {
|
||||||
|
append(name: string, value: string): void;
|
||||||
|
delete(name: string):void;
|
||||||
|
get(name: string): string;
|
||||||
|
getAll(name: string): Array<string>;
|
||||||
|
has(name: string): boolean;
|
||||||
|
set(name: string, value: string): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class Body {
|
||||||
|
bodyUsed: boolean;
|
||||||
|
arrayBuffer(): Promise<ArrayBuffer>;
|
||||||
|
blob(): Promise<Blob>;
|
||||||
|
formData(): Promise<FormData>;
|
||||||
|
json(): Promise<any>;
|
||||||
|
json<T>(): Promise<T>;
|
||||||
|
text(): Promise<string>;
|
||||||
|
}
|
||||||
|
declare class Response extends Body {
|
||||||
|
constructor(body?: BodyInit, init?: ResponseInit);
|
||||||
|
error(): Response;
|
||||||
|
redirect(url: string, status: number): Response;
|
||||||
|
type: string|ResponseType;
|
||||||
|
url: string;
|
||||||
|
status: number;
|
||||||
|
ok: boolean;
|
||||||
|
statusText: string;
|
||||||
|
headers: Headers;
|
||||||
|
clone(): Response;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare enum ResponseType { "basic", "cors", "default", "error", "opaque" }
|
||||||
|
|
||||||
|
interface ResponseInit {
|
||||||
|
status: number;
|
||||||
|
statusText?: string;
|
||||||
|
headers?: HeaderInit;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare type HeaderInit = Headers|Array<string>;
|
||||||
|
declare type BodyInit = Blob|FormData|string;
|
||||||
|
declare type RequestInfo = Request|string;
|
||||||
|
|
||||||
|
interface Window {
|
||||||
|
fetch(url: string|Request, init?: RequestInit): Promise<Response>;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare var fetch: typeof window.fetch;
|
||||||
@@ -10,7 +10,7 @@ module.exports = {
|
|||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{ test: /\.ts(x?)$/, include: /ReactApp/, exclude: /node_modules/, loader: 'babel-loader' },
|
{ test: /\.ts(x?)$/, include: /ReactApp/, exclude: /node_modules/, loader: 'babel-loader' },
|
||||||
{ test: /\.ts(x?)$/, include: /ReactApp/, exclude: /node_modules/, loader: 'ts-loader?silent' },
|
{ test: /\.ts(x?)$/, include: /ReactApp/, exclude: /node_modules/, loader: 'ts-loader' },
|
||||||
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
|
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
|
||||||
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }
|
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }
|
||||||
]
|
]
|
||||||
|
|||||||
1
samples/react/ReactGrid/.gitignore
vendored
1
samples/react/ReactGrid/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
/node_modules/
|
/node_modules/
|
||||||
|
project.lock.json
|
||||||
/wwwroot/dist/
|
/wwwroot/dist/
|
||||||
/Properties/launchSettings.json
|
/Properties/launchSettings.json
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<Import Project="..\..\..\build\dependencies.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.ReactServices\Microsoft.AspNetCore.ReactServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
|
||||||
<Exec Command="npm install" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
20
samples/react/ReactGrid/ReactGrid.xproj
Normal file
20
samples/react/ReactGrid/ReactGrid.xproj
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>abf90a5b-f4e0-438c-a6e4-9549fb43690b</ProjectGuid>
|
||||||
|
<RootNamespace>ReactGrid</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<DevelopmentServerPort>2311</DevelopmentServerPort>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
49
samples/react/ReactGrid/project.json
Executable file
49
samples/react/ReactGrid/project.json
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"buildOptions": {
|
||||||
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
|
},
|
||||||
|
"runtimeOptions": {
|
||||||
|
"gcServer": true
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"type": "platform"
|
||||||
|
},
|
||||||
|
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Json": "1.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Console": "1.0.0",
|
||||||
|
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||||
|
"Microsoft.Extensions.Logging.Debug": "1.0.0",
|
||||||
|
"Microsoft.AspNetCore.ReactServices": "1.0.0-*"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net45+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"publishOptions": {
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"**.xproj",
|
||||||
|
"**.user",
|
||||||
|
"**.vspscc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": [ "npm install" ],
|
||||||
|
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<Import Project="..\..\build\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Description>Helpers for building Angular 2 applications on ASP.NET Core.</Description>
|
|
||||||
<TargetFrameworks>net451;netstandard1.6</TargetFrameworks>
|
|
||||||
<VersionPrefix>1.1.0</VersionPrefix>
|
|
||||||
<VersionSuffix>beta2</VersionSuffix>
|
|
||||||
<PackageTags>aspnetcore;aspnetcoremvc;nodeservices</PackageTags>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="$(AspNetCoreVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>421807e6-b62c-417b-b901-46c5dedaa8f1</ProjectGuid>
|
||||||
|
<RootNamespace>Microsoft.AspNetCore.AngularServices</RootNamespace>
|
||||||
|
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||||
|
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||||
|
</Project>
|
||||||
@@ -9,31 +9,14 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace Microsoft.AspNetCore.AngularServices
|
namespace Microsoft.AspNetCore.AngularServices
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Helpers for prepopulating Angular 2's 'http' service with data.
|
|
||||||
/// </summary>
|
|
||||||
public static class PrimeCacheHelper
|
public static class PrimeCacheHelper
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Performs an HTTP GET request to the specified URL and adds the resulting JSON data
|
|
||||||
/// to the Angular 'http' service cache.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="html">The <see cref="IHtmlHelper"/>.</param>
|
|
||||||
/// <param name="url">The URL to be requested.</param>
|
|
||||||
/// <returns>A task representing the HTML content to be rendered into the document.</returns>
|
|
||||||
[Obsolete("Use PrimeCacheAsync instead")]
|
[Obsolete("Use PrimeCacheAsync instead")]
|
||||||
public static Task<IHtmlContent> PrimeCache(this IHtmlHelper html, string url)
|
public static Task<IHtmlContent> PrimeCache(this IHtmlHelper html, string url)
|
||||||
{
|
{
|
||||||
return PrimeCacheAsync(html, url);
|
return PrimeCacheAsync(html, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs an HTTP GET request to the specified URL and adds the resulting JSON data
|
|
||||||
/// to the Angular 'http' service cache.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="html">The <see cref="IHtmlHelper"/>.</param>
|
|
||||||
/// <param name="url">The URL to be requested.</param>
|
|
||||||
/// <returns>A task representing the HTML content to be rendered into the document.</returns>
|
|
||||||
public static async Task<IHtmlContent> PrimeCacheAsync(this IHtmlHelper html, string url)
|
public static async Task<IHtmlContent> PrimeCacheAsync(this IHtmlHelper html, string url)
|
||||||
{
|
{
|
||||||
// TODO: Consider deduplicating the PrimeCacheAsync calls (that is, if there are multiple requests to precache
|
// TODO: Consider deduplicating the PrimeCacheAsync calls (that is, if there are multiple requests to precache
|
||||||
|
|||||||
3
src/Microsoft.AspNetCore.AngularServices/npm/.gitignore
vendored
Normal file
3
src/Microsoft.AspNetCore.AngularServices/npm/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/node_modules/
|
||||||
|
/dist/
|
||||||
|
/bundles/
|
||||||
4
src/Microsoft.AspNetCore.AngularServices/npm/.npmignore
Normal file
4
src/Microsoft.AspNetCore.AngularServices/npm/.npmignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/src/
|
||||||
|
/tsconfig.json
|
||||||
|
/build.js
|
||||||
|
/typings/
|
||||||
33
src/Microsoft.AspNetCore.AngularServices/npm/build.js
Normal file
33
src/Microsoft.AspNetCore.AngularServices/npm/build.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// -------------
|
||||||
|
// No need to invoke this directly. To run a build, execute:
|
||||||
|
// npm run prepublish
|
||||||
|
// -------------
|
||||||
|
|
||||||
|
var Builder = require('systemjs-builder');
|
||||||
|
var builder = new Builder('./');
|
||||||
|
builder.config({
|
||||||
|
defaultJSExtensions: true,
|
||||||
|
paths: {
|
||||||
|
'angular2-aspnet': 'dist/Exports',
|
||||||
|
'angular2-aspnet/*': 'dist/*'
|
||||||
|
},
|
||||||
|
meta: {
|
||||||
|
'angular2/*': { build: false },
|
||||||
|
'rxjs/*': { build: false }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var entryPoint = 'dist/Exports';
|
||||||
|
var tasks = [
|
||||||
|
builder.bundle(entryPoint, './bundles/angular2-aspnet.js'),
|
||||||
|
builder.bundle(entryPoint, './bundles/angular2-aspnet.min.js', { minify: true })
|
||||||
|
];
|
||||||
|
|
||||||
|
Promise.all(tasks)
|
||||||
|
.then(function() {
|
||||||
|
console.log('Build complete');
|
||||||
|
})
|
||||||
|
.catch(function(err) {
|
||||||
|
console.error('Build error');
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
32
src/Microsoft.AspNetCore.AngularServices/npm/package.json
Normal file
32
src/Microsoft.AspNetCore.AngularServices/npm/package.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "angular2-aspnet",
|
||||||
|
"version": "0.0.6",
|
||||||
|
"description": "Helpers for Angular 2 apps built on ASP.NET",
|
||||||
|
"main": "./dist/Exports",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"prepublish": "rimraf *.d.ts dist/*.d.ts && tsc && node build.js"
|
||||||
|
},
|
||||||
|
"typings": "dist/Exports",
|
||||||
|
"author": "Microsoft",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/aspnet/JavaScriptServices/issues"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/aspnet/JavaScriptServices.git"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"angular2": "^2.0.0-beta.13",
|
||||||
|
"rxjs": "5.0.0-beta.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"es6-shim": "^0.35.0",
|
||||||
|
"reflect-metadata": "^0.1.2",
|
||||||
|
"rimraf": "^2.5.4",
|
||||||
|
"systemjs-builder": "^0.14.11",
|
||||||
|
"typescript": "^2.0.0",
|
||||||
|
"zone.js": "^0.6.10"
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/Microsoft.AspNetCore.AngularServices/npm/readme.md
Normal file
59
src/Microsoft.AspNetCore.AngularServices/npm/readme.md
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
If you just want to use this package, then you *don't have to build it*. Instead, just grab the prebuilt package from NPM:
|
||||||
|
|
||||||
|
npm install angular2-aspnet
|
||||||
|
|
||||||
|
The rest of this file is notes for anyone contributing to this package itself.
|
||||||
|
|
||||||
|
## How to build
|
||||||
|
|
||||||
|
Run the following:
|
||||||
|
|
||||||
|
npm install
|
||||||
|
npm run prepublish
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
|
||||||
|
* Node, NPM
|
||||||
|
* `tsc` installed globally (via `npm install -g typescript`)
|
||||||
|
|
||||||
|
## Project structure
|
||||||
|
|
||||||
|
This package is intended to be consumable both on the server in Node.js, and on the client. Also, it's written in TypeScript,
|
||||||
|
which neither of those environments knows natively, but the TypeScript type definitions need to get delivered with the package
|
||||||
|
so that developers get a good IDE experience when consuming it.
|
||||||
|
|
||||||
|
The build process is therefore:
|
||||||
|
|
||||||
|
1. Compile the TypeScript to produce the development-time (.d.ts) and server-side (.js) artifacts
|
||||||
|
|
||||||
|
`tsc` reads `tsconfig.json` and is instructed to compile all the `.ts` files in `src/`. It produces a corresponding
|
||||||
|
structure of `.js` and `.d.ts` files in `dist/`.
|
||||||
|
|
||||||
|
When a developer consumes the resulting package (via `npm install angular2-aspnet`),
|
||||||
|
|
||||||
|
- No additional copy of `angular2` will be installed, because this package's dependency on it is declared as a
|
||||||
|
`peerDependency`. This means it will work with whatever (compatible) version of `angular2` is already installed.
|
||||||
|
- At runtime inside Node.js, the `main` configuration in `package.json` means the developer can use a standard
|
||||||
|
`import` statement to consume this package (i.e., `import * from 'angular2-aspnet';` in either JS or TS files).
|
||||||
|
- At development time inside an IDE such as Visual Studio Code, the `typings` configuration in `package.json` means
|
||||||
|
the IDE will use the corresponding `.d.ts` file as type metadata for the variable imported that way.
|
||||||
|
|
||||||
|
2. Use the SystemJS builder to produce the client-side artifacts
|
||||||
|
|
||||||
|
`build.js` uses the SystemJS Builder API to combine files in `dist/` into `.js` files ready for use in client-side
|
||||||
|
SystemJS environments, and puts them in `bundles/`. The bundle files contain `System.register` calls so that any
|
||||||
|
other part of your client-side code that tries to import `angular2-aspnet` via SystemJS will get that module at runtime.
|
||||||
|
|
||||||
|
To make it work in an application:
|
||||||
|
- Set up some build step that copies your chosen bundle file from `bundles/` to some location where it will
|
||||||
|
be served to the client
|
||||||
|
- Below your `<script>` tag that loads SystemJS itself, and above the `<script>` tag that makes the first call to
|
||||||
|
`System.import`, have a `<script>` tag that loads the desired `angular2-aspnet.js` bundle file
|
||||||
|
|
||||||
|
For an example, see https://github.com/aspnet/NodeServices/tree/master/samples/angular/MusicStore
|
||||||
|
|
||||||
|
Of course, you can also bundle the `angular2-aspnet.js` file into a larger SystemJS bundle if you want to combine
|
||||||
|
it with the rest of the code in your application.
|
||||||
|
|
||||||
|
Currently, this build system does *not* attempt to send sourcemaps of the original TypeScript to the client. This
|
||||||
|
could be added if a strong need emerges.
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import { provide, Injectable, Provider } from 'angular2/core';
|
||||||
|
import { Connection, ConnectionBackend, Http, XHRBackend, RequestOptions, Request, RequestMethod, Response, ResponseOptions, ReadyState } from 'angular2/http';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class CachePrimedConnectionBackend extends ConnectionBackend {
|
||||||
|
private _preCachedResponses: PreCachedResponses;
|
||||||
|
|
||||||
|
constructor(private _underlyingBackend: ConnectionBackend, private _baseResponseOptions: ResponseOptions) {
|
||||||
|
super();
|
||||||
|
this._preCachedResponses = (<any>window).__preCachedResponses || {};
|
||||||
|
}
|
||||||
|
|
||||||
|
public createConnection(request: Request): Connection {
|
||||||
|
let cacheKey = request.url;
|
||||||
|
if (request.method === RequestMethod.Get && this._preCachedResponses.hasOwnProperty(cacheKey)) {
|
||||||
|
return new CacheHitConnection(request, this._preCachedResponses[cacheKey], this._baseResponseOptions);
|
||||||
|
} else {
|
||||||
|
return this._underlyingBackend.createConnection(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CacheHitConnection implements Connection {
|
||||||
|
readyState: ReadyState;
|
||||||
|
request: Request;
|
||||||
|
response: any;
|
||||||
|
|
||||||
|
constructor (req: Request, cachedResponse: PreCachedResponse, baseResponseOptions: ResponseOptions) {
|
||||||
|
this.request = req;
|
||||||
|
this.readyState = ReadyState.Done;
|
||||||
|
|
||||||
|
// Workaround for difficulty consuming CommonJS default exports in TypeScript. Note that it has to be a dynamic
|
||||||
|
// 'require', and not an 'import' statement, because the module isn't available on the server.
|
||||||
|
let obsCtor: any = require('rxjs/Observable').Observable;
|
||||||
|
this.response = new obsCtor(responseObserver => {
|
||||||
|
let response = new Response(new ResponseOptions({ body: cachedResponse.body, status: cachedResponse.statusCode }));
|
||||||
|
responseObserver.next(response);
|
||||||
|
responseObserver.complete();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare var require: any; // Part of the workaround mentioned below. Can remove this after updating Angular.
|
||||||
|
|
||||||
|
interface PreCachedResponses {
|
||||||
|
[url: string]: PreCachedResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PreCachedResponse {
|
||||||
|
statusCode: number;
|
||||||
|
body: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CACHE_PRIMED_HTTP_PROVIDERS = [
|
||||||
|
provide(Http, {
|
||||||
|
useFactory: (xhrBackend, requestOptions, responseOptions) => new Http(new CachePrimedConnectionBackend(xhrBackend, responseOptions), requestOptions),
|
||||||
|
deps: [XHRBackend, RequestOptions, ResponseOptions]
|
||||||
|
}),
|
||||||
|
];
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './CachePrimedHttp';
|
||||||
|
export * from './Validation';
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import { ControlGroup } from 'angular2/common';
|
||||||
|
import { Response } from 'angular2/http';
|
||||||
|
|
||||||
|
export class Validation {
|
||||||
|
|
||||||
|
public static showValidationErrors(response: ValidationErrorResult | Response, controlGroup: ControlGroup): void {
|
||||||
|
if (response instanceof Response) {
|
||||||
|
var httpResponse = <Response>response;
|
||||||
|
response = <ValidationErrorResult>(httpResponse.json());
|
||||||
|
}
|
||||||
|
|
||||||
|
// It's not yet clear whether this is a legitimate and supported use of the ng.ControlGroup API.
|
||||||
|
// Need feedback from the Angular 2 team on whether there's a better way.
|
||||||
|
var errors = <ValidationErrorResult>response;
|
||||||
|
Object.keys(errors || {}).forEach(key => {
|
||||||
|
errors[key].forEach(errorMessage => {
|
||||||
|
// If there's a specific control for this key, then use it. Otherwise associate the error
|
||||||
|
// with the whole control group.
|
||||||
|
var control = controlGroup.controls[key] || controlGroup;
|
||||||
|
|
||||||
|
// This is rough. Need to find out if there's a better way, or if this is even supported.
|
||||||
|
if (!control.errors) {
|
||||||
|
(<any>control)._errors = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
control.errors[errorMessage] = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ValidationErrorResult {
|
||||||
|
[propertyName: string]: string[];
|
||||||
|
}
|
||||||
15
src/Microsoft.AspNetCore.AngularServices/npm/tsconfig.json
Normal file
15
src/Microsoft.AspNetCore.AngularServices/npm/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es5",
|
||||||
|
"sourceMap": false,
|
||||||
|
"declaration": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"noLib": false,
|
||||||
|
"outDir": "./dist",
|
||||||
|
"lib": ["es2015", "dom"]
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
|
}
|
||||||
26
src/Microsoft.AspNetCore.AngularServices/project.json
Normal file
26
src/Microsoft.AspNetCore.AngularServices/project.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"description": "Helpers for building Angular 2 applications on ASP.NET Core.",
|
||||||
|
"compilationOptions": {
|
||||||
|
"keyFile": "../../tools/Key.snk"
|
||||||
|
},
|
||||||
|
"authors": [ "Microsoft" ],
|
||||||
|
"tooling": {
|
||||||
|
"defaultNamespace": "Microsoft.AspNetCore.AngularServices"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.1",
|
||||||
|
"Microsoft.AspNetCore.SpaServices": "1.0.0-*"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net451": {
|
||||||
|
},
|
||||||
|
"netstandard1.6": {
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.6",
|
||||||
|
"dnxcore50",
|
||||||
|
"portable-net45+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/bin/
|
|
||||||
/node_modules/
|
|
||||||
yarn.lock
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<Import Project="..\..\build\common.props" />
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<Description>Socket-based RPC for Microsoft.AspNetCore.NodeServices.</Description>
|
|
||||||
<TargetFrameworks>net451;netstandard1.6</TargetFrameworks>
|
|
||||||
<VersionPrefix>1.1.0</VersionPrefix>
|
|
||||||
<VersionSuffix>beta2</VersionSuffix>
|
|
||||||
<PackageTags>aspnetcore;aspnetcoremvc;nodeservices</PackageTags>
|
|
||||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Content\**\*" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
|
||||||
<PackageReference Include="Microsoft.Tpl.Dataflow" Version="$(MicrosoftDataflowVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
|
|
||||||
<PackageReference Include="System.IO.Pipes" Version="$(CoreFxVersion)" />
|
|
||||||
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="$(ThreadingDataflowVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
|
|
||||||
<Exec Command="npm install" />
|
|
||||||
<Exec Command="node node_modules/webpack/bin/webpack.js" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.NodeServices.Sockets
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Extension methods that help with populating a <see cref="NodeServicesOptions"/> object.
|
|
||||||
/// </summary>
|
|
||||||
public static class NodeServicesOptionsExtensions
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Configures the <see cref="INodeServices"/> service so that it will use out-of-process
|
|
||||||
/// Node.js instances and perform RPC calls over binary sockets (on Windows, this is
|
|
||||||
/// implemented as named pipes; on other platforms it uses domain sockets).
|
|
||||||
/// </summary>
|
|
||||||
public static void UseSocketHosting(this NodeServicesOptions options)
|
|
||||||
{
|
|
||||||
var pipeName = "pni-" + Guid.NewGuid().ToString("D"); // Arbitrary non-clashing string
|
|
||||||
options.NodeInstanceFactory = () => new SocketNodeInstance(options, pipeName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es3",
|
|
||||||
"module": "commonjs",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"types": ["node"]
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"node_modules"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "nodeservices.sockets",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "This is not really an NPM package and will not be published. This file exists only to reference compilation tools.",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"build": "./node_modules/.bin/webpack"
|
|
||||||
},
|
|
||||||
"author": "Microsoft",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^6.0.42",
|
|
||||||
"ts-loader": "^0.8.2",
|
|
||||||
"typescript": "^2.0.0",
|
|
||||||
"webpack": "^1.13.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
target: 'node',
|
|
||||||
externals: ['fs', 'net', 'events', 'readline', 'stream'],
|
|
||||||
resolve: {
|
|
||||||
extensions: [ '.ts' ]
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
loaders: [
|
|
||||||
{ test: /\.ts$/, loader: 'ts-loader' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
entry: {
|
|
||||||
'entrypoint-socket': ['./TypeScript/SocketNodeInstanceEntryPoint'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
libraryTarget: 'commonjs',
|
|
||||||
path: './Content/Node',
|
|
||||||
filename: '[name].js'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
/bin/
|
/bin/
|
||||||
/node_modules/
|
/node_modules/
|
||||||
yarn.lock
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Microsoft.AspNetCore.NodeServices
|
||||||
|
{
|
||||||
|
public enum NodeHostingModel
|
||||||
|
{
|
||||||
|
Http,
|
||||||
|
Socket,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Microsoft.AspNetCore.NodeServices.HostingModels;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.NodeServices
|
namespace Microsoft.AspNetCore.NodeServices
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Supplies INodeServices instances.
|
|
||||||
/// </summary>
|
|
||||||
public static class NodeServicesFactory
|
public static class NodeServicesFactory
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Create an <see cref="INodeServices"/> instance according to the supplied options.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="options">Options for creating the <see cref="INodeServices"/> instance.</param>
|
|
||||||
/// <returns>An <see cref="INodeServices"/> instance.</returns>
|
|
||||||
public static INodeServices CreateNodeServices(NodeServicesOptions options)
|
public static INodeServices CreateNodeServices(NodeServicesOptions options)
|
||||||
{
|
{
|
||||||
if (options == null)
|
if (options == null)
|
||||||
@@ -19,7 +12,32 @@ namespace Microsoft.AspNetCore.NodeServices
|
|||||||
throw new ArgumentNullException(nameof (options));
|
throw new ArgumentNullException(nameof (options));
|
||||||
}
|
}
|
||||||
|
|
||||||
return new NodeServicesImpl(options.NodeInstanceFactory);
|
return new NodeServicesImpl(() => CreateNodeInstance(options));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static INodeInstance CreateNodeInstance(NodeServicesOptions options)
|
||||||
|
{
|
||||||
|
if (options.NodeInstanceFactory != null)
|
||||||
|
{
|
||||||
|
// If you've explicitly supplied an INodeInstance factory, we'll use that. This is useful for
|
||||||
|
// custom INodeInstance implementations.
|
||||||
|
return options.NodeInstanceFactory();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (options.HostingModel)
|
||||||
|
{
|
||||||
|
case NodeHostingModel.Http:
|
||||||
|
return new HttpNodeInstance(options.ProjectPath, options.WatchFileExtensions, options.NodeInstanceOutputLogger,
|
||||||
|
options.EnvironmentVariables, options.InvocationTimeoutMilliseconds, options.LaunchWithDebugging, options.DebuggingPort, /* port */ 0);
|
||||||
|
case NodeHostingModel.Socket:
|
||||||
|
var pipeName = "pni-" + Guid.NewGuid().ToString("D"); // Arbitrary non-clashing string
|
||||||
|
return new SocketNodeInstance(options.ProjectPath, options.WatchFileExtensions, pipeName, options.NodeInstanceOutputLogger,
|
||||||
|
options.EnvironmentVariables, options.InvocationTimeoutMilliseconds, options.LaunchWithDebugging, options.DebuggingPort);
|
||||||
|
default:
|
||||||
|
throw new ArgumentException("Unknown hosting model: " + options.HostingModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,20 +8,14 @@ using Microsoft.Extensions.Logging.Console;
|
|||||||
|
|
||||||
namespace Microsoft.AspNetCore.NodeServices
|
namespace Microsoft.AspNetCore.NodeServices
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Describes options used to configure an <see cref="INodeServices"/> instance.
|
|
||||||
/// </summary>
|
|
||||||
public class NodeServicesOptions
|
public class NodeServicesOptions
|
||||||
{
|
{
|
||||||
|
public const NodeHostingModel DefaultNodeHostingModel = NodeHostingModel.Http;
|
||||||
internal const string TimeoutConfigPropertyName = nameof(InvocationTimeoutMilliseconds);
|
internal const string TimeoutConfigPropertyName = nameof(InvocationTimeoutMilliseconds);
|
||||||
private const int DefaultInvocationTimeoutMilliseconds = 60 * 1000;
|
private const int DefaultInvocationTimeoutMilliseconds = 60 * 1000;
|
||||||
private const string LogCategoryName = "Microsoft.AspNetCore.NodeServices";
|
private const string LogCategoryName = "Microsoft.AspNetCore.NodeServices";
|
||||||
private static readonly string[] DefaultWatchFileExtensions = { ".js", ".jsx", ".ts", ".tsx", ".json", ".html" };
|
private static readonly string[] DefaultWatchFileExtensions = { ".js", ".jsx", ".ts", ".tsx", ".json", ".html" };
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new instance of <see cref="NodeServicesOptions"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="serviceProvider">The <see cref="IServiceProvider"/>.</param>
|
|
||||||
public NodeServicesOptions(IServiceProvider serviceProvider)
|
public NodeServicesOptions(IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
if (serviceProvider == null)
|
if (serviceProvider == null)
|
||||||
@@ -31,6 +25,7 @@ namespace Microsoft.AspNetCore.NodeServices
|
|||||||
|
|
||||||
EnvironmentVariables = new Dictionary<string, string>();
|
EnvironmentVariables = new Dictionary<string, string>();
|
||||||
InvocationTimeoutMilliseconds = DefaultInvocationTimeoutMilliseconds;
|
InvocationTimeoutMilliseconds = DefaultInvocationTimeoutMilliseconds;
|
||||||
|
HostingModel = DefaultNodeHostingModel;
|
||||||
WatchFileExtensions = (string[])DefaultWatchFileExtensions.Clone();
|
WatchFileExtensions = (string[])DefaultWatchFileExtensions.Clone();
|
||||||
|
|
||||||
// In an ASP.NET environment, we can use the IHostingEnvironment data to auto-populate a few
|
// In an ASP.NET environment, we can use the IHostingEnvironment data to auto-populate a few
|
||||||
@@ -47,51 +42,16 @@ namespace Microsoft.AspNetCore.NodeServices
|
|||||||
NodeInstanceOutputLogger = loggerFactory != null
|
NodeInstanceOutputLogger = loggerFactory != null
|
||||||
? loggerFactory.CreateLogger(LogCategoryName)
|
? loggerFactory.CreateLogger(LogCategoryName)
|
||||||
: new ConsoleLogger(LogCategoryName, null, false);
|
: new ConsoleLogger(LogCategoryName, null, false);
|
||||||
|
|
||||||
// By default, we use this package's built-in out-of-process-via-HTTP hosting/transport
|
|
||||||
this.UseHttpHosting();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public NodeHostingModel HostingModel { get; set; }
|
||||||
/// Specifies how to construct Node.js instances. An <see cref="INodeInstance"/> encapsulates all details about
|
|
||||||
/// how Node.js instances are launched and communicated with. A new <see cref="INodeInstance"/> will be created
|
|
||||||
/// automatically if the previous instance has terminated (e.g., because a source file changed).
|
|
||||||
/// </summary>
|
|
||||||
public Func<INodeInstance> NodeInstanceFactory { get; set; }
|
public Func<INodeInstance> NodeInstanceFactory { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If set, overrides the path to the root of your application. This path is used when locating Node.js modules relative to your project.
|
|
||||||
/// </summary>
|
|
||||||
public string ProjectPath { get; set; }
|
public string ProjectPath { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If set, the Node.js instance should restart when any matching file on disk within your project changes.
|
|
||||||
/// </summary>
|
|
||||||
public string[] WatchFileExtensions { get; set; }
|
public string[] WatchFileExtensions { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The Node.js instance's stdout/stderr will be redirected to this <see cref="ILogger"/>.
|
|
||||||
/// </summary>
|
|
||||||
public ILogger NodeInstanceOutputLogger { get; set; }
|
public ILogger NodeInstanceOutputLogger { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If true, the Node.js instance will accept incoming V8 debugger connections (e.g., from node-inspector).
|
|
||||||
/// </summary>
|
|
||||||
public bool LaunchWithDebugging { get; set; }
|
public bool LaunchWithDebugging { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If <see cref="LaunchWithDebugging"/> is true, the Node.js instance will listen for V8 debugger connections on this port.
|
|
||||||
/// </summary>
|
|
||||||
public int DebuggingPort { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If set, starts the Node.js instance with the specified environment variables.
|
|
||||||
/// </summary>
|
|
||||||
public IDictionary<string, string> EnvironmentVariables { get; set; }
|
public IDictionary<string, string> EnvironmentVariables { get; set; }
|
||||||
|
public int DebuggingPort { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// Specifies the maximum duration, in milliseconds, that your .NET code should wait for Node.js RPC calls to return.
|
|
||||||
/// </summary>
|
|
||||||
public int InvocationTimeoutMilliseconds { get; set; }
|
public int InvocationTimeoutMilliseconds { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,18 +8,9 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class NodeServicesServiceCollectionExtensions
|
public static class NodeServicesServiceCollectionExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
|
|
||||||
public static void AddNodeServices(this IServiceCollection serviceCollection)
|
public static void AddNodeServices(this IServiceCollection serviceCollection)
|
||||||
=> AddNodeServices(serviceCollection, _ => {});
|
=> AddNodeServices(serviceCollection, _ => {});
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
|
|
||||||
/// <param name="options">Options for configuring the <see cref="INodeServices"/> instances.</param>
|
|
||||||
[Obsolete("Use the AddNodeServices(Action<NodeServicesOptions> setupAction) overload instead.")]
|
[Obsolete("Use the AddNodeServices(Action<NodeServicesOptions> setupAction) overload instead.")]
|
||||||
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options)
|
public static void AddNodeServices(this IServiceCollection serviceCollection, NodeServicesOptions options)
|
||||||
{
|
{
|
||||||
@@ -29,11 +20,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds NodeServices support to the <paramref name="serviceCollection"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="serviceCollection">The <see cref="IServiceCollection"/>.</param>
|
|
||||||
/// <param name="setupAction">A callback that will be invoked to populate the <see cref="NodeServicesOptions"/>.</param>
|
|
||||||
public static void AddNodeServices(this IServiceCollection serviceCollection, Action<NodeServicesOptions> setupAction)
|
public static void AddNodeServices(this IServiceCollection serviceCollection, Action<NodeServicesOptions> setupAction)
|
||||||
{
|
{
|
||||||
if (setupAction == null)
|
if (setupAction == null)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user