Skip to content

Support globs for src and ignoring paths#165

Merged
AlexMost merged 5 commits into
ttag-org:masterfrom
aperkaz:feat/glob-and-ignore
May 14, 2026
Merged

Support globs for src and ignoring paths#165
AlexMost merged 5 commits into
ttag-org:masterfrom
aperkaz:feat/glob-and-ignore

Conversation

@aperkaz
Copy link
Copy Markdown
Contributor

@aperkaz aperkaz commented Jan 6, 2026

This PR is a proposal for adding glob and ignore capabilities to the ttag-cli while keeping backwards compatibility (#78).

Feedback is welcome! 🙂

The feature has been built around the following goals:

  • Keep backwards compatibility and don't introduce breaking changes.
  • src globs and ignored paths are additional features.

Change summary:

  • Minimum package updates (glob package requires a higher version of typescript, thus creating a chain reaction that required updating jest too).
  • Most of snapshot updates are due to the jest version bump.
  • Extension of src/index.ts to inject the ignore argument into the commands/*.
  • All the file path calculation is encapsulated within src/libs/utils.ts > resolvePaths. No changes were made to the existing file-walking logic.

@aperkaz aperkaz changed the title Feat/support globs and ignore Support globs for src and ignoring paths Jan 6, 2026
@aperkaz aperkaz changed the title Support globs for src and ignoring paths Support globs for src and ignoring paths #78 Jan 6, 2026
@aperkaz aperkaz changed the title Support globs for src and ignoring paths #78 Support globs for src and ignoring paths Jan 6, 2026
@aperkaz aperkaz mentioned this pull request Jan 6, 2026
Comment thread package.json Outdated
Comment on lines +53 to +58
"jest": "^30.2.0",
"lint-staged": "^5.0.0",
"prettier": "^1.19.1",
"ts-jest": "^26.3.0",
"ts-jest": "^29.4.6",
"ts-node": "3.3.0",
"typescript": "^3.9.7"
"typescript": "^4.3"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These may be good changes, but they are strictly unrelated.

Copy link
Copy Markdown
Contributor Author

@aperkaz aperkaz Jan 16, 2026

Choose a reason for hiding this comment

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

As mentioned in the description, the glob package required a higher version of typescript, thus creating a chain reaction that required updating jest too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ugh... I would personally prefer dependency bumps to be a separate PR, but then again I'm not the owner of this project, maybe they think it's OK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see the value of splitting it into multiple PRs but would appreciate the input of someone with merge and publish privileges.

If you have the rights @dimaqq, I will get right into it 🙂

Comment thread package-lock.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OMG the diff size!

Comment thread tests/commands/__snapshots__/test_update.ts.snap Outdated
Comment thread src/lib/utils.ts
Comment thread src/lib/utils.ts Outdated
@aperkaz aperkaz requested a review from dimaqq January 16, 2026 12:14
@dimaqq
Copy link
Copy Markdown
Contributor

dimaqq commented May 10, 2026

I suppose I can try to make a separate PR for the Jest defaults update.
After that, this PR could be rebased to be nice and clean.

@dimaqq
Copy link
Copy Markdown
Contributor

dimaqq commented May 11, 2026

Deps update done in #167, PTAL.

@AlexMost
Copy link
Copy Markdown
Member

Guys, thank you for your contributions. I will take a closer look ASAP.

@dimaqq
Copy link
Copy Markdown
Contributor

dimaqq commented May 12, 2026

@aperkaz would you be up to rebasing this PR or cherry-picking only the glob changes and new tests?

@aperkaz aperkaz closed this May 14, 2026
@aperkaz aperkaz force-pushed the feat/glob-and-ignore branch from 49d9d2f to ae870eb Compare May 14, 2026 13:11
@aperkaz aperkaz reopened this May 14, 2026
@aperkaz
Copy link
Copy Markdown
Contributor Author

aperkaz commented May 14, 2026

@dimaqq I accidentally closed the PR, sorry about the noise.
I have cherry-picked the changes and pushed the changes 🙂

@aperkaz aperkaz force-pushed the feat/glob-and-ignore branch from 0483d9c to 312c129 Compare May 14, 2026 13:42
@AlexMost AlexMost merged commit 3e20368 into ttag-org:master May 14, 2026
1 check passed
@AlexMost
Copy link
Copy Markdown
Member

AlexMost commented May 14, 2026

awesome work, thanks for your contribution! Your changes are present in ttag-cli@1.12.0

@dimaqq - big thanks for the review ❤️

Comment thread package-lock.json
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
"resolved": "https://registry.npmmirror.com/@isaacs/cliui/-/cliui-8.0.2.tgz",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if perhaps this (and many below) is an unnecessary change.

registry.npmmirror.com should be legit and has some use: for developers based in China. this file had a mix of npmjs.org and this mirror before the change, so there was precedent but also... I feel that the specific mirror should be individual developer's concern, not a project-level concern.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, the package-lock.json was auto-generated when running npm i for the new packages. I am based in europe, so probably my .npmrc is to blame.

Will take it into consideration in the future 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No worries, I have fixed that after the merge

@aperkaz aperkaz deleted the feat/glob-and-ignore branch May 15, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants