Giter VIP home page Giter VIP logo

packman's Introduction

Client-Side Library Installer

Build status

Download the extension at the VS Gallery or get the nightly build.

See the changelog for changes and roadmap.


A simple solution to installing JavaScript and CSS libraries into any project. It uses well established global content delivery networks that hosts thousands of the most popular libraries.

Because it uses these content delivery networks as data source, it allows the user to be in total control over where to install the packages and what files to install. The user is in complete control of what is added to the project.

Reasons for using this extension

  1. For apps not currently using another package manager
  2. For projects where you think Bower and npm are overkill
  3. For developers that don't want to use Bower or npm
  4. For developers that values simplicity in their tools
  5. For using custom or private packages/files
  6. For ASP.NET Core apps where NuGet can't install content packages

Reasons for NOT using it

  1. Developer/team likes using Bower and/or npm
  2. For apps that uses WebPack or Browserify for module loading/bundling
  3. For app types where NuGet works just fine

Features

  • Fastest library installer in the world
    • Libraries installs take just milliseconds
  • Contains all the relevant client-side libraries
  • Always up-to-date with the latest versions
  • Can install libraries into any folder
  • Only installs the files you need and nothing else
    • Unlike Bower and npm that installs many extra files
  • Great Visual Studio integration
  • Is based on existing CDN infrastructure
  • Work in all Visual Studio projects types
    • Including ASP.NET, Cordova and Universal Windows Apps

Installing a library

Right-click any folder in your project and hit Add Client-Side Library...

Install package

This brings up the package installer dialog.

Dialog Open

You can now search for the thousands of available packages.

When you find the right package, the version dropdown populates to the latest stable version of the package.

Dialog Treeview

The tree view shows what files are available and will preselect the file(s) that it thinks you may want.

Place files in their own folder

By checking this checkbox, a folder with the same name as the package will be created and all the package files will be added to that folder.

This option is checked by default.

The manifest files

A main difference between this extension and package managers is that a manifest file is not needed at all in order to install packages.

NuGet uses packages.config, Bower uses bower.json etc.

This extension uses an optional file called packman.json.

If you don't check the Save manifest file checkbox, it will just add the library files to the selected folder, but not keep a record of it anywhere. This is essentially the same as going to a library's website and manually downloading the files and copying them into your project.

It's important to note that library restore will not be possible without a manifest file.

The format of the manifest file is simple and easy to understand.

packman.json

If you want to modify the manifest file manually, full Intellisense is provided for package names, versions and file names.

Intellisense

You only get Intellisense for file names if the version property exist and has an accurate value.

Custom URLs

You can create custom libraries that will download files at any URL you specify. To do that, open packman.json and add a custom entry like so:

"my-custom-package":{
  "path": "output/custom",
  "urls": [ 
    "http://example.com/file.js",
    "http://example.com/file.min.js"
  ]
}

Then simply restore the libraries to download and add the files to your project.

Restoring packages

It's very easy to restore libraries. Just right-click the packman.json manifest file and select Restore packages.

Package restore

This will hydrate your project with the files from all the libraries listed in packman.json.

Library restore will also happen every time you save packman.json. This behavior can be disabled in the options dialog.

Options

An options page is available in the Visual Studio options dialog.

Options

From here you can set various settings including which provider to use - JsDelivr or Cdnjs.

License

Apache 2.0

packman's People

Contributors

madskristensen avatar mlorbetske avatar scottaddie avatar

Stargazers

grip avatar Tau Dang avatar Ganeshan Venkataraman avatar  avatar Nick Kotin avatar tangdf avatar Rick Strahl avatar Natraj Yegnaraman avatar Luka Jerković avatar  avatar Jordan Ephron avatar  avatar Luke Kolodziej avatar Rob Siera avatar Postlagerkarte avatar David Schwartz avatar Steven Moschidis avatar James Messinger avatar Rob Howarth avatar Carlos Alberto Costa Beppler avatar Marcus R. Brown avatar Jared Thirsk avatar Mordechai Zuber avatar Shmueli Englard avatar Thomas L. Kjeldsen avatar Chad Tolkien avatar ricecookie avatar Jaime avatar

Watchers

Thomas Ardal avatar James Cloos avatar  avatar  avatar Quinntyne Brown avatar Isaac Levin avatar  avatar  avatar

packman's Issues

Remove files on new versions

It would be nice if files that are not in a package anymore, would be removed automatically.

E.g. upgrading from jQuery 2.2.0 to 2.2.3 on CDNjs right now, removed the file jquery.min.map and adds the file jquery.slim.js. However, jquery.min.map is not removed from the project.

Deprecate repo?

Since this is being reworked here, maybe we should mark this Extension as deprecated

How can I install Angular2 ?

Installed product versions

  • Visual Studio: [example 2015 Professional]
  • This extension: [example 1.1.21]

Description

Replace this text with a short description

Steps to recreate

  1. Replace this
  2. text with
  3. the steps
  4. to recreate

Current behavior

Explain what it's doing and why it's wrong

Expected behavior

Explain what it should be doing after it's fixed.

Make search more friendly

Search result order should be:

  • Exact name match
  • Begins with
  • Contains all parts
  • Contains all but one part
  • ...
  • Contains any part

Add the ability to have aliases

  • All packages with unspecified aliases should default to having an alias of the given package name
  • Search should operate on the aliases not the package names
  • Highlighting should still be done in the given package name.

Enhancement request: Add Referenced Client Side Libraries

There's an Add Client-Side Library... option that allows me to manually add files from libraries.

What I'd love it to do is to search my .cshtml files for CDN references, and add the referenced files to packman.json, as well as any relative dependencies (e.g. fonts or images included with url()).

Bonus points if it grabs both the min and non-min versions so I can develop locally with the non-min versions and publish the min versions.

Package not updated

Installed product versions

  • Visual Studio: 2015 Enterprise
  • This extension: 1.2.117

Description

Installing jQuery does not get all files, and one of them have wrong content

Steps to recreate

Add the following to packman.json and save:

    "jquery": {
      "path": "lib/jquery",
      "version": "2.2.3"
    },

Current behavior

It fetches the files

  • jquery.js
  • jquery.min.js
  • jquery.slim.js

Expected behavior

It should fetch the files

  • jquery.js
  • jquery.min.js
  • jquery.min.map
  • jquery.slim.js
  • jquery.slim.min.js
  • jquery.slim.min.map

I have tried deleting ~/.packman, but no difference.

Note, however, that this issue might be dependent on CDNjs issue 7617

Better processing of packages

I have a rather large packman.json file, and saving it or restoring packages takes ages.
The UI (VS 2015) also becomes unresponsive.

First of all, I think something should be placed in a background thread so the whole UI doesn't freeze.

Next, I imagine the following could speed the whole process it up:

  1. When installing a package, add a file in the install directory, with the installed package name and version number.
  2. Upon saving packman.json, when running through the packages, check for correct package name and version number in existing install directories, and if it doesn't match, delete the directory content and copy.

I believe this would reduce the number of necessary file operations drastically.

Upgrade overview

It would be awesome if you could get a view which would look at your packman.json, show you an overview of the packages, and let you change/upgrade versions where available.

Not showing new releases without clearing cache

Installed product versions

  • Visual Studio: 2015 Enterprise
  • This extension: 1.2.130

Description

I've an installed package. When i open this extension and enter that package's name, the extension displaying the installed version, but i can't know about is there any new version of that package without visiting CDN's web page manually.
After i checked the extension's options, i found out that there is a cache folder. Then i deleted the contents of the cache folder, and tried same conditions, it worked this time! It showed me the latest version of that package.

Steps to recreate

  1. Install a package.
  2. When a new release has published, check package again.

Current behavior

It's still showing installed version of package (if i doesn't clear cache folder).

Expected behavior

It should be display latest versions (even if that package already installed).

Configure source in JSON

It would be nice if you could configure the source for packages in packman.json, and perhaps have a section per source and one for custom sources
It would:

  • naturally order your packages after source
  • save the trouble of explaining to new developers that they should change the settings of the extension
  • render the configuration unnescesary

VS Crashed when trying to add a library

Installed product versions

  • Visual Studio Enterprise 2015 14.0.25123.00 Update 2
  • Client-Side Library Installer: example 1.2.117

Description

Visual Studio is Crashing when I try to add a client side library.

Steps to recreate

  1. New or empty web project (.NET 4.5)
  2. create js folder
  3. right click js folder and click "Add client-side library..."
  4. popup window opens and VS crashes right after with messeges "Visual Studio Stopped Working" and then the "Restarting" popup).

I tried on different projects and solutions to see if the problems was with a specific project or .NET target, but got the same results. Haven't tried on other computers yet.

Here are the logs there were added to my EventLog when VS Crashed.

eventlog vs crash add client-side lib.zip

Package restore doesn't work in Visual Studio 2017 Community

Installed product versions

  • Visual Studio: 2017 Community
  • This extension: Client Side Library Installer 1.2.130

Description

Package restore doesn't work in Visual Studio 2017 Community.

Steps to recreate

  1. If packman.json doesn't exist, add any client-side library and save the manifest.
  2. Right-click packman.json
  3. Click Restore Package
  4. Look in output window for Client-Side Package Installer

Current behavior

13/03/2017 6:06:24 PM: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.JSON.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.JSON.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at PackmanVsix.PackageService.d__5.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at PackmanVsix.PackageService.IsValidJson(String file)
at PackmanVsix.PackageService.d__4.MoveNext() in C:\projects\packman\src\PackmanVsix\PackageService.cs:line 0

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Expected behavior

It should restore the files/packages listed in packman.json.

Search spinner

Use case:

  1. I know I am looking for angularjs, so I type that in the search field
  2. nothing happens
  3. I select the "version" dropdown
  4. The "version" dropdown is populated (yay)

As a user in step 2 I am not sure if the extension does something in the background or I have to move the cursor out of the input field before the extension begins to search.

If the extension does not search in step 2, then maybe it could do that after e.g. a 500ms type-ahead-delay. Additionally, there could be a spinner or similar to indicate when search is happening.

Ps: Kudos for making this extension! I have used it on a small project and so far it has proved to be an excellent alternative to npm/bower/grunt-copy.

Not installable on any currently installed products.

Installed product versions

  • Visual Studio: [2017 Professional - v15.7.6]
  • This extension: [v1.2.130]

Description

Searching for applicable products...
Found installed product - Global Location
Found installed product - ssms
Found installed product - Visual Studio Professional 2017
VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable1& skuData) at VSIXInstaller.App.Initialize(Boolean isRepairSupported) at VSIXInstaller.App.Initialize() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

Steps to recreate

  1. Downloaded installer
  2. Run vsix installer

Current behavior

This extension is not installable on any currently installed products.

Expected behavior

Install.

Is this going to be updated or is there an alternative?

Editing `packman.json` or restoring packages results in: Could not load file or assembly 'Microsoft.JSON.Core, Version=14.0.0.0, (...)' or one of its dependencies.

Installed product versions

  • Visual Studio: 2017 15.7.0 Preview 2 and 2017 15.6.4
  • This extension: 1.2.130
  • Projects targeting .NET Core SDK 2.1.4, 2.1.300-preview1-008174

Description

The extension is broken.

It will only download packages when they are added the first time. Restore packages or changing packman.json will always result in the error shown below in the Show output from: Client-side Library Installer window and nothing else.

Steps to recreate

  1. Install Client-Side Library Manager
  2. File, New Project, ASP.NET Web Application, .NET Core 2.1.
  3. Shift+Alt+8, popper, Save manifest file, Install
  4. Right click packman.json, Restore Packages.

I verified this happens in both versions of Visual Studio mentioned, with .NET Core 2.1 projects and 2.0, although I only tested VS 15.6.4 with a .NET Core 2.0 project.

Current behavior

3/31/2018 5:13:59 PM: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.JSON.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.JSON.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at PackmanVsix.PackageService.<IsValidJson>d__5.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at PackmanVsix.PackageService.IsValidJson(String file)
   at PackmanVsix.PackageService.<RestorePackagesAsync>d__4.MoveNext() in C:\projects\packman\src\PackmanVsix\PackageService.cs:line 0

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Expected behavior

Packages are restored.

Support for bower/npm as providers?

Can we have bower/npm aren't an option as providers? It would be very useful, specially when you want to get some source files normally not available on cdns.

Better sorting of version numbers

Installed product versions

  • Visual Studio: 2015 Enterprise
  • This extension: Newest

Description

Version numbers are sorted wrongly.

Steps to recreate

  1. Change the extension to use CDNJS
  2. Add the package bootstrap-markdown
  3. Add the version property
  4. Enter 2 so intellisense is activated

Current behavior

Two things are wrong with the list that is shown:

  1. The list is sorted alphabetically. This means that version 2.10.0 appears in the middle of the list, even though it is the highest version (see the below screenshot).
    packman_version_bug
  2. It is ordered lowest to highest. Usually you want the newest version, so the order should be highest to lowest.

Expected behavior

I'd expect it to sort newest version to oldest. Versions are usually
The .NET Version class could be useful for sorting correctly, However I'm not shure how it parses beta numbers and such.

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.