LibraryManager icon indicating copy to clipboard operation
LibraryManager copied to clipboard

[CLI] Adding library to libman.json should be consistent for CLI install and UI install

Open YangLyu89 opened this issue 7 years ago • 2 comments

Minimal repro steps

  1. run libman install [email protected] on CLI
  2. open UI adding client-side libraries, and install a library like "[email protected]"
  3. open the libman.json file

Expected result

The libman.json should be look like something:

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "[email protected]",
      "destination": "wwwroot/lib/jquery"
    },
    {
      "provider": "cdnjs",
      "library": "[email protected]",
      "destination": "wwwroot/jo/"
    }
  ]
}

Actual result

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "[email protected]",
      "destination": "wwwroot\\lib\\jquery"
    },
    {
      "provider": "cdnjs",
      "library": "[email protected]",
      "destination": "wwwroot/jo/"
    }
  ]
}

YangLyu89 avatar Jul 11 '18 21:07 YangLyu89

We should be consistent about what type of slashes we use.

jodavis avatar Jul 12 '18 21:07 jodavis

We also have an issue that the schema flags backslashes as errors, even though they are accepted by the tool.

All our tooling should be consistent, using forward slash.

But we should accept both slashes, and in all cases where we see a forward or back slash, we should interpret that as "path separator character for the current OS."

The schema should be updated to accept both, but Visual Studio should provide a warning when it sees backslashes informing the user that they won't work on other operating systems.

jodavis avatar Sep 20 '18 20:09 jodavis