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

Inclusion pattern doesn't work #1399

Closed
diavrank opened this issue Nov 22, 2020 · 3 comments
Closed

Inclusion pattern doesn't work #1399

diavrank opened this issue Nov 22, 2020 · 3 comments
Labels
bug Functionality does not match expectation

Comments

@diavrank
Copy link

Search terms

inclusion patterns, negated, complement

Expected Behavior

I expect to select files which have an ending of 'Ctrl.ts' using negation operator in --exclude flag.

Actual Behavior

The "!" operator does not seem to be working. I am using the next command:

typedoc --out docs --ignoreCompilerErrors --exclude '!**/*Ctrl.ts' --excludeExternals imports/api

And directory structure is the following:

app-web git:(dev) tree imports/api
imports/api
├── Binnacle
│   └── BinnacleCtrl.ts
├── Permissions
│   ├── Permission.ts
│   ├── PermissionsCtrl.ts
│   └── PermissionsPubs.ts
├── Profiles
│   ├── Profile.ts
│   ├── ProfileSeeder.ts
│   ├── ProfilesCtrl.ts
│   ├── ProfilesPubs.ts
│   └── ProfilesServ.ts
├── Rest
│   ├── ResponseEntity.ts
│   ├── UsersRest.ts
│   ├── config.ts
│   └── upload-middleware.ts
├── SystemOptions
│   ├── SystemOption.ts
│   └── SystemOptionsCtrl.ts
└── Users
    ├── User.ts
    ├── UserPresenceConfig.ts
    ├── UsersCtrl.ts
    ├── UsersPubs.ts
    └── UsersServ.ts

I am trying to select files that have the ending Ctrl.js, this is like a inclusion pattern or the complement of the exclusion '**/*Ctrl.ts' which does work. When I execute the inclusion pattern, no data is exported. However, if I execute:

typedoc --out docs --ignoreCompilerErrors --exclude '**/*Ctrl.ts' --excludeExternals imports/api

This does work because is not showing files with ending Ctrl.ts. So, I want to get the complement of this but when I try to use negation operation (!), it doesn't display anything.

I already searched in different places the solution but I haven't had luck.

Environment

  • Typedoc version: 0.19.2
  • TypeScript version: 4.0.5
  • Node.js version: 12.18.4
  • OS: Mac OS Big Sur
@diavrank diavrank added the bug Functionality does not match expectation label Nov 22, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 25, 2020

I can't seem to reproduce this, is it possible your shell is expanding the alias?

@Gerrit0 Gerrit0 added the needs reproduction Needs a minimal reproducible case label Nov 25, 2020
@diavrank
Copy link
Author

diavrank commented Dec 4, 2020

Hi @Gerrit0 , I did a mini example in order to reproduce it.

Inside on it, there is a readme file with the steps to follow.

myapp.zip

Let me know if you have any question.

@Gerrit0 Gerrit0 added reproduced and removed needs reproduction Needs a minimal reproducible case labels Dec 5, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 5, 2020

Ah, that makes a whole lot more sense now! My test case didn't have an extra directory, which made all the difference.

What TypeDoc is doing:

  • Expand imports/api - getting each of the folders within that
  • Loop over each folder, checking imports/api/FOLDER against the exclude pattern - this matches since it doesn't end in Ctrl.ts, and each folder is marked as excluded

The first obvious fix for this is only checking exclude patterns on files - but that potentially causes other issues since the pattern node_modules would no longer exclude anything in that folder... I think I'm okay with this, especially with the changes in 0.20 which will result in --exclude not being used as frequently.

@Gerrit0 Gerrit0 added this to To do in Version 0.22 via automation Jan 1, 2021
@Gerrit0 Gerrit0 added this to To Do in Version 0.22 via automation Aug 13, 2021
@Gerrit0 Gerrit0 moved this from To Do to Done in Version 0.22 Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
No open projects
Development

No branches or pull requests

2 participants