Skip to content
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

chore(core): reconcile functions to find project of a path #13364

Merged
merged 5 commits into from
Nov 24, 2022

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Nov 23, 2022

Current Behavior

There are 4-5 different implementations of finding which project a file belongs to.

Expected Behavior

There are 2 different implementations of finding which project a file belongs to:

  • createProjectRootMapping(graph.nodes)
    • This should be used more often.
  • createProjectRootMappingsFromProjectConfigurations({ [name]: ProjectConfiguration)
    • This should only be used if there is no graph available (.i.e. this search is during the process of creating the graph.)
  • findProjectForPath(path, mapping)
    • This looks up the path in the map

Related Issue(s)

Fixes #

@vercel
Copy link

vercel bot commented Nov 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Nov 24, 2022 at 2:54PM (UTC)

@FrozenPandaz FrozenPandaz force-pushed the refactor-get-project2 branch 2 times, most recently from e20c6a5 to c502e9e Compare November 23, 2022 22:40
@meeroslav
Copy link
Contributor

The findProjectForPath in nx-plugin should be replaced with createProjectFileMappings (discussed already with @AgentEnder).

@FrozenPandaz FrozenPandaz merged commit 6d35fd4 into nrwl:master Nov 24, 2022
@FrozenPandaz FrozenPandaz deleted the refactor-get-project2 branch November 24, 2022 16:02
@FrozenPandaz
Copy link
Collaborator Author

Reviewed with @AgentEnder @vsavkin @meeroslav

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants