@strapi/admin 4.15.5-alpha.3 → 4.15.5-alpha.5

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 (199) hide show
  1. package/dist/_chunks/{AuthenticatedApp-2cfb41e2.mjs → AuthenticatedApp-1e10546a.mjs} +21 -21
  2. package/dist/_chunks/{AuthenticatedApp-2cfb41e2.mjs.map → AuthenticatedApp-1e10546a.mjs.map} +1 -1
  3. package/dist/_chunks/{AuthenticatedApp-79e3f141.js → AuthenticatedApp-eea6970a.js} +21 -21
  4. package/dist/_chunks/{AuthenticatedApp-79e3f141.js.map → AuthenticatedApp-eea6970a.js.map} +1 -1
  5. package/dist/_chunks/{HomePage-a617d19a.js → HomePage-3ce777a2.js} +4 -4
  6. package/dist/_chunks/{HomePage-a617d19a.js.map → HomePage-3ce777a2.js.map} +1 -1
  7. package/dist/_chunks/{HomePage-e333ff90.mjs → HomePage-96c4aa5b.mjs} +4 -4
  8. package/dist/_chunks/{HomePage-e333ff90.mjs.map → HomePage-96c4aa5b.mjs.map} +1 -1
  9. package/dist/_chunks/{HomePage-1376624b.mjs → HomePage-970b8c5a.mjs} +4 -4
  10. package/dist/_chunks/{HomePage-1376624b.mjs.map → HomePage-970b8c5a.mjs.map} +1 -1
  11. package/dist/_chunks/{HomePage-a9e9942a.js → HomePage-ec67248d.js} +4 -4
  12. package/dist/_chunks/{HomePage-a9e9942a.js.map → HomePage-ec67248d.js.map} +1 -1
  13. package/dist/_chunks/{InstalledPluginsPage-fb2aaa1f.js → InstalledPluginsPage-1e0d2ae1.js} +3 -3
  14. package/dist/_chunks/{InstalledPluginsPage-fb2aaa1f.js.map → InstalledPluginsPage-1e0d2ae1.js.map} +1 -1
  15. package/dist/_chunks/{InstalledPluginsPage-c7ccd2b2.mjs → InstalledPluginsPage-7743670e.mjs} +3 -3
  16. package/dist/_chunks/{InstalledPluginsPage-c7ccd2b2.mjs.map → InstalledPluginsPage-7743670e.mjs.map} +1 -1
  17. package/dist/_chunks/{Login-d6fd38ea.js → Login-04fc2757.js} +2 -2
  18. package/dist/_chunks/{Login-d6fd38ea.js.map → Login-04fc2757.js.map} +1 -1
  19. package/dist/_chunks/{Login-69bf063c.mjs → Login-a6af5d62.mjs} +2 -2
  20. package/dist/_chunks/{Login-69bf063c.mjs.map → Login-a6af5d62.mjs.map} +1 -1
  21. package/dist/_chunks/{MarketplacePage-c829d0de.mjs → MarketplacePage-61d66050.mjs} +3 -3
  22. package/dist/_chunks/{MarketplacePage-c829d0de.mjs.map → MarketplacePage-61d66050.mjs.map} +1 -1
  23. package/dist/_chunks/{MarketplacePage-7c516084.js → MarketplacePage-aeb425cc.js} +3 -3
  24. package/dist/_chunks/{MarketplacePage-7c516084.js.map → MarketplacePage-aeb425cc.js.map} +1 -1
  25. package/dist/_chunks/{ProfilePage-c6d8c69f.mjs → ProfilePage-862401de.mjs} +3 -3
  26. package/dist/_chunks/{ProfilePage-c6d8c69f.mjs.map → ProfilePage-862401de.mjs.map} +1 -1
  27. package/dist/_chunks/{ProfilePage-a2e54283.js → ProfilePage-f3915e86.js} +3 -3
  28. package/dist/_chunks/{ProfilePage-a2e54283.js.map → ProfilePage-f3915e86.js.map} +1 -1
  29. package/dist/_chunks/{build-20299009.mjs → build-92e15b93.mjs} +13 -13
  30. package/dist/_chunks/{build-20299009.mjs.map → build-92e15b93.mjs.map} +1 -1
  31. package/dist/_chunks/{build-58827c7a.js → build-df2f219f.js} +13 -13
  32. package/dist/_chunks/{build-58827c7a.js.map → build-df2f219f.js.map} +1 -1
  33. package/dist/_chunks/{constants-842c6449.mjs → constants-14dd24d9.mjs} +6 -6
  34. package/dist/_chunks/{constants-842c6449.mjs.map → constants-14dd24d9.mjs.map} +1 -1
  35. package/dist/_chunks/{constants-962e9922.js → constants-298d4e08.js} +5 -5
  36. package/dist/_chunks/{constants-962e9922.js.map → constants-298d4e08.js.map} +1 -1
  37. package/dist/_chunks/{constants-5f0670d7.mjs → constants-94ec0c39.mjs} +5 -5
  38. package/dist/_chunks/{constants-5f0670d7.mjs.map → constants-94ec0c39.mjs.map} +1 -1
  39. package/dist/_chunks/{constants-fad06b7f.mjs → constants-98046873.mjs} +2 -2
  40. package/dist/_chunks/{constants-fad06b7f.mjs.map → constants-98046873.mjs.map} +1 -1
  41. package/dist/_chunks/{constants-4c06740e.js → constants-9ee3d5d7.js} +3 -3
  42. package/dist/_chunks/{constants-4c06740e.js.map → constants-9ee3d5d7.js.map} +1 -1
  43. package/dist/_chunks/{constants-9212941b.js → constants-a0698a4a.js} +6 -6
  44. package/dist/_chunks/{constants-9212941b.js.map → constants-a0698a4a.js.map} +1 -1
  45. package/dist/_chunks/{constants-a16f9961.js → constants-ca23be5d.js} +2 -2
  46. package/dist/_chunks/{constants-a16f9961.js.map → constants-ca23be5d.js.map} +1 -1
  47. package/dist/_chunks/{constants-a3372db6.mjs → constants-fb780d44.mjs} +3 -3
  48. package/dist/_chunks/{constants-a3372db6.mjs.map → constants-fb780d44.mjs.map} +1 -1
  49. package/dist/_chunks/{develop-a7d5cf0c.js → develop-4d25a6e0.js} +13 -13
  50. package/dist/_chunks/{develop-a7d5cf0c.js.map → develop-4d25a6e0.js.map} +1 -1
  51. package/dist/_chunks/{develop-7066af5e.mjs → develop-a46fed01.mjs} +13 -13
  52. package/dist/_chunks/{develop-7066af5e.mjs.map → develop-a46fed01.mjs.map} +1 -1
  53. package/dist/_chunks/{index-e8b17b94.js → index-008328ba.js} +5 -5
  54. package/dist/_chunks/{index-e8b17b94.js.map → index-008328ba.js.map} +1 -1
  55. package/dist/_chunks/{index-693383db.mjs → index-04dc85bf.mjs} +5 -5
  56. package/dist/_chunks/{index-693383db.mjs.map → index-04dc85bf.mjs.map} +1 -1
  57. package/dist/_chunks/{index-9b3107a4.mjs → index-0a328691.mjs} +3 -3
  58. package/dist/_chunks/{index-9b3107a4.mjs.map → index-0a328691.mjs.map} +1 -1
  59. package/dist/_chunks/{index-1316edb2.mjs → index-15fddb85.mjs} +4 -4
  60. package/dist/_chunks/{index-1316edb2.mjs.map → index-15fddb85.mjs.map} +1 -1
  61. package/dist/_chunks/{index-341222f2.js → index-1930d662.js} +3 -3
  62. package/dist/_chunks/{index-341222f2.js.map → index-1930d662.js.map} +1 -1
  63. package/dist/_chunks/{index-b84b9fee.js → index-1a74fa41.js} +348 -302
  64. package/dist/_chunks/index-1a74fa41.js.map +1 -0
  65. package/dist/_chunks/{index-7338912f.js → index-1e7b6d32.js} +5 -5
  66. package/dist/_chunks/{index-7338912f.js.map → index-1e7b6d32.js.map} +1 -1
  67. package/dist/_chunks/{index-3444ab6f.js → index-2609696f.js} +4 -4
  68. package/dist/_chunks/{index-3444ab6f.js.map → index-2609696f.js.map} +1 -1
  69. package/dist/_chunks/{index-9e5d59f5.mjs → index-27d910b7.mjs} +5 -5
  70. package/dist/_chunks/{index-9e5d59f5.mjs.map → index-27d910b7.mjs.map} +1 -1
  71. package/dist/_chunks/{index-252284ed.js → index-3266a985.js} +3 -3
  72. package/dist/_chunks/{index-252284ed.js.map → index-3266a985.js.map} +1 -1
  73. package/dist/_chunks/{index-5b44cba5.mjs → index-372f70ce.mjs} +2 -2
  74. package/dist/_chunks/{index-5b44cba5.mjs.map → index-372f70ce.mjs.map} +1 -1
  75. package/dist/_chunks/{index-ecb3cfba.js → index-392a9490.js} +5 -5
  76. package/dist/_chunks/{index-ecb3cfba.js.map → index-392a9490.js.map} +1 -1
  77. package/dist/_chunks/{index-48ebb88c.js → index-401d5daa.js} +5 -5
  78. package/dist/_chunks/{index-48ebb88c.js.map → index-401d5daa.js.map} +1 -1
  79. package/dist/_chunks/{index-2aed5618.js → index-435b6463.js} +3 -3
  80. package/dist/_chunks/{index-2aed5618.js.map → index-435b6463.js.map} +1 -1
  81. package/dist/_chunks/{index-25c9158f.js → index-470c6923.js} +2 -2
  82. package/dist/_chunks/{index-25c9158f.js.map → index-470c6923.js.map} +1 -1
  83. package/dist/_chunks/{index-df70cfd7.mjs → index-4b12f2e9.mjs} +5 -5
  84. package/dist/_chunks/{index-df70cfd7.mjs.map → index-4b12f2e9.mjs.map} +1 -1
  85. package/dist/_chunks/{index-2b331655.js → index-51aa0dc6.js} +3 -3
  86. package/dist/_chunks/{index-2b331655.js.map → index-51aa0dc6.js.map} +1 -1
  87. package/dist/_chunks/{index-9910aa5a.mjs → index-527a80ef.mjs} +3 -3
  88. package/dist/_chunks/{index-9910aa5a.mjs.map → index-527a80ef.mjs.map} +1 -1
  89. package/dist/_chunks/{index-4c29f67c.js → index-56a6576d.js} +3 -3
  90. package/dist/_chunks/{index-4c29f67c.js.map → index-56a6576d.js.map} +1 -1
  91. package/dist/_chunks/{index-6b7dceb1.mjs → index-5a15fb17.mjs} +3 -3
  92. package/dist/_chunks/{index-6b7dceb1.mjs.map → index-5a15fb17.mjs.map} +1 -1
  93. package/dist/_chunks/{index-25feef65.js → index-5d3982dd.js} +6 -6
  94. package/dist/_chunks/{index-25feef65.js.map → index-5d3982dd.js.map} +1 -1
  95. package/dist/_chunks/{index-703c58c8.mjs → index-5de6defe.mjs} +4 -4
  96. package/dist/_chunks/{index-703c58c8.mjs.map → index-5de6defe.mjs.map} +1 -1
  97. package/dist/_chunks/{index-35fc9959.js → index-65d8637e.js} +3 -3
  98. package/dist/_chunks/{index-35fc9959.js.map → index-65d8637e.js.map} +1 -1
  99. package/dist/_chunks/{index-f097ccea.mjs → index-6b269800.mjs} +3 -3
  100. package/dist/_chunks/{index-f097ccea.mjs.map → index-6b269800.mjs.map} +1 -1
  101. package/dist/_chunks/{index-dcbab202.mjs → index-6c56f4c2.mjs} +3 -3
  102. package/dist/_chunks/{index-dcbab202.mjs.map → index-6c56f4c2.mjs.map} +1 -1
  103. package/dist/_chunks/{index-242c514c.mjs → index-6e082128.mjs} +3 -3
  104. package/dist/_chunks/{index-242c514c.mjs.map → index-6e082128.mjs.map} +1 -1
  105. package/dist/_chunks/{index-25bb4a4d.js → index-75d51788.js} +5 -5
  106. package/dist/_chunks/{index-25bb4a4d.js.map → index-75d51788.js.map} +1 -1
  107. package/dist/_chunks/{index-9d03d359.js → index-7b53073e.js} +3 -3
  108. package/dist/_chunks/{index-9d03d359.js.map → index-7b53073e.js.map} +1 -1
  109. package/dist/_chunks/{index-12b7d75f.js → index-7b5707cd.js} +4 -4
  110. package/dist/_chunks/{index-12b7d75f.js.map → index-7b5707cd.js.map} +1 -1
  111. package/dist/_chunks/{index-45a78b18.mjs → index-7d60e3dc.mjs} +20 -20
  112. package/dist/_chunks/{index-45a78b18.mjs.map → index-7d60e3dc.mjs.map} +1 -1
  113. package/dist/_chunks/{index-cf4fe6b7.mjs → index-7e1f48fc.mjs} +8 -8
  114. package/dist/_chunks/{index-cf4fe6b7.mjs.map → index-7e1f48fc.mjs.map} +1 -1
  115. package/dist/_chunks/{index-80574f48.mjs → index-80b911e7.mjs} +3 -3
  116. package/dist/_chunks/{index-80574f48.mjs.map → index-80b911e7.mjs.map} +1 -1
  117. package/dist/_chunks/{index-bef99193.mjs → index-83133812.mjs} +4 -4
  118. package/dist/_chunks/{index-bef99193.mjs.map → index-83133812.mjs.map} +1 -1
  119. package/dist/_chunks/{index-7a1a0c5c.mjs → index-8600b6e5.mjs} +3 -3
  120. package/dist/_chunks/{index-7a1a0c5c.mjs.map → index-8600b6e5.mjs.map} +1 -1
  121. package/dist/_chunks/{index-07d155a0.js → index-8c004453.js} +2 -2
  122. package/dist/_chunks/{index-07d155a0.js.map → index-8c004453.js.map} +1 -1
  123. package/dist/_chunks/{index-66177bc5.js → index-92a2ece4.js} +4 -4
  124. package/dist/_chunks/{index-66177bc5.js.map → index-92a2ece4.js.map} +1 -1
  125. package/dist/_chunks/{index-1e3a2719.mjs → index-92f311b0.mjs} +5 -5
  126. package/dist/_chunks/{index-1e3a2719.mjs.map → index-92f311b0.mjs.map} +1 -1
  127. package/dist/_chunks/{index-b53ba38d.mjs → index-9a307bbd.mjs} +4 -4
  128. package/dist/_chunks/{index-b53ba38d.mjs.map → index-9a307bbd.mjs.map} +1 -1
  129. package/dist/_chunks/{index-18fed2cd.js → index-9afe0455.js} +3 -3
  130. package/dist/_chunks/{index-18fed2cd.js.map → index-9afe0455.js.map} +1 -1
  131. package/dist/_chunks/{index-ea8946fb.js → index-9d9b9769.js} +2 -2
  132. package/dist/_chunks/{index-ea8946fb.js.map → index-9d9b9769.js.map} +1 -1
  133. package/dist/_chunks/{index-4a241498.js → index-a299ce97.js} +8 -8
  134. package/dist/_chunks/{index-4a241498.js.map → index-a299ce97.js.map} +1 -1
  135. package/dist/_chunks/{index-adb714e8.mjs → index-a3bc2b4e.mjs} +2 -2
  136. package/dist/_chunks/{index-adb714e8.mjs.map → index-a3bc2b4e.mjs.map} +1 -1
  137. package/dist/_chunks/{index-9f88ad83.mjs → index-a81ae30e.mjs} +3 -3
  138. package/dist/_chunks/{index-9f88ad83.mjs.map → index-a81ae30e.mjs.map} +1 -1
  139. package/dist/_chunks/{index-c4116296.mjs → index-aa35df09.mjs} +6 -6
  140. package/dist/_chunks/{index-c4116296.mjs.map → index-aa35df09.mjs.map} +1 -1
  141. package/dist/_chunks/{index-fbe9dba1.js → index-b1141822.js} +3 -3
  142. package/dist/_chunks/{index-fbe9dba1.js.map → index-b1141822.js.map} +1 -1
  143. package/dist/_chunks/{index-d4029932.js → index-b4277486.js} +4 -4
  144. package/dist/_chunks/{index-d4029932.js.map → index-b4277486.js.map} +1 -1
  145. package/dist/_chunks/{index-dede2234.mjs → index-b51842fb.mjs} +3 -3
  146. package/dist/_chunks/{index-dede2234.mjs.map → index-b51842fb.mjs.map} +1 -1
  147. package/dist/_chunks/{index-ef0c2ffb.js → index-b5ff3031.js} +4 -4
  148. package/dist/_chunks/{index-ef0c2ffb.js.map → index-b5ff3031.js.map} +1 -1
  149. package/dist/_chunks/{index-dcd31235.js → index-bff8cad7.js} +3 -3
  150. package/dist/_chunks/{index-dcd31235.js.map → index-bff8cad7.js.map} +1 -1
  151. package/dist/_chunks/{index-ed287ba8.mjs → index-c145ae06.mjs} +3 -3
  152. package/dist/_chunks/{index-ed287ba8.mjs.map → index-c145ae06.mjs.map} +1 -1
  153. package/dist/_chunks/{index-61c915cd.mjs → index-c5ed938c.mjs} +2 -2
  154. package/dist/_chunks/{index-61c915cd.mjs.map → index-c5ed938c.mjs.map} +1 -1
  155. package/dist/_chunks/{index-314f72f4.mjs → index-c66a60bb.mjs} +4 -4
  156. package/dist/_chunks/{index-314f72f4.mjs.map → index-c66a60bb.mjs.map} +1 -1
  157. package/dist/_chunks/{index-7d449292.mjs → index-c8abc905.mjs} +3 -3
  158. package/dist/_chunks/{index-7d449292.mjs.map → index-c8abc905.mjs.map} +1 -1
  159. package/dist/_chunks/{index-563a992a.js → index-cf35f9e7.js} +4 -4
  160. package/dist/_chunks/{index-563a992a.js.map → index-cf35f9e7.js.map} +1 -1
  161. package/dist/_chunks/{index-c2b86584.js → index-da0be0d5.js} +3 -3
  162. package/dist/_chunks/{index-c2b86584.js.map → index-da0be0d5.js.map} +1 -1
  163. package/dist/_chunks/{index-b53cf07d.mjs → index-dc89c18c.mjs} +340 -294
  164. package/dist/_chunks/index-dc89c18c.mjs.map +1 -0
  165. package/dist/_chunks/{index-f088fe2c.js → index-e12cacd1.js} +3 -3
  166. package/dist/_chunks/{index-f088fe2c.js.map → index-e12cacd1.js.map} +1 -1
  167. package/dist/_chunks/{index-61e392e8.mjs → index-e17a9e33.mjs} +5 -5
  168. package/dist/_chunks/{index-61e392e8.mjs.map → index-e17a9e33.mjs.map} +1 -1
  169. package/dist/_chunks/{index-edf62e62.mjs → index-e628615b.mjs} +4 -4
  170. package/dist/_chunks/{index-edf62e62.mjs.map → index-e628615b.mjs.map} +1 -1
  171. package/dist/_chunks/{index-517fbe00.mjs → index-e7e7f75d.mjs} +5 -5
  172. package/dist/_chunks/{index-517fbe00.mjs.map → index-e7e7f75d.mjs.map} +1 -1
  173. package/dist/_chunks/{index-68ae52b6.js → index-ea2ed45d.js} +5 -5
  174. package/dist/_chunks/{index-68ae52b6.js.map → index-ea2ed45d.js.map} +1 -1
  175. package/dist/_chunks/{index-dfc0437b.mjs → index-eafb6c8c.mjs} +4 -4
  176. package/dist/_chunks/{index-dfc0437b.mjs.map → index-eafb6c8c.mjs.map} +1 -1
  177. package/dist/_chunks/{index-996f7ad1.mjs → index-ebd41ad5.mjs} +3 -3
  178. package/dist/_chunks/{index-996f7ad1.mjs.map → index-ebd41ad5.mjs.map} +1 -1
  179. package/dist/_chunks/{index-c3469f69.js → index-f3c7f6a9.js} +3 -3
  180. package/dist/_chunks/{index-c3469f69.js.map → index-f3c7f6a9.js.map} +1 -1
  181. package/dist/_chunks/{index-fc7a00f0.js → index-f6e45499.js} +20 -20
  182. package/dist/_chunks/{index-fc7a00f0.js.map → index-f6e45499.js.map} +1 -1
  183. package/dist/_chunks/{index-174cc6b9.js → index-ffafceee.js} +4 -4
  184. package/dist/_chunks/{index-174cc6b9.js.map → index-ffafceee.js.map} +1 -1
  185. package/dist/_chunks/{schema-1808aa2d.mjs → schema-666ecce4.mjs} +2 -2
  186. package/dist/_chunks/{schema-1808aa2d.mjs.map → schema-666ecce4.mjs.map} +1 -1
  187. package/dist/_chunks/{schema-e73a6250.js → schema-755747ac.js} +2 -2
  188. package/dist/_chunks/{schema-e73a6250.js.map → schema-755747ac.js.map} +1 -1
  189. package/dist/_chunks/{validateWorkflow-11ecf8ee.js → validateWorkflow-ae45d3d4.js} +3 -3
  190. package/dist/_chunks/{validateWorkflow-11ecf8ee.js.map → validateWorkflow-ae45d3d4.js.map} +1 -1
  191. package/dist/_chunks/{validateWorkflow-1ec1040b.mjs → validateWorkflow-e77a9ab3.mjs} +3 -3
  192. package/dist/_chunks/{validateWorkflow-1ec1040b.mjs.map → validateWorkflow-e77a9ab3.mjs.map} +1 -1
  193. package/dist/admin/index.js +1 -1
  194. package/dist/admin/index.mjs +1 -1
  195. package/dist/cli.js +12 -12
  196. package/dist/cli.mjs +12 -12
  197. package/package.json +12 -12
  198. package/dist/_chunks/index-b53cf07d.mjs.map +0 -1
  199. package/dist/_chunks/index-b84b9fee.js.map +0 -1
@@ -21,6 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
22
  mod
23
23
  ));
24
+ const EE = require("@strapi/strapi/dist/utils/ee");
24
25
  const tsUtils = require("@strapi/typescript-utils");
25
26
  const os = require("node:os");
26
27
  const fs = require("node:fs/promises");
@@ -30,6 +31,16 @@ const semver = require("semver");
30
31
  const resolveFrom = require("resolve-from");
31
32
  const execa = require("execa");
32
33
  const readPkgUp = require("read-pkg-up");
34
+ const perf_hooks = require("perf_hooks");
35
+ const browserslist = require("browserslist");
36
+ const strapiFactory = require("@strapi/strapi");
37
+ const utils = require("@strapi/utils");
38
+ const dotenv = require("dotenv");
39
+ const node = require("esbuild-register/dist/node");
40
+ const fs$1 = require("node:fs");
41
+ const camelCase = require("lodash/camelCase");
42
+ const boxen = require("boxen");
43
+ const chalk = require("chalk");
33
44
  const outdent = require("outdent");
34
45
  const prettier = require("prettier");
35
46
  const react = require("react");
@@ -46,17 +57,6 @@ const crypto = require("node:crypto");
46
57
  const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
47
58
  const path$1 = require("path");
48
59
  const findRoot = require("find-root");
49
- const node = require("esbuild-register/dist/node");
50
- const boxen = require("boxen");
51
- const chalk = require("chalk");
52
- const browserslist = require("browserslist");
53
- const strapiFactory = require("@strapi/strapi");
54
- const utils = require("@strapi/utils");
55
- const dotenv = require("dotenv");
56
- const fs$1 = require("node:fs");
57
- const camelCase = require("lodash/camelCase");
58
- const EE = require("@strapi/strapi/dist/utils/ee");
59
- const perf_hooks = require("perf_hooks");
60
60
  const chokidar = require("chokidar");
61
61
  const cluster = require("node:cluster");
62
62
  const node_util = require("node:util");
@@ -81,6 +81,7 @@ function _interopNamespace(e) {
81
81
  n.default = e;
82
82
  return Object.freeze(n);
83
83
  }
84
+ const EE__default = /* @__PURE__ */ _interopDefault(EE);
84
85
  const tsUtils__namespace = /* @__PURE__ */ _interopNamespace(tsUtils);
85
86
  const os__default = /* @__PURE__ */ _interopDefault(os);
86
87
  const fs__default = /* @__PURE__ */ _interopDefault(fs);
@@ -90,6 +91,13 @@ const semver__default = /* @__PURE__ */ _interopDefault(semver);
90
91
  const resolveFrom__default = /* @__PURE__ */ _interopDefault(resolveFrom);
91
92
  const execa__default = /* @__PURE__ */ _interopDefault(execa);
92
93
  const readPkgUp__default = /* @__PURE__ */ _interopDefault(readPkgUp);
94
+ const browserslist__default = /* @__PURE__ */ _interopDefault(browserslist);
95
+ const strapiFactory__default = /* @__PURE__ */ _interopDefault(strapiFactory);
96
+ const dotenv__default = /* @__PURE__ */ _interopDefault(dotenv);
97
+ const fs__default$1 = /* @__PURE__ */ _interopDefault(fs$1);
98
+ const camelCase__default = /* @__PURE__ */ _interopDefault(camelCase);
99
+ const boxen__default = /* @__PURE__ */ _interopDefault(boxen);
100
+ const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
93
101
  const outdent__default = /* @__PURE__ */ _interopDefault(outdent);
94
102
  const webpack__default = /* @__PURE__ */ _interopDefault(webpack);
95
103
  const browserslistToEsbuild__default = /* @__PURE__ */ _interopDefault(browserslistToEsbuild);
@@ -100,21 +108,13 @@ const crypto__default = /* @__PURE__ */ _interopDefault(crypto);
100
108
  const ReactRefreshWebpackPlugin__default = /* @__PURE__ */ _interopDefault(ReactRefreshWebpackPlugin);
101
109
  const path__default$1 = /* @__PURE__ */ _interopDefault(path$1);
102
110
  const findRoot__default = /* @__PURE__ */ _interopDefault(findRoot);
103
- const boxen__default = /* @__PURE__ */ _interopDefault(boxen);
104
- const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
105
- const browserslist__default = /* @__PURE__ */ _interopDefault(browserslist);
106
- const strapiFactory__default = /* @__PURE__ */ _interopDefault(strapiFactory);
107
- const dotenv__default = /* @__PURE__ */ _interopDefault(dotenv);
108
- const fs__default$1 = /* @__PURE__ */ _interopDefault(fs$1);
109
- const camelCase__default = /* @__PURE__ */ _interopDefault(camelCase);
110
- const EE__default = /* @__PURE__ */ _interopDefault(EE);
111
111
  const chokidar__default = /* @__PURE__ */ _interopDefault(chokidar);
112
112
  const cluster__default = /* @__PURE__ */ _interopDefault(cluster);
113
113
  const webpackDevMiddleware__default = /* @__PURE__ */ _interopDefault(webpackDevMiddleware);
114
114
  const webpackHotMiddleware__default = /* @__PURE__ */ _interopDefault(webpackHotMiddleware);
115
115
  const build$2 = ({ command, ctx }) => {
116
116
  command.command("build").option("-d, --debug", "Enable debugging mode with verbose logs", false).option("--ignore-prompts", "Ignore all prompts", false).option("--minify", "Minify the output", true).option("--no-optimization", "[deprecated]: use minify instead").option("--silent", "Don't log anything", false).option("--sourcemap", "Produce sourcemaps", false).option("--stats", "Print build statistics to the console", false).description("Build the strapi admin app").action(async (options) => {
117
- const { build: build2 } = await Promise.resolve().then(() => require("./build-58827c7a.js"));
117
+ const { build: build2 } = await Promise.resolve().then(() => require("./build-df2f219f.js"));
118
118
  return build2({ ...options, ...ctx });
119
119
  });
120
120
  };
@@ -126,7 +126,7 @@ const develop$1 = ({ command, ctx }) => {
126
126
  "--watch-admin",
127
127
  "[deprecated]: there is now middleware for watching, it is no longer a separate process"
128
128
  ).option("--browser <name>", "[deprecated]: use open instead").option("--open", "Open the admin in your browser", true).description("Start your Strapi application in development mode").action(async (options) => {
129
- const { develop: develop2 } = await Promise.resolve().then(() => require("./develop-a7d5cf0c.js"));
129
+ const { develop: develop2 } = await Promise.resolve().then(() => require("./develop-4d25a6e0.js"));
130
130
  return develop2({ ...options, ...ctx });
131
131
  });
132
132
  };
@@ -300,6 +300,265 @@ const installDependencies = async (install, { cwd, logger }) => {
300
300
  throw new Error("Package installation failed");
301
301
  }
302
302
  };
303
+ function getTimer() {
304
+ const timings = {};
305
+ const startTimes = {};
306
+ function start(name) {
307
+ if (typeof startTimes[name] !== "undefined") {
308
+ throw new Error(`Timer "${name}" already started, cannot overwrite`);
309
+ }
310
+ startTimes[name] = perf_hooks.performance.now();
311
+ }
312
+ function end(name) {
313
+ if (typeof startTimes[name] === "undefined") {
314
+ throw new Error(`Timer "${name}" never started, cannot end`);
315
+ }
316
+ timings[name] = perf_hooks.performance.now() - startTimes[name];
317
+ return timings[name];
318
+ }
319
+ return { start, end, getTimings: () => timings };
320
+ }
321
+ const prettyTime = (timeInMs) => {
322
+ return Math.ceil(timeInMs) + "ms";
323
+ };
324
+ const pathExists = async (path2) => {
325
+ try {
326
+ await fs.access(path2);
327
+ return true;
328
+ } catch (error) {
329
+ return false;
330
+ }
331
+ };
332
+ const loadFile = async (path2) => {
333
+ if (await pathExists(path2)) {
334
+ const esbuildOptions = {
335
+ extensions: [".js", ".mjs", ".ts"]
336
+ };
337
+ const { unregister } = node.register(esbuildOptions);
338
+ const mod = require(path2);
339
+ unregister();
340
+ const file = mod?.default || mod || void 0;
341
+ return file;
342
+ }
343
+ return void 0;
344
+ };
345
+ const convertSystemPathToModulePath = (sysPath) => {
346
+ if (process.platform === "win32") {
347
+ return sysPath.split(path__default.default.sep).join(path__default.default.posix.sep);
348
+ } else {
349
+ return sysPath;
350
+ }
351
+ };
352
+ const convertModulePathToSystemPath = (modulePath) => {
353
+ if (process.platform === "win32") {
354
+ return modulePath.split(path__default.default.posix.sep).join(path__default.default.sep);
355
+ } else {
356
+ return modulePath;
357
+ }
358
+ };
359
+ const loadEnv = async (cwd) => {
360
+ const pathToEnv = path__default.default.resolve(cwd, ".env");
361
+ if (await pathExists(pathToEnv)) {
362
+ dotenv__default.default.config({ path: pathToEnv });
363
+ }
364
+ };
365
+ const getStrapiAdminEnvVars = (defaultEnv) => {
366
+ return Object.keys(process.env).filter((key) => key.toUpperCase().startsWith("STRAPI_ADMIN_")).reduce((acc, key) => {
367
+ acc[key] = process.env[key];
368
+ return acc;
369
+ }, defaultEnv);
370
+ };
371
+ const isError = (err) => err instanceof Error;
372
+ const handleUnexpectedError = (err) => {
373
+ console.error(
374
+ chalk__default.default.red(
375
+ `[ERROR] `,
376
+ "There seems to be an unexpected error, try again with --debug for more information",
377
+ os__default.default.EOL
378
+ )
379
+ );
380
+ if (isError(err) && err.stack) {
381
+ console.log(
382
+ chalk__default.default.red(
383
+ boxen__default.default(err.stack, {
384
+ padding: 1,
385
+ align: "left"
386
+ })
387
+ )
388
+ );
389
+ }
390
+ process.exit(1);
391
+ };
392
+ const validatePackageHasStrapi = (pkg) => "strapi" in pkg && typeof pkg.strapi === "object" && !Array.isArray(pkg.strapi) && pkg.strapi !== null;
393
+ const validatePackageIsPlugin = (pkg) => validatePackageHasStrapi(pkg) && pkg.strapi.kind === "plugin";
394
+ const getEnabledPlugins = async ({
395
+ cwd,
396
+ logger,
397
+ runtimeDir,
398
+ strapi
399
+ }) => {
400
+ const plugins = {};
401
+ const deps = strapi.config.get("info.dependencies", {});
402
+ logger.debug("Dependencies from user's project", os__default.default.EOL, deps);
403
+ for (const dep of Object.keys(deps)) {
404
+ const pkg = await getModule(dep, cwd);
405
+ if (pkg && validatePackageIsPlugin(pkg)) {
406
+ const name = pkg.strapi.name || pkg.name;
407
+ if (!name) {
408
+ throw Error(
409
+ "You're trying to import a plugin that doesn't have a name – check the package.json of that plugin!"
410
+ );
411
+ }
412
+ plugins[name] = {
413
+ name,
414
+ importName: camelCase__default.default(name),
415
+ type: "module",
416
+ modulePath: dep
417
+ };
418
+ }
419
+ }
420
+ const userPluginsFile = await loadUserPluginsFile(strapi.dirs.app.config);
421
+ logger.debug("User's plugins file", os__default.default.EOL, userPluginsFile);
422
+ for (const [userPluginName, userPluginConfig] of Object.entries(userPluginsFile)) {
423
+ if (userPluginConfig.enabled && userPluginConfig.resolve) {
424
+ const sysPath = convertModulePathToSystemPath(userPluginConfig.resolve);
425
+ plugins[userPluginName] = {
426
+ name: userPluginName,
427
+ importName: camelCase__default.default(userPluginName),
428
+ type: "local",
429
+ /**
430
+ * User plugin paths are resolved from the entry point
431
+ * of the app, because that's how you import them.
432
+ */
433
+ modulePath: convertSystemPathToModulePath(path__default.default.relative(runtimeDir, sysPath)),
434
+ path: sysPath
435
+ };
436
+ }
437
+ }
438
+ return plugins;
439
+ };
440
+ const PLUGIN_CONFIGS = ["plugins.js", "plugins.mjs", "plugins.ts"];
441
+ const loadUserPluginsFile = async (root) => {
442
+ for (const file of PLUGIN_CONFIGS) {
443
+ const filePath = path__default.default.join(root, file);
444
+ const configFile = await loadFile(filePath);
445
+ if (configFile) {
446
+ return typeof configFile === "function" ? configFile({ env: utils.env }) : configFile;
447
+ }
448
+ }
449
+ return {};
450
+ };
451
+ const getMapOfPluginsWithAdmin = (plugins) => Object.values(plugins).filter((plugin) => {
452
+ if (!plugin) {
453
+ return false;
454
+ }
455
+ try {
456
+ const isLocalPluginWithLegacyAdminFile = plugin.path && fs__default$1.default.existsSync(path__default.default.join(plugin.path, "strapi-admin.js"));
457
+ if (!isLocalPluginWithLegacyAdminFile) {
458
+ const isModuleWithFE = require.resolve(`${plugin.modulePath}/strapi-admin`);
459
+ return isModuleWithFE;
460
+ }
461
+ return isLocalPluginWithLegacyAdminFile;
462
+ } catch (err) {
463
+ if (isError(err) && "code" in err && err.code === "MODULE_NOT_FOUND") {
464
+ return false;
465
+ }
466
+ throw err;
467
+ }
468
+ }).map((plugin) => ({
469
+ ...plugin,
470
+ modulePath: `${plugin.modulePath}/strapi-admin`
471
+ }));
472
+ const ADMIN_APP_FILES = ["app.js", "app.mjs", "app.ts", "app.jsx", "app.tsx"];
473
+ const loadUserAppFile = async ({
474
+ runtimeDir,
475
+ appDir
476
+ }) => {
477
+ for (const file of ADMIN_APP_FILES) {
478
+ const filePath = path__default.default.join(appDir, "src", "admin", file);
479
+ if (await pathExists(filePath)) {
480
+ return {
481
+ path: filePath,
482
+ modulePath: convertSystemPathToModulePath(path__default.default.relative(runtimeDir, filePath))
483
+ };
484
+ }
485
+ }
486
+ return void 0;
487
+ };
488
+ const DEFAULT_BROWSERSLIST = [
489
+ "last 3 major versions",
490
+ "Firefox ESR",
491
+ "last 2 Opera versions",
492
+ "not dead"
493
+ ];
494
+ const createBuildContext = async ({
495
+ cwd,
496
+ logger,
497
+ tsconfig,
498
+ strapi,
499
+ options = {}
500
+ }) => {
501
+ const strapiInstance = strapi ?? strapiFactory__default.default({
502
+ // Directories
503
+ appDir: cwd,
504
+ distDir: tsconfig?.config.options.outDir ?? "",
505
+ // Options
506
+ autoReload: true,
507
+ serveAdminPanel: false
508
+ });
509
+ const { serverUrl, adminPath } = utils.getConfigUrls(strapiInstance.config, true);
510
+ const appDir = strapiInstance.dirs.app.root;
511
+ await loadEnv(cwd);
512
+ const env = getStrapiAdminEnvVars({
513
+ ADMIN_PATH: adminPath,
514
+ STRAPI_ADMIN_BACKEND_URL: serverUrl,
515
+ STRAPI_TELEMETRY_DISABLED: String(strapiInstance.telemetry.isDisabled)
516
+ });
517
+ const envKeys = Object.keys(env);
518
+ if (envKeys.length > 0) {
519
+ logger.info(
520
+ [
521
+ "Including the following ENV variables as part of the JS bundle:",
522
+ ...envKeys.map((key) => ` - ${key}`)
523
+ ].join(os__default.default.EOL)
524
+ );
525
+ }
526
+ const distPath = path__default.default.join(strapiInstance.dirs.dist.root, "build");
527
+ const distDir = path__default.default.relative(cwd, distPath);
528
+ try {
529
+ logger.debug(`Cleaning dist folder: ${distPath}`);
530
+ await fs__default.default.rm(distPath, { recursive: true, force: true });
531
+ logger.debug("Cleaned dist folder");
532
+ } catch {
533
+ logger.debug("There was no dist folder to clean");
534
+ }
535
+ const runtimeDir = path__default.default.join(cwd, ".strapi", "client");
536
+ const entry = path__default.default.relative(cwd, path__default.default.join(runtimeDir, "app.js"));
537
+ const plugins = await getEnabledPlugins({ cwd, logger, runtimeDir, strapi: strapiInstance });
538
+ logger.debug("Enabled plugins", os__default.default.EOL, plugins);
539
+ const pluginsWithFront = getMapOfPluginsWithAdmin(plugins);
540
+ logger.debug("Enabled plugins with FE", os__default.default.EOL, plugins);
541
+ const target = browserslist__default.default.loadConfig({ path: cwd }) ?? DEFAULT_BROWSERSLIST;
542
+ const customisations = await loadUserAppFile({ appDir, runtimeDir });
543
+ const buildContext = {
544
+ appDir,
545
+ basePath: `${adminPath}/`,
546
+ customisations,
547
+ cwd,
548
+ distDir,
549
+ distPath,
550
+ entry,
551
+ env,
552
+ logger,
553
+ options,
554
+ plugins: pluginsWithFront,
555
+ runtimeDir,
556
+ strapi: strapiInstance,
557
+ target,
558
+ tsconfig
559
+ };
560
+ return buildContext;
561
+ };
303
562
  const styles = `
304
563
  .strapi--root {
305
564
  position: absolute;
@@ -479,50 +738,15 @@ async function loadStrapiMonorepo(cwd) {
479
738
  while (p !== "/") {
480
739
  const readResult = await readPkgUp__default.default({ cwd: p });
481
740
  if (!readResult) {
482
- return void 0;
483
- }
484
- if (readResult.packageJson.isStrapiMonorepo) {
485
- return { path: path__default$1.default.dirname(readResult.path) };
486
- }
487
- p = path__default$1.default.dirname(path__default$1.default.dirname(readResult.path));
488
- }
489
- return void 0;
490
- }
491
- const pathExists = async (path2) => {
492
- try {
493
- await fs.access(path2);
494
- return true;
495
- } catch (error) {
496
- return false;
497
- }
498
- };
499
- const loadFile = async (path2) => {
500
- if (await pathExists(path2)) {
501
- const esbuildOptions = {
502
- extensions: [".js", ".mjs", ".ts"]
503
- };
504
- const { unregister } = node.register(esbuildOptions);
505
- const mod = require(path2);
506
- unregister();
507
- const file = mod?.default || mod || void 0;
508
- return file;
509
- }
510
- return void 0;
511
- };
512
- const convertSystemPathToModulePath = (sysPath) => {
513
- if (process.platform === "win32") {
514
- return sysPath.split(path__default.default.sep).join(path__default.default.posix.sep);
515
- } else {
516
- return sysPath;
517
- }
518
- };
519
- const convertModulePathToSystemPath = (modulePath) => {
520
- if (process.platform === "win32") {
521
- return modulePath.split(path__default.default.posix.sep).join(path__default.default.sep);
522
- } else {
523
- return modulePath;
741
+ return void 0;
742
+ }
743
+ if (readResult.packageJson.isStrapiMonorepo) {
744
+ return { path: path__default$1.default.dirname(readResult.path) };
745
+ }
746
+ p = path__default$1.default.dirname(path__default$1.default.dirname(readResult.path));
524
747
  }
525
- };
748
+ return void 0;
749
+ }
526
750
  const resolveBaseConfig = async (ctx) => {
527
751
  const monorepo = await loadStrapiMonorepo(ctx.cwd);
528
752
  const target = browserslistToEsbuild__default.default(ctx.target);
@@ -725,27 +949,6 @@ const mergeConfigWithUserConfig = async (config, ctx) => {
725
949
  }
726
950
  return config;
727
951
  };
728
- const isError = (err) => err instanceof Error;
729
- const handleUnexpectedError = (err) => {
730
- console.error(
731
- chalk__default.default.red(
732
- `[ERROR] `,
733
- "There seems to be an unexpected error, try again with --debug for more information",
734
- os__default.default.EOL
735
- )
736
- );
737
- if (isError(err) && err.stack) {
738
- console.log(
739
- chalk__default.default.red(
740
- boxen__default.default(err.stack, {
741
- padding: 1,
742
- align: "left"
743
- })
744
- )
745
- );
746
- }
747
- process.exit(1);
748
- };
749
952
  const build$1 = async (ctx) => new Promise(async (resolve, reject) => {
750
953
  const config = await resolveProductionConfig(ctx);
751
954
  const finalConfig = await mergeConfigWithUserConfig(config, ctx);
@@ -776,206 +979,6 @@ const build$1 = async (ctx) => new Promise(async (resolve, reject) => {
776
979
  }
777
980
  });
778
981
  });
779
- const loadEnv = async (cwd) => {
780
- const pathToEnv = path__default.default.resolve(cwd, ".env");
781
- if (await pathExists(pathToEnv)) {
782
- dotenv__default.default.config({ path: pathToEnv });
783
- }
784
- };
785
- const getStrapiAdminEnvVars = (defaultEnv) => {
786
- return Object.keys(process.env).filter((key) => key.toUpperCase().startsWith("STRAPI_ADMIN_")).reduce((acc, key) => {
787
- acc[key] = process.env[key];
788
- return acc;
789
- }, defaultEnv);
790
- };
791
- const validatePackageHasStrapi = (pkg) => "strapi" in pkg && typeof pkg.strapi === "object" && !Array.isArray(pkg.strapi) && pkg.strapi !== null;
792
- const validatePackageIsPlugin = (pkg) => validatePackageHasStrapi(pkg) && pkg.strapi.kind === "plugin";
793
- const getEnabledPlugins = async ({
794
- cwd,
795
- logger,
796
- runtimeDir,
797
- strapi
798
- }) => {
799
- const plugins = {};
800
- const deps = strapi.config.get("info.dependencies", {});
801
- logger.debug("Dependencies from user's project", os__default.default.EOL, deps);
802
- for (const dep of Object.keys(deps)) {
803
- const pkg = await getModule(dep, cwd);
804
- if (pkg && validatePackageIsPlugin(pkg)) {
805
- const name = pkg.strapi.name || pkg.name;
806
- if (!name) {
807
- throw Error(
808
- "You're trying to import a plugin that doesn't have a name – check the package.json of that plugin!"
809
- );
810
- }
811
- plugins[name] = {
812
- name,
813
- importName: camelCase__default.default(name),
814
- type: "module",
815
- modulePath: dep
816
- };
817
- }
818
- }
819
- const userPluginsFile = await loadUserPluginsFile(strapi.dirs.app.config);
820
- logger.debug("User's plugins file", os__default.default.EOL, userPluginsFile);
821
- for (const [userPluginName, userPluginConfig] of Object.entries(userPluginsFile)) {
822
- if (userPluginConfig.enabled && userPluginConfig.resolve) {
823
- const sysPath = convertModulePathToSystemPath(userPluginConfig.resolve);
824
- plugins[userPluginName] = {
825
- name: userPluginName,
826
- importName: camelCase__default.default(userPluginName),
827
- type: "local",
828
- /**
829
- * User plugin paths are resolved from the entry point
830
- * of the app, because that's how you import them.
831
- */
832
- modulePath: convertSystemPathToModulePath(path__default.default.relative(runtimeDir, sysPath)),
833
- path: sysPath
834
- };
835
- }
836
- }
837
- return plugins;
838
- };
839
- const PLUGIN_CONFIGS = ["plugins.js", "plugins.mjs", "plugins.ts"];
840
- const loadUserPluginsFile = async (root) => {
841
- for (const file of PLUGIN_CONFIGS) {
842
- const filePath = path__default.default.join(root, file);
843
- const configFile = await loadFile(filePath);
844
- if (configFile) {
845
- return typeof configFile === "function" ? configFile({ env: utils.env }) : configFile;
846
- }
847
- }
848
- return {};
849
- };
850
- const getMapOfPluginsWithAdmin = (plugins) => Object.values(plugins).filter((plugin) => {
851
- if (!plugin) {
852
- return false;
853
- }
854
- try {
855
- const isLocalPluginWithLegacyAdminFile = plugin.path && fs__default$1.default.existsSync(path__default.default.join(plugin.path, "strapi-admin.js"));
856
- if (!isLocalPluginWithLegacyAdminFile) {
857
- const isModuleWithFE = require.resolve(`${plugin.modulePath}/strapi-admin`);
858
- return isModuleWithFE;
859
- }
860
- return isLocalPluginWithLegacyAdminFile;
861
- } catch (err) {
862
- if (isError(err) && "code" in err && err.code === "MODULE_NOT_FOUND") {
863
- return false;
864
- }
865
- throw err;
866
- }
867
- }).map((plugin) => ({
868
- ...plugin,
869
- modulePath: `${plugin.modulePath}/strapi-admin`
870
- }));
871
- const ADMIN_APP_FILES = ["app.js", "app.mjs", "app.ts", "app.jsx", "app.tsx"];
872
- const loadUserAppFile = async ({
873
- runtimeDir,
874
- appDir
875
- }) => {
876
- for (const file of ADMIN_APP_FILES) {
877
- const filePath = path__default.default.join(appDir, "src", "admin", file);
878
- if (await pathExists(filePath)) {
879
- return {
880
- path: filePath,
881
- modulePath: convertSystemPathToModulePath(path__default.default.relative(runtimeDir, filePath))
882
- };
883
- }
884
- }
885
- return void 0;
886
- };
887
- const DEFAULT_BROWSERSLIST = [
888
- "last 3 major versions",
889
- "Firefox ESR",
890
- "last 2 Opera versions",
891
- "not dead"
892
- ];
893
- const createBuildContext = async ({
894
- cwd,
895
- logger,
896
- tsconfig,
897
- strapi,
898
- options = {}
899
- }) => {
900
- const strapiInstance = strapi ?? strapiFactory__default.default({
901
- // Directories
902
- appDir: cwd,
903
- distDir: tsconfig?.config.options.outDir ?? "",
904
- // Options
905
- autoReload: true,
906
- serveAdminPanel: false
907
- });
908
- const { serverUrl, adminPath } = utils.getConfigUrls(strapiInstance.config, true);
909
- const appDir = strapiInstance.dirs.app.root;
910
- await loadEnv(cwd);
911
- const env = getStrapiAdminEnvVars({
912
- ADMIN_PATH: adminPath,
913
- STRAPI_ADMIN_BACKEND_URL: serverUrl,
914
- STRAPI_TELEMETRY_DISABLED: String(strapiInstance.telemetry.isDisabled)
915
- });
916
- const envKeys = Object.keys(env);
917
- if (envKeys.length > 0) {
918
- logger.info(
919
- [
920
- "Including the following ENV variables as part of the JS bundle:",
921
- ...envKeys.map((key) => ` - ${key}`)
922
- ].join(os__default.default.EOL)
923
- );
924
- }
925
- const distPath = path__default.default.join(strapiInstance.dirs.dist.root, "build");
926
- const distDir = path__default.default.relative(cwd, distPath);
927
- try {
928
- logger.debug(`Cleaning dist folder: ${distPath}`);
929
- await fs__default.default.rm(distPath, { recursive: true, force: true });
930
- logger.debug("Cleaned dist folder");
931
- } catch {
932
- logger.debug("There was no dist folder to clean");
933
- }
934
- const runtimeDir = path__default.default.join(cwd, ".strapi", "client");
935
- const entry = path__default.default.relative(cwd, path__default.default.join(runtimeDir, "app.js"));
936
- const plugins = await getEnabledPlugins({ cwd, logger, runtimeDir, strapi: strapiInstance });
937
- logger.debug("Enabled plugins", os__default.default.EOL, plugins);
938
- const pluginsWithFront = getMapOfPluginsWithAdmin(plugins);
939
- logger.debug("Enabled plugins with FE", os__default.default.EOL, plugins);
940
- const target = browserslist__default.default.loadConfig({ path: cwd }) ?? DEFAULT_BROWSERSLIST;
941
- const customisations = await loadUserAppFile({ appDir, runtimeDir });
942
- const buildContext = {
943
- appDir,
944
- basePath: `${adminPath}/`,
945
- customisations,
946
- cwd,
947
- distDir,
948
- distPath,
949
- entry,
950
- env,
951
- logger,
952
- options,
953
- plugins: pluginsWithFront,
954
- runtimeDir,
955
- strapi: strapiInstance,
956
- target,
957
- tsconfig
958
- };
959
- return buildContext;
960
- };
961
- function getTimer() {
962
- const timings = {};
963
- const startTimes = {};
964
- function start(name) {
965
- if (typeof startTimes[name] !== "undefined") {
966
- throw new Error(`Timer "${name}" already started, cannot overwrite`);
967
- }
968
- startTimes[name] = perf_hooks.performance.now();
969
- }
970
- function end(name) {
971
- if (typeof startTimes[name] === "undefined") {
972
- throw new Error(`Timer "${name}" never started, cannot end`);
973
- }
974
- timings[name] = perf_hooks.performance.now() - startTimes[name];
975
- return timings[name];
976
- }
977
- return { start, end, getTimings: () => timings };
978
- }
979
982
  const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
980
983
  const timer = getTimer();
981
984
  const { didInstall } = await checkRequiredDependencies({ cwd, logger, ignorePrompts }).catch(
@@ -992,7 +995,7 @@ const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
992
995
  const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
993
996
  tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
994
997
  const compilingDuration = timer.end("compilingTS");
995
- compilingTsSpinner.text = `Compiling TS (${compilingDuration}ms)`;
998
+ compilingTsSpinner.text = `Compiling TS (${prettyTime(compilingDuration)})`;
996
999
  compilingTsSpinner.succeed();
997
1000
  }
998
1001
  timer.start("createBuildContext");
@@ -1005,7 +1008,7 @@ const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
1005
1008
  options
1006
1009
  });
1007
1010
  const contextDuration = timer.end("createBuildContext");
1008
- contextSpinner.text = `Building build context (${contextDuration}ms)`;
1011
+ contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
1009
1012
  contextSpinner.succeed();
1010
1013
  timer.start("buildAdmin");
1011
1014
  const buildingSpinner = logger.spinner(`Building admin panel`).start();
@@ -1015,7 +1018,7 @@ const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
1015
1018
  await writeStaticClientFiles(ctx);
1016
1019
  await build$1(ctx);
1017
1020
  const buildDuration = timer.end("buildAdmin");
1018
- buildingSpinner.text = `Building admin panel (${buildDuration}ms)`;
1021
+ buildingSpinner.text = `Building admin panel (${prettyTime(buildDuration)})`;
1019
1022
  buildingSpinner.succeed();
1020
1023
  } catch (err) {
1021
1024
  buildingSpinner.fail();
@@ -1103,6 +1106,35 @@ const watch = async (ctx) => {
1103
1106
  });
1104
1107
  });
1105
1108
  };
1109
+ const cleanupDistDirectory = async ({
1110
+ tsconfig,
1111
+ logger,
1112
+ timer
1113
+ }) => {
1114
+ const distDir = tsconfig?.config?.options?.outDir;
1115
+ if (!distDir || // we don't have a dist dir
1116
+ await fs__default.default.access(distDir).then(() => false).catch(() => true)) {
1117
+ return;
1118
+ }
1119
+ const timerName = "cleaningDist" + Date.now();
1120
+ timer.start(timerName);
1121
+ const cleaningSpinner = logger.spinner(`Cleaning dist dir ${distDir}`).start();
1122
+ try {
1123
+ const dirContent = await fs__default.default.readdir(distDir);
1124
+ const validFilenames = dirContent.filter((filename) => filename !== "build");
1125
+ for (const filename of validFilenames) {
1126
+ await fs__default.default.rm(path__default.default.resolve(distDir, filename), { recursive: true });
1127
+ }
1128
+ } catch (err) {
1129
+ const generatingDuration2 = timer.end(timerName);
1130
+ cleaningSpinner.text = `Error cleaning dist dir: ${err} (${prettyTime(generatingDuration2)})`;
1131
+ cleaningSpinner?.fail();
1132
+ return;
1133
+ }
1134
+ const generatingDuration = timer.end(timerName);
1135
+ cleaningSpinner.text = `Cleaning dist dir (${prettyTime(generatingDuration)})`;
1136
+ cleaningSpinner?.succeed();
1137
+ };
1106
1138
  const develop = async ({
1107
1139
  cwd,
1108
1140
  polling,
@@ -1123,6 +1155,10 @@ const develop = async ({
1123
1155
  if (didInstall) {
1124
1156
  return;
1125
1157
  }
1158
+ if (tsconfig?.config) {
1159
+ await cleanupDistDirectory({ tsconfig, logger, timer });
1160
+ await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: true } });
1161
+ }
1126
1162
  if (!watchAdmin) {
1127
1163
  timer.start("createBuildContext");
1128
1164
  const contextSpinner = logger.spinner(`Building build context`).start();
@@ -1134,7 +1170,7 @@ const develop = async ({
1134
1170
  options
1135
1171
  });
1136
1172
  const contextDuration = timer.end("createBuildContext");
1137
- contextSpinner.text = `Building build context (${contextDuration}ms)`;
1173
+ contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
1138
1174
  contextSpinner.succeed();
1139
1175
  timer.start("creatingAdmin");
1140
1176
  const adminSpinner = logger.spinner(`Creating admin`).start();
@@ -1142,12 +1178,16 @@ const develop = async ({
1142
1178
  await writeStaticClientFiles(ctx);
1143
1179
  await build$1(ctx);
1144
1180
  const adminDuration = timer.end("creatingAdmin");
1145
- adminSpinner.text = `Creating admin (${adminDuration}ms)`;
1181
+ adminSpinner.text = `Creating admin (${prettyTime(adminDuration)})`;
1146
1182
  adminSpinner.succeed();
1147
1183
  }
1148
1184
  cluster__default.default.on("message", async (worker, message) => {
1149
1185
  switch (message) {
1150
1186
  case "reload": {
1187
+ if (tsconfig?.config) {
1188
+ await cleanupDistDirectory({ tsconfig, logger, timer });
1189
+ await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: true } });
1190
+ }
1151
1191
  logger.debug("cluster has the reload message, sending the worker kill message");
1152
1192
  worker.send("kill");
1153
1193
  break;
@@ -1166,14 +1206,8 @@ const develop = async ({
1166
1206
  cluster__default.default.fork();
1167
1207
  }
1168
1208
  if (cluster__default.default.isWorker) {
1169
- if (tsconfig?.config) {
1170
- timer.start("compilingTS");
1171
- const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
1172
- tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
1173
- const compilingDuration = timer.end("compilingTS");
1174
- compilingTsSpinner.text = `Compiling TS (${compilingDuration}ms)`;
1175
- compilingTsSpinner.succeed();
1176
- }
1209
+ timer.start("loadStrapi");
1210
+ const loadStrapiSpinner = logger.spinner(`Loading Strapi`).start();
1177
1211
  const strapi = strapiFactory__default.default({
1178
1212
  appDir: cwd,
1179
1213
  distDir: tsconfig?.config.options.outDir ?? "",
@@ -1193,7 +1227,7 @@ const develop = async ({
1193
1227
  options
1194
1228
  });
1195
1229
  const contextDuration = timer.end("createBuildContext");
1196
- contextSpinner.text = `Building build context (${contextDuration}ms)`;
1230
+ contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
1197
1231
  contextSpinner.succeed();
1198
1232
  timer.start("creatingAdmin");
1199
1233
  const adminSpinner = logger.spinner(`Creating admin`).start();
@@ -1201,10 +1235,13 @@ const develop = async ({
1201
1235
  await writeStaticClientFiles(ctx);
1202
1236
  webpackWatcher = await watch(ctx);
1203
1237
  const adminDuration = timer.end("creatingAdmin");
1204
- adminSpinner.text = `Creating admin (${adminDuration}ms)`;
1238
+ adminSpinner.text = `Creating admin (${prettyTime(adminDuration)})`;
1205
1239
  adminSpinner.succeed();
1206
1240
  }
1207
1241
  const strapiInstance = await strapi.load();
1242
+ const loadStrapiDuration = timer.end("loadStrapi");
1243
+ loadStrapiSpinner.text = `Loading Strapi (${prettyTime(loadStrapiDuration)})`;
1244
+ loadStrapiSpinner.succeed();
1208
1245
  timer.start("generatingTS");
1209
1246
  const generatingTsSpinner = logger.spinner(`Generating types`).start();
1210
1247
  await tsUtils__namespace.generators.generate({
@@ -1215,8 +1252,17 @@ const develop = async ({
1215
1252
  artifacts: { contentTypes: true, components: true }
1216
1253
  });
1217
1254
  const generatingDuration = timer.end("generatingTS");
1218
- generatingTsSpinner.text = `Generating types (${generatingDuration}ms)`;
1255
+ generatingTsSpinner.text = `Generating types (${prettyTime(generatingDuration)})`;
1219
1256
  generatingTsSpinner.succeed();
1257
+ if (tsconfig?.config) {
1258
+ timer.start("compilingTS");
1259
+ const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
1260
+ await cleanupDistDirectory({ tsconfig, logger, timer });
1261
+ await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
1262
+ const compilingDuration = timer.end("compilingTS");
1263
+ compilingTsSpinner.text = `Compiling TS (${prettyTime(compilingDuration)})`;
1264
+ compilingTsSpinner.succeed();
1265
+ }
1220
1266
  const restart = async () => {
1221
1267
  if (strapiInstance.reload.isWatching && !strapiInstance.reload.isReloading) {
1222
1268
  strapiInstance.reload.isReloading = true;
@@ -1284,4 +1330,4 @@ exports.build = build;
1284
1330
  exports.develop = develop;
1285
1331
  exports.handleUnexpectedError = handleUnexpectedError;
1286
1332
  exports.index = index;
1287
- //# sourceMappingURL=index-b84b9fee.js.map
1333
+ //# sourceMappingURL=index-1a74fa41.js.map