feat(option): update 'dk list' filtering to '--where' with new advanced syntax#90
Merged
feat(option): update 'dk list' filtering to '--where' with new advanced syntax#90
Conversation
ee4e9e8 to
ef9e4fd
Compare
Contributor
Coverage Report for ./packages/devkit
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
ef9e4fd to
ea13d32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the template filtering mechanism for the
dk listcommand, replacing the deprecated--filteroption with the new, more powerful--whereoption.This change introduces advanced filtering capabilities, allowing users to perform more precise template lookups using a SQL-like
WHEREclause syntax.Breaking Change⚠️
The option
--filteris removed and replaced entirely by--where. Any scripts or commands using the old flag must be updated.New Features & Enhancements ✨
The new
--whereoption supports advanced filtering logic:Multiple Clauses (Logical AND): Users can now pass multiple
--wherearguments in a single command, which are combined using AND logic. Only templates matching all clauses will be displayed.dk list --where pm=npm --where alias:rtDual Syntax Support: The clause separator now accepts both the colon (
:) and the equals sign (=).name:vueorpm=pnpmRegular Expression (Regex) Matching: Filtering now supports full regex patterns, enclosed in forward slashes (
/). This allows for precise matching like "starts with" or "contains a specific pattern."dk list --where name:/^node/Presence/Absence Checks: Special characters are supported for checking if a property is defined or empty.
*(Presence): Filters for templates where the property is present (not empty). Example:--where alias:*~(Absence): Filters for templates where the property is missing or empty. Example:--where cache:~Affected Commands
dk listdk list <language>Fixes # (issue)
Type of change
Checklist: