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

fix(storybook): proper detection of e2e project existence #13635

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

mandarini
Copy link
Member

Nrwl/Storybook would not generate e2e project for standalone app. Now we are detecting existence of e2e project properly.

@vercel
Copy link

vercel bot commented Dec 5, 2022

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

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) Dec 5, 2022 at 7:09PM (UTC)

@mandarini mandarini self-assigned this Dec 5, 2022
@mandarini mandarini requested a review from jaysoo December 5, 2022 14:44
@nx-cloud
Copy link

nx-cloud bot commented Dec 5, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit b6f8e6d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 31 targets

Sent with 💌 from NxCloud.

@mandarini mandarini force-pushed the fix/sb-e2e-gen branch 2 times, most recently from 965112f to 4a00597 Compare December 5, 2022 17:51
@mandarini mandarini merged commit b959109 into nrwl:master Dec 5, 2022
Comment on lines +545 to +565
forEachExecutorOptions(
tree,
'@nrwl/cypress:cypress',
(options, projectName) => {
if (e2eProject) {
return;
}
if (options['devServerTarget']) {
const { project, target } = parseTargetString(
options['devServerTarget']
);
if (
(project === mainProject && target === 'serve') ||
(project === mainProject && target === 'storybook')
) {
e2eProject = projectName;
}
}
}
);
return e2eProject;
Copy link
Member

Choose a reason for hiding this comment

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

@FrozenPandaz should we add some utils in @nrwl/devkit to handle this better? something like:

findProjectWithTarget(executor?: name, searchFn: (TargetConfiguration) => boolean)

Copy link
Member Author

@mandarini mandarini Dec 6, 2022

Choose a reason for hiding this comment

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

Yeah @AgentEnder , we talked about this last week. The forEachExecutorOptions can be used to achieve this at the moment. If we decide to add another function, though, I'll be happy to write it! :D

Copy link
Member Author

@mandarini mandarini Dec 6, 2022

Choose a reason for hiding this comment

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

My suggestion was findBuildTarget, or something similar, to get the name of various targets. But since the callback in forEachExecutorOptions essentially can be used for that, we said that it's better to keep the one. Mind you, I still have to refactor all the places I've created my own "findTarget" functions :P

@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.

4 participants