marcj / typedoc-plugin-lerna-packages

A plugin for Typedoc that groups all Lerna packages into own TS module
MIT License
28 stars 15 forks source link

Package fails to find package on Windows #4

Closed jtenner closed 5 years ago

jtenner commented 5 years ago

https://github.com/marcj/typedoc-plugin-lerna-packages/blob/6a315f476dc84c6ec64c211e7bac08c8a9d91ce7/plugin.ts#L71

Logging out the variables reveals the problem.

for (const i in this.lernaPackages) {
  if (!this.lernaPackages.hasOwnProperty(i))
    continue;
  console.log(i);
  const packagePath = path_1.join(cwd, this.lernaPackages[i]) + '/';
  console.log("packagePath:", packagePath);
  console.log("path:", path);
  if (-1 !== (path + '/').indexOf(packagePath)) {
  console.log("fit", fit);
  if (i.length > fit.length) {
    fit = i;
  }
}
@as-pect/cli
packagePath: C:\Users\jtenner\Desktop\projects\as-pect\packages\cli/
path: C:/Users/jtenner/Desktop/projects/as-pect/packages/cli/src/help.ts
@as-pect/core
packagePath: C:\Users\jtenner\Desktop\projects\as-pect\packages\core/
path: C:/Users/jtenner/Desktop/projects/as-pect/packages/cli/src/help.ts

As you can see, the strings aren't normalized for windows users. This can be fixed by simply calling path.normalize() on the packagePath and the path object.

Would you like me to submit a pull request?

marcj commented 5 years ago

Yes, absolutely :)

jtenner commented 5 years ago

@marcj It looks like there is already a pull request for this change... but it hasn't been touched in a month. My change updates a few package dependencies too.

marcj commented 5 years ago

Oh I see, hehe. What dependencies would you like to update and why?

jtenner commented 5 years ago

I was mistaken on the package updates. Thanks for the quick fix!