composer-schema.json 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "name": "Package",
  4. "type": "object",
  5. "additionalProperties": false,
  6. "required": [ "name", "description" ],
  7. "properties": {
  8. "name": {
  9. "type": "string",
  10. "description": "Package name, including 'vendor-name/' prefix."
  11. },
  12. "type": {
  13. "description": "Package type, either 'library' for common packages, 'composer-plugin' for plugins, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.",
  14. "type": "string"
  15. },
  16. "target-dir": {
  17. "description": "DEPRECATED: 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.",
  18. "type": "string"
  19. },
  20. "description": {
  21. "type": "string",
  22. "description": "Short package description."
  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 https://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', 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DDTHH:MM:SSZ' 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. "required": [ "name"],
  55. "properties": {
  56. "name": {
  57. "type": "string",
  58. "description": "Full name of the author."
  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. "process-timeout": {
  112. "type": "integer",
  113. "description": "The timeout in seconds for process executions, defaults to 300 (5mins)."
  114. },
  115. "use-include-path": {
  116. "type": "boolean",
  117. "description": "If true, the Composer autoloader will also look for classes in the PHP include path."
  118. },
  119. "preferred-install": {
  120. "type": "string",
  121. "description": "The install method Composer will prefer to use, defaults to auto and can be any of source, dist or auto."
  122. },
  123. "notify-on-install": {
  124. "type": "boolean",
  125. "description": "Composer allows repositories to define a notification URL, so that they get notified whenever a package from that repository is installed. This option allows you to disable that behaviour, defaults to true."
  126. },
  127. "github-protocols": {
  128. "type": "array",
  129. "description": "A list of protocols to use for github.com clones, in priority order, defaults to [\"git\", \"https\", \"http\"].",
  130. "items": {
  131. "type": "string"
  132. }
  133. },
  134. "github-oauth": {
  135. "type": "object",
  136. "description": "A hash of domain name => github API oauth tokens, typically {\"github.com\":\"<token>\"}.",
  137. "additionalProperties": true
  138. },
  139. "http-basic": {
  140. "type": "object",
  141. "description": "A hash of domain name => {\"username\": \"...\", \"password\": \"...\"}.",
  142. "additionalProperties": true
  143. },
  144. "store-auths": {
  145. "type": ["string", "boolean"],
  146. "description": "What to do after prompting for authentication, one of: true (store), false (do not store) or \"prompt\" (ask every time), defaults to prompt."
  147. },
  148. "platform": {
  149. "type": "object",
  150. "description": "This is a hash of package name (keys) and version (values) that will be used to mock the platform packages on this machine.",
  151. "additionalProperties": true
  152. },
  153. "vendor-dir": {
  154. "type": "string",
  155. "description": "The location where all packages are installed, defaults to \"vendor\"."
  156. },
  157. "bin-dir": {
  158. "type": "string",
  159. "description": "The location where all binaries are linked, defaults to \"vendor/bin\"."
  160. },
  161. "cache-dir": {
  162. "type": "string",
  163. "description": "The location where all caches are located, defaults to \"~/.composer/cache\" on *nix and \"%LOCALAPPDATA%\\Composer\" on windows."
  164. },
  165. "cache-files-dir": {
  166. "type": "string",
  167. "description": "The location where files (zip downloads) are cached, defaults to \"{$cache-dir}/files\"."
  168. },
  169. "cache-repo-dir": {
  170. "type": "string",
  171. "description": "The location where repo (git/hg repo clones) are cached, defaults to \"{$cache-dir}/repo\"."
  172. },
  173. "cache-vcs-dir": {
  174. "type": "string",
  175. "description": "The location where vcs infos (git clones, github api calls, etc. when reading vcs repos) are cached, defaults to \"{$cache-dir}/vcs\"."
  176. },
  177. "cache-ttl": {
  178. "type": "integer",
  179. "description": "The default cache time-to-live, defaults to 15552000 (6 months)."
  180. },
  181. "cache-files-ttl": {
  182. "type": "integer",
  183. "description": "The cache time-to-live for files, defaults to the value of cache-ttl."
  184. },
  185. "cache-files-maxsize": {
  186. "type": ["string", "integer"],
  187. "description": "The cache max size for the files cache, defaults to \"300MiB\"."
  188. },
  189. "bin-compat": {
  190. "enum": ["auto", "full"],
  191. "description": "The compatibility of the binaries, defaults to \"auto\" (automatically guessed) and can be \"full\" (compatible with both Windows and Unix-based systems)."
  192. },
  193. "discard-changes": {
  194. "type": ["string", "boolean"],
  195. "description": "The default style of handling dirty updates, defaults to false and can be any of true, false or \"stash\"."
  196. },
  197. "autoloader-suffix": {
  198. "type": "string",
  199. "description": "Optional string to be used as a suffix for the generated Composer autoloader. When null a random one will be generated."
  200. },
  201. "optimize-autoloader": {
  202. "type": "boolean",
  203. "description": "Always optimize when dumping the autoloader."
  204. },
  205. "prepend-autoloader": {
  206. "type": "boolean",
  207. "description": "If false, the composer autoloader will not be prepended to existing autoloaders, defaults to true."
  208. },
  209. "classmap-authoritative": {
  210. "type": "boolean",
  211. "description": "If true, the composer autoloader will not scan the filesystem for classes that are not found in the class map, defaults to false."
  212. },
  213. "github-domains": {
  214. "type": "array",
  215. "description": "A list of domains to use in github mode. This is used for GitHub Enterprise setups, defaults to [\"github.com\"].",
  216. "items": {
  217. "type": "string"
  218. }
  219. },
  220. "github-expose-hostname": {
  221. "type": "boolean",
  222. "description": "Defaults to true. If set to false, the OAuth tokens created to access the github API will have a date instead of the machine hostname."
  223. },
  224. "archive-format": {
  225. "type": "string",
  226. "description": "The default archiving format when not provided on cli, defaults to \"tar\"."
  227. },
  228. "archive-dir": {
  229. "type": "string",
  230. "description": "The default archive path when not provided on cli, defaults to \".\"."
  231. }
  232. }
  233. },
  234. "extra": {
  235. "type": ["object", "array"],
  236. "description": "Arbitrary extra data that can be used by plugins, for example, package of type composer-plugin may have a 'class' key defining an installer class name.",
  237. "additionalProperties": true
  238. },
  239. "autoload": {
  240. "type": "object",
  241. "description": "Description of how the package can be autoloaded.",
  242. "properties": {
  243. "psr-0": {
  244. "type": "object",
  245. "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.",
  246. "additionalProperties": true
  247. },
  248. "psr-4": {
  249. "type": "object",
  250. "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.",
  251. "additionalProperties": true
  252. },
  253. "classmap": {
  254. "type": "array",
  255. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  256. },
  257. "files": {
  258. "type": "array",
  259. "description": "This is an array of files that are always required on every request."
  260. },
  261. "exclude-from-classmap": {
  262. "type": "array",
  263. "description": "This is an array of patterns to exclude from autoload classmap generation. (e.g. \"exclude-from-classmap\": [\"/test/\", \"/tests/\", \"/Tests/\"]"
  264. }
  265. }
  266. },
  267. "autoload-dev": {
  268. "type": "object",
  269. "description": "Description of additional autoload rules for development purpose (eg. a test suite).",
  270. "properties": {
  271. "psr-0": {
  272. "type": "object",
  273. "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.",
  274. "additionalProperties": true
  275. },
  276. "psr-4": {
  277. "type": "object",
  278. "description": "This is a hash of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.",
  279. "additionalProperties": true
  280. },
  281. "classmap": {
  282. "type": "array",
  283. "description": "This is an array of directories that contain classes to be included in the class-map generation process."
  284. },
  285. "files": {
  286. "type": "array",
  287. "description": "This is an array of files that are always required on every request."
  288. }
  289. }
  290. },
  291. "archive": {
  292. "type": ["object"],
  293. "description": "Options for creating package archives for distribution.",
  294. "properties": {
  295. "exclude": {
  296. "type": "array",
  297. "description": "A list of patterns for paths to exclude or include if prefixed with an exclamation mark."
  298. }
  299. }
  300. },
  301. "repositories": {
  302. "type": ["object", "array"],
  303. "description": "A set of additional repositories where packages can be found.",
  304. "additionalProperties": true
  305. },
  306. "minimum-stability": {
  307. "type": ["string"],
  308. "description": "The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.",
  309. "pattern": "^dev|alpha|beta|rc|RC|stable$"
  310. },
  311. "prefer-stable": {
  312. "type": ["boolean"],
  313. "description": "If set to true, stable packages will be preferred to dev packages when possible, even if the minimum-stability allows unstable packages."
  314. },
  315. "bin": {
  316. "type": ["array"],
  317. "description": "A set of files that should be treated as binaries and symlinked into bin-dir (from config).",
  318. "items": {
  319. "type": "string"
  320. }
  321. },
  322. "include-path": {
  323. "type": ["array"],
  324. "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.",
  325. "items": {
  326. "type": "string"
  327. }
  328. },
  329. "scripts": {
  330. "type": ["object"],
  331. "description": "Scripts listeners that will be executed before/after some events.",
  332. "properties": {
  333. "pre-install-cmd": {
  334. "type": ["array", "string"],
  335. "description": "Occurs before the install command is executed, contains one or more Class::method callables or shell commands."
  336. },
  337. "post-install-cmd": {
  338. "type": ["array", "string"],
  339. "description": "Occurs after the install command is executed, contains one or more Class::method callables or shell commands."
  340. },
  341. "pre-update-cmd": {
  342. "type": ["array", "string"],
  343. "description": "Occurs before the update command is executed, contains one or more Class::method callables or shell commands."
  344. },
  345. "post-update-cmd": {
  346. "type": ["array", "string"],
  347. "description": "Occurs after the update command is executed, contains one or more Class::method callables or shell commands."
  348. },
  349. "pre-status-cmd": {
  350. "type": ["array", "string"],
  351. "description": "Occurs before the status command is executed, contains one or more Class::method callables or shell commands."
  352. },
  353. "post-status-cmd": {
  354. "type": ["array", "string"],
  355. "description": "Occurs after the status command is executed, contains one or more Class::method callables or shell commands."
  356. },
  357. "pre-package-install": {
  358. "type": ["array", "string"],
  359. "description": "Occurs before a package is installed, contains one or more Class::method callables or shell commands."
  360. },
  361. "post-package-install": {
  362. "type": ["array", "string"],
  363. "description": "Occurs after a package is installed, contains one or more Class::method callables or shell commands."
  364. },
  365. "pre-package-update": {
  366. "type": ["array", "string"],
  367. "description": "Occurs before a package is updated, contains one or more Class::method callables or shell commands."
  368. },
  369. "post-package-update": {
  370. "type": ["array", "string"],
  371. "description": "Occurs after a package is updated, contains one or more Class::method callables or shell commands."
  372. },
  373. "pre-package-uninstall": {
  374. "type": ["array", "string"],
  375. "description": "Occurs before a package has been uninstalled, contains one or more Class::method callables or shell commands."
  376. },
  377. "post-package-uninstall": {
  378. "type": ["array", "string"],
  379. "description": "Occurs after a package has been uninstalled, contains one or more Class::method callables or shell commands."
  380. },
  381. "pre-autoload-dump": {
  382. "type": ["array", "string"],
  383. "description": "Occurs before the autoloader is dumped, contains one or more Class::method callables or shell commands."
  384. },
  385. "post-autoload-dump": {
  386. "type": ["array", "string"],
  387. "description": "Occurs after the autoloader is dumped, contains one or more Class::method callables or shell commands."
  388. },
  389. "post-root-package-install": {
  390. "type": ["array", "string"],
  391. "description": "Occurs after the root-package is installed, contains one or more Class::method callables or shell commands."
  392. },
  393. "post-create-project-cmd": {
  394. "type": ["array", "string"],
  395. "description": "Occurs after the create-project command is executed, contains one or more Class::method callables or shell commands."
  396. }
  397. }
  398. },
  399. "support": {
  400. "type": "object",
  401. "properties": {
  402. "email": {
  403. "type": "string",
  404. "description": "Email address for support.",
  405. "format": "email"
  406. },
  407. "issues": {
  408. "type": "string",
  409. "description": "URL to the issue tracker.",
  410. "format": "uri"
  411. },
  412. "forum": {
  413. "type": "string",
  414. "description": "URL to the forum.",
  415. "format": "uri"
  416. },
  417. "wiki": {
  418. "type": "string",
  419. "description": "URL to the wiki.",
  420. "format": "uri"
  421. },
  422. "irc": {
  423. "type": "string",
  424. "description": "IRC channel for support, as irc://server/channel.",
  425. "format": "uri"
  426. },
  427. "source": {
  428. "type": "string",
  429. "description": "URL to browse or download the sources.",
  430. "format": "uri"
  431. },
  432. "docs": {
  433. "type": "string",
  434. "description": "URL to the documentation.",
  435. "format": "uri"
  436. }
  437. }
  438. },
  439. "non-feature-branches": {
  440. "type": ["array"],
  441. "description": "A set of string or regex patterns for non-numeric branch names that will not be handled as feature branches.",
  442. "items": {
  443. "type": "string"
  444. }
  445. }
  446. }
  447. }