@strapi/admin 4.15.5-alpha.2 → 4.15.5-alpha.4

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-4b160235.js → AuthenticatedApp-31e6418d.js} +21 -21
  2. package/dist/_chunks/{AuthenticatedApp-4b160235.js.map → AuthenticatedApp-31e6418d.js.map} +1 -1
  3. package/dist/_chunks/{AuthenticatedApp-fa931d1d.mjs → AuthenticatedApp-52d37e32.mjs} +21 -21
  4. package/dist/_chunks/{AuthenticatedApp-fa931d1d.mjs.map → AuthenticatedApp-52d37e32.mjs.map} +1 -1
  5. package/dist/_chunks/{HomePage-b91d1592.js → HomePage-0f953b49.js} +4 -4
  6. package/dist/_chunks/{HomePage-b91d1592.js.map → HomePage-0f953b49.js.map} +1 -1
  7. package/dist/_chunks/{HomePage-8e98be60.mjs → HomePage-1e7b2e66.mjs} +4 -4
  8. package/dist/_chunks/{HomePage-8e98be60.mjs.map → HomePage-1e7b2e66.mjs.map} +1 -1
  9. package/dist/_chunks/{HomePage-9bda39b5.mjs → HomePage-a2c12504.mjs} +4 -4
  10. package/dist/_chunks/{HomePage-9bda39b5.mjs.map → HomePage-a2c12504.mjs.map} +1 -1
  11. package/dist/_chunks/{HomePage-b6967648.js → HomePage-d0f7fc69.js} +4 -4
  12. package/dist/_chunks/{HomePage-b6967648.js.map → HomePage-d0f7fc69.js.map} +1 -1
  13. package/dist/_chunks/{InstalledPluginsPage-ee6d69b0.mjs → InstalledPluginsPage-3fc71003.mjs} +3 -3
  14. package/dist/_chunks/{InstalledPluginsPage-ee6d69b0.mjs.map → InstalledPluginsPage-3fc71003.mjs.map} +1 -1
  15. package/dist/_chunks/{InstalledPluginsPage-d4b90e9c.js → InstalledPluginsPage-46e14507.js} +3 -3
  16. package/dist/_chunks/{InstalledPluginsPage-d4b90e9c.js.map → InstalledPluginsPage-46e14507.js.map} +1 -1
  17. package/dist/_chunks/{Login-5fbf37c3.js → Login-550366a9.js} +2 -2
  18. package/dist/_chunks/{Login-5fbf37c3.js.map → Login-550366a9.js.map} +1 -1
  19. package/dist/_chunks/{Login-4fc5dcbb.mjs → Login-57e0fd9c.mjs} +2 -2
  20. package/dist/_chunks/{Login-4fc5dcbb.mjs.map → Login-57e0fd9c.mjs.map} +1 -1
  21. package/dist/_chunks/{MarketplacePage-ff0d02c6.js → MarketplacePage-138e7b39.js} +3 -3
  22. package/dist/_chunks/{MarketplacePage-ff0d02c6.js.map → MarketplacePage-138e7b39.js.map} +1 -1
  23. package/dist/_chunks/{MarketplacePage-ec9bf1db.mjs → MarketplacePage-2505749a.mjs} +3 -3
  24. package/dist/_chunks/{MarketplacePage-ec9bf1db.mjs.map → MarketplacePage-2505749a.mjs.map} +1 -1
  25. package/dist/_chunks/{ProfilePage-96a8404e.js → ProfilePage-23b8a29f.js} +3 -3
  26. package/dist/_chunks/{ProfilePage-96a8404e.js.map → ProfilePage-23b8a29f.js.map} +1 -1
  27. package/dist/_chunks/{ProfilePage-caeace8c.mjs → ProfilePage-bd50b4f3.mjs} +3 -3
  28. package/dist/_chunks/{ProfilePage-caeace8c.mjs.map → ProfilePage-bd50b4f3.mjs.map} +1 -1
  29. package/dist/_chunks/{build-f011d8dc.mjs → build-92e15b93.mjs} +13 -13
  30. package/dist/_chunks/{build-f011d8dc.mjs.map → build-92e15b93.mjs.map} +1 -1
  31. package/dist/_chunks/{build-b285bccd.js → build-df2f219f.js} +13 -13
  32. package/dist/_chunks/{build-b285bccd.js.map → build-df2f219f.js.map} +1 -1
  33. package/dist/_chunks/{constants-916debf1.js → constants-06897e38.js} +2 -2
  34. package/dist/_chunks/{constants-916debf1.js.map → constants-06897e38.js.map} +1 -1
  35. package/dist/_chunks/{constants-129cf022.mjs → constants-362e760f.mjs} +6 -6
  36. package/dist/_chunks/{constants-129cf022.mjs.map → constants-362e760f.mjs.map} +1 -1
  37. package/dist/_chunks/{constants-1bd1239d.js → constants-4539f7ac.js} +6 -6
  38. package/dist/_chunks/{constants-1bd1239d.js.map → constants-4539f7ac.js.map} +1 -1
  39. package/dist/_chunks/{constants-39df4f04.mjs → constants-59bcff2e.mjs} +3 -3
  40. package/dist/_chunks/{constants-39df4f04.mjs.map → constants-59bcff2e.mjs.map} +1 -1
  41. package/dist/_chunks/{constants-7bfc7134.mjs → constants-6dcb43aa.mjs} +2 -2
  42. package/dist/_chunks/{constants-7bfc7134.mjs.map → constants-6dcb43aa.mjs.map} +1 -1
  43. package/dist/_chunks/{constants-86882708.js → constants-88f9d2a0.js} +3 -3
  44. package/dist/_chunks/{constants-86882708.js.map → constants-88f9d2a0.js.map} +1 -1
  45. package/dist/_chunks/{constants-cd5a4e71.js → constants-ac7899ed.js} +5 -5
  46. package/dist/_chunks/{constants-cd5a4e71.js.map → constants-ac7899ed.js.map} +1 -1
  47. package/dist/_chunks/{constants-ffa23daa.mjs → constants-e2c67ec8.mjs} +5 -5
  48. package/dist/_chunks/{constants-ffa23daa.mjs.map → constants-e2c67ec8.mjs.map} +1 -1
  49. package/dist/_chunks/{develop-9765d7ba.js → develop-4d25a6e0.js} +13 -13
  50. package/dist/_chunks/{develop-9765d7ba.js.map → develop-4d25a6e0.js.map} +1 -1
  51. package/dist/_chunks/{develop-3c9f7452.mjs → develop-a46fed01.mjs} +13 -13
  52. package/dist/_chunks/{develop-3c9f7452.mjs.map → develop-a46fed01.mjs.map} +1 -1
  53. package/dist/_chunks/{index-f18d27fd.js → index-02064a74.js} +3 -3
  54. package/dist/_chunks/{index-f18d27fd.js.map → index-02064a74.js.map} +1 -1
  55. package/dist/_chunks/{index-332b3702.mjs → index-03e8b9e3.mjs} +3 -3
  56. package/dist/_chunks/{index-332b3702.mjs.map → index-03e8b9e3.mjs.map} +1 -1
  57. package/dist/_chunks/{index-539c5eac.js → index-074a5de8.js} +2 -2
  58. package/dist/_chunks/{index-539c5eac.js.map → index-074a5de8.js.map} +1 -1
  59. package/dist/_chunks/{index-e2db7aa8.mjs → index-0778959c.mjs} +6 -6
  60. package/dist/_chunks/{index-e2db7aa8.mjs.map → index-0778959c.mjs.map} +1 -1
  61. package/dist/_chunks/{index-455d0b3e.js → index-0b787ac1.js} +5 -5
  62. package/dist/_chunks/{index-455d0b3e.js.map → index-0b787ac1.js.map} +1 -1
  63. package/dist/_chunks/{index-7c0dcf2b.js → index-133699a3.js} +4 -4
  64. package/dist/_chunks/{index-7c0dcf2b.js.map → index-133699a3.js.map} +1 -1
  65. package/dist/_chunks/{index-6861cd84.mjs → index-13ab14ec.mjs} +3 -3
  66. package/dist/_chunks/{index-6861cd84.mjs.map → index-13ab14ec.mjs.map} +1 -1
  67. package/dist/_chunks/{index-d196ac50.js → index-148939b0.js} +4 -4
  68. package/dist/_chunks/{index-d196ac50.js.map → index-148939b0.js.map} +1 -1
  69. package/dist/_chunks/{index-891d1527.mjs → index-15c76f0b.mjs} +4 -4
  70. package/dist/_chunks/{index-891d1527.mjs.map → index-15c76f0b.mjs.map} +1 -1
  71. package/dist/_chunks/{index-653e1ab3.js → index-19b1984d.js} +2 -2
  72. package/dist/_chunks/{index-653e1ab3.js.map → index-19b1984d.js.map} +1 -1
  73. package/dist/_chunks/{index-d33c8d9f.mjs → index-1a3e997a.mjs} +8 -8
  74. package/dist/_chunks/{index-d33c8d9f.mjs.map → index-1a3e997a.mjs.map} +1 -1
  75. package/dist/_chunks/{index-62b7bdbe.js → index-1a74fa41.js} +343 -285
  76. package/dist/_chunks/index-1a74fa41.js.map +1 -0
  77. package/dist/_chunks/{index-d80de23d.mjs → index-1a7cc203.mjs} +3 -3
  78. package/dist/_chunks/{index-d80de23d.mjs.map → index-1a7cc203.mjs.map} +1 -1
  79. package/dist/_chunks/{index-f4a061be.mjs → index-23925f10.mjs} +2 -2
  80. package/dist/_chunks/{index-f4a061be.mjs.map → index-23925f10.mjs.map} +1 -1
  81. package/dist/_chunks/{index-006ef0ac.js → index-24b626a6.js} +3 -3
  82. package/dist/_chunks/{index-006ef0ac.js.map → index-24b626a6.js.map} +1 -1
  83. package/dist/_chunks/{index-43e86c36.mjs → index-2b48526d.mjs} +5 -5
  84. package/dist/_chunks/{index-43e86c36.mjs.map → index-2b48526d.mjs.map} +1 -1
  85. package/dist/_chunks/{index-6bfd0b33.js → index-2c76e5e2.js} +3 -3
  86. package/dist/_chunks/{index-6bfd0b33.js.map → index-2c76e5e2.js.map} +1 -1
  87. package/dist/_chunks/{index-54dc318d.js → index-36a7c525.js} +3 -3
  88. package/dist/_chunks/{index-54dc318d.js.map → index-36a7c525.js.map} +1 -1
  89. package/dist/_chunks/{index-df043af5.mjs → index-3a96c79f.mjs} +3 -3
  90. package/dist/_chunks/{index-df043af5.mjs.map → index-3a96c79f.mjs.map} +1 -1
  91. package/dist/_chunks/{index-57ae9065.mjs → index-3be46ca9.mjs} +3 -3
  92. package/dist/_chunks/{index-57ae9065.mjs.map → index-3be46ca9.mjs.map} +1 -1
  93. package/dist/_chunks/{index-9b3ff96c.mjs → index-4544af4c.mjs} +20 -20
  94. package/dist/_chunks/{index-9b3ff96c.mjs.map → index-4544af4c.mjs.map} +1 -1
  95. package/dist/_chunks/{index-f3c67f77.js → index-4b8c01d4.js} +2 -2
  96. package/dist/_chunks/{index-f3c67f77.js.map → index-4b8c01d4.js.map} +1 -1
  97. package/dist/_chunks/{index-0bd0d840.mjs → index-4fef292a.mjs} +3 -3
  98. package/dist/_chunks/{index-0bd0d840.mjs.map → index-4fef292a.mjs.map} +1 -1
  99. package/dist/_chunks/{index-f67d8e8d.mjs → index-5113c6be.mjs} +2 -2
  100. package/dist/_chunks/{index-f67d8e8d.mjs.map → index-5113c6be.mjs.map} +1 -1
  101. package/dist/_chunks/{index-05ada54b.js → index-58ffc071.js} +3 -3
  102. package/dist/_chunks/{index-05ada54b.js.map → index-58ffc071.js.map} +1 -1
  103. package/dist/_chunks/{index-c184f4d7.mjs → index-59880344.mjs} +5 -5
  104. package/dist/_chunks/{index-c184f4d7.mjs.map → index-59880344.mjs.map} +1 -1
  105. package/dist/_chunks/{index-9c88e73f.js → index-5c19f439.js} +5 -5
  106. package/dist/_chunks/{index-9c88e73f.js.map → index-5c19f439.js.map} +1 -1
  107. package/dist/_chunks/{index-b593ff2a.mjs → index-610889c4.mjs} +4 -4
  108. package/dist/_chunks/{index-b593ff2a.mjs.map → index-610889c4.mjs.map} +1 -1
  109. package/dist/_chunks/{index-05001647.js → index-628c5937.js} +8 -8
  110. package/dist/_chunks/{index-05001647.js.map → index-628c5937.js.map} +1 -1
  111. package/dist/_chunks/{index-2ed87ac8.js → index-64a156de.js} +3 -3
  112. package/dist/_chunks/{index-2ed87ac8.js.map → index-64a156de.js.map} +1 -1
  113. package/dist/_chunks/{index-1bf08614.mjs → index-67a35378.mjs} +3 -3
  114. package/dist/_chunks/{index-1bf08614.mjs.map → index-67a35378.mjs.map} +1 -1
  115. package/dist/_chunks/{index-3fb94612.js → index-6b1148f6.js} +4 -4
  116. package/dist/_chunks/{index-3fb94612.js.map → index-6b1148f6.js.map} +1 -1
  117. package/dist/_chunks/{index-0c5f6415.js → index-6db2b431.js} +5 -5
  118. package/dist/_chunks/{index-0c5f6415.js.map → index-6db2b431.js.map} +1 -1
  119. package/dist/_chunks/{index-dff777b7.js → index-6e44aef9.js} +3 -3
  120. package/dist/_chunks/{index-dff777b7.js.map → index-6e44aef9.js.map} +1 -1
  121. package/dist/_chunks/{index-a684490c.mjs → index-70189e76.mjs} +3 -3
  122. package/dist/_chunks/{index-a684490c.mjs.map → index-70189e76.mjs.map} +1 -1
  123. package/dist/_chunks/{index-7028ad70.js → index-86172b2d.js} +4 -4
  124. package/dist/_chunks/{index-7028ad70.js.map → index-86172b2d.js.map} +1 -1
  125. package/dist/_chunks/{index-09752dfe.js → index-898ba1c6.js} +3 -3
  126. package/dist/_chunks/{index-09752dfe.js.map → index-898ba1c6.js.map} +1 -1
  127. package/dist/_chunks/{index-c40ee26a.mjs → index-8bca9e4c.mjs} +4 -4
  128. package/dist/_chunks/{index-c40ee26a.mjs.map → index-8bca9e4c.mjs.map} +1 -1
  129. package/dist/_chunks/{index-1eaab33f.js → index-8cafda81.js} +4 -4
  130. package/dist/_chunks/{index-1eaab33f.js.map → index-8cafda81.js.map} +1 -1
  131. package/dist/_chunks/{index-d5711ebb.js → index-9195720c.js} +5 -5
  132. package/dist/_chunks/{index-d5711ebb.js.map → index-9195720c.js.map} +1 -1
  133. package/dist/_chunks/{index-eea1e084.mjs → index-91ef29b3.mjs} +3 -3
  134. package/dist/_chunks/{index-eea1e084.mjs.map → index-91ef29b3.mjs.map} +1 -1
  135. package/dist/_chunks/{index-782c0685.mjs → index-994d2c5d.mjs} +2 -2
  136. package/dist/_chunks/{index-782c0685.mjs.map → index-994d2c5d.mjs.map} +1 -1
  137. package/dist/_chunks/{index-7a956856.js → index-9deb8ccb.js} +4 -4
  138. package/dist/_chunks/{index-7a956856.js.map → index-9deb8ccb.js.map} +1 -1
  139. package/dist/_chunks/{index-cd2af4a0.mjs → index-9eb4c34d.mjs} +5 -5
  140. package/dist/_chunks/{index-cd2af4a0.mjs.map → index-9eb4c34d.mjs.map} +1 -1
  141. package/dist/_chunks/{index-de154c58.mjs → index-9f8605e5.mjs} +3 -3
  142. package/dist/_chunks/{index-de154c58.mjs.map → index-9f8605e5.mjs.map} +1 -1
  143. package/dist/_chunks/{index-e013fe86.js → index-a0af8beb.js} +3 -3
  144. package/dist/_chunks/{index-e013fe86.js.map → index-a0af8beb.js.map} +1 -1
  145. package/dist/_chunks/{index-a220f0b2.mjs → index-aceb13c1.mjs} +4 -4
  146. package/dist/_chunks/{index-a220f0b2.mjs.map → index-aceb13c1.mjs.map} +1 -1
  147. package/dist/_chunks/{index-82f22c48.js → index-aee95cda.js} +3 -3
  148. package/dist/_chunks/{index-82f22c48.js.map → index-aee95cda.js.map} +1 -1
  149. package/dist/_chunks/{index-55a46be8.mjs → index-b17c7874.mjs} +3 -3
  150. package/dist/_chunks/{index-55a46be8.mjs.map → index-b17c7874.mjs.map} +1 -1
  151. package/dist/_chunks/{index-234ed67d.mjs → index-bb22dbbc.mjs} +3 -3
  152. package/dist/_chunks/{index-234ed67d.mjs.map → index-bb22dbbc.mjs.map} +1 -1
  153. package/dist/_chunks/{index-b6c497e5.js → index-be02d51c.js} +20 -20
  154. package/dist/_chunks/{index-b6c497e5.js.map → index-be02d51c.js.map} +1 -1
  155. package/dist/_chunks/{index-cdc1221a.js → index-be8eb534.js} +3 -3
  156. package/dist/_chunks/{index-cdc1221a.js.map → index-be8eb534.js.map} +1 -1
  157. package/dist/_chunks/{index-05f82f02.js → index-c36d6802.js} +3 -3
  158. package/dist/_chunks/{index-05f82f02.js.map → index-c36d6802.js.map} +1 -1
  159. package/dist/_chunks/{index-4343f97f.mjs → index-c45d5f19.mjs} +4 -4
  160. package/dist/_chunks/{index-4343f97f.mjs.map → index-c45d5f19.mjs.map} +1 -1
  161. package/dist/_chunks/{index-8d895e56.mjs → index-c59a117e.mjs} +3 -3
  162. package/dist/_chunks/{index-8d895e56.mjs.map → index-c59a117e.mjs.map} +1 -1
  163. package/dist/_chunks/{index-853bad50.mjs → index-c9e68296.mjs} +5 -5
  164. package/dist/_chunks/{index-853bad50.mjs.map → index-c9e68296.mjs.map} +1 -1
  165. package/dist/_chunks/{index-4e8af716.js → index-cd6b99a8.js} +5 -5
  166. package/dist/_chunks/{index-4e8af716.js.map → index-cd6b99a8.js.map} +1 -1
  167. package/dist/_chunks/{index-326b9481.mjs → index-ce41b6f0.mjs} +4 -4
  168. package/dist/_chunks/{index-326b9481.mjs.map → index-ce41b6f0.mjs.map} +1 -1
  169. package/dist/_chunks/{index-8acbbabe.js → index-d3dea80c.js} +6 -6
  170. package/dist/_chunks/{index-8acbbabe.js.map → index-d3dea80c.js.map} +1 -1
  171. package/dist/_chunks/{index-706ae836.js → index-d63b0b91.js} +4 -4
  172. package/dist/_chunks/{index-706ae836.js.map → index-d63b0b91.js.map} +1 -1
  173. package/dist/_chunks/{index-77124563.mjs → index-dc4938ad.mjs} +5 -5
  174. package/dist/_chunks/{index-77124563.mjs.map → index-dc4938ad.mjs.map} +1 -1
  175. package/dist/_chunks/{index-c075b5a1.mjs → index-dc89c18c.mjs} +335 -277
  176. package/dist/_chunks/index-dc89c18c.mjs.map +1 -0
  177. package/dist/_chunks/{index-f0f40db4.mjs → index-ea43b165.mjs} +5 -5
  178. package/dist/_chunks/{index-f0f40db4.mjs.map → index-ea43b165.mjs.map} +1 -1
  179. package/dist/_chunks/{index-55d6d65a.js → index-eb59cabf.js} +3 -3
  180. package/dist/_chunks/{index-55d6d65a.js.map → index-eb59cabf.js.map} +1 -1
  181. package/dist/_chunks/{index-d9f9de85.mjs → index-fae4b277.mjs} +4 -4
  182. package/dist/_chunks/{index-d9f9de85.mjs.map → index-fae4b277.mjs.map} +1 -1
  183. package/dist/_chunks/{index-96af3a65.js → index-ff9d30ef.js} +5 -5
  184. package/dist/_chunks/{index-96af3a65.js.map → index-ff9d30ef.js.map} +1 -1
  185. package/dist/_chunks/{schema-82ad2cb1.mjs → schema-549f8236.mjs} +2 -2
  186. package/dist/_chunks/{schema-82ad2cb1.mjs.map → schema-549f8236.mjs.map} +1 -1
  187. package/dist/_chunks/{schema-8bb5b01b.js → schema-e3080441.js} +2 -2
  188. package/dist/_chunks/{schema-8bb5b01b.js.map → schema-e3080441.js.map} +1 -1
  189. package/dist/_chunks/{validateWorkflow-23b1ee38.mjs → validateWorkflow-7bff41ac.mjs} +3 -3
  190. package/dist/_chunks/{validateWorkflow-23b1ee38.mjs.map → validateWorkflow-7bff41ac.mjs.map} +1 -1
  191. package/dist/_chunks/{validateWorkflow-f5761727.js → validateWorkflow-a7311af1.js} +3 -3
  192. package/dist/_chunks/{validateWorkflow-f5761727.js.map → validateWorkflow-a7311af1.js.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-62b7bdbe.js.map +0 -1
  199. package/dist/_chunks/index-c075b5a1.mjs.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-b285bccd.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-9765d7ba.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;
@@ -359,7 +618,7 @@ const DefaultDocument = () => {
359
618
  };
360
619
  const getEntryModule = (ctx) => {
361
620
  const pluginsObject = ctx.plugins.map(({ name, importName }) => `'${name}': ${importName}`).join(",\n");
362
- const pluginsImport = ctx.plugins.map(({ importName, path: path2 }) => `import ${importName} from '${path2}';`).join("\n");
621
+ const pluginsImport = ctx.plugins.map(({ importName, modulePath }) => `import ${importName} from '${modulePath}';`).join("\n");
363
622
  return outdent__default.default`
364
623
  /**
365
624
  * This file was automatically generated by Strapi.
@@ -368,15 +627,12 @@ const getEntryModule = (ctx) => {
368
627
  ${pluginsImport}
369
628
  import { renderAdmin } from "@strapi/strapi/admin"
370
629
 
371
- ${ctx.customisations?.path ? `import customisations from '${path__default.default.relative(
372
- ctx.runtimeDir,
373
- ctx.customisations.path
374
- )}'` : ""}
630
+ ${ctx.customisations?.modulePath ? `import customisations from '${ctx.customisations.modulePath}'` : ""}
375
631
 
376
632
  renderAdmin(
377
633
  document.getElementById("strapi"),
378
634
  {
379
- ${ctx.customisations?.path ? "customisations," : ""}
635
+ ${ctx.customisations?.modulePath ? "customisations," : ""}
380
636
  plugins: {
381
637
  ${pluginsObject}
382
638
  }
@@ -491,27 +747,6 @@ async function loadStrapiMonorepo(cwd) {
491
747
  }
492
748
  return void 0;
493
749
  }
494
- const pathExists = async (path2) => {
495
- try {
496
- await fs.access(path2);
497
- return true;
498
- } catch (error) {
499
- return false;
500
- }
501
- };
502
- const loadFile = async (path2) => {
503
- if (await pathExists(path2)) {
504
- const esbuildOptions = {
505
- extensions: [".js", ".mjs", ".ts"]
506
- };
507
- const { unregister } = node.register(esbuildOptions);
508
- const mod = require(path2);
509
- unregister();
510
- const file = mod?.default || mod || void 0;
511
- return file;
512
- }
513
- return void 0;
514
- };
515
750
  const resolveBaseConfig = async (ctx) => {
516
751
  const monorepo = await loadStrapiMonorepo(ctx.cwd);
517
752
  const target = browserslistToEsbuild__default.default(ctx.target);
@@ -714,27 +949,6 @@ const mergeConfigWithUserConfig = async (config, ctx) => {
714
949
  }
715
950
  return config;
716
951
  };
717
- const isError = (err) => err instanceof Error;
718
- const handleUnexpectedError = (err) => {
719
- console.error(
720
- chalk__default.default.red(
721
- `[ERROR] `,
722
- "There seems to be an unexpected error, try again with --debug for more information",
723
- os__default.default.EOL
724
- )
725
- );
726
- if (isError(err) && err.stack) {
727
- console.log(
728
- chalk__default.default.red(
729
- boxen__default.default(err.stack, {
730
- padding: 1,
731
- align: "left"
732
- })
733
- )
734
- );
735
- }
736
- process.exit(1);
737
- };
738
952
  const build$1 = async (ctx) => new Promise(async (resolve, reject) => {
739
953
  const config = await resolveProductionConfig(ctx);
740
954
  const finalConfig = await mergeConfigWithUserConfig(config, ctx);
@@ -765,205 +979,6 @@ const build$1 = async (ctx) => new Promise(async (resolve, reject) => {
765
979
  }
766
980
  });
767
981
  });
768
- const loadEnv = async (cwd) => {
769
- const pathToEnv = path__default.default.resolve(cwd, ".env");
770
- if (await pathExists(pathToEnv)) {
771
- dotenv__default.default.config({ path: pathToEnv });
772
- }
773
- };
774
- const getStrapiAdminEnvVars = (defaultEnv) => {
775
- return Object.keys(process.env).filter((key) => key.toUpperCase().startsWith("STRAPI_ADMIN_")).reduce((acc, key) => {
776
- acc[key] = process.env[key];
777
- return acc;
778
- }, defaultEnv);
779
- };
780
- const validatePackageHasStrapi = (pkg) => "strapi" in pkg && typeof pkg.strapi === "object" && !Array.isArray(pkg.strapi) && pkg.strapi !== null;
781
- const validatePackageIsPlugin = (pkg) => validatePackageHasStrapi(pkg) && pkg.strapi.kind === "plugin";
782
- const getEnabledPlugins = async ({
783
- strapi,
784
- cwd,
785
- logger
786
- }) => {
787
- const plugins = {};
788
- const deps = strapi.config.get("info.dependencies", {});
789
- logger.debug("Dependencies from user's project", os__default.default.EOL, deps);
790
- for (const dep of Object.keys(deps)) {
791
- const pkg = await getModule(dep, cwd);
792
- if (pkg && validatePackageIsPlugin(pkg)) {
793
- const name = pkg.strapi.name || pkg.name;
794
- if (!name) {
795
- throw Error(
796
- "You're trying to import a plugin that doesn't have a name – check the package.json of that plugin!"
797
- );
798
- }
799
- plugins[name] = {
800
- name,
801
- pathToPlugin: dep
802
- };
803
- }
804
- }
805
- const userPluginsFile = await loadUserPluginsFile(strapi.dirs.app.config);
806
- logger.debug("User's plugins file", os__default.default.EOL, userPluginsFile);
807
- for (const [userPluginName, userPluginConfig] of Object.entries(userPluginsFile)) {
808
- if (userPluginConfig.enabled && userPluginConfig.resolve) {
809
- plugins[userPluginName] = {
810
- name: userPluginName,
811
- isLocal: true,
812
- /**
813
- * User plugin paths are resolved from the entry point
814
- * of the app, because that's how you import them.
815
- */
816
- pathToPlugin: userPluginConfig.resolve
817
- };
818
- }
819
- }
820
- return plugins;
821
- };
822
- const PLUGIN_CONFIGS = ["plugins.js", "plugins.mjs", "plugins.ts"];
823
- const loadUserPluginsFile = async (root) => {
824
- for (const file of PLUGIN_CONFIGS) {
825
- const filePath = path__default.default.join(root, file);
826
- const configFile = await loadFile(filePath);
827
- if (configFile) {
828
- return typeof configFile === "function" ? configFile({ env: utils.env }) : configFile;
829
- }
830
- }
831
- return {};
832
- };
833
- const getMapOfPluginsWithAdmin = (plugins, { runtimeDir }) => Object.values(plugins).filter((plugin) => {
834
- if (!plugin) {
835
- return false;
836
- }
837
- try {
838
- const isLocalPluginWithLegacyAdminFile = fs__default$1.default.existsSync(
839
- //@ts-ignore
840
- path__default.default.resolve(`${plugin.pathToPlugin}/strapi-admin.js`)
841
- );
842
- if (!isLocalPluginWithLegacyAdminFile) {
843
- let pathToPlugin = plugin.pathToPlugin;
844
- if (process.platform === "win32") {
845
- pathToPlugin = pathToPlugin.split(path__default.default.sep).join(path__default.default.posix.sep);
846
- }
847
- const isModuleWithFE = require.resolve(`${pathToPlugin}/strapi-admin`);
848
- return isModuleWithFE;
849
- }
850
- return isLocalPluginWithLegacyAdminFile;
851
- } catch (err) {
852
- if (isError(err) && "code" in err && err.code === "MODULE_NOT_FOUND") {
853
- return false;
854
- }
855
- throw err;
856
- }
857
- }).map((plugin) => {
858
- const systemPath = plugin.isLocal ? path__default.default.relative(runtimeDir, plugin.pathToPlugin.split("/").join(path__default.default.sep)) : void 0;
859
- const modulePath = systemPath ? systemPath.split(path__default.default.sep).join("/") : void 0;
860
- return {
861
- path: !plugin.isLocal ? `${plugin.pathToPlugin}/strapi-admin` : `${modulePath}/strapi-admin`,
862
- name: plugin.name,
863
- importName: camelCase__default.default(plugin.name)
864
- };
865
- });
866
- const ADMIN_APP_FILES = ["app.js", "app.mjs", "app.ts", "app.jsx", "app.tsx"];
867
- const loadUserAppFile = async (appDir) => {
868
- for (const file of ADMIN_APP_FILES) {
869
- const filePath = path__default.default.join(appDir, "src", "admin", file);
870
- if (fs__default$1.default.existsSync(filePath)) {
871
- return { path: filePath };
872
- }
873
- }
874
- return void 0;
875
- };
876
- const DEFAULT_BROWSERSLIST = [
877
- "last 3 major versions",
878
- "Firefox ESR",
879
- "last 2 Opera versions",
880
- "not dead"
881
- ];
882
- const createBuildContext = async ({
883
- cwd,
884
- logger,
885
- tsconfig,
886
- strapi,
887
- options = {}
888
- }) => {
889
- const strapiInstance = strapi ?? strapiFactory__default.default({
890
- // Directories
891
- appDir: cwd,
892
- distDir: tsconfig?.config.options.outDir ?? "",
893
- // Options
894
- autoReload: true,
895
- serveAdminPanel: false
896
- });
897
- const { serverUrl, adminPath } = utils.getConfigUrls(strapiInstance.config, true);
898
- await loadEnv(cwd);
899
- const env = getStrapiAdminEnvVars({
900
- ADMIN_PATH: adminPath,
901
- STRAPI_ADMIN_BACKEND_URL: serverUrl,
902
- STRAPI_TELEMETRY_DISABLED: String(strapiInstance.telemetry.isDisabled)
903
- });
904
- const envKeys = Object.keys(env);
905
- if (envKeys.length > 0) {
906
- logger.info(
907
- [
908
- "Including the following ENV variables as part of the JS bundle:",
909
- ...envKeys.map((key) => ` - ${key}`)
910
- ].join(os__default.default.EOL)
911
- );
912
- }
913
- const distPath = path__default.default.join(strapiInstance.dirs.dist.root, "build");
914
- const distDir = path__default.default.relative(cwd, distPath);
915
- try {
916
- logger.debug(`Cleaning dist folder: ${distPath}`);
917
- await fs__default.default.rm(distPath, { recursive: true, force: true });
918
- logger.debug("Cleaned dist folder");
919
- } catch {
920
- logger.debug("There was no dist folder to clean");
921
- }
922
- const runtimeDir = path__default.default.join(cwd, ".strapi", "client");
923
- const entry = path__default.default.relative(cwd, path__default.default.join(runtimeDir, "app.js"));
924
- const plugins = await getEnabledPlugins({ cwd, logger, strapi: strapiInstance });
925
- logger.debug("Enabled plugins", os__default.default.EOL, plugins);
926
- const pluginsWithFront = getMapOfPluginsWithAdmin(plugins, { runtimeDir });
927
- logger.debug("Enabled plugins with FE", os__default.default.EOL, plugins);
928
- const target = browserslist__default.default.loadConfig({ path: cwd }) ?? DEFAULT_BROWSERSLIST;
929
- const customisations = await loadUserAppFile(strapiInstance.dirs.app.root);
930
- const buildContext = {
931
- appDir: strapiInstance.dirs.app.root,
932
- basePath: `${adminPath}/`,
933
- customisations,
934
- cwd,
935
- distDir,
936
- distPath,
937
- entry,
938
- env,
939
- logger,
940
- options,
941
- plugins: pluginsWithFront,
942
- runtimeDir,
943
- strapi: strapiInstance,
944
- target,
945
- tsconfig
946
- };
947
- return buildContext;
948
- };
949
- function getTimer() {
950
- const timings = {};
951
- const startTimes = {};
952
- function start(name) {
953
- if (typeof startTimes[name] !== "undefined") {
954
- throw new Error(`Timer "${name}" already started, cannot overwrite`);
955
- }
956
- startTimes[name] = perf_hooks.performance.now();
957
- }
958
- function end(name) {
959
- if (typeof startTimes[name] === "undefined") {
960
- throw new Error(`Timer "${name}" never started, cannot end`);
961
- }
962
- timings[name] = perf_hooks.performance.now() - startTimes[name];
963
- return timings[name];
964
- }
965
- return { start, end, getTimings: () => timings };
966
- }
967
982
  const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
968
983
  const timer = getTimer();
969
984
  const { didInstall } = await checkRequiredDependencies({ cwd, logger, ignorePrompts }).catch(
@@ -980,7 +995,7 @@ const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
980
995
  const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
981
996
  tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
982
997
  const compilingDuration = timer.end("compilingTS");
983
- compilingTsSpinner.text = `Compiling TS (${compilingDuration}ms)`;
998
+ compilingTsSpinner.text = `Compiling TS (${prettyTime(compilingDuration)})`;
984
999
  compilingTsSpinner.succeed();
985
1000
  }
986
1001
  timer.start("createBuildContext");
@@ -993,7 +1008,7 @@ const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
993
1008
  options
994
1009
  });
995
1010
  const contextDuration = timer.end("createBuildContext");
996
- contextSpinner.text = `Building build context (${contextDuration}ms)`;
1011
+ contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
997
1012
  contextSpinner.succeed();
998
1013
  timer.start("buildAdmin");
999
1014
  const buildingSpinner = logger.spinner(`Building admin panel`).start();
@@ -1003,7 +1018,7 @@ const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
1003
1018
  await writeStaticClientFiles(ctx);
1004
1019
  await build$1(ctx);
1005
1020
  const buildDuration = timer.end("buildAdmin");
1006
- buildingSpinner.text = `Building admin panel (${buildDuration}ms)`;
1021
+ buildingSpinner.text = `Building admin panel (${prettyTime(buildDuration)})`;
1007
1022
  buildingSpinner.succeed();
1008
1023
  } catch (err) {
1009
1024
  buildingSpinner.fail();
@@ -1091,6 +1106,35 @@ const watch = async (ctx) => {
1091
1106
  });
1092
1107
  });
1093
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
+ };
1094
1138
  const develop = async ({
1095
1139
  cwd,
1096
1140
  polling,
@@ -1111,6 +1155,10 @@ const develop = async ({
1111
1155
  if (didInstall) {
1112
1156
  return;
1113
1157
  }
1158
+ if (tsconfig?.config) {
1159
+ await cleanupDistDirectory({ tsconfig, logger, timer });
1160
+ await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: true } });
1161
+ }
1114
1162
  if (!watchAdmin) {
1115
1163
  timer.start("createBuildContext");
1116
1164
  const contextSpinner = logger.spinner(`Building build context`).start();
@@ -1122,7 +1170,7 @@ const develop = async ({
1122
1170
  options
1123
1171
  });
1124
1172
  const contextDuration = timer.end("createBuildContext");
1125
- contextSpinner.text = `Building build context (${contextDuration}ms)`;
1173
+ contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
1126
1174
  contextSpinner.succeed();
1127
1175
  timer.start("creatingAdmin");
1128
1176
  const adminSpinner = logger.spinner(`Creating admin`).start();
@@ -1130,12 +1178,16 @@ const develop = async ({
1130
1178
  await writeStaticClientFiles(ctx);
1131
1179
  await build$1(ctx);
1132
1180
  const adminDuration = timer.end("creatingAdmin");
1133
- adminSpinner.text = `Creating admin (${adminDuration}ms)`;
1181
+ adminSpinner.text = `Creating admin (${prettyTime(adminDuration)})`;
1134
1182
  adminSpinner.succeed();
1135
1183
  }
1136
1184
  cluster__default.default.on("message", async (worker, message) => {
1137
1185
  switch (message) {
1138
1186
  case "reload": {
1187
+ if (tsconfig?.config) {
1188
+ await cleanupDistDirectory({ tsconfig, logger, timer });
1189
+ await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: true } });
1190
+ }
1139
1191
  logger.debug("cluster has the reload message, sending the worker kill message");
1140
1192
  worker.send("kill");
1141
1193
  break;
@@ -1154,14 +1206,8 @@ const develop = async ({
1154
1206
  cluster__default.default.fork();
1155
1207
  }
1156
1208
  if (cluster__default.default.isWorker) {
1157
- if (tsconfig?.config) {
1158
- timer.start("compilingTS");
1159
- const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
1160
- tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
1161
- const compilingDuration = timer.end("compilingTS");
1162
- compilingTsSpinner.text = `Compiling TS (${compilingDuration}ms)`;
1163
- compilingTsSpinner.succeed();
1164
- }
1209
+ timer.start("loadStrapi");
1210
+ const loadStrapiSpinner = logger.spinner(`Loading Strapi`).start();
1165
1211
  const strapi = strapiFactory__default.default({
1166
1212
  appDir: cwd,
1167
1213
  distDir: tsconfig?.config.options.outDir ?? "",
@@ -1181,7 +1227,7 @@ const develop = async ({
1181
1227
  options
1182
1228
  });
1183
1229
  const contextDuration = timer.end("createBuildContext");
1184
- contextSpinner.text = `Building build context (${contextDuration}ms)`;
1230
+ contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
1185
1231
  contextSpinner.succeed();
1186
1232
  timer.start("creatingAdmin");
1187
1233
  const adminSpinner = logger.spinner(`Creating admin`).start();
@@ -1189,10 +1235,13 @@ const develop = async ({
1189
1235
  await writeStaticClientFiles(ctx);
1190
1236
  webpackWatcher = await watch(ctx);
1191
1237
  const adminDuration = timer.end("creatingAdmin");
1192
- adminSpinner.text = `Creating admin (${adminDuration}ms)`;
1238
+ adminSpinner.text = `Creating admin (${prettyTime(adminDuration)})`;
1193
1239
  adminSpinner.succeed();
1194
1240
  }
1195
1241
  const strapiInstance = await strapi.load();
1242
+ const loadStrapiDuration = timer.end("loadStrapi");
1243
+ loadStrapiSpinner.text = `Loading Strapi (${prettyTime(loadStrapiDuration)})`;
1244
+ loadStrapiSpinner.succeed();
1196
1245
  timer.start("generatingTS");
1197
1246
  const generatingTsSpinner = logger.spinner(`Generating types`).start();
1198
1247
  await tsUtils__namespace.generators.generate({
@@ -1203,8 +1252,17 @@ const develop = async ({
1203
1252
  artifacts: { contentTypes: true, components: true }
1204
1253
  });
1205
1254
  const generatingDuration = timer.end("generatingTS");
1206
- generatingTsSpinner.text = `Generating types (${generatingDuration}ms)`;
1255
+ generatingTsSpinner.text = `Generating types (${prettyTime(generatingDuration)})`;
1207
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
+ }
1208
1266
  const restart = async () => {
1209
1267
  if (strapiInstance.reload.isWatching && !strapiInstance.reload.isReloading) {
1210
1268
  strapiInstance.reload.isReloading = true;
@@ -1272,4 +1330,4 @@ exports.build = build;
1272
1330
  exports.develop = develop;
1273
1331
  exports.handleUnexpectedError = handleUnexpectedError;
1274
1332
  exports.index = index;
1275
- //# sourceMappingURL=index-62b7bdbe.js.map
1333
+ //# sourceMappingURL=index-1a74fa41.js.map