feat: make --library-name optional, fallback to solution name - #260
Conversation
There was a problem hiding this comment.
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-nameoptional and attempts to default it when omitted. - Adds
--spfx-versiontemplate filtering behavior (in addition to existing branch selection behavior) tolist-templates. - Updates
list-templateshelp 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.
|
@vystartasv seems like this PR has commits from #259 PR |
dda19b5 to
eb968a8
Compare
|
@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. |
eb968a8 to
0304b44
Compare
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>
Description
Makes
--library-nameoptional onspfx create. When omitted, the solution name is used as the default library name instead of requiring explicit input.Closes #246
How was this tested?
solutionName--library-nameand missing--solution-namemainto remove earlier cross-PR contamination — only this feature's changes are includedType of change