demike / TsUML2

Generates UML diagrams from TypeScript source code
MIT License
266 stars 34 forks source link

Some files seem to be ignored by the glob pattern #13

Open joaonevesvisualnuts opened 1 year ago

joaonevesvisualnuts commented 1 year ago

Command: tsuml2 --glob \"./src/**/!(*.d|*.spec).ts\" It's currently showing very few of the interfaces I have defined, I'm not sure why...

demike commented 1 year ago

Can you provide a minimal example that reproduces the problem?

joaonevesvisualnuts commented 1 year ago

I think it has to do with the package I'm building. It's a little bit hard to explain, but I think because I export all the interfaces/classes in the same object, it bundles them all together into a default entity in the diagram. For example, let's say I have this folder structure:

> package
> > index.ts <---- bundles all the classes together into an object
> > type1Classes
> > > Class1.ts <--- class that contains function x1()
> > type2Classes
> > > Class2.ts <--- class that contains function x2()

And index.ts is something like this:

const package = {
    Class1: require('type1Classes/Class1'),
    Class2: require('type2Classes/Class2')
};
export default package;

Then when I run tsuml2 --glob \"./package/**/!(*.d|*.spec).ts\" I get one of the entities in the diagram looking like this:

default:
   x1()
   x2()

Maybe it doesn't distinguish objects from classes or something?