Giter Site home page Giter Site logo

generator-aspnet's People

Contributors

egamma avatar gutek avatar jchannon avatar sayedihashimi avatar shirhatti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-aspnet's Issues

Error while creating a new project (events.js:72)

sudo yo aspnet
Password:

 _-----_
|       |    .--------------------------.
|--(o)--|    | Welcome to the marvelous |

---------´ | Aspnet generator! | ( _´U_ ) '--------------------------'
/_A\
| ~ |
**'.
**.'__
´ |° ´ Y

[?] What type of application do you want to create? MVC Application
[?] What's the name of your ASP.NET application? TestApp

 info ... Fetching http://github.com/ligershark/aspnet_vnext_samples/archive/master.tar.gz ...
 info This might take a few moments

..✔ Done in /Users/dmeijboom/.cache/yeoman/ligershark/aspnet_vnext_samples/master

create NuGet.config
create TestApp/Controllers/HomeController.cs
create TestApp/Models/User.cs
create TestApp/Startup.cs
create TestApp/Views/Home/Index.cshtml
create TestApp/Views/Shared/_Layout.cshtml
create TestApp/project.json
/Users/dmeijboom/.cache/yeoman

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)

Update to publish from release branch

It would be good if we create a new branch release that we release from. That would make it easy for us to continue dev in master and we can push changes to release when we are ready to go out in yeoman.

Below are the changes that I'm aware of to make this happen.

@shirhatti did I miss anything?

@shirhatti can you add me as an owner on the generator-aspnet package? My npm username is sayedha. You should be able to do that with the command npm owner add sayedha generator-aspnet.

Make kpm restore optional during generation ?

Creating an application installs it and then runs 'kpm restore' which pulls in packages from the feed defined in the Nuget.config dropped by the template. The feed currently points to vnext and user wouldn't have a chance to change the feed. Can we make it optional so that the user can change the feed and then restore the packages?

Create nested options

At the moment each option is a list item such as Console App, Web App, MVC App, Nancy App.

I think we should find a way to display the options nested so if you choose Console App you are then given the choice of Nancy Console App and WebApi App

Does not exit gracefully when K runtime is not installed

If the k runtime is not present on your machine, the generator will crash will trying to execute kpm restore

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1000:11)
    at Process.ChildProcess._handle.onexit (child_process.js:791:34)

Update travis build to verify all templates

We already have a travis build in place. When there are changes it's cumbersome to verify. It would be good if travis could verify the following continue to work.

  • yo aspnet creates content for all generators
  • kpm restore passes for all generators
  • kpm build passes for all generators
  • k kestrel successfully starts kestrel on given port for web projects. _stretch goal_

I don't know much about travis myself so this is def an area that we can use some help.

There is an error when I generate the project

I just install this generator-aspnet, but when I run the below command:

yo aspnet

and select the project(any projects), there is an error:

/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/node_modules/download/index.js:70
            if (opts.extract && (decompress.canExtract(opts.url, mime) || opts
                                            ^
TypeError: Object function Decompress(opts) {
    if (!(this instanceof Decompress)) {
        return new Decompress(opts);
    }

    this.opts = opts || {};
    this.streams = [];
} has no method 'canExtract'
    at Request.<anonymous> (/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/node_modules/download/index.js:70:45)
    at Request.EventEmitter.emit (events.js:95:17)
    at Request.onResponse (/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/node_modules/request/request.js:832:10)
    at ClientRequest.g (events.js:175:14)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1669:21)
    at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:120:23)
    at CleartextStream.socketOnData [as ondata] (http.js:1564:20)
    at CleartextStream.read [as _read] (tls.js:502:12)
    at CleartextStream.Readable.read (_stream_readable.js:320:10)

any ideas?

Thanks!

Error while using the generator on mac

? What type of application do you want to create? MVC Application
? What's the name of your ASP.NET application? Awesome

     info ... Fetching http://github.com/ligershark/aspnet_vnext_samples/archive/master.tar.gz ...
     info This might take a few moments
..✔ Done in /Users/ashutoshraina/.cache/yeoman/ligershark/aspnet_vnext_samples/master

   create NuGet.config
   create global.json
   create Awesome/Controllers/HomeController.cs
   create Awesome/Models/User.cs
   create Awesome/Startup.cs
   create Awesome/Views/Home/Index.cshtml
   create Awesome/Views/Shared/_Layout.cshtml
   create Awesome/project.json
   create Awesome/wwwroot/.gitignore
/Users/ashutoshraina/.cache/yeoman

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1001:11)
    at Process.ChildProcess._handle.onexit (child_process.js:792:34)

Let me know if I can provide some other information that might be useful.

Update content for console project

We should update template content to match what we are shipping in VS. We made some changes to project.json and the runtime will not resect old strings in a future version.

project.json
{
    "dependencies": {
    },

    "frameworks" : {
        "net451" : { },
        "k10" : { 
            "dependencies": {
                "System.Console": "4.0.0.0"
            }
        }
    }
}
Program.cs
using System;

namespace ConsoleApp1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            Console.ReadLine();
        }
    }
}

Should we be using .remote()?

@shirhatti in the current implementation we are using .remote() in index.js to retrieve the template content. What I've noticed is that when calling .remote() if the git repo exists on the client cache then it will not be refreshed. There is a refresh parameter on remote(). If we specify true for refresh then the git repo will be cloned each time when the generator is invoked. On my box in order to get rid of yeoman cache I had to remove yo.

Is using .remote() the right approach here? I looked at the generator-angular and they include the files directly inside the npm package then use .template() and .copy() to write the files.

The code to always update when using remote is below.

    retrieveContent: function () {
        var done = this.async();

        this.remote('ligershark', 'aspnet_vnext_samples', 'master', function(err, remote) {
            done();
        },true);
    }

cc @jchannon

Making dropping of Nuget.config file optional

Currently creating a new application drops Nuget.config and global.json in the root directory. Doing kpm restore, restores the packages from the feed defined in this Nuget.config file and not the Nuget.config defined for the machine. Can we make dropping of this file optional or not drop it at all ?

Add scaffolding to web templates

We should add the scaffolding components to web projects. We need to make the following changes to project.json for the web projects.

  1. Add "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-*" in dependencies
  2. Add "gen": "Microsoft.Framework.CodeGeneration" in the commands section

Update project.json for Web template

We should update the project.json file to use frameworks instead of configurations.

For reference we can look at how VS creates the file. In our case there are slight differences to include kestrel.

{
    "dependencies": {
        "EntityFramework.SqlServer": "7.0.0-alpha3",
        "Microsoft.AspNet.Mvc": "6.0.0-alpha3",
        "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-alpha3",
        "Microsoft.AspNet.Identity.Authentication": "3.0.0-alpha3",
        "Microsoft.AspNet.Security.Cookies": "1.0.0-alpha3",
        "Microsoft.AspNet.Server.IIS": "1.0.0-alpha3",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-alpha3",
        "Microsoft.AspNet.StaticFiles": "1.0.0-alpha3",
        "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-alpha3",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0-alpha2"
    },
    "commands": {
        /* Change the port number when you are self hosting this application */
        "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
    },
    "frameworks": {
        "net451" : { },
        "k10" : { }
    }
}

Subgenerators for yo

We should create some yo subgenerators for asp.net 5. What I would recommend is looking at the templates in the Add New Item dialog in VS and create subgenerators for those. That should be our initial release so that we are atleast on par with that.

What I'd love to see after that is to create an additional set of yo subgenerators. Then when a VS release is going to go out we can pickup the files in the subgenerators.

@kenwarner let me know what you think. I'm excited to try it out and see how the experience feels. I've assigned the item to you.

cc @rustd @johnpapa @shanselman

Add Unit Test template

We should add a Unit Test template to the generators. We have a sample test project contained in this sample. We should remove all the Visual Studio artifacts before creating the test project.

Create empty vNext project (i.e. class library)

We should create a template for an empty vNext project. This is basically a class library template.

This template should just create a new folder with the given application name and create a project.json file. I don't think we need to included the Class1.cs file in the template. Is there a Sublime snippet to create a C# class? If not we should consider to create one as well. I'll file an issue for us to look into it.

project.json
{
    "dependencies": {
    },

    "frameworks" : {
        "net451" : { 
            "dependencies": {
            }
        },
        "k10" : { 
            "dependencies": {
                "System.Runtime": "4.0.20.0"
            }
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.