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.
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
[rush] JSON Selector Expressions (with "json:" selector parser) #4271
base: main
Are you sure you want to change the base?
[rush] JSON Selector Expressions (with "json:" selector parser) #4271
Changes from 4 commits
b66c79d
5c89832
a247e2f
d66c54f
a6bb2f3
5acf61e
a9aea9e
bed6c5a
3ceb1e5
f87af3b
86da31c
fdf166d
2eb83cf
dfef721
874d5ed
ea94618
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
scope
? Give example stringsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
value
? Give example stringsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a "selector"? Looking at these docs, a "selector" is an engine that chooses a list of Rush projects, kind of like how a CSS selector chooses DOM elements.
You have created a class called
RushProjectSelector
whose state is a rush.json configuration plus some options controlling how the Git selector behaves. If we use SQL terminology, this class is like a SQL table plus some global options that affect query behavior. It has the ability to execute queries, but the class is not a query -- instead the actual query is passed intoprojectSelector.selectExpression()
.Is a "selector" that query? Well, the query's type is
SelectorExpression
(not to be confused withExpressionSelector
, let's ignore that for now).What is a "selector expression"? Well apparently it can be a selector:
Is it then the case that
--to X
andX
are both selectors? Is everything a "selector"? Is a "selector" just any AST node for this query language?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constructive suggestions:
git:origin/main
ortag:release
.to(tag:release and git:origin/main)
should get some other name, like selection expression.to()
itself is really a "selection function" but its JSON notation is an expression involving that function.--to
is the CLI parameter representation ofto()
. I feel like the JSON design went off the rails a bit by putting--to
in a JSON key. JSON keys are JavaScript variable names. We don't writelet --to: string;
. Of course we do want the JSON syntax to be concise to write, but it also needs to be an easy API to use. The API scenarios are things like:Such programs aren't very easy to write if we can't even do:
and instead must do:
RushProjectSelector.selectExpression
to something likeProjectQueryContext.select()