From 13cd111237e305371ce26027d76e12a48710c612 Mon Sep 17 00:00:00 2001 From: Sayed Ibrahim Hashimi Date: Mon, 16 May 2016 14:19:56 -0700 Subject: [PATCH 01/14] 0.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1345bd68..85a4e8c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-aspnet", - "version": "0.0.93", + "version": "0.1.0", "description": "Yeoman generator for ASP.NET Core 1.0 apps", "license": "Apache-2.0", "main": "app/index.js", From 50c619aee1c56224f6b49d52dd2b3c9547ad2b00 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Wed, 25 May 2016 21:13:31 +0200 Subject: [PATCH 02/14] :bug: Correct GC Server configuration. Fixes #727 (#728) See aspnet/Templates#575 for details. This commit introduces fix from aspnet/Templates to generator content Thanks! --- templates/projects/emptyweb/project.json | 4 +++- templates/projects/web/project.json | 4 +++- templates/projects/webapi/project.json | 4 +++- templates/projects/webbasic/project.json | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/templates/projects/emptyweb/project.json b/templates/projects/emptyweb/project.json index c95809f5..6940a2c6 100644 --- a/templates/projects/emptyweb/project.json +++ b/templates/projects/emptyweb/project.json @@ -31,7 +31,9 @@ }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/projects/web/project.json b/templates/projects/web/project.json index 26cd32a0..6cf408c6 100755 --- a/templates/projects/web/project.json +++ b/templates/projects/web/project.json @@ -85,7 +85,9 @@ }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/projects/webapi/project.json b/templates/projects/webapi/project.json index 4d2b9b4a..5f8dc9af 100644 --- a/templates/projects/webapi/project.json +++ b/templates/projects/webapi/project.json @@ -38,7 +38,9 @@ }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { diff --git a/templates/projects/webbasic/project.json b/templates/projects/webbasic/project.json index 28abc84f..78d9e089 100755 --- a/templates/projects/webbasic/project.json +++ b/templates/projects/webbasic/project.json @@ -48,7 +48,9 @@ }, "runtimeOptions": { - "gcServer": true + "configProperties": { + "System.GC.Server": true + } }, "publishOptions": { From 15da6ee63fa0cd64c35e7d50fd46ad657be2ace0 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Thu, 26 May 2016 22:38:08 +0200 Subject: [PATCH 03/14] Fix display of carousel images on older browsers (#729) See: aspnet/Templates#582 Thanks! --- templates/projects/webbasic/wwwroot/css/site.css | 7 +++++++ templates/projects/webbasic/wwwroot/css/site.min.css | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/projects/webbasic/wwwroot/css/site.css b/templates/projects/webbasic/wwwroot/css/site.css index 4c983f70..7a68c46e 100755 --- a/templates/projects/webbasic/wwwroot/css/site.css +++ b/templates/projects/webbasic/wwwroot/css/site.css @@ -22,6 +22,13 @@ textarea { font-size: 20px; line-height: 1.4; } + +/* Make .svg files in the carousel display properly in older browsers */ +.carousel-inner .item img[src$=".svg"] +{ + width: 100%; +} + /* Hide/rearrange for smaller screens */ @media screen and (max-width: 767px) { /* Hide captions */ diff --git a/templates/projects/webbasic/wwwroot/css/site.min.css b/templates/projects/webbasic/wwwroot/css/site.min.css index af119157..8c1ea957 100644 --- a/templates/projects/webbasic/wwwroot/css/site.min.css +++ b/templates/projects/webbasic/wwwroot/css/site.min.css @@ -1 +1 @@ -body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}@media screen and (max-width:767px){.carousel-caption{display:none}} +body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} From 4e86d5067e7ab9bc2603e4c1c976d6afb7445f7d Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Thu, 26 May 2016 22:38:22 +0200 Subject: [PATCH 04/14] Exclude node_modules from compilation (#730) See aspnet/Templates#583 Thanks! --- templates/projects/emptyweb/project.json | 7 ++++++- templates/projects/unittest/project.json | 7 ++++++- templates/projects/web/project.json | 7 ++++++- templates/projects/webapi/project.json | 7 ++++++- templates/projects/webbasic/project.json | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/templates/projects/emptyweb/project.json b/templates/projects/emptyweb/project.json index 6940a2c6..6abaf2ce 100644 --- a/templates/projects/emptyweb/project.json +++ b/templates/projects/emptyweb/project.json @@ -27,7 +27,12 @@ "buildOptions": { "emitEntryPoint": true, - "preserveCompilationContext": true + "preserveCompilationContext": true, + "compile": { + "exclude": [ + "node_modules" + ] + } }, "runtimeOptions": { diff --git a/templates/projects/unittest/project.json b/templates/projects/unittest/project.json index 970aa963..3beba008 100644 --- a/templates/projects/unittest/project.json +++ b/templates/projects/unittest/project.json @@ -2,7 +2,12 @@ "version": "1.0.0-*", "buildOptions": { - "preserveCompilationContext": true + "preserveCompilationContext": true, + "compile": { + "exclude": [ + "node_modules" + ] + } }, "dependencies": { diff --git a/templates/projects/web/project.json b/templates/projects/web/project.json index 6cf408c6..2e8d01b4 100755 --- a/templates/projects/web/project.json +++ b/templates/projects/web/project.json @@ -81,7 +81,12 @@ "buildOptions": { "emitEntryPoint": true, - "preserveCompilationContext": true + "preserveCompilationContext": true, + "compile": { + "exclude": [ + "node_modules" + ] + } }, "runtimeOptions": { diff --git a/templates/projects/webapi/project.json b/templates/projects/webapi/project.json index 5f8dc9af..60bae1e7 100644 --- a/templates/projects/webapi/project.json +++ b/templates/projects/webapi/project.json @@ -34,7 +34,12 @@ "buildOptions": { "emitEntryPoint": true, - "preserveCompilationContext": true + "preserveCompilationContext": true, + "compile": { + "exclude": [ + "node_modules" + ] + } }, "runtimeOptions": { diff --git a/templates/projects/webbasic/project.json b/templates/projects/webbasic/project.json index 78d9e089..0ab37150 100755 --- a/templates/projects/webbasic/project.json +++ b/templates/projects/webbasic/project.json @@ -44,7 +44,12 @@ "buildOptions": { "emitEntryPoint": true, - "preserveCompilationContext": true + "preserveCompilationContext": true, + "compile": { + "exclude": [ + "node_modules" + ] + } }, "runtimeOptions": { From f05d8072e655f930643271c5f963fdd6859bd134 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Thu, 26 May 2016 22:38:34 +0200 Subject: [PATCH 05/14] Indent parameters in constructor declaration (#731) See aspnet/Templates#579 Thanks! --- templates/projects/web/Controllers/ManageController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/projects/web/Controllers/ManageController.cs b/templates/projects/web/Controllers/ManageController.cs index c1bd3138..546928f8 100755 --- a/templates/projects/web/Controllers/ManageController.cs +++ b/templates/projects/web/Controllers/ManageController.cs @@ -22,11 +22,11 @@ public class ManageController : Controller private readonly ILogger _logger; public ManageController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) + UserManager userManager, + SignInManager signInManager, + IEmailSender emailSender, + ISmsSender smsSender, + ILoggerFactory loggerFactory) { _userManager = userManager; _signInManager = signInManager; From 67df2b8517494a7f3ef2ab555a9c832d6a48d0eb Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 10 Jun 2016 22:08:57 +0200 Subject: [PATCH 06/14] Add Microsoft.Extensions.Options.ConfigurationExtensions (#732) This commit adds Add Microsoft.Extensions.Options.ConfigurationExtensions to default projects packages as in: aspnet/Templates#471 Thanks! --- templates/projects/web/project.json | 1 + templates/projects/webapi/project.json | 3 ++- templates/projects/webbasic/project.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/projects/web/project.json b/templates/projects/web/project.json index 2e8d01b4..a278a144 100755 --- a/templates/projects/web/project.json +++ b/templates/projects/web/project.json @@ -29,6 +29,7 @@ "Microsoft.Extensions.Logging": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final", "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { "version": "1.0.0-preview1-final", diff --git a/templates/projects/webapi/project.json b/templates/projects/webapi/project.json index 60bae1e7..b93e3460 100644 --- a/templates/projects/webapi/project.json +++ b/templates/projects/webapi/project.json @@ -12,7 +12,8 @@ "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final", "Microsoft.Extensions.Logging": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final" + "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final" }, "tools": { diff --git a/templates/projects/webbasic/project.json b/templates/projects/webbasic/project.json index 0ab37150..f1244864 100755 --- a/templates/projects/webbasic/project.json +++ b/templates/projects/webbasic/project.json @@ -18,6 +18,7 @@ "Microsoft.Extensions.Logging": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final", "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final" }, From 5daea40341ed3e701c74947396a4ef1c09d5bc28 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 10 Jun 2016 22:09:16 +0200 Subject: [PATCH 07/14] Introduce Bundler to web basic (StarterWeb) template (#734) * Introduce Bundler to web basic (StarterWeb) template This commit brings changes from aspnet/Templates#592 to starter web project template. The Gulp, Grunt options are removed with NPM support removal. Thanks! * :arrow_up: Update Bundler version The 2.0.208 fixes *nix paths problem * Add missing Bundle to Semantic UI overrides * Set post-install of NPM to false * Fix output path names --- app/index.js | 10 +--- .../semantic/webbasic/bundleconfig.json | 29 +++++++++++ templates/projects/webbasic/Gruntfile.js | 10 ---- templates/projects/webbasic/bundleconfig.json | 20 +++++++ templates/projects/webbasic/gulpfile.js | 45 ---------------- templates/projects/webbasic/package.json | 13 ----- templates/projects/webbasic/project.json | 9 +++- test/test-core.js | 52 +------------------ 8 files changed, 60 insertions(+), 128 deletions(-) create mode 100644 templates/overrides/semantic/webbasic/bundleconfig.json delete mode 100644 templates/projects/webbasic/Gruntfile.js create mode 100644 templates/projects/webbasic/bundleconfig.json delete mode 100755 templates/projects/webbasic/gulpfile.js delete mode 100755 templates/projects/webbasic/package.json diff --git a/app/index.js b/app/index.js index 141d6e03..2c66ef7f 100644 --- a/app/index.js +++ b/app/index.js @@ -258,19 +258,13 @@ var AspnetGenerator = yeoman.generators.Base.extend({ break; case 'webbasic': this.sourceRoot(path.join(__dirname, '../templates/projects/' + this.type)); - // Grunt or Gulp - if (this.options.grunt) { - this.fs.copyTpl(this.templatePath('Gruntfile.js'), this.applicationName + '/Gruntfile.js', this.templatedata); - } else { - this.fs.copyTpl(this.templatePath('gulpfile.js'), this.applicationName + '/gulpfile.js', this.templatedata); - } // individual files (configs, etc) this.fs.copyTpl(this.sourceRoot() + '/../../Dockerfile.txt', this.applicationName + '/Dockerfile', this.templatedata); this.fs.copy(this.templatePath('.bowerrc'), this.applicationName + '/.bowerrc'); + this.fs.copy(this.templatePath('bundleconfig.json'), this.applicationName + '/bundleconfig.json'); this.fs.copy(this.sourceRoot() + '/../../gitignore.txt', this.applicationName + '/.gitignore'); this.fs.copyTpl(this.templatePath('bower.json'), this.applicationName + '/bower.json', this.templatedata); this.fs.copyTpl(this.templatePath('appsettings.json'), this.applicationName + '/appsettings.json', this.templatedata); - this.fs.copyTpl(this.templatePath('package.json'), this.applicationName + '/package.json', this.templatedata); this.fs.copyTpl(this.templatePath('project.json'), this.applicationName + '/project.json', this.templatedata); this.fs.copyTpl(this.templatePath('Program.cs'), this.applicationName + '/Program.cs', this.templatedata); // Properties @@ -343,7 +337,7 @@ var AspnetGenerator = yeoman.generators.Base.extend({ if(!this.options['skip-install'] && (this.type === 'web' || this.type === 'webbasic')) { process.chdir(this.applicationName); this.installDependencies({ - npm: true, + npm: false, bower: true, callback: this._showUsageHints.bind(this) }); diff --git a/templates/overrides/semantic/webbasic/bundleconfig.json b/templates/overrides/semantic/webbasic/bundleconfig.json new file mode 100644 index 00000000..5ae75176 --- /dev/null +++ b/templates/overrides/semantic/webbasic/bundleconfig.json @@ -0,0 +1,29 @@ +[ + { + "outputFileName": "wwwroot/css/site.min.css", + "inputFiles": [ + "wwwroot/css/site.css" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/semantic.validation.min.js", + "inputFiles": [ + "wwwroot/js/semantic.validation.js" + ], + "minify": { + "enabled": true + } + } +] diff --git a/templates/projects/webbasic/Gruntfile.js b/templates/projects/webbasic/Gruntfile.js deleted file mode 100644 index 27b3117e..00000000 --- a/templates/projects/webbasic/Gruntfile.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - This file is the main entry point for defining grunt tasks and using grunt plugins. - Click here to learn more: https://docs.asp.net/en/latest/client-side/using-grunt.html -*/ -"use strict"; - -module.exports = function(grunt) { - grunt.initConfig({ - }); -}; diff --git a/templates/projects/webbasic/bundleconfig.json b/templates/projects/webbasic/bundleconfig.json new file mode 100644 index 00000000..6eadf24e --- /dev/null +++ b/templates/projects/webbasic/bundleconfig.json @@ -0,0 +1,20 @@ +[ + { + "outputFileName": "wwwroot/css/site.min.css", + "inputFiles": [ + "wwwroot/css/site.css" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + "minify": { + "enabled": true + } + } +] diff --git a/templates/projects/webbasic/gulpfile.js b/templates/projects/webbasic/gulpfile.js deleted file mode 100755 index 55871e61..00000000 --- a/templates/projects/webbasic/gulpfile.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -"use strict"; - -var gulp = require("gulp"), - rimraf = require("rimraf"), - concat = require("gulp-concat"), - cssmin = require("gulp-cssmin"), - uglify = require("gulp-uglify"); - -var webroot = "./wwwroot/"; - -var paths = { - js: webroot + "js/**/*.js", - minJs: webroot + "js/**/*.min.js", - css: webroot + "css/**/*.css", - minCss: webroot + "css/**/*.min.css", - concatJsDest: webroot + "js/site.min.js", - concatCssDest: webroot + "css/site.min.css" -}; - -gulp.task("clean:js", function (cb) { - rimraf(paths.concatJsDest, cb); -}); - -gulp.task("clean:css", function (cb) { - rimraf(paths.concatCssDest, cb); -}); - -gulp.task("clean", ["clean:js", "clean:css"]); - -gulp.task("min:js", function () { - return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) - .pipe(concat(paths.concatJsDest)) - .pipe(uglify()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min:css", function () { - return gulp.src([paths.css, "!" + paths.minCss]) - .pipe(concat(paths.concatCssDest)) - .pipe(cssmin()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min", ["min:js", "min:css"]); diff --git a/templates/projects/webbasic/package.json b/templates/projects/webbasic/package.json deleted file mode 100755 index 16a66434..00000000 --- a/templates/projects/webbasic/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "<%= namespace.toLowerCase() %>", - "version": "0.0.0", - "private": true, - "devDependencies": {<% if(!grunt){ %> - "gulp": "3.9.1", - "gulp-concat": "2.6.0", - "gulp-cssmin": "0.1.7", - "gulp-uglify": "1.5.3", - "rimraf": "2.5.2"<% } %><% if(grunt){ %> - "grunt": "1.0.1"<% } %> - } -} diff --git a/templates/projects/webbasic/project.json b/templates/projects/webbasic/project.json index f1244864..1bfb59f2 100755 --- a/templates/projects/webbasic/project.json +++ b/templates/projects/webbasic/project.json @@ -23,6 +23,13 @@ }, "tools": { + "BundlerMinifier.Core": { + "version": "2.0.208", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net40+sl5+win8+wp8+wpa81" + ] + }, "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview1-final", "imports": "portable-net45+win8+dnxcore50" @@ -69,7 +76,7 @@ }, "scripts": { - "prepublish": [ "npm install", "bower install"<% if(!grunt){ %>, "gulp clean", "gulp min"<% } %> ], + "prepublish": [ "bower install" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }, diff --git a/test/test-core.js b/test/test-core.js index b945541a..f1c305cb 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -555,53 +555,6 @@ describe('aspnet - Web Application (Semantic UI)', function() { }); - -/* - * yo aspnet Web Application Basic - Grunt option - */ -describe('aspnet - Web Application Basic w/grunt', function() { - - util.goCreateApplicationWithOptions('webbasic', 'gruntTest', 'bootstrap', { - grunt: 'grunt' - }); - - describe('Checking directories', function() { - it('Application directory created', function() { - assert.file('gruntTest/'); - }); - - it('grunt file created', function() { - assert.file('gruntTest/Gruntfile.js'); - }); - - it('gulpfile does NOT exist', function() { - assert.noFile('gruntTest/gulpfile.js'); - }); - }); -}); - -/* - * yo aspnet Web Application Basic - No Grunt option - */ -describe('aspnet - Web Application Basic w/o grunt', function() { - - util.goCreateApplication('webbasic', 'gulpTest'); - - describe('Checking directories', function() { - it('Application directory created', function() { - assert.file('gulpTest/'); - }); - - it('gulp file created', function() { - assert.file('gulpTest/gulpfile.js'); - }); - - it('grunt file does NOT exist', function() { - assert.noFile('gulpTest/Gruntfile.js'); - }); - }); -}); - /* * yo aspnet Web Application (Bootstrap) */ @@ -658,10 +611,9 @@ describe('aspnet - Web Application Basic (Bootstrap)', function() { 'webTest/.bowerrc', 'webTest/.gitignore', 'webTest/bower.json', + 'webTest/bundleconfig.json', 'webTest/appsettings.json', 'webTest/Controllers/HomeController.cs', - 'webTest/gulpfile.js', - 'webTest/package.json', 'webTest/Program.cs', 'webTest/project.json', 'webTest/Properties/launchSettings.json', @@ -759,8 +711,6 @@ describe('aspnet - Web Application Basic (Semantic UI)', function() { 'webTest/bower.json', 'webTest/appsettings.json', 'webTest/Controllers/HomeController.cs', - 'webTest/gulpfile.js', - 'webTest/package.json', 'webTest/Program.cs', 'webTest/project.json', 'webTest/Properties/launchSettings.json', From 93e97319072215022b912209ec7daa1a46536cc7 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 10 Jun 2016 22:09:31 +0200 Subject: [PATCH 08/14] Introduce Bundler to web template (#735) This commit brings changes from aspnet/Templates#592 to web project template. The Gulp, Grunt options are removed with NPM support removal. Thanks! --- app/index.js | 8 +-- .../overrides/semantic/web/bundleconfig.json | 30 +++++++++++ templates/projects/web/Gruntfile.js | 10 ---- templates/projects/web/bundleconfig.json | 21 ++++++++ templates/projects/web/gulpfile.js | 45 ---------------- templates/projects/web/package.json | 13 ----- templates/projects/web/project.json | 9 +++- test/test-core.js | 52 +------------------ 8 files changed, 62 insertions(+), 126 deletions(-) create mode 100644 templates/overrides/semantic/web/bundleconfig.json delete mode 100644 templates/projects/web/Gruntfile.js create mode 100644 templates/projects/web/bundleconfig.json delete mode 100755 templates/projects/web/gulpfile.js delete mode 100755 templates/projects/web/package.json diff --git a/app/index.js b/app/index.js index 2c66ef7f..7fd39554 100644 --- a/app/index.js +++ b/app/index.js @@ -208,19 +208,13 @@ var AspnetGenerator = yeoman.generators.Base.extend({ case 'web': this.sourceRoot(path.join(__dirname, '../templates/projects/' + this.type)); - // Grunt or Gulp - if (this.options.grunt) { - this.fs.copyTpl(this.templatePath('Gruntfile.js'), this.applicationName + '/Gruntfile.js', this.templatedata); - } else { - this.fs.copyTpl(this.templatePath('gulpfile.js'), this.applicationName + '/gulpfile.js', this.templatedata); - } // individual files (configs, etc) this.fs.copyTpl(this.sourceRoot() + '/../../Dockerfile.txt', this.applicationName + '/Dockerfile', this.templatedata); this.fs.copy(this.templatePath('.bowerrc'), this.applicationName + '/.bowerrc'); this.fs.copy(this.sourceRoot() + '/../../gitignore.txt', this.applicationName + '/.gitignore'); this.fs.copyTpl(this.templatePath('appsettings.json'), this.applicationName + '/appsettings.json', this.templatedata); this.fs.copyTpl(this.templatePath('bower.json'), this.applicationName + '/bower.json', this.templatedata); - this.fs.copyTpl(this.templatePath('package.json'), this.applicationName + '/package.json', this.templatedata); + this.fs.copy(this.templatePath('bundleconfig.json'), this.applicationName + '/bundleconfig.json'); this.fs.copyTpl(this.templatePath('Program.cs'), this.applicationName + '/Program.cs', this.templatedata); this.fs.copyTpl(this.templatePath('project.json'), this.applicationName + '/project.json', this.templatedata); this.fs.copy(this.templatePath('README.md'), this.applicationName + '/README.md'); diff --git a/templates/overrides/semantic/web/bundleconfig.json b/templates/overrides/semantic/web/bundleconfig.json new file mode 100644 index 00000000..9caed82d --- /dev/null +++ b/templates/overrides/semantic/web/bundleconfig.json @@ -0,0 +1,30 @@ + +[ + { + "outputFileName": "wwwroot/css/site.min.css", + "inputFiles": [ + "wwwroot/css/site.css" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/semantic.validation.min.js", + "inputFiles": [ + "wwwroot/js/semantic.validation.js" + ], + "minify": { + "enabled": true + } + } +] diff --git a/templates/projects/web/Gruntfile.js b/templates/projects/web/Gruntfile.js deleted file mode 100644 index 27b3117e..00000000 --- a/templates/projects/web/Gruntfile.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - This file is the main entry point for defining grunt tasks and using grunt plugins. - Click here to learn more: https://docs.asp.net/en/latest/client-side/using-grunt.html -*/ -"use strict"; - -module.exports = function(grunt) { - grunt.initConfig({ - }); -}; diff --git a/templates/projects/web/bundleconfig.json b/templates/projects/web/bundleconfig.json new file mode 100644 index 00000000..430147e9 --- /dev/null +++ b/templates/projects/web/bundleconfig.json @@ -0,0 +1,21 @@ + +[ + { + "outputFileName": "wwwroot/css/site.min.css", + "inputFiles": [ + "wwwroot/css/site.css" + ], + "minify": { + "enabled": true + } + }, + { + "outputFileName": "wwwroot/js/site.min.js", + "inputFiles": [ + "wwwroot/js/site.js" + ], + "minify": { + "enabled": true + } + } +] diff --git a/templates/projects/web/gulpfile.js b/templates/projects/web/gulpfile.js deleted file mode 100755 index faf29554..00000000 --- a/templates/projects/web/gulpfile.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -"use strict"; - -var gulp = require("gulp"), - rimraf = require("rimraf"), - concat = require("gulp-concat"), - cssmin = require("gulp-cssmin"), - uglify = require("gulp-uglify"); - -var webroot = "./wwwroot/"; - -var paths = { - js: webroot + "js/**/*.js", - minJs: webroot + "js/**/*.min.js", - css: webroot + "css/**/*.css", - minCss: webroot + "css/**/*.min.css", - concatJsDest: webroot + "js/site.min.js", - concatCssDest: webroot + "css/site.min.css" -}; - -gulp.task("clean:js", function (cb) { - rimraf(paths.concatJsDest, cb); -}); - -gulp.task("clean:css", function (cb) { - rimraf(paths.concatCssDest, cb); -}); - -gulp.task("clean", ["clean:js", "clean:css"]); - -gulp.task("min:js", function () { - return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) - .pipe(concat(paths.concatJsDest)) - .pipe(uglify()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min:css", function () { - return gulp.src([paths.css, "!" + paths.minCss]) - .pipe(concat(paths.concatCssDest)) - .pipe(cssmin()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min", ["min:js", "min:css"]); diff --git a/templates/projects/web/package.json b/templates/projects/web/package.json deleted file mode 100755 index 6b829202..00000000 --- a/templates/projects/web/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "<%= namespace.toLowerCase() %>", - "version": "0.0.0", - "private": true, - "devDependencies": {<% if(!grunt){ %> - "gulp": "3.9.1", - "gulp-concat": "2.6.0", - "gulp-cssmin": "0.1.7", - "gulp-uglify": "1.5.3", - "rimraf": "2.5.2"<% } %><% if(grunt){ %> - "grunt": "1.0.1"<% } %> - } -} diff --git a/templates/projects/web/project.json b/templates/projects/web/project.json index a278a144..7f2515d3 100755 --- a/templates/projects/web/project.json +++ b/templates/projects/web/project.json @@ -42,6 +42,13 @@ }, "tools": { + "BundlerMinifier.Core": { + "version": "2.0.208", + "imports": [ + "portable-net45+win8+dnxcore50", + "portable-net40+sl5+win8+wp8+wpa81" + ] + }, "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview1-final", "imports": "portable-net45+win8+dnxcore50" @@ -106,7 +113,7 @@ }, "scripts": { - "prepublish": [ "npm install", "bower install"<% if(!grunt){ %>, "gulp clean", "gulp min"<% } %> ], + "prepublish": [ "bower install" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }, diff --git a/test/test-core.js b/test/test-core.js index f1c305cb..0eb3f1b8 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -129,52 +129,6 @@ describe('aspnet - Unit Test Application', function() { }); -/* - * yo aspnet Web Application - Grunt option - */ -describe('aspnet - Web Application w/grunt', function() { - - util.goCreateApplicationWithOptions('web', 'gruntTest', 'bootstrap', { - grunt: 'grunt' - }); - - describe('Checking directories', function() { - it('Application directory created', function() { - assert.file('gruntTest/'); - }); - - it('grunt file created', function() { - assert.file('gruntTest/Gruntfile.js'); - }); - - it('gulpfile does NOT exist', function() { - assert.noFile('gruntTest/gulpfile.js'); - }); - }); -}); - -/* - * yo aspnet Web Application - No Grunt option - */ -describe('aspnet - Web Application w/o grunt', function() { - - util.goCreateApplication('web', 'gulpTest'); - - describe('Checking directories', function() { - it('Application directory created', function() { - assert.file('gulpTest/'); - }); - - it('gulp file created', function() { - assert.file('gulpTest/gulpfile.js'); - }); - - it('grunt file does NOT exist', function() { - assert.noFile('gulpTest/Gruntfile.js'); - }); - }); -}); - /* * yo aspnet Web Application (Bootstrap) */ @@ -256,9 +210,8 @@ describe('aspnet - Web Application (Bootstrap)', function() { 'webTest/.gitignore', 'webTest/appsettings.json', 'webTest/bower.json', + 'webTest/bundleconfig.json', 'webTest/Dockerfile', - 'webTest/gulpfile.js', - 'webTest/package.json', 'webTest/Program.cs', 'webTest/project.json', 'webTest/README.md', @@ -424,9 +377,8 @@ describe('aspnet - Web Application (Semantic UI)', function() { 'webTest/.gitignore', 'webTest/appsettings.json', 'webTest/bower.json', + 'webTest/bundleconfig.json', 'webTest/Dockerfile', - 'webTest/gulpfile.js', - 'webTest/package.json', 'webTest/Program.cs', 'webTest/project.json', 'webTest/README.md', From bc70a72a07f09f833a8ce60817e562c8868765e3 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 10 Jun 2016 22:09:45 +0200 Subject: [PATCH 09/14] :memo: Update documentation removing Grunt/Gulp options description (#736) Afte adding Bundler support from aspnet/Templates#592 the --grunt option has no purpose --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 37deeafc..fc7a06fe 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,6 @@ See also: [Building Projects with Yeoman on docs.asp.net](https://docs.asp.net/e * `yo aspnet` shows a wizard for generating a new ASP.NET Core 1.0 app -* `yo aspnet --grunt` generates `Gruntfile.js` files for **web** templates instead of `gulpfile.js` - * `yo aspnet --help` shows flags and other configurable options ## Template projects @@ -53,8 +51,7 @@ The [Docker](https://www.docker.com/) support with `Dockerfile` configuration fi The Unit test project uses [xUnit: a free, open source, community-focused unit testing tool for the .NET Framework](https://xunit.github.io/) -The templates that use client side libraries and `Gulp` or `Grunt` tasks are now calling `npm install` and `bower install` script to install NPM and Bower managed dependencies. You can skip installation process by passign `--skip-install` option to generator, e.g. `yo aspnet --skip-install`. This should allow better experience when `Development` has been enabled. - +The templates that use client side libraries are calling `bower install` script to install Bower managed dependencies. You can skip installation process by passign `--skip-install` option to generator, e.g. `yo aspnet --skip-install`. This should allow better experience when `Development` has been enabled. ## Command line automation From 0ff085b95737be10175edaf05e3cf118ed750a16 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 10 Jun 2016 22:10:02 +0200 Subject: [PATCH 10/14] :fire: Remove comment block from library project (#737) See: aspnet/Templates#599 Thanks! --- templates/projects/classlibrary/class.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/projects/classlibrary/class.cs b/templates/projects/classlibrary/class.cs index 9ad14983..95a82752 100644 --- a/templates/projects/classlibrary/class.cs +++ b/templates/projects/classlibrary/class.cs @@ -5,8 +5,6 @@ namespace <%= namespace %> { - // This project can output the Class library as a NuGet Package. - // To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". public class Class1 { public Class1() From 2721f00ead44bad4b209b7b16b2082133bff13d2 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Fri, 10 Jun 2016 22:10:15 +0200 Subject: [PATCH 11/14] Add asp-area tag attribute to links (#738) See aspnet/Templates#593 See aspnet/Templates#597 Thanks! --- .../semantic/web/Views/Shared/_Layout.cshtml | 12 ++++++------ .../semantic/webbasic/Views/Shared/_Layout.cshtml | 12 ++++++------ templates/projects/web/Views/Shared/_Layout.cshtml | 8 ++++---- .../projects/webbasic/Views/Shared/_Layout.cshtml | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/templates/overrides/semantic/web/Views/Shared/_Layout.cshtml b/templates/overrides/semantic/web/Views/Shared/_Layout.cshtml index d1596336..656cf08d 100644 --- a/templates/overrides/semantic/web/Views/Shared/_Layout.cshtml +++ b/templates/overrides/semantic/web/Views/Shared/_Layout.cshtml @@ -31,9 +31,9 @@ Toggle Navigation <%= namespace %> - - - Contact + + + Contact @await Html.PartialAsync("_LoginPartial") @@ -41,9 +41,9 @@ diff --git a/templates/projects/web/Views/Shared/_Layout.cshtml b/templates/projects/web/Views/Shared/_Layout.cshtml index a8e70293..95fb72c2 100755 --- a/templates/projects/web/Views/Shared/_Layout.cshtml +++ b/templates/projects/web/Views/Shared/_Layout.cshtml @@ -26,13 +26,13 @@ - <%= namespace %> + <%= namespace %> diff --git a/templates/projects/webbasic/Views/Shared/_Layout.cshtml b/templates/projects/webbasic/Views/Shared/_Layout.cshtml index 3a82859b..f522a3d8 100755 --- a/templates/projects/webbasic/Views/Shared/_Layout.cshtml +++ b/templates/projects/webbasic/Views/Shared/_Layout.cshtml @@ -26,13 +26,13 @@ - <%= namespace %> + <%= namespace %> From 43a97f41eeae580fc2404b86a3cddd67d9c90973 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 11 Jun 2016 14:31:28 +0200 Subject: [PATCH 12/14] Update command name for bundling (#739) This commit adds Bundler command to script section of the project file See: aspnet/Templates@8b42fc6 Thanks! --- templates/projects/web/project.json | 1 + templates/projects/webbasic/project.json | 1 + 2 files changed, 2 insertions(+) diff --git a/templates/projects/web/project.json b/templates/projects/web/project.json index 7f2515d3..ee545064 100755 --- a/templates/projects/web/project.json +++ b/templates/projects/web/project.json @@ -113,6 +113,7 @@ }, "scripts": { + "precompile": [ "dotnet bundle" ], "prepublish": [ "bower install" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }, diff --git a/templates/projects/webbasic/project.json b/templates/projects/webbasic/project.json index 1bfb59f2..2abce44c 100755 --- a/templates/projects/webbasic/project.json +++ b/templates/projects/webbasic/project.json @@ -76,6 +76,7 @@ }, "scripts": { + "precompile": [ "dotnet bundle" ], "prepublish": [ "bower install" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }, From f160ad35e5c06c412d39d7d8ce2faa76e04b67e0 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 11 Jun 2016 14:31:41 +0200 Subject: [PATCH 13/14] Add svg file workaround to site.css (#740) This commit adds custom css rule to site.css See: aspnet/Templates@bc93039 Thanks! --- templates/projects/web/wwwroot/css/site.css | 6 ++++++ templates/projects/web/wwwroot/css/site.min.css | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/projects/web/wwwroot/css/site.css b/templates/projects/web/wwwroot/css/site.css index 6baa84da..5933ebab 100755 --- a/templates/projects/web/wwwroot/css/site.css +++ b/templates/projects/web/wwwroot/css/site.css @@ -35,6 +35,12 @@ textarea { padding-left: 0.5em; } +/* Make .svg files in the carousel display properly in older browsers */ +.carousel-inner .item img[src$=".svg"] +{ + width: 100%; +} + /* Hide/rearrange for smaller screens */ @media screen and (max-width: 767px) { /* Hide captions */ diff --git a/templates/projects/web/wwwroot/css/site.min.css b/templates/projects/web/wwwroot/css/site.min.css index c8f600ac..8c23178f 100755 --- a/templates/projects/web/wwwroot/css/site.min.css +++ b/templates/projects/web/wwwroot/css/site.min.css @@ -1 +1 @@ -body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}@media screen and (max-width:767px){.carousel-caption{display:none}} +body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}.carousel-inner .item img[src$=".svg"]{width:100%}@media screen and (max-width:767px){.carousel-caption{display:none}} From 6245a196a7f476f0392bfdac49b9e50fe626d7c2 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sat, 11 Jun 2016 14:31:54 +0200 Subject: [PATCH 14/14] Update bundleconfig.json (#741) For details please see: aspnet/Templates@749d029 Thanks! --- templates/overrides/semantic/web/bundleconfig.json | 3 ++- templates/overrides/semantic/webbasic/bundleconfig.json | 3 ++- templates/projects/web/bundleconfig.json | 3 ++- templates/projects/webbasic/bundleconfig.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/overrides/semantic/web/bundleconfig.json b/templates/overrides/semantic/web/bundleconfig.json index 9caed82d..9487b167 100644 --- a/templates/overrides/semantic/web/bundleconfig.json +++ b/templates/overrides/semantic/web/bundleconfig.json @@ -24,7 +24,8 @@ "wwwroot/js/semantic.validation.js" ], "minify": { - "enabled": true + "enabled": true, + "renameLocals": true } } ] diff --git a/templates/overrides/semantic/webbasic/bundleconfig.json b/templates/overrides/semantic/webbasic/bundleconfig.json index 5ae75176..937a1014 100644 --- a/templates/overrides/semantic/webbasic/bundleconfig.json +++ b/templates/overrides/semantic/webbasic/bundleconfig.json @@ -23,7 +23,8 @@ "wwwroot/js/semantic.validation.js" ], "minify": { - "enabled": true + "enabled": true, + "renameLocals": true } } ] diff --git a/templates/projects/web/bundleconfig.json b/templates/projects/web/bundleconfig.json index 430147e9..b6af0938 100644 --- a/templates/projects/web/bundleconfig.json +++ b/templates/projects/web/bundleconfig.json @@ -15,7 +15,8 @@ "wwwroot/js/site.js" ], "minify": { - "enabled": true + "enabled": true, + "renameLocals": true } } ] diff --git a/templates/projects/webbasic/bundleconfig.json b/templates/projects/webbasic/bundleconfig.json index 6eadf24e..d60e8e7d 100644 --- a/templates/projects/webbasic/bundleconfig.json +++ b/templates/projects/webbasic/bundleconfig.json @@ -14,7 +14,8 @@ "wwwroot/js/site.js" ], "minify": { - "enabled": true + "enabled": true, + "renameLocals": true } } ]