Skip to content

Commit

Permalink
Merge pull request #23598 from storybookjs/valentin/fix-initializatio…
Browse files Browse the repository at this point in the history
…n-of-storybook-in-angular-16.1

Angular: Fix initialization of Storybook in Angular 16.1
(cherry picked from commit 0aec101)
  • Loading branch information
valentinpalkovic authored and storybook-bot committed Jul 25, 2023
1 parent 0792ef2 commit 2d4a9a3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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');
}

0 comments on commit 2d4a9a3

Please sign in to comment.