LibraryManager
LibraryManager copied to clipboard
[CLI] Adding library to libman.json should be consistent for CLI install and UI install
Minimal repro steps
- run libman install [email protected] on CLI
- open UI adding client-side libraries, and install a library like "[email protected]"
- 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/"
}
]
}
We should be consistent about what type of slashes we use.
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.