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

feat(core): add API entrypoint to register metadata #22773

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

AgentEnder
Copy link
Member

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

Copy link

vercel bot commented Apr 10, 2024

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

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 8:13pm

export type ProjectsMetadata = Record<
string,
Pick<ProjectConfiguration, 'metadata'> & {
targets: Record<
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this? I'm not sure we do. I don't believe the graph provides information to determine metadata for targets anymore than the createNodes inputs does?

}
>;

export type CreateMetadata<T = unknown> = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move the graph out of the context to the first or second argument here?

I think the graph is the primary input for this function. It should not be in context along with stuff which is well contextual / environmental.

Comment on lines 368 to 372
return await applyProjectMetadata(result, plugins, {
graph: result,
nxJsonConfiguration: context.nxJsonConfiguration,
workspaceRoot,
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we should return directly... I think should do the same as nodes and dependencies.

If we have a partial graph, we should still be able to create metadata right? Is there any issue with that?

Just because a project is missing say... a lint target, does not mean we cannot identify that project as a React project.

So I think we should collect errors.. and return/throw afterwards.


for (const result of metadataResults) {
if (isCreateMetadataError(result)) {
errors.push(result);
Copy link
Collaborator

Choose a reason for hiding this comment

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

As far as I can see, these errors are not used anywhere.

@AgentEnder AgentEnder force-pushed the feat/register-metadata-entrypoint branch 2 times, most recently from dab73c1 to 178e75f Compare April 19, 2024 13:49
@AgentEnder AgentEnder force-pushed the feat/register-metadata-entrypoint branch from 178e75f to 1eba01b Compare April 23, 2024 14:43
@AgentEnder AgentEnder enabled auto-merge (squash) April 23, 2024 20:18
@AgentEnder AgentEnder merged commit 7bb6e9e into nrwl:master Apr 23, 2024
6 checks passed
Copy link

github-actions bot commented May 1, 2024

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 May 1, 2024
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

3 participants