composer-schema.json 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. {
  2. "name": "Package",
  3. "type": "object",
  4. "additionalProperties": false,
  5. "properties": {
  6. "name": {
  7. "type": "string",
  8. "description": "Package name, including 'vendor-name/' prefix.",
  9. "required": true
  10. },
  11. "type": {
  12. "description": "Package type, either 'library' for common packages, 'composer-installer' for custom installers, or a custom type defined by whatever project this package applies to.",
  13. "type": "string"
  14. },
  15. "target-dir": {
  16. "description": "Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.",
  17. "type": "string"
  18. },
  19. "description": {
  20. "type": "string",
  21. "description": "Short package description.",
  22. "required": true
  23. },
  24. "keywords": {
  25. "type": "array",
  26. "items": {
  27. "type": "string",
  28. "description": "A tag/keyword that this package relates to."
  29. }
  30. },
  31. "homepage": {
  32. "type": "string",
  33. "description": "Homepage URL for the project.",
  34. "format": "uri"
  35. },
  36. "version": {
  37. "type": "string",
  38. "description": "Package version, see http://packagist.org/about for more info on valid schemes.",
  39. "required": true
  40. },
  41. "time": {
  42. "type": "string",
  43. "description": "Package release date, in 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' format."
  44. },
  45. "license": {
  46. "type": ["string", "array"],
  47. "description": "License name. Or an array of license names."
  48. },
  49. "authors": {
  50. "type": "array",
  51. "description": "List of authors that contributed to the package. This is typically the main maintainers, not the full list.",
  52. "items": {
  53. "type": "object",
  54. "additionalProperties": false,
  55. "properties": {
  56. "name": {
  57. "type": "string",
  58. "description": "Full name of the author.",
  59. "required": true
  60. },
  61. "email": {
  62. "type": "string",
  63. "description": "Email address of the author.",
  64. "format": "email"
  65. },
  66. "homepage": {
  67. "type": "string",
  68. "description": "Homepage URL for the author.",
  69. "format": "uri"
  70. }
  71. }
  72. }
  73. },
  74. "require": {
  75. "type": "object",
  76. "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.",
  77. "additionalProperties": true
  78. },
  79. "replace": {
  80. "type": "object",
  81. "description": "This is a hash of package name (keys) and version constraints (values) that can be replaced by this package.",
  82. "additionalProperties": true
  83. },
  84. "conflict": {
  85. "type": "object",
  86. "description": "This is a hash of package name (keys) and version constraints (values) that conflict with this package.",
  87. "additionalProperties": true
  88. },
  89. "provide": {
  90. "type": "object",
  91. "description": "This is a hash of package name (keys) and version constraints (values) that this package provides in addition to this package's name.",
  92. "additionalProperties": true
  93. },
  94. "recommend": {
  95. "type": "object",
  96. "description": "This is a hash of package name (keys) and version constraints (values) that this package recommends to be installed (typically this will be installed as well).",
  97. "additionalProperties": true
  98. },
  99. "suggest": {
  100. "type": "object",
  101. "description": "This is a hash of package name (keys) and version constraints (values) that this package suggests work well with it (typically this will only be suggested to the user).",
  102. "additionalProperties": true
  103. },
  104. "config": {
  105. "type": ["object"],
  106. "description": "Composer options.",
  107. "properties": {
  108. "vendor-dir": {
  109. "type": "string",
  110. "description": "The location where all packages are installed, defaults to \"vendor\"."
  111. },
  112. "bin-dir": {
  113. "type": "string",
  114. "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
  115. }
  116. }
  117. },
  118. "extra": {
  119. "type": ["object", "array"],
  120. "description": "Arbitrary extra data that can be used by custom installers, for example, package of type composer-installer must have a 'class' key defining the installer class name.",
  121. "additionalProperties": true
  122. },
  123. "autoload": {
  124. "type": "object",
  125. "description": "Description of how the package can be autoloaded.",
  126. "properties": {
  127. "psr-0": {
  128. "type": "object",
  129. "description": "This is a hash of namespaces (keys) and the directories they can be found into (values) by the autoloader.",
  130. "additionalProperties": true
  131. }
  132. }
  133. },
  134. "repositories": {
  135. "type": ["object", "array"],
  136. "description": "A set of additional repositories where packages can be found.",
  137. "additionalProperties": true
  138. },
  139. "bin": {
  140. "type": ["array"],
  141. "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
  142. "items": {
  143. "type": "string"
  144. }
  145. },
  146. "scripts": {
  147. "type": ["object"],
  148. "description": "Scripts listeners that will be executed before/after some events.",
  149. "properties": {
  150. "pre-install-cmd": {
  151. "type": ["array", "string"],
  152. "description": "Occurs before the install command is executed, contains one or more Class::method callables."
  153. },
  154. "post-install-cmd": {
  155. "type": ["array", "string"],
  156. "description": "Occurs after the install command is executed, contains one or more Class::method callables."
  157. },
  158. "pre-update-cmd": {
  159. "type": ["array", "string"],
  160. "description": "Occurs before the update command is executed, contains one or more Class::method callables."
  161. },
  162. "post-update-cmd": {
  163. "type": ["array", "string"],
  164. "description": "Occurs after the update command is executed, contains one or more Class::method callables."
  165. },
  166. "pre-package-install": {
  167. "type": ["array", "string"],
  168. "description": "Occurs before a package is installed, contains one or more Class::method callables."
  169. },
  170. "post-package-install": {
  171. "type": ["array", "string"],
  172. "description": "Occurs after a package is installed, contains one or more Class::method callables."
  173. },
  174. "pre-package-update": {
  175. "type": ["array", "string"],
  176. "description": "Occurs before a package is updated, contains one or more Class::method callables."
  177. },
  178. "post-package-update": {
  179. "type": ["array", "string"],
  180. "description": "Occurs after a package is updated, contains one or more Class::method callables."
  181. },
  182. "pre-package-uninstall": {
  183. "type": ["array", "string"],
  184. "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables."
  185. },
  186. "post-package-uninstall": {
  187. "type": ["array", "string"],
  188. "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables."
  189. }
  190. }
  191. }
  192. }
  193. }