-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(core): add api for v2 of project project graph plugins #18032
Merged
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 7, 2023 22:33
ceef985
to
d3a0f7a
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 14, 2023 22:41
d3a0f7a
to
d883850
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 17, 2023 19:30
d883850
to
b2cabe8
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 17, 2023 20:57
b2cabe8
to
7f09b04
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 20, 2023 16:56
7f09b04
to
77c430e
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 20, 2023 22:06
77c430e
to
ba93987
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 21, 2023 16:39
ba93987
to
2cec50a
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 21, 2023 17:09
2cec50a
to
ec632e3
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 21, 2023 19:19
ec632e3
to
43f4f47
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 21, 2023 20:03
43f4f47
to
56fe9ee
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 24, 2023 16:35
cd0d320
to
cda23af
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
2 times, most recently
from
July 24, 2023 17:34
f2c8de0
to
a71a12c
Compare
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
July 25, 2023 14:40
a71a12c
to
0945b64
Compare
isaacplmann
approved these changes
Aug 10, 2023
leosvelperez
approved these changes
Aug 10, 2023
meeroslav
approved these changes
Aug 10, 2023
…we support both" This reverts commit f3748ed.
AgentEnder
force-pushed
the
feat/plugin-api-v2
branch
from
August 10, 2023 17:18
5cb78c3
to
1885132
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Current Behavior
There are 2 methods to interact with the project graph:
registerProjectTargets
projectFilePatterns
processProjectGraph
These 2 methods create some pain for us as we try to work on the internal code base, and there are some issues with the current inference APIs.
processProjectGraph
allows adding nodes to the graph, which seems like it would work as a project inference method outside of the official inference APIs. Adding nodes like this results in the project file map not being correctly calculated though, since they are added after we calculate the map.Expected Behavior
Plugins have 2 APIs for updating the graph:
createNodes
createDependencies
This allows us to proceed while knowing that the graph is updated with all nodes, and afterwards we can create dependencies between them.
CreateNodes
Provides a glob pattern and factory to construct nodes from files that match that pattern. As an example, consider the implementation of the project.json node creator:
The
createNodes
property is a tuple. The first element is the glob pattern, which says that we want all project.json files, including the one at the root if it is present. The second element is a function that takes the path to an individual file that was identified as matching the provided glob pattern, and returns all projects and external dependencies which are read from that file.In the case of
project.json
this is a single project. A similar plugin to supportworkspace.json
would look like this:CreateDependencies
createDependencies
returns an array of dependencies which should be added to the graph. It receives as arguments a context argument similar to the context currently provided toprocessProjectGraph
Known Limitations
The new APIs don't include methods to remove nodes or dependencies. We can't really find a valid use case for doing so, and it would result in complicating the return types of each of the methods.
Related Issue(s)
Fixes #