composer-schema.json 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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, 'metapackage' for empty packages, 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. "role": {
  71. "type": "string",
  72. "description": "Author's role in the project."
  73. }
  74. }
  75. }
  76. },
  77. "require": {
  78. "type": "object",
  79. "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.",
  80. "additionalProperties": true
  81. },
  82. "replace": {
  83. "type": "object",
  84. "description": "This is a hash of package name (keys) and version constraints (values) that can be replaced by this package.",
  85. "additionalProperties": true
  86. },
  87. "conflict": {
  88. "type": "object",
  89. "description": "This is a hash of package name (keys) and version constraints (values) that conflict with this package.",
  90. "additionalProperties": true
  91. },
  92. "provide": {
  93. "type": "object",
  94. "description": "This is a hash of package name (keys) and version constraints (values) that this package provides in addition to this package's name.",
  95. "additionalProperties": true
  96. },
  97. "require-dev": {
  98. "type": "object",
  99. "description": "This is a hash of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).",
  100. "additionalProperties": true
  101. },
  102. "suggest": {
  103. "type": "object",
  104. "description": "This is a hash of package name (keys) and descriptions (values) that this package suggests work well with it (this will be suggested to the user during installation).",
  105. "additionalProperties": true
  106. },
  107. "config": {
  108. "type": ["object"],
  109. "description": "Composer options.",
  110. "properties": {
  111. "vendor-dir": {
  112. "type": "string",
  113. "description": "The location where all packages are installed, defaults to \"vendor\"."
  114. },
  115. "bin-dir": {
  116. "type": "string",
  117. "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
  118. }
  119. }
  120. },
  121. "extra": {
  122. "type": ["object", "array"],
  123. "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.",
  124. "additionalProperties": true
  125. },
  126. "autoload": {
  127. "type": "object",
  128. "description": "Description of how the package can be autoloaded.",
  129. "properties": {
  130. "psr-0": {
  131. "type": "object",
  132. "description": "This is a hash of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.",
  133. "additionalProperties": true
  134. },
  135. "classmap": {
  136. "type": "array",
  137. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  138. }
  139. }
  140. },
  141. "repositories": {
  142. "type": ["object", "array"],
  143. "description": "A set of additional repositories where packages can be found.",
  144. "additionalProperties": true
  145. },
  146. "bin": {
  147. "type": ["array"],
  148. "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
  149. "items": {
  150. "type": "string"
  151. }
  152. },
  153. "include-path": {
  154. "type": ["array"],
  155. "description": "DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.",
  156. "items": {
  157. "type": "string"
  158. }
  159. },
  160. "scripts": {
  161. "type": ["object"],
  162. "description": "Scripts listeners that will be executed before/after some events.",
  163. "properties": {
  164. "pre-install-cmd": {
  165. "type": ["array", "string"],
  166. "description": "Occurs before the install command is executed, contains one or more Class::method callables."
  167. },
  168. "post-install-cmd": {
  169. "type": ["array", "string"],
  170. "description": "Occurs after the install command is executed, contains one or more Class::method callables."
  171. },
  172. "pre-update-cmd": {
  173. "type": ["array", "string"],
  174. "description": "Occurs before the update command is executed, contains one or more Class::method callables."
  175. },
  176. "post-update-cmd": {
  177. "type": ["array", "string"],
  178. "description": "Occurs after the update command is executed, contains one or more Class::method callables."
  179. },
  180. "pre-package-install": {
  181. "type": ["array", "string"],
  182. "description": "Occurs before a package is installed, contains one or more Class::method callables."
  183. },
  184. "post-package-install": {
  185. "type": ["array", "string"],
  186. "description": "Occurs after a package is installed, contains one or more Class::method callables."
  187. },
  188. "pre-package-update": {
  189. "type": ["array", "string"],
  190. "description": "Occurs before a package is updated, contains one or more Class::method callables."
  191. },
  192. "post-package-update": {
  193. "type": ["array", "string"],
  194. "description": "Occurs after a package is updated, contains one or more Class::method callables."
  195. },
  196. "pre-package-uninstall": {
  197. "type": ["array", "string"],
  198. "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables."
  199. },
  200. "post-package-uninstall": {
  201. "type": ["array", "string"],
  202. "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables."
  203. }
  204. }
  205. }
  206. }
  207. }