Replicating libman unpkg with a local filesystem

1k views Asked by At

I noticed I can use libman to download many libraries into my Asp.Net Core app in a nice way. E.g. I can easily get the latest @microsoft signalr:

libman-unpkg

However, in my application I can't rely on external package sources and would like to store the packages I need within my network. I noticed that libman supports "filesystem" mode, so I copied all the files downloaded from unpkg onto my local network drive, let's call it "L:"

/ L:
  | local_unpkg
     | @microsoft
       | signalr
         | 5.0.2
           | package.json
           | README.md
           | src
             | ... // a lot of files
           | dist
             | browser
             | cjs
             | esm
             | ... // other subfolders

When I try using "filesystem" provider, I get only the files in directly in the folder I specify, without nested folders:

unpkg_local

Is there a way to import entire packages that way, without manually specifying all the subfolders in the libman.json file?

If not, what's the recommended approach for using the tool in an environment, when I don't want to rely on external package sources?

1

There are 1 answers

1
Jimmy On BEST ANSWER

The filesystem provider specifically does not support recursive directory contents. With the other providers, the contents of the package are available all at once via the catalog metadata. But with file paths, and especially network file paths, iterating the file system can lead to extremely poor performance in large (or deep) directory structures. In many cases, you'd be typing out the path and the wizard would try to evaluate the contents as you type (e.g. once you typed L:\ it would recognize that directory and enumerate all its contents recursively, over the network).