Skip to content

Discussion: Library destination root #72

@justcla

Description

@justcla

We are considering introducing a property in the libman.json for "destinationRoot" (name to be decided).
The path specified here would be prefixed to any relative destination defined for a library.

For example:

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "destinationRoot": "/wwwroot/lib",
  "libraries": [
    {
      "library": "jquery@3.3.1",
      "destination": "jquery"
    }
  ]
}

In the case above, the jquery library would be downloaded to "/wwwroot/lib/jquery".

If not specified, the default/implied destinationRoot would be the project root ("/").
(This is the current behavior today.)

If a library specifies a path beginning with a forward slash ("/"), destinationRoot will be ignore for that library.

Please comment. Is this a design that would work for you? Would this be your preferred approach to defining library destinations? Or are you happy to specify the full destination path for each library you're pulling down?

Does the "defaultDestination" property suit your needs better?
ie. Are you more likely to place all your library files in the same directory?
Or is the defaultDestination useless to you as you'd always want to put each library in a separate directory? (ie. to avoid potential conflicts, or for cleaner management of 3rd party libraries)

Should we combine the defaultDestination with destinationRoot into a single property that becomes both

  • the destination prefix for libraries that define a destination without a slash ("/"), and
  • the default destination for libraries that don't define a specific destination
    ?

Alternatively (and separately), should we consider using the library's name combined with defaultDestination/destinationRoot as the destination folder if no "destination" is defined for a specific library.

So, in this example, the jquery library files would go into the "/wwwroot/lib/jquery" directory.

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "defaultDestination": "/wwwroot/lib",
  "libraries": [
    {
      "library": "jquery@3.3.1",
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThe issue is up for discussion with the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions