npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

check-vs-includes

v0.2.5

Published

Checks that your Visual Studio includes are in fine order

Downloads

94

Readme

CheckVSIncludes

TODO

  • Write Unit tests
  • Add clear usage example, also for Grunt

Using Visual Studio Web Deploy and had some nasty issues because files were not included in your project? Do you want to prevent this from ever happening again? Well I did, and because I couldn't find a generic solution to it yet - not even on Stack Overflow - I created this Node application.

How to use it

Gulp task

Create a 'gulpfile.js' in your project and add a task:

  var checkVSIncludes = require('check-vs-includes');
  ...

    gulp.task('check-vs-includes', function(cb) {
        checkVSIncludes(['/Content/**/*.less', '/app/**/*.js']);
    });

This example checks that all .js and .less files in the specified folders are included in your project file. Notice you can use a globs /Content/**/*.less to specify to take all files in the directory but also all those in any subdirectory, subsubdirectory etc.

Set working directory

Optionally you can specify an options object as a second parameter with for instance an alternative working directory cwd. You coders can check the source code on GitHub; pull requests are very welcome. The first contribution was already made, great work Thomas!

        checkVSIncludes(['/less/*.less', '/js/**/*.js'], { cwd: 'myapp.web'} );

Specify explicit project file

For Node developer .nsproj are also support. The app will autodetect the .csproj file in the specified folder, and check all the 'physical' files in the folder against this. If autodetection doesn't work, you can also specify an explicit .csproj filename via a third parameter. For instance if there are two .cspoj files in the folder (an old backup version or something):

gulp.task('check-vs-includes', function(cb) {
    checkVSIncludes('/Content/**/*.css', { }, 'MyApp.Web.csproj');
});

Notice in this example that for the first parameter instead of an array of strings you can also specify a single string. Beware of specifying *.* (or **/*.*) especially if your project includes a node_modules folder, as these can contain A LOT of files/folders and will slow down the check or even cause a 'hang'.

Grunt task

I don't know, I'm not a gruntee :P. But input is welcome!

Command line

STILL TODO Allow running check-vs-includes on the command line. Then you could run it after doing a global install. I'm yet to get better acquanted with yarg

When to use it?

When your project uses Visual Studio's Web deploy it is necessary that every file that needs to be deployed is included in Visual Studio. E.g. in the project file (.csproj file as used by VS internally). But sometimes files can be missing, for instance when there is a developer in your project who doesn't use Visual Studio as (main) IDE. You the real frontend developers often prefer Atom, Brackets, Sublime or one of those other hip editors.

But even with only Visual Studio afficionado's in your team, files can be missing due to merging the .csproj files for instance with GIT, and then lazily choosing. The project is running fine on your localhost, but after you deploy, things can go haywire. Once this happens a manager might insist to add a bullet point in your deploy scrip to check that all files are included. But if you're working on a project of any real-life size this means you'll have to manually open 100 folders or more.

What do you mean with 'includes'?

Visual Studio (VS) - Microsoft's main IDE - organizes it's files into a solution, and a solution consists of one or more projects. As most VS developers will know all the files that are included in the project are listed in the internal .csproj file. This is simply an XML file.