ranyitz/qnm

Scoped packages should be displayed using `/` separator, regardless of OS

nelson6e65 opened this issue ยท 7 comments

On Windows, qnm displays scoped packages using \ separator instead of the name of the package on npm register. It should use @scope/name instead of @scope\name regardless of directory separator used by the operating system.

Example:

$ qnm doctor
size    count  module
------  -----  ----------
107.7mb   2 ๐Ÿ˜  typescript
59.42mb   1 โœ“  @firebase\firestore
49.97mb   1 โœ“  cordova-plugin-ionic
41.68mb  55 ๐Ÿ˜– source-map
20.78mb   1 โœ“  @angular\core
20.31mb   2 ๐Ÿ˜  @schematics\angular
18.74mb   1 โœ“  @angular\compiler
18.57mb  37 ๐Ÿ˜– postcss
18.16mb   1 โœ“  firebase
16.83mb   1 โœ“  prettier
15.65mb   1 โœ“  @ionic\core
15.47mb   1 โœ“  @stencil\core
13.46mb   3 ๐Ÿ˜  rxjs
12.86mb   1 โœ“  @firebase\database
12.44mb   1 โœ“  @angular\common
12.16mb   1 โœ“  @ionic\angular-toolkit
11.71mb  13 ๐Ÿ˜ก ajv
9.36mb    1 โœ“  @angular\compiler-cli
8.79mb    1 โœ“  esbuild-wasm
8.54mb    1 โœ“  npm

Hey @nelson6e65, thanks for opening this issue!

It seems that the logic on this line is wrong, instead of using the path module, we should just join the directory name and the module name with / regardless of the environment (windows/linux/mac).

I believe this will solve both this issue and #97

@nelson6e65 would you be interested in contributing a PR that fixes this?

Sure.

Hello, @ranyitz I have a pre-pr ๐Ÿ˜…

I detected an issue when I cloned the repository to a directory with spaces. Can you check if my "solution" on #99 is Ok?

I don't know if you want I complete all Windows compatibility or merge #99 as a pre-fix (some tests are able to run, but others are still failing on Windows). ๐Ÿ˜…

@nelson6e65 yeah, it seems that I don't have a windows CI setup here, I'll try to add one soon (similar to this setup here).

Nice. I moved to GitHub Actions some time ago. ๐Ÿ˜…

In the meantime, I will continue on this issue later this night.

Fixed on #100 and released on v2.6.0