Custom Plugin: Component and Content-Type creation by startup

System Information
  • Strapi Version: 4.13.4
  • Operating System: macOS
  • Database: sqlite
  • Node Version: v18.17.0
  • NPM Version: 9.6.7
  • Yarn Version: -

Hi all,

I am currently working more intensively on plugin development and am facing a small problem:

My plugin has several components and content types. Content types are created correctly and automatically when starting. Components, on the other hand, have to be created manually, as with the Strapi SEO plugin (Create components using a plugin). I do this within register.js so that I can react to updates within the schemas before initialising strapi. If I create or update the components, I restart the server using strapi.reload().

Now this is my problem:
Sometimes the plugin creates collection types before the creation of components is done. I want to make sure that the creation of all components is finished and after that the plugin should begin creating collection types.

Is that even possible or is there another way to solve this?

Best regards