Skip to content

chore: swap globby with tinyglobby#1017

Open
l2ysho wants to merge 10 commits intomasterfrom
1007-swap-globby-with-tinyglobby
Open

chore: swap globby with tinyglobby#1017
l2ysho wants to merge 10 commits intomasterfrom
1007-swap-globby-with-tinyglobby

Conversation

@l2ysho
Copy link
Contributor

@l2ysho l2ysho commented Feb 10, 2026

Replaces globby with tinyglobby and the ignore package. Since tinyglobby lacks built-in gitignore support, .gitignore processing is now handled manually -- reading all .gitignore files sorted by depth and applying each one scoped to its directory.

Scope of Changes

  • Removed globby; added tinyglobby and ignore
  • Rewrote getActorLocalFilePaths with manual .gitignore processing
  • Updated checkIfStorageIsEmpty to use glob from tinyglobby
  • Added tests for gitignore patterns and nested .gitignore scoping

Behavior Changes

None expected. The public API is unchanged; only the internal gitignore mechanism differs.

Risks & Considerations

  • Minor behavioral differences between tinyglobby and globby in edge cases (symlinks, brace expansion) are possible but unlikely to surface in practice.

Testing

Added tests covering: no .gitignore, various patterns (wildcards, negation, comments, empty), and nested .gitignore scoping across directories.

Closes #1007

@l2ysho l2ysho linked an issue Feb 10, 2026 that may be closed by this pull request
@l2ysho l2ysho self-assigned this Feb 10, 2026
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 10, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Feb 10, 2026
@l2ysho l2ysho requested a review from B4nan February 10, 2026 20:53
@l2ysho l2ysho marked this pull request as ready for review February 10, 2026 20:54
@l2ysho l2ysho requested a review from vladfrangu as a code owner February 10, 2026 20:54
@l2ysho l2ysho changed the title 1007 swap globby with tinyglobby chore: swap globby with tinyglobby Feb 10, 2026
src/lib/utils.ts Outdated

// Collect all .gitignore files sorted by depth (root first) and apply each one scoped to its directory
const gitignoreFiles = paths
.filter((p) => p === '.gitignore' || p.endsWith('/.gitignore'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use / as a check because of Windows and \\ in paths (assuming the module returns the path like that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/lib/utils.ts Outdated
// Collect all .gitignore files sorted by depth (root first) and apply each one scoped to its directory
const gitignoreFiles = paths
.filter((p) => p === '.gitignore' || p.endsWith('/.gitignore'))
.sort((a, b) => a.split('/').length - b.split('/').length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/lib/utils.ts Outdated
});

// Collect all .gitignore files sorted by depth (root first) and apply each one scoped to its directory
const gitignoreFiles = paths
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't find the git root and fetch all gitignores from the root down, so if I run it in a nested folder, it won't propagate right? idk if thats an ISSUE or not, but something to consider

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, experimenting with that now and it is so ugly I will go for the git ls-files approach from migration guide

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines -43 to +45
writeFileSync(joinPath(file), Math.random().toString(36).substring(7), { flag: 'w' }),
writeFileSync(joinPath(file), Math.random().toString(36).substring(7), {
flag: 'w',
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, this diff should not be here 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly just formatter being formatters, depends if you've setup biome as the preferred one!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a hook for it, it should be always formatted the same way, no matter what I am using in editor (I use biome also in editor) 🤔

} catch {
warning({
message:
'Unable to read .gitignore rules — git is not installed or the directory is not in a git repository.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like I said, I personally do not want .gitignore to be ignored (pun intended) when there is no git installed... @B4nan thoughts?

I understand it would be more of a pain (function to find git root -> glob from there for all .gitignore files -> throw em all in ignore)...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then I would throw an error for user and force him to install git. Do you think there is many users in this situation? probably all gitcloned our template already 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our templates are not git cloned but written on the FS from the archive we manually download 👀. We should support gitignore even without git installed imo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you suggest? I personally believe more in ls-files than custom logic. Maybe we can use primary git and if not available then some custom solution? This traverse and inspect of file tree is not as straightforward as I thought.

Does it make sense to swap the globby for tinyglobby and introduce this gitignore problem? I just can't evaluate it with my current view into CLI. @B4nan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swap globby with tinyglobby

2 participants