composer-schema.json 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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://getcomposer.org/doc/04-schema.md#version for more info on valid schemes."
  39. },
  40. "time": {
  41. "type": "string",
  42. "description": "Package release date, in 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' format."
  43. },
  44. "license": {
  45. "type": ["string", "array"],
  46. "description": "License name. Or an array of license names."
  47. },
  48. "authors": {
  49. "type": "array",
  50. "description": "List of authors that contributed to the package. This is typically the main maintainers, not the full list.",
  51. "items": {
  52. "type": "object",
  53. "additionalProperties": false,
  54. "properties": {
  55. "name": {
  56. "type": "string",
  57. "description": "Full name of the author.",
  58. "required": true
  59. },
  60. "email": {
  61. "type": "string",
  62. "description": "Email address of the author.",
  63. "format": "email"
  64. },
  65. "homepage": {
  66. "type": "string",
  67. "description": "Homepage URL for the author.",
  68. "format": "uri"
  69. }
  70. }
  71. }
  72. },
  73. "require": {
  74. "type": "object",
  75. "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.",
  76. "additionalProperties": true
  77. },
  78. "replace": {
  79. "type": "object",
  80. "description": "This is a hash of package name (keys) and version constraints (values) that can be replaced by this package.",
  81. "additionalProperties": true
  82. },
  83. "conflict": {
  84. "type": "object",
  85. "description": "This is a hash of package name (keys) and version constraints (values) that conflict with this package.",
  86. "additionalProperties": true
  87. },
  88. "provide": {
  89. "type": "object",
  90. "description": "This is a hash of package name (keys) and version constraints (values) that this package provides in addition to this package's name.",
  91. "additionalProperties": true
  92. },
  93. "recommend": {
  94. "type": "object",
  95. "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).",
  96. "additionalProperties": true
  97. },
  98. "suggest": {
  99. "type": "object",
  100. "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).",
  101. "additionalProperties": true
  102. },
  103. "config": {
  104. "type": ["object"],
  105. "description": "Composer options.",
  106. "properties": {
  107. "vendor-dir": {
  108. "type": "string",
  109. "description": "The location where all packages are installed, defaults to \"vendor\"."
  110. },
  111. "bin-dir": {
  112. "type": "string",
  113. "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
  114. }
  115. }
  116. },
  117. "extra": {
  118. "type": ["object", "array"],
  119. "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.",
  120. "additionalProperties": true
  121. },
  122. "autoload": {
  123. "type": "object",
  124. "description": "Description of how the package can be autoloaded.",
  125. "properties": {
  126. "psr-0": {
  127. "type": "object",
  128. "description": "This is a hash of namespaces (keys) and the directories they can be found into (values) by the autoloader.",
  129. "additionalProperties": true
  130. },
  131. "classmap": {
  132. "type": "array",
  133. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  134. }
  135. }
  136. },
  137. "repositories": {
  138. "type": ["object", "array"],
  139. "description": "A set of additional repositories where packages can be found.",
  140. "additionalProperties": true
  141. },
  142. "bin": {
  143. "type": ["array"],
  144. "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
  145. "items": {
  146. "type": "string"
  147. }
  148. },
  149. "scripts": {
  150. "type": ["object"],
  151. "description": "Scripts listeners that will be executed before/after some events.",
  152. "properties": {
  153. "pre-install-cmd": {
  154. "type": ["array", "string"],
  155. "description": "Occurs before the install command is executed, contains one or more Class::method callables."
  156. },
  157. "post-install-cmd": {
  158. "type": ["array", "string"],
  159. "description": "Occurs after the install command is executed, contains one or more Class::method callables."
  160. },
  161. "pre-update-cmd": {
  162. "type": ["array", "string"],
  163. "description": "Occurs before the update command is executed, contains one or more Class::method callables."
  164. },
  165. "post-update-cmd": {
  166. "type": ["array", "string"],
  167. "description": "Occurs after the update command is executed, contains one or more Class::method callables."
  168. },
  169. "pre-package-install": {
  170. "type": ["array", "string"],
  171. "description": "Occurs before a package is installed, contains one or more Class::method callables."
  172. },
  173. "post-package-install": {
  174. "type": ["array", "string"],
  175. "description": "Occurs after a package is installed, contains one or more Class::method callables."
  176. },
  177. "pre-package-update": {
  178. "type": ["array", "string"],
  179. "description": "Occurs before a package is updated, contains one or more Class::method callables."
  180. },
  181. "post-package-update": {
  182. "type": ["array", "string"],
  183. "description": "Occurs after a package is updated, contains one or more Class::method callables."
  184. },
  185. "pre-package-uninstall": {
  186. "type": ["array", "string"],
  187. "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables."
  188. },
  189. "post-package-uninstall": {
  190. "type": ["array", "string"],
  191. "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables."
  192. }
  193. }
  194. }
  195. }
  196. }