Skip to content

Store the version of the generator used to create the project #258

@waldekmastykarz

Description

@waldekmastykarz

Category

  • Question
  • Typo
  • Bug
  • Enhancement / Suggestion
  • Additional article idea

Expected or Desired Behavior

When creating new project store the version of the generator used to create that project. This will help developers maintain integrity of their SharePoint Framework projects.

Observed Behavior

Currently the only way to figure out which version of the generator has been used to create the project, is by analyzing the versions of the different dependencies recorded in package.json. Which version of the generator has been used to create the project might not be that important now, but it will become essential once the SharePoint Framework becomes generally available and developers start using it in production. Often developers must not only be able to create new project but also support existing projects created in the past. If they would always keep their generator updated to the latest version, it could contain changes incompatible with the version used to create the project. Adding a new web part to an existing project could lead to errors hard to debug.

When creating the project you could store the version of the generator used to create the project in .yo.rc.json. When adding new web parts you could check if the recorded version matches the version of the current generator and display a warning if it doesn't. When updating the project to a newer version of SPFx developers could update the version number recorded in .yo.rc.json accordingly. In cases developers need to work with multiple versions of the generator to support the different projects in their organization, they could use a Docker image with the specific version of the generator installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:generatorCategory: SharePoint Framework Yeoman generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions