Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
18 changes: 3 additions & 15 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -258,19 +252,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
Expand Down Expand Up @@ -343,7 +331,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)
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 6 additions & 6 deletions templates/overrides/semantic/web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
<span class="sr-only">Toggle Navigation</span>
</a>
<a href="/" class="header item"><%= namespace %></a>
<menulink class="blue item" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" controller-name="Home" action-name="Contact" menu-text="Contact">Contact</menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Contact" menu-text="Contact">Contact</menulink>

@await Html.PartialAsync("_LoginPartial")
</div>
</div>

<!-- Sidebar Menu -->
<div class="ui vertical inverted sidebar menu">
<menulink class="blue item" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" controller-name="Home" action-name="Contact" menu-text="Contact"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Contact" menu-text="Contact"></menulink>

@if (SignInManager.IsSignedIn(User))
{
Expand Down
31 changes: 31 additions & 0 deletions templates/overrides/semantic/web/bundleconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

[
{
"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,
"renameLocals": true
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
<span class="sr-only">Toggle Navigation</span>
</a>
<a href="/" class="header item"><%= namespace %></a>
<menulink class="blue item" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" controller-name="Home" action-name="Contact" menu-text="Contact">Contact</menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Contact" menu-text="Contact">Contact</menulink>

</div>
</div>

<!-- Sidebar Menu -->
<div class="ui vertical inverted sidebar menu">
<menulink class="blue item" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" controller-name="Home" action-name="Contact" menu-text="Contact"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Index" menu-text="Home"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="About" menu-text="About"></menulink>
<menulink class="blue item" asp-area="" controller-name="Home" action-name="Contact" menu-text="Contact"></menulink>

</div>

Expand Down
30 changes: 30 additions & 0 deletions templates/overrides/semantic/webbasic/bundleconfig.json
Original file line number Diff line number Diff line change
@@ -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,
"renameLocals": true
}
}
]
2 changes: 0 additions & 2 deletions templates/projects/classlibrary/class.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
11 changes: 9 additions & 2 deletions templates/projects/emptyweb/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
"preserveCompilationContext": true,
"compile": {
"exclude": [
"node_modules"
]
}
},

"runtimeOptions": {
"gcServer": true
"configProperties": {
"System.GC.Server": true
}
},

"publishOptions": {
Expand Down
7 changes: 6 additions & 1 deletion templates/projects/unittest/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"version": "1.0.0-*",

"buildOptions": {
"preserveCompilationContext": true
"preserveCompilationContext": true,
"compile": {
"exclude": [
"node_modules"
]
}
},

"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions templates/projects/web/Controllers/ManageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public class ManageController : Controller
private readonly ILogger _logger;

public ManageController(
UserManager<ApplicationUser> userManager,
SignInManager<ApplicationUser> signInManager,
IEmailSender emailSender,
ISmsSender smsSender,
ILoggerFactory loggerFactory)
UserManager<ApplicationUser> userManager,
SignInManager<ApplicationUser> signInManager,
IEmailSender emailSender,
ISmsSender smsSender,
ILoggerFactory loggerFactory)
{
_userManager = userManager;
_signInManager = signInManager;
Expand Down
10 changes: 0 additions & 10 deletions templates/projects/web/Gruntfile.js

This file was deleted.

8 changes: 4 additions & 4 deletions templates/projects/web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-controller="Home" asp-action="Index" class="navbar-brand"><%= namespace %></a>
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand"><%= namespace %></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-controller="Home" asp-action="Contact">Contact</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
</ul>
@await Html.PartialAsync("_LoginPartial")
</div>
Expand Down
22 changes: 22 additions & 0 deletions templates/projects/web/bundleconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

[
{
"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,
"renameLocals": true
}
}
]
45 changes: 0 additions & 45 deletions templates/projects/web/gulpfile.js

This file was deleted.

13 changes: 0 additions & 13 deletions templates/projects/web/package.json

This file was deleted.

Loading