how to install bower.json and package.json dependencies osx - macos

Visual Studio automatically tracks changes in bower.json & package.json whenever you make changes & save the file. It automatically track new changes. But how would I do it on Visual Studio Code on OSX not sure.
I looked a lot on internet but there are absolutely no resource for dotnet core developers(on osx, linux) on internet. Neither Microsoft has anything mentioned in there documentation.
I have added font-awesome dependency in bower.json

There is a 3rd party bower extension for Visual Studio Code that lets you run the commands more easily from the editor rather than from the terminal, but bower for vs code is not as integrated as it is in Visual Studio.
For general help with dotnet and OSX there are some tutorials using vs code on learn.microsoft.com though not many. The docs site is open source in an effort to encourage community contributions on docs for scenarios like this one.

Related

What are the differences among npm, NuGet and Marketplace download options for Typescript?

I use VS pro at work and I am 100% typescript (and React and Node...) beginner dev. I am also trying to understand how all these things work together, why I'd need a given tool etc, not just copying CLI commands and code lines into files.
Here I found there are 3 different sources to download typescript: npm, NuGet and VS Marketplace.
My guess is npm and NuGet are the same thing just published to different repos but the bits from the Marketplace are always mandatory. Is that correct?
If not, what are the differences among them? I am confused.
What are the differences among npm, NuGet and Marketplace download options for Typescript?
What you understand is correct. npm and nuget are two tools for managing libraries. TypeScript provides source for two different tools. Just like you said, they are in the different repos and the way to get them is different also (one is via npm and another is nuget).
For the VS Marketplace, This is another way to get the TypeScript, integrating the TypeScript into the Visual Studio through Visual Studio extension, which has nothing to do with the way of managing the libraries.
So, What you understand is correct.
Hope this helps.

Visual Studio 2017 Grunt tasks

I recently moved to VS2017 and, it turned out I cannot make Grunt tasks work. Node is installed along with Grunt packages, Grunt task is also defined, but Task Runner Explorer in Visual Studio doesn't see it (screenshot is attached):
Hmm... from the documentation for that plugin a known issue is: "Projects inside nested solution folders aren't supported yet". So, my guess is that you won't be able to use this in your current structure given the location of your Gruntfile.js. You could try to confirm this by placing that file in the project root directory.
I happened to have a Gruntfile.js in the parent folder of my projects: 'source', and VS reads it by default. I started using Grunt out of frustration with the WebCompiler extension that is now severely broken in VS2017, and doesn't show signs of being updated anytime soon. I just started using grunt outside of VS to compile my sass and bundle/minify my js, which can be frustrating for my other team members. Anyway, I noticed VS2017 automatically picks up that Gruntfile, even though it's not even in the solution folder for my project. For my non MS projects, that's how I have it set up, because I don't want that insane node-modules folder jungle to end up in my git repo. It's super frustrating that MS now wants us to use open source tools in our projects. Us modern front-end devs are in limbo with sass or scss precompilers.

How to use ECMAScript 6 syntax with Visual Studio 2013

I am interested in using ECMAScript 6 features in my web application which I am developing using Visual Studio 2013. Currently the syntax does not seems to be working, How can I configure VS to make it work?
If you have Resharper installed in your VS 2013 - from today on you can switch to using ES6:
What I've done for the past few years for my VS solutions is to have the latest version of node.js installed.
From there, I whould create an _buildscripts directory with a package.json file. (NOTE: make sure to set private:true in your package.json)
With that in place I will have a prebuild.cmd (setup as a pre-build script for my project) with something similar to the following...
:CHANGE_TO_CURRENT_DIRECTORY
rem Change to this batch file's drive/directory
CD /D "%~dp0"
:INSTALL NODE DEPENDENCIES AND INSTALL - use call, since it's a batch/cmd file
call npm install
:SET YOUR "start" SCRIPT IN package.json TO BE YOUR BUILD
: such as .... "start":"gulp"
call npm start
From here, you can setup gulp, traceur, browserify and/or another tools targeting newer javascript concepts.
I'm using git, so detecting new/updated files is far easier than with TFS, but you can script at least the checkout of your output directory for transpiled JavaScript.
You can also use something like watchify or gulp-watchify for hanling live edits (via a terminal window).
I realize this answer takes you well outside of VS's integrated tooling, there are some integrated tools, like chirpy and others that do these sorts of things, but my experience is they have be sub-par for my needs, and I've been doing more node development lately.
Seems like the best we can do is to vote for es6 support.
It's strange for me but Web Essentials also doesn't povide ES6 support yet.
As for me I've disabled syntax errors for js files in my VS. Not ideal but at least less eye distracting.

Create a new TypeScript project in Visual Studio

How do I start writing TypeScript projects in Visual Studio? There's no option for it when I create a new project. I have Visual Studio 2012 installed along with the TypeScript add on
I just found the solution: Manual installation of the VS-Extension.
In some way, the VS-Extension is not getting installed. You can do it manually. There is a .vsix file located in C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.8.0.0 called TypeScriptLanguageService.vsix.
Try to run this file. It should install the TypeScript extension.
If you are running an x86-based system, try to look at C:\Program Files\Microsoft SDKs\TypeScript\0.8.0.0.
Worked for me. Now I can create TypeScript projects and it is listed in the Visual Studio extension list.
Note that the newer versions of TypeScript dropped the folder 0.8.0.0. You may find the .vsix file in C:\Program Files (x86)\Microsoft SDKs\TypeScript.
You can add TypeScript files to an existing project using the Add > New Item dialog.
You can also create a project of type HTML Application with TypeScript using the Add > New Project dialog. This project type is under Installed->(Templates)->Visual C#.
If these options are missing from Visual Studio, you should try re-installing the TypeScript Visual Studio plugin.
If you use Visual Studio 2017, the template 'HTML Application with TypeScript' has been removed from the templates.
But you can install the extension made by rich-newman on Github: https://github.com/rich-newman/typescript-html-application-vs2017-template
To install it do the following:
Go to the 'Add New Project' window
At the left go to 'online' in the left tree view
Search for 'TypeScript HTML Application Template'
Install the extension and the template should be available under 'installed --> TypeScript'
Followed the other answers but could not locate TypeScriptLanguageService.vsix after installing TypeScriptSetup.0.8.0.msi on Win7 64 w/ VS 2010.
To install on VS 2010, use 7zip to open the above msi and extract "TypeScriptLS.vsix_File", remove the trailing _File, and run as usual.
This gives a new TypeScript project template (but not a file template mysteriously), intellisense, code highlighting, etc.
I didn't have the project and ts file templates also, tried reinstalling it(just by running vsix file) that didn't help, so I
1. uninstalled(from the VS2012 manager) the extension
2. closed VS2012 and then installed it again and voila-
the Project and file template magically appeared. Thank god it worked- I can start playing with the language without having to run transcompilation manually every time.
Installing typescript adds a new project type as well as adds a file type for existing projects. After installing typescript, you can try searching "typescript" in the new project window. It shows "HTML Application with TypeScript" to me.
Every .ts file typescript file will add a dependent .js file.
Hope this helps!
Old post, new suggestion:
I've spent a few hours on this issue on Win8/VS2012. After multiple install/reinstall (of Typescript plugin v 0.8.3), the one thing that worked, was to run VS2012 in Administrator mode and (re)install Web Essentials 2012. That did the trick for me and I got Typescript as it's own section in Add New Project... (and all the other goodies mentioned above).
What reminded me of the run in admin mode was the process to update documentation (if you want to install documentation locally) where it too had an annoying cryptic error. Running in admin mode was also the answer.
You don't have to run in admin mode all the time, just probably a good practice when updating the IDE itself (new plugins, etc.).
For version 0.9.1.1 I was able to make it work following the instructions here: http://typescript.codeplex.com/wikipage?title=Compile-on-Save.
Support for Typescript was just disabled on Web Essentials 2012 3.0: http://vswebessentials.com/changelog
Another tip - you need to install Visual Studio for Web. It will not work with just VS for Desktop. Also, you need to install the plugin after VS, so if you installed the plugin first, uninstall it then reinstall.
I spent days on this issue too. Eventually found this (very old) answer. Didn't quite help. I have VS 2022 and under Extensions/ Manage Extensions, searched for Typescript and found 'Typescript HTML Application Template'. Downloaded it, created project from it, set the start page and it all seems to work :-)
It was also a simple matter to add a tsconfig.json file. (Not forgetting to put a "dom" in the "lib" line: Mine was
"lib": [ "es6", "dom" ],

Typescript not installed in VS2012? [duplicate]

How do I start writing TypeScript projects in Visual Studio? There's no option for it when I create a new project. I have Visual Studio 2012 installed along with the TypeScript add on
I just found the solution: Manual installation of the VS-Extension.
In some way, the VS-Extension is not getting installed. You can do it manually. There is a .vsix file located in C:\Program Files (x86)\Microsoft SDKs\TypeScript\0.8.0.0 called TypeScriptLanguageService.vsix.
Try to run this file. It should install the TypeScript extension.
If you are running an x86-based system, try to look at C:\Program Files\Microsoft SDKs\TypeScript\0.8.0.0.
Worked for me. Now I can create TypeScript projects and it is listed in the Visual Studio extension list.
Note that the newer versions of TypeScript dropped the folder 0.8.0.0. You may find the .vsix file in C:\Program Files (x86)\Microsoft SDKs\TypeScript.
You can add TypeScript files to an existing project using the Add > New Item dialog.
You can also create a project of type HTML Application with TypeScript using the Add > New Project dialog. This project type is under Installed->(Templates)->Visual C#.
If these options are missing from Visual Studio, you should try re-installing the TypeScript Visual Studio plugin.
If you use Visual Studio 2017, the template 'HTML Application with TypeScript' has been removed from the templates.
But you can install the extension made by rich-newman on Github: https://github.com/rich-newman/typescript-html-application-vs2017-template
To install it do the following:
Go to the 'Add New Project' window
At the left go to 'online' in the left tree view
Search for 'TypeScript HTML Application Template'
Install the extension and the template should be available under 'installed --> TypeScript'
Followed the other answers but could not locate TypeScriptLanguageService.vsix after installing TypeScriptSetup.0.8.0.msi on Win7 64 w/ VS 2010.
To install on VS 2010, use 7zip to open the above msi and extract "TypeScriptLS.vsix_File", remove the trailing _File, and run as usual.
This gives a new TypeScript project template (but not a file template mysteriously), intellisense, code highlighting, etc.
I didn't have the project and ts file templates also, tried reinstalling it(just by running vsix file) that didn't help, so I
1. uninstalled(from the VS2012 manager) the extension
2. closed VS2012 and then installed it again and voila-
the Project and file template magically appeared. Thank god it worked- I can start playing with the language without having to run transcompilation manually every time.
Installing typescript adds a new project type as well as adds a file type for existing projects. After installing typescript, you can try searching "typescript" in the new project window. It shows "HTML Application with TypeScript" to me.
Every .ts file typescript file will add a dependent .js file.
Hope this helps!
Old post, new suggestion:
I've spent a few hours on this issue on Win8/VS2012. After multiple install/reinstall (of Typescript plugin v 0.8.3), the one thing that worked, was to run VS2012 in Administrator mode and (re)install Web Essentials 2012. That did the trick for me and I got Typescript as it's own section in Add New Project... (and all the other goodies mentioned above).
What reminded me of the run in admin mode was the process to update documentation (if you want to install documentation locally) where it too had an annoying cryptic error. Running in admin mode was also the answer.
You don't have to run in admin mode all the time, just probably a good practice when updating the IDE itself (new plugins, etc.).
For version 0.9.1.1 I was able to make it work following the instructions here: http://typescript.codeplex.com/wikipage?title=Compile-on-Save.
Support for Typescript was just disabled on Web Essentials 2012 3.0: http://vswebessentials.com/changelog
Another tip - you need to install Visual Studio for Web. It will not work with just VS for Desktop. Also, you need to install the plugin after VS, so if you installed the plugin first, uninstall it then reinstall.
I spent days on this issue too. Eventually found this (very old) answer. Didn't quite help. I have VS 2022 and under Extensions/ Manage Extensions, searched for Typescript and found 'Typescript HTML Application Template'. Downloaded it, created project from it, set the start page and it all seems to work :-)
It was also a simple matter to add a tsconfig.json file. (Not forgetting to put a "dom" in the "lib" line: Mine was
"lib": [ "es6", "dom" ],

Resources