Skip to content

feat: make --library-name optional, fallback to solution name - #260

Merged
iclanton merged 3 commits into
SharePoint:mainfrom
vystartasv:fix/246-library-name-optional
Jul 16, 2026
Merged

feat: make --library-name optional, fallback to solution name#260
iclanton merged 3 commits into
SharePoint:mainfrom
vystartasv:fix/246-library-name-optional

Conversation

@vystartasv

@vystartasv vystartasv commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Description

Makes --library-name optional on spfx create. When omitted, the solution name is used as the default library name instead of requiring explicit input.

Closes #246

How was this tested?

  • Change is scoped to CreateAction.ts only — parameter type changed from required to optional, fallback uses computed solutionName
  • Verified the fallback path handles both missing --library-name and missing --solution-name
  • Branch rebuilt off main to remove earlier cross-PR contamination — only this feature's changes are included

Type of change

  • Bug fix
  • New feature / enhancement
  • Template change
  • Documentation / CI / governance

Copilot AI review requested due to automatic review settings July 11, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the SPFx CLI to reduce required inputs when scaffolding a component and also modifies list-templates output behavior around --spfx-version.

Changes:

  • Makes create --library-name optional and attempts to default it when omitted.
  • Adds --spfx-version template filtering behavior (in addition to existing branch selection behavior) to list-templates.
  • Updates list-templates help text to describe the filtering behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
apps/spfx-cli/src/cli/actions/CreateAction.ts Makes --library-name optional and introduces fallback behavior.
apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Adds --spfx-version filtering logic and updates command documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Copilot AI review requested due to automatic review settings July 11, 2026 21:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
@Adam-it

Adam-it commented Jul 13, 2026

Copy link
Copy Markdown

@vystartasv seems like this PR has commits from #259 PR ☹️
please check my comment in
#261 (comment)

@vystartasv
vystartasv force-pushed the fix/246-library-name-optional branch from dda19b5 to eb968a8 Compare July 13, 2026 13:18
Copilot AI review requested due to automatic review settings July 13, 2026 13:18
@vystartasv

Copy link
Copy Markdown
Contributor Author

@Adam-it Thanks for the feedback about mixed commits from #259 — I've rebased the branch cleanly so it only contains the #260-specific changes now (library-name optional + the SPFxTemplateCollection import fix). No more cross-PR commits.

Also — you're right about the AI-generated code concern. Going forward I'll review everything more carefully before opening PRs. Appreciate you flagging it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/ListTemplatesAction.ts Outdated
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Copilot AI review requested due to automatic review settings July 13, 2026 14:33
@vystartasv
vystartasv force-pushed the fix/246-library-name-optional branch from eb968a8 to 0304b44 Compare July 13, 2026 14:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
vystartasv added a commit to vystartasv/spfx that referenced this pull request Jul 13, 2026
Copilot AI review requested due to automatic review settings July 13, 2026 14:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
iclanton
iclanton previously approved these changes Jul 13, 2026
Copilot AI review requested due to automatic review settings July 15, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread apps/spfx-cli/src/cli/actions/CreateAction.ts
@iclanton
iclanton merged commit b5806b4 into SharePoint:main Jul 16, 2026
4 checks passed
vystartasv added a commit to vystartasv/spfx that referenced this pull request Jul 16, 2026
Fixes two issues:
1. Reverts --library-name back to optional (regression from merge conflict
   with already-merged PR SharePoint#260 that made it optional on main)
2. Fixes example text to accurately describe CLI behavior:
   - Subfolder output, not CWD
   - Use --package-manager none (not pnpm) to skip install
   - Include required params in all examples now that --library-name
     is optional, examples show the minimal arguments needed

Co-Authored-By: Claw <claw@hermes>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maybe --library-name could be optional

6 participants