regextypescriptgruntjsdocumentationtypedoc

TypeDoc and how to exclude *.d.ts files only from few paths


I've got the next question about TypeDoc. So I have got a TypeDoc config like that:

typedoc: {
    build: {
        options: {
            module: 'commonjs',
            out: '../MyDocumentation/',
            name: 'MyApp',
            target: 'es5',
            exclude: '**/*/*.d.ts',
            excludePrivate: true,
            mode: 'file'
        },
        src: [
            ...some sources...
        ]
    }
}

On my app are a few paths with *.ts files. After recompiled those files the *.d.ts files had been created and I want to exclude it.

So for needs of this question we'll assume that my paths looks like that:

Now my TypeDoc config is excluding all *.d.ts files from full of app.

I'm trying to exclude *.d.ts files but only from a my defined paths so I was trying a few ways to define my exclude pattern:

  1. exclude: 'Scripts/{FolderA,FolderB,FolderC}/*.d.ts' but it is just ignoring
  2. exclude: '**/*+(FolderA|FolderB|FolderC)/*.d.ts' but I've got a Process terminated with code 3. 'FolderB' is not recognized as an internal or external command, operable program or batch file error.
  3. exclude: '**/{FolderA,FolderB,FolderC}/*.d.ts' but it is just ignoring too
  4. exclude: [
        'Scripts/FolderA/*.d.ts',
        'Scripts/FolderB/*.d.ts',
        'Scripts/FolderC/*.d.ts'
    ]
    

    but it are ignoring too...

  5. **/FolderA/*.d.ts is not ignoring but how to add a few path? Some of my path have a subfolders, ex. **/FolderA/ver1/*.d.ts

And that's all because I need to include to my documentation all index.d.ts files from node_modules. I need to reference to those libs.

Maybe there is another way how to do it?

I saw this comment but I don't know why - my typedoc recompiling task is ignoring that pattern.


Solution

  • Ok, I found answer by myself...again !

    I need something like that:

    exclude: [
        '**/FolderA/*.d.ts',
        '**/FolderA/ver1/*.d.ts',
        '**/FolderB/*.d.ts',
        '**/FolderC/*.d.ts'
    ]
    

    now I have to way how to include only index.d.ts files from node_module :D


    It was a piece of cake - I need to add into src line: 'node_modules/*/index.d.ts'