omnisharp / generator-aspnet Goto Github PK
View Code? Open in Web Editor NEWyo generator for ASP.NET Core
yo generator for ASP.NET Core
I think that people will start using GulpJS with vNext project very soon, though VS tools appears to officially support GruntJS at the moment.
I'm referring also to this article:
https://www.tattoocoder.com/gulp-typescript-in-asp-net-5/
The contents of template file could be similar to the GruntJS' file template:
https://github.com/OmniSharp/generator-aspnet/blob/master/templates/gruntfile.js
for example:
/*
This file is the main entry point for defining Gulp tasks and using Gulp plugins
To learn more visit: https://github.com/gulpjs/gulp/blob/master/docs/README.md
*/
'use strict';
var gulp = require('gulp');
// The default task (called when you run `gulp` from CLI)
gulp.task('default', function() {
console.log('Running default Gulp task: replace with your own code!!!');
});
/cc @spboyer
The NPM package contains duplicate reference to generator-yeoman
:
https://github.com/OmniSharp/generator-aspnet/blob/master/package.json#L33-L42
I think it should only be used in devependencies
section and removed from devDependencies
:
https://docs.npmjs.com/files/package.json
(devdependencies section)
Currently index.js is pulling from the old LigerShark repo using .remote()
. We should update that to pull source files from this repo instead.
The generator README is missing basic description what we are generating in case of full samples:
Empty Application
Console Application
Web Application
MVC Application
Nancy ASP.NET Application
Class Library
Unit test project
A @VisualStudio contains a small help block in wizard when using given template - we could use something similar I think.
What's missing? What do you need here to make it better?
Can we make it such that the subgenerators handle file extensions better? For example if I invoke the MvcController with either of the commands.
yo aspnet:MvcController MyController
or
yo aspnet:MvcController MyController.cs
Should result in the same thing, MyController.cs being created. With the current implementation with yo aspnet:MvcController MyController.cs
will result in a file named MyController.cs.cs
.
We should move the wiki entries from https://github.com/ligershark/generator-aspnet/wiki to here.
Running through the Getting Started guide on the Mac ... unfortunately getting the following error when trying to run kpm restore
with the site generated by yo aspnet
. Is the nuget executable being used something that was installed via generator-aspnet, or something else on my system that might be out of date??
Restoring packages for /Users/joelmartinez/dev/vnext/FirstTest/project.json
CACHE https://nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc'
GET https://www.nuget.org/api/v2/package/Microsoft.AspNet.Mvc/6.0.0-beta1.
CACHE https://nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Hosting'
CACHE https://www.nuget.org/api/v2/package/Microsoft.AspNet.Hosting/1.0.0-beta1
CACHE https://nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Security.Cookies'
CACHE https://www.nuget.org/api/v2/package/Microsoft.AspNet.Security.Cookies/1.0.0-beta1
CACHE https://nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'
CACHE https://www.nuget.org/api/v2/package/Microsoft.AspNet.Server.WebListener/1.0.0-beta1
CACHE https://nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'
CACHE https://www.nuget.org/api/v2/package/Microsoft.AspNet.StaticFiles/1.0.0-beta1
GET https://nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
----------
System.NotImplementedException: The requested feature is not implemented.
at Microsoft.Framework.PackageManager.Restore.NuGet.PackageFeed+<OpenNuspecStreamAsync>d__1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.IO.Stream].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RemoteWalkProvider+<GetDependencies>d__1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Collections.Generic.IEnumerable`1[Microsoft.Framework.Runtime.LibraryDependency]].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryEntry>d__1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreOperations+<CreateGraphNode>d__1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreOperations+<CreateGraphNode>d__1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphNode[]].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreCommand+<RestoreForProject>d__1.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00000] in <filename unknown>:0
at Microsoft.Framework.PackageManager.RestoreCommand+<ExecuteCommand>d__1.MoveNext () [0x00000] in <filename unknown>:0
----------
Restore failed
The requested feature is not implemented.
@spboyer do you fancy creating a nancy module, bootstrapper & istatuscodehandler subgenerator?
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 generatorskpm restore
passes for all generatorskpm build
passes for all generatorsk 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.
Hey all,
I'm still somewhat new to ASP.net but one pattern I've noticed from the book I've read, for a complete project is:
Solution-Folder/
Solution-Name.sln
Project.WebUI
Project.UnitTests
Project.Domain
An example of what I mean is:
https://sportsstorevs2011.codeplex.com/SourceControl/latest -- under the 'SportsStore' application.
I'm curious if anyone knows a way to generate this kind of structure with existing tools? I'm tempted to extend the generator-aspnet to allow this kind of structure, but I wanted to ask first if anyone knew a way to do this.
I think I'm getting the same issue as this one from the yeoman-generator Dependency problem with download > decompress #626. I'm guessing that updating the dependency version of yeoman-generator to something greater than or equal to 0.17.3 should work, as that was the solution identified in their issue. I see that generator-aspnet uses version ~0.16.0 in it's package.json.
... Which apparently aren't valid for JSON docs...
http://stackoverflow.com/a/4183018/23300
https://github.com/OmniSharp/generator-aspnet/blob/master/templates/projects/webapi/project.json
This manifests itself as an issue with certain JSON deserializers which will fail to decode them. Specifically, trying to edit a newly created aspnet project with Omnisharp-sublime will fail:
File "./json/decoder.py", line 176, in JSONObject
ValueError: Expecting property name enclosed in double quotes: line 2 column 5 (char 6)
Stripping the comments from project.json, and then everything works fine.
Reported by @Martin105 on jabbr!
I think we should have a unit test template in the main generator. Right now it is hard to do it since we have to refer to Musicstore tests to setup one from scratch
This template can have
I think generator should follow its own conventions (CoffeeScript
) - so maybe there should be aspnet:JavaScript
subgenerator that can be used as:
yo aspnet:JavaScript app
At the moment there is a JScript
subgenerator - with a name that could not exactly correctly explain what kind of script is to be created in my opinion: http://en.wikipedia.org/wiki/JScript (the link is just for reference)
Aliases to subgenerators can be created by adding new subgenerator with correct (expected) name which uses existing subgenerator as module.
The problem is common, for example there was similar issue on Polymer generator I'm using where not trully fortunate name el
was picked as name for subgenerator that creates element
causing confusions:
yeoman/generator-polymer#87
yeoman/generator-polymer@b0d5102
We should move issues from https://github.com/ligershark/generator-aspnet/issues to here
Migrated from ligershark/generator-aspnet#16
Original issue submitted by @jchannon
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
As per @sayedihashimi comments in this:
#31
if PR is merged, will be this OK to also:
.gitignore
fileREADME.md
with the same content as in PRto the web root directory of MVC sample?
https://github.com/OmniSharp/generator-aspnet/tree/master/samples/mvc/wwwroot
I think web sample project:
https://github.com/OmniSharp/generator-aspnet/tree/master/samples/web
contains unnecessary build artefacts. They are usually excluded from C#/VisualStudio projects Git managed projects:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore#L19
The other samples do not have build artefacts right now.
Is it OK for you guys to remove it?
as side note: the project's .gitignore
could be also updated (via separated issue)
deevus@MacBook-Pro ~/temp/aspnet - $ yo aspnet
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the |
`---------´ | marvellous ASP.NET 5 |
( _´U`_ ) | generator! |
/___A___\ '--------------------------'
| ~ |
__'.___.'__
´ ` |° ´ Y `
? What type of application do you want to create? MVC Application
? What's the name of your ASP.NET application? MvcApplication
info ... Fetching https://github.com/OmniSharp/generator-aspnet/archive/release.tar.gz ...
info This might take a few moments
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
✔ Done in /Users/deevus/.cache/yeoman/OmniSharp/generator-aspnet/release
/Users/deevus/.cache/yeoman
Your project is now created, you can use the following commands to get going
kpm restore
kpm build
k run for console projects
k kestrel or k webfor web projects
deevus@MacBook-Pro ~/temp/aspnet - $ tree
.
└── MvcApplication
1 directory, 0 files
Done using a new install of kvm
and updated yo
and generator-aspnet
In the following session, I generate a unit test project and run kpm restore
. It fails to locate xunit.runner.kre
.
➜ Desktop yo aspnet
...
? What type of application do you want to create? Unit test project
? What's the name of your ASP.NET application? UnitTest
info ... Fetching https://github.com/OmniSharp/generator-aspnet/archive/release.tar.gz ...
info This might take a few moments
....
✔ Done in /Users/joao/.cache/yeoman/OmniSharp/generator-aspnet/release
create UnitTest/SampleTest.cs
create UnitTest/project.json
/Users/joao/.cache/yeoman
Your project is now created, you can use the following commands to get going
kpm restore
kpm build
k run for console projects
k kestrel or k webfor web projects
➜ Desktop cd UnitTest
➜ UnitTest kpm restore
Restoring packages for /Users/joao/Desktop/UnitTest/project.json
CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='xunit.runner.kre'
Resolving complete, 86ms elapsed
Unable to locate xunit.runner.kre >= 1.0.0-beta1
Restore complete, 89ms elapsed
I get this error
/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:9379
throw e;
^
TypeError: Object #<Object> has no method 'on'
at run (/usr/local/lib/node_modules/generator-aspnet/node_modules/yeoman-generator/lib/base.js:444:21)
at composeWith (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/base.js:568:15)
at yoyo._initGenerator (/usr/local/lib/node_modules/yo/yoyo.js:100:8)
at null.<anonymous> (/usr/local/lib/node_modules/yo/yoyo.js:407:35)
at PromptUI.onCompletion (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/lib/ui/prompt.js:69:10)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1965:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/rx/dist/rx.all.js:1902:14)
at AutoDetachObserverPrototype.completed (/usr/local/lib/node_%
The sample page for MVC layout page depends on @bootstrap and uses responsive features - but is missing JavaScript dependencies. When viewing on smaller screen there one cannot expand hamburger menu.
The problem can be fixed by adding them via CDN resources just like in @bootstrap getting started example markup:
http://getbootstrap.com/getting-started/#download
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Usually the commonly used --skip-install
option in Yeoman generators is used to not perform dependencies installation after content has been created.
For example:
generator-angular
:
https://github.com/yeoman/generator-angular/blob/master/app/index.js#L315-L324
generator-webapp
:
https://github.com/yeoman/generator-webapp/blob/master/app/index.js#L201-L206
and they all are based around idea of built-in feature:
yeoman/generator#205
Our generator currently does nothing really that important to be at all mentioned or used in code:
https://github.com/OmniSharp/generator-aspnet/blob/master/app/index.js#L287-L295
This option has a lot of sense in older releases:
a83d7e8#diff-2018087f584c4398b5c3a23fc0e5f9dbR91
as it was used in the same context and based on similar concept.
I think it should be now removed from help text (and from code check) as we do not perform anything related at the current state and people should always see final all is good + short what next message (so it can be a sign that everything ended OK).
Thanks!
JSPM looks very promising regarding client side package management and also ES6 compatible module loading. Will this generator a good place to start to leverage this great tool?
I understand that generator template have to follow markup generated by #VisualStudio templates #15 (comment), but can some attributes be added as this tool is used outside of #VisualStudio? Like "lang", etc.
<html lang="">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
https://github.com/h5bp/html5-boilerplate/blob/master/src/index.html
Migrated issue from ligershark/generator-aspnet#9. See that for full comments.
@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
I've merged the PR #8 from @spboyer which has support for creating items as subgenerators. I went ahead and merged it and released it. We can iterate/improve from here.
I noticed the following issues.
When invoking a generator like yo aspnet:BowerJson
the resulting file is always placed at the directory root of what yo believes is the project root. This is the folder where you started yo
in. It's the folder where .yo-rc.json
lives. I believe it would be better to create the file in the current working directory of the prompt instead of the root directory
Whenever I invoked a generator which accepts a file name (i.e. yo aspnet:MvcController FooController
I get an error like the following. I tried on OSX.
ReferenceError: NamedGenerator is not defined
at Object.<anonymous> (/usr/local/lib/node_modules/generator-aspnet/script-base.js:23:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-aspnet/MvcController/index.js:4:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
The only other concern that I had was that all the folders are at the root directory. Is it possible to move all the subgenerators into a subgenerators
folder? If not that's OK.
the generator now works off of samples for the mvc and web project types. Proposing that the Empty and Web project templates (from VS2015) be added or replace these as the core project templates for these types. Would you also like to see a basic MVC API starter template?
[patrick@Inigo] /Users/patrick/SourceCache/csharp$ yo aspnet
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the |
`---------´ | marvellous ASP.NET 5 |
( _´U`_ ) | generator! |
/___A___\ '--------------------------'
| ~ |
__'.___.'__
´ ` |° ´ Y `
? What type of application do you want to create? MVC Application
? What's the name of your ASP.NET application? MvcApplication
info ... Fetching https://github.com/OmniSharp/generator-aspnet/archive/release.tar.gz ...
info This might take a few moments
/Users/patrick/.cache/yeoman
Your project is now created, you can use the following commands to get going
kpm restore
kpm build
k run for console projects
k kestrel or k webfor web projects
Which is great, except while I now have an MvcApplication
folder, it's empty.
For what it's worth /Users/patrick/.cache/yeoman
does not exist on my machine (creating it doesn't change anything though)
[patrick@Inigo] /Users/patrick/SourceCache/csharp$ ls
MvcApplication
[patrick@Inigo] /Users/patrick/SourceCache/csharp$ cd MvcApplication/
[patrick@Inigo] /Users/patrick/SourceCache/csharp/MvcApplication$ ls
[patrick@Inigo] /Users/patrick/SourceCache/csharp/MvcApplication$ kpm restore
[patrick@Inigo] /Users/patrick/SourceCache/csharp/MvcApplication$ kpm build
Unable to locate project.json.'
[patrick@Inigo] /Users/patrick/SourceCache/csharp/MvcApplication$ k web
System.Exception: Unable to locate project.json
at Microsoft.Framework.Runtime.DefaultHost.Initialize (Microsoft.Framework.Runtime.DefaultHostOptions options, IServiceProvider hostServices) [0x00000] in <filename unknown>:0
at Microsoft.Framework.Runtime.DefaultHost..ctor (Microsoft.Framework.Runtime.DefaultHostOptions options, IServiceProvider hostServices) [0x00000] in <filename unknown>:0
at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
[patrick@Inigo] /Users/patrick/SourceCache/csharp/MvcApplication$
I used this generator to scaffold a Nancy application. I ended up with something that could be run (k kestrel
) but not built (kpm restore; kpm build
). It couldn't find the Nancy namespace when building.
I looked at @jchannon's generator-nancy and tried it out. It produced a seemingly healthier scaffold which I can both run and build successfully.
Why not incorporating generator-nancy into this project?
Generator should have an option to bypass the type
questions
--web
- Web template
--webapi
- Web API template
--empty
- Empty template
--nancy
- Nancy template
--console
- Console template
--classlib
- Class Library template
Usage would the allow for CLI to pass name and option of the type i.e.
yo aspnet [name] --[type]
Now that we have updated the generators for beta3
we should write a blog post announcing the updates and post it on the official ASP.NET team blog.
I'd like to give @spboyer the first chance to be the author on that since he was the main contributor for the updates. If he is not interested then I'd like to see if anyone else is.
When generating a controller or view should there be an option for creating the other?
i.e.
yo aspnet:MvcController MyController -v
generates
MyController.cs & MyController.cshtml
also/or perhaps adding the additional option for names or conventions?
yo aspnet:Mvc -c MyController -v MyView
generates
MyController.cs & MyView.cshtml
Shouldn't NPM package.json
keywords
section be modified to include additional search terms others then default one? Adding 'asp.net' and 'vNext' will certainly help NPM search engine to retrieve package I think:
https://www.npmjs.com/search?q=generator+asp.net
Not listed at all for above query though being primary generator for ASP.NET
We should update the project templates to match what we have in VS 2015 CTP6. I briefly spoke to @spboyer and he is investigating this. Will assign the item to him for now. Shayne if you need help let us know.
We are publishing with Sourabh's account, we should instead push using Sayed's account
This is a cross-reference to the issue on home project (no pun intended) of source the code for HomeController.cs
from the MVC sample:
Compiler warning (level 2) CS0108 in HelloMVC based projects #253
Running kpm build
shows the user some CS**** warnings, class related structure/design problems, etc. It would be better to avoid such code in boilerplate templates for users (some of them could be quite new to C#/vNext).
I think we could go with fixing template without waiting for original project issue fix (eventually updating relevant template accordingly to home project future changes).
I don't know if this is on my machine only. I am not experienced enough with the node package manager. I run windows 8.1 x64 by the way. This is my output of npm install -g yo generator-aspnet:
npm http 304 https://registry.npmjs.org/semver
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\lodash
'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_m
odules\lodash']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\lodash' }
npm ERR! Error: No compatible version found: chalk@'^0.4.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0","0.5.0","0.5.1"]
npm ERR! at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:719:10)
npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:638:10
npm ERR! at RegClient.get_ (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.
js:105:14)
npm ERR! at RegClient. (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-client\l
ib\get.js:41:12)
npm ERR! at fs.js:266:14
npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:103:5
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! EEXIST, mkdir 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\shelljs\scripts'
File exists: C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\shelljs\scripts
Move it away, and try again.npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\shelljs\scripts
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\shelljs\scripts\run-tests.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:171:23
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\mkdirp\index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\request
.npmignore'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\request.npmignore
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\request.npmigno
re
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\lodash.
debounce\README.md'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\lodash.debounce\README.m
d
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\lodash.debounce
README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/commander
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\object-
assign\object-assign.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\object-assign\object-ass
ign.js
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\object-assign\ob
ject-assign.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-generator\lib\actions
\install.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-generator\lib\actions\install.js
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-generator\lib\actions\install.
js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/abbrev
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\configs
tore\configstore.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\configstore\configstore.
js
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\configstore\conf
igstore.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 200 https://registry.npmjs.org/colors
npm http 200 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/colors/-/colors-0.6.2.tgz
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\async\lib\async.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\async\lib\async.js
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\async\lib\async.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/commander/-/commander-2.1.0.tgz
npm http 200 https://registry.npmjs.org/colors/-/colors-0.6.2.tgz
npm http 200 https://registry.npmjs.org/commander/-/commander-2.1.0.tgz
npm ERR! Error: ENOENT, lstat 'C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\lodash\lodash.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "-g" "yo" "generator-aspnet"
npm ERR! cwd C:\Users\JP\Desktop\testjp
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\lodash\lodash.js
npm ERR! fstream_path C:\Users\JP\AppData\Roaming\npm\node_modules\yo\node_modules\lodash\lodash.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http GET https://registry.npmjs.org/yosay
npm http 304 https://registry.npmjs.org/yosay
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\JP\Desktop\testjp\npm-debug.log
npm ERR! not ok code 0
as the log suggested, I have reported this issue to the node github npm/npm#6958 perhaps this has nothing to do with the yeoman aspnet-generator
I would like to combine my scaffolding with an ASP.net generator but that won't be possible unless there is some focus. Could you guys/gals create forks of the most popular templates so they can more concise in file structure and combined with other projects?
Thanks.
Create a gulp file that is equivalent to the grunt file for the web template. Make this an option like
yo aspnet --gulp
Currently index.js
pulls the latest from the master
branch.
I think we should change to this point to the release
branch instead so that changes are only picked up when we make a release.
Once we implement #26 this will be a moot point, but I think that may take some time.
I'm planning to switch index.js to point to release likely later today. If you have any concerns please reply here. We can always revert if needed.
We have a travis build which is currently configured on LigerShark/generator-aspnet we should create a new one that will publish from the release
branch (yet to be created) here.
I've managed to create and run vNext MVC ViewComponent - which is new and in my opinion undocumented fully upcoming feature:
https://gist.github.com/peterblazejewicz/b5915283a5ff23d468a6
http://www.asp.net/vnext/overview/aspnet-vnext/vc#intro
As there is not much documentation yet I'm not perfectly sure what is the best approach to write ViewComponents - but having simple example would be tremendous help. For example one that just uses view component class + view with static content, with no dependency injection, but with some insight from components authors in the boilerplate comment.
As far as I understand using ViewComponent requires a minimum two files:
/Components/MyComponent.cs
/Views/Shared/Components/MyComponent/Default.cshtml
We could generate them with:
yo aspnet:MvcViewComponent MyComponent
I could be wrong - but I think ViewComponent scaffolding is not yet covered in other tools as well.
I've created a PR here:
#56
to fix other issue: #55
We need a more user friendly error message, communicating what user should do (and then repeat running generator ofc).
At the moment my PR contains a code that shows generic Node JS error, like:
✖ { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }
I could update PR or we could just make a change later with separate PR.
Thanks!
The following fail with an error message, the error message is similar in all cases and I've included a sample from one invocation. If these generators require a file name can we make that clear in the error message? Could we also make it more clear in the help that's provided via --help
? If there are cases where we can default the name lets do that as well. For example HTMLPage can just create index.html
by default. Then if users invoke it and want a different name they can just do a mv
command.
Sayeds-MacBook-Pro:MvcApplication sayedhashimi$ yo aspnet:JScript
events.js:72
throw er; // Unhandled 'error' event
^
Error: Did not provide required argument name!
at NamedGenerator.argument (/Users/sayedhashimi/Documents/mycode/generator-aspnet/node_modules/yeoman-generator/lib/base.js:260:31)
at NamedGenerator.module.exports.Base.extend.constructor (/Users/sayedhashimi/Documents/mycode/generator-aspnet/node_modules/yeoman-generator/lib/named-base.js:20:10)
at NamedGenerator (/Users/sayedhashimi/Documents/mycode/generator-aspnet/script-base.js:8:31)
at new NamedGenerator (/Users/sayedhashimi/Documents/mycode/generator-aspnet/JScript/index.js:7:13)
at Environment.instantiate (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:270:10)
at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:247:15)
at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:306:24)
at /usr/local/lib/node_modules/yo/cli.js:110:9
at Environment.resolver.lookup (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/resolver.js:49:32)
at init (/usr/local/lib/node_modules/yo/cli.js:86:7)
I wonder if web application
type of project should contain webroot
key:
https://github.com/OmniSharp/generator-aspnet/blob/master/samples/web/project.json
The mvc application
project file contains relevant key:
https://github.com/OmniSharp/generator-aspnet/blob/master/samples/mvc/project.json#L2
The articles on vNext project states that VisualStudio generated template does contain webroot
key:
http://blogs.msdn.com/b/webdev/archive/2014/10/06/asp-net-vnext-in-visual-studio-14-ctp-4.aspx
http://www.asp.net/vnext/overview/aspnet-vnext/grunt-and-bower-in-visual-studio-2015
but I'm not sure about this - is that required or just advised.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.