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

Angular: Fix initialization of Storybook in Angular 16.1 #23598

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,7 +19,7 @@ export const angularBuildersMultiproject: Fix<AngularBuildersMultiprojectRunOpti
const frameworkPackageName = getFrameworkPackageName(mainConfig);

if (
(await isNxProject(packageManager)) ||
(await isNxProject()) ||
frameworkPackageName !== '@storybook/angular' ||
!angularVersion ||
semver.lt(angularVersion, '14.0.0')
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/automigrate/fixes/angular-builders.ts
Expand Up @@ -25,7 +25,7 @@ export const angularBuilders: Fix<AngularBuildersRunOptions> = {
// Skip in case of NX
if (
!angularVersion ||
(await isNxProject(packageManager)) ||
(await isNxProject()) ||
framewworkPackageName !== '@storybook/angular'
) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/detect.ts
Expand Up @@ -212,7 +212,7 @@ export async function detect(
return ProjectType.UNDETECTED;
}

if (await isNxProject(packageManager)) {
if (await isNxProject()) {
return ProjectType.NX;
}

Expand Down
5 changes: 2 additions & 3 deletions code/lib/cli/src/helpers.ts
Expand Up @@ -300,7 +300,6 @@ export function getStorybookVersionSpecifier(packageJson: PackageJsonWithDepsAnd
return allDeps[storybookPackage];
}

export async function isNxProject(packageManager: JsPackageManager) {
const nxVersion = await packageManager.getPackageVersion('nx');
return !!nxVersion ?? findUp.sync('nx.json');
export async function isNxProject() {
return findUp.sync('nx.json');
}