Coder Social home page Coder Social logo

typedoc-plugin-merge-modules's People

Contributors

beijaflor avatar erymski avatar krisztianb avatar osesov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

typedoc-plugin-merge-modules's Issues

Support for the Typedoc 26 Beta?

I am using the Beta for the packageOptions property of tsconfig.json, but would prefer if the modules were all under the name of the Module like this plugin does, is there any way I could use it with 0.26.0-beta.2?

Namespaces and Interfaces are not merged.

package.json:

{
  "devDependencies": {
    "typedoc": "0.22.13",
    "typedoc-plugin-markdown": "3.11.14",
    "typedoc-plugin-merge-modules": "3.1.0",
    "typescript": "4.6.3"
  },
  "name": "issue",
  "type": "module"
}

typedoc.json:

{
  "cleanOutputDir": true,
  "entryPointStrategy": "expand",
  "entryPoints": [
    "src"
  ],
  "gitRevision": "master",
  "hideBreadcrumbs": true,
  "hideInPageTOC": true,
  "hideLegend": true,
  "out": "_doc",
  "readme": "none"
}

tsconfig.json:

{
  "compilerOptions": {
    "allowJs": true,
    "declaration": true,
    "emitDeclarationOnly": true
  },
  "include": [
    "src/**/*.js"
  ]
}

src/file.js:

/**
 * Some module.
 *
 * @module
 */

/**
 * This description is not in the documentation!
 *
 * @callback Type1 This description is not in the documentation!
 *
 * @param {number} one This description is not in the documentation!
 * @param {number} two This description is not in the documentation!
 *
 * @returns {number} This description is not in the documentation!
 */

/**
 * @typedef {{(one: number, two: number) => number}} Type2
 *
 * Some type 2.
 */

/**
 * This block will be placed in the `interfaces/Type3.md` file
 * instead of the `README.md` file.
 *
 * @typedef Type3 Some type 3.
 *
 * @property {number} one property #1
 * @property {number} two property #2
 */

/**
 * @typedef {{
 *   one: number;
 *   two: number;
 * }} Type4
 *
 * Some type 4.
 */

/**
 * Some type 5.
 *
 * This block will be placed in the `modules/Type5.md` file
 * instead of the `README.md` file.
 */
export const Type5 = {}

/**
 * @param {number} n
 *
 * @returns {number}
 */
Type5.id = n => n

Type5.answer = 42

After running

npx typedoc

and

ls -R _doc

we got

README.md       interfaces      modules

_doc/interfaces:
Type3.md

_doc/modules:
Type5.md

Plugin fails to load with typedoc 0.22.3

output:

$ ./node_modules/.bin/typedoc --version
Error: The plugin typedoc-plugin-merge-modules could not be loaded.
Error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/lib/converter' is not defined by "exports" in /home/osesov/tizen/vscode/zplayer/node_modules/typedoc/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:413:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:652:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/home/osesov/tizen/vscode/zplayer/node_modules/typedoc-plugin-merge-modules/dist/plugin.js:4:21)

TypeDoc 0.22.3
Using TypeScript 4.4.2 from ./node_modules/typescript/lib

If that helps - recently the same situation used to be with typedoc-plugin-markdown #249

Interface and Properties names are not replacing 'default'

Thank you very much for this plugin!
When I run:
npx typedoc --pretty --mergeModulesRenameDefaults true ./src

The plug does fix most of my 'default' naming problems, but it is not working with property names and interface names.

Interface:

export default interface CRUDServiceInterface {

Property... if that is what we'll call it:

function loggerFactory(): winston.Logger {
...
    return logger;
}

export default loggerFactory();

Fixing the interface name would be the most helpful, and straightforward.
As for the 'property', I would recommend either a lowercase of the file name.

  • Example: logger

Or, something like: <filename>/@default


image

Usage with monorepo doesn't seem to work

Hi!
First of all thanks for your plugin :)

We are having issues working with [email protected] and typedoc-plugin-merge-modules in a monorepo.

In the [email protected] release, the author rebuilt the way typedoc works and how it builts the documentation for monorepos.

Currently, we are not able to make typedoc-plugin-merge-modules work in a monorepo with multiple packages

This worked with [email protected] and the previous version of the plugin

Expected Behavior

The documentation generated for all the packages properly merge the different packages with the same @module @mergeTarget tags

Current Behavior

Modules are not merged and are shown independently.

Steps to Reproduce

I will provide a repo with an example, we use Nx for the monorepo.

We have these projects in Nx
image
each one with his own package.json

[email protected] requires to split the configurations, we created a typedoc.json in both of them
image

the index.ts (entry point configured for typedoc) has the comments
image

but the result is
image

and here the typedoc global config
image

I will provide an example repository this afternoon :)

merge things into the same file

Hello, and thanks for updating this plugin to work with the latest TypeDoc!

Now, on to my issue. I was wondering if there could be a new option to merge things on to the same page.

For example, with the following typedoc.json:

{
    "$schema": "https://typedoc.org/schema.json",
    "entryPointStrategy": "Resolve",
    "entryPoints": [
        "./src/foo.ts",
        "./src/bar.ts"
    ]
}

And the following foo.ts:

export enum FooEnum {
  VALUE_1 = 0,
  VALUE_2 = 1,
}

export interface FooInterface {
  thing1: number;
  thing2: number;
}

And the following bar.ts:

// Same as "foo.ts", just different names.

export enum BarEnum {
  VALUE_1 = 0,
  VALUE_2 = 1,
}

export interface BarInterface {
  thing1: number;
  thing2: number;
}

Without any plugins, TypeDoc will generate docs that have FooEnum, FooInterface, BarEnum, and BarInterface all on separate HTML pages.

Instead, what I want is to have 2 HTML pages with 2 things each on them, because I have explicitly told TypeDoc to have 2 entry points.

(Essentially, this would allow people to document "chunks" or "features" of an app/library, and have everything concerning the feature be contained on a single HTML page.)

Is this possible?

Error when running typedoc

When running typedoc I'm getting the following error:

The plugin C:**\base\node_modules\typedoc-plugin-merge-modules could not be loaded.
Error: C:**\base\node_modules\marked\src\marked.js:158
const prevRenderer = extensions.renderers?.[ext.name];

Difficulty using options

I have tried adding "mergeModulesMergeMode": "module" to my typedoc.json file, but now TypeDoc throws error Error: Tried to set an option (mergeModulesMergeMode) that was not declared..

It does load typedoc-plugin-merge-modules right before throwing the error, so I believe I'm at fault for using the option the wrong way. How should I use it, though?

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.