In a recent update of canvas studio (> v3.21063) , it was found that the feature to import/export canvas app components will be retired in the future.
With this retirement, app makers will need to use the Component library to share components within the organization, and need to consider how to migrate from "standalone" app that contain components into component library.
In this post, I will share some of the interesting properties I discovered in the course of these studies.
Component library is another type of App
A component library looks no different from a regular/standalone app at the time of creation, except for the lack of form factor options.
However, once it is added as a library, the app will not appear in the list of executable apps, and the components shown in "Get more components" will only be those created in the Component library.
What is difference of standalone app and component library?
If you convert your app to source code, you will find that there is only one place where the library differs from a regular app.
That is the "DocumentType" property in CanvasManifest.
For regular app, value for "DocumentType" is "App", on the other side, for component library, it is "ComponentLibrary".
Aside from the screen details and checksum, this is the only difference, and it turns out that the difference in behavior described above is determined by the value of this property.
Convert app type
Since there is only one difference, let's convert the PnP shared app (standalone) into a Component library by rewriting this.
Download the source code, rewrite the "DocumentType" in CanvasManifest.json, and pack it again into msapp.
All you have to do is open msapp in studio and save it.
*Here, the form factor can be either tablet or phone.
Okay, you can migrate components in standalone app into component library!