From c2a783eb13a69bf7d3969086e275908f6c60b91d Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 27 Feb 2024 16:00:25 +0100 Subject: [PATCH 1/2] Enhance formatting --- code/lib/cli/src/generators/ANGULAR/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/cli/src/generators/ANGULAR/index.ts b/code/lib/cli/src/generators/ANGULAR/index.ts index cedc43def3b4..6a770ef1922c 100644 --- a/code/lib/cli/src/generators/ANGULAR/index.ts +++ b/code/lib/cli/src/generators/ANGULAR/index.ts @@ -1,5 +1,5 @@ import { join } from 'path'; -import { paddedLog } from '@storybook/core-common'; +import { commandLog } from '@storybook/core-common'; import { baseGenerator } from '../baseGenerator'; import type { Generator } from '../types'; import { CoreBuilder } from '../../project_types'; @@ -31,7 +31,7 @@ const generator: Generator<{ projectName: string }> = async ( } const angularProjectName = await angularJSON.getProjectName(); - paddedLog(`Adding Storybook support to your "${angularProjectName}" project`); + commandLog(`Adding Storybook support to your "${angularProjectName}" project`); const angularProject = angularJSON.getProjectSettingsByName(angularProjectName); From 68c45902cdcffb762468c9bb1e64f834f3894485 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 27 Feb 2024 16:00:42 +0100 Subject: [PATCH 2/2] Fix flag handling for npm package manager when used in Angular projects --- code/lib/cli/src/initiate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/lib/cli/src/initiate.ts b/code/lib/cli/src/initiate.ts index 3d647f923a43..b5504f2f751e 100644 --- a/code/lib/cli/src/initiate.ts +++ b/code/lib/cli/src/initiate.ts @@ -434,7 +434,8 @@ export async function initiate(options: CommandOptions, pkg: PackageJson): Promi const flags = []; // npm needs extra -- to pass flags to the command - if (packageManager.type === 'npm') { + // in the case of Angular, we are calling `ng run` which doesn't need the extra `--` + if (packageManager.type === 'npm' && projectType !== ProjectType.ANGULAR) { flags.push('--'); }