From 863fa3f082dfcd553247c13ea0990fdb4dcfc8ef Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 19 Jun 2015 00:04:44 +0200 Subject: [PATCH] Update Empty web application template for beta5. Closes #186 This commit update template files for Empty web application: - new hosting.ini file added to project - the test for Empty web application is updated to check for hosting.ini - project file updated to beta5 structure - the readme.md is fully updated and based on VS generated readme html --- app/index.js | 2 + .../projects/empty/{startup.cs => Startup.cs} | 0 templates/projects/empty/hosting.ini | 1 + templates/projects/empty/project.json | 34 +++++++-------- templates/projects/empty/wwwroot/README.md | 42 +++++++++++++++++++ templates/projects/empty/wwwroot/readme.md | 1 - test/test-core.js | 13 +++++- 7 files changed, 74 insertions(+), 19 deletions(-) rename templates/projects/empty/{startup.cs => Startup.cs} (100%) create mode 100644 templates/projects/empty/hosting.ini create mode 100644 templates/projects/empty/wwwroot/README.md delete mode 100644 templates/projects/empty/wwwroot/readme.md diff --git a/app/index.js b/app/index.js index 8a52ba3c..1b41e9f0 100644 --- a/app/index.js +++ b/app/index.js @@ -109,6 +109,8 @@ var AspnetGenerator = yeoman.generators.Base.extend({ this.copy(this.sourceRoot() + '/../../gitignore.txt', this.applicationName + '/.gitignore'); + this.copy(this.sourceRoot() + '/hosting.ini', this.applicationName + '/hosting.ini'); + this.template(this.sourceRoot() + '/startup.cs', this.applicationName + '/Startup.cs', this.templatedata); this.copy(this.sourceRoot() + '/project.json', this.applicationName + '/project.json'); diff --git a/templates/projects/empty/startup.cs b/templates/projects/empty/Startup.cs similarity index 100% rename from templates/projects/empty/startup.cs rename to templates/projects/empty/Startup.cs diff --git a/templates/projects/empty/hosting.ini b/templates/projects/empty/hosting.ini new file mode 100644 index 00000000..3899bfdd --- /dev/null +++ b/templates/projects/empty/hosting.ini @@ -0,0 +1 @@ +server.urls=http://localhost:5000 diff --git a/templates/projects/empty/project.json b/templates/projects/empty/project.json index 2ce9e89b..47ee50e7 100644 --- a/templates/projects/empty/project.json +++ b/templates/projects/empty/project.json @@ -1,31 +1,31 @@ { - "webroot": "wwwroot", - "version": "1.0.0-*", + "webroot": "wwwroot", + "version": "1.0.0-*", - "dependencies": { - "Microsoft.AspNet.Server.IIS": "1.0.0-beta4", - "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4", - "Kestrel": "1.0.0-beta4" - }, + "dependencies": { + "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", + "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", + "Kestrel": "1.0.0-beta5" + }, - "commands": { - "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000", - "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5001" - }, + "commands": { + "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --config hosting.ini", + "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --config hosting.ini" + }, - "frameworks": { - "dnx451": {}, - "dnxcore50": {} - }, + "frameworks": { + "dnx451": {}, + "dnxcore50": {} + }, - "publishExclude": [ + "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ], - "exclude": [ + "exclude": [ "wwwroot", "node_modules", "bower_components" diff --git a/templates/projects/empty/wwwroot/README.md b/templates/projects/empty/wwwroot/README.md new file mode 100644 index 00000000..6a0b7847 --- /dev/null +++ b/templates/projects/empty/wwwroot/README.md @@ -0,0 +1,42 @@ +# Welcome to ASP.NET 5 Preview + +We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. + +ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). +Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). + +We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. +The ASP.NET Team + +### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) + +### This application consists of: +* Sample pages using ASP.NET MVC 6 +* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources +* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) + +#### NEW CONCEPTS +* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) +* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) +* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) +* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) +* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) +* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) + +#### CUSTOMIZE APP +* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) +* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) +* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) +* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) +* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) +* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) +* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) + +#### DEPLOY +* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) +* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) +* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) +* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) +* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) + +We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/projects/empty/wwwroot/readme.md b/templates/projects/empty/wwwroot/readme.md deleted file mode 100644 index 2bffa7b8..00000000 --- a/templates/projects/empty/wwwroot/readme.md +++ /dev/null @@ -1 +0,0 @@ -## webroot folder \ No newline at end of file diff --git a/test/test-core.js b/test/test-core.js index e9bd9741..2ad04c30 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -22,12 +22,23 @@ describe('aspnet - Empty Application', function() { util.goCreateApplication('empty', 'emptyTest'); describe('Checking directories', function() { + it('Application directory created', function() { assert.file('emptyTest/'); }); + + it('wwwroot directory created', function() { + assert.file('emptyTest/wwwroot'); + }); + }); - var files = ['emptyTest/project.json', 'emptyTest/Startup.cs']; + var files = [ + 'emptyTest/hosting.ini', + 'emptyTest/project.json', + 'emptyTest/Startup.cs', + 'emptyTest/wwwroot/README.md' + ]; describe('Checking files', function() { for (var i = 0; i < files.length; i++) { util.filesCheck(files[i]);