@strapi/strapi 5.12.1 → 5.12.2
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/cli.js +89 -45
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +90 -42
- package/dist/cli.mjs.map +1 -1
- package/dist/package.json.js +6 -0
- package/dist/package.json.js.map +1 -0
- package/dist/package.json.mjs +4 -0
- package/dist/package.json.mjs.map +1 -0
- package/dist/src/cli/commands/admin/create-user.js +124 -0
- package/dist/src/cli/commands/admin/create-user.js.map +1 -0
- package/dist/src/cli/commands/admin/create-user.mjs +121 -0
- package/dist/src/cli/commands/admin/create-user.mjs.map +1 -0
- package/dist/src/cli/commands/admin/reset-user-password.js +61 -0
- package/dist/src/cli/commands/admin/reset-user-password.js.map +1 -0
- package/dist/src/cli/commands/admin/reset-user-password.mjs +58 -0
- package/dist/src/cli/commands/admin/reset-user-password.mjs.map +1 -0
- package/dist/src/cli/commands/build.js +29 -0
- package/dist/src/cli/commands/build.js.map +1 -0
- package/dist/src/cli/commands/build.mjs +27 -0
- package/dist/src/cli/commands/build.mjs.map +1 -0
- package/dist/src/cli/commands/components/list.js +32 -0
- package/dist/src/cli/commands/components/list.js.map +1 -0
- package/dist/src/cli/commands/components/list.mjs +29 -0
- package/dist/src/cli/commands/components/list.mjs.map +1 -0
- package/dist/src/cli/commands/configuration/dump.js +53 -0
- package/dist/src/cli/commands/configuration/dump.js.map +1 -0
- package/dist/src/cli/commands/configuration/dump.mjs +50 -0
- package/dist/src/cli/commands/configuration/dump.mjs.map +1 -0
- package/dist/src/cli/commands/configuration/restore.js +173 -0
- package/dist/src/cli/commands/configuration/restore.js.map +1 -0
- package/dist/src/cli/commands/configuration/restore.mjs +170 -0
- package/dist/src/cli/commands/configuration/restore.mjs.map +1 -0
- package/dist/src/cli/commands/console.js +31 -0
- package/dist/src/cli/commands/console.js.map +1 -0
- package/dist/src/cli/commands/console.mjs +28 -0
- package/dist/src/cli/commands/console.mjs.map +1 -0
- package/dist/src/cli/commands/content-types/list.js +32 -0
- package/dist/src/cli/commands/content-types/list.js.map +1 -0
- package/dist/src/cli/commands/content-types/list.mjs +29 -0
- package/dist/src/cli/commands/content-types/list.mjs.map +1 -0
- package/dist/src/cli/commands/controllers/list.js +32 -0
- package/dist/src/cli/commands/controllers/list.js.map +1 -0
- package/dist/src/cli/commands/controllers/list.mjs +29 -0
- package/dist/src/cli/commands/controllers/list.mjs.map +1 -0
- package/dist/src/cli/commands/develop.js +32 -0
- package/dist/src/cli/commands/develop.js.map +1 -0
- package/dist/src/cli/commands/develop.mjs +30 -0
- package/dist/src/cli/commands/develop.mjs.map +1 -0
- package/dist/src/cli/commands/export/action.js +126 -0
- package/dist/src/cli/commands/export/action.js.map +1 -0
- package/dist/src/cli/commands/export/action.mjs +124 -0
- package/dist/src/cli/commands/export/action.mjs.map +1 -0
- package/dist/src/cli/commands/export/command.js +15 -0
- package/dist/src/cli/commands/export/command.js.map +1 -0
- package/dist/src/cli/commands/export/command.mjs +13 -0
- package/dist/src/cli/commands/export/command.mjs.map +1 -0
- package/dist/src/cli/commands/generate.js +18 -0
- package/dist/src/cli/commands/generate.js.map +1 -0
- package/dist/src/cli/commands/generate.mjs +16 -0
- package/dist/src/cli/commands/generate.mjs.map +1 -0
- package/dist/src/cli/commands/hooks/list.js +32 -0
- package/dist/src/cli/commands/hooks/list.js.map +1 -0
- package/dist/src/cli/commands/hooks/list.mjs +29 -0
- package/dist/src/cli/commands/hooks/list.mjs.map +1 -0
- package/dist/src/cli/commands/import/action.js +124 -0
- package/dist/src/cli/commands/import/action.js.map +1 -0
- package/dist/src/cli/commands/import/action.mjs +122 -0
- package/dist/src/cli/commands/import/action.mjs.map +1 -0
- package/dist/src/cli/commands/import/command.js +59 -0
- package/dist/src/cli/commands/import/command.js.map +1 -0
- package/dist/src/cli/commands/import/command.mjs +57 -0
- package/dist/src/cli/commands/import/command.mjs.map +1 -0
- package/dist/src/cli/commands/index.js +64 -0
- package/dist/src/cli/commands/index.js.map +1 -0
- package/dist/src/cli/commands/index.mjs +62 -0
- package/dist/src/cli/commands/index.mjs.map +1 -0
- package/dist/src/cli/commands/middlewares/list.js +32 -0
- package/dist/src/cli/commands/middlewares/list.js.map +1 -0
- package/dist/src/cli/commands/middlewares/list.mjs +29 -0
- package/dist/src/cli/commands/middlewares/list.mjs.map +1 -0
- package/dist/src/cli/commands/policies/list.js +32 -0
- package/dist/src/cli/commands/policies/list.js.map +1 -0
- package/dist/src/cli/commands/policies/list.mjs +29 -0
- package/dist/src/cli/commands/policies/list.mjs.map +1 -0
- package/dist/src/cli/commands/report.js +39 -0
- package/dist/src/cli/commands/report.js.map +1 -0
- package/dist/src/cli/commands/report.mjs +37 -0
- package/dist/src/cli/commands/report.mjs.map +1 -0
- package/dist/src/cli/commands/routes/list.js +40 -0
- package/dist/src/cli/commands/routes/list.js.map +1 -0
- package/dist/src/cli/commands/routes/list.mjs +37 -0
- package/dist/src/cli/commands/routes/list.mjs.map +1 -0
- package/dist/src/cli/commands/services/list.js +32 -0
- package/dist/src/cli/commands/services/list.js.map +1 -0
- package/dist/src/cli/commands/services/list.mjs +29 -0
- package/dist/src/cli/commands/services/list.mjs.map +1 -0
- package/dist/src/cli/commands/start.js +28 -0
- package/dist/src/cli/commands/start.js.map +1 -0
- package/dist/src/cli/commands/start.mjs +26 -0
- package/dist/src/cli/commands/start.mjs.map +1 -0
- package/dist/src/cli/commands/telemetry/disable.js +72 -0
- package/dist/src/cli/commands/telemetry/disable.js.map +1 -0
- package/dist/src/cli/commands/telemetry/disable.mjs +69 -0
- package/dist/src/cli/commands/telemetry/disable.mjs.map +1 -0
- package/dist/src/cli/commands/telemetry/enable.js +88 -0
- package/dist/src/cli/commands/telemetry/enable.js.map +1 -0
- package/dist/src/cli/commands/telemetry/enable.mjs +85 -0
- package/dist/src/cli/commands/telemetry/enable.mjs.map +1 -0
- package/dist/src/cli/commands/templates/generate.js +15 -0
- package/dist/src/cli/commands/templates/generate.js.map +1 -0
- package/dist/src/cli/commands/templates/generate.mjs +13 -0
- package/dist/src/cli/commands/templates/generate.mjs.map +1 -0
- package/dist/src/cli/commands/transfer/action.js +141 -0
- package/dist/src/cli/commands/transfer/action.js.map +1 -0
- package/dist/src/cli/commands/transfer/action.mjs +139 -0
- package/dist/src/cli/commands/transfer/action.mjs.map +1 -0
- package/dist/src/cli/commands/transfer/command.js +61 -0
- package/dist/src/cli/commands/transfer/command.js.map +1 -0
- package/dist/src/cli/commands/transfer/command.mjs +59 -0
- package/dist/src/cli/commands/transfer/command.mjs.map +1 -0
- package/dist/src/cli/commands/ts/generate-types.js +40 -0
- package/dist/src/cli/commands/ts/generate-types.js.map +1 -0
- package/dist/src/cli/commands/ts/generate-types.mjs +37 -0
- package/dist/src/cli/commands/ts/generate-types.mjs.map +1 -0
- package/dist/src/cli/commands/version.js +17 -0
- package/dist/src/cli/commands/version.js.map +1 -0
- package/dist/src/cli/commands/version.mjs +15 -0
- package/dist/src/cli/commands/version.mjs.map +1 -0
- package/dist/src/cli/utils/commander.js +125 -0
- package/dist/src/cli/utils/commander.js.map +1 -0
- package/dist/src/cli/utils/commander.mjs +116 -0
- package/dist/src/cli/utils/commander.mjs.map +1 -0
- package/dist/src/cli/utils/data-transfer.js +378 -0
- package/dist/src/cli/utils/data-transfer.js.map +1 -0
- package/dist/src/cli/utils/data-transfer.mjs +359 -0
- package/dist/src/cli/utils/data-transfer.mjs.map +1 -0
- package/dist/src/cli/utils/helpers.js +114 -0
- package/dist/src/cli/utils/helpers.js.map +1 -0
- package/dist/src/cli/utils/helpers.mjs +107 -0
- package/dist/src/cli/utils/helpers.mjs.map +1 -0
- package/dist/src/cli/utils/logger.js +125 -0
- package/dist/src/cli/utils/logger.js.map +1 -0
- package/dist/src/cli/utils/logger.mjs +104 -0
- package/dist/src/cli/utils/logger.mjs.map +1 -0
- package/dist/src/cli/utils/telemetry.js +27 -0
- package/dist/src/cli/utils/telemetry.js.map +1 -0
- package/dist/src/cli/utils/telemetry.mjs +25 -0
- package/dist/src/cli/utils/telemetry.mjs.map +1 -0
- package/dist/src/cli/utils/tsconfig.js +25 -0
- package/dist/src/cli/utils/tsconfig.js.map +1 -0
- package/dist/src/cli/utils/tsconfig.mjs +23 -0
- package/dist/src/cli/utils/tsconfig.mjs.map +1 -0
- package/dist/src/node/build.js +90 -0
- package/dist/src/node/build.js.map +1 -0
- package/dist/src/node/build.mjs +69 -0
- package/dist/src/node/build.mjs.map +1 -0
- package/dist/src/node/core/admin-customisations.js +27 -0
- package/dist/src/node/core/admin-customisations.js.map +1 -0
- package/dist/src/node/core/admin-customisations.mjs +25 -0
- package/dist/src/node/core/admin-customisations.mjs.map +1 -0
- package/dist/{chunks/aliases-BkD9BImE.js → src/node/core/aliases.js} +3 -42
- package/dist/src/node/core/aliases.js.map +1 -0
- package/dist/{chunks/aliases-CZgVGGH9.mjs → src/node/core/aliases.mjs} +4 -41
- package/dist/src/node/core/aliases.mjs.map +1 -0
- package/dist/src/node/core/config.js +18 -0
- package/dist/src/node/core/config.js.map +1 -0
- package/dist/src/node/core/config.mjs +16 -0
- package/dist/src/node/core/config.mjs.map +1 -0
- package/dist/src/node/core/dependencies.js +186 -0
- package/dist/src/node/core/dependencies.js.map +1 -0
- package/dist/src/node/core/dependencies.mjs +183 -0
- package/dist/src/node/core/dependencies.mjs.map +1 -0
- package/dist/src/node/core/env.js +32 -0
- package/dist/src/node/core/env.js.map +1 -0
- package/dist/src/node/core/env.mjs +29 -0
- package/dist/src/node/core/env.mjs.map +1 -0
- package/dist/src/node/core/errors.js +51 -0
- package/dist/src/node/core/errors.js.map +1 -0
- package/dist/src/node/core/errors.mjs +48 -0
- package/dist/src/node/core/errors.mjs.map +1 -0
- package/dist/src/node/core/files.js +68 -0
- package/dist/src/node/core/files.js.map +1 -0
- package/dist/src/node/core/files.mjs +63 -0
- package/dist/src/node/core/files.mjs.map +1 -0
- package/dist/src/node/core/managers.js +27 -0
- package/dist/src/node/core/managers.js.map +1 -0
- package/dist/src/node/core/managers.mjs +25 -0
- package/dist/src/node/core/managers.mjs.map +1 -0
- package/dist/src/node/core/monorepo.js +30 -0
- package/dist/src/node/core/monorepo.js.map +1 -0
- package/dist/src/node/core/monorepo.mjs +28 -0
- package/dist/src/node/core/monorepo.mjs.map +1 -0
- package/dist/src/node/core/plugins.js +140 -0
- package/dist/src/node/core/plugins.js.map +1 -0
- package/dist/src/node/core/plugins.mjs +137 -0
- package/dist/src/node/core/plugins.mjs.map +1 -0
- package/dist/src/node/core/timer.js +33 -0
- package/dist/src/node/core/timer.js.map +1 -0
- package/dist/src/node/core/timer.mjs +30 -0
- package/dist/src/node/core/timer.mjs.map +1 -0
- package/dist/src/node/create-build-context.js +111 -0
- package/dist/src/node/create-build-context.js.map +1 -0
- package/dist/src/node/create-build-context.mjs +109 -0
- package/dist/src/node/create-build-context.mjs.map +1 -0
- package/dist/src/node/develop.js +312 -0
- package/dist/src/node/develop.js.map +1 -0
- package/dist/src/node/develop.mjs +291 -0
- package/dist/src/node/develop.mjs.map +1 -0
- package/dist/src/node/staticFiles.js +81 -0
- package/dist/src/node/staticFiles.js.map +1 -0
- package/dist/src/node/staticFiles.mjs +78 -0
- package/dist/src/node/staticFiles.mjs.map +1 -0
- package/dist/src/node/vite/build.js +14 -0
- package/dist/src/node/vite/build.js.map +1 -0
- package/dist/src/node/vite/build.mjs +12 -0
- package/dist/src/node/vite/build.mjs.map +1 -0
- package/dist/{chunks/config-D3Y5s3ui.js → src/node/vite/config.js} +12 -50
- package/dist/src/node/vite/config.js.map +1 -0
- package/dist/{chunks/config-BFUn1raM.mjs → src/node/vite/config.mjs} +6 -44
- package/dist/src/node/vite/config.mjs.map +1 -0
- package/dist/src/node/vite/plugins.js +46 -0
- package/dist/src/node/vite/plugins.js.map +1 -0
- package/dist/src/node/vite/plugins.mjs +44 -0
- package/dist/src/node/vite/plugins.mjs.map +1 -0
- package/dist/{chunks/watch-gkyBsmAJ.js → src/node/vite/watch.js} +2 -45
- package/dist/src/node/vite/watch.js.map +1 -0
- package/dist/{chunks/watch-DUnlAAiK.mjs → src/node/vite/watch.mjs} +2 -45
- package/dist/src/node/vite/watch.mjs.map +1 -0
- package/dist/src/node/webpack/build.js +37 -0
- package/dist/src/node/webpack/build.js.map +1 -0
- package/dist/src/node/webpack/build.mjs +35 -0
- package/dist/src/node/webpack/build.mjs.map +1 -0
- package/dist/{chunks/config-Bcu3_xSp.js → src/node/webpack/config.js} +10 -8
- package/dist/src/node/webpack/config.js.map +1 -0
- package/dist/{chunks/config-DKpJU9io.mjs → src/node/webpack/config.mjs} +5 -3
- package/dist/src/node/webpack/config.mjs.map +1 -0
- package/dist/{chunks/watch-CNfkm7Fm.js → src/node/webpack/watch.js} +2 -51
- package/dist/src/node/webpack/watch.js.map +1 -0
- package/dist/{chunks/watch-BEC39t49.mjs → src/node/webpack/watch.mjs} +2 -51
- package/dist/src/node/webpack/watch.mjs.map +1 -0
- package/package.json +22 -22
- package/dist/chunks/aliases-BkD9BImE.js.map +0 -1
- package/dist/chunks/aliases-CZgVGGH9.mjs.map +0 -1
- package/dist/chunks/build-B6f5SABm.js +0 -87
- package/dist/chunks/build-B6f5SABm.js.map +0 -1
- package/dist/chunks/build-BQc6C2UF.mjs +0 -85
- package/dist/chunks/build-BQc6C2UF.mjs.map +0 -1
- package/dist/chunks/build-C4qN5x5L.js +0 -59
- package/dist/chunks/build-C4qN5x5L.js.map +0 -1
- package/dist/chunks/build-D6MP0Rwu.mjs +0 -57
- package/dist/chunks/build-D6MP0Rwu.mjs.map +0 -1
- package/dist/chunks/config-BFUn1raM.mjs.map +0 -1
- package/dist/chunks/config-Bcu3_xSp.js.map +0 -1
- package/dist/chunks/config-D3Y5s3ui.js.map +0 -1
- package/dist/chunks/config-DKpJU9io.mjs.map +0 -1
- package/dist/chunks/index-DGhshfMs.mjs +0 -3160
- package/dist/chunks/index-DGhshfMs.mjs.map +0 -1
- package/dist/chunks/index-DW2NjgW9.js +0 -3185
- package/dist/chunks/index-DW2NjgW9.js.map +0 -1
- package/dist/chunks/watch-BEC39t49.mjs.map +0 -1
- package/dist/chunks/watch-CNfkm7Fm.js.map +0 -1
- package/dist/chunks/watch-DUnlAAiK.mjs.map +0 -1
- package/dist/chunks/watch-gkyBsmAJ.js.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as tsUtils from '@strapi/typescript-utils';
|
|
2
|
+
import { checkRequiredDependencies } from './core/dependencies.mjs';
|
|
3
|
+
import { prettyTime, getTimer } from './core/timer.mjs';
|
|
4
|
+
import { createBuildContext } from './create-build-context.mjs';
|
|
5
|
+
import { writeStaticClientFiles } from './staticFiles.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @example `$ strapi build`
|
|
9
|
+
*
|
|
10
|
+
* @description Builds the admin panel of the strapi application.
|
|
11
|
+
*/ const build = async ({ logger, cwd, tsconfig, ...options })=>{
|
|
12
|
+
const timer = getTimer();
|
|
13
|
+
const { didInstall } = await checkRequiredDependencies({
|
|
14
|
+
cwd,
|
|
15
|
+
logger
|
|
16
|
+
}).catch((err)=>{
|
|
17
|
+
logger.error(err.message);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
});
|
|
20
|
+
if (didInstall) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (tsconfig?.config) {
|
|
24
|
+
timer.start('compilingTS');
|
|
25
|
+
const compilingTsSpinner = logger.spinner(`Compiling TS`).start();
|
|
26
|
+
tsUtils.compile(cwd, {
|
|
27
|
+
configOptions: {
|
|
28
|
+
ignoreDiagnostics: false
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const compilingDuration = timer.end('compilingTS');
|
|
32
|
+
compilingTsSpinner.text = `Compiling TS (${prettyTime(compilingDuration)})`;
|
|
33
|
+
compilingTsSpinner.succeed();
|
|
34
|
+
}
|
|
35
|
+
timer.start('createBuildContext');
|
|
36
|
+
const contextSpinner = logger.spinner(`Building build context`).start();
|
|
37
|
+
console.log('');
|
|
38
|
+
const ctx = await createBuildContext({
|
|
39
|
+
cwd,
|
|
40
|
+
logger,
|
|
41
|
+
tsconfig,
|
|
42
|
+
options
|
|
43
|
+
});
|
|
44
|
+
const contextDuration = timer.end('createBuildContext');
|
|
45
|
+
contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;
|
|
46
|
+
contextSpinner.succeed();
|
|
47
|
+
timer.start('buildAdmin');
|
|
48
|
+
const buildingSpinner = logger.spinner(`Building admin panel`).start();
|
|
49
|
+
console.log('');
|
|
50
|
+
try {
|
|
51
|
+
await writeStaticClientFiles(ctx);
|
|
52
|
+
if (ctx.bundler === 'webpack') {
|
|
53
|
+
const { build: buildWebpack } = await import('./webpack/build.mjs');
|
|
54
|
+
await buildWebpack(ctx);
|
|
55
|
+
} else if (ctx.bundler === 'vite') {
|
|
56
|
+
const { build: buildVite } = await import('./vite/build.mjs');
|
|
57
|
+
await buildVite(ctx);
|
|
58
|
+
}
|
|
59
|
+
const buildDuration = timer.end('buildAdmin');
|
|
60
|
+
buildingSpinner.text = `Building admin panel (${prettyTime(buildDuration)})`;
|
|
61
|
+
buildingSpinner.succeed();
|
|
62
|
+
} catch (err) {
|
|
63
|
+
buildingSpinner.fail();
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { build };
|
|
69
|
+
//# sourceMappingURL=build.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.mjs","sources":["../../../src/node/build.ts"],"sourcesContent":["import * as tsUtils from '@strapi/typescript-utils';\nimport type { CLIContext } from '../cli/types';\nimport { checkRequiredDependencies } from './core/dependencies';\nimport { getTimer, prettyTime } from './core/timer';\nimport { createBuildContext } from './create-build-context';\nimport { writeStaticClientFiles } from './staticFiles';\n\ninterface BuildOptions extends CLIContext {\n /**\n * Which bundler to use for building.\n *\n * @default webpack\n */\n bundler?: 'webpack' | 'vite';\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, ...options }: BuildOptions) => {\n const timer = getTimer();\n\n const { didInstall } = await checkRequiredDependencies({ cwd, logger }).catch((err) => {\n logger.error(err.message);\n process.exit(1);\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 (${prettyTime(compilingDuration)})`;\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\n const contextDuration = timer.end('createBuildContext');\n contextSpinner.text = `Building build context (${prettyTime(contextDuration)})`;\n contextSpinner.succeed();\n\n timer.start('buildAdmin');\n const buildingSpinner = logger.spinner(`Building admin panel`).start();\n console.log('');\n\n try {\n await writeStaticClientFiles(ctx);\n\n if (ctx.bundler === 'webpack') {\n const { build: buildWebpack } = await import('./webpack/build');\n await buildWebpack(ctx);\n } else if (ctx.bundler === 'vite') {\n const { build: buildVite } = await import('./vite/build');\n await buildVite(ctx);\n }\n\n const buildDuration = timer.end('buildAdmin');\n buildingSpinner.text = `Building admin panel (${prettyTime(buildDuration)})`;\n buildingSpinner.succeed();\n } catch (err) {\n buildingSpinner.fail();\n throw err;\n }\n};\n\nexport { build };\nexport type { BuildOptions };\n"],"names":["build","logger","cwd","tsconfig","options","timer","getTimer","didInstall","checkRequiredDependencies","catch","err","error","message","process","exit","config","start","compilingTsSpinner","spinner","tsUtils","compile","configOptions","ignoreDiagnostics","compilingDuration","end","text","prettyTime","succeed","contextSpinner","console","log","ctx","createBuildContext","contextDuration","buildingSpinner","writeStaticClientFiles","bundler","buildWebpack","buildVite","buildDuration","fail"],"mappings":";;;;;;AA8BA;;;;IAKA,MAAMA,KAAQ,GAAA,OAAO,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAE,GAAGC,OAAuB,EAAA,GAAA;AACtE,IAAA,MAAMC,KAAQC,GAAAA,QAAAA,EAAAA;AAEd,IAAA,MAAM,EAAEC,UAAU,EAAE,GAAG,MAAMC,yBAA0B,CAAA;AAAEN,QAAAA,GAAAA;AAAKD,QAAAA;KAAUQ,CAAAA,CAAAA,KAAK,CAAC,CAACC,GAAAA,GAAAA;QAC7ET,MAAOU,CAAAA,KAAK,CAACD,GAAAA,CAAIE,OAAO,CAAA;AACxBC,QAAAA,OAAAA,CAAQC,IAAI,CAAC,CAAA,CAAA;AACf,KAAA,CAAA;AAEA,IAAA,IAAIP,UAAY,EAAA;AACd,QAAA;AACF;AAEA,IAAA,IAAIJ,UAAUY,MAAQ,EAAA;AACpBV,QAAAA,KAAAA,CAAMW,KAAK,CAAC,aAAA,CAAA;QACZ,MAAMC,kBAAAA,GAAqBhB,OAAOiB,OAAO,CAAC,CAAC,YAAY,CAAC,EAAEF,KAAK,EAAA;QAE/DG,OAAQC,CAAAA,OAAO,CAAClB,GAAK,EAAA;YAAEmB,aAAe,EAAA;gBAAEC,iBAAmB,EAAA;AAAM;AAAE,SAAA,CAAA;QAEnE,MAAMC,iBAAAA,GAAoBlB,KAAMmB,CAAAA,GAAG,CAAC,aAAA,CAAA;QACpCP,kBAAmBQ,CAAAA,IAAI,GAAG,CAAC,cAAc,EAAEC,UAAWH,CAAAA,iBAAAA,CAAAA,CAAmB,CAAC,CAAC;AAC3EN,QAAAA,kBAAAA,CAAmBU,OAAO,EAAA;AAC5B;AAEAtB,IAAAA,KAAAA,CAAMW,KAAK,CAAC,oBAAA,CAAA;IACZ,MAAMY,cAAAA,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AA,IAAI,GAAG,CAAC,sBAAsB,EAAEC,UAAWa,CAAAA,aAAAA,CAAAA,CAAe,CAAC,CAAC;AAC5EL,QAAAA,eAAAA,CAAgBP,OAAO,EAAA;AACzB,KAAA,CAAE,OAAOjB,GAAK,EAAA;AACZwB,QAAAA,eAAAA,CAAgBM,IAAI,EAAA;QACpB,MAAM9B,GAAAA;AACR;AACF;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var files = require('./files.js');
|
|
5
|
+
|
|
6
|
+
const ADMIN_APP_FILES = [
|
|
7
|
+
'app.js',
|
|
8
|
+
'app.mjs',
|
|
9
|
+
'app.ts',
|
|
10
|
+
'app.jsx',
|
|
11
|
+
'app.tsx'
|
|
12
|
+
];
|
|
13
|
+
const loadUserAppFile = async ({ runtimeDir, appDir })=>{
|
|
14
|
+
for (const file of ADMIN_APP_FILES){
|
|
15
|
+
const filePath = path.join(appDir, 'src', 'admin', file);
|
|
16
|
+
if (await files.pathExists(filePath)) {
|
|
17
|
+
return {
|
|
18
|
+
path: filePath,
|
|
19
|
+
modulePath: files.convertSystemPathToModulePath(path.relative(runtimeDir, filePath))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.loadUserAppFile = loadUserAppFile;
|
|
27
|
+
//# sourceMappingURL=admin-customisations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-customisations.js","sources":["../../../../src/node/core/admin-customisations.ts"],"sourcesContent":["import path from 'node:path';\nimport { convertSystemPathToModulePath, pathExists } from './files';\nimport type { BaseContext } from '../types';\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?: (...args: any[]) => any;\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<BaseContext, '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"],"names":["ADMIN_APP_FILES","loadUserAppFile","runtimeDir","appDir","file","filePath","path","join","pathExists","modulePath","convertSystemPathToModulePath","relative","undefined"],"mappings":";;;;;AAIA,MAAMA,eAAkB,GAAA;AAAC,IAAA,QAAA;AAAU,IAAA,SAAA;AAAW,IAAA,QAAA;AAAU,IAAA,SAAA;AAAW,IAAA;AAAU,CAAA;AAoB7E,MAAMC,kBAAkB,OAAO,EAC7BC,UAAU,EACVC,MAAM,EACqC,GAAA;IAC3C,KAAK,MAAMC,QAAQJ,eAAiB,CAAA;AAClC,QAAA,MAAMK,WAAWC,IAAKC,CAAAA,IAAI,CAACJ,MAAAA,EAAQ,OAAO,OAASC,EAAAA,IAAAA,CAAAA;QAEnD,IAAI,MAAMI,iBAAWH,QAAW,CAAA,EAAA;YAC9B,OAAO;gBACLC,IAAMD,EAAAA,QAAAA;AACNI,gBAAAA,UAAAA,EAAYC,mCAA8BJ,CAAAA,IAAAA,CAAKK,QAAQ,CAACT,UAAYG,EAAAA,QAAAA,CAAAA;AACtE,aAAA;AACF;AACF;IAEA,OAAOO,SAAAA;AACT;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { pathExists, convertSystemPathToModulePath } from './files.mjs';
|
|
3
|
+
|
|
4
|
+
const ADMIN_APP_FILES = [
|
|
5
|
+
'app.js',
|
|
6
|
+
'app.mjs',
|
|
7
|
+
'app.ts',
|
|
8
|
+
'app.jsx',
|
|
9
|
+
'app.tsx'
|
|
10
|
+
];
|
|
11
|
+
const loadUserAppFile = async ({ runtimeDir, appDir })=>{
|
|
12
|
+
for (const file of ADMIN_APP_FILES){
|
|
13
|
+
const filePath = path.join(appDir, 'src', 'admin', file);
|
|
14
|
+
if (await pathExists(filePath)) {
|
|
15
|
+
return {
|
|
16
|
+
path: filePath,
|
|
17
|
+
modulePath: convertSystemPathToModulePath(path.relative(runtimeDir, filePath))
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { loadUserAppFile };
|
|
25
|
+
//# sourceMappingURL=admin-customisations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-customisations.mjs","sources":["../../../../src/node/core/admin-customisations.ts"],"sourcesContent":["import path from 'node:path';\nimport { convertSystemPathToModulePath, pathExists } from './files';\nimport type { BaseContext } from '../types';\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?: (...args: any[]) => any;\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<BaseContext, '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"],"names":["ADMIN_APP_FILES","loadUserAppFile","runtimeDir","appDir","file","filePath","path","join","pathExists","modulePath","convertSystemPathToModulePath","relative","undefined"],"mappings":";;;AAIA,MAAMA,eAAkB,GAAA;AAAC,IAAA,QAAA;AAAU,IAAA,SAAA;AAAW,IAAA,QAAA;AAAU,IAAA,SAAA;AAAW,IAAA;AAAU,CAAA;AAoB7E,MAAMC,kBAAkB,OAAO,EAC7BC,UAAU,EACVC,MAAM,EACqC,GAAA;IAC3C,KAAK,MAAMC,QAAQJ,eAAiB,CAAA;AAClC,QAAA,MAAMK,WAAWC,IAAKC,CAAAA,IAAI,CAACJ,MAAAA,EAAQ,OAAO,OAASC,EAAAA,IAAAA,CAAAA;QAEnD,IAAI,MAAMI,WAAWH,QAAW,CAAA,EAAA;YAC9B,OAAO;gBACLC,IAAMD,EAAAA,QAAAA;AACNI,gBAAAA,UAAAA,EAAYC,6BAA8BJ,CAAAA,IAAAA,CAAKK,QAAQ,CAACT,UAAYG,EAAAA,QAAAA,CAAAA;AACtE,aAAA;AACF;AACF;IAEA,OAAOO,SAAAA;AACT;;;;"}
|
|
@@ -1,43 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var path = require('path');
|
|
4
|
-
var readPkgUp = require('read-pkg-up');
|
|
5
|
-
var path$1 = require('node:path');
|
|
6
|
-
var cli = require('./index-DW2NjgW9.js');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Load information about the strapi CMS monorepo (if applicable)
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/ async function loadStrapiMonorepo(cwd) {
|
|
13
|
-
let p = cwd;
|
|
14
|
-
while(p !== '/'){
|
|
15
|
-
const readResult = await readPkgUp({
|
|
16
|
-
cwd: p
|
|
17
|
-
});
|
|
18
|
-
if (!readResult) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
if (readResult.packageJson.isStrapiMonorepo) {
|
|
22
|
-
return {
|
|
23
|
-
path: path.dirname(readResult.path)
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
p = path.dirname(path.dirname(readResult.path));
|
|
27
|
-
}
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const getUserConfig = async (fileNames, ctx)=>{
|
|
32
|
-
for (const file of fileNames){
|
|
33
|
-
const filePath = path$1.join(ctx.appDir, 'src', 'admin', file);
|
|
34
|
-
const configFile = await cli.loadFile(filePath);
|
|
35
|
-
if (configFile) {
|
|
36
|
-
return configFile;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return undefined;
|
|
40
|
-
};
|
|
3
|
+
var path = require('node:path');
|
|
41
4
|
|
|
42
5
|
/**
|
|
43
6
|
* The path mappings/aliases used by various tools in the monorepo to map imported modules to
|
|
@@ -69,12 +32,10 @@ const getMonorepoAliases = ({ monorepo })=>{
|
|
|
69
32
|
return Object.fromEntries(Object.entries(devAliases).map(([key, modulePath])=>{
|
|
70
33
|
return [
|
|
71
34
|
key,
|
|
72
|
-
path
|
|
35
|
+
path.join(monorepo.path, modulePath)
|
|
73
36
|
];
|
|
74
37
|
}));
|
|
75
38
|
};
|
|
76
39
|
|
|
77
40
|
exports.getMonorepoAliases = getMonorepoAliases;
|
|
78
|
-
|
|
79
|
-
exports.loadStrapiMonorepo = loadStrapiMonorepo;
|
|
80
|
-
//# sourceMappingURL=aliases-BkD9BImE.js.map
|
|
41
|
+
//# sourceMappingURL=aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aliases.js","sources":["../../../../src/node/core/aliases.ts"],"sourcesContent":["import path from 'node:path';\nimport { StrapiMonorepo } from './monorepo';\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-releases/strapi-admin': './packages/core/content-releases/admin/src',\n '@strapi/content-manager/strapi-admin': './packages/core/content-manager/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-cloud/strapi-admin': './packages/plugins/cloud/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/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/review-workflows/strapi-admin': './packages/core/review-workflows/admin/src',\n};\n\nconst getMonorepoAliases = ({ monorepo }: { monorepo?: StrapiMonorepo }) => {\n if (!monorepo?.path) {\n return {};\n }\n\n return Object.fromEntries(\n Object.entries(devAliases).map(([key, modulePath]) => {\n return [key, path.join(monorepo.path, modulePath)];\n })\n );\n};\n\nexport { getMonorepoAliases };\n"],"names":["devAliases","getMonorepoAliases","monorepo","path","Object","fromEntries","entries","map","key","modulePath","join"],"mappings":";;;;AAGA;;;;;;;AAOC,IACD,MAAMA,UAAqC,GAAA;IACzC,4BAA8B,EAAA,iCAAA;IAC9B,uCAAyC,EAAA,4CAAA;IACzC,sCAAwC,EAAA,2CAAA;IACxC,2CAA6C,EAAA,gDAAA;IAC7C,4BAA8B,EAAA,iCAAA;IAC9B,6BAA+B,EAAA,kCAAA;IAC/B,mCAAqC,EAAA,oCAAA;IACrC,0CAA4C,EAAA,2CAAA;IAC5C,2CAA6C,EAAA,4CAAA;IAC7C,qCAAuC,EAAA,sCAAA;IACvC,2BAA6B,EAAA,mCAAA;IAC7B,oCAAsC,EAAA,qCAAA;IACtC,+CAAiD,EAAA,gDAAA;IACjD,uCAAyC,EAAA;AAC3C,CAAA;AAEA,MAAMC,kBAAqB,GAAA,CAAC,EAAEC,QAAQ,EAAiC,GAAA;IACrE,IAAI,CAACA,UAAUC,IAAM,EAAA;AACnB,QAAA,OAAO,EAAC;AACV;AAEA,IAAA,OAAOC,MAAOC,CAAAA,WAAW,CACvBD,MAAAA,CAAOE,OAAO,CAACN,UAAYO,CAAAA,CAAAA,GAAG,CAAC,CAAC,CAACC,GAAAA,EAAKC,UAAW,CAAA,GAAA;QAC/C,OAAO;AAACD,YAAAA,GAAAA;AAAKL,YAAAA,IAAAA,CAAKO,IAAI,CAACR,QAASC,CAAAA,IAAI,EAAEM,UAAAA;AAAY,SAAA;AACpD,KAAA,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,41 +1,4 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import readPkgUp from 'read-pkg-up';
|
|
3
|
-
import path$1 from 'node:path';
|
|
4
|
-
import { l as loadFile } from './index-DGhshfMs.mjs';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Load information about the strapi CMS monorepo (if applicable)
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
*/ async function loadStrapiMonorepo(cwd) {
|
|
11
|
-
let p = cwd;
|
|
12
|
-
while(p !== '/'){
|
|
13
|
-
const readResult = await readPkgUp({
|
|
14
|
-
cwd: p
|
|
15
|
-
});
|
|
16
|
-
if (!readResult) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
if (readResult.packageJson.isStrapiMonorepo) {
|
|
20
|
-
return {
|
|
21
|
-
path: path.dirname(readResult.path)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
p = path.dirname(path.dirname(readResult.path));
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const getUserConfig = async (fileNames, ctx)=>{
|
|
30
|
-
for (const file of fileNames){
|
|
31
|
-
const filePath = path$1.join(ctx.appDir, 'src', 'admin', file);
|
|
32
|
-
const configFile = await loadFile(filePath);
|
|
33
|
-
if (configFile) {
|
|
34
|
-
return configFile;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
};
|
|
1
|
+
import path from 'node:path';
|
|
39
2
|
|
|
40
3
|
/**
|
|
41
4
|
* The path mappings/aliases used by various tools in the monorepo to map imported modules to
|
|
@@ -67,10 +30,10 @@ const getMonorepoAliases = ({ monorepo })=>{
|
|
|
67
30
|
return Object.fromEntries(Object.entries(devAliases).map(([key, modulePath])=>{
|
|
68
31
|
return [
|
|
69
32
|
key,
|
|
70
|
-
path
|
|
33
|
+
path.join(monorepo.path, modulePath)
|
|
71
34
|
];
|
|
72
35
|
}));
|
|
73
36
|
};
|
|
74
37
|
|
|
75
|
-
export {
|
|
76
|
-
//# sourceMappingURL=aliases
|
|
38
|
+
export { getMonorepoAliases };
|
|
39
|
+
//# sourceMappingURL=aliases.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aliases.mjs","sources":["../../../../src/node/core/aliases.ts"],"sourcesContent":["import path from 'node:path';\nimport { StrapiMonorepo } from './monorepo';\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-releases/strapi-admin': './packages/core/content-releases/admin/src',\n '@strapi/content-manager/strapi-admin': './packages/core/content-manager/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-cloud/strapi-admin': './packages/plugins/cloud/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/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/review-workflows/strapi-admin': './packages/core/review-workflows/admin/src',\n};\n\nconst getMonorepoAliases = ({ monorepo }: { monorepo?: StrapiMonorepo }) => {\n if (!monorepo?.path) {\n return {};\n }\n\n return Object.fromEntries(\n Object.entries(devAliases).map(([key, modulePath]) => {\n return [key, path.join(monorepo.path, modulePath)];\n })\n );\n};\n\nexport { getMonorepoAliases };\n"],"names":["devAliases","getMonorepoAliases","monorepo","path","Object","fromEntries","entries","map","key","modulePath","join"],"mappings":";;AAGA;;;;;;;AAOC,IACD,MAAMA,UAAqC,GAAA;IACzC,4BAA8B,EAAA,iCAAA;IAC9B,uCAAyC,EAAA,4CAAA;IACzC,sCAAwC,EAAA,2CAAA;IACxC,2CAA6C,EAAA,gDAAA;IAC7C,4BAA8B,EAAA,iCAAA;IAC9B,6BAA+B,EAAA,kCAAA;IAC/B,mCAAqC,EAAA,oCAAA;IACrC,0CAA4C,EAAA,2CAAA;IAC5C,2CAA6C,EAAA,4CAAA;IAC7C,qCAAuC,EAAA,sCAAA;IACvC,2BAA6B,EAAA,mCAAA;IAC7B,oCAAsC,EAAA,qCAAA;IACtC,+CAAiD,EAAA,gDAAA;IACjD,uCAAyC,EAAA;AAC3C,CAAA;AAEA,MAAMC,kBAAqB,GAAA,CAAC,EAAEC,QAAQ,EAAiC,GAAA;IACrE,IAAI,CAACA,UAAUC,IAAM,EAAA;AACnB,QAAA,OAAO,EAAC;AACV;AAEA,IAAA,OAAOC,MAAOC,CAAAA,WAAW,CACvBD,MAAAA,CAAOE,OAAO,CAACN,UAAYO,CAAAA,CAAAA,GAAG,CAAC,CAAC,CAACC,GAAAA,EAAKC,UAAW,CAAA,GAAA;QAC/C,OAAO;AAACD,YAAAA,GAAAA;AAAKL,YAAAA,IAAAA,CAAKO,IAAI,CAACR,QAASC,CAAAA,IAAI,EAAEM,UAAAA;AAAY,SAAA;AACpD,KAAA,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('node:path');
|
|
4
|
+
var files = require('./files.js');
|
|
5
|
+
|
|
6
|
+
const getUserConfig = async (fileNames, ctx)=>{
|
|
7
|
+
for (const file of fileNames){
|
|
8
|
+
const filePath = path.join(ctx.appDir, 'src', 'admin', file);
|
|
9
|
+
const configFile = await files.loadFile(filePath);
|
|
10
|
+
if (configFile) {
|
|
11
|
+
return configFile;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.getUserConfig = getUserConfig;
|
|
18
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../../src/node/core/config.ts"],"sourcesContent":["import path from 'node:path';\n\nimport type { BuildContext } from '../create-build-context';\nimport { loadFile } from './files';\n\nconst getUserConfig = async <TConfig>(\n fileNames: string[],\n ctx: BuildContext\n): Promise<TConfig | undefined> => {\n for (const file of fileNames) {\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\nexport { getUserConfig };\n"],"names":["getUserConfig","fileNames","ctx","file","filePath","path","join","appDir","configFile","loadFile","undefined"],"mappings":";;;;;AAKMA,MAAAA,aAAAA,GAAgB,OACpBC,SACAC,EAAAA,GAAAA,GAAAA;IAEA,KAAK,MAAMC,QAAQF,SAAW,CAAA;QAC5B,MAAMG,QAAAA,GAAWC,KAAKC,IAAI,CAACJ,IAAIK,MAAM,EAAE,OAAO,OAASJ,EAAAA,IAAAA,CAAAA;QACvD,MAAMK,UAAAA,GAAa,MAAMC,cAASL,CAAAA,QAAAA,CAAAA;AAElC,QAAA,IAAII,UAAY,EAAA;YACd,OAAOA,UAAAA;AACT;AACF;IAEA,OAAOE,SAAAA;AACT;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { loadFile } from './files.mjs';
|
|
3
|
+
|
|
4
|
+
const getUserConfig = async (fileNames, ctx)=>{
|
|
5
|
+
for (const file of fileNames){
|
|
6
|
+
const filePath = path.join(ctx.appDir, 'src', 'admin', file);
|
|
7
|
+
const configFile = await loadFile(filePath);
|
|
8
|
+
if (configFile) {
|
|
9
|
+
return configFile;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { getUserConfig };
|
|
16
|
+
//# sourceMappingURL=config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.mjs","sources":["../../../../src/node/core/config.ts"],"sourcesContent":["import path from 'node:path';\n\nimport type { BuildContext } from '../create-build-context';\nimport { loadFile } from './files';\n\nconst getUserConfig = async <TConfig>(\n fileNames: string[],\n ctx: BuildContext\n): Promise<TConfig | undefined> => {\n for (const file of fileNames) {\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\nexport { getUserConfig };\n"],"names":["getUserConfig","fileNames","ctx","file","filePath","path","join","appDir","configFile","loadFile","undefined"],"mappings":";;;AAKMA,MAAAA,aAAAA,GAAgB,OACpBC,SACAC,EAAAA,GAAAA,GAAAA;IAEA,KAAK,MAAMC,QAAQF,SAAW,CAAA;QAC5B,MAAMG,QAAAA,GAAWC,KAAKC,IAAI,CAACJ,IAAIK,MAAM,EAAE,OAAO,OAASJ,EAAAA,IAAAA,CAAAA;QACvD,MAAMK,UAAAA,GAAa,MAAMC,QAASL,CAAAA,QAAAA,CAAAA;AAElC,QAAA,IAAII,UAAY,EAAA;YACd,OAAOA,UAAAA;AACT;AACF;IAEA,OAAOE,SAAAA;AACT;;;;"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var os = require('node:os');
|
|
4
|
+
var fs = require('node:fs/promises');
|
|
5
|
+
var path = require('node:path');
|
|
6
|
+
var semver = require('semver');
|
|
7
|
+
var resolveFrom = require('resolve-from');
|
|
8
|
+
var execa = require('execa');
|
|
9
|
+
var readPkgUp = require('read-pkg-up');
|
|
10
|
+
var managers = require('./managers.js');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* From V5 this will be imported from the package.json of `@strapi/strapi`.
|
|
14
|
+
*/ const PEER_DEPS = {
|
|
15
|
+
react: '^18.0.0',
|
|
16
|
+
'react-dom': '^18.0.0',
|
|
17
|
+
'react-router-dom': '^6.0.0',
|
|
18
|
+
'styled-components': '^6.0.0'
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Checks the user's project that it has declared and installed the required dependencies
|
|
22
|
+
* needed by the Strapi admin project. Whilst generally speaking most modules will be
|
|
23
|
+
* declared by the actual packages there are some packages where you only really want one of
|
|
24
|
+
* and thus they are declared as peer dependencies – react / styled-components / etc.
|
|
25
|
+
*
|
|
26
|
+
* If these deps are not installed or declared, then we prompt the user to correct this. In
|
|
27
|
+
* V4 this is not a hard requirement, but in V5 it will be. Might as well get people started now.
|
|
28
|
+
*/ const checkRequiredDependencies = async ({ cwd, logger })=>{
|
|
29
|
+
/**
|
|
30
|
+
* This enables us to use experimental deps for libraries like
|
|
31
|
+
* react or styled-components. This is useful for testing against.
|
|
32
|
+
*/ if (process.env.USE_EXPERIMENTAL_DEPENDENCIES === 'true') {
|
|
33
|
+
logger.warn('You are using experimental dependencies that may not be compatible with Strapi.');
|
|
34
|
+
return {
|
|
35
|
+
didInstall: false
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const pkg = await readPkgUp({
|
|
39
|
+
cwd
|
|
40
|
+
});
|
|
41
|
+
if (!pkg) {
|
|
42
|
+
throw new Error(`Could not find package.json at path: ${cwd}`);
|
|
43
|
+
}
|
|
44
|
+
logger.debug('Loaded package.json:', os.EOL, pkg.packageJson);
|
|
45
|
+
/**
|
|
46
|
+
* Run through each of the peer deps and figure out if they need to be
|
|
47
|
+
* installed or they need their version checked against.
|
|
48
|
+
*/ const { install, review } = Object.entries(PEER_DEPS).reduce((acc, [name, version])=>{
|
|
49
|
+
if (!pkg.packageJson.dependencies) {
|
|
50
|
+
throw new Error(`Could not find dependencies in package.json at path: ${cwd}`);
|
|
51
|
+
}
|
|
52
|
+
const declaredVersion = pkg.packageJson.dependencies[name];
|
|
53
|
+
if (!declaredVersion) {
|
|
54
|
+
acc.install.push({
|
|
55
|
+
name,
|
|
56
|
+
wantedVersion: version
|
|
57
|
+
});
|
|
58
|
+
} else {
|
|
59
|
+
acc.review.push({
|
|
60
|
+
name,
|
|
61
|
+
wantedVersion: version,
|
|
62
|
+
declaredVersion
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return acc;
|
|
66
|
+
}, {
|
|
67
|
+
install: [],
|
|
68
|
+
review: []
|
|
69
|
+
});
|
|
70
|
+
if (install.length > 0) {
|
|
71
|
+
logger.info('The Strapi admin needs to install the following dependencies:', os.EOL, install.map(({ name, wantedVersion })=>` - ${name}@${wantedVersion}`).join(os.EOL));
|
|
72
|
+
await installDependencies(install, {
|
|
73
|
+
cwd,
|
|
74
|
+
logger
|
|
75
|
+
});
|
|
76
|
+
const [file, ...args] = process.argv;
|
|
77
|
+
/**
|
|
78
|
+
* Re-run the same command after installation e.g. strapi build because the yarn.lock might
|
|
79
|
+
* not be the same and could break installations. It's not the best solution, but it works.
|
|
80
|
+
*/ await execa(file, args, {
|
|
81
|
+
cwd,
|
|
82
|
+
stdio: 'inherit'
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
didInstall: true
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (review.length) {
|
|
89
|
+
const errors = [];
|
|
90
|
+
for (const dep of review){
|
|
91
|
+
// The version specified in package.json could be incorrect, eg `foo`
|
|
92
|
+
let minDeclaredVersion = null;
|
|
93
|
+
try {
|
|
94
|
+
minDeclaredVersion = semver.minVersion(dep.declaredVersion);
|
|
95
|
+
} catch (err) {
|
|
96
|
+
// Intentional fall-through (variable will be left as null, throwing below)
|
|
97
|
+
}
|
|
98
|
+
if (!minDeclaredVersion) {
|
|
99
|
+
errors.push(`The declared dependency, ${dep.name} has an invalid version in package.json: ${dep.declaredVersion}`);
|
|
100
|
+
} else if (!semver.satisfies(minDeclaredVersion, dep.wantedVersion)) {
|
|
101
|
+
/**
|
|
102
|
+
* The delcared version should be semver compatible with our required version
|
|
103
|
+
* of the dependency. If it's not, we should advise the user to change it.
|
|
104
|
+
*/ logger.warn([
|
|
105
|
+
`Declared version of ${dep.name} (${minDeclaredVersion}) is not compatible with the version required by Strapi (${dep.wantedVersion}).`,
|
|
106
|
+
'You may experience issues, we recommend you change this.'
|
|
107
|
+
].join(os.EOL));
|
|
108
|
+
}
|
|
109
|
+
const installedVersion = await getModuleVersion(dep.name, cwd);
|
|
110
|
+
if (!installedVersion) {
|
|
111
|
+
/**
|
|
112
|
+
* TODO: when we know the packageManager we can advise the actual install command.
|
|
113
|
+
*/ errors.push(`The declared dependency, ${dep.name} is not installed. You should install before re-running this command`);
|
|
114
|
+
} else if (!semver.satisfies(installedVersion, dep.wantedVersion)) {
|
|
115
|
+
logger.warn([
|
|
116
|
+
`Declared version of ${dep.name} (${installedVersion}) is not compatible with the version required by Strapi (${dep.wantedVersion}).`,
|
|
117
|
+
'You may experience issues, we recommend you change this.'
|
|
118
|
+
].join(os.EOL));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (errors.length > 0 && process.env.NODE_ENV === 'development') {
|
|
122
|
+
throw new Error(`${os.EOL}- ${errors.join(`${os.EOL}- `)}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
didInstall: false
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const getModule = async (name, cwd)=>{
|
|
130
|
+
const modulePackagePath = resolveFrom.silent(cwd, path.join(name, 'package.json'));
|
|
131
|
+
if (!modulePackagePath) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const file = await fs.readFile(modulePackagePath, 'utf8').then((res)=>JSON.parse(res));
|
|
135
|
+
return file;
|
|
136
|
+
};
|
|
137
|
+
const getModuleVersion = async (name, cwd)=>{
|
|
138
|
+
const pkg = await getModule(name, cwd);
|
|
139
|
+
return pkg?.version || null;
|
|
140
|
+
};
|
|
141
|
+
const installDependencies = async (install, { cwd, logger })=>{
|
|
142
|
+
const packageManager = managers.getPackageManager();
|
|
143
|
+
if (!packageManager) {
|
|
144
|
+
logger.error('Could not find a supported package manager, please install the dependencies manually.');
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
const execOptions = {
|
|
148
|
+
encoding: 'utf8',
|
|
149
|
+
cwd,
|
|
150
|
+
stdio: 'inherit'
|
|
151
|
+
};
|
|
152
|
+
const packages = install.map(({ name, wantedVersion })=>`${name}@${wantedVersion}`);
|
|
153
|
+
let result;
|
|
154
|
+
if (packageManager === 'npm') {
|
|
155
|
+
const npmArgs = [
|
|
156
|
+
'install',
|
|
157
|
+
'--legacy-peer-deps',
|
|
158
|
+
'--save',
|
|
159
|
+
...packages
|
|
160
|
+
];
|
|
161
|
+
logger.info(`Running 'npm ${npmArgs.join(' ')}'`);
|
|
162
|
+
result = await execa('npm', npmArgs, execOptions);
|
|
163
|
+
} else if (packageManager === 'yarn') {
|
|
164
|
+
const yarnArgs = [
|
|
165
|
+
'add',
|
|
166
|
+
...packages
|
|
167
|
+
];
|
|
168
|
+
logger.info(`Running 'yarn ${yarnArgs.join(' ')}'`);
|
|
169
|
+
result = await execa('yarn', yarnArgs, execOptions);
|
|
170
|
+
} else if (packageManager === 'pnpm') {
|
|
171
|
+
const pnpmArgs = [
|
|
172
|
+
'add',
|
|
173
|
+
'--save-prod',
|
|
174
|
+
...packages
|
|
175
|
+
];
|
|
176
|
+
logger.info(`Running 'pnpm ${pnpmArgs.join(' ')}'`);
|
|
177
|
+
result = await execa('pnpm', pnpmArgs, execOptions);
|
|
178
|
+
}
|
|
179
|
+
if (result?.exitCode || result?.failed) {
|
|
180
|
+
throw new Error('Package installation failed');
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
exports.checkRequiredDependencies = checkRequiredDependencies;
|
|
185
|
+
exports.getModule = getModule;
|
|
186
|
+
//# sourceMappingURL=dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.js","sources":["../../../../src/node/core/dependencies.ts"],"sourcesContent":["import os from 'node:os';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\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': '^6.0.0',\n 'styled-components': '^6.0.0',\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}: Pick<BuildOptions, 'cwd' | 'logger'>): Promise<CheckRequiredDependenciesResult> => {\n /**\n * This enables us to use experimental deps for libraries like\n * react or styled-components. This is useful for testing against.\n */\n if (process.env.USE_EXPERIMENTAL_DEPENDENCIES === 'true') {\n logger.warn('You are using experimental dependencies that may not be compatible with Strapi.');\n return { didInstall: false };\n }\n\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 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 }\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"],"names":["PEER_DEPS","react","checkRequiredDependencies","cwd","logger","process","env","USE_EXPERIMENTAL_DEPENDENCIES","warn","didInstall","pkg","readPkgUp","Error","debug","os","EOL","packageJson","install","review","Object","entries","reduce","acc","name","version","dependencies","declaredVersion","push","wantedVersion","length","info","map","join","installDependencies","file","args","argv","execa","stdio","errors","dep","minDeclaredVersion","semver","minVersion","err","satisfies","installedVersion","getModuleVersion","NODE_ENV","getModule","modulePackagePath","resolveFrom","silent","path","fs","readFile","then","res","JSON","parse","packageManager","getPackageManager","error","exit","execOptions","encoding","packages","result","npmArgs","yarnArgs","pnpmArgs","exitCode","failed"],"mappings":";;;;;;;;;;;AAUA;;AAEC,IACD,MAAMA,SAAY,GAAA;IAChBC,KAAO,EAAA,SAAA;IACP,WAAa,EAAA,SAAA;IACb,kBAAoB,EAAA,QAAA;IACpB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