Compare commits

..

223 Commits

Author SHA1 Message Date
Steve Sanderson
85e59efa21 Rename Angular2Spa to AngularSpa, plus rephrase "Angular 2" as "Angular" in many places 2017-05-18 13:40:58 +01:00
Steve Sanderson
a74b7aea6b Bump template package versions to 0.9.3 for release 2017-05-18 12:10:15 +01:00
Mads Kristensen
178a05cc33 Added missing Framework symbol 2017-05-17 22:25:37 +01:00
Steve Sanderson
33b275a7d3 Update ReactReduxSpa to latest versions of all dependencies, and pin to exact versions 2017-05-17 22:21:37 +01:00
Steve Sanderson
c9d235d425 Update ReactSpa to latest versions of dependencies, and pin to exact versions. Simplify some instructions. 2017-05-17 22:06:32 +01:00
Steve Sanderson
48b923fcd5 Update ReactReduxSpa to React Hot Loader 3, and remove Babel dependency 2017-05-17 21:51:13 +01:00
Steve Sanderson
eeaf4e6590 Update ReactSpa to React Hot Loader 3. Remove babel dependency. 2017-05-17 21:37:47 +01:00
Steve Sanderson
ef9dbfe44b Update aspnet-webpack-react to v2.0.0, now supporting Webpack 2+ and React Hot Loader 3+ only 2017-05-17 21:10:29 +01:00
Steve Sanderson
e658ee6375 Simplifications in ReactSpa and ReactReduxSpa 2017-05-17 14:46:37 +01:00
Keven van Zuijlen
785e7d48a2 Implemented react-router v4 to ReactRedux template 2017-05-17 14:46:37 +01:00
Keven van Zuijlen
c791ceee49 Updatged package.json and webpack vendor config 2017-05-17 14:46:37 +01:00
Keven van Zuijlen
d2c56d19d0 Implemented react-router-dom v4 2017-05-17 14:46:37 +01:00
Keven van Zuijlen
7a11cf97fd Updated react-router to react-router-dom 4.0.0 2017-05-17 14:46:37 +01:00
Steve Sanderson
84aec29cf2 Bump template package versions to 0.9.2 for publish 2017-05-17 14:27:11 +01:00
Steve Sanderson
5086d0cc1c Fix test script 2017-05-17 12:25:23 +01:00
Steve Sanderson
144ad6a561 Further attempt to make Djna.nosys=true work on AppVeyor 2017-05-17 12:04:43 +01:00
Steve Sanderson
5ec31b3672 Try another way to get AppVeyor to pass through -Djna.nosys=true 2017-05-17 11:43:33 +01:00
Steve Sanderson
82dca64b8a When generating test project, do include test files 2017-05-17 11:37:33 +01:00
Steve Sanderson
45ec148dec Update AppVeyor to use .NET Core 1.0.4 SDK 2017-05-17 11:22:59 +01:00
Steve Sanderson
4e847f4545 Reference icon in vs-2017.3.host.json files 2017-05-17 11:10:29 +01:00
Steve Sanderson
ca9c6387d0 Add template icons 2017-05-17 11:10:29 +01:00
Mads Kristensen
d7a3289164 Outputs vs-2017.3.host.json file
This should now write out the correct file for VS to pick up. The icon is missing since I'm not totally sure about how we should inject that into the _.template.config_ folder. Also, is there a description of each template we can use?
2017-05-17 11:10:29 +01:00
Steve Sanderson
3c1a1ffaa4 Attempt to make selenium-standalone run on AppVeyor 2017-05-17 11:04:41 +01:00
Steve Sanderson
cd240907f8 Update tests to work with latest tooling 2017-05-17 10:43:20 +01:00
Steve Sanderson
3390d75528 Begin re-enabling tests in AppVeyor (still need to diagnose why they intermittently time out) 2017-05-17 10:18:26 +01:00
Steve Sanderson
5ade33b870 Update to Angular 4 (but leave directory name as Angular2Spa until finished) 2017-05-17 10:13:46 +01:00
Steve Sanderson
b5636ea871 Clarify contribution instructions. Fixes #934. 2017-05-16 10:56:53 +01:00
Steve Sanderson
1d57ca384f Remove vue-class-component dependency, because we're only referencing vue-property-decorator directly 2017-05-12 10:25:38 +01:00
ferrx
9d58c8836b Switched from av-ts to vue-property-decorator and vue-class-component 2017-05-12 10:20:06 +01:00
Ashley Grant
d016950e50 Add Aurelia and Vue to framework list
Doing this due to a Stack Overflow question where a dev thought this project doesn't support Aurelia simply b/c this Readme file didn't include it.  Went ahead and added Vue as well for completeness.
2017-05-11 15:06:50 +01:00
Stephan
f2260d572f Templates: update React's component's State and Property type 2017-05-05 17:37:47 +01:00
Steve Sanderson
214a908c92 Temporarily pin React to 15.4.x, because 15.5.0 has conflict with Babel (Babel injects code that tries to evaluate PropTypes) 2017-05-05 16:23:16 +01:00
Steve Sanderson
4abc39faa0 Bump generator-aspnetcore-spa to 0.9.1 for release 2017-05-04 19:53:49 +01:00
Kevin Logan
c9486eac0b Add blog link
I keep searching for this very useful MSDN blog link.
2017-05-04 19:54:07 +01:00
Steve Sanderson
6fa6765fa5 Update README.md 2017-05-04 19:52:30 +01:00
Rick Anderson
c570d79dcc removed cache priming 2017-05-04 19:52:08 +01:00
Rick Anderson
8f3e9308cc Update README.md 2017-05-04 19:52:08 +01:00
Rick Anderson
76c7db42b9 Update README.md 2017-05-04 19:52:08 +01:00
Steve Sanderson
5a5b309cdf Bump aspnet-prerendering to 2.0.5 for release 2017-05-04 18:20:38 +01:00
Steve Sanderson
d41f47f5bc Make statusCode optional on RenderToStringResult. Fixes #917 and #918 2017-05-04 18:20:25 +01:00
Steve Sanderson
e48ee287c2 Change .NET package versions since subsequent builds won't be RTM releases 2017-05-04 14:24:59 +01:00
Steve Sanderson
15ceec0b3f Have templates declare dependency on SpaServices 1.1.1 2017-05-04 14:15:16 +01:00
Steve Sanderson
decb13b33b Make versions consistent across all .NET projects 2017-05-04 14:07:00 +01:00
Steve Sanderson
f18e0be128 Fix VersionSuffix in build 2017-05-04 14:03:00 +01:00
Steve Sanderson
6300f6cdcd Have CI build 1.1.1 RTM versions of NodeServices/SpaServices for release 2017-05-04 13:37:56 +01:00
Steve Sanderson
3dca3c37ff Bump aspnet-webpack to 1.0.29 for publish 2017-05-04 13:33:25 +01:00
Steve Sanderson
1862e388e1 Bump aspnet-prerendering to 2.0.4 for publish 2017-05-04 13:21:35 +01:00
Steve Sanderson
cbaeb1c055 Fix ReactReduxSpa build issue. Fixes #859 and #878 2017-05-04 13:17:24 +01:00
Matt Perry
cdbbbcc473 Fix build break 2017-05-04 13:07:18 +01:00
Matt Perry
02b31d05a2 Stick closer to established style guides. Up buffer size to match websocket buffer size from original proxy code. 2017-05-04 13:07:18 +01:00
Matt Perry
54884459bd Allow proxy middleware to abort long running connections. 2017-05-04 13:07:18 +01:00
Steve Sanderson
018a3e65ff Put back "name" in AureliaSpa package.json because this is auto-replaced during template evaluation 2017-05-04 12:41:30 +01:00
Steve Sanderson
e3a8c13c22 Make Aurelia webpack config as consistent as possible with the other templates 2017-05-04 12:36:25 +01:00
Meirion Hughes
37df30929c Update Aurelia SPA template 2017-04-13 20:54:56 +01:00
Erick Galassi
ea429cccf4 Minimize CSS in production builds (all templates) 2017-04-11 14:51:31 +01:00
Pavlo Glazkov
c0205cfc4e Fix watchOptions in webpack.config.js being ignored by WebpackDevMiddleware (#806)
This enables Docker HMR workflow and the workaround mentioned in this comment: https://github.com/aspnet/JavaScriptServices/issues/806#issuecomment-290081291
2017-04-11 14:35:57 +01:00
Ben Adams
b28f85236f Console type needs exe 2017-04-11 14:31:28 +01:00
Pranav K
e1533c2203 Use 2.0.0 version of Internal.AspNetCore.Sdk 2017-04-07 12:03:14 -07:00
Steve Sanderson
5dc476182c Reference bootstrap JS in KnockoutSpa/ReactSpa/VueSpa. Fixes #846 2017-04-07 15:48:20 +01:00
Steve Sanderson
5cb1846dd2 Fix and reorganise WebpackDevMiddleware.ts following PR 2017-03-29 14:18:37 +01:00
Steve Sanderson
1f03b1e633 Tiny shortcut to reduce string checking in non-debug scenarios 2017-03-29 12:02:02 +01:00
Steve Sanderson
8544714cbb Revert IsWarning code path to avoid breaking change (e.g., if someone overrode OnErrorDataReceived to receive such lines) 2017-03-29 12:02:02 +01:00
Thomas Hermann
0c09c68b77 Support V8 Inspector Integration for Node.js
Addresses #796
2017-03-29 12:02:02 +01:00
Steve Sanderson
ee601bed50 Minor doc tweaks 2017-03-29 11:41:38 +01:00
Thomas Hermann
ce40973859 Add option to configure Webpack Hot Middleware client
Addresses #667
2017-03-29 11:35:57 +01:00
peterlazzarino
347524a116 Add status code response capabilities to PrerenderTagHelper and RenderToStringResult. Client can now send status codes back based on client routes. 2017-03-29 11:32:37 +01:00
Steve Sanderson
b9c387bf5f Remove obsolete references from gitignore files. Fixes #818 and #819. 2017-03-29 10:33:29 +01:00
Steve Sanderson
6ed6b8e3d2 Set AutoCompleteOnClose=false on JsonTextWriter. Fixes #822 2017-03-29 10:27:50 +01:00
Kiran Challa
dcf51f706c Upgraded Json.NET version to 10.0.1 2017-03-28 10:43:05 -07:00
Dan Harman
365b2c50cb Added babel-loader caching to improve subsequent build times. (#777) 2017-03-22 10:28:26 +00:00
Steve Sanderson
efcfc0b9a6 Bump template packages to 0.9.0 for release 2017-03-15 17:04:55 -07:00
Steve Sanderson
68e27d6091 In Yeoman generator, assert dotnet is >= 1.0.0, and set detected version in global.json 2017-03-15 17:04:20 -07:00
Steve Sanderson
08ea344fcf Remove project.json-specific content from all the SPA templates 2017-03-14 17:23:08 -07:00
Steve Sanderson
a6e0955581 In Yeoman/dotnetnew generators, remove support for producing project.json projects 2017-03-14 17:09:33 -07:00
Steve Sanderson
d8143e2603 Update Yeoman package README 2017-03-14 17:07:42 -07:00
Mark Thiessen
3077b8a8c0 Modifies babel config to allow for webpack tree shaking 2017-03-13 11:20:05 -07:00
Steve Sanderson
5866713a05 Remove style-loader from vendor bundles. Fixes #715. 2017-03-13 11:11:38 -07:00
Steve Sanderson
7aacf2151c Bump templates packages versions to 0.8.7 for release 2017-03-13 09:55:48 -07:00
Steve Sanderson
e4623bb186 Add Vue template to Yeoman generator 2017-03-13 09:32:02 -07:00
Steve Sanderson
c6a089880c Add VueSpa.csproj to .sln 2017-03-13 09:29:29 -07:00
Steve Sanderson
59e09816c7 Fix typos (etc) in description on homepage 2017-03-13 09:25:23 -07:00
Steve Sanderson
c3ad9e8c2f Remove Vue template server-side prerendering because of limitations 2017-03-13 09:25:23 -07:00
Steve Sanderson
119b274c19 Add server-side rendering (via bundleRenderer, as this is what the Vue docs recommend, and apparently the only way it does encapsulation) 2017-03-13 09:25:23 -07:00
Steve Sanderson
360688f78b Add Vue template 2017-03-13 09:25:23 -07:00
Maciej Lelito
0a1ac6a70a Added missing import in boot.ts in Aurelia template 2017-03-10 13:58:32 +00:00
Kyle Summers
8d27d9d583 Updates Aurelia project url (#741)
aurealia.io doesn't appear to support https currently
2017-03-10 13:36:37 +00:00
David Fowler
8bba142e8f Merge pull request #751 from aspnet/no-mono
No mono
2017-03-10 00:58:33 -08:00
David Fowler
94d47a3917 No mono 2017-03-10 00:15:39 -08:00
Nate McMaster
13fb00a71e Update KoreBuild to dev 2017-03-01 18:44:16 -08:00
Nate McMaster
684a77430c Add CI feed to NuGet.config 2017-03-01 09:10:37 -08:00
Nate McMaster
3058c050bb Unify dependency versions across all non-template projects 2017-03-01 09:28:11 +00:00
Nate McMaster
821ad85e41 Fixup MSBuild conversion (#721)
* Replace makefile.shade with repo.targets

* Remove web site projects as these are not yet supported by MSBuild for .NET Core

cref https://github.com/Microsoft/msbuild/issues/1767
2017-03-01 09:17:49 +00:00
Steve Sanderson
76ae9aa58f Fix build error in aspnet-prerendering caused by TypeScript 2.2.1 breaking change 2017-02-28 09:19:39 +00:00
Steve Sanderson
a79bc75671 Migrate to csproj (#703)
Migrate to csproj
2017-02-28 09:17:35 +00:00
Steve Sanderson
795aac241e Bump templates package versions to 0.8.6 for release 2017-02-23 10:23:34 +00:00
Steve Sanderson
a38db81b71 Templates that were waiting for awesome-typescript-loader 3.0.0 to ship no longer need to wait - it has shipped 2017-02-23 10:14:37 +00:00
Steve Sanderson
689f106181 Update templates to TypeScript 2.2.1 and fix whatwg-fetch related errors. Fixes #705 2017-02-23 10:07:03 +00:00
Steve Sanderson
627ea78e72 Replace image resizing sample with chartist sample 2017-02-22 13:27:18 +00:00
Steve Sanderson
3162946139 In ReactReduxSpa, configure store before matching routes. Fixes #663 2017-02-21 16:56:35 +00:00
Steve Sanderson
c9526dd4d2 Remove Dockerfiles for consistency with other templates. Also fixes #694 2017-02-21 16:18:25 +00:00
SteveSandersonMS
3c2fd50e8f Add fields to dotnet new NuSpec file 2017-02-13 16:38:56 +00:00
SteveSandersonMS
04111db230 Add "dotnet new" nupkg as AppVeyor artifact 2017-02-13 15:48:19 +00:00
SteveSandersonMS
5a593d657d Bump generator-aspnetcore-spa to 0.8.5 2017-02-13 15:44:49 +00:00
SteveSandersonMS
5a67ca35be Add 'primaryOutputs' to dotnet new template.json files (and reorder JSON properties alphabetically) 2017-02-13 15:28:12 +00:00
SteveSandersonMS
72dabb3664 After building "dotnet new" package, put it in "artifacts" dir 2017-02-13 15:06:41 +00:00
SteveSandersonMS
b7314359c8 When building "dotnet new" templates, always prebuild and include client-side 'dist' files for all templates, because dotnet new can't run arbitrary post-generation steps 2017-02-13 14:59:43 +00:00
SteveSandersonMS
1bf283877e More updates to "dotnet new" template to produce correct template.json values 2017-02-13 14:42:47 +00:00
SteveSandersonMS
1115a0aff5 Fix package.json files in Angular2Spa and AureliaSpa to have replaceable name (not hardcoded as Angular2Spa, etc.). Other templates were already set up like this. 2017-02-13 14:38:44 +00:00
SteveSandersonMS
70ad900f59 Further update dotnet new template builder to produce correct template.son contents 2017-02-13 14:05:36 +00:00
SteveSandersonMS
fadc5d7b98 Update dotnet new template builder to match tooling preview 4 file structure 2017-02-13 13:12:44 +00:00
SteveSandersonMS
85dcc66723 Update the version of NuGet.exe used when building "dotnet new" templates to v4 (rc) 2017-02-13 13:07:24 +00:00
SteveSandersonMS
f0825bec1d In generator-aspnetcore-spa, change internal name of Angular template from "angular-2" to "angular" to comply with suggested Angular branding 2017-02-13 13:05:59 +00:00
SteveSandersonMS
0ec6178617 Remove the Angular 2.0.2 template; define the 2.4.5+ template as the standard Angular one. Makes issue #665 no longer apply. 2017-02-13 12:55:48 +00:00
SteveSandersonMS
0f3e3ebb3b Fix TypeScript build error with updated lodash type definitions 2017-02-13 12:50:25 +00:00
SteveSandersonMS
9017ef6fdc Fix issues in KnockoutSpa/ReactSpa webpack 2 configs. Bump generator version to 0.8.4. 2017-02-09 18:10:58 +00:00
SteveSandersonMS
520ef02b98 Bump generator-aspnetcore-spa version to 0.8.3 for release 2017-02-09 15:49:39 +00:00
SteveSandersonMS
481ca0a8e0 Replace 'loader' with 'use' in various Webpack configs. Fixes 'loader option has been deprecated' warnings. 2017-02-09 15:43:41 +00:00
SteveSandersonMS
28483e2cf3 In ReactReduxSpa, pin @types/react-router-redux to known-good version 4.0.30, because 4.0.40 is broken. Fixes #651 2017-02-09 15:35:11 +00:00
SteveSandersonMS
e8dd8089d4 In Angular2Spa, fix HMR with 2.4.6 and relax version dependency to allow arbitrary 2.x again. Fixes #643 2017-02-09 15:14:30 +00:00
SteveSandersonMS
4f7091c5d5 Remove "Connection: keep-alive" workaround from domain-task, as it's not needed with .NET Core >= 1.1.0. Fixes #655 2017-02-09 14:28:18 +00:00
SteveSandersonMS
66148dacf3 Move angular2-template-loader dependency version to ^0.6.2 now that the bug in 0.6.1 is fixed. Fixes #649. 2017-02-09 10:12:46 +00:00
SteveSandersonMS
8ca45f0d77 Bump generator-aspnetcore-spa to 0.8.2 for release 2017-02-07 17:57:21 +00:00
SteveSandersonMS
0559bbb9af Temporarily pin to Angular 2.4.5 and angular2-template-loader 0.6.0 because of bugs in their patch releases (#643, #649) 2017-02-07 17:52:37 +00:00
SteveSandersonMS
7b28d05373 Pin AureliaSpa to extract-text-webpack-plugin 2.0.0-beta.4 until it can move to Webpack 2.2.0 final. 2017-02-03 11:50:05 +00:00
SteveSandersonMS
87b9db7579 Add yarn.lock to ignorefiles in aspnet-prerendering 2017-02-03 10:54:00 +00:00
SteveSandersonMS
61ffca6290 In aspnet-prerendering, parse the incoming querystring before passing it to the boot func for convenience. Fixes #638. 2017-02-03 10:54:00 +00:00
Mark Pieszak
a9e97f6783 fix(ng-router): update to 3.4.5 for experimental version
When everything is 4.x they'll all be on the same page / semantic versioning :)
2017-02-03 10:00:52 +00:00
SteveSandersonMS
f8f4016b33 Minor tweak in Yeoman generator source to clarify intent (makes no difference in current cases, so no need to re-release the package for this) 2017-01-31 16:09:36 +00:00
SteveSandersonMS
59dbb1f88f Bump generator-aspnetcore-spa version to 0.8.1 for release 2017-01-31 15:26:27 +00:00
SteveSandersonMS
ac75a3136d In generator-aspnetcore-spa, add option to produce Angular 2.4.5 project (with 'experimental' caveat) 2017-01-31 15:26:12 +00:00
SteveSandersonMS
a3af5c0b25 In Angular2Spa, reference angular2-universal-patch. This will allow for upgrades to Angular 2.4.5. 2017-01-31 14:19:14 +00:00
SteveSandersonMS
847430a0d9 Update Karma config to allow for Webpack 2-style config file. Fixes #625. 2017-01-31 11:49:21 +00:00
SteveSandersonMS
55c3156df2 Bump generator-aspnetcore-spa version to 0.8.0 for release 2017-01-30 13:02:16 +00:00
SteveSandersonMS
e7785dff01 Update templates to match VS2017RC build 26127 project file format, plus latest ASP.NET Core 'Program.cs' convention. Fixes #620. 2017-01-30 13:02:16 +00:00
SteveSandersonMS
6ed34ddd33 Update KnockoutSpa to Webpack 2 (plus awesome-typescript-loader) 2017-01-30 11:21:12 +00:00
SteveSandersonMS
9f7bc75960 Update ReactReduxSpa to Webpack 2 (plus awesome-typescript-loader) 2017-01-30 11:21:12 +00:00
SteveSandersonMS
bdd7cfd38b Update ReactSpa to Webpack 2 (plus awesome-typescript-loader) 2017-01-30 11:21:12 +00:00
SteveSandersonMS
be3fb6e876 Update Angular2Spa to Webpack 2 (plus awesome-typescript-loader for improved build speed) 2017-01-30 11:21:12 +00:00
SteveSandersonMS
d69b65e572 Bump NodeServices/SpaServices package versions to 1.1.0-rtm for release 2017-01-30 09:57:00 +00:00
SteveSandersonMS
e5178d2938 Update peerDependency on aspnet-webpack-react to allow Webpack 2.2.0+ as well as 1.x 2017-01-27 15:32:19 +00:00
SteveSandersonMS
e4d00a2da3 Update aspnet-webpack to support Webpack 2-style configs that export a function 2017-01-27 14:44:25 +00:00
SteveSandersonMS
345b4f64b5 Update aspnet-webpack-react to support Webpack 2.x-style configs 2017-01-27 11:18:26 +00:00
SteveSandersonMS
a9bc1201d1 Fix the build by passing allowConnectionDraining from SocketNodeInstance 2017-01-20 18:09:57 +00:00
SteveSandersonMS
6a1f35da8f Bumping NodeServices/SpaServices versions to 1.1.0-rc2-* for RC2 release 2017-01-20 17:33:34 +00:00
SteveSandersonMS
d7d1a04751 When Node is launched with a debug listener, disable connection draining on restart. Fixes #506. 2017-01-20 17:32:26 +00:00
SteveSandersonMS
351fe3d15c In SpaServices, add new HotModuleReplacementEndpoint option on HMR config. Fixes #579. 2017-01-20 15:03:52 +00:00
SteveSandersonMS
3313a7f0a6 Update Node version to 6.x (current LTS) in Dockerfiles. Fixes #591. 2017-01-20 12:38:57 +00:00
SteveSandersonMS
867d070263 Remove unused references to ThunkAction. Fixes a build error since @types/redux-thunk 2.2.0 removes the ThunkAction export. 2017-01-18 19:14:17 +00:00
SteveSandersonMS
a046bd2021 Temporarily disable tests on AppVeyor until config can be updated to match new chromedriver version requirement 2017-01-18 18:52:21 +00:00
SteveSandersonMS
1a49a27344 Use correct docker base image for csproj projects. Fixes #574. 2017-01-16 15:25:41 +00:00
SteveSandersonMS
f8714e9653 Fix react/redux TypeScript build errors caused by breaking changes in dependencies. Fixes #529, #582, #583 2017-01-16 10:46:28 +00:00
SteveSandersonMS
9d5006107f Bumping NodeServices/SpaServices versions to 1.1.0-rc1-* for RC1 release 2017-01-13 09:02:28 +00:00
SteveSandersonMS
c3316d0caa Hopefully fix BuildQuality setting in build 2017-01-10 19:43:15 +00:00
SteveSandersonMS
38441c6598 Override the build quality determined by KoreBuild 2017-01-10 19:13:15 +00:00
SteveSandersonMS
f8f42a53b2 Increase Mocha timeout. Trying to fix intermittent test failures on AppVeyor. 2017-01-10 10:37:00 +00:00
SteveSandersonMS
a93f59c660 Add Aurelia to generator's README.md. Fixes #561. 2017-01-09 14:43:28 +00:00
SteveSandersonMS
c377e6cd28 For project.json-based projects, fix Kudu deployment by adding a .deployment file at the root 2017-01-07 00:08:06 +00:00
SteveSandersonMS
2a1435d9c1 Bump generator-aspnetcore-spa version to 0.7.3 2017-01-07 00:04:50 +00:00
SteveSandersonMS
6789dbc102 csproj-based projects don't need the _placeholder.txt files, because the publishing code correctly includes dist files even if they were not on disk before 2017-01-07 00:04:20 +00:00
SteveSandersonMS
59526ff16a Update templates' csproj files to fix first-time publishing (previously, it didn't deploy dist files if they were not already on disk) 2017-01-07 00:00:52 +00:00
SteveSandersonMS
8c456aa0fc Make Karma serve .ts files with executable MIME type, otherwise newer versions of Chrome won't run it. Fixes #499 2017-01-03 17:35:30 +00:00
Niclas Emdelius
49bece54c2 Check if response is stream or object without using reference to reflection package. 2017-01-03 13:29:45 +00:00
nicemd
0907379da8 Streamed responses can be be Object or Stream
See issue https://github.com/aspnet/JavaScriptServices/issues/518
2017-01-03 13:29:45 +00:00
SteveSandersonMS
fbb8054c2e Make error message clearer if Node isn't installed (or not found on PATH). Fixes #527 2017-01-03 10:59:26 +00:00
SteveSandersonMS
70f59fc8ec Update core package versions to 1.1.0-beta2-* so that CI will produce non-timestamped packages 2017-01-03 10:29:22 +00:00
SteveSandersonMS
e6cfe93e13 Instruct AppVeyor to regard the generator-aspnetcore-spa.tar.gz file as a build artifact 2017-01-02 12:02:58 +00:00
SteveSandersonMS
dad095b749 Bump generator-aspnetcore-spa version to 0.7.2 2017-01-02 11:59:51 +00:00
SteveSandersonMS
f31b96fe1e Yeoman package builder emits .tar.gz artifact 2017-01-02 11:59:16 +00:00
SteveSandersonMS
312885acde Add AppVeyor status to root README.md 2017-01-02 11:31:40 +00:00
SteveSandersonMS
0763f1062b Add missing trailing slash on publicPath in docs. Fixes #516. 2017-01-02 10:58:03 +00:00
SteveSandersonMS
dcb819f644 Fix port testing logic in tests by being explicit about which interface we're checking 2016-12-15 22:53:12 +00:00
SteveSandersonMS
f722dcf98d Fix PrerenderResult in Webpack sample 2016-12-15 21:45:02 +00:00
SteveSandersonMS
153c9848ca Also build samples/misc 2016-12-15 21:42:40 +00:00
SteveSandersonMS
aefa578e04 Reuse TEST_PROJECT_GLOB to build templates, since the 'test' dir doesn't contain any .NET projects 2016-12-15 21:09:44 +00:00
SteveSandersonMS
953f370336 Wait for port to be freed before continuing 2016-12-15 20:34:55 +00:00
SteveSandersonMS
200d80627c Update Appveyor test environment to Node 6.9.2 to deal with Windows-specific NPM issues 2016-12-15 20:34:46 +00:00
SteveSandersonMS
994653a277 Stop including templates in regular build (they now contain .csproj, which is not supported by that build system, and in any case they are built and end-to-end tested on Appveyor) 2016-12-15 20:32:08 +00:00
SteveSandersonMS
17b107bb42 Fix how 'current' and 'preview' SDKs are merged in Appveyor builds 2016-12-15 19:31:09 +00:00
SteveSandersonMS
67cd5f6093 In csproj projects, reference 1.1.0-preview4-final version of Razor tools 2016-12-15 18:10:43 +00:00
SteveSandersonMS
06ccad4344 Automatically install both the 'current' and 'preview' SDKs when building in Appveyor 2016-12-15 18:07:34 +00:00
SteveSandersonMS
4fd19b4293 Run tests against both csproj and project.json-style projects. Assumes relevant dotnet SDKs are installed locally. 2016-12-15 17:17:04 +00:00
SteveSandersonMS
f34eb582ad Update tests to be compatible with newer Yeoman generator 2016-12-15 16:52:02 +00:00
SteveSandersonMS
4580412f73 Don't leave behind an unused package.json.tmp file 2016-12-15 16:42:25 +00:00
SteveSandersonMS
a76b6e25d4 Add .csproj files for the templates. Some are set up for prerendering; others not. 2016-12-15 16:42:25 +00:00
SteveSandersonMS
2135d77189 generator-aspnetcore-spa support for selecting between project.json and .csproj 2016-12-15 16:42:25 +00:00
SteveSandersonMS
62b676174e generator-aspnetcore-spa now displays its own version number on startup 2016-12-15 16:41:10 +00:00
SteveSandersonMS
67c2cfd84e Add Appveyor builds and webdriver.io tests (tests cover Angular2Spa template only at present) 2016-12-15 16:38:30 +00:00
SteveSandersonMS
6decb30681 Make 'counter' components use <h1> headers to be consistent with other pages 2016-12-15 16:37:29 +00:00
SteveSandersonMS
33ed333f92 Specify SDK at repo root 2016-12-15 16:35:48 +00:00
SteveSandersonMS
6c16ba3da7 Remove template_nodemodules_placeholder.txt files - they are redundant now that we no longer need to publish node_modules to production 2016-12-15 16:35:48 +00:00
SteveSandersonMS
495c95d227 If generator fails because NPM is too old, exit with nonzero status code 2016-12-15 16:35:48 +00:00
SteveSandersonMS
4dd91a9b78 Make template package build script automate running the prepublish steps needed for the Angular2Spa template 2016-12-14 10:21:04 +00:00
SteveSandersonMS
06335eeee1 Fix building generator-aspnetcore-spa (something in a newer TypeScript version broke it) 2016-12-14 09:56:23 +00:00
SteveSandersonMS
eb98067e86 Update docs about using socket transport. Fixes #500 2016-12-13 15:59:43 +00:00
SteveSandersonMS
a25d1f4731 Publish aspnet-webpack 1.0.26 2016-12-13 15:48:44 +00:00
SteveSandersonMS
4c3834361e Stop WebpackDevMiddleware littering the 'dist' directories with blah.host-update.js.map files (they never need to be written to disk) 2016-12-13 15:47:43 +00:00
SteveSandersonMS
4cc61d79e2 Add json-loader to add webpack.config.js files. Helps with #507. 2016-12-13 12:57:06 +00:00
SteveSandersonMS
1c4682e50d Fix all the ConditionalProxyMiddleware errors that happened if you ctrl+c on a "dotnet run" (not "dotnet watch run") since beta-000002. 2016-12-13 11:32:32 +00:00
Sébastien Ros
6545e11bf2 Fix filename in sample
Mismatch between code sample and described js filename.
2016-12-08 10:04:50 +00:00
SteveSandersonMS
8d1cb3a537 Remove angular2-aspnet NPM package source as none of its functionality is still in use (and hasn't been since beta versions of Angular 2) 2016-12-08 10:02:37 +00:00
SteveSandersonMS
8705a4b353 Remove redux-typed from source tree. It's no longer in use and doesn't need to be maintained. Source can be re-added in the future if needed. 2016-12-07 19:02:53 +00:00
SteveSandersonMS
7c685c1354 Add AssemblyInfo.cs to Microsoft.AspNetCore.NodeServices.Sockets package 2016-12-07 18:09:11 +00:00
SteveSandersonMS
633969c7b4 Update Dockerfiles for .NET Core 1.1.0. Fixes #489 2016-12-07 11:15:40 +00:00
SteveSandersonMS
9c1c1b4023 Publish aspnet-prerendering 2.0.2 2016-12-01 17:31:32 +00:00
SteveSandersonMS
0a116ba2a1 Prerendering logic supplies PathBase (formatted as baseUrl) to boot logic 2016-12-01 17:24:24 +00:00
SteveSandersonMS
2b2465ad2e Update prerendering docs to account for aspnet-prerendering 2.0.0 and the new createServerRenderer API. Fixes #479 2016-12-01 14:41:48 +00:00
SteveSandersonMS
dc130adc91 Update aspnet-prerendering to reference baseUrl in domain-task's main module, not domain-task/fetch. Goal is to avoid Webpack having to bundle isomorphic-fetch on server unless you're actually using it. 2016-12-01 14:32:54 +00:00
SteveSandersonMS
b8913d29dd Update domain-task to export baseUrl from 'main' instead of only 'fetch'. Goal is to avoid Webpack detecting dependency on isomorphic-fetch unless you're actually using it. 2016-12-01 14:31:27 +00:00
SteveSandersonMS
5e669d6e7a Publish Yeoman generators 0.7.1 2016-11-30 17:54:46 +00:00
SteveSandersonMS
5d02728159 Publish Yeoman generators version 0.7.0. From here on, the templates produce ASP.NET Core 1.1.0 projects. 2016-11-30 17:09:24 +00:00
SteveSandersonMS
78632617f8 Publish aspnet-webpack 1.0.25 2016-11-30 16:53:39 +00:00
SteveSandersonMS
e2f8031bb8 For HMR, proxy all requests including /__webpack_hmr. Fixes #271. 2016-11-30 16:53:16 +00:00
SteveSandersonMS
2cffab14f6 StringAsTempFile cleans up in a wider range of circumstances (not relying on finalizer running). Helps with #7 but still doesn't cover all cases. 2016-11-30 15:04:08 +00:00
SteveSandersonMS
9001c191c1 Make Angular and React templates reference SpaServices directly. The AngularServices/ReactServices packages might be used in the future, but don't presently contain any extra usable functionality. 2016-11-30 12:19:05 +00:00
SteveSandersonMS
832da2a451 Split out 'socket' hosting model into a separate optional NuGet package, since most developers won't need it 2016-11-30 12:18:57 +00:00
SteveSandersonMS
ebf5a18344 Eliminate the NodeHostingModel enum because it isn't extensible. Instead, use extension methods on NodeServicesOptions to configure a NodeInstanceFactory. 2016-11-30 11:29:57 +00:00
SteveSandersonMS
d865e1f28b Specify latest 'current' SDK in all template global.json files 2016-11-30 11:29:57 +00:00
SteveSandersonMS
62c0680193 Make 'fetchdata' components in templates compatible with latest TypeScript compiler 2016-11-29 19:11:03 +00:00
SteveSandersonMS
a8d3eed32c Detect legacy aspnet-prerendering mode earlier to fix #470 2016-11-29 18:37:43 +00:00
SteveSandersonMS
5d14f11b1b Update all the project templates to .NET Core 1.1.0 2016-11-29 16:36:05 +00:00
SteveSandersonMS
196c0dd32e Update other samples to 1.1.0 dependencies 2016-11-29 16:36:05 +00:00
SteveSandersonMS
31d8eb69a7 Updated all 'misc' samples to 1.1.0 dependencies (and to TypeScript 2 for the Webpack sample) 2016-11-29 16:36:05 +00:00
SteveSandersonMS
4cbbf58600 Update core packages to version 1.1.0-*, upgrading .NET Core dependencies to match 1.1.0 release 2016-11-29 16:35:59 +00:00
349 changed files with 4337 additions and 3860 deletions

3
.gitignore vendored
View File

@@ -13,7 +13,6 @@ PublishProfiles/
*.docstates *.docstates
_ReSharper.* _ReSharper.*
nuget.exe nuget.exe
project.lock.json
*net45.csproj *net45.csproj
*net451.csproj *net451.csproj
*k10.csproj *k10.csproj
@@ -39,3 +38,5 @@ npm-debug.log
/templates/*/ClientApp/dist/ /templates/*/ClientApp/dist/
/templates/*/yarn.lock /templates/*/yarn.lock
.vscode/ .vscode/
/templates/*/Properties/launchSettings.json

View File

@@ -10,11 +10,10 @@ addons:
- libssl-dev - libssl-dev
- libunwind8 - libunwind8
- zlib1g - zlib1g
mono: mono: none
- 4.0.5
os: os:
- linux - linux
- osx - osx
osx_image: xcode7.1 osx_image: xcode7.1
script: script:
- ./build.sh verify - ./build.sh

View File

@@ -1,54 +1,68 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 15
VisualStudioVersion = 14.0.25420.1 VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E6E88944-4800-40BA-8AF5-069EA3ADFEB8}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{27304DDE-AFB2-4F8B-B765-E3E2F11E886C}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.NodeServices", "src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.xproj", "{B0FA4175-8B29-4904-9780-28B3C24B0567}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices", "src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.csproj", "{66B77203-1469-41DF-92F2-2BE6900BD36F}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NodeServicesExamples", "samples\misc\NodeServicesExamples\NodeServicesExamples.xproj", "{6D4BCDD6-7951-449B-BE55-CB7F014B7430}" 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}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{78DAC76C-1092-45AB-BF0D-594B8C7B6569}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices", "src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.csproj", "{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}"
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("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\angular\MusicStore\MusicStore.xproj", "{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{23836492-E7F4-4376-85BF-A635C304AC46}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactGrid", "samples\react\ReactGrid\ReactGrid.xproj", "{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{E6A161EA-646C-4033-9090-95BE809AB8D9}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.AngularServices", "src\Microsoft.AspNetCore.AngularServices\Microsoft.AspNetCore.AngularServices.xproj", "{421807E6-B62C-417B-B901-46C5DEDAA8F1}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.csproj", "{1931B19A-EC42-4D56-B2D0-FB06D17244DA}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.ReactServices", "src\Microsoft.AspNetCore.ReactServices\Microsoft.AspNetCore.ReactServices.xproj", "{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webpack", "samples\misc\Webpack\Webpack.csproj", "{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.SpaServices", "src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.xproj", "{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NodeServicesExamples", "samples\misc\NodeServicesExamples\NodeServicesExamples.csproj", "{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{727E6D58-6830-4792-96C6-E138A33959FB}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "angular", "angular", "{B54435EB-D5E8-4CEC-A02E-DDCB0C750E34}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Angular2Spa", "templates\Angular2Spa\Angular2Spa.xproj", "{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicStore", "samples\angular\MusicStore\MusicStore.csproj", "{63FC66E7-559B-4426-93E1-2D951EFC8293}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactReduxSpa", "templates\ReactReduxSpa\ReactReduxSpa.xproj", "{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "react", "react", "{BD77E73E-13BC-4550-99DA-51869BD8DFC4}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactSpa", "templates\ReactSpa\ReactSpa.xproj", "{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactGrid", "samples\react\ReactGrid\ReactGrid.csproj", "{3B023106-88DB-4C3A-B01F-C1AECB02D80B}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.xproj", "{CB4398D6-B7F1-449A-AE02-828769679232}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicStore", "samples\react\MusicStore\MusicStore.csproj", "{6E898586-79CA-4AA8-946E-943B3682F376}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{E0771531-BE20-40CD-A1B0-A57E09511060}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{1598B415-73F1-4B37-B3B4-0A10677ABB2D}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Webpack", "samples\misc\Webpack\Webpack.xproj", "{A8905301-8492-42FD-9E83-F715A0FDC3A2}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KnockoutSpa", "templates\KnockoutSpa\KnockoutSpa.csproj", "{F60248B1-940E-43FB-BEA0-589362AA6320}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.xproj", "{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AngularSpa", "templates\AngularSpa\AngularSpa.csproj", "{4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "React", "React", "{E0EBA813-4478-4C02-B11D-FB3793113FE4}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AureliaSpa", "templates\AureliaSpa\AureliaSpa.csproj", "{4D57B6E1-7141-48ED-959E-872BDD4A2F72}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\react\MusicStore\MusicStore.xproj", "{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactSpa", "templates\ReactSpa\ReactSpa.csproj", "{868A630E-C61B-4807-B7A8-7EB53BE1C28A}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Angular", "Angular", "{4867A616-83D6-48DC-964D-6AE743596631}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactReduxSpa", "templates\ReactReduxSpa\ReactReduxSpa.csproj", "{9D4D15A1-A25B-44EC-AB63-F1CE9986712E}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Aurelia", "templates\AureliaSpa\Aurelia.xproj", "{33D8DAD9-74F9-471D-8BAD-55F828FAA736}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.csproj", "{86911E07-C733-4C18-B49F-9A007A651246}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "KnockoutSpa", "templates\KnockoutSpa\KnockoutSpa.xproj", "{85231B41-6998-49AE-ABD2-5124C83DBEF2}" 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
@@ -56,89 +70,104 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {66B77203-1469-41DF-92F2-2BE6900BD36F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Debug|Any CPU.Build.0 = Debug|Any CPU {66B77203-1469-41DF-92F2-2BE6900BD36F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Release|Any CPU.ActiveCfg = Release|Any CPU {66B77203-1469-41DF-92F2-2BE6900BD36F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0FA4175-8B29-4904-9780-28B3C24B0567}.Release|Any CPU.Build.0 = Release|Any CPU {66B77203-1469-41DF-92F2-2BE6900BD36F}.Release|Any CPU.Build.0 = Release|Any CPU
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Debug|Any CPU.Build.0 = Debug|Any CPU {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Release|Any CPU.ActiveCfg = Release|Any CPU {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Release|Any CPU.Build.0 = Release|Any CPU {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Release|Any CPU.Build.0 = Release|Any CPU
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Debug|Any CPU.Build.0 = Debug|Any CPU {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Release|Any CPU.ActiveCfg = Release|Any CPU {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Release|Any CPU.Build.0 = Release|Any CPU {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Release|Any CPU.Build.0 = Release|Any CPU
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Debug|Any CPU.Build.0 = Debug|Any CPU {58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Release|Any CPU.ActiveCfg = Release|Any CPU {58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Release|Any CPU.Build.0 = Release|Any CPU {58AAABB6-9D21-42F6-BC97-3DD282B55FD6}.Release|Any CPU.Build.0 = Release|Any CPU
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Debug|Any CPU.Build.0 = Debug|Any CPU {F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Release|Any CPU.ActiveCfg = Release|Any CPU {F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{421807E6-B62C-417B-B901-46C5DEDAA8F1}.Release|Any CPU.Build.0 = Release|Any CPU {F1081B9A-8D67-4A5E-80C6-615F9A975D4F}.Release|Any CPU.Build.0 = Release|Any CPU
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Release|Any CPU.Build.0 = Release|Any CPU {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Release|Any CPU.Build.0 = Release|Any CPU
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Release|Any CPU.Build.0 = Release|Any CPU {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Release|Any CPU.Build.0 = Release|Any CPU
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Debug|Any CPU.Build.0 = Debug|Any CPU {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Release|Any CPU.ActiveCfg = Release|Any CPU {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Release|Any CPU.Build.0 = Release|Any CPU {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Release|Any CPU.Build.0 = Release|Any CPU
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {63FC66E7-559B-4426-93E1-2D951EFC8293}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU {63FC66E7-559B-4426-93E1-2D951EFC8293}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU {63FC66E7-559B-4426-93E1-2D951EFC8293}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Release|Any CPU.Build.0 = Release|Any CPU {63FC66E7-559B-4426-93E1-2D951EFC8293}.Release|Any CPU.Build.0 = Release|Any CPU
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Release|Any CPU.ActiveCfg = Release|Any CPU {3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Release|Any CPU.Build.0 = Release|Any CPU {3B023106-88DB-4C3A-B01F-C1AECB02D80B}.Release|Any CPU.Build.0 = Release|Any CPU
{CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6E898586-79CA-4AA8-946E-943B3682F376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E898586-79CA-4AA8-946E-943B3682F376}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.ActiveCfg = Release|Any CPU {6E898586-79CA-4AA8-946E-943B3682F376}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.Build.0 = Release|Any CPU {6E898586-79CA-4AA8-946E-943B3682F376}.Release|Any CPU.Build.0 = Release|Any CPU
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F60248B1-940E-43FB-BEA0-589362AA6320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.Build.0 = Debug|Any CPU {F60248B1-940E-43FB-BEA0-589362AA6320}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.ActiveCfg = Release|Any CPU {F60248B1-940E-43FB-BEA0-589362AA6320}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.Build.0 = Release|Any CPU {F60248B1-940E-43FB-BEA0-589362AA6320}.Release|Any CPU.Build.0 = Release|Any CPU
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.Build.0 = Debug|Any CPU {4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.ActiveCfg = Release|Any CPU {4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.Build.0 = Release|Any CPU {4D4B84C9-13F7-40CA-B05A-DC98FD6019AC}.Release|Any CPU.Build.0 = Release|Any CPU
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.Build.0 = Debug|Any CPU {4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.ActiveCfg = Release|Any CPU {4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.Build.0 = Release|Any CPU {4D57B6E1-7141-48ED-959E-872BDD4A2F72}.Release|Any CPU.Build.0 = Release|Any CPU
{33D8DAD9-74F9-471D-8BAD-55F828FAA736}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{33D8DAD9-74F9-471D-8BAD-55F828FAA736}.Debug|Any CPU.Build.0 = Debug|Any CPU {868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{33D8DAD9-74F9-471D-8BAD-55F828FAA736}.Release|Any CPU.ActiveCfg = Release|Any CPU {868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{33D8DAD9-74F9-471D-8BAD-55F828FAA736}.Release|Any CPU.Build.0 = Release|Any CPU {868A630E-C61B-4807-B7A8-7EB53BE1C28A}.Release|Any CPU.Build.0 = Release|Any CPU
{85231B41-6998-49AE-ABD2-5124C83DBEF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85231B41-6998-49AE-ABD2-5124C83DBEF2}.Debug|Any CPU.Build.0 = Debug|Any CPU {9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85231B41-6998-49AE-ABD2-5124C83DBEF2}.Release|Any CPU.ActiveCfg = Release|Any CPU {9D4D15A1-A25B-44EC-AB63-F1CE9986712E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85231B41-6998-49AE-ABD2-5124C83DBEF2}.Release|Any CPU.Build.0 = 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
{6D4BCDD6-7951-449B-BE55-CB7F014B7430} = {E0771531-BE20-40CD-A1B0-A57E09511060} {66B77203-1469-41DF-92F2-2BE6900BD36F} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B} = {4867A616-83D6-48DC-964D-6AE743596631} {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
{ABF90A5B-F4E0-438C-A6E4-9549FB43690B} = {E0EBA813-4478-4C02-B11D-FB3793113FE4} {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11} = {727E6D58-6830-4792-96C6-E138A33959FB} {58AAABB6-9D21-42F6-BC97-3DD282B55FD6} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
{DBFC6DB0-A6D1-4694-A108-1C604B988DA3} = {727E6D58-6830-4792-96C6-E138A33959FB} {F1081B9A-8D67-4A5E-80C6-615F9A975D4F} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C}
{E9D1A695-F0E6-46F2-B5E3-72F4AF805387} = {727E6D58-6830-4792-96C6-E138A33959FB} {E6A161EA-646C-4033-9090-95BE809AB8D9} = {23836492-E7F4-4376-85BF-A635C304AC46}
{CB4398D6-B7F1-449A-AE02-828769679232} = {727E6D58-6830-4792-96C6-E138A33959FB} {1931B19A-EC42-4D56-B2D0-FB06D17244DA} = {E6A161EA-646C-4033-9090-95BE809AB8D9}
{E0771531-BE20-40CD-A1B0-A57E09511060} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} {DE479DC3-1461-4EAD-A188-4AF7AA4AE344} = {E6A161EA-646C-4033-9090-95BE809AB8D9}
{A8905301-8492-42FD-9E83-F715A0FDC3A2} = {E0771531-BE20-40CD-A1B0-A57E09511060} {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE} = {E6A161EA-646C-4033-9090-95BE809AB8D9}
{A64AF9D9-72AA-4433-BE1D-DC2524B6808A} = {E0771531-BE20-40CD-A1B0-A57E09511060} {B54435EB-D5E8-4CEC-A02E-DDCB0C750E34} = {23836492-E7F4-4376-85BF-A635C304AC46}
{E0EBA813-4478-4C02-B11D-FB3793113FE4} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} {63FC66E7-559B-4426-93E1-2D951EFC8293} = {B54435EB-D5E8-4CEC-A02E-DDCB0C750E34}
{C870A92C-9E3F-4BF2-82B8-5758545A8B7C} = {E0EBA813-4478-4C02-B11D-FB3793113FE4} {BD77E73E-13BC-4550-99DA-51869BD8DFC4} = {23836492-E7F4-4376-85BF-A635C304AC46}
{4867A616-83D6-48DC-964D-6AE743596631} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} {3B023106-88DB-4C3A-B01F-C1AECB02D80B} = {BD77E73E-13BC-4550-99DA-51869BD8DFC4}
{33D8DAD9-74F9-471D-8BAD-55F828FAA736} = {727E6D58-6830-4792-96C6-E138A33959FB} {6E898586-79CA-4AA8-946E-943B3682F376} = {BD77E73E-13BC-4550-99DA-51869BD8DFC4}
{85231B41-6998-49AE-ABD2-5124C83DBEF2} = {727E6D58-6830-4792-96C6-E138A33959FB} {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

8
NuGet.config Normal file
View File

@@ -0,0 +1,8 @@
<?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>

View File

@@ -1,8 +0,0 @@
<?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>

View File

@@ -1,10 +1,18 @@
# JavaScriptServices # JavaScriptServices
AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/gprilrckx116vc9m/branch/dev?svg=true)](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?
`JavaScriptServices` is a set of technologies for ASP.NET Core developers. It provides infrastructure that you'll find useful if you use Angular 2 / React / Knockout / etc. on the client, or if you build your client-side resources using Webpack, or otherwise want to execute JavaScript on the server at runtime. `JavaScriptServices` is a set of client-side technologies for ASP.NET Core. It provides infrastructure that you'll find useful if you:
- Use Angular / React / Vue / Aurelia / Knockout / etc.
- Build your client-side resources using Webpack.
- Execute JavaScript on the server at runtime.
Read [Building Single Page Applications on ASP.NET Core with JavaScriptServices](https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/) for more details.
This repo contains: This repo contains:
@@ -15,27 +23,26 @@ This repo contains:
* Hot module replacement (HMR) ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#webpack-hot-module-replacement)) * Hot module replacement (HMR) ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#webpack-hot-module-replacement))
* Server-side and client-side routing integration ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#routing-helper-mapspafallbackroute)) * Server-side and client-side routing integration ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#routing-helper-mapspafallbackroute))
* Server-side and client-side validation integration * Server-side and client-side validation integration
* "Cache priming" for Angular 2 apps
* "Lazy loading" for Knockout apps * "Lazy loading" for Knockout apps
* A Yeoman generator that creates preconfigured app starting points ([guide](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/)) * A Yeoman generator that creates preconfigured app starting points ([guide](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/))
* Samples and docs * Samples and docs
Everything here is cross-platform, and works with .NET Core 1.0.1 or later on Windows, Linux, or OS X. It's cross-platform (Windows, Linux, or macOS) and works with .NET Core 1.0.1 or later.
## Creating new applications ## Creating new applications
If you want to build a brand-new ASP.NET Core app that uses Angular 2 / React / Knockout on the client, consider starting with the `aspnetcore-spa` generator. This lets you choose your client-side framework, and generates a starting point that includes applicable features such as Webpack dev middleware, server-side prerendering, and efficient production builds. It's much easier than configuring everything to work together manually! If you want to build a brand-new ASP.NET Core app that uses Angular / React / Knockout on the client, consider starting with the `aspnetcore-spa` generator. This lets you choose your client-side framework. It generates a starting point that includes applicable features such as Webpack dev middleware, server-side prerendering, and efficient production builds. It's much easier than configuring everything to work together manually!
To do this, first install Yeoman and these generator templates: To do this, install Yeoman and these generator templates:
npm install -g yo generator-aspnetcore-spa npm install -g yo generator-aspnetcore-spa
Then you can generate your new application starting point: Generate your new application starting point:
cd some-empty-directory cd some-empty-directory
yo aspnetcore-spa yo aspnetcore-spa
Finally, once the generator has run and restored all the dependencies, you can start up your new ASP.NET Core Single Page Application: Once the generator has run and restored all the dependencies, you can start up your new ASP.NET Core SPA:
dotnet run dotnet run
@@ -50,11 +57,11 @@ If you have an existing ASP.NET Core application, or if you just want to use the
* Most applications developers don't need to use this directly, but you can do so if you want to implement your own functionality that involves calling Node.js code from .NET at runtime. * Most applications developers don't need to use this directly, but you can do so if you want to implement your own functionality that involves calling Node.js code from .NET at runtime.
* Find [documentation and usage examples here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.NodeServices#microsoftaspnetcorenodeservices). * Find [documentation and usage examples here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.NodeServices#microsoftaspnetcorenodeservices).
* `Microsoft.AspNetCore.SpaServices` * `Microsoft.AspNetCore.SpaServices`
* This provides infrastructure that's generally useful when building Single Page Applications (SPAs) with technologies such as Angular 2 or React (for example, server-side prerendering and webpack middleware). Internally, it uses the `NodeServices` package to implement its features. * This provides infrastructure that's generally useful when building Single Page Applications (SPAs) with technologies such as Angular or React (for example, server-side prerendering and webpack middleware). Internally, it uses the `NodeServices` package to implement its features.
* Find [documentation and usage examples here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#microsoftaspnetcorespaservices). * Find [documentation and usage examples here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#microsoftaspnetcorespaservices).
* `Microsoft.AspNetCore.AngularServices` * `Microsoft.AspNetCore.AngularServices`
* This builds on the `SpaServices` package and includes features specific to Angular 2. Currently, this includes validation helpers and a "cache priming" feature, which let you pre-evaluate ajax requests on the server so that client-side code doesn't need to make network calls once it's loaded. * This builds on the `SpaServices` package and includes features specific to Angular. Currently, this includes validation helpers.
* The code is [here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.AngularServices), and you'll find a usage example for [the validation helper here](https://github.com/aspnet/JavaScriptServices/blob/dev/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts), and for the [cache priming here](https://github.com/aspnet/JavaScriptServices/blob/dev/samples/angular/MusicStore/Views/Home/Index.cshtml#L7-8). Full docs are to be written. * The code is [here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.AngularServices). You'll find a usage example for [the validation helper here](https://github.com/aspnet/JavaScriptServices/blob/dev/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts).
There was previously a `Microsoft.AspNetCore.ReactServices` but this is not currently needed - all applicable functionality is in `Microsoft.AspNetCore.SpaServices`, because it's sufficiently general. We might add a new `Microsoft.AspNetCore.ReactServices` package in the future if new React-specific requirements emerge. There was previously a `Microsoft.AspNetCore.ReactServices` but this is not currently needed - all applicable functionality is in `Microsoft.AspNetCore.SpaServices`, because it's sufficiently general. We might add a new `Microsoft.AspNetCore.ReactServices` package in the future if new React-specific requirements emerge.
@@ -62,28 +69,32 @@ If you want to build a helper library for some other SPA framework, you can do s
## Samples and templates ## Samples and templates
Inside this repo, [the `templates` directory](https://github.com/aspnet/JavaScriptServices/tree/dev/templates) contains the application starting points that the `aspnetcore-spa` generator emits. If you want, you can clone this repo and run those applications directly. But it's easier to [use the Yeoman tool to run the generator](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/). Inside this repo, [the `templates` directory](https://github.com/aspnet/JavaScriptServices/tree/dev/templates) contains the application starting points that the `aspnetcore-spa` generator emits. You can clone this repo and run those applications directly. But it's easier to [use the Yeoman tool to run the generator](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/).
Also in this repo, [the `samples` directory](https://github.com/aspnet/JavaScriptServices/tree/dev/samples) contains examples of using the JavaScript services family of packages with Angular 2 and React, plus examples of standalone `NodeServices` usage for runtime code transpilation and image processing. The [`samples` directory](https://github.com/aspnet/JavaScriptServices/tree/dev/samples) contains examples of:
- Using the JavaScript services family of packages with Angular and React.
- A standalone `NodeServices` usage for runtime code transpilation and image processing.
**To run the samples:** **To run the samples:**
* Clone this repo * Clone this repo
* At the repo's root directory (the one containing `src`, `samples`, etc.), run `dotnet restore` * At the repo's root directory (the one containing `src`, `samples`, etc.), run `dotnet restore`
* Change directory to the sample you want to run (e.g., `cd samples/angular/MusicStore`) * Change directory to the sample you want to run (for example, `cd samples/angular/MusicStore`)
* Restore Node dependencies by running `npm install` * Restore Node dependencies by running `npm install`
* If you're trying to run the Angular 2 "Music Store" sample, then also run `gulp` (which you need to have installed globally). None of the other samples require this. * If you're trying to run the Angular "Music Store" sample, then also run `gulp` (which you need to have installed globally). None of the other samples require this.
* Run the application (`dotnet run`) * Run the application (`dotnet run`)
* Browse to [http://localhost:5000](http://localhost:5000) * Browse to [http://localhost:5000](http://localhost:5000)
## Contributing ## Contributing
If you're interested in contributing to the various packages, samples, and project templates in this repo, that's great! You can run the code in this repo just by: If you're interested in contributing to the various packages, samples, and project templates in this repo, that's great! You can run the code in this repo as follows:
* Cloning the repo * Clone the repo
* Running `dotnet restore` at the repo root dir * Run `dotnet restore` at the repo root dir
* Going to whatever sample or template you want to run (e.g., `cd templates/Angular2Spa`) * Go to whatever sample or template you want to run (for example, `cd templates/AngularSpa`)
* Restoring NPM dependencies (run `npm install`) * Restore NPM dependencies (run `npm install`)
* Launching it (`dotnet run`) * If the sample/template you're trying to run has a file called `webpack.config.vendor.js` at its root, run `webpack --config webpack.config.vendor.js`. It it has a file called `webpack.config.js`, run `webpack` (no args). You might need to install webpack first, by running `npm install -g webpack`.
* Launch it (`dotnet run`)
If you're planning to submit a pull request, and if it's more than a trivial fix (e.g., for a typo), it's usually a good idea first to file an issue describing what you're proposing to do and how it will work. Then you can find out if it's likely that such a pull request will be accepted, and how it fits into wider ongoing plans. If you're planning to submit a pull request, and if it's more than a trivial fix (for example, for a typo), it's usually a good idea first to file an issue describing what you're proposing to do and how it will work. Then you can find out if it's likely that such a pull request will be accepted, and how it fits into wider ongoing plans.

View File

@@ -1,7 +1,40 @@
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://download.microsoft.com/download/E/7/8/E782433E-7737-4E6C-BFBF-290A0A81C3D7/dotnet-dev-win-x64.1.0.4.zip"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: $tempFileCurrent = [System.IO.Path]::GetTempFileName()
- ps: (New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent)
- ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR)
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
build_script: build_script:
- build.cmd verify - ps: Push-Location
- 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: off test_script:
- dotnet restore
- ps: Push-Location
- cd test
- npm install selenium-standalone
- ps: Start-Process node './start-selenium.js'
- 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

View File

@@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries)
{ {
while($true) while($true)
{ {
@@ -19,7 +19,7 @@ function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $ret
Start-Sleep -Seconds 10 Start-Sleep -Seconds 10
} }
else else
{ {
$exception = $_.Exception $exception = $_.Exception
throw $exception throw $exception
@@ -43,18 +43,18 @@ $buildFolder = ".build"
$buildFile="$buildFolder\KoreBuild.ps1" $buildFile="$buildFolder\KoreBuild.ps1"
if (!(Test-Path $buildFolder)) { if (!(Test-Path $buildFolder)) {
Write-Host "Downloading KoreBuild from $koreBuildZip" Write-Host "Downloading KoreBuild from $koreBuildZip"
$tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid()
New-Item -Path "$tempFolder" -Type directory | Out-Null New-Item -Path "$tempFolder" -Type directory | Out-Null
$localZipFile="$tempFolder\korebuild.zip" $localZipFile="$tempFolder\korebuild.zip"
DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6
Add-Type -AssemblyName System.IO.Compression.FileSystem Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder)
New-Item -Path "$buildFolder" -Type directory | Out-Null New-Item -Path "$buildFolder" -Type directory | Out-Null
copy-item "$tempFolder\**\build\*" $buildFolder -Recurse copy-item "$tempFolder\**\build\*" $buildFolder -Recurse
@@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) {
} }
} }
&"$buildFile" $args &"$buildFile" @args

View File

@@ -12,12 +12,12 @@ buildFile="$buildFolder/KoreBuild.sh"
if test ! -d $buildFolder; then if test ! -d $buildFolder; then
echo "Downloading KoreBuild from $koreBuildZip" echo "Downloading KoreBuild from $koreBuildZip"
tempFolder="/tmp/KoreBuild-$(uuidgen)" tempFolder="/tmp/KoreBuild-$(uuidgen)"
mkdir $tempFolder mkdir $tempFolder
localZipFile="$tempFolder/korebuild.zip" localZipFile="$tempFolder/korebuild.zip"
retries=6 retries=6
until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null)
do do
@@ -29,18 +29,18 @@ if test ! -d $buildFolder; then
echo "Waiting 10 seconds before retrying. Retries left: $retries" echo "Waiting 10 seconds before retrying. Retries left: $retries"
sleep 10s sleep 10s
done done
unzip -q -d $tempFolder $localZipFile unzip -q -d $tempFolder $localZipFile
mkdir $buildFolder mkdir $buildFolder
cp -r $tempFolder/**/build/** $buildFolder cp -r $tempFolder/**/build/** $buildFolder
chmod +x $buildFile chmod +x $buildFile
# Cleanup # Cleanup
if test ! -d $tempFolder; then if test ! -d $tempFolder; then
rm -rf $tempFolder rm -rf $tempFolder
fi fi
fi fi
$buildFile -r $repoFolder "$@" $buildFile -r $repoFolder "$@"

20
build/common.props Normal file
View File

@@ -0,0 +1,20 @@
<Project>
<Import Project="dependencies.props" />
<Import Project="version.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>
<VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" Version="$(InternalAspNetCoreSdkVersion)" PrivateAssets="All" />
</ItemGroup>
</Project>

14
build/dependencies.props Normal file
View File

@@ -0,0 +1,14 @@
<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>
<InternalAspNetCoreSdkVersion>2.0.0-*</InternalAspNetCoreSdkVersion>
<MicrosoftDataflowVersion>4.5.24</MicrosoftDataflowVersion>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<ThreadingDataflowVersion>4.7.0</ThreadingDataflowVersion>
</PropertyGroup>
</Project>

12
build/repo.targets Normal file
View File

@@ -0,0 +1,12 @@
<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>

6
build/version.props Normal file
View File

@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.1.2</VersionPrefix>
<VersionSuffix>preview1</VersionSuffix>
</PropertyGroup>
</Project>

View File

@@ -1,3 +0,0 @@
{
"projects": ["src"]
}

View File

@@ -1,8 +0,0 @@
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

View File

@@ -1,22 +0,0 @@
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

View File

@@ -1,7 +1,6 @@
/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

View File

@@ -0,0 +1,31 @@
<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>

View File

@@ -1,20 +0,0 @@
<?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>

View File

@@ -1,79 +0,0 @@
{
"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%" ]
}
}

View File

@@ -14,7 +14,7 @@ export class AlbumDeletePrompt {
public show(album: models.Album) { public show(album: models.Album) {
this.album = album; this.album = album;
// Consider rewriting this using Angular 2's "Renderer" API so as to avoid direct DOM access // Consider rewriting this using Angular's "Renderer" API so as to avoid direct DOM access
(<any>window).jQuery(".modal", this._elementRef.nativeElement).modal(); (<any>window).jQuery(".modal", this._elementRef.nativeElement).modal();
} }
} }

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<IsPackable>false</IsPackable>
<OutputType>exe</OutputType>
</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>

View File

@@ -1,19 +0,0 @@
<?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>

View File

@@ -3,6 +3,7 @@ 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
@@ -16,7 +17,10 @@ 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 => {
options.HostingModel = NodeServicesOptions.DefaultNodeHostingModel; // To compare with Socket hosting, uncomment the following line
// 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
}); });

View File

@@ -1,19 +0,0 @@
{
"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"
}
}
}

View File

@@ -1,5 +1,6 @@
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
{ {
@@ -15,8 +16,21 @@ namespace NodeServicesExamples.Controllers
return View(); return View();
} }
public IActionResult ImageResizing() public async Task<IActionResult> Chart([FromServices] INodeServices nodeServices)
{ {
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();
} }

View File

@@ -1,64 +0,0 @@
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;
}
}
}

View File

@@ -0,0 +1,8 @@
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
);
};

View File

@@ -1,8 +0,0 @@
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);
}

View File

@@ -0,0 +1,26 @@
<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>

View File

@@ -1,20 +0,0 @@
<?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>

View File

@@ -0,0 +1,12 @@
<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"])

View File

@@ -1,34 +0,0 @@
<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>

View File

@@ -7,7 +7,6 @@
</p> </p>
<ul> <ul>
<li><a asp-action="ES2015Transpilation">ES2015 transpilation</a> <li><a asp-action="ES2015Transpilation">ES2015 transpilation</a></li>
<li><a asp-action="ImageResizing">Image resizing</a> <li><a asp-action="Chart">Server-side chart rendering</a></li>
</li> </ul>

View File

@@ -1,8 +1,9 @@
<!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()

View File

@@ -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",
"sharp": "^0.15.0" "node-chartist": "^1.0.2"
} }
} }

View File

@@ -1,50 +0,0 @@
{
"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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

View File

@@ -1,6 +1,9 @@
## 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
@@ -40,10 +43,6 @@ 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

View File

@@ -38,7 +38,8 @@ 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";

View File

@@ -2,8 +2,8 @@ export default function (params: any): Promise<{ html: string, globals?: any }>
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// Here, you could put any logic that synchronously or asynchronously prerenders // Here, you could put any logic that synchronously or asynchronously prerenders
// your SPA components. For example, see the boot-server.ts files in the Angular2Spa // your SPA components. For example, see the boot-server.ts files in the AngularSpa
// and ReactReduxSpa templates for ways to prerender Angular 2 and React components. // and ReactReduxSpa templates for ways to prerender Angular and React components.
// //
// If you wanted, you could use a property on the 'params.data' object to specify // If you wanted, you could use a property on the 'params.data' object to specify
// which SPA component or template to render. // which SPA component or template to render.

View File

@@ -1,11 +0,0 @@
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"]

View File

@@ -0,0 +1,26 @@
<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>

View File

@@ -1,20 +0,0 @@
<?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>

View File

@@ -11,9 +11,10 @@
"webpack-hot-middleware": "^2.7.1" "webpack-hot-middleware": "^2.7.1"
}, },
"dependencies": { "dependencies": {
"aspnet-webpack": "^1.0.3",
"aspnet-prerendering": "^1.0.4", "aspnet-prerendering": "^1.0.4",
"aspnet-webpack": "^1.0.3",
"ts-loader": "^0.8.1", "ts-loader": "^0.8.1",
"typescript": "^1.7.5" "typescript": "^2.0.0",
"webpack": "^1.13.3"
} }
} }

View File

@@ -1,52 +0,0 @@
{
"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%" ]
}
}

View File

@@ -2,9 +2,10 @@
"compilerOptions": { "compilerOptions": {
"moduleResolution": "node", "moduleResolution": "node",
"module": "commonjs", "module": "commonjs",
"target": "es6", "target": "es5",
"jsx": "preserve", "jsx": "preserve",
"sourceMap": true "sourceMap": true,
"lib": ["es6", "dom"]
}, },
"exclude": [ "exclude": [
"node_modules" "node_modules"

View File

@@ -10,6 +10,6 @@ module.exports = {
}, },
plugins: [ plugins: [
extractLESS, extractLESS,
new webpack.optimize.UglifyJsPlugin({ minimize: true }) new webpack.optimize.UglifyJsPlugin({ minimize: true, compressor: { warnings: false } })
] ]
}; };

View File

@@ -0,0 +1,39 @@
<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>

View File

@@ -1,20 +0,0 @@
<?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>

View File

@@ -1,4 +1,4 @@
import { createStore, applyMiddleware, compose, combineReducers, GenericStoreEnhancer } from 'redux'; import { createStore, applyMiddleware, compose, combineReducers, GenericStoreEnhancer, Store as ReduxStore } from 'redux';
import thunk from 'redux-thunk'; import thunk from 'redux-thunk';
import { routerReducer } from 'react-router-redux'; import { routerReducer } from 'react-router-redux';
import * as Store from './store'; import * as Store from './store';
@@ -16,7 +16,7 @@ export default function configureStore(initialState?: Store.ApplicationState) {
// Combine all reducers and instantiate the app-wide store instance // Combine all reducers and instantiate the app-wide store instance
const allReducers = buildRootReducer(Store.reducers); const allReducers = buildRootReducer(Store.reducers);
const store = createStoreWithMiddleware(allReducers, initialState) as Redux.Store<Store.ApplicationState>; const store = createStoreWithMiddleware(allReducers, initialState) as ReduxStore<Store.ApplicationState>;
// Enable Webpack hot module replacement for reducers // Enable Webpack hot module replacement for reducers
if (module.hot) { if (module.hot) {

View File

@@ -2,6 +2,7 @@
"name": "music-store", "name": "music-store",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@types/history": "^2.0.0",
"@types/react": "^0.14.29", "@types/react": "^0.14.29",
"@types/react-bootstrap": "^0.0.35", "@types/react-bootstrap": "^0.0.35",
"@types/react-dom": "^0.14.14", "@types/react-dom": "^0.14.14",
@@ -9,7 +10,6 @@
"@types/react-router": "^2.0.30", "@types/react-router": "^2.0.30",
"@types/react-router-bootstrap": "^0.0.27", "@types/react-router-bootstrap": "^0.0.27",
"@types/react-router-redux": "^4.0.30", "@types/react-router-redux": "^4.0.30",
"@types/redux": "3.5.27",
"@types/redux-thunk": "^2.1.28", "@types/redux-thunk": "^2.1.28",
"@types/source-map": "^0.1.28", "@types/source-map": "^0.1.28",
"@types/uglify-js": "^2.0.27", "@types/uglify-js": "^2.0.27",
@@ -42,7 +42,7 @@
"redux-typed": "^2.0.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.1",
"typescript": "2.0.3", "typescript": "^2.0.3",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"webpack": "^1.13.2", "webpack": "^1.13.2",
"webpack-hot-middleware": "^2.12.2", "webpack-hot-middleware": "^2.12.2",

View File

@@ -1,83 +0,0 @@
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.ReactServices": "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"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"compile": {
"exclude": ["node_modules"]
}
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"appsettings.json",
"ClientApp/dist",
"node_modules",
"Views",
"web.config",
"wwwroot"
],
"exclude": [
"wwwroot/dist/*.map"
]
},
"scripts": {
"prepublish": [
"npm install",
"node node_modules/webpack/bin/webpack.js"
],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"tooling": {
"defaultNamespace": "MusicStore"
}
}

View File

@@ -1,11 +1,19 @@
{ {
"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" ] "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"

View File

@@ -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' }, { test: /\.ts(x?)$/, include: /ReactApp/, exclude: /node_modules/, loader: 'ts-loader?silent' },
{ 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' }
] ]

View File

@@ -1,4 +1,3 @@
/node_modules/ /node_modules/
project.lock.json
/wwwroot/dist/ /wwwroot/dist/
/Properties/launchSettings.json /Properties/launchSettings.json

View File

@@ -0,0 +1,25 @@
<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>

View File

@@ -1,20 +0,0 @@
<?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>

View File

@@ -1,49 +0,0 @@
{
"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%" ]
}
}

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>Helpers for building Angular applications on ASP.NET Core.</Description>
<TargetFrameworks>net451;netstandard1.6</TargetFrameworks>
<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>

View File

@@ -1,18 +0,0 @@
<?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>

View File

@@ -10,7 +10,7 @@ using Newtonsoft.Json;
namespace Microsoft.AspNetCore.AngularServices namespace Microsoft.AspNetCore.AngularServices
{ {
/// <summary> /// <summary>
/// Helpers for prepopulating Angular 2's 'http' service with data. /// Helpers for prepopulating Angular's 'http' service with data.
/// </summary> /// </summary>
public static class PrimeCacheHelper public static class PrimeCacheHelper
{ {

View File

@@ -1,12 +0,0 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: NeutralResourcesLanguage("en-us")]
[assembly: AssemblyCompany("Microsoft Corporation.")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyProduct("Microsoft ASP.NET Core")]

View File

@@ -1,3 +0,0 @@
/node_modules/
/dist/
/bundles/

View File

@@ -1,4 +0,0 @@
/src/
/tsconfig.json
/build.js
/typings/

View File

@@ -1,33 +0,0 @@
// -------------
// 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);
});

View File

@@ -1,32 +0,0 @@
{
"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",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2"
},
"devDependencies": {
"es6-shim": "^0.35.0",
"rimraf": "^2.5.4",
"systemjs-builder": "^0.14.11",
"typescript": "^2.0.0",
"zone.js": "^0.6.10"
}
}

View File

@@ -1,59 +0,0 @@
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.

View File

@@ -1,59 +0,0 @@
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]
}),
];

View File

@@ -1,2 +0,0 @@
export * from './CachePrimedHttp';
export * from './Validation';

View File

@@ -1,34 +0,0 @@
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[];
}

View File

@@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": false,
"declaration": true,
"experimentalDecorators": true,
"noLib": false,
"outDir": "./dist",
"lib": ["es2015", "dom"]
},
"exclude": [
"node_modules"
]
}

View File

@@ -1,28 +0,0 @@
{
"description": "Helpers for building Angular 2 applications on ASP.NET Core.",
"version": "1.0.0-*",
"packOptions": {
"repository": {
"type": "git",
"url": "git://github.com/aspnet/javascriptservices"
},
"tags": [
"aspnetcore",
"aspnetcoremvc",
"nodeservices"
]
},
"buildOptions": {
"warningsAsErrors": true,
"keyFile": "../../tools/Key.snk",
"xmlDoc": true
},
"dependencies": {
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.1",
"Microsoft.AspNetCore.SpaServices": "1.0.0-*"
},
"frameworks": {
"net451": {},
"netstandard1.6": {}
}
}

View File

@@ -0,0 +1,3 @@
/bin/
/node_modules/
yarn.lock

View File

@@ -44,11 +44,81 @@
/* 0 */ /* 0 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(7); module.exports = __webpack_require__(1);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
// Limit dependencies to core Node modules. This means the code in this file has to be very low-level and unattractive,
// but simplifies things for the consumer of this module.
__webpack_require__(2);
var net = __webpack_require__(3);
var path = __webpack_require__(4);
var readline = __webpack_require__(5);
var ArgsUtil_1 = __webpack_require__(6);
var ExitWhenParentExits_1 = __webpack_require__(7);
var virtualConnectionServer = __webpack_require__(8);
// Webpack doesn't support dynamic requires for files not present at compile time, so grab a direct
// reference to Node's runtime 'require' function.
var dynamicRequire = eval('require');
// Signal to the .NET side when we're ready to accept invocations
var server = net.createServer().on('listening', function () {
console.log('[Microsoft.AspNetCore.NodeServices:Listening]');
});
// Each virtual connection represents a separate invocation
virtualConnectionServer.createInterface(server).on('connection', function (connection) {
readline.createInterface(connection, null).on('line', function (line) {
try {
// Get a reference to the function to invoke
var invocation = JSON.parse(line);
var invokedModule = dynamicRequire(path.resolve(process.cwd(), invocation.moduleName));
var invokedFunction = invocation.exportedFunctionName ? invokedModule[invocation.exportedFunctionName] : invokedModule;
// Prepare a callback for accepting non-streamed JSON responses
var hasInvokedCallback_1 = false;
var invocationCallback = function (errorValue, successValue) {
if (hasInvokedCallback_1) {
throw new Error('Cannot supply more than one result. The callback has already been invoked,'
+ ' or the result stream has already been accessed');
}
hasInvokedCallback_1 = true;
connection.end(JSON.stringify({
result: successValue,
errorMessage: errorValue && (errorValue.message || errorValue),
errorDetails: errorValue && (errorValue.stack || null)
}));
};
// Also support streamed binary responses
Object.defineProperty(invocationCallback, 'stream', {
enumerable: true,
get: function () {
hasInvokedCallback_1 = true;
return connection;
}
});
// Actually invoke it, passing through any supplied args
invokedFunction.apply(null, [invocationCallback].concat(invocation.args));
}
catch (ex) {
connection.end(JSON.stringify({
errorMessage: ex.message,
errorDetails: ex.stack
}));
}
});
});
// Begin listening now. The underlying transport varies according to the runtime platform.
// On Windows it's Named Pipes; on Linux/OSX it's Domain Sockets.
var useWindowsNamedPipes = /^win/.test(process.platform);
var parsedArgs = ArgsUtil_1.parseArgs(process.argv);
var listenAddress = (useWindowsNamedPipes ? '\\\\.\\pipe\\' : '/tmp/') + parsedArgs.listenAddress;
server.listen(listenAddress);
ExitWhenParentExits_1.exitWhenParentExits(parseInt(parsedArgs.parentPid));
/***/ }, /***/ },
/* 1 */,
/* 2 */ /* 2 */
/***/ function(module, exports) { /***/ function(module, exports) {
@@ -90,7 +160,12 @@
/***/ }, /***/ },
/* 3 */, /* 3 */
/***/ function(module, exports) {
module.exports = require("net");
/***/ },
/* 4 */ /* 4 */
/***/ function(module, exports) { /***/ function(module, exports) {
@@ -98,6 +173,12 @@
/***/ }, /***/ },
/* 5 */ /* 5 */
/***/ function(module, exports) {
module.exports = require("readline");
/***/ },
/* 6 */
/***/ function(module, exports) { /***/ function(module, exports) {
"use strict"; "use strict";
@@ -123,7 +204,7 @@
/***/ }, /***/ },
/* 6 */ /* 7 */
/***/ function(module, exports) { /***/ function(module, exports) {
/* /*
@@ -189,96 +270,13 @@
} }
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
// Limit dependencies to core Node modules. This means the code in this file has to be very low-level and unattractive,
// but simplifies things for the consumer of this module.
__webpack_require__(2);
var net = __webpack_require__(8);
var path = __webpack_require__(4);
var readline = __webpack_require__(9);
var ArgsUtil_1 = __webpack_require__(5);
var ExitWhenParentExits_1 = __webpack_require__(6);
var virtualConnectionServer = __webpack_require__(10);
// Webpack doesn't support dynamic requires for files not present at compile time, so grab a direct
// reference to Node's runtime 'require' function.
var dynamicRequire = eval('require');
// Signal to the .NET side when we're ready to accept invocations
var server = net.createServer().on('listening', function () {
console.log('[Microsoft.AspNetCore.NodeServices:Listening]');
});
// Each virtual connection represents a separate invocation
virtualConnectionServer.createInterface(server).on('connection', function (connection) {
readline.createInterface(connection, null).on('line', function (line) {
try {
// Get a reference to the function to invoke
var invocation = JSON.parse(line);
var invokedModule = dynamicRequire(path.resolve(process.cwd(), invocation.moduleName));
var invokedFunction = invocation.exportedFunctionName ? invokedModule[invocation.exportedFunctionName] : invokedModule;
// Prepare a callback for accepting non-streamed JSON responses
var hasInvokedCallback_1 = false;
var invocationCallback = function (errorValue, successValue) {
if (hasInvokedCallback_1) {
throw new Error('Cannot supply more than one result. The callback has already been invoked,'
+ ' or the result stream has already been accessed');
}
hasInvokedCallback_1 = true;
connection.end(JSON.stringify({
result: successValue,
errorMessage: errorValue && (errorValue.message || errorValue),
errorDetails: errorValue && (errorValue.stack || null)
}));
};
// Also support streamed binary responses
Object.defineProperty(invocationCallback, 'stream', {
enumerable: true,
get: function () {
hasInvokedCallback_1 = true;
return connection;
}
});
// Actually invoke it, passing through any supplied args
invokedFunction.apply(null, [invocationCallback].concat(invocation.args));
}
catch (ex) {
connection.end(JSON.stringify({
errorMessage: ex.message,
errorDetails: ex.stack
}));
}
});
});
// Begin listening now. The underlying transport varies according to the runtime platform.
// On Windows it's Named Pipes; on Linux/OSX it's Domain Sockets.
var useWindowsNamedPipes = /^win/.test(process.platform);
var parsedArgs = ArgsUtil_1.parseArgs(process.argv);
var listenAddress = (useWindowsNamedPipes ? '\\\\.\\pipe\\' : '/tmp/') + parsedArgs.listenAddress;
server.listen(listenAddress);
ExitWhenParentExits_1.exitWhenParentExits(parseInt(parsedArgs.parentPid));
/***/ }, /***/ },
/* 8 */ /* 8 */
/***/ function(module, exports) {
module.exports = require("net");
/***/ },
/* 9 */
/***/ function(module, exports) {
module.exports = require("readline");
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
"use strict"; "use strict";
var events_1 = __webpack_require__(11); var events_1 = __webpack_require__(9);
var VirtualConnection_1 = __webpack_require__(12); var VirtualConnection_1 = __webpack_require__(10);
// Keep this in sync with the equivalent constant in the .NET code. Both sides split up their transmissions into frames with this max length, // Keep this in sync with the equivalent constant in the .NET code. Both sides split up their transmissions into frames with this max length,
// and both will reject longer frames. // and both will reject longer frames.
var MaxFrameBodyLength = 16 * 1024; var MaxFrameBodyLength = 16 * 1024;
@@ -460,13 +458,13 @@
/***/ }, /***/ },
/* 11 */ /* 9 */
/***/ function(module, exports) { /***/ function(module, exports) {
module.exports = require("events"); module.exports = require("events");
/***/ }, /***/ },
/* 12 */ /* 10 */
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
"use strict"; "use strict";
@@ -475,17 +473,18 @@
function __() { this.constructor = d; } function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}; };
var stream_1 = __webpack_require__(13); var stream_1 = __webpack_require__(11);
/** /**
* Represents a virtual connection. Multiple virtual connections may be multiplexed over a single physical socket connection. * Represents a virtual connection. Multiple virtual connections may be multiplexed over a single physical socket connection.
*/ */
var VirtualConnection = (function (_super) { var VirtualConnection = (function (_super) {
__extends(VirtualConnection, _super); __extends(VirtualConnection, _super);
function VirtualConnection(_beginWriteCallback) { function VirtualConnection(_beginWriteCallback) {
_super.call(this); var _this = _super.call(this) || this;
this._beginWriteCallback = _beginWriteCallback; _this._beginWriteCallback = _beginWriteCallback;
this._flowing = false; _this._flowing = false;
this._receivedDataQueue = []; _this._receivedDataQueue = [];
return _this;
} }
VirtualConnection.prototype._read = function () { VirtualConnection.prototype._read = function () {
this._flowing = true; this._flowing = true;
@@ -516,7 +515,7 @@
/***/ }, /***/ },
/* 13 */ /* 11 */
/***/ function(module, exports) { /***/ function(module, exports) {
module.exports = require("stream"); module.exports = require("stream");

View File

@@ -0,0 +1,34 @@
<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>
<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>

View File

@@ -2,7 +2,7 @@ using System.IO;
using System.IO.Pipes; using System.IO.Pipes;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections
{ {
internal class NamedPipeConnection : StreamConnection internal class NamedPipeConnection : StreamConnection
{ {

View File

@@ -2,7 +2,7 @@ using System;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections
{ {
internal abstract class StreamConnection : IDisposable internal abstract class StreamConnection : IDisposable
{ {

View File

@@ -2,7 +2,7 @@ using System.IO;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections
{ {
internal class UnixDomainSocketConnection : StreamConnection internal class UnixDomainSocketConnection : StreamConnection
{ {

View File

@@ -3,7 +3,7 @@ using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
namespace Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections namespace Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections
{ {
// From System.IO.Pipes/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs (an internal class in System.IO.Pipes) // From System.IO.Pipes/src/System/Net/Sockets/UnixDomainSocketEndPoint.cs (an internal class in System.IO.Pipes)
internal sealed class UnixDomainSocketEndPoint : EndPoint internal sealed class UnixDomainSocketEndPoint : EndPoint

View File

@@ -1,16 +1,15 @@
using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections; using Microsoft.AspNetCore.NodeServices.HostingModels;
using Microsoft.AspNetCore.NodeServices.HostingModels.VirtualConnections; using Microsoft.AspNetCore.NodeServices.Sockets.PhysicalConnections;
using Microsoft.AspNetCore.NodeServices.Sockets.VirtualConnections;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
namespace Microsoft.AspNetCore.NodeServices.HostingModels namespace Microsoft.AspNetCore.NodeServices.Sockets
{ {
/// <summary> /// <summary>
/// A specialisation of the OutOfProcessNodeInstance base class that uses a lightweight binary streaming protocol /// A specialisation of the OutOfProcessNodeInstance base class that uses a lightweight binary streaming protocol
@@ -42,21 +41,19 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
private string _socketAddress; private string _socketAddress;
private VirtualConnectionClient _virtualConnectionClient; private VirtualConnectionClient _virtualConnectionClient;
public SocketNodeInstance(string projectPath, string[] watchFileExtensions, string socketAddress, public SocketNodeInstance(NodeServicesOptions options, string socketAddress)
ILogger nodeInstanceOutputLogger, IDictionary<string, string> environmentVars,
int invocationTimeoutMilliseconds, bool launchWithDebugging, int debuggingPort)
: base( : base(
EmbeddedResourceReader.Read( EmbeddedResourceReader.Read(
typeof(SocketNodeInstance), typeof(SocketNodeInstance),
"/Content/Node/entrypoint-socket.js"), "/Content/Node/entrypoint-socket.js"),
projectPath, options.ProjectPath,
watchFileExtensions, options.WatchFileExtensions,
MakeNewCommandLineOptions(socketAddress), MakeNewCommandLineOptions(socketAddress),
nodeInstanceOutputLogger, options.NodeInstanceOutputLogger,
environmentVars, options.EnvironmentVariables,
invocationTimeoutMilliseconds, options.InvocationTimeoutMilliseconds,
launchWithDebugging, options.LaunchWithDebugging,
debuggingPort) options.DebuggingPort)
{ {
_socketAddress = socketAddress; _socketAddress = socketAddress;
} }
@@ -65,11 +62,15 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
{ {
if (_connectionHasFailed) if (_connectionHasFailed)
{ {
// _connectionHasFailed implies a protocol-level error. The old instance is no longer of any use.
var allowConnectionDraining = false;
// This special exception type forces NodeServicesImpl to restart the Node instance // This special exception type forces NodeServicesImpl to restart the Node instance
throw new NodeInvocationException( throw new NodeInvocationException(
"The SocketNodeInstance socket connection failed. See logs to identify the reason.", "The SocketNodeInstance socket connection failed. See logs to identify the reason.",
null, details: null,
nodeInstanceUnavailable: true); nodeInstanceUnavailable: true,
allowConnectionDraining: allowConnectionDraining);
} }
if (_virtualConnectionClient == null) if (_virtualConnectionClient == null)
@@ -79,7 +80,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
// wait for the same connection task. There's no reason why the first caller should have the // wait for the same connection task. There's no reason why the first caller should have the
// special ability to cancel the connection process in a way that would affect subsequent // special ability to cancel the connection process in a way that would affect subsequent
// callers. So, each caller just independently stops awaiting connection if that call is cancelled. // callers. So, each caller just independently stops awaiting connection if that call is cancelled.
await EnsureVirtualConnectionClientCreated().OrThrowOnCancellation(cancellationToken); await ThrowOnCancellation(EnsureVirtualConnectionClientCreated(), cancellationToken);
} }
// For each invocation, we open a new virtual connection. This gives an API equivalent to opening a new // For each invocation, we open a new virtual connection. This gives an API equivalent to opening a new
@@ -178,6 +179,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
using (var jsonWriter = new JsonTextWriter(streamWriter)) using (var jsonWriter = new JsonTextWriter(streamWriter))
{ {
jsonWriter.CloseOutput = false; jsonWriter.CloseOutput = false;
jsonWriter.AutoCompleteOnClose = false;
var serializer = JsonSerializer.Create(jsonSerializerSettings); var serializer = JsonSerializer.Create(jsonSerializerSettings);
serializer.Serialize(jsonWriter, serializableObject); serializer.Serialize(jsonWriter, serializableObject);
@@ -215,6 +217,17 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
return $"--listenAddress {listenAddress}"; return $"--listenAddress {listenAddress}";
} }
private static Task ThrowOnCancellation(Task task, CancellationToken cancellationToken)
{
return task.IsCompleted
? task // If the task is already completed, no need to wrap it in a further layer of task
: task.ContinueWith(
_ => {}, // If the task completes, allow execution to continue
cancellationToken,
TaskContinuationOptions.ExecuteSynchronously,
TaskScheduler.Default);
}
#pragma warning disable 649 // These properties are populated via JSON deserialization #pragma warning disable 649 // These properties are populated via JSON deserialization
private class RpcJsonResponse<TResult> private class RpcJsonResponse<TResult>
{ {

View File

@@ -0,0 +1,21 @@
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);
}
}
}

View File

@@ -1,12 +1,12 @@
// Limit dependencies to core Node modules. This means the code in this file has to be very low-level and unattractive, // Limit dependencies to core Node modules. This means the code in this file has to be very low-level and unattractive,
// but simplifies things for the consumer of this module. // but simplifies things for the consumer of this module.
import './Util/OverrideStdOutputs'; import '../../Microsoft.AspNetCore.NodeServices/TypeScript/Util/OverrideStdOutputs';
import * as net from 'net'; import * as net from 'net';
import * as path from 'path'; import * as path from 'path';
import * as readline from 'readline'; import * as readline from 'readline';
import { Duplex } from 'stream'; import { Duplex } from 'stream';
import { parseArgs } from './Util/ArgsUtil'; import { parseArgs } from '../../Microsoft.AspNetCore.NodeServices/TypeScript/Util/ArgsUtil';
import { exitWhenParentExits } from './Util/ExitWhenParentExits'; import { exitWhenParentExits } from '../../Microsoft.AspNetCore.NodeServices/TypeScript/Util/ExitWhenParentExits';
import * as virtualConnectionServer from './VirtualConnections/VirtualConnectionServer'; import * as virtualConnectionServer from './VirtualConnections/VirtualConnectionServer';
// Webpack doesn't support dynamic requires for files not present at compile time, so grab a direct // Webpack doesn't support dynamic requires for files not present at compile time, so grab a direct
@@ -70,7 +70,7 @@ const parsedArgs = parseArgs(process.argv);
const listenAddress = (useWindowsNamedPipes ? '\\\\.\\pipe\\' : '/tmp/') + parsedArgs.listenAddress; const listenAddress = (useWindowsNamedPipes ? '\\\\.\\pipe\\' : '/tmp/') + parsedArgs.listenAddress;
server.listen(listenAddress); server.listen(listenAddress);
exitWhenParentExits(parseInt(parsedArgs.parentPid)); exitWhenParentExits(parseInt(parsedArgs.parentPid), /* ignoreSigint */ true);
interface RpcInvocation { interface RpcInvocation {
moduleName: string; moduleName: string;

View File

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es3",
"module": "commonjs",
"moduleResolution": "node",
"types": ["node"]
},
"exclude": [
"node_modules"
]
}

View File

@@ -4,7 +4,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow; using System.Threading.Tasks.Dataflow;
namespace Microsoft.AspNetCore.NodeServices.HostingModels.VirtualConnections namespace Microsoft.AspNetCore.NodeServices.Sockets.VirtualConnections
{ {
/// <summary> /// <summary>
/// A virtual read/write connection, typically to a remote process. Multiple virtual connections can be /// A virtual read/write connection, typically to a remote process. Multiple virtual connections can be

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.NodeServices.HostingModels.VirtualConnections namespace Microsoft.AspNetCore.NodeServices.Sockets.VirtualConnections
{ {
/// <summary> /// <summary>
/// A callback that will be invoked if the <see cref="VirtualConnectionClient"/> encounters a read error. /// A callback that will be invoked if the <see cref="VirtualConnectionClient"/> encounters a read error.

View File

@@ -0,0 +1,18 @@
{
"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"
}
}

View File

@@ -0,0 +1,20 @@
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'
}
};

View File

@@ -1,2 +1,3 @@
/bin/ /bin/
/node_modules/ /node_modules/
yarn.lock

View File

@@ -1,18 +0,0 @@
namespace Microsoft.AspNetCore.NodeServices
{
/// <summary>
/// Represents a way of creating and invoking code in a Node.js environment.
/// </summary>
public enum NodeHostingModel
{
/// <summary>
/// An out-of-process Node.js instance where RPC calls are made via HTTP.
/// </summary>
Http,
/// <summary>
/// An out-of-process Node.js instance where RPC calls are made over binary sockets.
/// </summary>
Socket,
}
}

View File

@@ -1,5 +1,4 @@
using System; using System;
using Microsoft.AspNetCore.NodeServices.HostingModels;
namespace Microsoft.AspNetCore.NodeServices namespace Microsoft.AspNetCore.NodeServices
{ {
@@ -19,33 +18,8 @@ namespace Microsoft.AspNetCore.NodeServices
{ {
throw new ArgumentNullException(nameof (options)); throw new ArgumentNullException(nameof (options));
} }
return new NodeServicesImpl(() => CreateNodeInstance(options));
}
private static INodeInstance CreateNodeInstance(NodeServicesOptions options) return new NodeServicesImpl(options.NodeInstanceFactory);
{
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);
}
}
} }
} }
} }

View File

@@ -13,11 +13,6 @@ namespace Microsoft.AspNetCore.NodeServices
/// </summary> /// </summary>
public class NodeServicesOptions public class NodeServicesOptions
{ {
/// <summary>
/// Defines the default <see cref="NodeHostingModel"/>.
/// </summary>
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";
@@ -36,7 +31,6 @@ 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
@@ -53,15 +47,15 @@ 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> /// <summary>
/// Specifies which <see cref="NodeHostingModel"/> should be used. /// Specifies how to construct Node.js instances. An <see cref="INodeInstance"/> encapsulates all details about
/// </summary> /// how Node.js instances are launched and communicated with. A new <see cref="INodeInstance"/> will be created
public NodeHostingModel HostingModel { get; set; } /// automatically if the previous instance has terminated (e.g., because a source file changed).
/// <summary>
/// If set, this callback function will be invoked to supply the <see cref="INodeServices"/> instance.
/// </summary> /// </summary>
public Func<INodeInstance> NodeInstanceFactory { get; set; } public Func<INodeInstance> NodeInstanceFactory { get; set; }

View File

@@ -125,7 +125,7 @@
// Signal to the NodeServices base class that we're ready to accept invocations // Signal to the NodeServices base class that we're ready to accept invocations
console.log('[Microsoft.AspNetCore.NodeServices:Listening]'); console.log('[Microsoft.AspNetCore.NodeServices:Listening]');
}); });
ExitWhenParentExits_1.exitWhenParentExits(parseInt(parsedArgs.parentPid)); ExitWhenParentExits_1.exitWhenParentExits(parseInt(parsedArgs.parentPid), /* ignoreSigint */ true);
function readRequestBodyAsJson(request, callback) { function readRequestBodyAsJson(request, callback) {
var requestBodyAsString = ''; var requestBodyAsString = '';
request.on('data', function (chunk) { requestBodyAsString += chunk; }); request.on('data', function (chunk) { requestBodyAsString += chunk; });
@@ -255,7 +255,7 @@
*/ */
"use strict"; "use strict";
var pollIntervalMs = 1000; var pollIntervalMs = 1000;
function exitWhenParentExits(parentPid) { function exitWhenParentExits(parentPid, ignoreSigint) {
setInterval(function () { setInterval(function () {
if (!processExists(parentPid)) { if (!processExists(parentPid)) {
// Can't log anything at this point, because out stdout was connected to the parent, // Can't log anything at this point, because out stdout was connected to the parent,
@@ -263,6 +263,24 @@
process.exit(); process.exit();
} }
}, pollIntervalMs); }, pollIntervalMs);
if (ignoreSigint) {
// Pressing ctrl+c in the terminal sends a SIGINT to all processes in the foreground process tree.
// By default, the Node process would then exit before the .NET process, because ASP.NET implements
// a delayed shutdown to allow ongoing requests to complete.
//
// This is problematic, because if Node exits first, the CopyToAsync code in ConditionalProxyMiddleware
// will experience a read fault, and logs a huge load of errors. Fortunately, since the Node process is
// already set up to shut itself down if it detects the .NET process is terminated, all we have to do is
// ignore the SIGINT. The Node process will then terminate automatically after the .NET process does.
//
// A better solution would be to have WebpackDevMiddleware listen for SIGINT and gracefully close any
// ongoing EventSource connections before letting the Node process exit, independently of the .NET
// process exiting. However, doing this well in general is very nontrivial (see all the discussion at
// https://github.com/nodejs/node/issues/2642).
process.on('SIGINT', function () {
console.log('Received SIGINT. Waiting for .NET process to exit...');
});
}
} }
exports.exitWhenParentExits = exitWhenParentExits; exports.exitWhenParentExits = exitWhenParentExits;
function processExists(pid) { function processExists(pid) {

View File

@@ -1,12 +1,10 @@
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
@@ -36,21 +34,19 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
private bool _disposed; private bool _disposed;
private int _portNumber; private int _portNumber;
public HttpNodeInstance(string projectPath, string[] watchFileExtensions, ILogger nodeInstanceOutputLogger, public HttpNodeInstance(NodeServicesOptions options, int port = 0)
IDictionary<string, string> environmentVars, int invocationTimeoutMilliseconds, bool launchWithDebugging,
int debuggingPort, int port = 0)
: base( : base(
EmbeddedResourceReader.Read( EmbeddedResourceReader.Read(
typeof(HttpNodeInstance), typeof(HttpNodeInstance),
"/Content/Node/entrypoint-http.js"), "/Content/Node/entrypoint-http.js"),
projectPath, options.ProjectPath,
watchFileExtensions, options.WatchFileExtensions,
MakeCommandLineOptions(port), MakeCommandLineOptions(port),
nodeInstanceOutputLogger, options.NodeInstanceOutputLogger,
environmentVars, options.EnvironmentVariables,
invocationTimeoutMilliseconds, options.InvocationTimeoutMilliseconds,
launchWithDebugging, options.LaunchWithDebugging,
debuggingPort) options.DebuggingPort)
{ {
_client = new HttpClient(); _client = new HttpClient();
} }
@@ -95,7 +91,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
case "application/octet-stream": case "application/octet-stream":
// Streamed responses have to be received as System.IO.Stream instances // Streamed responses have to be received as System.IO.Stream instances
if (typeof(T) != typeof(Stream)) if (typeof(T) != typeof(Stream) && typeof(T) != typeof(object))
{ {
throw new ArgumentException( throw new ArgumentException(
"Node module responded with binary stream. This cannot be converted to the requested generic type: " + "Node module responded with binary stream. This cannot be converted to the requested generic type: " +
@@ -140,4 +136,4 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
} }
} }
} }
} }

View File

@@ -13,6 +13,13 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
/// </summary> /// </summary>
public bool NodeInstanceUnavailable { get; private set; } public bool NodeInstanceUnavailable { get; private set; }
/// <summary>
/// If true, indicates that even though the invocation failed because the Node.js instance could not be reached
/// or needs to be restarted, that Node.js instance may remain alive for a period in order to complete any
/// outstanding requests.
/// </summary>
public bool AllowConnectionDraining { get; private set;}
/// <summary> /// <summary>
/// Creates a new instance of <see cref="NodeInvocationException"/>. /// Creates a new instance of <see cref="NodeInvocationException"/>.
/// </summary> /// </summary>
@@ -29,10 +36,20 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
/// <param name="message">A description of the exception.</param> /// <param name="message">A description of the exception.</param>
/// <param name="details">Additional information, such as a Node.js stack trace, representing the exception.</param> /// <param name="details">Additional information, such as a Node.js stack trace, representing the exception.</param>
/// <param name="nodeInstanceUnavailable">Specifies a value for the <see cref="NodeInstanceUnavailable"/> flag.</param> /// <param name="nodeInstanceUnavailable">Specifies a value for the <see cref="NodeInstanceUnavailable"/> flag.</param>
public NodeInvocationException(string message, string details, bool nodeInstanceUnavailable) /// <param name="allowConnectionDraining">Specifies a value for the <see cref="AllowConnectionDraining"/> flag.</param>
public NodeInvocationException(string message, string details, bool nodeInstanceUnavailable, bool allowConnectionDraining)
: this(message, details) : this(message, details)
{ {
// Reject a meaningless combination of flags
if (allowConnectionDraining && !nodeInstanceUnavailable)
{
throw new ArgumentException(
$"The '${ nameof(allowConnectionDraining) }' parameter cannot be true " +
$"unless the '${ nameof(nodeInstanceUnavailable) }' parameter is also true.");
}
NodeInstanceUnavailable = nodeInstanceUnavailable; NodeInstanceUnavailable = nodeInstanceUnavailable;
AllowConnectionDraining = allowConnectionDraining;
} }
} }
} }

View File

@@ -0,0 +1,17 @@
namespace Microsoft.AspNetCore.NodeServices.HostingModels
{
/// <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 HTTP.
/// </summary>
public static void UseHttpHosting(this NodeServicesOptions options)
{
options.NodeInstanceFactory = () => new HttpNodeInstance(options);
}
}
}

Some files were not shown because too many files have changed in this diff Show More