From 22e4d5890947d65d9e4367324ff14626d04ebeaa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 21:19:31 +0000 Subject: [PATCH 1/4] Initial plan From 2c6ca42b21c29613c2baf699f783925762c86996 Mon Sep 17 00:00:00 2001 From: Vilius Vystartas Date: Mon, 13 Jul 2026 15:33:28 +0100 Subject: [PATCH 2/4] feat: make --library-name optional, fallback to solution name --- apps/spfx-cli/src/cli/actions/CreateAction.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/spfx-cli/src/cli/actions/CreateAction.ts b/apps/spfx-cli/src/cli/actions/CreateAction.ts index 8da46af7..3bf134a8 100644 --- a/apps/spfx-cli/src/cli/actions/CreateAction.ts +++ b/apps/spfx-cli/src/cli/actions/CreateAction.ts @@ -48,7 +48,7 @@ const ScaffoldProfileSchema: z.ZodType = z.object({ export class CreateAction extends SPFxActionBase { private readonly _targetDirParameter: CommandLineStringParameter; private readonly _templateParameter: IRequiredCommandLineStringParameter; - private readonly _libraryNameParameter: IRequiredCommandLineStringParameter; + private readonly _libraryNameParameter: CommandLineStringParameter; private readonly _componentNameParameter: IRequiredCommandLineStringParameter; private readonly _componentAliasParameter: CommandLineStringParameter; private readonly _componentDescriptionParameter: CommandLineStringParameter; @@ -83,8 +83,8 @@ export class CreateAction extends SPFxActionBase { this._libraryNameParameter = this.defineStringParameter({ parameterLongName: '--library-name', argumentName: 'LIBRARY_NAME', - description: 'The library name for the component', - required: true + description: 'The library name for the component. Defaults to the solution name if not specified.', + required: false }); this._componentNameParameter = this.defineStringParameter({ @@ -204,7 +204,7 @@ export class CreateAction extends SPFxActionBase { const builtInContext: ISPFxBuiltInContext = buildBuiltInContext( { componentName, - libraryName: this._libraryNameParameter.value, + libraryName: this._libraryNameParameter.value || solutionName, spfxVersion: template.spfxVersion, solutionName: rawSolutionName || undefined, componentAlias: this._componentAliasParameter.value?.trim() || undefined, From de6e591550ea2a17d73f9f169eb7725cf1076222 Mon Sep 17 00:00:00 2001 From: Vilius Vystartas Date: Mon, 13 Jul 2026 15:49:16 +0100 Subject: [PATCH 3/4] chore: add change file for --library-name optional --- .../spfx-cli/library-name-optional_2026-07-13.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@microsoft/spfx-cli/library-name-optional_2026-07-13.json diff --git a/common/changes/@microsoft/spfx-cli/library-name-optional_2026-07-13.json b/common/changes/@microsoft/spfx-cli/library-name-optional_2026-07-13.json new file mode 100644 index 00000000..a0a328ef --- /dev/null +++ b/common/changes/@microsoft/spfx-cli/library-name-optional_2026-07-13.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/spfx-cli", + "comment": "", + "type": "none" + } + ], + "packageName": "@microsoft/spfx-cli" +} From db5b89c684741aef8e719056ffbc42ef46ad1d0f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Jul 2026 21:23:09 +0000 Subject: [PATCH 4/4] test: update create help snapshot --- .../cli/test/__snapshots__/CommandLineHelp.test.ts.snap | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/spfx-cli/src/cli/test/__snapshots__/CommandLineHelp.test.ts.snap b/apps/spfx-cli/src/cli/test/__snapshots__/CommandLineHelp.test.ts.snap index 03b72a53..650ee872 100644 --- a/apps/spfx-cli/src/cli/test/__snapshots__/CommandLineHelp.test.ts.snap +++ b/apps/spfx-cli/src/cli/test/__snapshots__/CommandLineHelp.test.ts.snap @@ -4,8 +4,9 @@ exports[`CommandLineHelp prints the help: create 1`] = ` "usage: spfx create [-h] [--template-url URL] [--spfx-version VERSION] [--local-source TEMPLATE_PATH] [--remote-source URL] [--github-token TOKEN] [--target-dir TARGET_DIR] --template - TEMPLATE_NAME --library-name LIBRARY_NAME --component-name - COMPONENT_NAME [--component-alias COMPONENT_ALIAS] + TEMPLATE_NAME [--library-name LIBRARY_NAME] + --component-name COMPONENT_NAME + [--component-alias COMPONENT_ALIAS] [--component-description COMPONENT_DESCRIPTION] [--solution-name SOLUTION_NAME] [--package-manager {npm,pnpm,yarn,none}] @@ -40,7 +41,8 @@ Optional arguments: --template TEMPLATE_NAME The template to use for scaffolding --library-name LIBRARY_NAME - The library name for the component + The library name for the component. Defaults to the + solution name if not specified. --component-name COMPONENT_NAME The component name (e.g., \\"Hello World\\") --component-alias COMPONENT_ALIAS