Coder Social home page Coder Social logo

Comments (12)

krisztianb avatar krisztianb commented on June 23, 2024 2

I think renameDefaults: true makes a lot of sense. I don't think anybody wants to have something called default and moreover risk overwriting reflections when merging modules. I think I can add this option sometime next week.

from typedoc-plugin-merge-modules.

krisztianb avatar krisztianb commented on June 23, 2024 2

New option mergeModulesRenameDefaults added in version 2.0.0. 🎉

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024 1

If you want, you can try with my repository:

https://github.com/felipecrs/megatar/tree/upgrade-typedoc/website
https://gitpod.io/#https://github.com/felipecrs/megatar/tree/upgrade-typedoc/website

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024

PS: this makes the API not browsable, as only one "default" link works.

from typedoc-plugin-merge-modules.

krisztianb avatar krisztianb commented on June 23, 2024

Hi Felipe. I'm glad the plugin is useful for somebody.

If you look at the code you will see that the plugin does nothing fancy. It only moves all reflections from the modules into the project.

So the answer to your question is: No, it should not rename any exports at the moment. Naming collisions are not handled. I can have a look at that though.

What would be your expected output?

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024

No, it should not rename any exports at the moment. Naming collisions are not handled.

I thought more about it, and I agree, you're right. Especially because users may want to do the "renaming" without using your plugin together, so it would be better to be a standalone plugin.

What would be your expected output?

With TypeDoc 0.19 and --mode files, this is what I had:

image

Now, with TypeDoc 0.20 and your plugin:

image

Without your plugin:

image

(despite the bad naming, they at least don't overlap)

PS: I'm using docusaurus, but I already tested and this behavior remains in vanilla TypeDoc html generator.

from typedoc-plugin-merge-modules.

krisztianb avatar krisztianb commented on June 23, 2024

That would mean that moving the reflections to the project somehow destroys their "path". I'll take a look when I find the time. This should by fairly easy to reproduce with a simple example.

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024

@krisztianb fyi https://github.com/felipecrs/typedoc-plugin-rename-defaults

from typedoc-plugin-merge-modules.

krisztianb avatar krisztianb commented on June 23, 2024

Interesting. Thanks for the heads up. I was thinking about adding an option (something like renameDefaults: true|false) to this plugin so that you don't need to create a separate one, since when merging modules this can be a common problem.

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024

The main motivation for having a separate plugin is to be able to use it without your plugin.

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024

I mean, for those who would still like to have their defaults renamed but they don't want to merge the modules. But the code itself is quite easy, as proposed by Gerrit0 at TypeStrong/typedoc#1521 (comment).

from typedoc-plugin-merge-modules.

felipecrs avatar felipecrs commented on June 23, 2024

I thought in these options:

  • As you said, add the code and an option (and think about leaving the renameDefaults: true it by default, as it would cause the docs to overlap otherwise)
  • Add typedoc-plugin-rename-defaults as dependency of yours, but I don't really know if that would work
  • Simply document in the README, so who find this issue know what to do (install the typedoc-plugin-rename-defaults plugin)

from typedoc-plugin-merge-modules.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.