@strapi/admin 4.15.5-alpha.2 → 4.15.5-alpha.3
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/dist/_chunks/{AuthenticatedApp-fa931d1d.mjs → AuthenticatedApp-2cfb41e2.mjs} +21 -21
- package/dist/_chunks/{AuthenticatedApp-fa931d1d.mjs.map → AuthenticatedApp-2cfb41e2.mjs.map} +1 -1
- package/dist/_chunks/{AuthenticatedApp-4b160235.js → AuthenticatedApp-79e3f141.js} +21 -21
- package/dist/_chunks/{AuthenticatedApp-4b160235.js.map → AuthenticatedApp-79e3f141.js.map} +1 -1
- package/dist/_chunks/{HomePage-8e98be60.mjs → HomePage-1376624b.mjs} +4 -4
- package/dist/_chunks/{HomePage-8e98be60.mjs.map → HomePage-1376624b.mjs.map} +1 -1
- package/dist/_chunks/{HomePage-b91d1592.js → HomePage-a617d19a.js} +4 -4
- package/dist/_chunks/{HomePage-b91d1592.js.map → HomePage-a617d19a.js.map} +1 -1
- package/dist/_chunks/{HomePage-b6967648.js → HomePage-a9e9942a.js} +4 -4
- package/dist/_chunks/{HomePage-b6967648.js.map → HomePage-a9e9942a.js.map} +1 -1
- package/dist/_chunks/{HomePage-9bda39b5.mjs → HomePage-e333ff90.mjs} +4 -4
- package/dist/_chunks/{HomePage-9bda39b5.mjs.map → HomePage-e333ff90.mjs.map} +1 -1
- package/dist/_chunks/{InstalledPluginsPage-ee6d69b0.mjs → InstalledPluginsPage-c7ccd2b2.mjs} +3 -3
- package/dist/_chunks/{InstalledPluginsPage-ee6d69b0.mjs.map → InstalledPluginsPage-c7ccd2b2.mjs.map} +1 -1
- package/dist/_chunks/{InstalledPluginsPage-d4b90e9c.js → InstalledPluginsPage-fb2aaa1f.js} +3 -3
- package/dist/_chunks/{InstalledPluginsPage-d4b90e9c.js.map → InstalledPluginsPage-fb2aaa1f.js.map} +1 -1
- package/dist/_chunks/{Login-4fc5dcbb.mjs → Login-69bf063c.mjs} +2 -2
- package/dist/_chunks/{Login-4fc5dcbb.mjs.map → Login-69bf063c.mjs.map} +1 -1
- package/dist/_chunks/{Login-5fbf37c3.js → Login-d6fd38ea.js} +2 -2
- package/dist/_chunks/{Login-5fbf37c3.js.map → Login-d6fd38ea.js.map} +1 -1
- package/dist/_chunks/{MarketplacePage-ff0d02c6.js → MarketplacePage-7c516084.js} +3 -3
- package/dist/_chunks/{MarketplacePage-ff0d02c6.js.map → MarketplacePage-7c516084.js.map} +1 -1
- package/dist/_chunks/{MarketplacePage-ec9bf1db.mjs → MarketplacePage-c829d0de.mjs} +3 -3
- package/dist/_chunks/{MarketplacePage-ec9bf1db.mjs.map → MarketplacePage-c829d0de.mjs.map} +1 -1
- package/dist/_chunks/{ProfilePage-96a8404e.js → ProfilePage-a2e54283.js} +3 -3
- package/dist/_chunks/{ProfilePage-96a8404e.js.map → ProfilePage-a2e54283.js.map} +1 -1
- package/dist/_chunks/{ProfilePage-caeace8c.mjs → ProfilePage-c6d8c69f.mjs} +3 -3
- package/dist/_chunks/{ProfilePage-caeace8c.mjs.map → ProfilePage-c6d8c69f.mjs.map} +1 -1
- package/dist/_chunks/{build-f011d8dc.mjs → build-20299009.mjs} +2 -2
- package/dist/_chunks/{build-f011d8dc.mjs.map → build-20299009.mjs.map} +1 -1
- package/dist/_chunks/{build-b285bccd.js → build-58827c7a.js} +2 -2
- package/dist/_chunks/{build-b285bccd.js.map → build-58827c7a.js.map} +1 -1
- package/dist/_chunks/{constants-86882708.js → constants-4c06740e.js} +3 -3
- package/dist/_chunks/{constants-86882708.js.map → constants-4c06740e.js.map} +1 -1
- package/dist/_chunks/{constants-ffa23daa.mjs → constants-5f0670d7.mjs} +5 -5
- package/dist/_chunks/{constants-ffa23daa.mjs.map → constants-5f0670d7.mjs.map} +1 -1
- package/dist/_chunks/{constants-129cf022.mjs → constants-842c6449.mjs} +6 -6
- package/dist/_chunks/{constants-129cf022.mjs.map → constants-842c6449.mjs.map} +1 -1
- package/dist/_chunks/{constants-1bd1239d.js → constants-9212941b.js} +6 -6
- package/dist/_chunks/{constants-1bd1239d.js.map → constants-9212941b.js.map} +1 -1
- package/dist/_chunks/{constants-cd5a4e71.js → constants-962e9922.js} +5 -5
- package/dist/_chunks/{constants-cd5a4e71.js.map → constants-962e9922.js.map} +1 -1
- package/dist/_chunks/{constants-916debf1.js → constants-a16f9961.js} +2 -2
- package/dist/_chunks/{constants-916debf1.js.map → constants-a16f9961.js.map} +1 -1
- package/dist/_chunks/{constants-39df4f04.mjs → constants-a3372db6.mjs} +3 -3
- package/dist/_chunks/{constants-39df4f04.mjs.map → constants-a3372db6.mjs.map} +1 -1
- package/dist/_chunks/{constants-7bfc7134.mjs → constants-fad06b7f.mjs} +2 -2
- package/dist/_chunks/{constants-7bfc7134.mjs.map → constants-fad06b7f.mjs.map} +1 -1
- package/dist/_chunks/{develop-3c9f7452.mjs → develop-7066af5e.mjs} +2 -2
- package/dist/_chunks/{develop-3c9f7452.mjs.map → develop-7066af5e.mjs.map} +1 -1
- package/dist/_chunks/{develop-9765d7ba.js → develop-a7d5cf0c.js} +2 -2
- package/dist/_chunks/{develop-9765d7ba.js.map → develop-a7d5cf0c.js.map} +1 -1
- package/dist/_chunks/{index-653e1ab3.js → index-07d155a0.js} +2 -2
- package/dist/_chunks/{index-653e1ab3.js.map → index-07d155a0.js.map} +1 -1
- package/dist/_chunks/{index-1eaab33f.js → index-12b7d75f.js} +4 -4
- package/dist/_chunks/{index-1eaab33f.js.map → index-12b7d75f.js.map} +1 -1
- package/dist/_chunks/{index-4343f97f.mjs → index-1316edb2.mjs} +4 -4
- package/dist/_chunks/{index-4343f97f.mjs.map → index-1316edb2.mjs.map} +1 -1
- package/dist/_chunks/{index-3fb94612.js → index-174cc6b9.js} +4 -4
- package/dist/_chunks/{index-3fb94612.js.map → index-174cc6b9.js.map} +1 -1
- package/dist/_chunks/{index-05f82f02.js → index-18fed2cd.js} +3 -3
- package/dist/_chunks/{index-05f82f02.js.map → index-18fed2cd.js.map} +1 -1
- package/dist/_chunks/{index-77124563.mjs → index-1e3a2719.mjs} +5 -5
- package/dist/_chunks/{index-77124563.mjs.map → index-1e3a2719.mjs.map} +1 -1
- package/dist/_chunks/{index-0bd0d840.mjs → index-242c514c.mjs} +3 -3
- package/dist/_chunks/{index-0bd0d840.mjs.map → index-242c514c.mjs.map} +1 -1
- package/dist/_chunks/{index-cdc1221a.js → index-252284ed.js} +3 -3
- package/dist/_chunks/{index-cdc1221a.js.map → index-252284ed.js.map} +1 -1
- package/dist/_chunks/{index-4e8af716.js → index-25bb4a4d.js} +5 -5
- package/dist/_chunks/{index-4e8af716.js.map → index-25bb4a4d.js.map} +1 -1
- package/dist/_chunks/{index-f3c67f77.js → index-25c9158f.js} +2 -2
- package/dist/_chunks/{index-f3c67f77.js.map → index-25c9158f.js.map} +1 -1
- package/dist/_chunks/{index-8acbbabe.js → index-25feef65.js} +6 -6
- package/dist/_chunks/{index-8acbbabe.js.map → index-25feef65.js.map} +1 -1
- package/dist/_chunks/{index-05ada54b.js → index-2aed5618.js} +3 -3
- package/dist/_chunks/{index-05ada54b.js.map → index-2aed5618.js.map} +1 -1
- package/dist/_chunks/{index-f18d27fd.js → index-2b331655.js} +3 -3
- package/dist/_chunks/{index-f18d27fd.js.map → index-2b331655.js.map} +1 -1
- package/dist/_chunks/{index-a220f0b2.mjs → index-314f72f4.mjs} +4 -4
- package/dist/_chunks/{index-a220f0b2.mjs.map → index-314f72f4.mjs.map} +1 -1
- package/dist/_chunks/{index-006ef0ac.js → index-341222f2.js} +3 -3
- package/dist/_chunks/{index-006ef0ac.js.map → index-341222f2.js.map} +1 -1
- package/dist/_chunks/{index-7c0dcf2b.js → index-3444ab6f.js} +4 -4
- package/dist/_chunks/{index-7c0dcf2b.js.map → index-3444ab6f.js.map} +1 -1
- package/dist/_chunks/{index-09752dfe.js → index-35fc9959.js} +3 -3
- package/dist/_chunks/{index-09752dfe.js.map → index-35fc9959.js.map} +1 -1
- package/dist/_chunks/{index-9b3ff96c.mjs → index-45a78b18.mjs} +20 -20
- package/dist/_chunks/{index-9b3ff96c.mjs.map → index-45a78b18.mjs.map} +1 -1
- package/dist/_chunks/{index-d5711ebb.js → index-48ebb88c.js} +5 -5
- package/dist/_chunks/{index-d5711ebb.js.map → index-48ebb88c.js.map} +1 -1
- package/dist/_chunks/{index-05001647.js → index-4a241498.js} +8 -8
- package/dist/_chunks/{index-05001647.js.map → index-4a241498.js.map} +1 -1
- package/dist/_chunks/{index-54dc318d.js → index-4c29f67c.js} +3 -3
- package/dist/_chunks/{index-54dc318d.js.map → index-4c29f67c.js.map} +1 -1
- package/dist/_chunks/{index-c184f4d7.mjs → index-517fbe00.mjs} +5 -5
- package/dist/_chunks/{index-c184f4d7.mjs.map → index-517fbe00.mjs.map} +1 -1
- package/dist/_chunks/{index-7028ad70.js → index-563a992a.js} +4 -4
- package/dist/_chunks/{index-7028ad70.js.map → index-563a992a.js.map} +1 -1
- package/dist/_chunks/{index-782c0685.mjs → index-5b44cba5.mjs} +2 -2
- package/dist/_chunks/{index-782c0685.mjs.map → index-5b44cba5.mjs.map} +1 -1
- package/dist/_chunks/{index-f4a061be.mjs → index-61c915cd.mjs} +2 -2
- package/dist/_chunks/{index-f4a061be.mjs.map → index-61c915cd.mjs.map} +1 -1
- package/dist/_chunks/{index-f0f40db4.mjs → index-61e392e8.mjs} +5 -5
- package/dist/_chunks/{index-f0f40db4.mjs.map → index-61e392e8.mjs.map} +1 -1
- package/dist/_chunks/{index-7a956856.js → index-66177bc5.js} +4 -4
- package/dist/_chunks/{index-7a956856.js.map → index-66177bc5.js.map} +1 -1
- package/dist/_chunks/{index-9c88e73f.js → index-68ae52b6.js} +5 -5
- package/dist/_chunks/{index-9c88e73f.js.map → index-68ae52b6.js.map} +1 -1
- package/dist/_chunks/{index-43e86c36.mjs → index-693383db.mjs} +5 -5
- package/dist/_chunks/{index-43e86c36.mjs.map → index-693383db.mjs.map} +1 -1
- package/dist/_chunks/{index-8d895e56.mjs → index-6b7dceb1.mjs} +3 -3
- package/dist/_chunks/{index-8d895e56.mjs.map → index-6b7dceb1.mjs.map} +1 -1
- package/dist/_chunks/{index-d9f9de85.mjs → index-703c58c8.mjs} +4 -4
- package/dist/_chunks/{index-d9f9de85.mjs.map → index-703c58c8.mjs.map} +1 -1
- package/dist/_chunks/{index-96af3a65.js → index-7338912f.js} +5 -5
- package/dist/_chunks/{index-96af3a65.js.map → index-7338912f.js.map} +1 -1
- package/dist/_chunks/{index-1bf08614.mjs → index-7a1a0c5c.mjs} +3 -3
- package/dist/_chunks/{index-1bf08614.mjs.map → index-7a1a0c5c.mjs.map} +1 -1
- package/dist/_chunks/{index-6861cd84.mjs → index-7d449292.mjs} +3 -3
- package/dist/_chunks/{index-6861cd84.mjs.map → index-7d449292.mjs.map} +1 -1
- package/dist/_chunks/{index-de154c58.mjs → index-80574f48.mjs} +3 -3
- package/dist/_chunks/{index-de154c58.mjs.map → index-80574f48.mjs.map} +1 -1
- package/dist/_chunks/{index-55a46be8.mjs → index-9910aa5a.mjs} +3 -3
- package/dist/_chunks/{index-55a46be8.mjs.map → index-9910aa5a.mjs.map} +1 -1
- package/dist/_chunks/{index-df043af5.mjs → index-996f7ad1.mjs} +3 -3
- package/dist/_chunks/{index-df043af5.mjs.map → index-996f7ad1.mjs.map} +1 -1
- package/dist/_chunks/{index-a684490c.mjs → index-9b3107a4.mjs} +3 -3
- package/dist/_chunks/{index-a684490c.mjs.map → index-9b3107a4.mjs.map} +1 -1
- package/dist/_chunks/{index-e013fe86.js → index-9d03d359.js} +3 -3
- package/dist/_chunks/{index-e013fe86.js.map → index-9d03d359.js.map} +1 -1
- package/dist/_chunks/{index-cd2af4a0.mjs → index-9e5d59f5.mjs} +5 -5
- package/dist/_chunks/{index-cd2af4a0.mjs.map → index-9e5d59f5.mjs.map} +1 -1
- package/dist/_chunks/{index-57ae9065.mjs → index-9f88ad83.mjs} +3 -3
- package/dist/_chunks/{index-57ae9065.mjs.map → index-9f88ad83.mjs.map} +1 -1
- package/dist/_chunks/{index-f67d8e8d.mjs → index-adb714e8.mjs} +2 -2
- package/dist/_chunks/{index-f67d8e8d.mjs.map → index-adb714e8.mjs.map} +1 -1
- package/dist/_chunks/{index-b593ff2a.mjs → index-b53ba38d.mjs} +4 -4
- package/dist/_chunks/{index-b593ff2a.mjs.map → index-b53ba38d.mjs.map} +1 -1
- package/dist/_chunks/{index-c075b5a1.mjs → index-b53cf07d.mjs} +52 -40
- package/dist/_chunks/index-b53cf07d.mjs.map +1 -0
- package/dist/_chunks/{index-62b7bdbe.js → index-b84b9fee.js} +52 -40
- package/dist/_chunks/index-b84b9fee.js.map +1 -0
- package/dist/_chunks/{index-326b9481.mjs → index-bef99193.mjs} +4 -4
- package/dist/_chunks/{index-326b9481.mjs.map → index-bef99193.mjs.map} +1 -1
- package/dist/_chunks/{index-6bfd0b33.js → index-c2b86584.js} +3 -3
- package/dist/_chunks/{index-6bfd0b33.js.map → index-c2b86584.js.map} +1 -1
- package/dist/_chunks/{index-82f22c48.js → index-c3469f69.js} +3 -3
- package/dist/_chunks/{index-82f22c48.js.map → index-c3469f69.js.map} +1 -1
- package/dist/_chunks/{index-e2db7aa8.mjs → index-c4116296.mjs} +6 -6
- package/dist/_chunks/{index-e2db7aa8.mjs.map → index-c4116296.mjs.map} +1 -1
- package/dist/_chunks/{index-d33c8d9f.mjs → index-cf4fe6b7.mjs} +8 -8
- package/dist/_chunks/{index-d33c8d9f.mjs.map → index-cf4fe6b7.mjs.map} +1 -1
- package/dist/_chunks/{index-d196ac50.js → index-d4029932.js} +4 -4
- package/dist/_chunks/{index-d196ac50.js.map → index-d4029932.js.map} +1 -1
- package/dist/_chunks/{index-eea1e084.mjs → index-dcbab202.mjs} +3 -3
- package/dist/_chunks/{index-eea1e084.mjs.map → index-dcbab202.mjs.map} +1 -1
- package/dist/_chunks/{index-dff777b7.js → index-dcd31235.js} +3 -3
- package/dist/_chunks/{index-dff777b7.js.map → index-dcd31235.js.map} +1 -1
- package/dist/_chunks/{index-332b3702.mjs → index-dede2234.mjs} +3 -3
- package/dist/_chunks/{index-332b3702.mjs.map → index-dede2234.mjs.map} +1 -1
- package/dist/_chunks/{index-853bad50.mjs → index-df70cfd7.mjs} +5 -5
- package/dist/_chunks/{index-853bad50.mjs.map → index-df70cfd7.mjs.map} +1 -1
- package/dist/_chunks/{index-c40ee26a.mjs → index-dfc0437b.mjs} +4 -4
- package/dist/_chunks/{index-c40ee26a.mjs.map → index-dfc0437b.mjs.map} +1 -1
- package/dist/_chunks/{index-455d0b3e.js → index-e8b17b94.js} +5 -5
- package/dist/_chunks/{index-455d0b3e.js.map → index-e8b17b94.js.map} +1 -1
- package/dist/_chunks/{index-539c5eac.js → index-ea8946fb.js} +2 -2
- package/dist/_chunks/{index-539c5eac.js.map → index-ea8946fb.js.map} +1 -1
- package/dist/_chunks/{index-0c5f6415.js → index-ecb3cfba.js} +5 -5
- package/dist/_chunks/{index-0c5f6415.js.map → index-ecb3cfba.js.map} +1 -1
- package/dist/_chunks/{index-d80de23d.mjs → index-ed287ba8.mjs} +3 -3
- package/dist/_chunks/{index-d80de23d.mjs.map → index-ed287ba8.mjs.map} +1 -1
- package/dist/_chunks/{index-891d1527.mjs → index-edf62e62.mjs} +4 -4
- package/dist/_chunks/{index-891d1527.mjs.map → index-edf62e62.mjs.map} +1 -1
- package/dist/_chunks/{index-706ae836.js → index-ef0c2ffb.js} +4 -4
- package/dist/_chunks/{index-706ae836.js.map → index-ef0c2ffb.js.map} +1 -1
- package/dist/_chunks/{index-2ed87ac8.js → index-f088fe2c.js} +3 -3
- package/dist/_chunks/{index-2ed87ac8.js.map → index-f088fe2c.js.map} +1 -1
- package/dist/_chunks/{index-234ed67d.mjs → index-f097ccea.mjs} +3 -3
- package/dist/_chunks/{index-234ed67d.mjs.map → index-f097ccea.mjs.map} +1 -1
- package/dist/_chunks/{index-55d6d65a.js → index-fbe9dba1.js} +3 -3
- package/dist/_chunks/{index-55d6d65a.js.map → index-fbe9dba1.js.map} +1 -1
- package/dist/_chunks/{index-b6c497e5.js → index-fc7a00f0.js} +20 -20
- package/dist/_chunks/{index-b6c497e5.js.map → index-fc7a00f0.js.map} +1 -1
- package/dist/_chunks/{schema-82ad2cb1.mjs → schema-1808aa2d.mjs} +2 -2
- package/dist/_chunks/{schema-82ad2cb1.mjs.map → schema-1808aa2d.mjs.map} +1 -1
- package/dist/_chunks/{schema-8bb5b01b.js → schema-e73a6250.js} +2 -2
- package/dist/_chunks/{schema-8bb5b01b.js.map → schema-e73a6250.js.map} +1 -1
- package/dist/_chunks/{validateWorkflow-f5761727.js → validateWorkflow-11ecf8ee.js} +3 -3
- package/dist/_chunks/{validateWorkflow-f5761727.js.map → validateWorkflow-11ecf8ee.js.map} +1 -1
- package/dist/_chunks/{validateWorkflow-23b1ee38.mjs → validateWorkflow-1ec1040b.mjs} +3 -3
- package/dist/_chunks/{validateWorkflow-23b1ee38.mjs.map → validateWorkflow-1ec1040b.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.mjs +1 -1
- package/package.json +12 -12
- package/dist/_chunks/index-62b7bdbe.js.map +0 -1
- package/dist/_chunks/index-c075b5a1.mjs.map +0 -1
|
@@ -41,7 +41,7 @@ import webpackDevMiddleware from "webpack-dev-middleware";
|
|
|
41
41
|
import webpackHotMiddleware from "webpack-hot-middleware";
|
|
42
42
|
const build$2 = ({ command, ctx }) => {
|
|
43
43
|
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) => {
|
|
44
|
-
const { build: build2 } = await import("./build-
|
|
44
|
+
const { build: build2 } = await import("./build-20299009.mjs");
|
|
45
45
|
return build2({ ...options, ...ctx });
|
|
46
46
|
});
|
|
47
47
|
};
|
|
@@ -53,7 +53,7 @@ const develop$1 = ({ command, ctx }) => {
|
|
|
53
53
|
"--watch-admin",
|
|
54
54
|
"[deprecated]: there is now middleware for watching, it is no longer a separate process"
|
|
55
55
|
).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) => {
|
|
56
|
-
const { develop: develop2 } = await import("./develop-
|
|
56
|
+
const { develop: develop2 } = await import("./develop-7066af5e.mjs");
|
|
57
57
|
return develop2({ ...options, ...ctx });
|
|
58
58
|
});
|
|
59
59
|
};
|
|
@@ -286,7 +286,7 @@ const DefaultDocument = () => {
|
|
|
286
286
|
};
|
|
287
287
|
const getEntryModule = (ctx) => {
|
|
288
288
|
const pluginsObject = ctx.plugins.map(({ name, importName }) => `'${name}': ${importName}`).join(",\n");
|
|
289
|
-
const pluginsImport = ctx.plugins.map(({ importName,
|
|
289
|
+
const pluginsImport = ctx.plugins.map(({ importName, modulePath }) => `import ${importName} from '${modulePath}';`).join("\n");
|
|
290
290
|
return outdent`
|
|
291
291
|
/**
|
|
292
292
|
* This file was automatically generated by Strapi.
|
|
@@ -295,15 +295,12 @@ const getEntryModule = (ctx) => {
|
|
|
295
295
|
${pluginsImport}
|
|
296
296
|
import { renderAdmin } from "@strapi/strapi/admin"
|
|
297
297
|
|
|
298
|
-
${ctx.customisations?.
|
|
299
|
-
ctx.runtimeDir,
|
|
300
|
-
ctx.customisations.path
|
|
301
|
-
)}'` : ""}
|
|
298
|
+
${ctx.customisations?.modulePath ? `import customisations from '${ctx.customisations.modulePath}'` : ""}
|
|
302
299
|
|
|
303
300
|
renderAdmin(
|
|
304
301
|
document.getElementById("strapi"),
|
|
305
302
|
{
|
|
306
|
-
${ctx.customisations?.
|
|
303
|
+
${ctx.customisations?.modulePath ? "customisations," : ""}
|
|
307
304
|
plugins: {
|
|
308
305
|
${pluginsObject}
|
|
309
306
|
}
|
|
@@ -439,6 +436,20 @@ const loadFile = async (path2) => {
|
|
|
439
436
|
}
|
|
440
437
|
return void 0;
|
|
441
438
|
};
|
|
439
|
+
const convertSystemPathToModulePath = (sysPath) => {
|
|
440
|
+
if (process.platform === "win32") {
|
|
441
|
+
return sysPath.split(path.sep).join(path.posix.sep);
|
|
442
|
+
} else {
|
|
443
|
+
return sysPath;
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
const convertModulePathToSystemPath = (modulePath) => {
|
|
447
|
+
if (process.platform === "win32") {
|
|
448
|
+
return modulePath.split(path.posix.sep).join(path.sep);
|
|
449
|
+
} else {
|
|
450
|
+
return modulePath;
|
|
451
|
+
}
|
|
452
|
+
};
|
|
442
453
|
const resolveBaseConfig = async (ctx) => {
|
|
443
454
|
const monorepo = await loadStrapiMonorepo(ctx.cwd);
|
|
444
455
|
const target = browserslistToEsbuild(ctx.target);
|
|
@@ -707,9 +718,10 @@ const getStrapiAdminEnvVars = (defaultEnv) => {
|
|
|
707
718
|
const validatePackageHasStrapi = (pkg) => "strapi" in pkg && typeof pkg.strapi === "object" && !Array.isArray(pkg.strapi) && pkg.strapi !== null;
|
|
708
719
|
const validatePackageIsPlugin = (pkg) => validatePackageHasStrapi(pkg) && pkg.strapi.kind === "plugin";
|
|
709
720
|
const getEnabledPlugins = async ({
|
|
710
|
-
strapi,
|
|
711
721
|
cwd,
|
|
712
|
-
logger
|
|
722
|
+
logger,
|
|
723
|
+
runtimeDir,
|
|
724
|
+
strapi
|
|
713
725
|
}) => {
|
|
714
726
|
const plugins = {};
|
|
715
727
|
const deps = strapi.config.get("info.dependencies", {});
|
|
@@ -725,7 +737,9 @@ const getEnabledPlugins = async ({
|
|
|
725
737
|
}
|
|
726
738
|
plugins[name] = {
|
|
727
739
|
name,
|
|
728
|
-
|
|
740
|
+
importName: camelCase(name),
|
|
741
|
+
type: "module",
|
|
742
|
+
modulePath: dep
|
|
729
743
|
};
|
|
730
744
|
}
|
|
731
745
|
}
|
|
@@ -733,14 +747,17 @@ const getEnabledPlugins = async ({
|
|
|
733
747
|
logger.debug("User's plugins file", os.EOL, userPluginsFile);
|
|
734
748
|
for (const [userPluginName, userPluginConfig] of Object.entries(userPluginsFile)) {
|
|
735
749
|
if (userPluginConfig.enabled && userPluginConfig.resolve) {
|
|
750
|
+
const sysPath = convertModulePathToSystemPath(userPluginConfig.resolve);
|
|
736
751
|
plugins[userPluginName] = {
|
|
737
752
|
name: userPluginName,
|
|
738
|
-
|
|
753
|
+
importName: camelCase(userPluginName),
|
|
754
|
+
type: "local",
|
|
739
755
|
/**
|
|
740
756
|
* User plugin paths are resolved from the entry point
|
|
741
757
|
* of the app, because that's how you import them.
|
|
742
758
|
*/
|
|
743
|
-
|
|
759
|
+
modulePath: convertSystemPathToModulePath(path.relative(runtimeDir, sysPath)),
|
|
760
|
+
path: sysPath
|
|
744
761
|
};
|
|
745
762
|
}
|
|
746
763
|
}
|
|
@@ -757,21 +774,14 @@ const loadUserPluginsFile = async (root) => {
|
|
|
757
774
|
}
|
|
758
775
|
return {};
|
|
759
776
|
};
|
|
760
|
-
const getMapOfPluginsWithAdmin = (plugins
|
|
777
|
+
const getMapOfPluginsWithAdmin = (plugins) => Object.values(plugins).filter((plugin) => {
|
|
761
778
|
if (!plugin) {
|
|
762
779
|
return false;
|
|
763
780
|
}
|
|
764
781
|
try {
|
|
765
|
-
const isLocalPluginWithLegacyAdminFile = fs$1.existsSync(
|
|
766
|
-
//@ts-ignore
|
|
767
|
-
path.resolve(`${plugin.pathToPlugin}/strapi-admin.js`)
|
|
768
|
-
);
|
|
782
|
+
const isLocalPluginWithLegacyAdminFile = plugin.path && fs$1.existsSync(path.join(plugin.path, "strapi-admin.js"));
|
|
769
783
|
if (!isLocalPluginWithLegacyAdminFile) {
|
|
770
|
-
|
|
771
|
-
if (process.platform === "win32") {
|
|
772
|
-
pathToPlugin = pathToPlugin.split(path.sep).join(path.posix.sep);
|
|
773
|
-
}
|
|
774
|
-
const isModuleWithFE = require.resolve(`${pathToPlugin}/strapi-admin`);
|
|
784
|
+
const isModuleWithFE = require.resolve(`${plugin.modulePath}/strapi-admin`);
|
|
775
785
|
return isModuleWithFE;
|
|
776
786
|
}
|
|
777
787
|
return isLocalPluginWithLegacyAdminFile;
|
|
@@ -781,21 +791,22 @@ const getMapOfPluginsWithAdmin = (plugins, { runtimeDir }) => Object.values(plug
|
|
|
781
791
|
}
|
|
782
792
|
throw err;
|
|
783
793
|
}
|
|
784
|
-
}).map((plugin) => {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
path: !plugin.isLocal ? `${plugin.pathToPlugin}/strapi-admin` : `${modulePath}/strapi-admin`,
|
|
789
|
-
name: plugin.name,
|
|
790
|
-
importName: camelCase(plugin.name)
|
|
791
|
-
};
|
|
792
|
-
});
|
|
794
|
+
}).map((plugin) => ({
|
|
795
|
+
...plugin,
|
|
796
|
+
modulePath: `${plugin.modulePath}/strapi-admin`
|
|
797
|
+
}));
|
|
793
798
|
const ADMIN_APP_FILES = ["app.js", "app.mjs", "app.ts", "app.jsx", "app.tsx"];
|
|
794
|
-
const loadUserAppFile = async (
|
|
799
|
+
const loadUserAppFile = async ({
|
|
800
|
+
runtimeDir,
|
|
801
|
+
appDir
|
|
802
|
+
}) => {
|
|
795
803
|
for (const file of ADMIN_APP_FILES) {
|
|
796
804
|
const filePath = path.join(appDir, "src", "admin", file);
|
|
797
|
-
if (
|
|
798
|
-
return {
|
|
805
|
+
if (await pathExists(filePath)) {
|
|
806
|
+
return {
|
|
807
|
+
path: filePath,
|
|
808
|
+
modulePath: convertSystemPathToModulePath(path.relative(runtimeDir, filePath))
|
|
809
|
+
};
|
|
799
810
|
}
|
|
800
811
|
}
|
|
801
812
|
return void 0;
|
|
@@ -822,6 +833,7 @@ const createBuildContext = async ({
|
|
|
822
833
|
serveAdminPanel: false
|
|
823
834
|
});
|
|
824
835
|
const { serverUrl, adminPath } = getConfigUrls(strapiInstance.config, true);
|
|
836
|
+
const appDir = strapiInstance.dirs.app.root;
|
|
825
837
|
await loadEnv(cwd);
|
|
826
838
|
const env2 = getStrapiAdminEnvVars({
|
|
827
839
|
ADMIN_PATH: adminPath,
|
|
@@ -848,14 +860,14 @@ const createBuildContext = async ({
|
|
|
848
860
|
}
|
|
849
861
|
const runtimeDir = path.join(cwd, ".strapi", "client");
|
|
850
862
|
const entry = path.relative(cwd, path.join(runtimeDir, "app.js"));
|
|
851
|
-
const plugins = await getEnabledPlugins({ cwd, logger, strapi: strapiInstance });
|
|
863
|
+
const plugins = await getEnabledPlugins({ cwd, logger, runtimeDir, strapi: strapiInstance });
|
|
852
864
|
logger.debug("Enabled plugins", os.EOL, plugins);
|
|
853
|
-
const pluginsWithFront = getMapOfPluginsWithAdmin(plugins
|
|
865
|
+
const pluginsWithFront = getMapOfPluginsWithAdmin(plugins);
|
|
854
866
|
logger.debug("Enabled plugins with FE", os.EOL, plugins);
|
|
855
867
|
const target = browserslist.loadConfig({ path: cwd }) ?? DEFAULT_BROWSERSLIST;
|
|
856
|
-
const customisations = await loadUserAppFile(
|
|
868
|
+
const customisations = await loadUserAppFile({ appDir, runtimeDir });
|
|
857
869
|
const buildContext = {
|
|
858
|
-
appDir
|
|
870
|
+
appDir,
|
|
859
871
|
basePath: `${adminPath}/`,
|
|
860
872
|
customisations,
|
|
861
873
|
cwd,
|
|
@@ -1201,4 +1213,4 @@ export {
|
|
|
1201
1213
|
handleUnexpectedError as h,
|
|
1202
1214
|
index as i
|
|
1203
1215
|
};
|
|
1204
|
-
//# sourceMappingURL=index-
|
|
1216
|
+
//# sourceMappingURL=index-b53cf07d.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-b53cf07d.mjs","sources":["../../_internal/cli/index.ts","../../_internal/node/core/managers.ts","../../_internal/node/core/dependencies.ts","../../admin/src/components/NoJavascript.tsx","../../admin/src/components/DefaultDocument.tsx","../../_internal/node/staticFiles.ts","../../_internal/node/webpack/aliases.ts","../../_internal/node/core/monorepo.ts","../../_internal/node/core/files.ts","../../_internal/node/webpack/config.ts","../../_internal/node/core/errors.ts","../../_internal/node/webpack/build.ts","../../_internal/node/core/env.ts","../../_internal/node/core/plugins.ts","../../_internal/node/core/admin-customisations.ts","../../_internal/node/createBuildContext.ts","../../_internal/node/core/timer.ts","../../_internal/node/build.ts","../../_internal/node/webpack/watch.ts","../../_internal/node/develop.ts"],"sourcesContent":["import type { StrapiCommand } from '@strapi/strapi';\nimport type { BuildCLIOptions } from './commands/build';\nimport type { DevelopCLIOptions } from './commands/develop';\n\n/**\n * `$ strapi build`\n */\nconst build: StrapiCommand = ({ command, ctx }) => {\n command\n .command('build')\n .option('-d, --debug', 'Enable debugging mode with verbose logs', false)\n .option('--ignore-prompts', 'Ignore all prompts', false)\n .option('--minify', 'Minify the output', true)\n .option('--no-optimization', '[deprecated]: use minify instead')\n .option('--silent', \"Don't log anything\", false)\n .option('--sourcemap', 'Produce sourcemaps', false)\n .option('--stats', 'Print build statistics to the console', false)\n .description('Build the strapi admin app')\n .action(async (options: BuildCLIOptions) => {\n const { build } = await import('./commands/build');\n\n return build({ ...options, ...ctx });\n });\n};\n\n/**\n * `$ strapi develop`\n */\nconst develop: StrapiCommand = ({ command, ctx }) => {\n command\n .command('develop')\n .alias('dev')\n .option('-d, --debug', 'Enable debugging mode with verbose logs', false)\n .option('--silent', \"Don't log anything\", false)\n .option('--ignore-prompts', 'Ignore all prompts', false)\n .option('--polling', 'Watch for file changes in network directories', false)\n .option('--watch-admin', 'Watch the admin panel for hot changes', false)\n .option(\n '--no-build',\n '[deprecated]: there is middleware for the server, it is no longer a separate process'\n )\n .option(\n '--watch-admin',\n '[deprecated]: there is now middleware for watching, it is no longer a separate process'\n )\n .option('--browser <name>', '[deprecated]: use open instead')\n .option('--open', 'Open the admin in your browser', true)\n .description('Start your Strapi application in development mode')\n .action(async (options: DevelopCLIOptions) => {\n const { develop } = await import('./commands/develop');\n\n return develop({ ...options, ...ctx });\n });\n};\n\nexport { build, develop };\n","/**\n * @description Supports the following managers:\n * – npm\n * – yarn\n * – pnpm\n */\nconst getPackageManager = () => {\n // Yes, the env var is lowercase - it is set by the package managers themselves\n const agent = process.env.npm_config_user_agent || '';\n\n if (agent.includes('yarn')) {\n return 'yarn';\n }\n\n if (agent.includes('pnpm')) {\n return 'pnpm';\n }\n\n // Both yarn and pnpm does a `npm/?` thing, thus the slightly different match here\n // Theoretically not needed since we check for yarn/pnpm above, but in case other\n // package managers do the same thing, we'll (hopefully) catch them here.\n if (/^npm\\/\\d/.test(agent)) {\n return 'npm';\n }\n\n return undefined;\n};\n\nexport { getPackageManager };\n","import os from 'node:os';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport inquirer from 'inquirer';\nimport semver, { SemVer } from 'semver';\nimport resolveFrom from 'resolve-from';\nimport execa, { CommonOptions, ExecaReturnValue } from 'execa';\nimport readPkgUp, { PackageJson } from 'read-pkg-up';\nimport type { BuildOptions } from '../build';\nimport { getPackageManager } from './managers';\n\n/**\n * From V5 this will be imported from the package.json of `@strapi/strapi`.\n */\nconst PEER_DEPS = {\n react: '^18.0.0',\n 'react-dom': '^18.0.0',\n 'react-router-dom': '^5.2.0',\n 'styled-components': '^5.2.1',\n};\n\ninterface CheckRequiredDependenciesResult {\n didInstall: boolean;\n}\n\ninterface DepToInstall {\n name: string;\n wantedVersion: string;\n declaredVersion?: never;\n}\n\n/**\n * Checks the user's project that it has declared and installed the required dependencies\n * needed by the Strapi admin project. Whilst generally speaking most modules will be\n * declared by the actual packages there are some packages where you only really want one of\n * and thus they are declared as peer dependencies – react / styled-components / etc.\n *\n * If these deps are not installed or declared, then we prompt the user to correct this. In\n * V4 this is not a hard requirement, but in V5 it will be. Might as well get people started now.\n */\nconst checkRequiredDependencies = async ({\n cwd,\n logger,\n ignorePrompts,\n}: Pick<\n BuildOptions,\n 'cwd' | 'logger' | 'ignorePrompts'\n>): Promise<CheckRequiredDependenciesResult> => {\n const pkg = await readPkgUp({ cwd });\n\n if (!pkg) {\n throw new Error(`Could not find package.json at path: ${cwd}`);\n }\n\n logger.debug('Loaded package.json:', os.EOL, pkg.packageJson);\n\n interface DepToReview {\n name: string;\n wantedVersion: string;\n declaredVersion: string;\n }\n\n /**\n * Run through each of the peer deps and figure out if they need to be\n * installed or they need their version checked against.\n */\n const { install, review } = Object.entries(PEER_DEPS).reduce<{\n install: DepToInstall[];\n review: DepToReview[];\n }>(\n (acc, [name, version]) => {\n if (!pkg.packageJson.dependencies) {\n throw new Error(`Could not find dependencies in package.json at path: ${cwd}`);\n }\n\n const declaredVersion = pkg.packageJson.dependencies[name];\n\n if (!declaredVersion) {\n acc.install.push({\n name,\n wantedVersion: version,\n });\n } else {\n acc.review.push({\n name,\n wantedVersion: version,\n declaredVersion,\n });\n }\n\n return acc;\n },\n {\n install: [],\n review: [],\n }\n );\n\n if (install.length > 0) {\n logger.info(\n 'The Strapi admin needs to install the following dependencies:',\n os.EOL,\n install.map(({ name, wantedVersion }) => ` - ${name}@${wantedVersion}`).join(os.EOL)\n );\n\n /**\n * temporary until V5 when we _will_ be enforcing these dependencies as required.\n */\n if (process.env.NODE_ENV !== 'development' || ignorePrompts) {\n return { didInstall: false };\n }\n\n /**\n * This prompt can be removed in V5 & therefore the code underneath can be refactored to\n * only install the deps and return that we installed deps.\n */\n const { install: installAns } = await inquirer.prompt({\n type: 'confirm',\n name: 'install',\n default: true,\n message:\n 'Would you like to install these dependencies now? These are not required but are recommended, from V5 these will be required.',\n });\n\n if (installAns) {\n await installDependencies(install, {\n cwd,\n logger,\n });\n\n const [file, ...args] = process.argv;\n\n /**\n * Re-run the same command after installation e.g. strapi build because the yarn.lock might\n * not be the same and could break installations. It's not the best solution, but it works.\n */\n await execa(file, args, { cwd, stdio: 'inherit' });\n return { didInstall: true };\n } else {\n return { didInstall: false };\n }\n }\n\n if (review.length) {\n const errors: string[] = [];\n\n for (const dep of review) {\n // The version specified in package.json could be incorrect, eg `foo`\n let minDeclaredVersion: SemVer | null = null;\n try {\n minDeclaredVersion = semver.minVersion(dep.declaredVersion);\n } catch (err) {\n // Intentional fall-through (variable will be left as null, throwing below)\n }\n\n if (!minDeclaredVersion) {\n errors.push(\n `The declared dependency, ${dep.name} has an invalid version in package.json: ${dep.declaredVersion}`\n );\n } else if (!semver.satisfies(minDeclaredVersion, dep.wantedVersion)) {\n /**\n * The delcared version should be semver compatible with our required version\n * of the dependency. If it's not, we should advise the user to change it.\n */\n logger.warn(\n [\n `Declared version of ${dep.name} (${minDeclaredVersion}) is not compatible with the version required by Strapi (${dep.wantedVersion}).`,\n 'You may experience issues, we recommend you change this.',\n ].join(os.EOL)\n );\n }\n\n const installedVersion = await getModuleVersion(dep.name, cwd);\n\n if (!installedVersion) {\n /**\n * TODO: when we know the packageManager we can advise the actual install command.\n */\n errors.push(\n `The declared dependency, ${dep.name} is not installed. You should install before re-running this command`\n );\n } else if (!semver.satisfies(installedVersion, dep.wantedVersion)) {\n logger.warn(\n [\n `Declared version of ${dep.name} (${installedVersion}) is not compatible with the version required by Strapi (${dep.wantedVersion}).`,\n 'You may experience issues, we recommend you change this.',\n ].join(os.EOL)\n );\n }\n }\n\n if (errors.length > 0 && process.env.NODE_ENV === 'development') {\n throw new Error(`${os.EOL}- ${errors.join(`${os.EOL}- `)}`);\n }\n }\n\n return { didInstall: false };\n};\n\nconst getModule = async (name: string, cwd: string): Promise<PackageJson | null> => {\n const modulePackagePath = resolveFrom.silent(cwd, path.join(name, 'package.json'));\n if (!modulePackagePath) {\n return null;\n }\n const file = await fs.readFile(modulePackagePath, 'utf8').then((res) => JSON.parse(res));\n\n return file;\n};\n\nconst getModuleVersion = async (name: string, cwd: string): Promise<string | null> => {\n const pkg = await getModule(name, cwd);\n\n return pkg?.version || null;\n};\n\nconst installDependencies = async (\n install: DepToInstall[],\n { cwd, logger }: Pick<BuildOptions, 'cwd' | 'logger'>\n) => {\n const packageManager = getPackageManager();\n\n if (!packageManager) {\n logger.error(\n 'Could not find a supported package manager, please install the dependencies manually.'\n );\n process.exit(1);\n }\n\n const execOptions: CommonOptions<'utf8'> = {\n encoding: 'utf8',\n cwd,\n stdio: 'inherit',\n };\n\n const packages = install.map(({ name, wantedVersion }) => `${name}@${wantedVersion}`);\n\n let result: ExecaReturnValue<string> | undefined;\n\n if (packageManager === 'npm') {\n const npmArgs = ['install', '--legacy-peer-deps', '--save', ...packages];\n logger.info(`Running 'npm ${npmArgs.join(' ')}'`);\n result = await execa('npm', npmArgs, execOptions);\n } else if (packageManager === 'yarn') {\n const yarnArgs = ['add', ...packages];\n logger.info(`Running 'yarn ${yarnArgs.join(' ')}'`);\n result = await execa('yarn', yarnArgs, execOptions);\n } else if (packageManager === 'pnpm') {\n const pnpmArgs = ['add', '--save-prod', ...packages];\n logger.info(`Running 'pnpm ${pnpmArgs.join(' ')}'`);\n result = await execa('pnpm', pnpmArgs, execOptions);\n }\n\n if (result?.exitCode || result?.failed) {\n throw new Error('Package installation failed');\n }\n};\n\nexport { checkRequiredDependencies, getModule };\nexport type { CheckRequiredDependenciesResult, PackageJson };\n","const styles = `\n.strapi--root {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n background: #fff;\n}\n\n.strapi--no-js {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n font-family: helvetica, arial, sans-serif;\n}\n`;\n\n/**\n * @internal\n *\n * @description this belongs to our default document that we render.\n */\nconst NoJavascript = () => {\n return (\n <noscript>\n <div className=\"strapi--root\">\n <div className=\"strapi--no-js\">\n <style type=\"text/css\">{styles}</style>\n <h1>JavaScript disabled</h1>\n <p>\n Please <a href=\"https://www.enable-javascript.com/\">enable JavaScript</a> in your\n browser and reload the page to proceed.\n </p>\n </div>\n </div>\n </noscript>\n );\n};\n\nexport { NoJavascript };\n","import { NoJavascript } from './NoJavascript';\n\n/**\n * TODO: add favicons.........\n */\n\nconst globalStyles = `\n html,\n body,\n #strapi {\n height: 100%;\n }\n body {\n margin: 0;\n -webkit-font-smoothing: antialiased;\n }\n`;\n\n/**\n * @internal\n */\nconst DefaultDocument = () => {\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\" />\n <meta name=\"robots\" content=\"noindex\" />\n <meta name=\"referrer\" content=\"same-origin\" />\n\n <title>Strapi Admin</title>\n <style>{globalStyles}</style>\n </head>\n <body>\n <div id=\"strapi\" />\n <NoJavascript />\n </body>\n </html>\n );\n};\n\nexport { DefaultDocument };\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport outdent from 'outdent';\nimport { format } from 'prettier';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport camelCase from 'lodash/camelCase';\nimport { DefaultDocument as Document } from '../../admin/src/components/DefaultDocument';\n\nimport type { BuildContext } from './createBuildContext';\n\nconst getEntryModule = (ctx: BuildContext): string => {\n const pluginsObject = ctx.plugins\n .map(({ name, importName }) => `'${name}': ${importName}`)\n .join(',\\n');\n\n const pluginsImport = ctx.plugins\n .map(({ importName, modulePath }) => `import ${importName} from '${modulePath}';`)\n .join('\\n');\n\n return outdent`\n /**\n * This file was automatically generated by Strapi.\n * Any modifications made will be discarded.\n */\n ${pluginsImport}\n import { renderAdmin } from \"@strapi/strapi/admin\"\n\n ${\n ctx.customisations?.modulePath\n ? `import customisations from '${ctx.customisations.modulePath}'`\n : ''\n }\n\n renderAdmin(\n document.getElementById(\"strapi\"),\n {\n ${ctx.customisations?.modulePath ? 'customisations,' : ''}\n plugins: {\n ${pluginsObject}\n }\n })\n `;\n};\n\n/**\n * TODO: Here in the future we could add the ability\n * to load a user's Document component?\n */\nconst getDocumentHTML = async ({ logger }: Pick<BuildContext, 'logger'>) => {\n const result = renderToStaticMarkup(createElement(Document));\n logger.debug('Rendered the HTML');\n\n return outdent`<!DOCTYPE html>${result}`;\n};\n\nconst AUTO_GENERATED_WARNING = `\nThis file was automatically generated by Strapi.\nAny modifications made will be discarded.\n`.trim();\n\n/**\n * Because we now auto-generate the index.html file,\n * we should be clear that people _should not_ modify it.\n *\n * @internal\n */\nconst decorateHTMLWithAutoGeneratedWarning = (htmlTemplate: string): string =>\n htmlTemplate.replace(/<head/, `\\n<!--\\n${AUTO_GENERATED_WARNING}\\n-->\\n<head`);\n\nconst writeStaticClientFiles = async (ctx: BuildContext) => {\n /**\n * For everything to work effectively we create a client folder in `.strapi` at the cwd level.\n * We then use the function we need to \"createAdmin\" as well as generate the Document index.html as well.\n *\n * All this links together an imaginary \"src/index\" that then allows vite to correctly build the admin panel.\n */\n\n await fs.mkdir(ctx.runtimeDir, { recursive: true });\n ctx.logger.debug('Created the runtime directory');\n\n const indexHtml = decorateHTMLWithAutoGeneratedWarning(\n await getDocumentHTML({ logger: ctx.logger })\n );\n\n await fs.writeFile(\n path.join(ctx.runtimeDir, 'index.html'),\n format(indexHtml, {\n parser: 'html',\n })\n );\n ctx.logger.debug('Wrote the index.html file');\n await fs.writeFile(\n path.join(ctx.runtimeDir, 'app.js'),\n format(getEntryModule(ctx), {\n parser: 'babel',\n })\n );\n ctx.logger.debug('Wrote the app.js file');\n};\n\nexport { writeStaticClientFiles };\n","import path from 'path';\nimport findRoot from 'find-root';\nimport type { StrapiMonorepo } from '../core/monorepo';\n\n/**\n * @deprecated we will not support aliasing dependencies from V5.\n */\nconst adminPackageAliases = [\n '@strapi/design-system',\n '@strapi/helper-plugin',\n '@strapi/icons',\n 'date-fns',\n 'formik',\n 'history',\n 'immer',\n 'qs',\n 'lodash',\n 'react',\n 'react-dnd',\n 'react-dnd-html5-backend',\n 'react-dom',\n 'react-error-boundary',\n 'react-helmet',\n 'react-is',\n 'react-intl',\n 'react-query',\n 'react-redux',\n 'react-router-dom',\n 'react-window',\n 'react-select',\n 'redux',\n 'reselect',\n 'styled-components',\n 'yup',\n] as const;\n\n/**\n * @deprecated we will not support aliasing dependencies from V5.\n */\nconst getAdminDependencyAliases = (monorepo?: StrapiMonorepo) =>\n adminPackageAliases\n .filter(\n (moduleName) => !monorepo?.path || (monorepo.path && moduleName !== '@strapi/helper-plugin')\n )\n .reduce((acc, moduleName) => {\n /**\n * We use `findRoot` instead of `resolveFrom` here because we don't want to\n * choose a particular file e.g. the CJS version over the ESM because the\n * bundler should decide this, so insted find-root is more appropriate.\n *\n * When we remove these aliases in V5 we can also remove the `find-root` package.\n */\n acc[`${moduleName}$`] = findRoot(require.resolve(moduleName));\n return acc;\n }, {} as Record<string, string>);\n\n/**\n * The path mappings/aliases used by various tools in the monorepo to map imported modules to\n * source files in order to speed up rebuilding and avoid having a separate watcher process to build\n * from `src` to `lib`.\n *\n * This file is currently read by:\n * - Webpack when running the dev server (only when running in this monorepo)\n */\nconst devAliases: Record<string, string> = {\n '@strapi/admin/strapi-admin': './packages/core/admin/admin/src',\n '@strapi/content-type-builder/strapi-admin': './packages/core/content-type-builder/admin/src',\n '@strapi/email/strapi-admin': './packages/core/email/admin/src',\n '@strapi/upload/strapi-admin': './packages/core/upload/admin/src',\n '@strapi/plugin-color-picker/strapi-admin': './packages/plugins/color-picker/admin/src',\n '@strapi/plugin-documentation/strapi-admin': './packages/plugins/documentation/admin/src',\n '@strapi/plugin-graphql/strapi-admin': './packages/plugins/graphql/admin/src',\n '@strapi/plugin-i18n/strapi-admin': './packages/plugins/i18n/admin/src',\n '@strapi/plugin-sentry/strapi-admin': './packages/plugins/sentry/admin/src',\n '@strapi/plugin-users-permissions/strapi-admin': './packages/plugins/users-permissions/admin/src',\n '@strapi/helper-plugin': './packages/core/helper-plugin/src',\n};\n\nconst getAliases = (cwd: string, monorepo?: StrapiMonorepo) => {\n const adminAliases = getAdminDependencyAliases(monorepo);\n const monorepoAliases = monorepo\n ? Object.fromEntries(\n Object.entries(devAliases).map(([key, modulePath]) => {\n return [key, path.join(monorepo.path, modulePath)];\n })\n )\n : {};\n\n return {\n ...adminAliases,\n ...monorepoAliases,\n };\n};\n\nexport { getAliases };\n","import path from 'path';\nimport readPkgUp from 'read-pkg-up';\n\ninterface StrapiMonorepo {\n path: string;\n}\n\n/**\n * Load information about the strapi CMS monorepo (if applicable)\n *\n * @internal\n */\nasync function loadStrapiMonorepo(cwd: string): Promise<StrapiMonorepo | undefined> {\n let p = cwd;\n\n while (p !== '/') {\n const readResult = await readPkgUp({ cwd: p });\n\n if (!readResult) {\n return undefined;\n }\n\n if (readResult.packageJson.isStrapiMonorepo) {\n return { path: path.dirname(readResult.path) };\n }\n\n p = path.dirname(path.dirname(readResult.path));\n }\n\n return undefined;\n}\n\nexport { loadStrapiMonorepo };\nexport type { StrapiMonorepo };\n","import path from 'node:path';\nimport { access } from 'node:fs/promises';\nimport { register } from 'esbuild-register/dist/node';\n\n/**\n * @internal\n */\nconst pathExists = async (path: string) => {\n try {\n await access(path);\n return true;\n } catch (error) {\n return false;\n }\n};\n\n/**\n * @internal\n */\nconst loadFile = async (path: string): Promise<undefined | any> => {\n if (await pathExists(path)) {\n const esbuildOptions: Parameters<typeof register>[0] = {\n extensions: ['.js', '.mjs', '.ts'],\n };\n\n const { unregister } = register(esbuildOptions);\n\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const mod = require(path);\n\n unregister();\n\n /**\n * handles esm or cjs exporting.\n */\n const file = mod?.default || mod || undefined;\n\n return file;\n }\n\n return undefined;\n};\n\n/**\n * @internal\n *\n * @description Converts a system path to a module path mainly for `Windows` systems.\n * where the path separator is `\\` instead of `/`, on linux systems the path separator\n * is identical to the module path separator.\n */\nconst convertSystemPathToModulePath = (sysPath: string) => {\n if (process.platform === 'win32') {\n return sysPath.split(path.sep).join(path.posix.sep);\n } else {\n return sysPath;\n }\n};\n\n/**\n * @internal\n *\n * @description Converts a module path to a system path, again largely used for Windows systems.\n * The original use case was plugins where the resolve path was in module format but we want to\n * have it relative to the runtime directory.\n */\nconst convertModulePathToSystemPath = (modulePath: string) => {\n if (process.platform === 'win32') {\n return modulePath.split(path.posix.sep).join(path.sep);\n } else {\n return modulePath;\n }\n};\n\nexport { pathExists, loadFile, convertSystemPathToModulePath, convertModulePathToSystemPath };\n","import browserslistToEsbuild from 'browserslist-to-esbuild';\nimport { ESBuildMinifyPlugin } from 'esbuild-loader';\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\nimport MiniCssExtractPlugin from 'mini-css-extract-plugin';\nimport ForkTsCheckerPlugin from 'fork-ts-checker-webpack-plugin';\nimport { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';\nimport crypto from 'node:crypto';\nimport path from 'node:path';\nimport { Configuration, DefinePlugin, HotModuleReplacementPlugin } from 'webpack';\nimport ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';\n\nimport { getAliases } from './aliases';\nimport { loadStrapiMonorepo } from '../core/monorepo';\nimport type { BuildContext } from '../createBuildContext';\nimport { loadFile } from '../core/files';\n\nconst resolveBaseConfig = async (ctx: BuildContext) => {\n const monorepo = await loadStrapiMonorepo(ctx.cwd);\n\n const target = browserslistToEsbuild(ctx.target);\n\n return {\n experiments: {\n topLevelAwait: true,\n },\n entry: {\n main: [`./${ctx.entry}`],\n },\n resolve: {\n alias: getAliases(ctx.cwd, monorepo),\n extensions: ['.js', '.jsx', '.react.js', '.ts', '.tsx'],\n },\n module: {\n rules: [\n {\n test: /\\.(ts|tsx)$/,\n loader: require.resolve('esbuild-loader'),\n options: {\n loader: 'tsx',\n target,\n jsx: 'automatic',\n },\n },\n {\n test: /\\.(js|jsx|mjs)$/,\n use: {\n loader: require.resolve('esbuild-loader'),\n options: {\n loader: 'jsx',\n target,\n jsx: 'automatic',\n },\n },\n },\n {\n test: /\\.m?js/,\n resolve: {\n fullySpecified: false,\n },\n },\n {\n test: /\\.css$/i,\n use: [require.resolve('style-loader'), require.resolve('css-loader')],\n },\n {\n test: /\\.(svg|eot|otf|ttf|woff|woff2)$/,\n type: 'asset/resource',\n },\n {\n test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/, /\\.ico$/],\n type: 'asset',\n parser: {\n dataUrlCondition: {\n maxSize: 1000,\n },\n },\n },\n {\n test: /\\.(mp4|webm)$/,\n type: 'asset',\n parser: {\n dataUrlCondition: {\n maxSize: 10000,\n },\n },\n },\n ],\n },\n plugins: [\n new HtmlWebpackPlugin({\n inject: true,\n template: path.resolve(ctx.runtimeDir, 'index.html'),\n }),\n new DefinePlugin(\n Object.entries(ctx.env).reduce<Record<string, string>>((acc, [key, value]) => {\n acc[`process.env.${key}`] = JSON.stringify(value);\n return acc;\n }, {})\n ),\n ctx.tsconfig &&\n new ForkTsCheckerPlugin({\n typescript: {\n configFile: ctx.tsconfig.path,\n configOverwrite: {\n compilerOptions: {\n sourceMap: ctx.options.sourcemaps,\n },\n },\n },\n }),\n ].filter(Boolean),\n };\n};\n\nconst resolveDevelopmentConfig = async (ctx: BuildContext): Promise<Configuration> => {\n const baseConfig = await resolveBaseConfig(ctx);\n\n return {\n ...baseConfig,\n cache: {\n type: 'filesystem',\n // version cache when there are changes to aliases\n buildDependencies: {\n config: [__filename],\n },\n version: crypto\n .createHash('md5')\n .update(Object.entries(baseConfig.resolve.alias).join())\n .digest('hex'),\n },\n entry: {\n ...baseConfig.entry,\n main: [\n `${require.resolve('webpack-hot-middleware/client')}?path=/__webpack_hmr`,\n ...baseConfig.entry.main,\n ],\n },\n stats: 'errors-warnings',\n mode: 'development',\n devtool: 'inline-source-map',\n output: {\n filename: '[name].js',\n path: ctx.distPath,\n publicPath: ctx.basePath,\n },\n infrastructureLogging: {\n level: 'error',\n },\n plugins: [\n ...baseConfig.plugins,\n new HotModuleReplacementPlugin(),\n new ReactRefreshWebpackPlugin(),\n ],\n };\n};\n\nconst resolveProductionConfig = async (ctx: BuildContext): Promise<Configuration> => {\n const target = browserslistToEsbuild(ctx.target);\n\n const baseConfig = await resolveBaseConfig(ctx);\n\n return {\n ...baseConfig,\n stats: 'errors-only',\n mode: 'production',\n bail: true,\n devtool: ctx.options.sourcemaps ? 'source-map' : false,\n output: {\n path: ctx.distPath,\n publicPath: ctx.basePath,\n // Utilize long-term caching by adding content hashes (not compilation hashes)\n // to compiled assets for production\n filename: '[name].[contenthash:8].js',\n chunkFilename: '[name].[contenthash:8].chunk.js',\n },\n optimization: {\n minimize: ctx.options.minify,\n minimizer: [\n new ESBuildMinifyPlugin({\n target,\n css: true, // Apply minification to CSS assets\n }),\n ],\n moduleIds: 'deterministic',\n runtimeChunk: true,\n },\n // @ts-expect-error\n plugins: [\n ...baseConfig.plugins,\n new MiniCssExtractPlugin({\n filename: '[name].[chunkhash].css',\n chunkFilename: '[name].[chunkhash].chunkhash.css',\n ignoreOrder: true,\n }),\n ctx.options.stats && new BundleAnalyzerPlugin(),\n ].filter(Boolean),\n };\n};\n\nconst USER_CONFIGS = ['webpack.config.js', 'webpack.config.mjs', 'webpack.config.ts'];\n\ntype UserWebpackConfig = (config: Configuration, webpack: unknown) => Configuration;\n\nconst getUserConfig = async (ctx: BuildContext): Promise<UserWebpackConfig | undefined> => {\n for (const file of USER_CONFIGS) {\n const filePath = path.join(ctx.appDir, 'src', 'admin', file);\n const configFile = await loadFile(filePath);\n\n if (configFile) {\n return configFile;\n }\n }\n\n return undefined;\n};\n\nconst mergeConfigWithUserConfig = async (config: Configuration, ctx: BuildContext) => {\n const userConfig = await getUserConfig(ctx);\n\n if (userConfig) {\n if (typeof userConfig === 'function') {\n const webpack = await import('webpack');\n return userConfig(config, webpack);\n } else {\n ctx.logger.warn(\n `You've exported something other than a function from ${path.join(\n ctx.appDir,\n 'src',\n 'admin',\n 'webpack.config'\n )}, this will ignored.`\n );\n }\n }\n\n return config;\n};\n\nexport { resolveProductionConfig, resolveDevelopmentConfig, mergeConfigWithUserConfig };\n","import boxen from 'boxen';\nimport chalk from 'chalk';\nimport os from 'node:os';\n\nconst isError = (err: unknown): err is Error => err instanceof Error;\n\n/**\n * @description Handle unexpected errors. No, but really, your CLI should anticipate error cases.\n * If a user hits an error we don't expect, then we need to flag to them that this is not normal\n * and they should use the `--debug` flag to get more information (assuming you've implemented this\n * in your action).\n */\nconst handleUnexpectedError = (err: unknown) => {\n console.error(\n chalk.red(\n `[ERROR] `,\n 'There seems to be an unexpected error, try again with --debug for more information',\n os.EOL\n )\n );\n\n if (isError(err) && err.stack) {\n // eslint-disable-next-line no-console\n console.log(\n chalk.red(\n boxen(err.stack, {\n padding: 1,\n align: 'left',\n })\n )\n );\n }\n\n process.exit(1);\n};\n\nexport { handleUnexpectedError, isError };\n","import webpack from 'webpack';\n\nimport { mergeConfigWithUserConfig, resolveProductionConfig } from './config';\nimport { isError } from '../core/errors';\n\nimport type { BuildContext } from '../createBuildContext';\n\nconst build = async (ctx: BuildContext) =>\n new Promise(async (resolve, reject) => {\n const config = await resolveProductionConfig(ctx);\n const finalConfig = await mergeConfigWithUserConfig(config, ctx);\n\n ctx.logger.debug('Webpack config', finalConfig);\n\n webpack(finalConfig, (err, stats) => {\n if (stats) {\n if (stats.hasErrors()) {\n ctx.logger.error(\n stats.toString({\n chunks: false,\n colors: true,\n })\n );\n\n reject(false);\n } else if (ctx.options.stats) {\n ctx.logger.info(\n stats.toString({\n chunks: false,\n colors: true,\n })\n );\n }\n\n resolve(true);\n }\n\n if (err && isError(err)) {\n ctx.logger.error(err.message);\n reject(false);\n }\n });\n });\n\nexport { build };\n","import path from 'node:path';\nimport dotenv from 'dotenv';\nimport { pathExists } from './files';\n\n/**\n * This is the base of _any_ env set for a strapi project,\n * to build a strapi admin panel we require these env variables.\n */\ninterface DefaultEnv {\n ADMIN_PATH: string;\n STRAPI_ADMIN_BACKEND_URL: string;\n STRAPI_TELEMETRY_DISABLED: string;\n}\n\n/**\n * @internal\n *\n * @description Load the .env file if it exists\n */\nconst loadEnv = async (cwd: string) => {\n const pathToEnv = path.resolve(cwd, '.env');\n\n if (await pathExists(pathToEnv)) {\n dotenv.config({ path: pathToEnv });\n }\n};\n\n/**\n * @internal\n *\n * @description Get all the environment variables that start with `STRAPI_ADMIN_`\n */\nconst getStrapiAdminEnvVars = (defaultEnv: DefaultEnv): Record<string, string> => {\n return Object.keys(process.env)\n .filter((key) => key.toUpperCase().startsWith('STRAPI_ADMIN_'))\n .reduce((acc, key) => {\n acc[key] = process.env[key] as string;\n\n return acc;\n }, defaultEnv as unknown as Record<string, string>);\n};\n\nexport { getStrapiAdminEnvVars, loadEnv };\n","import os from 'node:os';\nimport path from 'node:path';\nimport fs from 'node:fs';\nimport camelCase from 'lodash/camelCase';\nimport { env } from '@strapi/utils';\nimport { getModule, PackageJson } from './dependencies';\nimport { convertModulePathToSystemPath, convertSystemPathToModulePath, loadFile } from './files';\nimport { BuildContext } from '../createBuildContext';\nimport { isError } from './errors';\n\ninterface LocalPluginMeta {\n name: string;\n /**\n * camelCased version of the plugin name\n */\n importName: string;\n /**\n * The path to the plugin, relative to the app's root directory\n * in system format\n */\n path: string;\n /**\n * The path to the plugin, relative to the runtime directory\n * in module format (i.e. with forward slashes) because thats\n * where it should be used as an import\n */\n modulePath: string;\n type: 'local';\n}\n\ninterface ModulePluginMeta {\n name: string;\n /**\n * camelCased version of the plugin name\n */\n importName: string;\n /**\n * Modules don't have a path because we never resolve them to their node_modules\n * because we simply do not require it.\n */\n path?: never;\n /**\n * The path to the plugin, relative to the app's root directory\n * in module format (i.e. with forward slashes)\n */\n modulePath: string;\n type: 'module';\n}\n\ntype PluginMeta = LocalPluginMeta | ModulePluginMeta;\n\ninterface StrapiPlugin extends PackageJson {\n strapi: {\n description?: string;\n displayName?: string;\n kind: 'plugin';\n name?: string;\n required?: boolean;\n };\n}\n\nconst validatePackageHasStrapi = (\n pkg: PackageJson\n): pkg is PackageJson & { strapi: Record<string, unknown> } =>\n 'strapi' in pkg &&\n typeof pkg.strapi === 'object' &&\n !Array.isArray(pkg.strapi) &&\n pkg.strapi !== null;\n\nconst validatePackageIsPlugin = (pkg: PackageJson): pkg is StrapiPlugin =>\n validatePackageHasStrapi(pkg) && pkg.strapi.kind === 'plugin';\n\nconst getEnabledPlugins = async ({\n cwd,\n logger,\n runtimeDir,\n strapi,\n}: Pick<BuildContext, 'cwd' | 'logger' | 'strapi' | 'runtimeDir'>): Promise<\n Record<string, PluginMeta>\n> => {\n const plugins: Record<string, PluginMeta> = {};\n\n /**\n * This is the list of dependencies that are installed in the user's project.\n * It will include libraries like \"react\", so we need to collect the ones that\n * are plugins.\n */\n const deps = strapi.config.get('info.dependencies', {});\n\n logger.debug(\"Dependencies from user's project\", os.EOL, deps);\n\n for (const dep of Object.keys(deps)) {\n const pkg = await getModule(dep, cwd);\n\n if (pkg && validatePackageIsPlugin(pkg)) {\n const name = pkg.strapi.name || pkg.name;\n\n if (!name) {\n /**\n * Unlikely to happen, but you never know.\n */\n throw Error(\n \"You're trying to import a plugin that doesn't have a name – check the package.json of that plugin!\"\n );\n }\n\n plugins[name] = {\n name,\n importName: camelCase(name),\n type: 'module',\n modulePath: dep,\n };\n }\n }\n\n const userPluginsFile = await loadUserPluginsFile(strapi.dirs.app.config);\n\n logger.debug(\"User's plugins file\", os.EOL, userPluginsFile);\n\n for (const [userPluginName, userPluginConfig] of Object.entries(userPluginsFile)) {\n if (userPluginConfig.enabled && userPluginConfig.resolve) {\n const sysPath = convertModulePathToSystemPath(userPluginConfig.resolve);\n plugins[userPluginName] = {\n name: userPluginName,\n importName: camelCase(userPluginName),\n type: 'local',\n /**\n * User plugin paths are resolved from the entry point\n * of the app, because that's how you import them.\n */\n modulePath: convertSystemPathToModulePath(path.relative(runtimeDir, sysPath)),\n path: sysPath,\n };\n }\n }\n\n return plugins;\n};\n\nconst PLUGIN_CONFIGS = ['plugins.js', 'plugins.mjs', 'plugins.ts'];\n\ntype UserPluginConfigFile = Record<string, { enabled: boolean; resolve: string }>;\n\nconst loadUserPluginsFile = async (root: string): Promise<UserPluginConfigFile> => {\n for (const file of PLUGIN_CONFIGS) {\n const filePath = path.join(root, file);\n const configFile = await loadFile(filePath);\n\n if (configFile) {\n /**\n * Configs can be a function or they can be just an object!\n */\n return typeof configFile === 'function' ? configFile({ env }) : configFile;\n }\n }\n\n return {};\n};\n\nconst getMapOfPluginsWithAdmin = (plugins: Record<string, PluginMeta>) =>\n Object.values(plugins)\n .filter((plugin) => {\n if (!plugin) {\n return false;\n }\n\n /**\n * There are two ways a plugin should be imported, either it's local to the strapi app,\n * or it's an actual npm module that's installed and resolved via node_modules.\n *\n * We first check if the plugin is local to the strapi app, using a regular `fs.existsSync` because\n * the pathToPlugin will be relative i.e. `/Users/my-name/strapi-app/src/plugins/my-plugin`.\n *\n * If the file doesn't exist well then it's probably a node_module, so instead we use `require.resolve`\n * which will resolve the path to the module in node_modules. If it fails with the specific code `MODULE_NOT_FOUND`\n * then it doesn't have an admin part to the package.\n */\n try {\n const isLocalPluginWithLegacyAdminFile =\n plugin.path && fs.existsSync(path.join(plugin.path, 'strapi-admin.js'));\n\n if (!isLocalPluginWithLegacyAdminFile) {\n const isModuleWithFE = require.resolve(`${plugin.modulePath}/strapi-admin`);\n\n return isModuleWithFE;\n }\n\n return isLocalPluginWithLegacyAdminFile;\n } catch (err) {\n if (isError(err) && 'code' in err && err.code === 'MODULE_NOT_FOUND') {\n /**\n * the plugin does not contain FE code, so we\n * don't want to import it anyway\n */\n return false;\n }\n\n throw err;\n }\n })\n .map((plugin) => ({\n ...plugin,\n modulePath: `${plugin.modulePath}/strapi-admin`,\n }));\n\nexport { getEnabledPlugins, getMapOfPluginsWithAdmin };\nexport type { PluginMeta, LocalPluginMeta, ModulePluginMeta };\n","import path from 'node:path';\nimport { convertSystemPathToModulePath, pathExists } from '../core/files';\nimport { BuildContext } from '../createBuildContext';\n\nconst ADMIN_APP_FILES = ['app.js', 'app.mjs', 'app.ts', 'app.jsx', 'app.tsx'];\n\ninterface AdminCustomisations {\n config?: {\n locales?: string[];\n };\n bootstrap?: Function;\n}\n\ninterface AppFile {\n /**\n * The system path to the file\n */\n path: string;\n /**\n * The module path to the file i.e. how you would import it\n */\n modulePath: string;\n}\n\nconst loadUserAppFile = async ({\n runtimeDir,\n appDir,\n}: Pick<BuildContext, 'appDir' | 'runtimeDir'>): Promise<AppFile | undefined> => {\n for (const file of ADMIN_APP_FILES) {\n const filePath = path.join(appDir, 'src', 'admin', file);\n\n if (await pathExists(filePath)) {\n return {\n path: filePath,\n modulePath: convertSystemPathToModulePath(path.relative(runtimeDir, filePath)),\n };\n }\n }\n\n return undefined;\n};\n\nexport { loadUserAppFile };\nexport type { AdminCustomisations, AppFile };\n","import os from 'node:os';\nimport path from 'node:path';\nimport fs from 'node:fs/promises';\nimport browserslist from 'browserslist';\nimport strapiFactory, { CLIContext } from '@strapi/strapi';\nimport { getConfigUrls } from '@strapi/utils';\n\nimport { getStrapiAdminEnvVars, loadEnv } from './core/env';\n\nimport type { BuildOptions } from './build';\nimport { DevelopOptions } from './develop';\nimport { PluginMeta, getEnabledPlugins, getMapOfPluginsWithAdmin } from './core/plugins';\nimport { Strapi } from '@strapi/types';\nimport { AppFile, loadUserAppFile } from './core/admin-customisations';\n\ninterface BuildContext {\n /**\n * The absolute path to the app directory defined by the Strapi instance\n */\n appDir: string;\n /**\n * If a user is deploying the project under a nested public path, we use\n * this path so all asset paths will be rewritten accordingly\n */\n basePath: string;\n /**\n * The customisations defined by the user in their app.js file\n */\n customisations?: AppFile;\n /**\n * The current working directory\n */\n cwd: string;\n /**\n * The absolute path to the dist directory\n */\n distPath: string;\n /**\n * The relative path to the dist directory\n */\n distDir: string;\n /**\n * The absolute path to the entry file\n */\n entry: string;\n /**\n * The environment variables to be included in the JS bundle\n */\n env: Record<string, string>;\n logger: CLIContext['logger'];\n /**\n * The build options\n */\n options: Pick<BuildOptions, 'minify' | 'sourcemaps' | 'stats'> & Pick<DevelopOptions, 'open'>;\n /**\n * The plugins to be included in the JS bundle\n * incl. internal plugins, third party plugins & local plugins\n */\n plugins: PluginMeta[];\n /**\n * The absolute path to the runtime directory\n */\n runtimeDir: string;\n /**\n * The Strapi instance\n */\n strapi: Strapi;\n /**\n * The browserslist target either loaded from the user's workspace or falling back to the default\n */\n target: string[];\n tsconfig?: CLIContext['tsconfig'];\n}\n\ninterface CreateBuildContextArgs extends CLIContext {\n strapi?: Strapi;\n options?: BuildContext['options'];\n}\n\nconst DEFAULT_BROWSERSLIST = [\n 'last 3 major versions',\n 'Firefox ESR',\n 'last 2 Opera versions',\n 'not dead',\n];\n\nconst createBuildContext = async ({\n cwd,\n logger,\n tsconfig,\n strapi,\n options = {},\n}: CreateBuildContextArgs) => {\n /**\n * If you make a new strapi instance when one already exists,\n * you will overwrite the global and the app will _most likely_\n * crash and die.\n */\n const strapiInstance =\n strapi ??\n strapiFactory({\n // Directories\n appDir: cwd,\n distDir: tsconfig?.config.options.outDir ?? '',\n // Options\n autoReload: true,\n serveAdminPanel: false,\n });\n\n const { serverUrl, adminPath } = getConfigUrls(strapiInstance.config, true);\n\n const appDir = strapiInstance.dirs.app.root;\n\n await loadEnv(cwd);\n\n const env = getStrapiAdminEnvVars({\n ADMIN_PATH: adminPath,\n STRAPI_ADMIN_BACKEND_URL: serverUrl,\n STRAPI_TELEMETRY_DISABLED: String(strapiInstance.telemetry.isDisabled),\n });\n\n const envKeys = Object.keys(env);\n\n if (envKeys.length > 0) {\n logger.info(\n [\n 'Including the following ENV variables as part of the JS bundle:',\n ...envKeys.map((key) => ` - ${key}`),\n ].join(os.EOL)\n );\n }\n\n const distPath = path.join(strapiInstance.dirs.dist.root, 'build');\n const distDir = path.relative(cwd, distPath);\n\n /**\n * If the distPath already exists, clean it\n */\n try {\n logger.debug(`Cleaning dist folder: ${distPath}`);\n await fs.rm(distPath, { recursive: true, force: true });\n logger.debug('Cleaned dist folder');\n } catch {\n // do nothing, it will fail if the folder does not exist\n logger.debug('There was no dist folder to clean');\n }\n\n const runtimeDir = path.join(cwd, '.strapi', 'client');\n const entry = path.relative(cwd, path.join(runtimeDir, 'app.js'));\n\n const plugins = await getEnabledPlugins({ cwd, logger, runtimeDir, strapi: strapiInstance });\n\n logger.debug('Enabled plugins', os.EOL, plugins);\n\n const pluginsWithFront = getMapOfPluginsWithAdmin(plugins);\n\n logger.debug('Enabled plugins with FE', os.EOL, plugins);\n\n const target = browserslist.loadConfig({ path: cwd }) ?? DEFAULT_BROWSERSLIST;\n\n const customisations = await loadUserAppFile({ appDir, runtimeDir });\n\n const buildContext = {\n appDir,\n basePath: `${adminPath}/`,\n customisations,\n cwd,\n distDir,\n distPath,\n entry,\n env,\n logger,\n options,\n plugins: pluginsWithFront,\n runtimeDir,\n strapi: strapiInstance,\n target,\n tsconfig,\n } satisfies BuildContext;\n\n return buildContext;\n};\n\nexport { createBuildContext };\nexport type { BuildContext, CreateBuildContextArgs };\n","import { performance } from 'perf_hooks';\n\nexport interface TimeMeasurer {\n start: (name: string) => void;\n end: (name: string) => number;\n getTimings: () => Record<string, number>;\n}\n\nexport function getTimer(): TimeMeasurer {\n const timings: Record<string, number> = {};\n const startTimes: Record<string, number> = {};\n\n function start(name: string): void {\n if (typeof startTimes[name] !== 'undefined') {\n throw new Error(`Timer \"${name}\" already started, cannot overwrite`);\n }\n\n startTimes[name] = performance.now();\n }\n\n function end(name: string): number {\n if (typeof startTimes[name] === 'undefined') {\n throw new Error(`Timer \"${name}\" never started, cannot end`);\n }\n\n timings[name] = performance.now() - startTimes[name];\n return timings[name];\n }\n\n return { start, end, getTimings: () => timings };\n}\n","import * as tsUtils from '@strapi/typescript-utils';\nimport { checkRequiredDependencies } from './core/dependencies';\nimport { writeStaticClientFiles } from './staticFiles';\nimport { build as buildWebpack } from './webpack/build';\nimport { createBuildContext } from './createBuildContext';\n\nimport EE from '@strapi/strapi/dist/utils/ee';\nimport { getTimer } from './core/timer';\n\nimport type { CLIContext } from '@strapi/strapi';\n\ninterface BuildOptions extends CLIContext {\n /**\n * @default false\n */\n ignorePrompts?: boolean;\n /**\n * Minify the output\n *\n * @default true\n */\n minify?: boolean;\n /**\n * Generate sourcemaps – useful for debugging bugs in the admin panel UI.\n */\n sourcemaps?: boolean;\n /**\n * Print stats for build\n */\n stats?: boolean;\n}\n\n/**\n * @example `$ strapi build`\n *\n * @description Builds the admin panel of the strapi application.\n */\nconst build = async ({ logger, cwd, tsconfig, ignorePrompts, ...options }: BuildOptions) => {\n const timer = getTimer();\n\n const { didInstall } = await checkRequiredDependencies({ cwd, logger, ignorePrompts }).catch(\n (err) => {\n logger.error(err.message);\n process.exit(1);\n }\n );\n\n if (didInstall) {\n return;\n }\n\n if (tsconfig?.config) {\n timer.start('compilingTS');\n const compilingTsSpinner = logger.spinner(`Compiling TS`).start();\n\n tsUtils.compile(cwd, { configOptions: { ignoreDiagnostics: false } });\n\n const compilingDuration = timer.end('compilingTS');\n compilingTsSpinner.text = `Compiling TS (${compilingDuration}ms)`;\n compilingTsSpinner.succeed();\n }\n\n timer.start('createBuildContext');\n const contextSpinner = logger.spinner(`Building build context`).start();\n console.log('');\n\n const ctx = await createBuildContext({\n cwd,\n logger,\n tsconfig,\n options,\n });\n const contextDuration = timer.end('createBuildContext');\n contextSpinner.text = `Building build context (${contextDuration}ms)`;\n contextSpinner.succeed();\n\n timer.start('buildAdmin');\n const buildingSpinner = logger.spinner(`Building admin panel`).start();\n console.log('');\n\n try {\n EE.init(cwd);\n\n await writeStaticClientFiles(ctx);\n await buildWebpack(ctx);\n\n const buildDuration = timer.end('buildAdmin');\n buildingSpinner.text = `Building admin panel (${buildDuration}ms)`;\n buildingSpinner.succeed();\n } catch (err) {\n buildingSpinner.fail();\n throw err;\n }\n};\n\nexport { build };\nexport type { BuildOptions };\n","import os from 'node:os';\nimport path from 'node:path';\nimport { promisify } from 'node:util';\nimport webpackDevMiddleware from 'webpack-dev-middleware';\nimport webpackHotMiddleware from 'webpack-hot-middleware';\nimport { webpack } from 'webpack';\nimport type { BuildContext } from '../createBuildContext';\nimport { mergeConfigWithUserConfig, resolveDevelopmentConfig } from './config';\nimport { Common, Strapi } from '@strapi/types';\n\ninterface WebpackWatcher {\n close(): Promise<void>;\n}\n\nconst watch = async (ctx: BuildContext): Promise<WebpackWatcher> => {\n const config = await resolveDevelopmentConfig(ctx);\n const finalConfig = await mergeConfigWithUserConfig(config, ctx);\n\n ctx.logger.debug('Final webpack config:', os.EOL, finalConfig);\n\n return new Promise<WebpackWatcher>((res) => {\n const compiler = webpack(finalConfig);\n\n const devMiddleware = webpackDevMiddleware(compiler);\n\n // @ts-ignore\n const hotMiddleware = webpackHotMiddleware(compiler, {\n log: false,\n path: '/__webpack_hmr',\n });\n\n ctx.strapi.server.app.use((ctx, next) => {\n return new Promise((resolve, reject) => {\n hotMiddleware(ctx.req, ctx.res, (err) => {\n if (err) reject(err);\n else resolve(next());\n });\n });\n });\n\n ctx.strapi.server.app.use((context, next) => {\n // wait for webpack-dev-middleware to signal that the build is ready\n const ready = new Promise((resolve, reject) => {\n devMiddleware.waitUntilValid(() => {\n resolve(true);\n });\n });\n // tell webpack-dev-middleware to handle the request\n const init = new Promise((resolve) => {\n devMiddleware(\n context.req,\n {\n // @ts-expect-error\n end: (content) => {\n // eslint-disable-next-line no-param-reassign\n context.body = content;\n resolve(true);\n },\n getHeader: context.get.bind(context),\n // @ts-expect-error\n setHeader: context.set.bind(context),\n locals: context.state,\n },\n () => resolve(next())\n );\n });\n\n return Promise.all([ready, init]);\n });\n\n const serveAdmin: Common.MiddlewareHandler = async (ctx, next) => {\n await next();\n\n if (devMiddleware.context.outputFileSystem.createReadStream) {\n if (ctx.method !== 'HEAD' && ctx.method !== 'GET') {\n return;\n }\n\n if (ctx.body != null || ctx.status !== 404) {\n return;\n }\n\n const filename = path.resolve(finalConfig.output?.path!, 'index.html');\n ctx.type = 'html';\n ctx.body = devMiddleware.context.outputFileSystem.createReadStream(filename);\n }\n };\n\n ctx.strapi.server.routes([\n {\n method: 'GET',\n path: `${ctx.basePath}:path*`,\n handler: serveAdmin,\n config: { auth: false },\n },\n ]);\n\n devMiddleware.waitUntilValid(() => {\n res({\n async close() {\n await Promise.all([\n promisify(devMiddleware.close.bind(devMiddleware))(),\n hotMiddleware.close(),\n promisify(compiler.close.bind(compiler))(),\n ]);\n },\n });\n });\n });\n};\n\nexport { watch };\nexport type { WebpackWatcher };\n","import type { CLIContext } from '@strapi/strapi';\nimport * as tsUtils from '@strapi/typescript-utils';\nimport { joinBy } from '@strapi/utils';\nimport chokidar from 'chokidar';\nimport cluster from 'node:cluster';\n\nimport { getTimer } from './core/timer';\nimport { checkRequiredDependencies } from './core/dependencies';\nimport { createBuildContext } from './createBuildContext';\nimport { WebpackWatcher, watch as watchWebpack } from './webpack/watch';\nimport { build as buildWebpack } from './webpack/build';\n\nimport EE from '@strapi/strapi/dist/utils/ee';\nimport { writeStaticClientFiles } from './staticFiles';\nimport strapiFactory from '@strapi/strapi';\n\ninterface DevelopOptions extends CLIContext {\n /**\n * @default false\n */\n ignorePrompts?: boolean;\n polling?: boolean;\n open?: boolean;\n watchAdmin?: boolean;\n}\n\nconst develop = async ({\n cwd,\n polling,\n logger,\n tsconfig,\n ignorePrompts,\n watchAdmin,\n ...options\n}: DevelopOptions) => {\n const timer = getTimer();\n\n if (cluster.isPrimary) {\n const { didInstall } = await checkRequiredDependencies({ cwd, logger, ignorePrompts }).catch(\n (err) => {\n logger.error(err.message);\n process.exit(1);\n }\n );\n\n if (didInstall) {\n return;\n }\n\n /**\n * IF we're not watching the admin we're going to build it, this makes\n * sure that at least the admin is built for users & they can interact\n * with the application.\n */\n if (!watchAdmin) {\n timer.start('createBuildContext');\n const contextSpinner = logger.spinner(`Building build context`).start();\n console.log('');\n\n const ctx = await createBuildContext({\n cwd,\n logger,\n tsconfig,\n options,\n });\n const contextDuration = timer.end('createBuildContext');\n contextSpinner.text = `Building build context (${contextDuration}ms)`;\n contextSpinner.succeed();\n\n timer.start('creatingAdmin');\n const adminSpinner = logger.spinner(`Creating admin`).start();\n\n EE.init(cwd);\n await writeStaticClientFiles(ctx);\n await buildWebpack(ctx);\n\n const adminDuration = timer.end('creatingAdmin');\n adminSpinner.text = `Creating admin (${adminDuration}ms)`;\n adminSpinner.succeed();\n }\n\n cluster.on('message', async (worker, message) => {\n switch (message) {\n case 'reload': {\n logger.debug('cluster has the reload message, sending the worker kill message');\n worker.send('kill');\n break;\n }\n case 'killed': {\n logger.debug('cluster has the killed message, forking the cluster');\n cluster.fork();\n break;\n }\n case 'stop': {\n process.exit(1);\n break;\n }\n default:\n break;\n }\n });\n\n cluster.fork();\n }\n\n if (cluster.isWorker) {\n if (tsconfig?.config) {\n timer.start('compilingTS');\n const compilingTsSpinner = logger.spinner(`Compiling TS`).start();\n\n tsUtils.compile(cwd, { configOptions: { ignoreDiagnostics: false } });\n\n const compilingDuration = timer.end('compilingTS');\n compilingTsSpinner.text = `Compiling TS (${compilingDuration}ms)`;\n compilingTsSpinner.succeed();\n }\n\n const strapi = strapiFactory({\n appDir: cwd,\n distDir: tsconfig?.config.options.outDir ?? '',\n autoReload: true,\n serveAdminPanel: !watchAdmin,\n });\n\n let webpackWatcher: WebpackWatcher | undefined;\n\n /**\n * If we're watching the admin panel then we're going to attach the watcher\n * as a strapi middleware.\n */\n if (watchAdmin) {\n timer.start('createBuildContext');\n const contextSpinner = logger.spinner(`Building build context`).start();\n console.log('');\n\n const ctx = await createBuildContext({\n cwd,\n logger,\n strapi,\n tsconfig,\n options,\n });\n const contextDuration = timer.end('createBuildContext');\n contextSpinner.text = `Building build context (${contextDuration}ms)`;\n contextSpinner.succeed();\n\n timer.start('creatingAdmin');\n const adminSpinner = logger.spinner(`Creating admin`).start();\n\n EE.init(cwd);\n await writeStaticClientFiles(ctx);\n webpackWatcher = await watchWebpack(ctx);\n\n const adminDuration = timer.end('creatingAdmin');\n adminSpinner.text = `Creating admin (${adminDuration}ms)`;\n adminSpinner.succeed();\n }\n\n const strapiInstance = await strapi.load();\n\n timer.start('generatingTS');\n const generatingTsSpinner = logger.spinner(`Generating types`).start();\n\n await tsUtils.generators.generate({\n strapi: strapiInstance,\n pwd: cwd,\n rootDir: undefined,\n logger: { silent: true, debug: false },\n artifacts: { contentTypes: true, components: true },\n });\n\n const generatingDuration = timer.end('generatingTS');\n generatingTsSpinner.text = `Generating types (${generatingDuration}ms)`;\n generatingTsSpinner.succeed();\n\n const restart = async () => {\n if (strapiInstance.reload.isWatching && !strapiInstance.reload.isReloading) {\n strapiInstance.reload.isReloading = true;\n strapiInstance.reload();\n }\n };\n\n const watcher = chokidar\n .watch(cwd, {\n ignoreInitial: true,\n usePolling: polling,\n ignored: [\n /(^|[/\\\\])\\../, // dot files\n /tmp/,\n '**/src/admin/**',\n '**/src/plugins/**/admin/**',\n '**/dist/src/plugins/test/admin/**',\n '**/documentation',\n '**/documentation/**',\n '**/node_modules',\n '**/node_modules/**',\n '**/plugins.json',\n '**/build',\n '**/build/**',\n '**/index.html',\n '**/public',\n '**/public/**',\n strapiInstance.dirs.static.public,\n joinBy('/', strapiInstance.dirs.static.public, '**'),\n '**/*.db*',\n '**/exports/**',\n '**/dist/**',\n '**/*.d.ts',\n ...strapiInstance.config.get('admin.watchIgnoreFiles', []),\n ],\n })\n .on('add', (path) => {\n strapiInstance.log.info(`File created: ${path}`);\n restart();\n })\n .on('change', (path) => {\n strapiInstance.log.info(`File changed: ${path}`);\n restart();\n })\n .on('unlink', (path) => {\n strapiInstance.log.info(`File deleted: ${path}`);\n restart();\n });\n\n process.on('message', async (message) => {\n switch (message) {\n case 'kill': {\n logger.debug(\n 'child process has the kill message, destroying the strapi instance and sending the killed process message'\n );\n await watcher.close();\n\n await strapiInstance.destroy();\n\n if (webpackWatcher) {\n webpackWatcher.close();\n }\n process.send?.('killed');\n break;\n }\n default:\n break;\n }\n });\n\n strapiInstance.start();\n }\n};\n\nexport { develop };\nexport type { DevelopOptions };\n"],"names":["build","develop","Document","path","webpack","fs","env","buildWebpack","ctx","watchWebpack"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,UAAuB,CAAC,EAAE,SAAS,UAAU;AACjD,UACG,QAAQ,OAAO,EACf,OAAO,eAAe,2CAA2C,KAAK,EACtE,OAAO,oBAAoB,sBAAsB,KAAK,EACtD,OAAO,YAAY,qBAAqB,IAAI,EAC5C,OAAO,qBAAqB,kCAAkC,EAC9D,OAAO,YAAY,sBAAsB,KAAK,EAC9C,OAAO,eAAe,sBAAsB,KAAK,EACjD,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AAG,eAAe,OAAO,IAAI,0BAA0B,CAAA,CAAE;AAAA,MAC3D;AAAA,IACD,CAAA,EACA,GAAG,OAAO,CAACN,UAAS;AACnB,qBAAe,IAAI,KAAK,iBAAiBA,KAAI,EAAE;AACvC;IACT,CAAA,EACA,GAAG,UAAU,CAACA,UAAS;AACtB,qBAAe,IAAI,KAAK,iBAAiBA,KAAI,EAAE;AACvC;IACT,CAAA,EACA,GAAG,UAAU,CAACA,UAAS;AACtB,qBAAe,IAAI,KAAK,iBAAiBA,KAAI,EAAE;AACvC;IAAA,CACT;AAEK,YAAA,GAAG,WAAW,OAAO,YAAY;AACvC,cAAQ,SAAS;AAAA,QACf,KAAK,QAAQ;AACJ,iBAAA;AAAA,YACL;AAAA,UAAA;AAEF,gBAAM,QAAQ;AAEd,gBAAM,eAAe;AAErB,cAAI,gBAAgB;AAClB,2BAAe,MAAM;AAAA,UACvB;AACA,kBAAQ,OAAO,QAAQ;AACvB;AAAA,QACF;AAAA,MAGF;AAAA,IAAA,CACD;AAED,mBAAe,MAAM;AAAA,EACvB;AACF;"}
|
|
@@ -114,7 +114,7 @@ const webpackDevMiddleware__default = /* @__PURE__ */ _interopDefault(webpackDev
|
|
|
114
114
|
const webpackHotMiddleware__default = /* @__PURE__ */ _interopDefault(webpackHotMiddleware);
|
|
115
115
|
const build$2 = ({ command, ctx }) => {
|
|
116
116
|
command.command("build").option("-d, --debug", "Enable debugging mode with verbose logs", false).option("--ignore-prompts", "Ignore all prompts", false).option("--minify", "Minify the output", true).option("--no-optimization", "[deprecated]: use minify instead").option("--silent", "Don't log anything", false).option("--sourcemap", "Produce sourcemaps", false).option("--stats", "Print build statistics to the console", false).description("Build the strapi admin app").action(async (options) => {
|
|
117
|
-
const { build: build2 } = await Promise.resolve().then(() => require("./build-
|
|
117
|
+
const { build: build2 } = await Promise.resolve().then(() => require("./build-58827c7a.js"));
|
|
118
118
|
return build2({ ...options, ...ctx });
|
|
119
119
|
});
|
|
120
120
|
};
|
|
@@ -126,7 +126,7 @@ const develop$1 = ({ command, ctx }) => {
|
|
|
126
126
|
"--watch-admin",
|
|
127
127
|
"[deprecated]: there is now middleware for watching, it is no longer a separate process"
|
|
128
128
|
).option("--browser <name>", "[deprecated]: use open instead").option("--open", "Open the admin in your browser", true).description("Start your Strapi application in development mode").action(async (options) => {
|
|
129
|
-
const { develop: develop2 } = await Promise.resolve().then(() => require("./develop-
|
|
129
|
+
const { develop: develop2 } = await Promise.resolve().then(() => require("./develop-a7d5cf0c.js"));
|
|
130
130
|
return develop2({ ...options, ...ctx });
|
|
131
131
|
});
|
|
132
132
|
};
|
|
@@ -359,7 +359,7 @@ const DefaultDocument = () => {
|
|
|
359
359
|
};
|
|
360
360
|
const getEntryModule = (ctx) => {
|
|
361
361
|
const pluginsObject = ctx.plugins.map(({ name, importName }) => `'${name}': ${importName}`).join(",\n");
|
|
362
|
-
const pluginsImport = ctx.plugins.map(({ importName,
|
|
362
|
+
const pluginsImport = ctx.plugins.map(({ importName, modulePath }) => `import ${importName} from '${modulePath}';`).join("\n");
|
|
363
363
|
return outdent__default.default`
|
|
364
364
|
/**
|
|
365
365
|
* This file was automatically generated by Strapi.
|
|
@@ -368,15 +368,12 @@ const getEntryModule = (ctx) => {
|
|
|
368
368
|
${pluginsImport}
|
|
369
369
|
import { renderAdmin } from "@strapi/strapi/admin"
|
|
370
370
|
|
|
371
|
-
${ctx.customisations?.
|
|
372
|
-
ctx.runtimeDir,
|
|
373
|
-
ctx.customisations.path
|
|
374
|
-
)}'` : ""}
|
|
371
|
+
${ctx.customisations?.modulePath ? `import customisations from '${ctx.customisations.modulePath}'` : ""}
|
|
375
372
|
|
|
376
373
|
renderAdmin(
|
|
377
374
|
document.getElementById("strapi"),
|
|
378
375
|
{
|
|
379
|
-
${ctx.customisations?.
|
|
376
|
+
${ctx.customisations?.modulePath ? "customisations," : ""}
|
|
380
377
|
plugins: {
|
|
381
378
|
${pluginsObject}
|
|
382
379
|
}
|
|
@@ -512,6 +509,20 @@ const loadFile = async (path2) => {
|
|
|
512
509
|
}
|
|
513
510
|
return void 0;
|
|
514
511
|
};
|
|
512
|
+
const convertSystemPathToModulePath = (sysPath) => {
|
|
513
|
+
if (process.platform === "win32") {
|
|
514
|
+
return sysPath.split(path__default.default.sep).join(path__default.default.posix.sep);
|
|
515
|
+
} else {
|
|
516
|
+
return sysPath;
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
const convertModulePathToSystemPath = (modulePath) => {
|
|
520
|
+
if (process.platform === "win32") {
|
|
521
|
+
return modulePath.split(path__default.default.posix.sep).join(path__default.default.sep);
|
|
522
|
+
} else {
|
|
523
|
+
return modulePath;
|
|
524
|
+
}
|
|
525
|
+
};
|
|
515
526
|
const resolveBaseConfig = async (ctx) => {
|
|
516
527
|
const monorepo = await loadStrapiMonorepo(ctx.cwd);
|
|
517
528
|
const target = browserslistToEsbuild__default.default(ctx.target);
|
|
@@ -780,9 +791,10 @@ const getStrapiAdminEnvVars = (defaultEnv) => {
|
|
|
780
791
|
const validatePackageHasStrapi = (pkg) => "strapi" in pkg && typeof pkg.strapi === "object" && !Array.isArray(pkg.strapi) && pkg.strapi !== null;
|
|
781
792
|
const validatePackageIsPlugin = (pkg) => validatePackageHasStrapi(pkg) && pkg.strapi.kind === "plugin";
|
|
782
793
|
const getEnabledPlugins = async ({
|
|
783
|
-
strapi,
|
|
784
794
|
cwd,
|
|
785
|
-
logger
|
|
795
|
+
logger,
|
|
796
|
+
runtimeDir,
|
|
797
|
+
strapi
|
|
786
798
|
}) => {
|
|
787
799
|
const plugins = {};
|
|
788
800
|
const deps = strapi.config.get("info.dependencies", {});
|
|
@@ -798,7 +810,9 @@ const getEnabledPlugins = async ({
|
|
|
798
810
|
}
|
|
799
811
|
plugins[name] = {
|
|
800
812
|
name,
|
|
801
|
-
|
|
813
|
+
importName: camelCase__default.default(name),
|
|
814
|
+
type: "module",
|
|
815
|
+
modulePath: dep
|
|
802
816
|
};
|
|
803
817
|
}
|
|
804
818
|
}
|
|
@@ -806,14 +820,17 @@ const getEnabledPlugins = async ({
|
|
|
806
820
|
logger.debug("User's plugins file", os__default.default.EOL, userPluginsFile);
|
|
807
821
|
for (const [userPluginName, userPluginConfig] of Object.entries(userPluginsFile)) {
|
|
808
822
|
if (userPluginConfig.enabled && userPluginConfig.resolve) {
|
|
823
|
+
const sysPath = convertModulePathToSystemPath(userPluginConfig.resolve);
|
|
809
824
|
plugins[userPluginName] = {
|
|
810
825
|
name: userPluginName,
|
|
811
|
-
|
|
826
|
+
importName: camelCase__default.default(userPluginName),
|
|
827
|
+
type: "local",
|
|
812
828
|
/**
|
|
813
829
|
* User plugin paths are resolved from the entry point
|
|
814
830
|
* of the app, because that's how you import them.
|
|
815
831
|
*/
|
|
816
|
-
|
|
832
|
+
modulePath: convertSystemPathToModulePath(path__default.default.relative(runtimeDir, sysPath)),
|
|
833
|
+
path: sysPath
|
|
817
834
|
};
|
|
818
835
|
}
|
|
819
836
|
}
|
|
@@ -830,21 +847,14 @@ const loadUserPluginsFile = async (root) => {
|
|
|
830
847
|
}
|
|
831
848
|
return {};
|
|
832
849
|
};
|
|
833
|
-
const getMapOfPluginsWithAdmin = (plugins
|
|
850
|
+
const getMapOfPluginsWithAdmin = (plugins) => Object.values(plugins).filter((plugin) => {
|
|
834
851
|
if (!plugin) {
|
|
835
852
|
return false;
|
|
836
853
|
}
|
|
837
854
|
try {
|
|
838
|
-
const isLocalPluginWithLegacyAdminFile = fs__default$1.default.existsSync(
|
|
839
|
-
//@ts-ignore
|
|
840
|
-
path__default.default.resolve(`${plugin.pathToPlugin}/strapi-admin.js`)
|
|
841
|
-
);
|
|
855
|
+
const isLocalPluginWithLegacyAdminFile = plugin.path && fs__default$1.default.existsSync(path__default.default.join(plugin.path, "strapi-admin.js"));
|
|
842
856
|
if (!isLocalPluginWithLegacyAdminFile) {
|
|
843
|
-
|
|
844
|
-
if (process.platform === "win32") {
|
|
845
|
-
pathToPlugin = pathToPlugin.split(path__default.default.sep).join(path__default.default.posix.sep);
|
|
846
|
-
}
|
|
847
|
-
const isModuleWithFE = require.resolve(`${pathToPlugin}/strapi-admin`);
|
|
857
|
+
const isModuleWithFE = require.resolve(`${plugin.modulePath}/strapi-admin`);
|
|
848
858
|
return isModuleWithFE;
|
|
849
859
|
}
|
|
850
860
|
return isLocalPluginWithLegacyAdminFile;
|
|
@@ -854,21 +864,22 @@ const getMapOfPluginsWithAdmin = (plugins, { runtimeDir }) => Object.values(plug
|
|
|
854
864
|
}
|
|
855
865
|
throw err;
|
|
856
866
|
}
|
|
857
|
-
}).map((plugin) => {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
path: !plugin.isLocal ? `${plugin.pathToPlugin}/strapi-admin` : `${modulePath}/strapi-admin`,
|
|
862
|
-
name: plugin.name,
|
|
863
|
-
importName: camelCase__default.default(plugin.name)
|
|
864
|
-
};
|
|
865
|
-
});
|
|
867
|
+
}).map((plugin) => ({
|
|
868
|
+
...plugin,
|
|
869
|
+
modulePath: `${plugin.modulePath}/strapi-admin`
|
|
870
|
+
}));
|
|
866
871
|
const ADMIN_APP_FILES = ["app.js", "app.mjs", "app.ts", "app.jsx", "app.tsx"];
|
|
867
|
-
const loadUserAppFile = async (
|
|
872
|
+
const loadUserAppFile = async ({
|
|
873
|
+
runtimeDir,
|
|
874
|
+
appDir
|
|
875
|
+
}) => {
|
|
868
876
|
for (const file of ADMIN_APP_FILES) {
|
|
869
877
|
const filePath = path__default.default.join(appDir, "src", "admin", file);
|
|
870
|
-
if (
|
|
871
|
-
return {
|
|
878
|
+
if (await pathExists(filePath)) {
|
|
879
|
+
return {
|
|
880
|
+
path: filePath,
|
|
881
|
+
modulePath: convertSystemPathToModulePath(path__default.default.relative(runtimeDir, filePath))
|
|
882
|
+
};
|
|
872
883
|
}
|
|
873
884
|
}
|
|
874
885
|
return void 0;
|
|
@@ -895,6 +906,7 @@ const createBuildContext = async ({
|
|
|
895
906
|
serveAdminPanel: false
|
|
896
907
|
});
|
|
897
908
|
const { serverUrl, adminPath } = utils.getConfigUrls(strapiInstance.config, true);
|
|
909
|
+
const appDir = strapiInstance.dirs.app.root;
|
|
898
910
|
await loadEnv(cwd);
|
|
899
911
|
const env = getStrapiAdminEnvVars({
|
|
900
912
|
ADMIN_PATH: adminPath,
|
|
@@ -921,14 +933,14 @@ const createBuildContext = async ({
|
|
|
921
933
|
}
|
|
922
934
|
const runtimeDir = path__default.default.join(cwd, ".strapi", "client");
|
|
923
935
|
const entry = path__default.default.relative(cwd, path__default.default.join(runtimeDir, "app.js"));
|
|
924
|
-
const plugins = await getEnabledPlugins({ cwd, logger, strapi: strapiInstance });
|
|
936
|
+
const plugins = await getEnabledPlugins({ cwd, logger, runtimeDir, strapi: strapiInstance });
|
|
925
937
|
logger.debug("Enabled plugins", os__default.default.EOL, plugins);
|
|
926
|
-
const pluginsWithFront = getMapOfPluginsWithAdmin(plugins
|
|
938
|
+
const pluginsWithFront = getMapOfPluginsWithAdmin(plugins);
|
|
927
939
|
logger.debug("Enabled plugins with FE", os__default.default.EOL, plugins);
|
|
928
940
|
const target = browserslist__default.default.loadConfig({ path: cwd }) ?? DEFAULT_BROWSERSLIST;
|
|
929
|
-
const customisations = await loadUserAppFile(
|
|
941
|
+
const customisations = await loadUserAppFile({ appDir, runtimeDir });
|
|
930
942
|
const buildContext = {
|
|
931
|
-
appDir
|
|
943
|
+
appDir,
|
|
932
944
|
basePath: `${adminPath}/`,
|
|
933
945
|
customisations,
|
|
934
946
|
cwd,
|
|
@@ -1272,4 +1284,4 @@ exports.build = build;
|
|
|
1272
1284
|
exports.develop = develop;
|
|
1273
1285
|
exports.handleUnexpectedError = handleUnexpectedError;
|
|
1274
1286
|
exports.index = index;
|
|
1275
|
-
//# sourceMappingURL=index-
|
|
1287
|
+
//# sourceMappingURL=index-b84b9fee.js.map
|