pnp/cli-microsoft365

New command: enable SPFx package for deployment in Teams

Open

#2,369 opened on Apr 17, 2021

View on GitHub
 (15 comments) (1 reaction) (0 assignees)TypeScript (399 forks)auto 404
help wantednew feature

Repository metrics

Stars
 (1,390 stars)
PR merge metrics
 (PR metrics pending)

Description

Usage

spfx package teams enable

Description

Checks if the SPFx package is enabled for deployment in Teams. Optionally, changes the package to enable it for deployment in Teams

Options

Option Description
-f, --filePath <filePath> Absolute or relative path to the .sppkg file to analyze
--fix Specify, to update all web parts in the package to be exposed in Teams

Additional Information

The idea of this command is to help admins analyze if the particular SPFx package can be deployed in Teams and enable it if needed without having to manually change the package.

The command has the following steps:

  • unzips the specified .sppkg file
  • discovers all web parts
  • for each web part checks its manifest and verifies if Teams is listed in supported hosts
  • the command prints in console all discovered web parts and whether they're enabled for deployment in Teams or not
  • when you use the --fix option, the command will unzip the .sppkg file, update all web part manifests so that all web parts are enabled in Teams, increase the package minor version number and create a new zip

This command could also be used in a script that downloads all .sppkg files from the app catalog, analyzes them and provides report or downloads all .sppkg files from the app catalog and updates all .sppkg files to be deployable in Teams.

Contributor guide