Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return value of methods #6

Closed
yboujraf opened this issue May 11, 2020 · 8 comments
Closed

Wrong return value of methods #6

yboujraf opened this issue May 11, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@yboujraf
Copy link

Dear @krisztianb

If I compare the uml generated and the type of the methods, ... are not the same and missing information :

image

If I compare with other tools, the same class, I have this :

  • Your plugin :

image

  • vscode tools :

image

Best Regards,
Youssef

@krisztianb krisztianb added the bug Something isn't working label May 11, 2020
@krisztianb
Copy link
Owner

Can you show me the types that are output by typedoc for the properties and methods?

@krisztianb
Copy link
Owner

This is fixed in 0.1.4. 🎉

@yboujraf
Copy link
Author

Dear @krisztianb

Error when executing the plugin. "umlClassDiagramBoxBorderWidth"

$ npm run docs:class:diagram

> @by-research/smh-template-connector-lib@0.0.0-development docs:class:diagram C:\Git\by-research\smh - connectors\smh-template-connector-lib
> rimraf ./docs/dist/docs-class-diagram && typedoc --options ./typedoc/typedoc-config-class-diagram.ts

Error: The plugin typedoc-umlclass could not be loaded.

Error: umlClassDiagramBoxBorderWidth must be >= 0
    at Object.convert (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\declaration.js:37:23)
    at Options.setOptionValueToDefault (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\options.js:119:64)
    at Options.addDeclaration (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\options.js:53:14)
    at PluginOptions.addToApplication (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc-umlclass\dist\plugin_options.js:285:25)
    at Plugin.addOptionsToApplication (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc-umlclass\dist\plugin.js:50:22)
    at Plugin.initialize (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc-umlclass\dist\plugin.js:42:14)
    at load (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc-umlclass\dist\index.js:9:27)
    at PluginHost.load (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\plugins.js:28:21)
    at CliApplication.bootstrap (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\application.js:50:22)
    at CliApplication.bootstrap (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\cli.js:29:30)
C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\declaration.js:37
                throw new Error(getBoundsError(numberOption.name, numberOption.minValue, numberOption.maxValue));
                ^

Error: umlClassDiagramBoxBorderWidth must be >= 0
    at Object.convert (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\declaration.js:37:23)
    at Options.setOptionValueToDefault (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\options.js:119:64)
    at Options.reset (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\utils\options\options.js:24:18)
    at CliApplication.bootstrap (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\application.js:51:22)
    at CliApplication.bootstrap (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\dist\lib\cli.js:29:30)
    at Object.<anonymous> (C:\Git\by-research\smh - connectors\smh-template-connector-lib\node_modules\typedoc\bin\typedoc:5:5)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @by-research/smh-template-connector-lib@0.0.0-development docs:class:diagram: `rimraf ./docs/dist/docs-class-diagram && typedoc --options ./typedoc/typedoc-config-class-diagram.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @by-research/smh-template-connector-lib@0.0.0-development docs:class:diagram script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ybouj\AppData\Roaming\npm-cache\_logs\2020-05-19T19_01_21_743Z-debug.log

My typedoc-config-class-diagram.ts

module.exports = {
    inputFiles: ['./src/'],
    mode: 'file',
    //mode: 'modules',
    includeDeclarations: true,
    tsconfig: 'tsconfig.json',
    out: './docs/dist/docs-class-diagram/',
    excludePrivate: false,
    excludeProtected: false,
    excludeExternals: true,
    readme: './README.md',
    name: 'Probel SW-P-8 protocol Library project',
    ignoreCompilerErrors: true,
    plugin: 'typedoc-umlclass',
    listInvalidSymbolLinks: true,
    entryPoint: 'index',
    categorizeByGroup: true,
    media: './medias',
    version: '',
    gitRemote: 'remote',
    gitRevision: 'revision',
    theme: 'default',
    umlClassDiagramType: 'detailed',
    umlClassDiagramLocation: 'local',
    umlClassDiagramFormat: 'png',
    umlClassDiagramSectionTitle: 'Class-Diagram',
    umlClassDiagramPosition: 'above',
    umlClassDiagramHideEmptyMembers: 'false',
    // umlClassDiagramTopDownLayoutMaxSiblings: 6,
    umlClassDiagramMemberVisibilityStyle: 'icon',
    umlClassDiagramHideCircledChar: 'false',
    umlClassDiagramHideShadow: 'false',
    umlClassDiagramBoxBorderRadius: 2,
    umlClassDiagramBoxBorderWidth: 1,
    umlClassDiagramClassFontName: 'Courier',
    umlClassDiagramClassFontStyle: 'bold',
    umlClassDiagramClassAttributeFontStyle: 'italic'
};

Best Regards,
Youssef

@krisztianb
Copy link
Owner

You need to update TypeDoc to the latest version (0.17.7) which allows default values that are out of bounds: TypeStrong/typedoc#1291

@yboujraf
Copy link
Author

Dear @krisztianb

umlclass diagram

image

uml vscode diagram

image

I see now from the previous picture sent, a better decode of the type but I don't have all the dependencies that means interface, inheritance are missing.

Best Regards,
Youssef

@krisztianb
Copy link
Owner

I moved this to a separate issue as it is not related to the original problem. Let's discuss the problem over there, shall we?

@yboujraf
Copy link
Author

yboujraf commented Jun 1, 2020

Dear @krisztianb

The return value is look like the source code.

Just for my knowledge, why the class diagram provided by the vscode plugin is more detailed from yours plugin?

Best Regards,
Youssef

@krisztianb
Copy link
Owner

krisztianb commented Jun 2, 2020

There can be two reasons for this:

  1. My plugin currently does not display type parameters of template classes in the diagram. There is already on open issue for this: Support generics/template classes #13
  2. My plugin only shows the direct parents of a class or interface.

Number 2 means the following:

If you have a class A that extends B and B implements InterfaceC, then A only includes in the diagram the extending of B, but not InterfaceC. InterfaceC is only visible in the diagram of B. So in the diagrams in my plugin you only see that which is there in the code too: class A extends B and class B implements InterfaceC. I think this is a reasonable thing to do and I can't remember having seen this any different in an UML diagram so far.

Would you need this to be different? We could add an option to always include every implemented interface in the diagrams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants