Giter Site home page Giter Site logo

Comments (6)

acinep avatar acinep commented on May 26, 2024 4

I like defaultDestination, and the use of the library name if nothing else is provided. This is pretty much what we used to have with PackMan and worked great.

from librarymanager.

justcla avatar justcla commented on May 26, 2024

Thanks for the input @acinep .

But should defaultDestination be used as a prefix to the destination of the library (whether provided explicitly or defaulted to the library name)?

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "defaultDestination": "/wwwroot/lib",
  "libraries": [
    {
      "library": "[email protected]",
    },
    {
      "library": "[email protected]",
      "destination": "otherlibs",
    },
    {
      "library": "[email protected]",
      "destination": "/foobar",
    }
  ]
}

Question 1:
In the example above, which folder would the "barlib" files go to?
a - "/otherlibs" (current behavior)
b - "/wwwroot/lib/otherlibs" (defaultDestination prefixed to explicitly set relative destination)

(separately)
Question 2:
Which folder would the "foolib" files go to?
a - "/wwwroot/lib" (current behavior)
b - "/foolib" (default to library name)
c - "/wwwroot/lib/foolib" (defaultDestination prefixed to default library name)

Question 3:
Which folder would the "foobar" files go to? (Note the destination start with "/")
a - "/foobar" (current behavior)
b - "/wwwroot/bin/foobar" (defaultDestination prefixed to explicitly set root path)

from librarymanager.

justcla avatar justcla commented on May 26, 2024

Or should we introduce a new property for the destination prefix?

from librarymanager.

mattfraley1 avatar mattfraley1 commented on May 26, 2024

If defaultDestination is prefixed in both cases, question 1 & 2 above, then you wouldn't be able to dump a file directly lib folder such as /wwwroot/lib/coollib.js. I suppose you could specify destination as /wwwroot/lib.

I guess developers either want their libraries in library subfolders or they don't. Maybe a property could be added such as "useLibraryFolders"? Then you could set it to the true or false and get the behavior you like best.

from librarymanager.

justcla avatar justcla commented on May 26, 2024

Thanks @mattfraley1.
Yes, the design is that a forward slash ("/") at the beginning of the destination would indicate that the destination is relative to the root of the project.
ie. "/scripts" would send files to the [root]/scripts, but
"scripts" would send files to [defaultDestinationFolder]/scripts.'

Thanks for the suggestion about "useLibraryFolders". We will consider that!

from librarymanager.

lgoudriaan avatar lgoudriaan commented on May 26, 2024

@justcla I expected it to work like this, but unfortunately, it's not implemented yet.

Question 1: B
Question 2: A
Question 3: A

The useLibraryFolders would be nice, you should be able to override this behavior by setting the destination in the library setting.

Example:

{
  "version": "1.0",
  "defaultProvider": "unpkg",
  "defaultDestination": "Assets/Libraries/",
  "useLibraryFolders": true,
  "libraries": [
    {
      "library": "[email protected]",
      "destination": "jquery-custom" // Assets/Libraries/jquery-custom/ (custom library folder)
    },
    {
      "library": "[email protected]"  // Assets/Libraries/bootstrap/
    },
    {
      "library": "[email protected]",
      "destination": "" // Assets/Libraries/coollib.js (overrides useLibraryFolders)
    },
    {
      "library": "[email protected]",
      "destination": "/foobar" // foobar (overrides root defaultDestination)
    }
  ]
}

This will give you full flexibility.

from librarymanager.

Related Issues (20)

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.