egoist / egoist/tsup

Regression in glob pattern handling after switching from globby to tinyglobby

Open
#1,297 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

## Issue

Since upgrading from `tsup` **8.2.4** to **8.3.0**, glob patterns that previously worked have stopped functioning as expected. Specifically, patterns that use an exclusion followed by an explicit inclusion no longer behave correctly after `tsup` switched from `globby` to `tinyglobby`.

Before, we could exclude all directories starting with a directory prefix and specifically opt out of one. Here is an example:
```ts
[
"!src/**/dir-prefix*/**/*",
"src/dir-prefix-special/**/*"
]
```

This would correctly ignore any directory matching `dir-prefix*` while still including the `dir-prefix-special` directory.

However, from **8.3.0** onwards, the same set of patterns fails to ignore `dir-prefix-special` directory from the exclusion list.

## Steps to reproduce

1. Create a project with tsup 8.2.4 (or any version < 8.3.0).
2. Add a directory structure that has `src/dir-prefix-foo` and `src/dir-prefix-special`.
3. Configure the tsup config with the following entry patterns:
```ts
entry: [
"!src/**/dir-prefix*/**/*",
"src/dir-prefix-special/**/*"
],
```
4. Run tsup and notice that `dir-prefix-foo` is ignored while `dir-prefix-special` is included.
5. Upgrade tsup to 8.3.0 or above.
6. Run the same build configuration. Observe that `dir-prefix-special` is now also ignored when it should be included.

Contributor guide

Open the contributing guide

Research direction

Reproduce the regression using the entry patterns in the issue with tsup 8.2.4 and 8.3.0, then inspect the glob-handling path affected by the switch from globby to tinyglobby. Done means the exclusion still ignores dir-prefix-foo while the later explicit inclusion keeps dir-prefix-special, with a regression test covering both versions' behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.