@flarum/cli 2.0.0-beta.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (663) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +178 -48
  3. package/bin/run +2 -1
  4. package/bin/splitsh-lite-darwin +0 -0
  5. package/bin/splitsh-lite-linux +0 -0
  6. package/boilerplate/skeleton/extension/.gitattributes +16 -14
  7. package/boilerplate/skeleton/extension/.github/workflows/backend.yml +2 -6
  8. package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +5 -6
  9. package/boilerplate/skeleton/extension/.github/workflows/phpstan.yml +12 -0
  10. package/boilerplate/skeleton/extension/LICENSE.md +1 -1
  11. package/boilerplate/skeleton/extension/README.md +1 -1
  12. package/boilerplate/skeleton/extension/composer.json +13 -7
  13. package/boilerplate/skeleton/extension/extend.php +2 -2
  14. package/boilerplate/skeleton/extension/gitignore +1 -0
  15. package/boilerplate/skeleton/extension/js/admin.ts +2 -0
  16. package/boilerplate/skeleton/extension/js/forum.ts +2 -0
  17. package/boilerplate/skeleton/extension/js/jest.config.cjs +1 -0
  18. package/boilerplate/skeleton/extension/js/package.json +11 -4
  19. package/boilerplate/skeleton/extension/js/src/admin/extend.js +8 -0
  20. package/boilerplate/skeleton/extension/js/src/admin/extend.ts +8 -0
  21. package/boilerplate/skeleton/extension/js/src/admin/index.js +2 -0
  22. package/boilerplate/skeleton/extension/js/src/admin/index.ts +7 -0
  23. package/boilerplate/skeleton/extension/js/src/common/extend.js +5 -0
  24. package/boilerplate/skeleton/extension/js/src/common/extend.ts +5 -0
  25. package/boilerplate/skeleton/extension/js/src/common/index.ts +5 -0
  26. package/boilerplate/skeleton/extension/js/src/forum/extend.js +8 -0
  27. package/boilerplate/skeleton/extension/js/src/forum/extend.ts +8 -0
  28. package/boilerplate/skeleton/extension/js/src/forum/index.js +2 -0
  29. package/boilerplate/skeleton/extension/js/src/forum/index.ts +7 -0
  30. package/boilerplate/skeleton/extension/js/tests/unit/.gitkeep +0 -0
  31. package/boilerplate/skeleton/extension/js/tsconfig.json +10 -2
  32. package/boilerplate/skeleton/extension/js/tsconfig.test.json +10 -0
  33. package/boilerplate/skeleton/extension/locale/en.yml +1 -1
  34. package/boilerplate/skeleton/extension/phpstan.neon +12 -0
  35. package/boilerplate/skeleton/extension/tests/phpunit.integration.xml +6 -7
  36. package/boilerplate/skeleton/extension/tests/phpunit.unit.xml +5 -10
  37. package/boilerplate/stubs/backend/advanced-api-resource.php +85 -0
  38. package/boilerplate/stubs/backend/api-resource.php +73 -0
  39. package/boilerplate/stubs/backend/command.php +2 -2
  40. package/boilerplate/stubs/backend/controller.php +19 -0
  41. package/boilerplate/stubs/backend/event-listener.php +1 -1
  42. package/boilerplate/stubs/backend/filter.php +25 -0
  43. package/boilerplate/stubs/backend/handler/command.php +6 -20
  44. package/boilerplate/stubs/backend/handler/handler.php +6 -14
  45. package/boilerplate/stubs/backend/integration-test.php +10 -7
  46. package/boilerplate/stubs/backend/job.php +6 -11
  47. package/boilerplate/stubs/backend/mail-driver.php +36 -0
  48. package/boilerplate/stubs/backend/middleware.php +19 -0
  49. package/boilerplate/stubs/backend/model.php +1 -1
  50. package/boilerplate/stubs/backend/notification-blueprint.php +42 -0
  51. package/boilerplate/stubs/backend/notification-driver.php +32 -0
  52. package/boilerplate/stubs/backend/policy.php +1 -1
  53. package/boilerplate/stubs/backend/post-type.php +35 -0
  54. package/boilerplate/stubs/backend/repository.php +2 -10
  55. package/boilerplate/stubs/backend/search/driver.php +13 -0
  56. package/boilerplate/stubs/backend/search/searcher.php +41 -0
  57. package/boilerplate/stubs/backend/service-provider.php +1 -1
  58. package/boilerplate/stubs/backend/validator.php +1 -1
  59. package/boilerplate/stubs/frontend/component.js +1 -1
  60. package/boilerplate/stubs/frontend/forum-page.js +68 -0
  61. package/boilerplate/stubs/frontend/gambit/boolean.js +12 -0
  62. package/boilerplate/stubs/frontend/gambit/key-value.js +16 -0
  63. package/boilerplate/stubs/frontend/modal.js +1 -1
  64. package/boilerplate/stubs/frontend/model.js +1 -1
  65. package/boilerplate/stubs/frontend/notification.js +22 -0
  66. package/boilerplate/stubs/frontend/post-type.js +13 -0
  67. package/boilerplate/stubs/migration.php +1 -1
  68. package/boilerplate/stubs/views/email/html/information.blade.php +8 -0
  69. package/boilerplate/stubs/views/email/html/notification.blade.php +8 -0
  70. package/boilerplate/stubs/views/email/plain/information.blade.php +7 -0
  71. package/boilerplate/stubs/views/email/plain/notification.blade.php +6 -0
  72. package/lib/base-command.d.ts +22 -6
  73. package/lib/base-command.js +114 -56
  74. package/lib/boilersmith/io.d.ts +33 -11
  75. package/lib/boilersmith/io.js +32 -17
  76. package/lib/boilersmith/paths.d.ts +3 -3
  77. package/lib/boilersmith/paths.js +7 -7
  78. package/lib/boilersmith/scaffolding/audit-step-factory.js +12 -12
  79. package/lib/boilersmith/scaffolding/infra-step-factory.js +2 -2
  80. package/lib/boilersmith/scaffolding/init-step-factory.js +5 -5
  81. package/lib/boilersmith/scaffolding/module.d.ts +30 -10
  82. package/lib/boilersmith/scaffolding/module.js +61 -19
  83. package/lib/boilersmith/scaffolding/scaffolder.d.ts +4 -1
  84. package/lib/boilersmith/scaffolding/scaffolder.js +33 -33
  85. package/lib/boilersmith/scaffolding/template-param.d.ts +2 -2
  86. package/lib/boilersmith/scaffolding/template-param.js +2 -2
  87. package/lib/boilersmith/step-manager.d.ts +15 -11
  88. package/lib/boilersmith/step-manager.js +45 -29
  89. package/lib/boilersmith/steps/stub-base.js +4 -4
  90. package/lib/boilersmith/utils/clone-and-fill.js +1 -1
  91. package/lib/boilersmith/utils/commit-async.d.ts +2 -0
  92. package/lib/boilersmith/utils/commit-async.js +15 -0
  93. package/lib/boilersmith/utils/json-leaf-paths.d.ts +2 -2
  94. package/lib/boilersmith/utils/read-tpl.js +2 -2
  95. package/lib/commands/audit/infra.d.ts +2 -5
  96. package/lib/commands/audit/infra.js +31 -9
  97. package/lib/commands/infra.d.ts +2 -10
  98. package/lib/commands/infra.js +20 -14
  99. package/lib/commands/init.d.ts +2 -5
  100. package/lib/commands/init.js +7 -5
  101. package/lib/commands/make/backend/{api-serializer.d.ts → api-resource.d.ts} +2 -5
  102. package/lib/commands/make/backend/api-resource.js +26 -0
  103. package/lib/commands/make/backend/command.d.ts +1 -4
  104. package/lib/commands/make/backend/command.js +3 -4
  105. package/lib/commands/make/backend/{api-controller.d.ts → controller.d.ts} +2 -5
  106. package/lib/commands/make/backend/controller.js +31 -0
  107. package/lib/commands/make/backend/event-listener.d.ts +1 -4
  108. package/lib/commands/make/backend/event-listener.js +2 -3
  109. package/lib/commands/make/backend/{api-serializer-attributes.d.ts → filter.d.ts} +3 -6
  110. package/lib/commands/make/backend/filter.js +26 -0
  111. package/lib/commands/make/backend/handler.d.ts +2 -5
  112. package/lib/commands/make/backend/handler.js +8 -11
  113. package/lib/commands/make/backend/integration-test.d.ts +1 -4
  114. package/lib/commands/make/backend/integration-test.js +4 -6
  115. package/lib/commands/make/backend/job.d.ts +1 -4
  116. package/lib/commands/make/backend/job.js +2 -2
  117. package/lib/commands/make/backend/mail-driver.d.ts +12 -0
  118. package/lib/commands/make/backend/mail-driver.js +29 -0
  119. package/lib/commands/make/backend/middleware.d.ts +11 -0
  120. package/lib/commands/make/backend/middleware.js +26 -0
  121. package/lib/commands/make/backend/migration.d.ts +1 -4
  122. package/lib/commands/make/backend/migration.js +10 -4
  123. package/lib/commands/make/backend/model.d.ts +6 -7
  124. package/lib/commands/make/backend/model.js +69 -449
  125. package/lib/commands/make/backend/notification-blueprint.d.ts +12 -0
  126. package/lib/commands/make/backend/notification-blueprint.js +29 -0
  127. package/lib/commands/make/backend/notification-driver.d.ts +12 -0
  128. package/lib/commands/make/backend/notification-driver.js +29 -0
  129. package/lib/commands/make/backend/policy.d.ts +1 -4
  130. package/lib/commands/make/backend/policy.js +2 -3
  131. package/lib/commands/make/backend/post-type.d.ts +12 -0
  132. package/lib/commands/make/backend/post-type.js +29 -0
  133. package/lib/commands/make/backend/repository.d.ts +1 -4
  134. package/lib/commands/make/backend/repository.js +1 -1
  135. package/lib/commands/make/backend/route.d.ts +1 -4
  136. package/lib/commands/make/backend/route.js +2 -3
  137. package/lib/commands/make/backend/search-driver.d.ts +11 -0
  138. package/lib/commands/make/backend/search-driver.js +51 -0
  139. package/lib/commands/make/backend/service-provider.d.ts +1 -4
  140. package/lib/commands/make/backend/service-provider.js +3 -4
  141. package/lib/commands/make/backend/validator.d.ts +1 -4
  142. package/lib/commands/make/backend/validator.js +2 -2
  143. package/lib/commands/make/frontend/component.d.ts +4 -5
  144. package/lib/commands/make/frontend/component.js +7 -2
  145. package/lib/commands/make/frontend/forum-page.d.ts +11 -0
  146. package/lib/commands/make/frontend/forum-page.js +92 -0
  147. package/lib/commands/make/frontend/gambit.d.ts +11 -0
  148. package/lib/commands/make/frontend/gambit.js +30 -0
  149. package/lib/commands/make/frontend/modal.d.ts +1 -4
  150. package/lib/commands/make/frontend/modal.js +3 -2
  151. package/lib/commands/make/frontend/model.d.ts +6 -7
  152. package/lib/commands/make/frontend/model.js +27 -28
  153. package/lib/commands/make/frontend/notification.d.ts +12 -0
  154. package/lib/commands/make/frontend/notification.js +62 -0
  155. package/lib/commands/make/frontend/post-type.d.ts +12 -0
  156. package/lib/commands/make/frontend/post-type.js +59 -0
  157. package/lib/commands/make/locale.d.ts +11 -0
  158. package/lib/commands/make/locale.js +27 -0
  159. package/lib/commands/make/model.d.ts +12 -0
  160. package/lib/commands/make/model.js +29 -0
  161. package/lib/commands/make/notification.d.ts +11 -0
  162. package/lib/commands/make/notification.js +33 -0
  163. package/lib/commands/make/post-type.d.ts +11 -0
  164. package/lib/commands/make/post-type.js +31 -0
  165. package/lib/commands/monorepo/create.d.ts +12 -0
  166. package/lib/commands/monorepo/create.js +20 -0
  167. package/lib/commands/monorepo/split.d.ts +12 -0
  168. package/lib/commands/monorepo/split.js +19 -0
  169. package/lib/commands/update/js-imports.d.ts +1 -4
  170. package/lib/commands/update/js-imports.js +2 -3
  171. package/lib/commands/upgrade/2.0.d.ts +17 -0
  172. package/lib/commands/upgrade/2.0.js +113 -0
  173. package/lib/help.js +2 -2
  174. package/lib/providers/php-provider.d.ts +7 -1
  175. package/lib/providers/php-provider.js +18 -5
  176. package/lib/steps/extenders/{api-serializer.d.ts → api-resource.d.ts} +1 -1
  177. package/lib/steps/extenders/api-resource.js +38 -0
  178. package/lib/steps/extenders/base.d.ts +1 -1
  179. package/lib/steps/extenders/base.js +13 -1
  180. package/lib/steps/extenders/console-command.js +1 -1
  181. package/lib/steps/extenders/event.js +1 -1
  182. package/lib/steps/extenders/mail-driver.d.ts +5 -0
  183. package/lib/steps/extenders/mail-driver.js +58 -0
  184. package/lib/steps/extenders/middleware.d.ts +5 -0
  185. package/lib/steps/extenders/middleware.js +57 -0
  186. package/lib/steps/extenders/notification-driver.d.ts +5 -0
  187. package/lib/steps/extenders/notification-driver.js +58 -0
  188. package/lib/steps/extenders/notification-type.d.ts +5 -0
  189. package/lib/steps/extenders/notification-type.js +55 -0
  190. package/lib/steps/extenders/policy.js +1 -1
  191. package/lib/steps/extenders/post-type.d.ts +5 -0
  192. package/lib/steps/extenders/post-type.js +42 -0
  193. package/lib/steps/extenders/route.js +11 -2
  194. package/lib/steps/extenders/search-driver.d.ts +5 -0
  195. package/lib/steps/extenders/search-driver.js +38 -0
  196. package/lib/steps/extenders/search-filter.d.ts +5 -0
  197. package/lib/steps/extenders/search-filter.js +67 -0
  198. package/lib/steps/extenders/service-provider.js +1 -1
  199. package/lib/steps/gen-ext-scaffolder.d.ts +4 -4
  200. package/lib/steps/gen-ext-scaffolder.js +264 -58
  201. package/lib/steps/js/base.d.ts +14 -5
  202. package/lib/steps/js/base.js +101 -27
  203. package/lib/steps/js/model.d.ts +4 -7
  204. package/lib/steps/js/model.js +45 -19
  205. package/lib/steps/js/notification.d.ts +7 -0
  206. package/lib/steps/js/notification.js +58 -0
  207. package/lib/steps/js/post-type.d.ts +8 -0
  208. package/lib/steps/js/post-type.js +60 -0
  209. package/lib/steps/js/routes.d.ts +7 -0
  210. package/lib/steps/js/routes.js +63 -0
  211. package/lib/steps/js/search-driver-locale.d.ts +8 -0
  212. package/lib/steps/js/search-driver-locale.js +36 -0
  213. package/lib/steps/js/search-gambit.d.ts +7 -0
  214. package/lib/steps/js/search-gambit.js +51 -0
  215. package/lib/steps/locale/base.d.ts +32 -0
  216. package/lib/steps/locale/base.js +97 -0
  217. package/lib/steps/misc/composer.js +2 -2
  218. package/lib/steps/misc/git.d.ts +1 -1
  219. package/lib/steps/misc/git.js +3 -3
  220. package/lib/steps/misc/npm.d.ts +11 -0
  221. package/lib/steps/misc/npm.js +19 -0
  222. package/lib/steps/misc/yarn.js +2 -2
  223. package/lib/steps/monorepo/create.d.ts +19 -0
  224. package/lib/steps/monorepo/create.js +187 -0
  225. package/lib/steps/monorepo/split.d.ts +14 -0
  226. package/lib/steps/monorepo/split.js +99 -0
  227. package/lib/steps/stubs/backend/advanced-api-resource.d.ts +13 -0
  228. package/lib/steps/stubs/backend/advanced-api-resource.js +81 -0
  229. package/lib/steps/stubs/backend/{api-serializer.d.ts → api-resource.d.ts} +2 -2
  230. package/lib/steps/stubs/backend/{api-serializer.js → api-resource.js} +12 -9
  231. package/lib/steps/stubs/backend/command.d.ts +2 -21
  232. package/lib/steps/stubs/backend/command.js +15 -1
  233. package/lib/steps/stubs/backend/{api-controller.d.ts → controller.d.ts} +4 -14
  234. package/lib/steps/stubs/backend/controller.js +40 -0
  235. package/lib/steps/stubs/backend/event-listener.d.ts +1 -1
  236. package/lib/steps/stubs/backend/event-listener.js +3 -1
  237. package/lib/steps/stubs/backend/filter.d.ts +8 -0
  238. package/lib/steps/stubs/backend/filter.js +44 -0
  239. package/lib/steps/stubs/backend/handler-command.d.ts +2 -27
  240. package/lib/steps/stubs/backend/handler-command.js +3 -1
  241. package/lib/steps/stubs/backend/handler.d.ts +1 -1
  242. package/lib/steps/stubs/backend/handler.js +5 -1
  243. package/lib/steps/stubs/backend/integration-test.d.ts +1 -1
  244. package/lib/steps/stubs/backend/integration-test.js +1 -4
  245. package/lib/steps/stubs/backend/job.d.ts +1 -1
  246. package/lib/steps/stubs/backend/job.js +1 -0
  247. package/lib/steps/stubs/backend/mail-driver.d.ts +7 -0
  248. package/lib/steps/stubs/backend/mail-driver.js +30 -0
  249. package/lib/steps/stubs/backend/middleware.d.ts +22 -0
  250. package/lib/steps/stubs/backend/middleware.js +31 -0
  251. package/lib/steps/stubs/backend/migration.js +6 -3
  252. package/lib/steps/stubs/backend/model.d.ts +2 -24
  253. package/lib/steps/stubs/backend/model.js +3 -5
  254. package/lib/steps/stubs/backend/notification-blueprint.d.ts +7 -0
  255. package/lib/steps/stubs/backend/notification-blueprint.js +44 -0
  256. package/lib/steps/stubs/backend/notification-driver.d.ts +7 -0
  257. package/lib/steps/stubs/backend/notification-driver.js +30 -0
  258. package/lib/steps/stubs/backend/policy.d.ts +1 -1
  259. package/lib/steps/stubs/backend/policy.js +3 -1
  260. package/lib/steps/stubs/backend/post-type.d.ts +7 -0
  261. package/lib/steps/stubs/backend/post-type.js +44 -0
  262. package/lib/steps/stubs/backend/repository.d.ts +1 -1
  263. package/lib/steps/stubs/backend/repository.js +3 -1
  264. package/lib/steps/stubs/backend/search-driver-searcher.d.ts +24 -0
  265. package/lib/steps/stubs/backend/search-driver-searcher.js +32 -0
  266. package/lib/steps/stubs/backend/search-driver.d.ts +8 -0
  267. package/lib/steps/stubs/backend/search-driver.js +49 -0
  268. package/lib/steps/stubs/backend/service-provider.d.ts +1 -1
  269. package/lib/steps/stubs/backend/service-provider.js +1 -0
  270. package/lib/steps/stubs/backend/validator.d.ts +1 -1
  271. package/lib/steps/stubs/backend/validator.js +1 -0
  272. package/lib/steps/stubs/flarum-base.js +1 -1
  273. package/lib/steps/stubs/frontend/component.d.ts +0 -5
  274. package/lib/steps/stubs/frontend/component.js +1 -0
  275. package/lib/steps/stubs/frontend/forum-page.d.ts +25 -0
  276. package/lib/steps/stubs/frontend/forum-page.js +37 -0
  277. package/lib/steps/stubs/frontend/gambit.d.ts +7 -0
  278. package/lib/steps/stubs/frontend/gambit.js +50 -0
  279. package/lib/steps/stubs/frontend/modal.d.ts +0 -5
  280. package/lib/steps/stubs/frontend/modal.js +1 -0
  281. package/lib/steps/stubs/frontend/model.d.ts +8 -1
  282. package/lib/steps/stubs/frontend/model.js +6 -0
  283. package/lib/steps/stubs/frontend/notification.d.ts +11 -0
  284. package/lib/steps/stubs/frontend/notification.js +48 -0
  285. package/lib/steps/stubs/frontend/post-type.d.ts +11 -0
  286. package/lib/steps/stubs/frontend/post-type.js +48 -0
  287. package/lib/steps/stubs/js-base.js +12 -5
  288. package/lib/steps/stubs/php-base.js +13 -9
  289. package/lib/steps/update/js-imports.js +9 -3
  290. package/lib/steps/upgrade/twopointoh/backend/email-views.d.ts +18 -0
  291. package/lib/steps/upgrade/twopointoh/backend/email-views.js +81 -0
  292. package/lib/steps/upgrade/twopointoh/backend/filesystem.d.ts +8 -0
  293. package/lib/steps/upgrade/twopointoh/backend/filesystem.js +40 -0
  294. package/lib/steps/upgrade/twopointoh/backend/intervention-image.d.ts +8 -0
  295. package/lib/steps/upgrade/twopointoh/backend/intervention-image.js +44 -0
  296. package/lib/steps/upgrade/twopointoh/backend/json-api.d.ts +12 -0
  297. package/lib/steps/upgrade/twopointoh/backend/json-api.js +111 -0
  298. package/lib/steps/upgrade/twopointoh/backend/mailer.d.ts +8 -0
  299. package/lib/steps/upgrade/twopointoh/backend/mailer.js +37 -0
  300. package/lib/steps/upgrade/twopointoh/backend/misc.d.ts +8 -0
  301. package/lib/steps/upgrade/twopointoh/backend/misc.js +42 -0
  302. package/lib/steps/upgrade/twopointoh/backend/phpunit.d.ts +8 -0
  303. package/lib/steps/upgrade/twopointoh/backend/phpunit.js +52 -0
  304. package/lib/steps/upgrade/twopointoh/backend/search.d.ts +28 -0
  305. package/lib/steps/upgrade/twopointoh/backend/search.js +200 -0
  306. package/lib/steps/upgrade/twopointoh/base.d.ts +58 -0
  307. package/lib/steps/upgrade/twopointoh/base.js +284 -0
  308. package/lib/steps/upgrade/twopointoh/dependencies.d.ts +10 -0
  309. package/lib/steps/upgrade/twopointoh/dependencies.js +108 -0
  310. package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.d.ts +26 -0
  311. package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.js +418 -0
  312. package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.d.ts +12 -0
  313. package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.js +75 -0
  314. package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.d.ts +13 -0
  315. package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.js +126 -0
  316. package/lib/steps/upgrade/twopointoh/frontend/format.d.ts +8 -0
  317. package/lib/steps/upgrade/twopointoh/frontend/format.js +32 -0
  318. package/lib/steps/upgrade/twopointoh/frontend/misc.d.ts +17 -0
  319. package/lib/steps/upgrade/twopointoh/frontend/misc.js +433 -0
  320. package/lib/steps/upgrade/twopointoh/infra.d.ts +10 -0
  321. package/lib/steps/upgrade/twopointoh/infra.js +51 -0
  322. package/lib/steps/upgrade/twopointoh/less.d.ts +12 -0
  323. package/lib/steps/upgrade/twopointoh/less.js +217 -0
  324. package/lib/utils/add-extenders.d.ts +2 -0
  325. package/lib/utils/add-extenders.js +115 -0
  326. package/lib/utils/ast.d.ts +22 -0
  327. package/lib/utils/ast.js +235 -0
  328. package/lib/utils/composer.d.ts +2 -1
  329. package/lib/utils/migration.js +3 -1
  330. package/lib/utils/model-name.d.ts +1 -0
  331. package/lib/utils/model-name.js +7 -3
  332. package/lib/utils/monorepo.d.ts +24 -0
  333. package/lib/utils/monorepo.js +24 -0
  334. package/lib/utils/validation.d.ts +6 -1
  335. package/lib/utils/validation.js +15 -0
  336. package/oclif.manifest.json +1 -1
  337. package/package.json +27 -14
  338. package/php-subsystem/composer.json +11 -9
  339. package/php-subsystem/composer.lock +66 -71
  340. package/php-subsystem/index.php +41 -6
  341. package/php-subsystem/src/CustomPrettyPrinter.php +1 -1
  342. package/php-subsystem/src/ExtenderUtil.php +7 -13
  343. package/php-subsystem/src/NodeUtil.php +72 -0
  344. package/php-subsystem/src/NodeVisitors/AddExtender.php +28 -12
  345. package/php-subsystem/src/NodeVisitors/AddUses.php +24 -0
  346. package/php-subsystem/src/NodeVisitors/ChangeSignatures.php +200 -0
  347. package/php-subsystem/src/NodeVisitors/ReplaceUses.php +175 -0
  348. package/php-subsystem/src/Upgrade/Replacement.php +51 -0
  349. package/php-subsystem/src/Upgrade/ReplacementResult.php +17 -0
  350. package/php-subsystem/src/Upgrade/TwoPointOh/EmailViews.php +94 -0
  351. package/php-subsystem/src/Upgrade/TwoPointOh/Filesystem.php +88 -0
  352. package/php-subsystem/src/Upgrade/TwoPointOh/InterventionImage.php +86 -0
  353. package/php-subsystem/src/Upgrade/TwoPointOh/JsonApi.php +186 -0
  354. package/php-subsystem/src/Upgrade/TwoPointOh/Misc.php +564 -0
  355. package/php-subsystem/src/Upgrade/TwoPointOh/PhpUnit.php +241 -0
  356. package/php-subsystem/src/Upgrade/TwoPointOh/Search.php +589 -0
  357. package/php-subsystem/vendor/autoload.php +18 -0
  358. package/php-subsystem/vendor/bin/php-parse +119 -0
  359. package/php-subsystem/vendor/composer/ClassLoader.php +166 -32
  360. package/php-subsystem/vendor/composer/InstalledVersions.php +350 -209
  361. package/php-subsystem/vendor/composer/autoload_classmap.php +1 -1
  362. package/php-subsystem/vendor/composer/autoload_namespaces.php +1 -1
  363. package/php-subsystem/vendor/composer/autoload_psr4.php +1 -1
  364. package/php-subsystem/vendor/composer/autoload_real.php +3 -22
  365. package/php-subsystem/vendor/composer/installed.json +56 -61
  366. package/php-subsystem/vendor/composer/installed.php +29 -30
  367. package/php-subsystem/vendor/composer/platform_check.php +2 -2
  368. package/php-subsystem/vendor/nikic/php-parser/README.md +21 -13
  369. package/php-subsystem/vendor/nikic/php-parser/bin/php-parse +12 -11
  370. package/php-subsystem/vendor/nikic/php-parser/composer.json +41 -39
  371. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +58 -11
  372. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +54 -25
  373. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +11 -4
  374. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +87 -0
  375. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +116 -0
  376. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +8 -9
  377. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +22 -5
  378. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +26 -7
  379. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +31 -13
  380. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +5 -5
  381. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +69 -26
  382. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +47 -18
  383. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +6 -5
  384. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +25 -28
  385. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +31 -8
  386. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +8 -8
  387. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder.php +2 -3
  388. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +85 -70
  389. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +119 -71
  390. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +1 -2
  391. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment.php +35 -67
  392. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +3 -3
  393. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +17 -9
  394. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Error.php +24 -33
  395. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +6 -9
  396. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +2 -3
  397. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +2 -3
  398. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +11 -7
  399. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +36 -22
  400. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +24 -14
  401. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php +237 -0
  402. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +63 -69
  403. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +15 -10
  404. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +74 -92
  405. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +11 -18
  406. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +10 -15
  407. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +45 -0
  408. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +19 -25
  409. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +6 -10
  410. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +22 -29
  411. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
  412. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +31 -0
  413. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +6 -5
  414. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +10 -5
  415. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +70 -491
  416. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php +69 -0
  417. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +23 -24
  418. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +13 -14
  419. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php +43 -0
  420. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +9 -10
  421. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +5 -7
  422. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php +36 -0
  423. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +13 -0
  424. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php +12 -13
  425. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php +37 -0
  426. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +10 -11
  427. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +1 -39
  428. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +11 -11
  429. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +35 -30
  430. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +9 -10
  431. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +2 -3
  432. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +2 -3
  433. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +2 -3
  434. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +2 -3
  435. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +2 -3
  436. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +2 -3
  437. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +2 -3
  438. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +2 -3
  439. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +2 -3
  440. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +2 -3
  441. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +2 -3
  442. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +2 -3
  443. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +2 -3
  444. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +7 -8
  445. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +9 -10
  446. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +4 -5
  447. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +4 -5
  448. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +4 -5
  449. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +4 -5
  450. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +4 -5
  451. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +4 -5
  452. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +4 -5
  453. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +4 -5
  454. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +4 -5
  455. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +4 -5
  456. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +4 -5
  457. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +4 -5
  458. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +4 -5
  459. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +4 -5
  460. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +4 -5
  461. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +4 -5
  462. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +4 -5
  463. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +4 -5
  464. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +4 -5
  465. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +4 -5
  466. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +4 -5
  467. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +4 -5
  468. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +4 -5
  469. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +4 -5
  470. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +4 -5
  471. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +4 -5
  472. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +4 -5
  473. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +8 -11
  474. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +7 -8
  475. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +7 -8
  476. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +35 -0
  477. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +2 -3
  478. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +2 -3
  479. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +5 -6
  480. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +2 -3
  481. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +2 -3
  482. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +2 -3
  483. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +2 -3
  484. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +5 -6
  485. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +12 -12
  486. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +7 -8
  487. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +34 -27
  488. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +1 -32
  489. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +7 -8
  490. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +7 -8
  491. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +5 -6
  492. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +7 -8
  493. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +7 -8
  494. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +10 -11
  495. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +15 -12
  496. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +13 -14
  497. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +11 -11
  498. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +7 -8
  499. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +12 -8
  500. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +8 -7
  501. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +18 -13
  502. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +17 -12
  503. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +18 -13
  504. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +10 -10
  505. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +7 -8
  506. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +7 -8
  507. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +6 -7
  508. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +7 -8
  509. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +7 -8
  510. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +10 -10
  511. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +9 -9
  512. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +19 -14
  513. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +11 -11
  514. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +12 -13
  515. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +6 -7
  516. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +7 -8
  517. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +7 -8
  518. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +6 -7
  519. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +7 -8
  520. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +10 -11
  521. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +1 -2
  522. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +6 -9
  523. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php +13 -13
  524. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php +32 -0
  525. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +27 -0
  526. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +8 -9
  527. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +8 -9
  528. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +8 -9
  529. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +80 -53
  530. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +10 -11
  531. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +47 -23
  532. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php +37 -0
  533. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +1 -68
  534. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +1 -29
  535. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +1 -28
  536. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php +78 -0
  537. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php +82 -0
  538. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php +34 -0
  539. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +1 -71
  540. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +4 -5
  541. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +4 -5
  542. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +4 -5
  543. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +4 -5
  544. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +4 -5
  545. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +4 -5
  546. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +4 -5
  547. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +4 -5
  548. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +4 -5
  549. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +44 -24
  550. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +1 -2
  551. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php +39 -0
  552. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php +29 -0
  553. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +8 -9
  554. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +10 -11
  555. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +11 -12
  556. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +33 -27
  557. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +15 -15
  558. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +66 -71
  559. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +48 -61
  560. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +7 -8
  561. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +8 -9
  562. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +1 -32
  563. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +12 -12
  564. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +9 -10
  565. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +7 -8
  566. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +9 -10
  567. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +7 -8
  568. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +11 -12
  569. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +17 -13
  570. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +7 -8
  571. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +7 -8
  572. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +19 -15
  573. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +20 -17
  574. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +31 -27
  575. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +7 -8
  576. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +7 -8
  577. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +16 -14
  578. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +7 -8
  579. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +18 -15
  580. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +7 -8
  581. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +13 -10
  582. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +7 -8
  583. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +11 -12
  584. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +4 -5
  585. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +35 -36
  586. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +1 -32
  587. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +8 -9
  588. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +1 -35
  589. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +8 -8
  590. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +9 -10
  591. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +8 -9
  592. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +12 -13
  593. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +9 -10
  594. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +3 -4
  595. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +10 -8
  596. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +11 -12
  597. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +7 -8
  598. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +1 -50
  599. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +16 -16
  600. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +9 -10
  601. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +1 -2
  602. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +8 -11
  603. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php +55 -0
  604. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +2 -3
  605. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
  606. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node.php +24 -29
  607. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +20 -20
  608. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +169 -82
  609. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +28 -19
  610. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +71 -84
  611. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +4 -7
  612. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +1 -2
  613. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php +82 -0
  614. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +4 -5
  615. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +6 -7
  616. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +40 -24
  617. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +2 -3
  618. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +8 -11
  619. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php +59 -7
  620. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +1 -2
  621. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2011 -2058
  622. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php +2717 -0
  623. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser.php +9 -3
  624. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +466 -248
  625. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +31 -33
  626. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php +164 -0
  627. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +419 -338
  628. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php +51 -0
  629. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +587 -431
  630. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Token.php +18 -0
  631. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php +63 -0
  632. package/boilerplate/stubs/backend/api-controller/create.php +0 -53
  633. package/boilerplate/stubs/backend/api-controller/delete.php +0 -52
  634. package/boilerplate/stubs/backend/api-controller/list.php +0 -61
  635. package/boilerplate/stubs/backend/api-controller/normal.php +0 -29
  636. package/boilerplate/stubs/backend/api-controller/show.php +0 -48
  637. package/boilerplate/stubs/backend/api-controller/update.php +0 -54
  638. package/boilerplate/stubs/backend/api-serializer.php +0 -36
  639. package/lib/commands/make/backend/api-controller.js +0 -27
  640. package/lib/commands/make/backend/api-serializer-attributes.js +0 -15
  641. package/lib/commands/make/backend/api-serializer.js +0 -15
  642. package/lib/steps/extenders/api-serializer.js +0 -77
  643. package/lib/steps/stubs/backend/api-controller.js +0 -62
  644. package/lib/steps/stubs/frontend/migration.js +0 -1
  645. package/php-subsystem/vendor/nikic/php-parser/.editorconfig +0 -9
  646. package/php-subsystem/vendor/nikic/php-parser/grammar/README.md +0 -30
  647. package/php-subsystem/vendor/nikic/php-parser/grammar/parser.template +0 -106
  648. package/php-subsystem/vendor/nikic/php-parser/grammar/php5.y +0 -1026
  649. package/php-subsystem/vendor/nikic/php-parser/grammar/php7.y +0 -1152
  650. package/php-subsystem/vendor/nikic/php-parser/grammar/phpyLang.php +0 -192
  651. package/php-subsystem/vendor/nikic/php-parser/grammar/rebuildParsers.php +0 -81
  652. package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.template +0 -17
  653. package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.y +0 -115
  654. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +0 -47
  655. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +0 -76
  656. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +0 -23
  657. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +0 -105
  658. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +0 -30
  659. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +0 -55
  660. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +0 -2630
  661. package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +0 -145
  662. /package/{lib/steps/stubs/frontend/migration.d.ts → boilerplate/skeleton/extension/js/tests/integration/.gitkeep} +0 -0
  663. /package/boilerplate/skeleton/extension/js/{webpack.config.js → webpack.config.cjs} +0 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Stichting Flarum (Flarum Foundation)
3
+ Copyright (c) 2021-2024 Stichting Flarum (Flarum Foundation)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -3,41 +3,53 @@
3
3
  A CLI for developing Flarum extensions</p>
4
4
 
5
5
  <p align=center>
6
- <a href="https://oclif.io"><img alt"oclif" src="https://img.shields.io/badge/cli-oclif-brightgreen.svg"></a>
7
- <a href="https://npmjs.org/package/@flarum/cli"><img alt"Version" src="https://img.shields.io/npm/v/@flarum/cli.svg"></a>
8
- <a href="https://npmjs.org/package/@flarum/cli"><img alt"Downloads/week" src="https://img.shields.io/npm/dw/@flarum/cli.svg"></a>
9
- <a href="https://github.com/flarum/cli/blob/master/package.json"><img alt"License" src="https://img.shields.io/npm/l/@flarum/cli.svg"></a>
6
+ <a href="https://oclif.io"><img alt="oclif" src="https://img.shields.io/badge/cli-oclif-brightgreen.svg"></a>
7
+ <a href="https://npmjs.org/package/@flarum/cli"><img alt="Version" src="https://img.shields.io/npm/v/@flarum/cli.svg"></a>
8
+ <a href="https://npmjs.org/package/@flarum/cli"><img alt="Downloads/week" src="https://img.shields.io/npm/dw/@flarum/cli.svg"></a>
9
+ <a href="https://github.com/flarum/cli/blob/master/package.json"><img alt="License" src="https://img.shields.io/npm/l/@flarum/cli.svg"></a>
10
10
  <br>
11
- <img width=720 src="https://sycho9.github.io/flarum-cli.svg" alt="terminal_example">
12
11
  </p>
13
12
 
14
- <!-- toc -->
15
- * [Introduction](#introduction)
16
- * [Installation](#installation)
17
- * [Usage](#usage)
18
- * [Commands](#commands)
19
- <!-- tocstop -->
13
+ | Version | Node.js | Flarum | PHP |
14
+ |---------|---------|--------|--------|
15
+ | 3.x | >= 18.x | >= 2.0 | >= 8.0 |
16
+ | 1.x-2.x | >= 12.x | >= 1.0 | >= 7.2 |
20
17
 
21
- # Introduction
22
- One of our core values is ***Framework First***, Flarum is as much a framework for extension development as it is a forum platform.
18
+ ## Introduction
19
+
20
+ One of our core values is **_Framework First_**, Flarum is as much a framework for extension development as it is a forum platform.
23
21
 
24
22
  This tool was built to simplify the development of Flarum extensions by automating some repetitive and menial tasks. It allows to generate boilerplate skeleton for a new extension, common backend classes and frontend components, extenders, as well as other maintenance tasks.
25
23
 
26
- # Installation
24
+ ## Installation
25
+
27
26
  <!-- installation -->
27
+
28
28
  ```sh-session
29
29
  $ npm install -g @flarum/cli
30
30
  ```
31
+
31
32
  <!-- installationstop -->
32
33
 
33
- # Usage
34
+ ## Updating
35
+
36
+ <!-- updating -->
37
+
38
+ ```sh-session
39
+ $ npm update -g @flarum/cli
40
+ ```
41
+
42
+ <!-- updatingstop -->
43
+
44
+ ## Usage
45
+
34
46
  <!-- usage -->
35
47
  ```sh-session
36
48
  $ npm install -g @flarum/cli
37
49
  $ flarum-cli COMMAND
38
50
  running command...
39
51
  $ flarum-cli (-v|--version|version)
40
- @flarum/cli/2.0.0-beta.8 linux-x64 node-v16.13.0
52
+ @flarum/cli/3.0.0 linux-x64 node-v18.19.1
41
53
  $ flarum-cli --help [COMMAND]
42
54
  USAGE
43
55
  $ flarum-cli COMMAND
@@ -59,29 +71,116 @@ or
59
71
  flarum-cli --help
60
72
  ```
61
73
 
62
- # Commands
63
- * `flarum-cli help [COMMAND]`
64
- * `flarum-cli infra backend-testing [PATH]`
65
- * `flarum-cli init [PATH]`
66
- * `flarum-cli make backend api-controller [PATH]`
67
- * `flarum-cli make backend api-serializer [PATH]`
68
- * `flarum-cli make backend api-serializer-attributes [PATH]`
69
- * `flarum-cli make backend command [PATH]`
70
- * `flarum-cli make backend event-listener [PATH]`
71
- * `flarum-cli make backend handler [PATH]`
72
- * `flarum-cli make backend integration-test [PATH]`
73
- * `flarum-cli make backend job [PATH]`
74
- * `flarum-cli make backend migration [PATH]`
75
- * `flarum-cli make backend model [PATH]`
76
- * `flarum-cli make backend policy [PATH]`
77
- * `flarum-cli make backend repository [PATH]`
78
- * `flarum-cli make backend route [PATH]`
79
- * `flarum-cli make backend service-provider [PATH]`
80
- * `flarum-cli make backend validator [PATH]`
81
- * `flarum-cli make frontend component [PATH]`
82
- * `flarum-cli make frontend modal [PATH]`
83
- * `flarum-cli make frontend model [PATH]`
84
- * `flarum-cli update js-imports [PATH]`
74
+ ## Commands
75
+
76
+ The CLI has different types of commands for different tasks:
77
+
78
+ **Initialisation**
79
+
80
+ - `flarum-cli init [PATH]`: Generates a blank extension skeleton, including all recommended infrastructure.
81
+
82
+ **Infrastructure**: See the [infrastructure](#infrastructure-modules) section for more information.
83
+
84
+ - `flarum-cli infra [MODULE] [PATH]`: Adds (or updates) infrastructure for some part of extension infrastructure. You can see all available modules by running `fl-dev infra --help`.
85
+
86
+ **Audit**: These commands help you make sure your extension is up-to-date.
87
+
88
+ - `flarum-cli audit infra [--monorepo] [--fix]` Check that infrastructure files are up-to-date for all enabled modules.
89
+
90
+ **Backend/Frontend Boilerplate Generation**: These commands generate boilerplate code for different parts of an extension.
91
+
92
+ - `flarum-cli make model [className] [PATH] [-n|--no-interaction]`: Generates a backend model, the corresponding table migration, policy, API resource, routes, frontend equivalent, and related extenders.
93
+ - `flarum-cli make notification [className] [PATH] [-n|--no-interaction]`: Generates a backend notification blueprint, the corresponding backend extender, and the frontend equivalent.
94
+ - `flarum-cli make post-type [className] [PATH] [-n|--no-interaction]`: Generates a post type, the corresponding extenders, and the frontend equivalent.
95
+
96
+ **Localized text generation**: This command generates a locale key-value pair for a given string.
97
+
98
+ - `flarum-cli make locale [key] [value] [PATH] [-n|--no-interaction]`
99
+
100
+ **Backend Boilerplate Generation**: Generates different types of backend classes and/or extenders, ready to be used.
101
+
102
+ - `flarum-cli make backend model [className] [PATH] [-n|--no-interaction]`
103
+ - `flarum-cli make backend controller [className] [PATH] [-n|--no-interaction]`
104
+ - `flarum-cli make backend api-resource [PATH] [-n|--no-interaction]`
105
+ - `flarum-cli make backend command [className] [PATH] [-n|--no-interaction]`
106
+ - `flarum-cli make backend event-listener [PATH] [-n|--no-interaction]`
107
+ - `flarum-cli make backend handler [className] [PATH] [-n|--no-interaction]`
108
+ - `flarum-cli make backend integration-test [className] [PATH] [-n|--no-interaction]`
109
+ - `flarum-cli make backend job [className] [PATH] [-n|--no-interaction]`
110
+ - `flarum-cli make backend migration [name] [PATH] [-n|--no-interaction]`
111
+ - `flarum-cli make backend policy [PATH] [-n|--no-interaction]`
112
+ - `flarum-cli make backend repository [PATH] [-n|--no-interaction]`
113
+ - `flarum-cli make backend route [PATH] [-n|--no-interaction]`
114
+ - `flarum-cli make backend service-provider [className] [PATH] [-n|--no-interaction]`
115
+ - `flarum-cli make backend validator [className] [PATH] [-n|--no-interaction]`
116
+ - `flarum-cli make backend filter [className] [PATH] [-n|--no-interaction]`
117
+ - `flarum-cli make backend notification-blueprint [className] [PATH] [-n|--no-interaction]`
118
+ - `flarum-cli make backend notification-driver [className] [PATH] [-n|--no-interaction]`
119
+ - `flarum-cli make backend post-type [className] [PATH] [-n|--no-interaction]`
120
+ - `flarum-cli make backend mail-driver [className] [PATH] [-n|--no-interaction]`
121
+
122
+ **Frontend Boilerplate Generation**: Generate frontend components/classes, ready to be used.
123
+
124
+ - `flarum-cli make frontend component [frontend] [className] [PATH] [-n|--no-interaction]`
125
+ - `flarum-cli make frontend modal [frontend] [className] [PATH] [-n|--no-interaction]`
126
+ - `flarum-cli make frontend model [className] [PATH] [-n|--no-interaction]`
127
+ - `flarum-cli make frontend forum-page [className] [routeName] [routePath] [PATH] [-n|--no-interaction]`
128
+ - `flarum-cli make frontend gambit [PATH] [-n|--no-interaction]`
129
+ - `flarum-cli make frontend notification [className] [PATH] [-n|--no-interaction]`
130
+ - `flarum-cli make frontend post-type [className] [PATH] [-n|--no-interaction]`
131
+
132
+ **Code Updates**: These commands help update extensions for newer versions of Flarum.
133
+
134
+ - `flarum-cli update js-imports [PATH]`: Adds admin/forum/common namespaces to all JS imports from flarum core.
135
+
136
+ _And of course, you can always use the help command to see a list of all available commands with their descriptions:_
137
+
138
+ - `flarum-cli help [COMMAND]`
139
+
140
+ All commands can use a `--no-interaction` flag to proceed with default values for prompts when possible.
141
+
142
+ ## Infrastructure Modules
143
+
144
+ If you maintain more than just a few extensions, keeping the infrastructure up to date can be very tedious.
145
+ We heavily value developer experience, and make it a point to support automated testing, static analysis, formatting, and other tools
146
+ that help you work more happily and efficiently. However, all this means that there's a lot of config files to keep track of.
147
+
148
+ The idea behind Flarum CLI's infrastructure modules is simple: the config for some feature is associated with a "module".
149
+ For example, the "typescript" module includes:
150
+
151
+ - The `js/tsconfig.json` file
152
+ - Dependency reqs for `typescript`, `typescript-coverage-report`, and `flarum-tsconfig` in the `package.json` file.
153
+ - Script configuration to check type safety and type coverage in the `package.json` file.
154
+
155
+ So to enable the `typescript` module, all Flarum CLI has to do is update those files and JSON config keys to the latest version.
156
+
157
+ Please note that running `flarum-cli infra` or `flarum-cli audit infra --fix` will only add new files/keys and overwrite existing ones; it will not delete old files or config keys.
158
+
159
+ Also, we strongly recommend carefully looking over the changes made by these commands before committing them: they should work the vast majority of the time, but there could be some corner cases.
160
+
161
+ ### Excluding Files
162
+
163
+ Sometimes, you'll want to customize some of these configuration files, and prevent `flarum-cli infra [MODULE]` or `flarum-cli audit infra --fix` from overriding your changes. You can also exclude any files from these updates by adding their relative path to the "extra.flarum-cli.excludeScaffolding" key's array in your extension's `composer.json` file. For example, if you wanted to exclude your tsconfig file from any updates by the infra system, your `composer.json` should look as follows:
164
+
165
+ ```json
166
+ {
167
+ ...
168
+ "extra": {
169
+ "flarum-cli": {
170
+ "excludeScaffolding": [
171
+ "js/tsconfig.json"
172
+ ],
173
+ "excludeScaffoldingConfigKeys": {
174
+ "composer.json": [
175
+ "scripts.test:setup"
176
+ ],
177
+ ...
178
+ },
179
+ ...
180
+ }
181
+ ...
182
+ }
183
+ ```
85
184
 
86
185
  ## For Maintainers
87
186
 
@@ -99,7 +198,7 @@ The base command is implemented at [src/base-command.ts](https://github.com/flar
99
198
  3. Confirm we are in the right directory
100
199
  4. Confirm that files will be overwritten / clear files as needed
101
200
  5. Run a set of registered steps
102
- 6. Tell the user which steps ran
201
+ 6. Tell the user which steps ran, or display any errors
103
202
  7. Show a goodbye message
104
203
 
105
204
  Actual functionality is implemented at the step layer.
@@ -117,7 +216,7 @@ More documentation (and functionality!) will be added later.
117
216
 
118
217
  #### What are steps?
119
218
 
120
- Steps represent granular operations. Some are bigger and some are smaller, but they include:
219
+ Steps represent meaningful, granular operations. Some are bigger and some are smaller, but they include:
121
220
 
122
221
  - Initializing an extension from boilerplate
123
222
  - Updating some part of an extension from boilerplate (like adding backend testing)
@@ -132,9 +231,10 @@ If some subtask might be needed by multiple commands, that should be a step too.
132
231
  The actual logic of a step is implemented in the async `run` method. This method takes:
133
232
 
134
233
  - An in-memory filesystem object (through `mem-fs`)
135
- - A path provider, which is a class that can be used to get paths relative to the extension root, the working directory, the requested directory, and the CLI's boilerplate directory
136
- - A param provider, which can be used to prompt the user for parameters. We'll discuss this more soon.
137
- - A "php provider", which can be used to interact with the PHP subsystem to add extenders to extend.php.
234
+ - A paths object, which is a class that can be used to get paths relative to the extension root, the working directory, the requested directory (if the command was run with the `path` arg specified), and the monorepo directory (if in a subdirectory of a monorepo).
235
+ - An `io` instance, which can be used to prompt the user for input or display outputs / errors.
236
+ - An object of "providers", which represent additional functionality. For Flarum commands, these are:
237
+ - A "php provider", which can be used to interact with the PHP subsystem to add extenders to extend.php.
138
238
 
139
239
  Steps should modify the in-memory filesystem with their changes and return it.
140
240
 
@@ -159,7 +259,6 @@ Sharing parameters is done via the following process:
159
259
  - What the param is consumed at
160
260
  - If the param value is falsy, should the consumer step run at all? Useful for variable dependencies.
161
261
 
162
-
163
262
  For example:
164
263
 
165
264
  ```ts
@@ -195,7 +294,6 @@ For example:
195
294
  .run(new Paths({...}), new PromptsIO(), {php: new PhpProvider(...)});
196
295
  ```
197
296
 
198
-
199
297
  #### Step Composability and Atomic Groups
200
298
 
201
299
  As noted above, steps should work by modifying and returning an in-memory filesystem.
@@ -214,8 +312,6 @@ Steps for generating extenders should use `src/steps/extenders/base`, where all
214
312
 
215
313
  Steps for generating templates from php stubs should use `src/steps/stubs/php-base`, where they just need to describe what stub file they use, which params they need, and a recommended namespace where the generated file should be placed.
216
314
 
217
- Steps for `infra` operations (copying over some portion of the default skeleton, for operations like adding/updating backend testing or TypeScript config) shouls use `src/steps/infra/base`, where all they need to indicate is a list of files from the boilerplate they copy over, and an object describing which JSON config keys should be copied from the boilerplate to the extension for various JSON files.
218
-
219
315
  ### Testing
220
316
 
221
317
  Most of this architecture was driven by TDD and BDD development, allowing for a highly decoupled system.
@@ -225,3 +321,37 @@ Any additions of steps, modifications of providers, or changes of functionality
225
321
  The 3 base step types actually provide a simple interface to generate test cases. See the relevant test files for more info.
226
322
 
227
323
  Since commands directly affect the filesystem, unit tests for them aren't really possible. It would also be quite complex to unit test all commands in addition to all steps. For this reason, commands should be manually tested, but unit tests are not currently required.
324
+
325
+ ### Monorepo Support
326
+
327
+ Flarum CLI was designed with monorepos in mind.
328
+ When registering a step, you can provide it an array of subdirectories to run it in.
329
+ For each of these subdirectories, an instance of the step will run with the `paths` object returning the subdirectory as `package()`, and the original root directory as `monorepo()`.
330
+
331
+ A monorepo should have a `flarum-monorepo.json` file in the root directory with the following (optional) keys:
332
+
333
+ - `packages.core`: a path to Flarum Core, if present.
334
+ - `packages.extensions`: an array of paths to Flarum extensions.
335
+ - `packages.composer`: an array of paths to non-extension PHP Composer packages published on Packagist.
336
+ - `packages.npm`: an array of paths to non-extension JS/TS packages published on NPM.
337
+
338
+ ### Scaffolding Generation
339
+
340
+ One powerful use-case of Flarum CLI is creating new extensions, and keeping infrastructure in sync for existing extensions.
341
+ For example, if managing 100 extensions, making sure the prettier config is consistent for all of them can be very tedious. Additionally, it can be annoying to have to add TypeScript config to every extension, and it's easy to make mistakes.
342
+
343
+ For this purpose, Flarum CLI's `Scaffolder` system formalizes the concepts of initializing and updating extension infrastructure.
344
+
345
+ At the core level, there's a boilerplate directory (`boilerplate/skeleton/extension`) that contains the scaffolding for a new extension.
346
+
347
+ The scaffolder receives a set of modules, which represent some aspect of infrastructure (e.g. JS, TypeScript, Backend Testing, etc).
348
+ Modules can be updatable (e.g. TypeScript) or not (e.g. the core setup of an `extend.php` file).
349
+ They can also be togglable (e.g. JS), or not, in which case they are always on.
350
+
351
+ Modules own files in the scaffolding directory, as well as keys in JSON config files. Every file and key must belong to at least one module. If any keys in a JSON config file belong to a module, all keys must belong to a module; if no keys are owned, the config file is treated like any other file.
352
+
353
+ Modules also have template params, which are used as variables in the scaffolding.
354
+
355
+ There's a lot more features and guaruntees than that, see the `Module` interface for more information.
356
+
357
+ The main benefit to this system is that given this scaffolding / module setup, it is possible to generate steps to initialize a new extension, update/add a module to an existing extension, or audit an extension for any outdated infrastructure. This is how the `init`, `infra`, and `audit infra` commands are implemented.
package/bin/run CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ const { resolve } = require('path');
2
3
 
3
- require('module-alias').addAlias('boilersmith', `${__dirname}/../lib/boilersmith`);
4
+ require('module-alias').addAlias('boilersmith', resolve(__dirname, '..', 'lib', 'boilersmith'));
4
5
 
5
6
  const oclif = require('@oclif/core');
6
7
 
Binary file
Binary file
@@ -1,18 +1,20 @@
1
- .gitattributes export-ignore
2
- .gitignore export-ignore
3
- .gitmodules export-ignore
4
- .github export-ignore
5
- .travis export-ignore
6
- .travis.yml export-ignore
7
- .editorconfig export-ignore
8
- .styleci.yml export-ignore
1
+ **/.gitattributes export-ignore
2
+ **/.gitignore export-ignore
3
+ **/.gitmodules export-ignore
4
+ **/.github export-ignore
5
+ **/.travis export-ignore
6
+ **/.travis.yml export-ignore
7
+ **/.editorconfig export-ignore
8
+ **/.styleci.yml export-ignore
9
9
 
10
- phpunit.xml export-ignore
11
- tests export-ignore
10
+ **/phpunit.xml export-ignore
11
+ **/tests export-ignore
12
12
 
13
- js/dist/* -diff
14
- js/dist/* linguist-generated
15
- js/dist-typings/* linguist-generated
16
- js/yarn.lock -diff
13
+ **/js/dist/**/* -diff
14
+ **/js/dist/**/* linguist-generated
15
+ **/js/dist-typings/**/* -diff
16
+ **/js/dist-typings/**/* linguist-generated
17
+ **/js/yarn.lock -diff
18
+ **/js/package-lock.json -diff
17
19
 
18
20
  * text=auto eol=lf
@@ -2,14 +2,10 @@ name: <%= params.extensionName %> PHP
2
2
 
3
3
  on: [workflow_dispatch, push, pull_request]
4
4
 
5
- # The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
6
- # This will break your current script.
7
- # When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
8
-
9
5
  jobs:
10
6
  run:
11
- uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
7
+ uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@2.x
12
8
  with:
13
9
  enable_backend_testing: <%= modules.backendTesting %>
14
10
 
15
- backend_directory: <%= params.backendDirectory %>
11
+ backend_directory: <%= params.backendDirectory %>
@@ -2,19 +2,18 @@ name: <%= params.extensionName %> JS
2
2
 
3
3
  on: [workflow_dispatch, push, pull_request]
4
4
 
5
- # The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
6
- # This will break your current script.
7
- # When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
8
-
9
5
  jobs:
10
6
  run:
11
- uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
7
+ uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@2.x
12
8
  with:
13
9
  enable_bundlewatch: <%= modules.bundlewatch %>
14
10
  enable_prettier: <%= modules.prettier %>
15
11
  enable_typescript: <%= modules.typescript %>
12
+ enable_tests: <%= modules.frontendTesting %>
16
13
 
17
14
  frontend_directory: <%= params.frontendDirectory %>
15
+ backend_directory: <%= params.backendDirectory %>
16
+ js_package_manager: <%= params.jsPackageManager %>
18
17
  main_git_branch: <%= params.mainGitBranch %>
19
18
  secrets:
20
- bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
19
+ bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
@@ -0,0 +1,12 @@
1
+ name: Static Code Analysis
2
+
3
+ on: [workflow_dispatch, push, pull_request]
4
+
5
+ jobs:
6
+ run:
7
+ uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@2.x
8
+ with:
9
+ enable_backend_testing: false
10
+ enable_phpstan: <%= modules.phpstan %>
11
+
12
+ backend_directory: <%= params.backendDirectory %>
@@ -1 +1 @@
1
- <%= params.licenseText %>
1
+ <%- params.licenseText %>
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![License](https://img.shields.io/badge/license-<%= params.licenseType %>-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/<%= params.packageName %>.svg)](https://packagist.org/packages/<%= params.packageName %>) [![Total Downloads](https://img.shields.io/packagist/dt/<%= params.packageName %>.svg)](https://packagist.org/packages/<%= params.packageName %>)
4
4
 
5
- A [Flarum](http://flarum.org) extension. <%= params.packageDescription %>
5
+ A [Flarum](https://flarum.org) extension. <%= params.packageDescription %>
6
6
 
7
7
  ## Installation
8
8
 
@@ -7,10 +7,11 @@
7
7
  "type": "flarum-extension",
8
8
  "license": "<%= params.licenseType %>",
9
9
  "require": {
10
- "flarum/core": "^1.0.0"
10
+ "flarum/core": "^2.0"
11
11
  },
12
12
  "require-dev": {
13
- "flarum/testing": "^1.0.0"
13
+ "flarum/testing": "^2.0",
14
+ "flarum/phpstan": "^2.0"
14
15
  },
15
16
  "authors": [<% if (params.authorName) { %>
16
17
  {
@@ -22,13 +23,13 @@
22
23
  <% if (params.packageNamespace) { %>
23
24
  "autoload": {
24
25
  "psr-4": {
25
- "<%= params.packageNamespaceEscapedSlash %>\\": "src/"
26
+ "<%= params.packageNamespace %>\\": "src/"
26
27
  }
27
28
  },
28
29
  <% } %>
29
30
  "autoload-dev": {
30
31
  "psr-4": {
31
- "<%= params.packageNamespaceEscapedSlash %>\\Tests\\": "tests/"
32
+ "<%= params.packageNamespace %>\\Tests\\": "tests/"
32
33
  }
33
34
  },
34
35
  "extra": {
@@ -49,12 +50,17 @@
49
50
  ],
50
51
  "test:unit": "phpunit -c tests/phpunit.unit.xml",
51
52
  "test:integration": "phpunit -c tests/phpunit.integration.xml",
52
- "test:setup": "@php tests/integration/setup.php"
53
+ "test:setup": "@php tests/integration/setup.php",
54
+ "analyse:phpstan": "phpstan analyse",
55
+ "clear-cache:phpstan": "phpstan clear-result-cache"
53
56
  },
54
57
  "scripts-descriptions": {
55
58
  "test": "Runs all tests.",
56
59
  "test:unit": "Runs all unit tests.",
57
60
  "test:integration": "Runs all integration tests.",
58
- "test:setup": "Sets up a database for use with integration tests. Execute this only once."
59
- }
61
+ "test:setup": "Sets up a database for use with integration tests. Execute this only once.",
62
+ "analyse:phpstan": "Run static analysis"
63
+ },
64
+ "minimum-stability": "dev",
65
+ "prefer-stable": true
60
66
  }
@@ -14,10 +14,10 @@ namespace <%= params.packageNamespace %>;
14
14
  use Flarum\Extend;
15
15
 
16
16
  return [
17
- <% if (modules.js || modules.css) { %>(new Extend\Frontend('forum'))
17
+ <% if (modules.forum) { %>(new Extend\Frontend('forum'))
18
18
  <% if (modules.js) { %>->js(__DIR__.'/js/dist/forum.js')<% if (!modules.css) { %>,<% } %><% } %>
19
19
  <% if (modules.css) { %>->css(__DIR__.'/less/forum.less'),<% } %><% } %>
20
- <% if (modules.js || modules.css) { %>(new Extend\Frontend('admin'))
20
+ <% if (modules.admin) { %>(new Extend\Frontend('admin'))
21
21
  <% if (modules.js) { %>->js(__DIR__.'/js/dist/admin.js')<% if (!modules.css) { %>,<% } %><% } %>
22
22
  <% if (modules.css) { %>->css(__DIR__.'/less/admin.less'),<% } %><% } %>
23
23
  <% if (modules.locale) { %>new Extend\Locales(__DIR__.'/locale'),<% } %>
@@ -4,6 +4,7 @@ composer.phar
4
4
 
5
5
  .DS_Store
6
6
  Thumbs.db
7
+ tests/.phpunit.cache
7
8
  tests/.phpunit.result.cache
8
9
  /tests/integration/tmp
9
10
  .vagrant
@@ -0,0 +1,2 @@
1
+ <% if (modules.jsCommon) { %>export * from './src/common';
2
+ <% } %>export * from './src/admin';
@@ -0,0 +1,2 @@
1
+ <% if (modules.jsCommon) { %>export * from './src/common';
2
+ <% } %>export * from './src/forum';
@@ -0,0 +1 @@
1
+ module.exports = require('@flarum/jest-config')({});
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@<%= params.packageName %>",
3
3
  "private": true,
4
+ "type": "module",
5
+ "version": "0.0.0",
4
6
  "prettier": "@flarum/prettier-config",
5
7
  "dependencies": {
6
8
  },
7
9
  "devDependencies": {
10
+ "@flarum/jest-config": "^1.0.1",
8
11
  "@flarum/prettier-config": "^1.0.0",
9
- "flarum-tsconfig": "^1.0.2",
10
- "flarum-webpack-config": "^2.0.0",
12
+ "flarum-tsconfig": "^2.0.0",
13
+ "flarum-webpack-config": "^3.0.0",
11
14
  "prettier": "^2.5.1",
12
15
  "typescript": "^4.5.4",
13
16
  "typescript-coverage-report": "^0.6.1",
@@ -17,10 +20,14 @@
17
20
  "scripts": {
18
21
  "dev": "webpack --mode development --watch",
19
22
  "build": "webpack --mode production",
20
- "analyze": "cross-env ANALYZER=true yarn build",
23
+ "analyze": "cross-env ANALYZER=true <%= params.jsPackageManager %> run build",
21
24
  "format": "prettier --write src",
22
25
  "format-check": "prettier --check src",
26
+ "clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
27
+ "build-typings": "<%= params.jsPackageManager %> run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && <%= params.jsPackageManager %> run post-build-typings",
28
+ "post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
23
29
  "check-typings": "tsc --noEmit --emitDeclarationOnly false",
24
- "check-typings-coverage": "typescript-coverage-report"
30
+ "check-typings-coverage": "typescript-coverage-report",
31
+ "test": "yarn node --experimental-vm-modules $(yarn bin jest)"
25
32
  }
26
33
  }
@@ -0,0 +1,8 @@
1
+ import Extend from 'flarum/common/extenders';
2
+ import commonExtend from '../common/extend';
3
+
4
+ export default [
5
+ ...commonExtend,
6
+
7
+ // Add your admin extenders here
8
+ ];
@@ -0,0 +1,8 @@
1
+ import Extend from 'flarum/common/extenders';
2
+ import commonExtend from '../common/extend';
3
+
4
+ export default [
5
+ ...commonExtend,
6
+
7
+ // Add your admin extenders here
8
+ ];
@@ -1,5 +1,7 @@
1
1
  import app from 'flarum/admin/app';
2
2
 
3
+ export { default as extend } from './extend';
4
+
3
5
  app.initializers.add('<%= params.packageName %>', () => {
4
6
  console.log('[<%= params.packageName %>] Hello, admin!');
5
7
  });
@@ -0,0 +1,7 @@
1
+ import app from 'flarum/admin/app';
2
+
3
+ export { default as extend } from './extend';
4
+
5
+ app.initializers.add('<%= params.extensionId %>', () => {
6
+ console.log('[<%= params.packageName %>] Hello, admin!');
7
+ });
@@ -0,0 +1,5 @@
1
+ import Extend from 'flarum/common/extenders';
2
+
3
+ export default [
4
+ // Add your common extenders here
5
+ ];
@@ -0,0 +1,5 @@
1
+ import Extend from 'flarum/common/extenders';
2
+
3
+ export default [
4
+ // Add your common extenders here
5
+ ];
@@ -0,0 +1,5 @@
1
+ import app from 'flarum/common/app';
2
+
3
+ app.initializers.add('<%= params.extensionId %>-common', () => {
4
+ console.log('[<%= params.packageName %>] Hello, forum and admin!');
5
+ });
@@ -0,0 +1,8 @@
1
+ import Extend from 'flarum/common/extenders';
2
+ import commonExtend from '../common/extend';
3
+
4
+ export default [
5
+ ...commonExtend,
6
+
7
+ // Add your forum extenders here
8
+ ];
@@ -0,0 +1,8 @@
1
+ import Extend from 'flarum/common/extenders';
2
+ import commonExtend from '../common/extend';
3
+
4
+ export default [
5
+ ...commonExtend,
6
+
7
+ // Add your forum extenders here
8
+ ];