@strapi/admin 4.16.2 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +55 -41
- package/strapi-server.js +3 -3
- package/dist/_chunks/AuthenticatedApp-342bf22f.js +0 -1476
- package/dist/_chunks/AuthenticatedApp-342bf22f.js.map +0 -1
- package/dist/_chunks/AuthenticatedApp-bb31f306.mjs +0 -1450
- package/dist/_chunks/AuthenticatedApp-bb31f306.mjs.map +0 -1
- package/dist/_chunks/DragLayer-bff96835.mjs +0 -44
- package/dist/_chunks/DragLayer-bff96835.mjs.map +0 -1
- package/dist/_chunks/DragLayer-f07eee6c.js +0 -43
- package/dist/_chunks/DragLayer-f07eee6c.js.map +0 -1
- package/dist/_chunks/HomePage-0c7717c0.mjs +0 -49
- package/dist/_chunks/HomePage-0c7717c0.mjs.map +0 -1
- package/dist/_chunks/HomePage-175f79c7.js +0 -49
- package/dist/_chunks/HomePage-175f79c7.js.map +0 -1
- package/dist/_chunks/HomePage-246cc590.mjs +0 -542
- package/dist/_chunks/HomePage-246cc590.mjs.map +0 -1
- package/dist/_chunks/HomePage-6ff9e578.js +0 -563
- package/dist/_chunks/HomePage-6ff9e578.js.map +0 -1
- package/dist/_chunks/InstalledPluginsPage-170aff77.mjs +0 -134
- package/dist/_chunks/InstalledPluginsPage-170aff77.mjs.map +0 -1
- package/dist/_chunks/InstalledPluginsPage-3ae5dbb6.js +0 -153
- package/dist/_chunks/InstalledPluginsPage-3ae5dbb6.js.map +0 -1
- package/dist/_chunks/InternalErrorPage-040dc993.mjs +0 -41
- package/dist/_chunks/InternalErrorPage-040dc993.mjs.map +0 -1
- package/dist/_chunks/InternalErrorPage-d0e51ac2.js +0 -41
- package/dist/_chunks/InternalErrorPage-d0e51ac2.js.map +0 -1
- package/dist/_chunks/Layout-4b3e434a.js +0 -92
- package/dist/_chunks/Layout-4b3e434a.js.map +0 -1
- package/dist/_chunks/Layout-72fa2ace.mjs +0 -90
- package/dist/_chunks/Layout-72fa2ace.mjs.map +0 -1
- package/dist/_chunks/LimitsModal-203482b8.js +0 -84
- package/dist/_chunks/LimitsModal-203482b8.js.map +0 -1
- package/dist/_chunks/LimitsModal-da04700e.mjs +0 -82
- package/dist/_chunks/LimitsModal-da04700e.mjs.map +0 -1
- package/dist/_chunks/Login-576bbc11.js +0 -64
- package/dist/_chunks/Login-576bbc11.js.map +0 -1
- package/dist/_chunks/Login-d627bb0a.mjs +0 -62
- package/dist/_chunks/Login-d627bb0a.mjs.map +0 -1
- package/dist/_chunks/MarketplacePage-1cbfa8fd.mjs +0 -1011
- package/dist/_chunks/MarketplacePage-1cbfa8fd.mjs.map +0 -1
- package/dist/_chunks/MarketplacePage-e7cd973b.js +0 -1035
- package/dist/_chunks/MarketplacePage-e7cd973b.js.map +0 -1
- package/dist/_chunks/ProfilePage-52844daa.js +0 -665
- package/dist/_chunks/ProfilePage-52844daa.js.map +0 -1
- package/dist/_chunks/ProfilePage-ef400907.mjs +0 -642
- package/dist/_chunks/ProfilePage-ef400907.mjs.map +0 -1
- package/dist/_chunks/SSOProviders-62bfad92.mjs +0 -58
- package/dist/_chunks/SSOProviders-62bfad92.mjs.map +0 -1
- package/dist/_chunks/SSOProviders-b395a4e6.js +0 -59
- package/dist/_chunks/SSOProviders-b395a4e6.js.map +0 -1
- package/dist/_chunks/SalesPage-4a0a68fb.js +0 -51
- package/dist/_chunks/SalesPage-4a0a68fb.js.map +0 -1
- package/dist/_chunks/SalesPage-56bf9463.mjs +0 -48
- package/dist/_chunks/SalesPage-56bf9463.mjs.map +0 -1
- package/dist/_chunks/SalesPage-66f9ea32.js +0 -51
- package/dist/_chunks/SalesPage-66f9ea32.js.map +0 -1
- package/dist/_chunks/SalesPage-d0cdc1a7.js +0 -48
- package/dist/_chunks/SalesPage-d0cdc1a7.js.map +0 -1
- package/dist/_chunks/SalesPage-f9597ae7.mjs +0 -51
- package/dist/_chunks/SalesPage-f9597ae7.mjs.map +0 -1
- package/dist/_chunks/SalesPage-fceedf48.mjs +0 -51
- package/dist/_chunks/SalesPage-fceedf48.mjs.map +0 -1
- package/dist/_chunks/ar-21279f4c.js +0 -936
- package/dist/_chunks/ar-21279f4c.js.map +0 -1
- package/dist/_chunks/ar-62e5e2b3.mjs +0 -936
- package/dist/_chunks/ar-62e5e2b3.mjs.map +0 -1
- package/dist/_chunks/build-1026ce7c.mjs +0 -68
- package/dist/_chunks/build-1026ce7c.mjs.map +0 -1
- package/dist/_chunks/build-d99bcc06.js +0 -68
- package/dist/_chunks/build-d99bcc06.js.map +0 -1
- package/dist/_chunks/ca-d05fb350.js +0 -724
- package/dist/_chunks/ca-d05fb350.js.map +0 -1
- package/dist/_chunks/ca-e99de225.mjs +0 -724
- package/dist/_chunks/ca-e99de225.mjs.map +0 -1
- package/dist/_chunks/colors-c24a54f0.js +0 -33
- package/dist/_chunks/colors-c24a54f0.js.map +0 -1
- package/dist/_chunks/colors-e7489dd4.mjs +0 -34
- package/dist/_chunks/colors-e7489dd4.mjs.map +0 -1
- package/dist/_chunks/constants-2a8f4e41.mjs +0 -11
- package/dist/_chunks/constants-2a8f4e41.mjs.map +0 -1
- package/dist/_chunks/constants-40ffa931.js +0 -11
- package/dist/_chunks/constants-40ffa931.js.map +0 -1
- package/dist/_chunks/constants-4aca55b6.js +0 -85
- package/dist/_chunks/constants-4aca55b6.js.map +0 -1
- package/dist/_chunks/constants-64899732.js +0 -30
- package/dist/_chunks/constants-64899732.js.map +0 -1
- package/dist/_chunks/constants-6c68e9a0.js +0 -229
- package/dist/_chunks/constants-6c68e9a0.js.map +0 -1
- package/dist/_chunks/constants-6ecddc43.mjs +0 -111
- package/dist/_chunks/constants-6ecddc43.mjs.map +0 -1
- package/dist/_chunks/constants-74b8a935.mjs +0 -52
- package/dist/_chunks/constants-74b8a935.mjs.map +0 -1
- package/dist/_chunks/constants-7596f6f3.js +0 -132
- package/dist/_chunks/constants-7596f6f3.js.map +0 -1
- package/dist/_chunks/constants-8092eeb5.mjs +0 -59
- package/dist/_chunks/constants-8092eeb5.mjs.map +0 -1
- package/dist/_chunks/constants-85da8cc4.js +0 -58
- package/dist/_chunks/constants-85da8cc4.js.map +0 -1
- package/dist/_chunks/constants-a6fd64fc.mjs +0 -80
- package/dist/_chunks/constants-a6fd64fc.mjs.map +0 -1
- package/dist/_chunks/constants-a92ce583.mjs +0 -7
- package/dist/_chunks/constants-a92ce583.mjs.map +0 -1
- package/dist/_chunks/constants-ae0b83df.mjs +0 -227
- package/dist/_chunks/constants-ae0b83df.mjs.map +0 -1
- package/dist/_chunks/constants-c1f1f698.mjs +0 -85
- package/dist/_chunks/constants-c1f1f698.mjs.map +0 -1
- package/dist/_chunks/constants-d3dd8ed6.mjs +0 -7
- package/dist/_chunks/constants-d3dd8ed6.mjs.map +0 -1
- package/dist/_chunks/constants-d5d67ca8.js +0 -6
- package/dist/_chunks/constants-d5d67ca8.js.map +0 -1
- package/dist/_chunks/constants-da2542a3.js +0 -6
- package/dist/_chunks/constants-da2542a3.js.map +0 -1
- package/dist/_chunks/constants-ddd2d586.js +0 -82
- package/dist/_chunks/constants-ddd2d586.js.map +0 -1
- package/dist/_chunks/constants-def33545.mjs +0 -30
- package/dist/_chunks/constants-def33545.mjs.map +0 -1
- package/dist/_chunks/constants-e05f06d4.js +0 -52
- package/dist/_chunks/constants-e05f06d4.js.map +0 -1
- package/dist/_chunks/cs-2fa881a2.mjs +0 -291
- package/dist/_chunks/cs-2fa881a2.mjs.map +0 -1
- package/dist/_chunks/cs-eee75b10.js +0 -291
- package/dist/_chunks/cs-eee75b10.js.map +0 -1
- package/dist/_chunks/de-28f8bc28.mjs +0 -716
- package/dist/_chunks/de-28f8bc28.mjs.map +0 -1
- package/dist/_chunks/de-976cc986.js +0 -716
- package/dist/_chunks/de-976cc986.js.map +0 -1
- package/dist/_chunks/develop-72394876.mjs +0 -61
- package/dist/_chunks/develop-72394876.mjs.map +0 -1
- package/dist/_chunks/develop-da585b1e.js +0 -61
- package/dist/_chunks/develop-da585b1e.js.map +0 -1
- package/dist/_chunks/dk-0b759a56.mjs +0 -634
- package/dist/_chunks/dk-0b759a56.mjs.map +0 -1
- package/dist/_chunks/dk-6189917e.js +0 -634
- package/dist/_chunks/dk-6189917e.js.map +0 -1
- package/dist/_chunks/edit-29bdf5d6.js +0 -50
- package/dist/_chunks/edit-29bdf5d6.js.map +0 -1
- package/dist/_chunks/edit-923cefa0.mjs +0 -32
- package/dist/_chunks/edit-923cefa0.mjs.map +0 -1
- package/dist/_chunks/en-0e9e9327.js +0 -1022
- package/dist/_chunks/en-0e9e9327.js.map +0 -1
- package/dist/_chunks/en-e728accb.mjs +0 -1022
- package/dist/_chunks/en-e728accb.mjs.map +0 -1
- package/dist/_chunks/es-18b29db2.mjs +0 -796
- package/dist/_chunks/es-18b29db2.mjs.map +0 -1
- package/dist/_chunks/es-3ee0992a.js +0 -796
- package/dist/_chunks/es-3ee0992a.js.map +0 -1
- package/dist/_chunks/eu-8fd773c2.mjs +0 -832
- package/dist/_chunks/eu-8fd773c2.mjs.map +0 -1
- package/dist/_chunks/eu-be749f31.js +0 -832
- package/dist/_chunks/eu-be749f31.js.map +0 -1
- package/dist/_chunks/formatAPIErrors-b599cf27.js +0 -20
- package/dist/_chunks/formatAPIErrors-b599cf27.js.map +0 -1
- package/dist/_chunks/formatAPIErrors-db6ed675.mjs +0 -21
- package/dist/_chunks/formatAPIErrors-db6ed675.mjs.map +0 -1
- package/dist/_chunks/fr-29c84e1f.js +0 -762
- package/dist/_chunks/fr-29c84e1f.js.map +0 -1
- package/dist/_chunks/fr-f37df086.mjs +0 -762
- package/dist/_chunks/fr-f37df086.mjs.map +0 -1
- package/dist/_chunks/gu-377a4b46.js +0 -623
- package/dist/_chunks/gu-377a4b46.js.map +0 -1
- package/dist/_chunks/gu-69f0e13a.mjs +0 -623
- package/dist/_chunks/gu-69f0e13a.mjs.map +0 -1
- package/dist/_chunks/he-aec27352.js +0 -326
- package/dist/_chunks/he-aec27352.js.map +0 -1
- package/dist/_chunks/he-bd769d7e.mjs +0 -326
- package/dist/_chunks/he-bd769d7e.mjs.map +0 -1
- package/dist/_chunks/hi-1bdc7a46.js +0 -722
- package/dist/_chunks/hi-1bdc7a46.js.map +0 -1
- package/dist/_chunks/hi-d397a24b.mjs +0 -722
- package/dist/_chunks/hi-d397a24b.mjs.map +0 -1
- package/dist/_chunks/hu-e2c05f40.js +0 -832
- package/dist/_chunks/hu-e2c05f40.js.map +0 -1
- package/dist/_chunks/hu-eb88bd0c.mjs +0 -832
- package/dist/_chunks/hu-eb88bd0c.mjs.map +0 -1
- package/dist/_chunks/id-586df3a2.js +0 -448
- package/dist/_chunks/id-586df3a2.js.map +0 -1
- package/dist/_chunks/id-f47699e6.mjs +0 -448
- package/dist/_chunks/id-f47699e6.mjs.map +0 -1
- package/dist/_chunks/index-10a05917.mjs +0 -51
- package/dist/_chunks/index-10a05917.mjs.map +0 -1
- package/dist/_chunks/index-115d317b.mjs +0 -244
- package/dist/_chunks/index-115d317b.mjs.map +0 -1
- package/dist/_chunks/index-171715e4.js +0 -697
- package/dist/_chunks/index-171715e4.js.map +0 -1
- package/dist/_chunks/index-176cc121.mjs +0 -469
- package/dist/_chunks/index-176cc121.mjs.map +0 -1
- package/dist/_chunks/index-1bac5263.js +0 -338
- package/dist/_chunks/index-1bac5263.js.map +0 -1
- package/dist/_chunks/index-200c5a6a.js +0 -51
- package/dist/_chunks/index-200c5a6a.js.map +0 -1
- package/dist/_chunks/index-215b5421.mjs +0 -51
- package/dist/_chunks/index-215b5421.mjs.map +0 -1
- package/dist/_chunks/index-23401c29.js +0 -418
- package/dist/_chunks/index-23401c29.js.map +0 -1
- package/dist/_chunks/index-242c859c.js +0 -335
- package/dist/_chunks/index-242c859c.js.map +0 -1
- package/dist/_chunks/index-26fcb3ca.mjs +0 -1432
- package/dist/_chunks/index-26fcb3ca.mjs.map +0 -1
- package/dist/_chunks/index-28dd9303.mjs +0 -51
- package/dist/_chunks/index-28dd9303.mjs.map +0 -1
- package/dist/_chunks/index-296c14bf.mjs +0 -362
- package/dist/_chunks/index-296c14bf.mjs.map +0 -1
- package/dist/_chunks/index-2de06c32.js +0 -51
- package/dist/_chunks/index-2de06c32.js.map +0 -1
- package/dist/_chunks/index-2eb69b5d.mjs +0 -399
- package/dist/_chunks/index-2eb69b5d.mjs.map +0 -1
- package/dist/_chunks/index-2f61e3ae.js +0 -585
- package/dist/_chunks/index-2f61e3ae.js.map +0 -1
- package/dist/_chunks/index-308b73ba.mjs +0 -60
- package/dist/_chunks/index-308b73ba.mjs.map +0 -1
- package/dist/_chunks/index-34e41e15.js +0 -134
- package/dist/_chunks/index-34e41e15.js.map +0 -1
- package/dist/_chunks/index-38115cde.js +0 -66
- package/dist/_chunks/index-38115cde.js.map +0 -1
- package/dist/_chunks/index-383efae4.mjs +0 -55
- package/dist/_chunks/index-383efae4.mjs.map +0 -1
- package/dist/_chunks/index-3b426575.js +0 -47
- package/dist/_chunks/index-3b426575.js.map +0 -1
- package/dist/_chunks/index-47af1603.js +0 -253
- package/dist/_chunks/index-47af1603.js.map +0 -1
- package/dist/_chunks/index-49b7e6ff.mjs +0 -1266
- package/dist/_chunks/index-49b7e6ff.mjs.map +0 -1
- package/dist/_chunks/index-4d9b2cb9.js +0 -47
- package/dist/_chunks/index-4d9b2cb9.js.map +0 -1
- package/dist/_chunks/index-4de70b5d.js +0 -3404
- package/dist/_chunks/index-4de70b5d.js.map +0 -1
- package/dist/_chunks/index-59b1f604.js +0 -380
- package/dist/_chunks/index-59b1f604.js.map +0 -1
- package/dist/_chunks/index-5a5217e0.mjs +0 -308
- package/dist/_chunks/index-5a5217e0.mjs.map +0 -1
- package/dist/_chunks/index-5da07c41.js +0 -418
- package/dist/_chunks/index-5da07c41.js.map +0 -1
- package/dist/_chunks/index-600cb5dd.js +0 -51
- package/dist/_chunks/index-600cb5dd.js.map +0 -1
- package/dist/_chunks/index-608d8d10.mjs +0 -393
- package/dist/_chunks/index-608d8d10.mjs.map +0 -1
- package/dist/_chunks/index-74812118.mjs +0 -53
- package/dist/_chunks/index-74812118.mjs.map +0 -1
- package/dist/_chunks/index-7d578921.js +0 -847
- package/dist/_chunks/index-7d578921.js.map +0 -1
- package/dist/_chunks/index-8109fa91.mjs +0 -676
- package/dist/_chunks/index-8109fa91.mjs.map +0 -1
- package/dist/_chunks/index-82c7a120.js +0 -15401
- package/dist/_chunks/index-82c7a120.js.map +0 -1
- package/dist/_chunks/index-83d53962.js +0 -62
- package/dist/_chunks/index-83d53962.js.map +0 -1
- package/dist/_chunks/index-88298941.js +0 -54
- package/dist/_chunks/index-88298941.js.map +0 -1
- package/dist/_chunks/index-8933483b.mjs +0 -3374
- package/dist/_chunks/index-8933483b.mjs.map +0 -1
- package/dist/_chunks/index-91df57b1.mjs +0 -826
- package/dist/_chunks/index-91df57b1.mjs.map +0 -1
- package/dist/_chunks/index-973c363e.mjs +0 -63
- package/dist/_chunks/index-973c363e.mjs.map +0 -1
- package/dist/_chunks/index-989bbeec.mjs +0 -232
- package/dist/_chunks/index-989bbeec.mjs.map +0 -1
- package/dist/_chunks/index-9910dda4.js +0 -55
- package/dist/_chunks/index-9910dda4.js.map +0 -1
- package/dist/_chunks/index-9afb163a.js +0 -418
- package/dist/_chunks/index-9afb163a.js.map +0 -1
- package/dist/_chunks/index-9f61bef8.js +0 -51
- package/dist/_chunks/index-9f61bef8.js.map +0 -1
- package/dist/_chunks/index-ab31623a.mjs +0 -273
- package/dist/_chunks/index-ab31623a.mjs.map +0 -1
- package/dist/_chunks/index-ac85118a.mjs +0 -47
- package/dist/_chunks/index-ac85118a.mjs.map +0 -1
- package/dist/_chunks/index-ad8e55c0.mjs +0 -866
- package/dist/_chunks/index-ad8e55c0.mjs.map +0 -1
- package/dist/_chunks/index-aedeaf5a.js +0 -311
- package/dist/_chunks/index-aedeaf5a.js.map +0 -1
- package/dist/_chunks/index-bbac142a.js +0 -125
- package/dist/_chunks/index-bbac142a.js.map +0 -1
- package/dist/_chunks/index-bd18f803.mjs +0 -15320
- package/dist/_chunks/index-bd18f803.mjs.map +0 -1
- package/dist/_chunks/index-c8b8a2ee.mjs +0 -359
- package/dist/_chunks/index-c8b8a2ee.mjs.map +0 -1
- package/dist/_chunks/index-c97f5820.js +0 -1456
- package/dist/_chunks/index-c97f5820.js.map +0 -1
- package/dist/_chunks/index-cb6a72d2.mjs +0 -127
- package/dist/_chunks/index-cb6a72d2.mjs.map +0 -1
- package/dist/_chunks/index-cbc7c054.js +0 -266
- package/dist/_chunks/index-cbc7c054.js.map +0 -1
- package/dist/_chunks/index-ce5995cd.mjs +0 -132
- package/dist/_chunks/index-ce5995cd.mjs.map +0 -1
- package/dist/_chunks/index-d1152896.js +0 -294
- package/dist/_chunks/index-d1152896.js.map +0 -1
- package/dist/_chunks/index-d1dd825b.js +0 -365
- package/dist/_chunks/index-d1dd825b.js.map +0 -1
- package/dist/_chunks/index-d2d9df41.mjs +0 -270
- package/dist/_chunks/index-d2d9df41.mjs.map +0 -1
- package/dist/_chunks/index-d3e1fd86.js +0 -490
- package/dist/_chunks/index-d3e1fd86.js.map +0 -1
- package/dist/_chunks/index-d4517ac4.mjs +0 -582
- package/dist/_chunks/index-d4517ac4.mjs.map +0 -1
- package/dist/_chunks/index-d49fa655.js +0 -873
- package/dist/_chunks/index-d49fa655.js.map +0 -1
- package/dist/_chunks/index-d6694cab.mjs +0 -125
- package/dist/_chunks/index-d6694cab.mjs.map +0 -1
- package/dist/_chunks/index-e117c643.mjs +0 -55
- package/dist/_chunks/index-e117c643.mjs.map +0 -1
- package/dist/_chunks/index-e1b90981.mjs +0 -314
- package/dist/_chunks/index-e1b90981.mjs.map +0 -1
- package/dist/_chunks/index-e24df0bf.js +0 -403
- package/dist/_chunks/index-e24df0bf.js.map +0 -1
- package/dist/_chunks/index-e2d2f58e.mjs +0 -47
- package/dist/_chunks/index-e2d2f58e.mjs.map +0 -1
- package/dist/_chunks/index-e369d741.mjs +0 -383
- package/dist/_chunks/index-e369d741.mjs.map +0 -1
- package/dist/_chunks/index-e79b2b9e.mjs +0 -338
- package/dist/_chunks/index-e79b2b9e.mjs.map +0 -1
- package/dist/_chunks/index-ea18ff22.mjs +0 -51
- package/dist/_chunks/index-ea18ff22.mjs.map +0 -1
- package/dist/_chunks/index-eb67694f.mjs +0 -261
- package/dist/_chunks/index-eb67694f.mjs.map +0 -1
- package/dist/_chunks/index-ed3696ec.js +0 -272
- package/dist/_chunks/index-ed3696ec.js.map +0 -1
- package/dist/_chunks/index-ee1ea38b.js +0 -129
- package/dist/_chunks/index-ee1ea38b.js.map +0 -1
- package/dist/_chunks/index-efc967f5.js +0 -55
- package/dist/_chunks/index-efc967f5.js.map +0 -1
- package/dist/_chunks/index-fc700e52.js +0 -263
- package/dist/_chunks/index-fc700e52.js.map +0 -1
- package/dist/_chunks/index-fd4e5616.mjs +0 -412
- package/dist/_chunks/index-fd4e5616.mjs.map +0 -1
- package/dist/_chunks/index-ffd2f664.js +0 -1337
- package/dist/_chunks/index-ffd2f664.js.map +0 -1
- package/dist/_chunks/it-4006227c.mjs +0 -459
- package/dist/_chunks/it-4006227c.mjs.map +0 -1
- package/dist/_chunks/it-9c4295f1.js +0 -459
- package/dist/_chunks/it-9c4295f1.js.map +0 -1
- package/dist/_chunks/ja-db43ca3d.mjs +0 -633
- package/dist/_chunks/ja-db43ca3d.mjs.map +0 -1
- package/dist/_chunks/ja-eb74520f.js +0 -633
- package/dist/_chunks/ja-eb74520f.js.map +0 -1
- package/dist/_chunks/ko-18e71df4.js +0 -631
- package/dist/_chunks/ko-18e71df4.js.map +0 -1
- package/dist/_chunks/ko-a7826e25.mjs +0 -631
- package/dist/_chunks/ko-a7826e25.mjs.map +0 -1
- package/dist/_chunks/ml-90131768.mjs +0 -722
- package/dist/_chunks/ml-90131768.mjs.map +0 -1
- package/dist/_chunks/ml-c5199364.js +0 -722
- package/dist/_chunks/ml-c5199364.js.map +0 -1
- package/dist/_chunks/ms-bc514df6.js +0 -342
- package/dist/_chunks/ms-bc514df6.js.map +0 -1
- package/dist/_chunks/ms-f4f16a83.mjs +0 -342
- package/dist/_chunks/ms-f4f16a83.mjs.map +0 -1
- package/dist/_chunks/nl-887ce2c3.mjs +0 -828
- package/dist/_chunks/nl-887ce2c3.mjs.map +0 -1
- package/dist/_chunks/nl-f1aedbe2.js +0 -828
- package/dist/_chunks/nl-f1aedbe2.js.map +0 -1
- package/dist/_chunks/no-ec6c2927.js +0 -310
- package/dist/_chunks/no-ec6c2927.js.map +0 -1
- package/dist/_chunks/no-f0b02541.mjs +0 -310
- package/dist/_chunks/no-f0b02541.mjs.map +0 -1
- package/dist/_chunks/pl-9be86414.js +0 -721
- package/dist/_chunks/pl-9be86414.js.map +0 -1
- package/dist/_chunks/pl-9ccd35d9.mjs +0 -721
- package/dist/_chunks/pl-9ccd35d9.mjs.map +0 -1
- package/dist/_chunks/pt-4fcc08f1.js +0 -296
- package/dist/_chunks/pt-4fcc08f1.js.map +0 -1
- package/dist/_chunks/pt-8acb6ac1.mjs +0 -296
- package/dist/_chunks/pt-8acb6ac1.mjs.map +0 -1
- package/dist/_chunks/pt-BR-d43239e3.js +0 -794
- package/dist/_chunks/pt-BR-d43239e3.js.map +0 -1
- package/dist/_chunks/pt-BR-fd73cb13.mjs +0 -794
- package/dist/_chunks/pt-BR-fd73cb13.mjs.map +0 -1
- package/dist/_chunks/ru-9aad40c5.mjs +0 -993
- package/dist/_chunks/ru-9aad40c5.mjs.map +0 -1
- package/dist/_chunks/ru-c0293425.js +0 -993
- package/dist/_chunks/ru-c0293425.js.map +0 -1
- package/dist/_chunks/sa-6bf4c20e.mjs +0 -722
- package/dist/_chunks/sa-6bf4c20e.mjs.map +0 -1
- package/dist/_chunks/sa-8ffb7ca7.js +0 -722
- package/dist/_chunks/sa-8ffb7ca7.js.map +0 -1
- package/dist/_chunks/schema-260fec28.js +0 -514
- package/dist/_chunks/schema-260fec28.js.map +0 -1
- package/dist/_chunks/schema-6bd8bd85.mjs +0 -490
- package/dist/_chunks/schema-6bd8bd85.mjs.map +0 -1
- package/dist/_chunks/sk-58d31b17.mjs +0 -690
- package/dist/_chunks/sk-58d31b17.mjs.map +0 -1
- package/dist/_chunks/sk-a9308737.js +0 -690
- package/dist/_chunks/sk-a9308737.js.map +0 -1
- package/dist/_chunks/sv-0f5ffd1e.js +0 -827
- package/dist/_chunks/sv-0f5ffd1e.js.map +0 -1
- package/dist/_chunks/sv-d80ad633.mjs +0 -827
- package/dist/_chunks/sv-d80ad633.mjs.map +0 -1
- package/dist/_chunks/th-a53bbf7a.js +0 -430
- package/dist/_chunks/th-a53bbf7a.js.map +0 -1
- package/dist/_chunks/th-e72c6a22.mjs +0 -430
- package/dist/_chunks/th-e72c6a22.mjs.map +0 -1
- package/dist/_chunks/tr-b84a68b0.js +0 -785
- package/dist/_chunks/tr-b84a68b0.js.map +0 -1
- package/dist/_chunks/tr-e35ecfe8.mjs +0 -785
- package/dist/_chunks/tr-e35ecfe8.mjs.map +0 -1
- package/dist/_chunks/uk-de367ec1.mjs +0 -343
- package/dist/_chunks/uk-de367ec1.mjs.map +0 -1
- package/dist/_chunks/uk-e5226227.js +0 -343
- package/dist/_chunks/uk-e5226227.js.map +0 -1
- package/dist/_chunks/useAdminRolePermissions-603a2709.mjs +0 -2322
- package/dist/_chunks/useAdminRolePermissions-603a2709.mjs.map +0 -1
- package/dist/_chunks/useAdminRolePermissions-cb1a3ee2.js +0 -2337
- package/dist/_chunks/useAdminRolePermissions-cb1a3ee2.js.map +0 -1
- package/dist/_chunks/useAdminRoles-68d5d608.js +0 -62
- package/dist/_chunks/useAdminRoles-68d5d608.js.map +0 -1
- package/dist/_chunks/useAdminRoles-7ab5d521.mjs +0 -44
- package/dist/_chunks/useAdminRoles-7ab5d521.mjs.map +0 -1
- package/dist/_chunks/useAdminUsers-05d6b26a.js +0 -61
- package/dist/_chunks/useAdminUsers-05d6b26a.js.map +0 -1
- package/dist/_chunks/useAdminUsers-09f86a58.mjs +0 -43
- package/dist/_chunks/useAdminUsers-09f86a58.mjs.map +0 -1
- package/dist/_chunks/useContentTypes-53b449bb.mjs +0 -67
- package/dist/_chunks/useContentTypes-53b449bb.mjs.map +0 -1
- package/dist/_chunks/useContentTypes-7da293cc.js +0 -85
- package/dist/_chunks/useContentTypes-7da293cc.js.map +0 -1
- package/dist/_chunks/useDebounce-4712871e.js +0 -35
- package/dist/_chunks/useDebounce-4712871e.js.map +0 -1
- package/dist/_chunks/useDebounce-9364f340.mjs +0 -17
- package/dist/_chunks/useDebounce-9364f340.mjs.map +0 -1
- package/dist/_chunks/useLicenseLimitNotification-1fd756fa.mjs +0 -80
- package/dist/_chunks/useLicenseLimitNotification-1fd756fa.mjs.map +0 -1
- package/dist/_chunks/useLicenseLimitNotification-8a4d7fc1.js +0 -100
- package/dist/_chunks/useLicenseLimitNotification-8a4d7fc1.js.map +0 -1
- package/dist/_chunks/useLicenseLimits-13a102d3.mjs +0 -31
- package/dist/_chunks/useLicenseLimits-13a102d3.mjs.map +0 -1
- package/dist/_chunks/useLicenseLimits-81ef3cce.js +0 -49
- package/dist/_chunks/useLicenseLimits-81ef3cce.js.map +0 -1
- package/dist/_chunks/useReviewWorkflows-799e0305.js +0 -59
- package/dist/_chunks/useReviewWorkflows-799e0305.js.map +0 -1
- package/dist/_chunks/useReviewWorkflows-9e6b8986.mjs +0 -41
- package/dist/_chunks/useReviewWorkflows-9e6b8986.mjs.map +0 -1
- package/dist/_chunks/validateWorkflow-5693ea2d.js +0 -1124
- package/dist/_chunks/validateWorkflow-5693ea2d.js.map +0 -1
- package/dist/_chunks/validateWorkflow-7a2b6ab8.mjs +0 -1101
- package/dist/_chunks/validateWorkflow-7a2b6ab8.mjs.map +0 -1
- package/dist/_chunks/vi-096bccbb.mjs +0 -298
- package/dist/_chunks/vi-096bccbb.mjs.map +0 -1
- package/dist/_chunks/vi-c5fabb75.js +0 -298
- package/dist/_chunks/vi-c5fabb75.js.map +0 -1
- package/dist/_chunks/zh-24f618cb.js +0 -836
- package/dist/_chunks/zh-24f618cb.js.map +0 -1
- package/dist/_chunks/zh-Hans-35d2c374.js +0 -957
- package/dist/_chunks/zh-Hans-35d2c374.js.map +0 -1
- package/dist/_chunks/zh-Hans-ccf4be4b.mjs +0 -957
- package/dist/_chunks/zh-Hans-ccf4be4b.mjs.map +0 -1
- package/dist/_chunks/zh-ba29b2e1.mjs +0 -836
- package/dist/_chunks/zh-ba29b2e1.mjs.map +0 -1
- package/dist/admin/index.js +0 -34
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs +0 -34
- package/dist/admin/index.mjs.map +0 -1
- package/dist/admin/src/App.d.ts +0 -6
- package/dist/admin/src/StrapiApp.d.ts +0 -140
- package/dist/admin/src/components/AuthenticatedApp.d.ts +0 -2
- package/dist/admin/src/components/ConfigurationProvider.d.ts +0 -11
- package/dist/admin/src/components/DefaultDocument.d.ts +0 -5
- package/dist/admin/src/components/DragLayer.d.ts +0 -10
- package/dist/admin/src/components/GuidedTour/Homepage.d.ts +0 -2
- package/dist/admin/src/components/GuidedTour/Modal.d.ts +0 -2
- package/dist/admin/src/components/GuidedTour/Ornaments.d.ts +0 -13
- package/dist/admin/src/components/GuidedTour/Provider.d.ts +0 -6
- package/dist/admin/src/components/GuidedTour/constants.d.ts +0 -165
- package/dist/admin/src/components/LanguageProvider.d.ts +0 -19
- package/dist/admin/src/components/LeftMenu.d.ts +0 -5
- package/dist/admin/src/components/NoJavascript.d.ts +0 -7
- package/dist/admin/src/components/NpsSurvey.d.ts +0 -17
- package/dist/admin/src/components/Onboarding.d.ts +0 -2
- package/dist/admin/src/components/PluginsInitializer.d.ts +0 -5
- package/dist/admin/src/components/PrivateRoute.d.ts +0 -8
- package/dist/admin/src/components/Providers.d.ts +0 -13
- package/dist/admin/src/components/RBACProvider.d.ts +0 -27
- package/dist/admin/src/components/Theme.d.ts +0 -6
- package/dist/admin/src/components/ThemeToggleProvider.d.ts +0 -12
- package/dist/admin/src/components/UnauthenticatedLogo.d.ts +0 -2
- package/dist/admin/src/constants.d.ts +0 -195
- package/dist/admin/src/content-manager/components/BlocksInput/BlocksContent.d.ts +0 -5
- package/dist/admin/src/content-manager/components/BlocksInput/BlocksEditor.d.ts +0 -34
- package/dist/admin/src/content-manager/components/BlocksInput/BlocksInput.d.ts +0 -18
- package/dist/admin/src/content-manager/components/BlocksInput/BlocksToolbar.d.ts +0 -2
- package/dist/admin/src/content-manager/components/BlocksInput/hooks/useBlocksStore.d.ts +0 -32
- package/dist/admin/src/content-manager/components/BlocksInput/hooks/useModifiersStore.d.ts +0 -20
- package/dist/admin/src/content-manager/components/BlocksInput/plugins/withLinks.d.ts +0 -8
- package/dist/admin/src/content-manager/components/BlocksInput/plugins/withStrapiSchema.d.ts +0 -8
- package/dist/admin/src/content-manager/components/BlocksInput/tests/mock-schema.d.ts +0 -2
- package/dist/admin/src/content-manager/components/BlocksInput/utils/links.d.ts +0 -10
- package/dist/admin/src/content-manager/components/BlocksInput/utils/types.d.ts +0 -6
- package/dist/admin/src/contexts/admin.d.ts +0 -14
- package/dist/admin/src/contexts/apiTokenPermissions.d.ts +0 -36
- package/dist/admin/src/contexts/configuration.d.ts +0 -27
- package/dist/admin/src/contexts/themeToggle.d.ts +0 -22
- package/dist/admin/src/core/apis/Components.d.ts +0 -10
- package/dist/admin/src/core/apis/CustomFields.d.ts +0 -8
- package/dist/admin/src/core/apis/Fields.d.ts +0 -10
- package/dist/admin/src/core/apis/Middlewares.d.ts +0 -9
- package/dist/admin/src/core/apis/Plugin.d.ts +0 -19
- package/dist/admin/src/core/apis/Reducers.d.ts +0 -10
- package/dist/admin/src/core/store/configure.d.ts +0 -29
- package/dist/admin/src/core/store/hooks.d.ts +0 -37
- package/dist/admin/src/core/utils/basename.d.ts +0 -1
- package/dist/admin/src/core/utils/createHook.d.ts +0 -10
- package/dist/admin/src/hooks/__mocks__/useAdminUsers.d.ts +0 -2
- package/dist/admin/src/hooks/__mocks__/useContentTypes.d.ts +0 -2
- package/dist/admin/src/hooks/__mocks__/useSettingsMenu.d.ts +0 -2
- package/dist/admin/src/hooks/useAdminRoles.d.ts +0 -13
- package/dist/admin/src/hooks/useAdminUsers.d.ts +0 -19
- package/dist/admin/src/hooks/useContentTypes.d.ts +0 -7
- package/dist/admin/src/hooks/useDebounce.d.ts +0 -1
- package/dist/admin/src/hooks/useEnterprise.d.ts +0 -8
- package/dist/admin/src/hooks/useInjectReducer.d.ts +0 -10
- package/dist/admin/src/hooks/useLicenseLimitNotification.d.ts +0 -1
- package/dist/admin/src/hooks/useMenu.d.ts +0 -9
- package/dist/admin/src/hooks/useSettingsMenu.d.ts +0 -24
- package/dist/admin/src/index.d.ts +0 -3
- package/dist/admin/src/layouts/AppLayout.d.ts +0 -7
- package/dist/admin/src/layouts/UnauthenticatedLayout.d.ts +0 -11
- package/dist/admin/src/pages/Admin.d.ts +0 -7
- package/dist/admin/src/pages/Auth/AuthPage.d.ts +0 -6
- package/dist/admin/src/pages/Auth/components/FieldActionWrapper.d.ts +0 -3
- package/dist/admin/src/pages/Auth/components/ForgotPassword.d.ts +0 -3
- package/dist/admin/src/pages/Auth/components/ForgotPasswordSuccess.d.ts +0 -2
- package/dist/admin/src/pages/Auth/components/Login.d.ts +0 -8
- package/dist/admin/src/pages/Auth/components/Oops.d.ts +0 -2
- package/dist/admin/src/pages/Auth/components/Register.d.ts +0 -7
- package/dist/admin/src/pages/Auth/components/ResetPassword.d.ts +0 -3
- package/dist/admin/src/pages/Auth/constants.d.ts +0 -14
- package/dist/admin/src/pages/HomePage.d.ts +0 -3
- package/dist/admin/src/pages/InstalledPluginsPage.d.ts +0 -3
- package/dist/admin/src/pages/InternalErrorPage.d.ts +0 -7
- package/dist/admin/src/pages/Marketplace/MarketplacePage.d.ts +0 -19
- package/dist/admin/src/pages/Marketplace/components/NpmPackageCard.d.ts +0 -13
- package/dist/admin/src/pages/Marketplace/components/NpmPackagesFilters.d.ts +0 -13
- package/dist/admin/src/pages/Marketplace/components/NpmPackagesGrid.d.ts +0 -13
- package/dist/admin/src/pages/Marketplace/components/OfflineLayout.d.ts +0 -2
- package/dist/admin/src/pages/Marketplace/components/PageHeader.d.ts +0 -8
- package/dist/admin/src/pages/Marketplace/components/SortSelect.d.ts +0 -51
- package/dist/admin/src/pages/Marketplace/hooks/__mocks__/useNavigatorOnline.d.ts +0 -1
- package/dist/admin/src/pages/Marketplace/hooks/useMarketplaceData.d.ts +0 -92
- package/dist/admin/src/pages/Marketplace/hooks/useNavigatorOnline.d.ts +0 -5
- package/dist/admin/src/pages/NotFoundPage.d.ts +0 -1
- package/dist/admin/src/pages/ProfilePage.d.ts +0 -2
- package/dist/admin/src/pages/SettingsPage/hooks/useRegenerate.d.ts +0 -4
- package/dist/admin/src/pages/SettingsPage/pages/Roles/EditPage/hooks/usePermissionsDataManager.d.ts +0 -24
- package/dist/admin/src/pages/SettingsPage/pages/Roles/hooks/__mocks__/useAdminRolePermissions.d.ts +0 -2
- package/dist/admin/src/pages/SettingsPage/pages/Roles/hooks/useAdminRolePermissions.d.ts +0 -11
- package/dist/admin/src/pages/SettingsPage/utils/makeUniqueRoutes.d.ts +0 -6
- package/dist/admin/src/pages/UseCasePage.d.ts +0 -8
- package/dist/admin/src/reducer.d.ts +0 -21
- package/dist/admin/src/render.d.ts +0 -10
- package/dist/admin/src/selectors.d.ts +0 -21
- package/dist/admin/src/shared/components/InjectionZone.d.ts +0 -53
- package/dist/admin/src/shared/hooks/__mocks__/useInjectionZone.d.ts +0 -1
- package/dist/admin/src/shared/hooks/useInjectionZone.d.ts +0 -2
- package/dist/admin/src/translations/languageNativeNames.d.ts +0 -36
- package/dist/admin/src/types/permissions.d.ts +0 -17
- package/dist/admin/src/utils/createRoute.d.ts +0 -6
- package/dist/admin/src/utils/formatAPIErrors.d.ts +0 -6
- package/dist/admin/src/utils/getFullName.d.ts +0 -1
- package/dist/admin/src/utils/hashAdminUserEmail.d.ts +0 -6
- package/dist/cli.js +0 -48
- package/dist/cli.js.map +0 -1
- package/dist/cli.mjs +0 -48
- package/dist/cli.mjs.map +0 -1
- package/dist/ee/admin/src/constants.d.ts +0 -55
- package/dist/ee/admin/src/hooks/useLicenseLimitNotification.d.ts +0 -1
- package/dist/ee/admin/src/pages/AuthPage/components/Login.d.ts +0 -3
- package/dist/ee/admin/src/pages/AuthPage/components/Providers.d.ts +0 -2
- package/dist/ee/admin/src/pages/AuthPage/components/SSOProviders.d.ts +0 -8
- package/dist/ee/admin/src/pages/AuthPage/constants.d.ts +0 -3
- package/dist/ee/admin/src/pages/AuthResponse.d.ts +0 -2
- package/dist/ee/admin/src/pages/HomePage.d.ts +0 -1
- package/dist/shared/contracts/admin.d.ts +0 -23
- package/dist/shared/contracts/authentication.d.ts +0 -126
- package/dist/shared/contracts/providers.d.ts +0 -34
- package/dist/shared/contracts/roles.d.ts +0 -52
- package/dist/shared/contracts/shared.d.ts +0 -39
- package/dist/shared/contracts/user.d.ts +0 -40
- package/dist/shared/contracts/users.d.ts +0 -52
- package/dist/shared/schema.d.ts +0 -7
- package/ee/server/bootstrap.js +0 -41
- package/ee/server/config/admin-actions.js +0 -72
- package/ee/server/constants/default-stages.json +0 -18
- package/ee/server/constants/default-workflow.json +0 -3
- package/ee/server/constants/webhookEvents.js +0 -5
- package/ee/server/constants/workflows.js +0 -33
- package/ee/server/content-types/index.js +0 -9
- package/ee/server/content-types/workflow/index.js +0 -41
- package/ee/server/content-types/workflow-stage/index.js +0 -51
- package/ee/server/controllers/__tests__/stages.test.js +0 -174
- package/ee/server/controllers/admin.js +0 -50
- package/ee/server/controllers/audit-logs.js +0 -24
- package/ee/server/controllers/authentication/constants.js +0 -11
- package/ee/server/controllers/authentication/index.js +0 -11
- package/ee/server/controllers/authentication/middlewares.js +0 -117
- package/ee/server/controllers/authentication/utils.js +0 -23
- package/ee/server/controllers/authentication.js +0 -64
- package/ee/server/controllers/index.js +0 -12
- package/ee/server/controllers/role.js +0 -64
- package/ee/server/controllers/user.js +0 -110
- package/ee/server/controllers/workflows/assignees/index.js +0 -44
- package/ee/server/controllers/workflows/index.js +0 -188
- package/ee/server/controllers/workflows/stages/index.js +0 -189
- package/ee/server/destroy.js +0 -12
- package/ee/server/index.js +0 -11
- package/ee/server/middlewares/__tests__/review-workflows.test.js +0 -40
- package/ee/server/middlewares/review-workflows.js +0 -40
- package/ee/server/migrations/audit-logs-table.js +0 -45
- package/ee/server/migrations/review-workflows-content-types.js +0 -29
- package/ee/server/migrations/review-workflows-deleted-ct-in-workflows.js +0 -39
- package/ee/server/migrations/review-workflows-stage-attribute.js +0 -49
- package/ee/server/migrations/review-workflows-stages-color.js +0 -20
- package/ee/server/migrations/review-workflows-stages-roles.js +0 -68
- package/ee/server/migrations/review-workflows-workflow-name.js +0 -28
- package/ee/server/register.js +0 -40
- package/ee/server/routes/audit-logs.js +0 -43
- package/ee/server/routes/index.js +0 -8
- package/ee/server/routes/license-limit.js +0 -29
- package/ee/server/routes/review-workflows.js +0 -164
- package/ee/server/routes/sso.js +0 -69
- package/ee/server/routes/utils.js +0 -15
- package/ee/server/services/__tests__/assignees.test.js +0 -76
- package/ee/server/services/__tests__/audit-logs.test.js +0 -300
- package/ee/server/services/__tests__/passport.test.js +0 -95
- package/ee/server/services/__tests__/review-workflows-validation.test.js +0 -100
- package/ee/server/services/__tests__/review-workflows.test.js +0 -163
- package/ee/server/services/__tests__/sso.test.js +0 -117
- package/ee/server/services/__tests__/stages.test.js +0 -275
- package/ee/server/services/__tests__/workflows.test.js +0 -203
- package/ee/server/services/audit-logs.js +0 -236
- package/ee/server/services/auth.js +0 -75
- package/ee/server/services/index.js +0 -18
- package/ee/server/services/passport/provider-registry.js +0 -27
- package/ee/server/services/passport/sso.js +0 -37
- package/ee/server/services/passport.js +0 -46
- package/ee/server/services/review-workflows/__tests__/entity-service-decorator.test.js +0 -211
- package/ee/server/services/review-workflows/assignees.js +0 -54
- package/ee/server/services/review-workflows/entity-service-decorator.js +0 -101
- package/ee/server/services/review-workflows/metrics/__tests__/weekly-metrics.test.js +0 -65
- package/ee/server/services/review-workflows/metrics/index.js +0 -56
- package/ee/server/services/review-workflows/metrics/weekly-metrics.js +0 -76
- package/ee/server/services/review-workflows/review-workflows.js +0 -133
- package/ee/server/services/review-workflows/stage-permissions.js +0 -60
- package/ee/server/services/review-workflows/stages.js +0 -384
- package/ee/server/services/review-workflows/validation.js +0 -68
- package/ee/server/services/review-workflows/workflows/__tests__/content-types.test.js +0 -146
- package/ee/server/services/review-workflows/workflows/content-types.js +0 -89
- package/ee/server/services/review-workflows/workflows/index.js +0 -237
- package/ee/server/services/role.js +0 -24
- package/ee/server/services/seat-enforcement.js +0 -114
- package/ee/server/services/user.js +0 -234
- package/ee/server/utils/__tests__/persisted-tables.test.js +0 -38
- package/ee/server/utils/__tests__/sso-lock.test.js +0 -84
- package/ee/server/utils/index.js +0 -8
- package/ee/server/utils/persisted-tables.js +0 -139
- package/ee/server/utils/review-workflows.js +0 -39
- package/ee/server/utils/sso-lock.js +0 -42
- package/ee/server/validation/audit-logs.js +0 -18
- package/ee/server/validation/authentication.js +0 -36
- package/ee/server/validation/review-workflows.js +0 -92
- package/ee/server/validation/role.js +0 -68
- package/ee/server/validation/user.js +0 -27
- package/ee/strapi-server.js +0 -3
- package/server/bootstrap.js +0 -101
- package/server/config/admin-actions.js +0 -216
- package/server/config/admin-conditions.js +0 -26
- package/server/config/email-templates/forgot-password.js +0 -25
- package/server/config/index.js +0 -9
- package/server/config/settings.js +0 -9
- package/server/content-types/Permission.js +0 -64
- package/server/content-types/Role.js +0 -59
- package/server/content-types/User.js +0 -112
- package/server/content-types/api-token-permission.js +0 -36
- package/server/content-types/api-token.js +0 -76
- package/server/content-types/index.js +0 -11
- package/server/content-types/transfer-token-permission.js +0 -36
- package/server/content-types/transfer-token.js +0 -66
- package/server/controllers/__tests__/admin.test.js +0 -106
- package/server/controllers/__tests__/api-token.test.js +0 -496
- package/server/controllers/__tests__/content-api.test.js +0 -173
- package/server/controllers/__tests__/permission.test.js +0 -200
- package/server/controllers/__tests__/role.test.js +0 -201
- package/server/controllers/__tests__/transfer/token.test.js +0 -520
- package/server/controllers/__tests__/user.test.js +0 -326
- package/server/controllers/admin.js +0 -151
- package/server/controllers/api-token.js +0 -135
- package/server/controllers/authenticated-user.js +0 -52
- package/server/controllers/authentication.js +0 -172
- package/server/controllers/content-api.js +0 -15
- package/server/controllers/formatters/conditions.js +0 -12
- package/server/controllers/formatters/format-actions-by-sections.js +0 -40
- package/server/controllers/formatters/index.js +0 -9
- package/server/controllers/index.js +0 -14
- package/server/controllers/permission.js +0 -45
- package/server/controllers/role.js +0 -198
- package/server/controllers/transfer/index.js +0 -13
- package/server/controllers/transfer/runner.js +0 -28
- package/server/controllers/transfer/token.js +0 -131
- package/server/controllers/user.js +0 -141
- package/server/controllers/webhooks.js +0 -132
- package/server/destroy.js +0 -10
- package/server/domain/action/__tests__/action-domain.test.js +0 -230
- package/server/domain/action/__tests__/action-provider.test.js +0 -376
- package/server/domain/action/index.js +0 -142
- package/server/domain/action/provider.js +0 -83
- package/server/domain/condition/__tests__/condition-domain.test.js +0 -122
- package/server/domain/condition/__tests__/condition-provider.test.js +0 -156
- package/server/domain/condition/index.js +0 -92
- package/server/domain/condition/provider.js +0 -42
- package/server/domain/permission/__tests__/permission-domain.test.js +0 -285
- package/server/domain/permission/index.js +0 -156
- package/server/domain/user.js +0 -28
- package/server/index.js +0 -26
- package/server/middlewares/data-transfer.js +0 -29
- package/server/middlewares/index.js +0 -8
- package/server/middlewares/rateLimit.js +0 -47
- package/server/policies/hasPermissions.js +0 -38
- package/server/policies/index.js +0 -7
- package/server/policies/isAuthenticatedAdmin.js +0 -5
- package/server/policies/isTelemetryEnabled.js +0 -16
- package/server/register.js +0 -19
- package/server/routes/admin.js +0 -71
- package/server/routes/api-tokens.js +0 -70
- package/server/routes/authentication.js +0 -57
- package/server/routes/content-api.js +0 -20
- package/server/routes/index.js +0 -28
- package/server/routes/permissions.js +0 -20
- package/server/routes/roles.js +0 -107
- package/server/routes/serve-admin-panel.js +0 -71
- package/server/routes/transfer.js +0 -102
- package/server/routes/users.js +0 -88
- package/server/routes/webhooks.js +0 -81
- package/server/services/__tests__/action.test.js +0 -98
- package/server/services/__tests__/api-token.test.js +0 -980
- package/server/services/__tests__/auth.test.js +0 -319
- package/server/services/__tests__/content-type.test.js +0 -405
- package/server/services/__tests__/metrics.test.js +0 -65
- package/server/services/__tests__/passport.test.js +0 -90
- package/server/services/__tests__/permission.test.js +0 -177
- package/server/services/__tests__/permissions-manager-sanitize.test.js +0 -117
- package/server/services/__tests__/permissions-manager-validate.test.js +0 -119
- package/server/services/__tests__/permissions-manager.test.js +0 -318
- package/server/services/__tests__/permissions.section-builder.section.test.js +0 -136
- package/server/services/__tests__/project-settings.test.js +0 -397
- package/server/services/__tests__/role.test.js +0 -970
- package/server/services/__tests__/token.test.js +0 -217
- package/server/services/__tests__/transfer/token.test.js +0 -878
- package/server/services/__tests__/user.test.js +0 -786
- package/server/services/action.js +0 -35
- package/server/services/api-token.js +0 -453
- package/server/services/auth.js +0 -117
- package/server/services/condition.js +0 -14
- package/server/services/constants.js +0 -37
- package/server/services/content-type.js +0 -208
- package/server/services/index.js +0 -18
- package/server/services/metrics.js +0 -44
- package/server/services/passport/local-strategy.js +0 -28
- package/server/services/passport.js +0 -45
- package/server/services/permission/engine.js +0 -85
- package/server/services/permission/permissions-manager/index.js +0 -53
- package/server/services/permission/permissions-manager/query-builders.js +0 -72
- package/server/services/permission/permissions-manager/sanitize.js +0 -286
- package/server/services/permission/permissions-manager/validate.js +0 -218
- package/server/services/permission/queries.js +0 -190
- package/server/services/permission/sections-builder/builder.js +0 -84
- package/server/services/permission/sections-builder/handlers.js +0 -156
- package/server/services/permission/sections-builder/index.js +0 -50
- package/server/services/permission/sections-builder/section.js +0 -71
- package/server/services/permission/sections-builder/utils.js +0 -26
- package/server/services/permission.js +0 -33
- package/server/services/project-settings.js +0 -174
- package/server/services/role.js +0 -471
- package/server/services/token.js +0 -70
- package/server/services/transfer/index.js +0 -7
- package/server/services/transfer/permission.js +0 -22
- package/server/services/transfer/token.js +0 -449
- package/server/services/transfer/utils.js +0 -38
- package/server/services/user.js +0 -363
- package/server/strategies/__tests__/admin.test.js +0 -118
- package/server/strategies/__tests__/api-token.test.js +0 -364
- package/server/strategies/admin.js +0 -52
- package/server/strategies/api-token.js +0 -140
- package/server/strategies/data-transfer.js +0 -113
- package/server/strategies/index.js +0 -26
- package/server/utils/index.d.ts +0 -25
- package/server/utils/index.js +0 -9
- package/server/validation/__tests__/common-functions.test.js +0 -54
- package/server/validation/action-provider.js +0 -67
- package/server/validation/api-tokens.js +0 -32
- package/server/validation/authentication/forgot-password.js +0 -14
- package/server/validation/authentication/index.js +0 -19
- package/server/validation/authentication/register.js +0 -45
- package/server/validation/authentication/renew-token.js +0 -7
- package/server/validation/authentication/reset-password.js +0 -15
- package/server/validation/common-functions/check-fields-are-correctly-nested.js +0 -28
- package/server/validation/common-functions/check-fields-dont-have-duplicates.js +0 -17
- package/server/validation/common-functions/index.js +0 -9
- package/server/validation/common-validators.js +0 -209
- package/server/validation/permission.js +0 -53
- package/server/validation/policies/hasPermissions.js +0 -27
- package/server/validation/project-settings.js +0 -48
- package/server/validation/role.js +0 -59
- package/server/validation/transfer/index.js +0 -5
- package/server/validation/transfer/token.js +0 -42
- package/server/validation/user.js +0 -65
|
@@ -1,1337 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
const EE = require("@strapi/strapi/dist/utils/ee");
|
|
25
|
-
const tsUtils = require("@strapi/typescript-utils");
|
|
26
|
-
const os = require("node:os");
|
|
27
|
-
const fs = require("node:fs/promises");
|
|
28
|
-
const path = require("node:path");
|
|
29
|
-
const inquirer = require("inquirer");
|
|
30
|
-
const semver = require("semver");
|
|
31
|
-
const resolveFrom = require("resolve-from");
|
|
32
|
-
const execa = require("execa");
|
|
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");
|
|
44
|
-
const outdent = require("outdent");
|
|
45
|
-
const prettier = require("prettier");
|
|
46
|
-
const react = require("react");
|
|
47
|
-
const server = require("react-dom/server");
|
|
48
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
49
|
-
const webpack = require("webpack");
|
|
50
|
-
const browserslistToEsbuild = require("browserslist-to-esbuild");
|
|
51
|
-
const esbuildLoader = require("esbuild-loader");
|
|
52
|
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
53
|
-
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
54
|
-
const ForkTsCheckerPlugin = require("fork-ts-checker-webpack-plugin");
|
|
55
|
-
const webpackBundleAnalyzer = require("webpack-bundle-analyzer");
|
|
56
|
-
const crypto = require("node:crypto");
|
|
57
|
-
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
|
|
58
|
-
const path$1 = require("path");
|
|
59
|
-
const findRoot = require("find-root");
|
|
60
|
-
const chokidar = require("chokidar");
|
|
61
|
-
const cluster = require("node:cluster");
|
|
62
|
-
const node_util = require("node:util");
|
|
63
|
-
const webpackDevMiddleware = require("webpack-dev-middleware");
|
|
64
|
-
const webpackHotMiddleware = require("webpack-hot-middleware");
|
|
65
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
66
|
-
function _interopNamespace(e) {
|
|
67
|
-
if (e && e.__esModule)
|
|
68
|
-
return e;
|
|
69
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
70
|
-
if (e) {
|
|
71
|
-
for (const k in e) {
|
|
72
|
-
if (k !== "default") {
|
|
73
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
74
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: () => e[k]
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
n.default = e;
|
|
82
|
-
return Object.freeze(n);
|
|
83
|
-
}
|
|
84
|
-
const EE__default = /* @__PURE__ */ _interopDefault(EE);
|
|
85
|
-
const tsUtils__namespace = /* @__PURE__ */ _interopNamespace(tsUtils);
|
|
86
|
-
const os__default = /* @__PURE__ */ _interopDefault(os);
|
|
87
|
-
const fs__default = /* @__PURE__ */ _interopDefault(fs);
|
|
88
|
-
const path__default = /* @__PURE__ */ _interopDefault(path);
|
|
89
|
-
const inquirer__default = /* @__PURE__ */ _interopDefault(inquirer);
|
|
90
|
-
const semver__default = /* @__PURE__ */ _interopDefault(semver);
|
|
91
|
-
const resolveFrom__default = /* @__PURE__ */ _interopDefault(resolveFrom);
|
|
92
|
-
const execa__default = /* @__PURE__ */ _interopDefault(execa);
|
|
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);
|
|
101
|
-
const outdent__default = /* @__PURE__ */ _interopDefault(outdent);
|
|
102
|
-
const webpack__default = /* @__PURE__ */ _interopDefault(webpack);
|
|
103
|
-
const browserslistToEsbuild__default = /* @__PURE__ */ _interopDefault(browserslistToEsbuild);
|
|
104
|
-
const HtmlWebpackPlugin__default = /* @__PURE__ */ _interopDefault(HtmlWebpackPlugin);
|
|
105
|
-
const MiniCssExtractPlugin__default = /* @__PURE__ */ _interopDefault(MiniCssExtractPlugin);
|
|
106
|
-
const ForkTsCheckerPlugin__default = /* @__PURE__ */ _interopDefault(ForkTsCheckerPlugin);
|
|
107
|
-
const crypto__default = /* @__PURE__ */ _interopDefault(crypto);
|
|
108
|
-
const ReactRefreshWebpackPlugin__default = /* @__PURE__ */ _interopDefault(ReactRefreshWebpackPlugin);
|
|
109
|
-
const path__default$1 = /* @__PURE__ */ _interopDefault(path$1);
|
|
110
|
-
const findRoot__default = /* @__PURE__ */ _interopDefault(findRoot);
|
|
111
|
-
const chokidar__default = /* @__PURE__ */ _interopDefault(chokidar);
|
|
112
|
-
const cluster__default = /* @__PURE__ */ _interopDefault(cluster);
|
|
113
|
-
const webpackDevMiddleware__default = /* @__PURE__ */ _interopDefault(webpackDevMiddleware);
|
|
114
|
-
const webpackHotMiddleware__default = /* @__PURE__ */ _interopDefault(webpackHotMiddleware);
|
|
115
|
-
const build$2 = ({ command, ctx }) => {
|
|
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-d99bcc06.js"));
|
|
118
|
-
return build2({ ...options, ...ctx });
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
const develop$1 = ({ command, ctx }) => {
|
|
122
|
-
command.command("develop").alias("dev").option("-d, --debug", "Enable debugging mode with verbose logs", false).option("--silent", "Don't log anything", false).option("--ignore-prompts", "Ignore all prompts", false).option("--polling", "Watch for file changes in network directories", false).option("--watch-admin", "Watch the admin panel for hot changes", false).option(
|
|
123
|
-
"--no-build",
|
|
124
|
-
"[deprecated]: there is middleware for the server, it is no longer a separate process"
|
|
125
|
-
).option(
|
|
126
|
-
"--watch-admin",
|
|
127
|
-
"[deprecated]: there is now middleware for watching, it is no longer a separate process"
|
|
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-da585b1e.js"));
|
|
130
|
-
return develop2({ ...options, ...ctx });
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
134
|
-
__proto__: null,
|
|
135
|
-
build: build$2,
|
|
136
|
-
develop: develop$1
|
|
137
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
138
|
-
const getPackageManager = () => {
|
|
139
|
-
const agent = process.env.npm_config_user_agent || "";
|
|
140
|
-
if (agent.includes("yarn")) {
|
|
141
|
-
return "yarn";
|
|
142
|
-
}
|
|
143
|
-
if (agent.includes("pnpm")) {
|
|
144
|
-
return "pnpm";
|
|
145
|
-
}
|
|
146
|
-
if (/^npm\/\d/.test(agent)) {
|
|
147
|
-
return "npm";
|
|
148
|
-
}
|
|
149
|
-
return void 0;
|
|
150
|
-
};
|
|
151
|
-
const PEER_DEPS = {
|
|
152
|
-
react: "^18.0.0",
|
|
153
|
-
"react-dom": "^18.0.0",
|
|
154
|
-
"react-router-dom": "^5.2.0",
|
|
155
|
-
"styled-components": "^5.2.1"
|
|
156
|
-
};
|
|
157
|
-
const checkRequiredDependencies = async ({
|
|
158
|
-
cwd,
|
|
159
|
-
logger,
|
|
160
|
-
ignorePrompts
|
|
161
|
-
}) => {
|
|
162
|
-
const pkg = await readPkgUp__default.default({ cwd });
|
|
163
|
-
if (!pkg) {
|
|
164
|
-
throw new Error(`Could not find package.json at path: ${cwd}`);
|
|
165
|
-
}
|
|
166
|
-
logger.debug("Loaded package.json:", os__default.default.EOL, pkg.packageJson);
|
|
167
|
-
const { install, review } = Object.entries(PEER_DEPS).reduce(
|
|
168
|
-
(acc, [name, version]) => {
|
|
169
|
-
if (!pkg.packageJson.dependencies) {
|
|
170
|
-
throw new Error(`Could not find dependencies in package.json at path: ${cwd}`);
|
|
171
|
-
}
|
|
172
|
-
const declaredVersion = pkg.packageJson.dependencies[name];
|
|
173
|
-
if (!declaredVersion) {
|
|
174
|
-
acc.install.push({
|
|
175
|
-
name,
|
|
176
|
-
wantedVersion: version
|
|
177
|
-
});
|
|
178
|
-
} else {
|
|
179
|
-
acc.review.push({
|
|
180
|
-
name,
|
|
181
|
-
wantedVersion: version,
|
|
182
|
-
declaredVersion
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
return acc;
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
install: [],
|
|
189
|
-
review: []
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
if (install.length > 0) {
|
|
193
|
-
logger.info(
|
|
194
|
-
"The Strapi admin needs to install the following dependencies:",
|
|
195
|
-
os__default.default.EOL,
|
|
196
|
-
install.map(({ name, wantedVersion }) => ` - ${name}@${wantedVersion}`).join(os__default.default.EOL)
|
|
197
|
-
);
|
|
198
|
-
if (process.env.NODE_ENV !== "development" || ignorePrompts) {
|
|
199
|
-
return { didInstall: false };
|
|
200
|
-
}
|
|
201
|
-
const { install: installAns } = await inquirer__default.default.prompt({
|
|
202
|
-
type: "confirm",
|
|
203
|
-
name: "install",
|
|
204
|
-
default: true,
|
|
205
|
-
message: "Would you like to install these dependencies now? These are not required but are recommended, from V5 these will be required."
|
|
206
|
-
});
|
|
207
|
-
if (installAns) {
|
|
208
|
-
await installDependencies(install, {
|
|
209
|
-
cwd,
|
|
210
|
-
logger
|
|
211
|
-
});
|
|
212
|
-
const [file, ...args] = process.argv;
|
|
213
|
-
await execa__default.default(file, args, { cwd, stdio: "inherit" });
|
|
214
|
-
return { didInstall: true };
|
|
215
|
-
} else {
|
|
216
|
-
return { didInstall: false };
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (review.length) {
|
|
220
|
-
const errors = [];
|
|
221
|
-
for (const dep of review) {
|
|
222
|
-
let minDeclaredVersion = null;
|
|
223
|
-
try {
|
|
224
|
-
minDeclaredVersion = semver__default.default.minVersion(dep.declaredVersion);
|
|
225
|
-
} catch (err) {
|
|
226
|
-
}
|
|
227
|
-
if (!minDeclaredVersion) {
|
|
228
|
-
errors.push(
|
|
229
|
-
`The declared dependency, ${dep.name} has an invalid version in package.json: ${dep.declaredVersion}`
|
|
230
|
-
);
|
|
231
|
-
} else if (!semver__default.default.satisfies(minDeclaredVersion, dep.wantedVersion)) {
|
|
232
|
-
logger.warn(
|
|
233
|
-
[
|
|
234
|
-
`Declared version of ${dep.name} (${minDeclaredVersion}) is not compatible with the version required by Strapi (${dep.wantedVersion}).`,
|
|
235
|
-
"You may experience issues, we recommend you change this."
|
|
236
|
-
].join(os__default.default.EOL)
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
const installedVersion = await getModuleVersion(dep.name, cwd);
|
|
240
|
-
if (!installedVersion) {
|
|
241
|
-
errors.push(
|
|
242
|
-
`The declared dependency, ${dep.name} is not installed. You should install before re-running this command`
|
|
243
|
-
);
|
|
244
|
-
} else if (!semver__default.default.satisfies(installedVersion, dep.wantedVersion)) {
|
|
245
|
-
logger.warn(
|
|
246
|
-
[
|
|
247
|
-
`Declared version of ${dep.name} (${installedVersion}) is not compatible with the version required by Strapi (${dep.wantedVersion}).`,
|
|
248
|
-
"You may experience issues, we recommend you change this."
|
|
249
|
-
].join(os__default.default.EOL)
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (errors.length > 0 && process.env.NODE_ENV === "development") {
|
|
254
|
-
throw new Error(`${os__default.default.EOL}- ${errors.join(`${os__default.default.EOL}- `)}`);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return { didInstall: false };
|
|
258
|
-
};
|
|
259
|
-
const getModule = async (name, cwd) => {
|
|
260
|
-
const modulePackagePath = resolveFrom__default.default.silent(cwd, path__default.default.join(name, "package.json"));
|
|
261
|
-
if (!modulePackagePath) {
|
|
262
|
-
return null;
|
|
263
|
-
}
|
|
264
|
-
const file = await fs__default.default.readFile(modulePackagePath, "utf8").then((res) => JSON.parse(res));
|
|
265
|
-
return file;
|
|
266
|
-
};
|
|
267
|
-
const getModuleVersion = async (name, cwd) => {
|
|
268
|
-
const pkg = await getModule(name, cwd);
|
|
269
|
-
return pkg?.version || null;
|
|
270
|
-
};
|
|
271
|
-
const installDependencies = async (install, { cwd, logger }) => {
|
|
272
|
-
const packageManager = getPackageManager();
|
|
273
|
-
if (!packageManager) {
|
|
274
|
-
logger.error(
|
|
275
|
-
"Could not find a supported package manager, please install the dependencies manually."
|
|
276
|
-
);
|
|
277
|
-
process.exit(1);
|
|
278
|
-
}
|
|
279
|
-
const execOptions = {
|
|
280
|
-
encoding: "utf8",
|
|
281
|
-
cwd,
|
|
282
|
-
stdio: "inherit"
|
|
283
|
-
};
|
|
284
|
-
const packages = install.map(({ name, wantedVersion }) => `${name}@${wantedVersion}`);
|
|
285
|
-
let result;
|
|
286
|
-
if (packageManager === "npm") {
|
|
287
|
-
const npmArgs = ["install", "--legacy-peer-deps", "--save", ...packages];
|
|
288
|
-
logger.info(`Running 'npm ${npmArgs.join(" ")}'`);
|
|
289
|
-
result = await execa__default.default("npm", npmArgs, execOptions);
|
|
290
|
-
} else if (packageManager === "yarn") {
|
|
291
|
-
const yarnArgs = ["add", ...packages];
|
|
292
|
-
logger.info(`Running 'yarn ${yarnArgs.join(" ")}'`);
|
|
293
|
-
result = await execa__default.default("yarn", yarnArgs, execOptions);
|
|
294
|
-
} else if (packageManager === "pnpm") {
|
|
295
|
-
const pnpmArgs = ["add", "--save-prod", ...packages];
|
|
296
|
-
logger.info(`Running 'pnpm ${pnpmArgs.join(" ")}'`);
|
|
297
|
-
result = await execa__default.default("pnpm", pnpmArgs, execOptions);
|
|
298
|
-
}
|
|
299
|
-
if (result?.exitCode || result?.failed) {
|
|
300
|
-
throw new Error("Package installation failed");
|
|
301
|
-
}
|
|
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 features = strapiInstance.config.get("features", void 0);
|
|
544
|
-
const buildContext = {
|
|
545
|
-
appDir,
|
|
546
|
-
basePath: `${adminPath}/`,
|
|
547
|
-
customisations,
|
|
548
|
-
cwd,
|
|
549
|
-
distDir,
|
|
550
|
-
distPath,
|
|
551
|
-
entry,
|
|
552
|
-
env,
|
|
553
|
-
logger,
|
|
554
|
-
options,
|
|
555
|
-
plugins: pluginsWithFront,
|
|
556
|
-
runtimeDir,
|
|
557
|
-
strapi: strapiInstance,
|
|
558
|
-
target,
|
|
559
|
-
tsconfig,
|
|
560
|
-
features
|
|
561
|
-
};
|
|
562
|
-
return buildContext;
|
|
563
|
-
};
|
|
564
|
-
const styles = `
|
|
565
|
-
.strapi--root {
|
|
566
|
-
position: absolute;
|
|
567
|
-
top: 0;
|
|
568
|
-
right: 0;
|
|
569
|
-
left: 0;
|
|
570
|
-
bottom: 0;
|
|
571
|
-
background: #fff;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.strapi--no-js {
|
|
575
|
-
position: absolute;
|
|
576
|
-
top: 50%;
|
|
577
|
-
left: 50%;
|
|
578
|
-
transform: translate(-50%, -50%);
|
|
579
|
-
text-align: center;
|
|
580
|
-
font-family: helvetica, arial, sans-serif;
|
|
581
|
-
}
|
|
582
|
-
`;
|
|
583
|
-
const NoJavascript = () => {
|
|
584
|
-
return /* @__PURE__ */ jsxRuntime.jsx("noscript", { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "strapi--root", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "strapi--no-js", children: [
|
|
585
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { type: "text/css", children: styles }),
|
|
586
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { children: "JavaScript disabled" }),
|
|
587
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
588
|
-
"Please ",
|
|
589
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://www.enable-javascript.com/", children: "enable JavaScript" }),
|
|
590
|
-
" in your browser and reload the page to proceed."
|
|
591
|
-
] })
|
|
592
|
-
] }) }) });
|
|
593
|
-
};
|
|
594
|
-
const globalStyles = `
|
|
595
|
-
html,
|
|
596
|
-
body,
|
|
597
|
-
#strapi {
|
|
598
|
-
height: 100%;
|
|
599
|
-
}
|
|
600
|
-
body {
|
|
601
|
-
margin: 0;
|
|
602
|
-
-webkit-font-smoothing: antialiased;
|
|
603
|
-
}
|
|
604
|
-
`;
|
|
605
|
-
const DefaultDocument = () => {
|
|
606
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("html", { lang: "en", children: [
|
|
607
|
-
/* @__PURE__ */ jsxRuntime.jsxs("head", { children: [
|
|
608
|
-
/* @__PURE__ */ jsxRuntime.jsx("meta", { charSet: "utf-8" }),
|
|
609
|
-
/* @__PURE__ */ jsxRuntime.jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1, viewport-fit=cover" }),
|
|
610
|
-
/* @__PURE__ */ jsxRuntime.jsx("meta", { name: "robots", content: "noindex" }),
|
|
611
|
-
/* @__PURE__ */ jsxRuntime.jsx("meta", { name: "referrer", content: "same-origin" }),
|
|
612
|
-
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Strapi Admin" }),
|
|
613
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: globalStyles })
|
|
614
|
-
] }),
|
|
615
|
-
/* @__PURE__ */ jsxRuntime.jsxs("body", { children: [
|
|
616
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { id: "strapi" }),
|
|
617
|
-
/* @__PURE__ */ jsxRuntime.jsx(NoJavascript, {})
|
|
618
|
-
] })
|
|
619
|
-
] });
|
|
620
|
-
};
|
|
621
|
-
const getEntryModule = (ctx) => {
|
|
622
|
-
const pluginsObject = ctx.plugins.map(({ name, importName }) => `'${name}': ${importName}`).join(",\n");
|
|
623
|
-
const pluginsImport = ctx.plugins.map(({ importName, modulePath }) => `import ${importName} from '${modulePath}';`).join("\n");
|
|
624
|
-
return outdent__default.default`
|
|
625
|
-
/**
|
|
626
|
-
* This file was automatically generated by Strapi.
|
|
627
|
-
* Any modifications made will be discarded.
|
|
628
|
-
*/
|
|
629
|
-
${pluginsImport}
|
|
630
|
-
import { renderAdmin } from "@strapi/strapi/admin"
|
|
631
|
-
|
|
632
|
-
${ctx.customisations?.modulePath ? `import customisations from '${ctx.customisations.modulePath}'` : ""}
|
|
633
|
-
|
|
634
|
-
renderAdmin(
|
|
635
|
-
document.getElementById("strapi"),
|
|
636
|
-
{
|
|
637
|
-
${ctx.customisations?.modulePath ? "customisations," : ""}
|
|
638
|
-
${ctx.features ? `features: ${JSON.stringify(ctx.features)},` : ""}
|
|
639
|
-
plugins: {
|
|
640
|
-
${pluginsObject}
|
|
641
|
-
}
|
|
642
|
-
})
|
|
643
|
-
`;
|
|
644
|
-
};
|
|
645
|
-
const getDocumentHTML = async ({ logger }) => {
|
|
646
|
-
const result = server.renderToStaticMarkup(react.createElement(DefaultDocument));
|
|
647
|
-
logger.debug("Rendered the HTML");
|
|
648
|
-
return outdent__default.default`<!DOCTYPE html>${result}`;
|
|
649
|
-
};
|
|
650
|
-
const AUTO_GENERATED_WARNING = `
|
|
651
|
-
This file was automatically generated by Strapi.
|
|
652
|
-
Any modifications made will be discarded.
|
|
653
|
-
`.trim();
|
|
654
|
-
const decorateHTMLWithAutoGeneratedWarning = (htmlTemplate) => htmlTemplate.replace(/<head/, `
|
|
655
|
-
<!--
|
|
656
|
-
${AUTO_GENERATED_WARNING}
|
|
657
|
-
-->
|
|
658
|
-
<head`);
|
|
659
|
-
const writeStaticClientFiles = async (ctx) => {
|
|
660
|
-
await fs__default.default.mkdir(ctx.runtimeDir, { recursive: true });
|
|
661
|
-
ctx.logger.debug("Created the runtime directory");
|
|
662
|
-
const indexHtml = decorateHTMLWithAutoGeneratedWarning(
|
|
663
|
-
await getDocumentHTML({ logger: ctx.logger })
|
|
664
|
-
);
|
|
665
|
-
await fs__default.default.writeFile(
|
|
666
|
-
path__default.default.join(ctx.runtimeDir, "index.html"),
|
|
667
|
-
prettier.format(indexHtml, {
|
|
668
|
-
parser: "html"
|
|
669
|
-
})
|
|
670
|
-
);
|
|
671
|
-
ctx.logger.debug("Wrote the index.html file");
|
|
672
|
-
await fs__default.default.writeFile(
|
|
673
|
-
path__default.default.join(ctx.runtimeDir, "app.js"),
|
|
674
|
-
prettier.format(getEntryModule(ctx), {
|
|
675
|
-
parser: "babel"
|
|
676
|
-
})
|
|
677
|
-
);
|
|
678
|
-
ctx.logger.debug("Wrote the app.js file");
|
|
679
|
-
};
|
|
680
|
-
const adminPackageAliases = [
|
|
681
|
-
"@strapi/design-system",
|
|
682
|
-
"@strapi/helper-plugin",
|
|
683
|
-
"@strapi/icons",
|
|
684
|
-
"date-fns",
|
|
685
|
-
"formik",
|
|
686
|
-
"history",
|
|
687
|
-
"immer",
|
|
688
|
-
"qs",
|
|
689
|
-
"lodash",
|
|
690
|
-
"react",
|
|
691
|
-
"react-dnd",
|
|
692
|
-
"react-dnd-html5-backend",
|
|
693
|
-
"react-dom",
|
|
694
|
-
"react-error-boundary",
|
|
695
|
-
"react-helmet",
|
|
696
|
-
"react-is",
|
|
697
|
-
"react-intl",
|
|
698
|
-
"react-query",
|
|
699
|
-
"react-redux",
|
|
700
|
-
"react-router-dom",
|
|
701
|
-
"react-window",
|
|
702
|
-
"react-select",
|
|
703
|
-
"redux",
|
|
704
|
-
"reselect",
|
|
705
|
-
"styled-components",
|
|
706
|
-
"yup"
|
|
707
|
-
];
|
|
708
|
-
const getAdminDependencyAliases = (monorepo) => adminPackageAliases.filter(
|
|
709
|
-
(moduleName) => !monorepo?.path || monorepo.path && moduleName !== "@strapi/helper-plugin"
|
|
710
|
-
).reduce((acc, moduleName) => {
|
|
711
|
-
acc[`${moduleName}$`] = findRoot__default.default(require.resolve(moduleName));
|
|
712
|
-
return acc;
|
|
713
|
-
}, {});
|
|
714
|
-
const devAliases = {
|
|
715
|
-
"@strapi/admin/strapi-admin": "./packages/core/admin/admin/src",
|
|
716
|
-
"@strapi/content-releases/strapi-admin": "./packages/core/content-releases/admin/src",
|
|
717
|
-
"@strapi/content-type-builder/strapi-admin": "./packages/core/content-type-builder/admin/src",
|
|
718
|
-
"@strapi/email/strapi-admin": "./packages/core/email/admin/src",
|
|
719
|
-
"@strapi/upload/strapi-admin": "./packages/core/upload/admin/src",
|
|
720
|
-
"@strapi/plugin-color-picker/strapi-admin": "./packages/plugins/color-picker/admin/src",
|
|
721
|
-
"@strapi/plugin-documentation/strapi-admin": "./packages/plugins/documentation/admin/src",
|
|
722
|
-
"@strapi/plugin-graphql/strapi-admin": "./packages/plugins/graphql/admin/src",
|
|
723
|
-
"@strapi/plugin-i18n/strapi-admin": "./packages/plugins/i18n/admin/src",
|
|
724
|
-
"@strapi/plugin-sentry/strapi-admin": "./packages/plugins/sentry/admin/src",
|
|
725
|
-
"@strapi/plugin-users-permissions/strapi-admin": "./packages/plugins/users-permissions/admin/src",
|
|
726
|
-
"@strapi/helper-plugin": "./packages/core/helper-plugin/src"
|
|
727
|
-
};
|
|
728
|
-
const getAliases = (cwd, monorepo) => {
|
|
729
|
-
const adminAliases = getAdminDependencyAliases(monorepo);
|
|
730
|
-
const monorepoAliases = monorepo ? Object.fromEntries(
|
|
731
|
-
Object.entries(devAliases).map(([key, modulePath]) => {
|
|
732
|
-
return [key, path__default$1.default.join(monorepo.path, modulePath)];
|
|
733
|
-
})
|
|
734
|
-
) : {};
|
|
735
|
-
return {
|
|
736
|
-
...adminAliases,
|
|
737
|
-
...monorepoAliases
|
|
738
|
-
};
|
|
739
|
-
};
|
|
740
|
-
async function loadStrapiMonorepo(cwd) {
|
|
741
|
-
let p = cwd;
|
|
742
|
-
while (p !== "/") {
|
|
743
|
-
const readResult = await readPkgUp__default.default({ cwd: p });
|
|
744
|
-
if (!readResult) {
|
|
745
|
-
return void 0;
|
|
746
|
-
}
|
|
747
|
-
if (readResult.packageJson.isStrapiMonorepo) {
|
|
748
|
-
return { path: path__default$1.default.dirname(readResult.path) };
|
|
749
|
-
}
|
|
750
|
-
p = path__default$1.default.dirname(path__default$1.default.dirname(readResult.path));
|
|
751
|
-
}
|
|
752
|
-
return void 0;
|
|
753
|
-
}
|
|
754
|
-
const resolveBaseConfig = async (ctx) => {
|
|
755
|
-
const monorepo = await loadStrapiMonorepo(ctx.cwd);
|
|
756
|
-
const target = browserslistToEsbuild__default.default(ctx.target);
|
|
757
|
-
return {
|
|
758
|
-
experiments: {
|
|
759
|
-
topLevelAwait: true
|
|
760
|
-
},
|
|
761
|
-
entry: {
|
|
762
|
-
main: [`./${ctx.entry}`]
|
|
763
|
-
},
|
|
764
|
-
resolve: {
|
|
765
|
-
alias: getAliases(ctx.cwd, monorepo),
|
|
766
|
-
extensions: [".js", ".jsx", ".react.js", ".ts", ".tsx"]
|
|
767
|
-
},
|
|
768
|
-
module: {
|
|
769
|
-
rules: [
|
|
770
|
-
{
|
|
771
|
-
test: /\.(ts|tsx)$/,
|
|
772
|
-
loader: require.resolve("esbuild-loader"),
|
|
773
|
-
options: {
|
|
774
|
-
loader: "tsx",
|
|
775
|
-
target,
|
|
776
|
-
jsx: "automatic"
|
|
777
|
-
}
|
|
778
|
-
},
|
|
779
|
-
{
|
|
780
|
-
test: /\.(js|jsx|mjs)$/,
|
|
781
|
-
use: {
|
|
782
|
-
loader: require.resolve("esbuild-loader"),
|
|
783
|
-
options: {
|
|
784
|
-
loader: "jsx",
|
|
785
|
-
target,
|
|
786
|
-
jsx: "automatic"
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
test: /\.m?js/,
|
|
792
|
-
resolve: {
|
|
793
|
-
fullySpecified: false
|
|
794
|
-
}
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
test: /\.css$/i,
|
|
798
|
-
use: [require.resolve("style-loader"), require.resolve("css-loader")]
|
|
799
|
-
},
|
|
800
|
-
{
|
|
801
|
-
test: /\.(svg|eot|otf|ttf|woff|woff2)$/,
|
|
802
|
-
type: "asset/resource"
|
|
803
|
-
},
|
|
804
|
-
{
|
|
805
|
-
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.ico$/],
|
|
806
|
-
type: "asset",
|
|
807
|
-
parser: {
|
|
808
|
-
dataUrlCondition: {
|
|
809
|
-
maxSize: 1e3
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
test: /\.(mp4|webm)$/,
|
|
815
|
-
type: "asset",
|
|
816
|
-
parser: {
|
|
817
|
-
dataUrlCondition: {
|
|
818
|
-
maxSize: 1e4
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
]
|
|
823
|
-
},
|
|
824
|
-
plugins: [
|
|
825
|
-
new HtmlWebpackPlugin__default.default({
|
|
826
|
-
inject: true,
|
|
827
|
-
template: path__default.default.resolve(ctx.runtimeDir, "index.html")
|
|
828
|
-
}),
|
|
829
|
-
new webpack.DefinePlugin(
|
|
830
|
-
Object.entries(ctx.env).reduce((acc, [key, value]) => {
|
|
831
|
-
acc[`process.env.${key}`] = JSON.stringify(value);
|
|
832
|
-
return acc;
|
|
833
|
-
}, {})
|
|
834
|
-
),
|
|
835
|
-
ctx.tsconfig && new ForkTsCheckerPlugin__default.default({
|
|
836
|
-
typescript: {
|
|
837
|
-
configFile: ctx.tsconfig.path,
|
|
838
|
-
configOverwrite: {
|
|
839
|
-
compilerOptions: {
|
|
840
|
-
sourceMap: ctx.options.sourcemaps
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
})
|
|
845
|
-
].filter(Boolean)
|
|
846
|
-
};
|
|
847
|
-
};
|
|
848
|
-
const resolveDevelopmentConfig = async (ctx) => {
|
|
849
|
-
const baseConfig = await resolveBaseConfig(ctx);
|
|
850
|
-
return {
|
|
851
|
-
...baseConfig,
|
|
852
|
-
cache: {
|
|
853
|
-
type: "filesystem",
|
|
854
|
-
// version cache when there are changes to aliases
|
|
855
|
-
buildDependencies: {
|
|
856
|
-
config: [__filename]
|
|
857
|
-
},
|
|
858
|
-
version: crypto__default.default.createHash("md5").update(Object.entries(baseConfig.resolve.alias).join()).digest("hex")
|
|
859
|
-
},
|
|
860
|
-
entry: {
|
|
861
|
-
...baseConfig.entry,
|
|
862
|
-
main: [
|
|
863
|
-
`${require.resolve("webpack-hot-middleware/client")}?path=/__webpack_hmr`,
|
|
864
|
-
...baseConfig.entry.main
|
|
865
|
-
]
|
|
866
|
-
},
|
|
867
|
-
stats: "errors-warnings",
|
|
868
|
-
mode: "development",
|
|
869
|
-
devtool: "inline-source-map",
|
|
870
|
-
output: {
|
|
871
|
-
filename: "[name].js",
|
|
872
|
-
path: ctx.distPath,
|
|
873
|
-
publicPath: ctx.basePath
|
|
874
|
-
},
|
|
875
|
-
infrastructureLogging: {
|
|
876
|
-
level: "error"
|
|
877
|
-
},
|
|
878
|
-
plugins: [
|
|
879
|
-
...baseConfig.plugins,
|
|
880
|
-
new webpack.HotModuleReplacementPlugin(),
|
|
881
|
-
new ReactRefreshWebpackPlugin__default.default()
|
|
882
|
-
]
|
|
883
|
-
};
|
|
884
|
-
};
|
|
885
|
-
const resolveProductionConfig = async (ctx) => {
|
|
886
|
-
const target = browserslistToEsbuild__default.default(ctx.target);
|
|
887
|
-
const baseConfig = await resolveBaseConfig(ctx);
|
|
888
|
-
return {
|
|
889
|
-
...baseConfig,
|
|
890
|
-
stats: "errors-only",
|
|
891
|
-
mode: "production",
|
|
892
|
-
bail: true,
|
|
893
|
-
devtool: ctx.options.sourcemaps ? "source-map" : false,
|
|
894
|
-
output: {
|
|
895
|
-
path: ctx.distPath,
|
|
896
|
-
publicPath: ctx.basePath,
|
|
897
|
-
// Utilize long-term caching by adding content hashes (not compilation hashes)
|
|
898
|
-
// to compiled assets for production
|
|
899
|
-
filename: "[name].[contenthash:8].js",
|
|
900
|
-
chunkFilename: "[name].[contenthash:8].chunk.js"
|
|
901
|
-
},
|
|
902
|
-
optimization: {
|
|
903
|
-
minimize: ctx.options.minify,
|
|
904
|
-
minimizer: [
|
|
905
|
-
new esbuildLoader.ESBuildMinifyPlugin({
|
|
906
|
-
target,
|
|
907
|
-
css: true
|
|
908
|
-
// Apply minification to CSS assets
|
|
909
|
-
})
|
|
910
|
-
],
|
|
911
|
-
moduleIds: "deterministic",
|
|
912
|
-
runtimeChunk: true
|
|
913
|
-
},
|
|
914
|
-
// @ts-expect-error
|
|
915
|
-
plugins: [
|
|
916
|
-
...baseConfig.plugins,
|
|
917
|
-
new MiniCssExtractPlugin__default.default({
|
|
918
|
-
filename: "[name].[chunkhash].css",
|
|
919
|
-
chunkFilename: "[name].[chunkhash].chunkhash.css",
|
|
920
|
-
ignoreOrder: true
|
|
921
|
-
}),
|
|
922
|
-
ctx.options.stats && new webpackBundleAnalyzer.BundleAnalyzerPlugin()
|
|
923
|
-
].filter(Boolean)
|
|
924
|
-
};
|
|
925
|
-
};
|
|
926
|
-
const USER_CONFIGS = ["webpack.config.js", "webpack.config.mjs", "webpack.config.ts"];
|
|
927
|
-
const getUserConfig = async (ctx) => {
|
|
928
|
-
for (const file of USER_CONFIGS) {
|
|
929
|
-
const filePath = path__default.default.join(ctx.appDir, "src", "admin", file);
|
|
930
|
-
const configFile = await loadFile(filePath);
|
|
931
|
-
if (configFile) {
|
|
932
|
-
return configFile;
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
return void 0;
|
|
936
|
-
};
|
|
937
|
-
const mergeConfigWithUserConfig = async (config, ctx) => {
|
|
938
|
-
const userConfig = await getUserConfig(ctx);
|
|
939
|
-
if (userConfig) {
|
|
940
|
-
if (typeof userConfig === "function") {
|
|
941
|
-
const webpack2 = await import("webpack");
|
|
942
|
-
return userConfig(config, webpack2);
|
|
943
|
-
} else {
|
|
944
|
-
ctx.logger.warn(
|
|
945
|
-
`You've exported something other than a function from ${path__default.default.join(
|
|
946
|
-
ctx.appDir,
|
|
947
|
-
"src",
|
|
948
|
-
"admin",
|
|
949
|
-
"webpack.config"
|
|
950
|
-
)}, this will ignored.`
|
|
951
|
-
);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
return config;
|
|
955
|
-
};
|
|
956
|
-
const build$1 = async (ctx) => new Promise(async (resolve, reject) => {
|
|
957
|
-
const config = await resolveProductionConfig(ctx);
|
|
958
|
-
const finalConfig = await mergeConfigWithUserConfig(config, ctx);
|
|
959
|
-
ctx.logger.debug("Webpack config", finalConfig);
|
|
960
|
-
webpack__default.default(finalConfig, (err, stats) => {
|
|
961
|
-
if (stats) {
|
|
962
|
-
if (stats.hasErrors()) {
|
|
963
|
-
ctx.logger.error(
|
|
964
|
-
stats.toString({
|
|
965
|
-
chunks: false,
|
|
966
|
-
colors: true
|
|
967
|
-
})
|
|
968
|
-
);
|
|
969
|
-
reject(false);
|
|
970
|
-
} else if (ctx.options.stats) {
|
|
971
|
-
ctx.logger.info(
|
|
972
|
-
stats.toString({
|
|
973
|
-
chunks: false,
|
|
974
|
-
colors: true
|
|
975
|
-
})
|
|
976
|
-
);
|
|
977
|
-
}
|
|
978
|
-
resolve(true);
|
|
979
|
-
}
|
|
980
|
-
if (err && isError(err)) {
|
|
981
|
-
ctx.logger.error(err.message);
|
|
982
|
-
reject(false);
|
|
983
|
-
}
|
|
984
|
-
});
|
|
985
|
-
});
|
|
986
|
-
const build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }) => {
|
|
987
|
-
const timer = getTimer();
|
|
988
|
-
const { didInstall } = await checkRequiredDependencies({ cwd, logger, ignorePrompts }).catch(
|
|
989
|
-
(err) => {
|
|
990
|
-
logger.error(err.message);
|
|
991
|
-
process.exit(1);
|
|
992
|
-
}
|
|
993
|
-
);
|
|
994
|
-
if (didInstall) {
|
|
995
|
-
return;
|
|
996
|
-
}
|
|
997
|
-
if (tsconfig?.config) {
|
|
998
|
-
timer.start("compilingTS");
|
|
999
|
-
const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
|
|
1000
|
-
tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
|
|
1001
|
-
const compilingDuration = timer.end("compilingTS");
|
|
1002
|
-
compilingTsSpinner.text = `Compiling TS (${prettyTime(compilingDuration)})`;
|
|
1003
|
-
compilingTsSpinner.succeed();
|
|
1004
|
-
}
|
|
1005
|
-
timer.start("createBuildContext");
|
|
1006
|
-
const contextSpinner = logger.spinner(`Building build context`).start();
|
|
1007
|
-
console.log("");
|
|
1008
|
-
const ctx = await createBuildContext({
|
|
1009
|
-
cwd,
|
|
1010
|
-
logger,
|
|
1011
|
-
tsconfig,
|
|
1012
|
-
options
|
|
1013
|
-
});
|
|
1014
|
-
const contextDuration = timer.end("createBuildContext");
|
|
1015
|
-
contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
|
|
1016
|
-
contextSpinner.succeed();
|
|
1017
|
-
timer.start("buildAdmin");
|
|
1018
|
-
const buildingSpinner = logger.spinner(`Building admin panel`).start();
|
|
1019
|
-
console.log("");
|
|
1020
|
-
try {
|
|
1021
|
-
EE__default.default.init(cwd);
|
|
1022
|
-
await writeStaticClientFiles(ctx);
|
|
1023
|
-
await build$1(ctx);
|
|
1024
|
-
const buildDuration = timer.end("buildAdmin");
|
|
1025
|
-
buildingSpinner.text = `Building admin panel (${prettyTime(buildDuration)})`;
|
|
1026
|
-
buildingSpinner.succeed();
|
|
1027
|
-
} catch (err) {
|
|
1028
|
-
buildingSpinner.fail();
|
|
1029
|
-
throw err;
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
const watch = async (ctx) => {
|
|
1033
|
-
const config = await resolveDevelopmentConfig(ctx);
|
|
1034
|
-
const finalConfig = await mergeConfigWithUserConfig(config, ctx);
|
|
1035
|
-
ctx.logger.debug("Final webpack config:", os__default.default.EOL, finalConfig);
|
|
1036
|
-
return new Promise((res) => {
|
|
1037
|
-
const compiler = webpack.webpack(finalConfig);
|
|
1038
|
-
const devMiddleware = webpackDevMiddleware__default.default(compiler);
|
|
1039
|
-
const hotMiddleware = webpackHotMiddleware__default.default(compiler, {
|
|
1040
|
-
log: false,
|
|
1041
|
-
path: "/__webpack_hmr"
|
|
1042
|
-
});
|
|
1043
|
-
ctx.strapi.server.app.use((ctx2, next) => {
|
|
1044
|
-
return new Promise((resolve, reject) => {
|
|
1045
|
-
hotMiddleware(ctx2.req, ctx2.res, (err) => {
|
|
1046
|
-
if (err)
|
|
1047
|
-
reject(err);
|
|
1048
|
-
else
|
|
1049
|
-
resolve(next());
|
|
1050
|
-
});
|
|
1051
|
-
});
|
|
1052
|
-
});
|
|
1053
|
-
ctx.strapi.server.app.use((context, next) => {
|
|
1054
|
-
const ready = new Promise((resolve, reject) => {
|
|
1055
|
-
devMiddleware.waitUntilValid(() => {
|
|
1056
|
-
resolve(true);
|
|
1057
|
-
});
|
|
1058
|
-
});
|
|
1059
|
-
const init = new Promise((resolve) => {
|
|
1060
|
-
devMiddleware(
|
|
1061
|
-
context.req,
|
|
1062
|
-
{
|
|
1063
|
-
// @ts-expect-error
|
|
1064
|
-
end: (content) => {
|
|
1065
|
-
context.body = content;
|
|
1066
|
-
resolve(true);
|
|
1067
|
-
},
|
|
1068
|
-
getHeader: context.get.bind(context),
|
|
1069
|
-
// @ts-expect-error
|
|
1070
|
-
setHeader: context.set.bind(context),
|
|
1071
|
-
locals: context.state
|
|
1072
|
-
},
|
|
1073
|
-
() => resolve(next())
|
|
1074
|
-
);
|
|
1075
|
-
});
|
|
1076
|
-
return Promise.all([ready, init]);
|
|
1077
|
-
});
|
|
1078
|
-
const serveAdmin = async (ctx2, next) => {
|
|
1079
|
-
await next();
|
|
1080
|
-
if (devMiddleware.context.outputFileSystem.createReadStream) {
|
|
1081
|
-
if (ctx2.method !== "HEAD" && ctx2.method !== "GET") {
|
|
1082
|
-
return;
|
|
1083
|
-
}
|
|
1084
|
-
if (ctx2.body != null || ctx2.status !== 404) {
|
|
1085
|
-
return;
|
|
1086
|
-
}
|
|
1087
|
-
const filename = path__default.default.resolve(finalConfig.output?.path, "index.html");
|
|
1088
|
-
ctx2.type = "html";
|
|
1089
|
-
ctx2.body = devMiddleware.context.outputFileSystem.createReadStream(filename);
|
|
1090
|
-
}
|
|
1091
|
-
};
|
|
1092
|
-
ctx.strapi.server.routes([
|
|
1093
|
-
{
|
|
1094
|
-
method: "GET",
|
|
1095
|
-
path: `${ctx.basePath}:path*`,
|
|
1096
|
-
handler: serveAdmin,
|
|
1097
|
-
config: { auth: false }
|
|
1098
|
-
}
|
|
1099
|
-
]);
|
|
1100
|
-
devMiddleware.waitUntilValid(() => {
|
|
1101
|
-
res({
|
|
1102
|
-
async close() {
|
|
1103
|
-
await Promise.all([
|
|
1104
|
-
node_util.promisify(devMiddleware.close.bind(devMiddleware))(),
|
|
1105
|
-
hotMiddleware.close(),
|
|
1106
|
-
node_util.promisify(compiler.close.bind(compiler))()
|
|
1107
|
-
]);
|
|
1108
|
-
}
|
|
1109
|
-
});
|
|
1110
|
-
});
|
|
1111
|
-
});
|
|
1112
|
-
};
|
|
1113
|
-
const cleanupDistDirectory = async ({
|
|
1114
|
-
tsconfig,
|
|
1115
|
-
logger,
|
|
1116
|
-
timer
|
|
1117
|
-
}) => {
|
|
1118
|
-
const distDir = tsconfig?.config?.options?.outDir;
|
|
1119
|
-
if (!distDir || // we don't have a dist dir
|
|
1120
|
-
await fs__default.default.access(distDir).then(() => false).catch(() => true)) {
|
|
1121
|
-
return;
|
|
1122
|
-
}
|
|
1123
|
-
const timerName = "cleaningDist" + Date.now();
|
|
1124
|
-
timer.start(timerName);
|
|
1125
|
-
const cleaningSpinner = logger.spinner(`Cleaning dist dir ${distDir}`).start();
|
|
1126
|
-
try {
|
|
1127
|
-
const dirContent = await fs__default.default.readdir(distDir);
|
|
1128
|
-
const validFilenames = dirContent.filter((filename) => filename !== "build");
|
|
1129
|
-
for (const filename of validFilenames) {
|
|
1130
|
-
await fs__default.default.rm(path__default.default.resolve(distDir, filename), { recursive: true });
|
|
1131
|
-
}
|
|
1132
|
-
} catch (err) {
|
|
1133
|
-
const generatingDuration2 = timer.end(timerName);
|
|
1134
|
-
cleaningSpinner.text = `Error cleaning dist dir: ${err} (${prettyTime(generatingDuration2)})`;
|
|
1135
|
-
cleaningSpinner?.fail();
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
const generatingDuration = timer.end(timerName);
|
|
1139
|
-
cleaningSpinner.text = `Cleaning dist dir (${prettyTime(generatingDuration)})`;
|
|
1140
|
-
cleaningSpinner?.succeed();
|
|
1141
|
-
};
|
|
1142
|
-
const develop = async ({
|
|
1143
|
-
cwd,
|
|
1144
|
-
polling,
|
|
1145
|
-
logger,
|
|
1146
|
-
tsconfig,
|
|
1147
|
-
ignorePrompts,
|
|
1148
|
-
watchAdmin,
|
|
1149
|
-
...options
|
|
1150
|
-
}) => {
|
|
1151
|
-
const timer = getTimer();
|
|
1152
|
-
if (cluster__default.default.isPrimary) {
|
|
1153
|
-
const { didInstall } = await checkRequiredDependencies({ cwd, logger, ignorePrompts }).catch(
|
|
1154
|
-
(err) => {
|
|
1155
|
-
logger.error(err.message);
|
|
1156
|
-
process.exit(1);
|
|
1157
|
-
}
|
|
1158
|
-
);
|
|
1159
|
-
if (didInstall) {
|
|
1160
|
-
return;
|
|
1161
|
-
}
|
|
1162
|
-
if (tsconfig?.config) {
|
|
1163
|
-
await cleanupDistDirectory({ tsconfig, logger, timer });
|
|
1164
|
-
await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: true } });
|
|
1165
|
-
}
|
|
1166
|
-
if (!watchAdmin) {
|
|
1167
|
-
timer.start("createBuildContext");
|
|
1168
|
-
const contextSpinner = logger.spinner(`Building build context`).start();
|
|
1169
|
-
console.log("");
|
|
1170
|
-
const ctx = await createBuildContext({
|
|
1171
|
-
cwd,
|
|
1172
|
-
logger,
|
|
1173
|
-
tsconfig,
|
|
1174
|
-
options
|
|
1175
|
-
});
|
|
1176
|
-
const contextDuration = timer.end("createBuildContext");
|
|
1177
|
-
contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
|
|
1178
|
-
contextSpinner.succeed();
|
|
1179
|
-
timer.start("creatingAdmin");
|
|
1180
|
-
const adminSpinner = logger.spinner(`Creating admin`).start();
|
|
1181
|
-
EE__default.default.init(cwd);
|
|
1182
|
-
await writeStaticClientFiles(ctx);
|
|
1183
|
-
await build$1(ctx);
|
|
1184
|
-
const adminDuration = timer.end("creatingAdmin");
|
|
1185
|
-
adminSpinner.text = `Creating admin (${prettyTime(adminDuration)})`;
|
|
1186
|
-
adminSpinner.succeed();
|
|
1187
|
-
}
|
|
1188
|
-
cluster__default.default.on("message", async (worker, message) => {
|
|
1189
|
-
switch (message) {
|
|
1190
|
-
case "reload": {
|
|
1191
|
-
if (tsconfig?.config) {
|
|
1192
|
-
await cleanupDistDirectory({ tsconfig, logger, timer });
|
|
1193
|
-
await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: true } });
|
|
1194
|
-
}
|
|
1195
|
-
logger.debug("cluster has the reload message, sending the worker kill message");
|
|
1196
|
-
worker.send("kill");
|
|
1197
|
-
break;
|
|
1198
|
-
}
|
|
1199
|
-
case "killed": {
|
|
1200
|
-
logger.debug("cluster has the killed message, forking the cluster");
|
|
1201
|
-
cluster__default.default.fork();
|
|
1202
|
-
break;
|
|
1203
|
-
}
|
|
1204
|
-
case "stop": {
|
|
1205
|
-
process.exit(1);
|
|
1206
|
-
break;
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
});
|
|
1210
|
-
cluster__default.default.fork();
|
|
1211
|
-
}
|
|
1212
|
-
if (cluster__default.default.isWorker) {
|
|
1213
|
-
timer.start("loadStrapi");
|
|
1214
|
-
const loadStrapiSpinner = logger.spinner(`Loading Strapi`).start();
|
|
1215
|
-
const strapi = strapiFactory__default.default({
|
|
1216
|
-
appDir: cwd,
|
|
1217
|
-
distDir: tsconfig?.config.options.outDir ?? "",
|
|
1218
|
-
autoReload: true,
|
|
1219
|
-
serveAdminPanel: !watchAdmin
|
|
1220
|
-
});
|
|
1221
|
-
let webpackWatcher;
|
|
1222
|
-
if (watchAdmin) {
|
|
1223
|
-
timer.start("createBuildContext");
|
|
1224
|
-
const contextSpinner = logger.spinner(`Building build context`).start();
|
|
1225
|
-
console.log("");
|
|
1226
|
-
const ctx = await createBuildContext({
|
|
1227
|
-
cwd,
|
|
1228
|
-
logger,
|
|
1229
|
-
strapi,
|
|
1230
|
-
tsconfig,
|
|
1231
|
-
options
|
|
1232
|
-
});
|
|
1233
|
-
const contextDuration = timer.end("createBuildContext");
|
|
1234
|
-
contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
|
|
1235
|
-
contextSpinner.succeed();
|
|
1236
|
-
timer.start("creatingAdmin");
|
|
1237
|
-
const adminSpinner = logger.spinner(`Creating admin`).start();
|
|
1238
|
-
EE__default.default.init(cwd);
|
|
1239
|
-
await writeStaticClientFiles(ctx);
|
|
1240
|
-
webpackWatcher = await watch(ctx);
|
|
1241
|
-
const adminDuration = timer.end("creatingAdmin");
|
|
1242
|
-
adminSpinner.text = `Creating admin (${prettyTime(adminDuration)})`;
|
|
1243
|
-
adminSpinner.succeed();
|
|
1244
|
-
}
|
|
1245
|
-
const strapiInstance = await strapi.load();
|
|
1246
|
-
const loadStrapiDuration = timer.end("loadStrapi");
|
|
1247
|
-
loadStrapiSpinner.text = `Loading Strapi (${prettyTime(loadStrapiDuration)})`;
|
|
1248
|
-
loadStrapiSpinner.succeed();
|
|
1249
|
-
timer.start("generatingTS");
|
|
1250
|
-
const generatingTsSpinner = logger.spinner(`Generating types`).start();
|
|
1251
|
-
await tsUtils__namespace.generators.generate({
|
|
1252
|
-
strapi: strapiInstance,
|
|
1253
|
-
pwd: cwd,
|
|
1254
|
-
rootDir: void 0,
|
|
1255
|
-
logger: { silent: true, debug: false },
|
|
1256
|
-
artifacts: { contentTypes: true, components: true }
|
|
1257
|
-
});
|
|
1258
|
-
const generatingDuration = timer.end("generatingTS");
|
|
1259
|
-
generatingTsSpinner.text = `Generating types (${prettyTime(generatingDuration)})`;
|
|
1260
|
-
generatingTsSpinner.succeed();
|
|
1261
|
-
if (tsconfig?.config) {
|
|
1262
|
-
timer.start("compilingTS");
|
|
1263
|
-
const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
|
|
1264
|
-
await cleanupDistDirectory({ tsconfig, logger, timer });
|
|
1265
|
-
await tsUtils__namespace.compile(cwd, { configOptions: { ignoreDiagnostics: false } });
|
|
1266
|
-
const compilingDuration = timer.end("compilingTS");
|
|
1267
|
-
compilingTsSpinner.text = `Compiling TS (${prettyTime(compilingDuration)})`;
|
|
1268
|
-
compilingTsSpinner.succeed();
|
|
1269
|
-
}
|
|
1270
|
-
const restart = async () => {
|
|
1271
|
-
if (strapiInstance.reload.isWatching && !strapiInstance.reload.isReloading) {
|
|
1272
|
-
strapiInstance.reload.isReloading = true;
|
|
1273
|
-
strapiInstance.reload();
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
const watcher = chokidar__default.default.watch(cwd, {
|
|
1277
|
-
ignoreInitial: true,
|
|
1278
|
-
usePolling: polling,
|
|
1279
|
-
ignored: [
|
|
1280
|
-
/(^|[/\\])\../,
|
|
1281
|
-
// dot files
|
|
1282
|
-
/tmp/,
|
|
1283
|
-
"**/src/admin/**",
|
|
1284
|
-
"**/src/plugins/**/admin/**",
|
|
1285
|
-
"**/dist/src/plugins/test/admin/**",
|
|
1286
|
-
"**/documentation",
|
|
1287
|
-
"**/documentation/**",
|
|
1288
|
-
"**/node_modules",
|
|
1289
|
-
"**/node_modules/**",
|
|
1290
|
-
"**/plugins.json",
|
|
1291
|
-
"**/build",
|
|
1292
|
-
"**/build/**",
|
|
1293
|
-
"**/index.html",
|
|
1294
|
-
"**/public",
|
|
1295
|
-
"**/public/**",
|
|
1296
|
-
strapiInstance.dirs.static.public,
|
|
1297
|
-
utils.joinBy("/", strapiInstance.dirs.static.public, "**"),
|
|
1298
|
-
"**/*.db*",
|
|
1299
|
-
"**/exports/**",
|
|
1300
|
-
"**/dist/**",
|
|
1301
|
-
"**/*.d.ts",
|
|
1302
|
-
...strapiInstance.config.get("admin.watchIgnoreFiles", [])
|
|
1303
|
-
]
|
|
1304
|
-
}).on("add", (path2) => {
|
|
1305
|
-
strapiInstance.log.info(`File created: ${path2}`);
|
|
1306
|
-
restart();
|
|
1307
|
-
}).on("change", (path2) => {
|
|
1308
|
-
strapiInstance.log.info(`File changed: ${path2}`);
|
|
1309
|
-
restart();
|
|
1310
|
-
}).on("unlink", (path2) => {
|
|
1311
|
-
strapiInstance.log.info(`File deleted: ${path2}`);
|
|
1312
|
-
restart();
|
|
1313
|
-
});
|
|
1314
|
-
process.on("message", async (message) => {
|
|
1315
|
-
switch (message) {
|
|
1316
|
-
case "kill": {
|
|
1317
|
-
logger.debug(
|
|
1318
|
-
"child process has the kill message, destroying the strapi instance and sending the killed process message"
|
|
1319
|
-
);
|
|
1320
|
-
await watcher.close();
|
|
1321
|
-
await strapiInstance.destroy();
|
|
1322
|
-
if (webpackWatcher) {
|
|
1323
|
-
webpackWatcher.close();
|
|
1324
|
-
}
|
|
1325
|
-
process.send?.("killed");
|
|
1326
|
-
break;
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
});
|
|
1330
|
-
strapiInstance.start();
|
|
1331
|
-
}
|
|
1332
|
-
};
|
|
1333
|
-
exports.build = build;
|
|
1334
|
-
exports.develop = develop;
|
|
1335
|
-
exports.handleUnexpectedError = handleUnexpectedError;
|
|
1336
|
-
exports.index = index;
|
|
1337
|
-
//# sourceMappingURL=index-ffd2f664.js.map
|