Skip to content

💡 [Feature]: Improve SPFx Project detection logic #627

@Saurabh7019

Description

@Saurabh7019

🎯 Aim of the feature

The current SPFx project detection relies completely on .yo-rc.json files, which creates a couple of issues:

  1. Sample Gallery missing valid samples - The prepare-sample-data.ps1 script skips samples that don't have this file. The sample gallery's primary purpose is to provide developers with various real-world examples for learning and inspiration. By excluding valid SPFx projects due to this missing file, we are reducing the number of available community samples.
  2. Extension fails to detect valid SPFx project - SPFx solutions can function without a .yo-rc.json file and still build, bundle, and package successfully using npm scripts, the SPFx Toolkit extension hides the Tasks view because it relies on this file to validate the project.

This scope of this issue is to identify key SPFx indicators that are required for all SPFx project types (WebParts, Extensions, Libraries, ACEs) and implement multi-layer SPFx detection solution.

As mentioned in the comment below, the @microsoft/sp-core-library package appears to be a consistent and mandatory dependency for all valid SPFx projects. Let's verify that all SPFx component types (Web Part, Extension, Library, ACE) consistently include this package and then proceed with updating the detection logic to use this package as the primary SPFx indicator, with current .yo-rc.json as a fallback.

files to update:

📷 Images (if possible) with expected result

No response

🤔 Additional remarks or comments

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions