runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
507 stars 65 forks source link

custom-elements.json tag path incorrect on windows #216

Open ajmchambers opened 3 years ago

ajmchambers commented 3 years ago

After running wca analyze \"src/**/*.js\" --outFile custom-elements.json

The result path is e.g.: "./src\\Component.js"

This seems to be due to this line here:

import { relative } from "path";

...

const path = fileName != null && config.cwd != null ? `./${relative(config.cwd, fileName)}` : undefined;

Changing it to this appears to fix it:

import { relative, sep, posix } from "path";

...

const path = fileName != null && config.cwd != null ? `./${relative(config.cwd, fileName).replaceAll(sep, posix.sep)}` : undefined;
rallets commented 3 years ago

I have the same problem, a separator mismatch between Mac and Windows. Very annoying that every time we get a different file. Someone can take a look to this issue? cc. @justinfagnani @runem

tonjohn commented 1 year ago

My team has the same issue as well - would be great to get this fixed.