Skip to content

Instantly share code, notes, and snippets.

@df2k2
Created May 21, 2018 15:09
Show Gist options
  • Save df2k2/6c01b32e32b28a05b2e693431a9f2756 to your computer and use it in GitHub Desktop.
Save df2k2/6c01b32e32b28a05b2e693431a9f2756 to your computer and use it in GitHub Desktop.
temp

Composer Packaging


The composer.json Schema

https://getcomposer.org/schema.json

Package Types

The type of the package. It defaults to library.

Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. This could be a symfony-bundle, a wordpress-plugin or a typo3-cms-extension. These types will all be specific to certain projects, and they will need to provide an installer capable of installing packages of that type.

Out of the box, Composer supports four types:

  • library: This is the default. It will simply copy the files to vendor.
  • project: This denotes a project rather than a library. For example application shells like the Symfony standard edition, CMSs like the SilverStripe installer or full fledged applications distributed as packages. This can for example be used by IDEs to provide listings of projects to initialize when creating a new workspace.
  • metapackage: An empty package that contains requirements and will trigger their installation, but contains no files and will not write anything to the filesystem. As such, it does not require a dist or source key to be installable.
  • composer-plugin: A package of type composer-plugin may provide an installer for other packages that have a custom type. Read more in the dedicated article.

Only use a custom type if you need custom logic during installation. It is recommended to omit this field and have it default to library.

Magento Packaging Types and Examples

  • Library
    • "magento/composer", "magento/data-migration-tool", "magento/marketplace-eqp"
  • Project
    • "magento/project-enterprise-edition", "magento/project-community-edition"
  • Metapackage
    • "magento/extension-b2b", "magento/product-enterprise-edition"
  • Custom
    • magento2-component
      • Example: "magento/magento2-base", "magento/magento2-ee-base", "magento/magento2-b2b-base"
    • magento2-library
      • Example: "magento/framework", "magento/framework-amqp"
    • magento2-module
      • Example: "magento/checkout"
    • magento2-theme
      • Example: "magento/theme-frontend-luma", "magento/theme-adminhtml-backend"

References:


Package Links

References:


Reference Material

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/package/package_module.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment