How to setup a modern js LIBRARY project in Visual Studio - node.js

I am looking at how to setup a modern js library project (npm + react + typescript + webpack, etc) with Visual Studios 2019. Note that I don't want this project to be executable (as all of the built-in project types appear to be...). What I want is for the build process to produce bundle(s) which will ultimately be uploaded to Azure Storage and deployed via Azure CDN. Right now I'm just focusing on how to setup the project so that it will produce a bundle(s).
Is there a built-in project type suited to this that I'm missing? Or do I need to use Visual Studio Codes for this type of work? Preferably I'd like to stick with Visual Studio 2019 rather than introduce another IDE if I can help it.
Thanks!

Related

Is it possible to use the ServiceStack templates in Visual Studio 2017 or 2019?

Is it possible to use the ServiceStack templates in Visual Studio 2017 or 2019? I've seen the documentation reference VS Code. I'm able to run the projects in VS 2019. If there is a place ask ServiceStack, I haven't found it yet.
All ServiceStack Project Templates should work in Visual Studio, eventually all .NET Core projects will be upgraded to use .NET Core 3.1 LTS when it's released where you'll need to use VS 2019.
But most of the Single Page App Templates utilizes npm utils to provide web transformations and each SPA Framework has unique formats like Vue's SFC's, React JSX and .svelte templates which are poorly supported in Visual Studio, you'll have a much better development experience using either VS Code or JetBrains Rider with first-class support for these formats and much better Terminal integration to run watched npm utils.
If I needed to use Visual Studio I'd only use it for all back-end C# development whilst using VS Code for all front-end development and running built-in npm utils in its multi terminal window support.
Otherwise for non SPA project templates using Visual Studio should provide a good development experience.
If there is a place ask ServiceStack, I haven't found it yet.
If you're asking if there's a specific place to ask ServiceStack questions, you can use the ServiceStack Customer Forums.

Should I use empty website or spa web application template for an Angular 2 project in Visual Studio?

For an angular project every tutorial on web, indicates to use Visual Studio Code. I am familiar with visual studio environment for like ten years besides there will be more project in my solution. Visual studio code is fine for an angular project but what about other projects in my solution? like services or class libraries.
So i decided to use visual studio 2017 rather than visual studio code. But i couldnt decide which template to choose for angular project, a website or spa template? And is there a way to run an angular project on nodejs just clicking run button.
I would really recommend using the Angular CLI if possible. The CLI adds tooling for testing and AOT among other things that will save you a lot of time in the future.
here is an article about using the CLI with Visual Studio in an MVC app it may give you more info on specifics that you have.
http://candordeveloper.com/2017/04/12/how-to-use-angular-cli-with-visual-studio-2017/
There are some excellent custom templates available for Visual Studio. I personally use this one for Visual Studio 2015. However, I am sure it would work for Visual Studio 2017.
https://marketplace.visualstudio.com/items?itemName=Drag13.Angular2WebTemplate
You can try out the new templates available via "dotnet new" such as "dotnet new angular" You can find out more here: https://dotnetcore.gaprogman.com/2017/04/20/dotnet-new-angular-single-page-application-setup-and-how-the-template-works/

Can you create an Azure Functions from Visual Studio Mac?

I don't see the option to create an Azure function class library template in new projects under Visual Studio Mac. If I created one manually - what files do I need to include and what framework target should I use for the library? .net core or .net standard or something custom?
Alternatively - if I use a CSX script file instead, how would I debug that on a mac?
Azure Functions support for Visual Studio for Mac is available in the alpha channel, so you need to switch to that in order to use this functionality.
The tooling there is similar to what is available for Visual Studio 2015, supporting CSX based projects (as opposed to pre-compiled, class library projects) and giving you a local run/debug experience.
In Visual Studio Mac 7.2 this feature was moved into an extension. Just open the extension manager - search for "functions" and you can install that feature again.

Using Visual Studio 2015 for existing node-js client-side web projects

I have a team working on a client-side node.js application. The sources are stored in a source control. I'd like to modify and debug this application in Visual Studio 2015. They use other IDEs, and I would not like to add additional VS-specific files such as .sln to source control.
I'm able to clone the repository, create a separate empty solution and add the repository as an "Existing Web Site". However, Visual Studio do not recognize package.json, and do not install dependencies as it would for MVC6 projects. Consequently gruntfile.js would not work either.
Is there any way to make Visual Studio see and process package.json, or I'm on a wrong track here?
Instead of using the "Existing Web Site" option, create a new solution and add items to it. Web Site Projects types are a different, legacy project type.

How to add TypeScript to Visual Studio 2012 ASP.net web forms web-site?

I'm trying to add TypeScript to an existing:
web-site (not a web-application)
web forms (not MVC)
Visual Studio 2012
I think, at a fundamental level, the problem is that an ASP.net web-site has no project. This means there is no ability to define "Build options". An ASP.net web-site cannot declare that a *.ts file should have a build action of Compile, since without a project file there are no build actions.
Obviously i'm not going to convert to a web-application (due to the unresolvable disadvantages of a web-applications).
Having said that, how do i add TypeScript to an:
ASP.net
web-site
web-forms
Visual Studio 2012
solution?
Bonus Reading
Using TypeScript in an existing Visual Studio Web Site project (web-application)
How do I add typescript to an existing Asp.Net MVC project? (mvc web-application)
typescript for web forms (web-application)
Converting existing JavaScript code to TypeScript in Visual Studio (web-application)
You can simply add typescript files to the project and manage the compilation externally (outside of visual studio) using something like grunt-ts https://github.com/basarat/grunt-ts (disclaimer : I am one of the authors)
You can add a *.ts file to the web folder, then run the ts compiler from the command prompt.
Or create a separate web app with just the TS file. Then in the build properties, add a command to copy it to the desired location.

Resources