@adobe/aio-commerce-lib-app 2.0.0-beta-20260820174436 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -5
- package/dist/cjs/actions/app-config/index.cjs +3 -3
- package/dist/cjs/actions/app-config/index.d.cts +3 -4
- package/dist/cjs/actions/association/index.d.cts +2 -3
- package/dist/cjs/actions/config/index.d.cts +2 -3
- package/dist/cjs/actions/installation/index.cjs +14 -7
- package/dist/cjs/actions/installation/index.d.cts +5 -5
- package/dist/cjs/actions/scope-tree/index.d.cts +2 -3
- package/dist/cjs/{app-Cf3EmtUh.d.cts → app-DwSqUkJA.d.cts} +122 -16
- package/dist/cjs/commands/index.cjs +91 -51
- package/dist/cjs/commands/templates/admin-ui/web-src/.babelrc +14 -0
- package/dist/cjs/commands/templates/business-configuration/config.js.template +7 -1
- package/dist/cjs/{common-B70f39vI.cjs → common-VSsQEHDv.cjs} +15 -2
- package/dist/cjs/config/index.browser.d.cts +1 -1
- package/dist/cjs/config/index.node.cjs +4 -3
- package/dist/cjs/config/index.node.d.cts +104 -50
- package/dist/{es/define-DSU8Kgu0.d.mts → cjs/define-Cc3AaVmY.d.cts} +1 -1
- package/dist/{es/index-COLnI6Ok.d.mts → cjs/index-C7dqTDHu.d.cts} +25 -3
- package/dist/cjs/index.d.cts +10 -10
- package/dist/cjs/{index.node-CXeIG8SS.cjs → index.node-vcOo1rt0.cjs} +1 -1
- package/dist/cjs/installation-D72LoQ_1.d.cts +39 -0
- package/dist/cjs/management/index.cjs +1 -1
- package/dist/cjs/management/index.d.cts +1 -1
- package/dist/cjs/{management-BhMdRr8i.cjs → management-Bki3hlxL.cjs} +207 -27
- package/dist/cjs/{openapi-DVJUTOXY.cjs → openapi-CAXgKam0.cjs} +317 -390
- package/dist/cjs/{validate-Dff0nrqM.cjs → validate-CwWYtRsS.cjs} +33 -2
- package/dist/cjs/{webhooks-E1KDx3Yu.cjs → webhooks-Bcq2Qy7q.cjs} +69 -8
- package/dist/es/actions/app-config/index.d.mts +3 -4
- package/dist/es/actions/app-config/index.mjs +3 -3
- package/dist/es/actions/association/index.d.mts +2 -3
- package/dist/es/actions/config/index.d.mts +2 -3
- package/dist/es/actions/installation/index.d.mts +5 -5
- package/dist/es/actions/installation/index.mjs +14 -7
- package/dist/es/actions/scope-tree/index.d.mts +2 -3
- package/dist/es/{app-Cf3EmtUh.d.mts → app-DwSqUkJA.d.mts} +122 -16
- package/dist/es/commands/index.mjs +92 -52
- package/dist/es/commands/templates/admin-ui/web-src/.babelrc +14 -0
- package/dist/es/commands/templates/business-configuration/config.js.template +7 -1
- package/dist/es/{common-BVG9tiX0.mjs → common-dy6NrZt8.mjs} +10 -3
- package/dist/es/config/index.browser.d.mts +1 -1
- package/dist/es/config/index.node.d.mts +104 -50
- package/dist/es/config/index.node.mjs +4 -4
- package/dist/{cjs/define-B-_oKmCe.d.cts → es/define-Bq1zw9Lr.d.mts} +1 -1
- package/dist/{cjs/index-CkwCGvut.d.cts → es/index-BryddQId.d.mts} +25 -3
- package/dist/es/index.d.mts +10 -10
- package/dist/es/{index.node-DRTF5Hue.mjs → index.node-CW46zuxW.mjs} +1 -1
- package/dist/es/installation-DqVDJ1ur.d.mts +39 -0
- package/dist/es/management/index.d.mts +1 -1
- package/dist/es/management/index.mjs +1 -1
- package/dist/es/{management-BTWQdJNO.mjs → management-DgwAhaaJ.mjs} +207 -27
- package/dist/es/{openapi-D18LT0Wp.mjs → openapi-BnR9OUac.mjs} +317 -390
- package/dist/es/{validate-8AXMGEwr.mjs → validate-NzW1FQwL.mjs} +29 -4
- package/dist/es/{webhooks-BQ8kSN2Z.mjs → webhooks-CHZ1SXxw.mjs} +64 -9
- package/package.json +19 -19
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
const require_rolldown_runtime = require('../rolldown-runtime-CDQd2xEI.cjs');
|
|
17
17
|
const require_error = require('../error-D-N0PKSl.cjs');
|
|
18
|
-
const require_index_node = require('../index.node-
|
|
19
|
-
const require_webhooks = require('../webhooks-
|
|
20
|
-
const require_validate = require('../validate-
|
|
21
|
-
const require_common = require('../common-
|
|
18
|
+
const require_index_node = require('../index.node-vcOo1rt0.cjs');
|
|
19
|
+
const require_webhooks = require('../webhooks-Bcq2Qy7q.cjs');
|
|
20
|
+
const require_validate = require('../validate-CwWYtRsS.cjs');
|
|
21
|
+
const require_common = require('../common-VSsQEHDv.cjs');
|
|
22
22
|
const require_logging = require('../logging-Br3xfBNe.cjs');
|
|
23
23
|
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
24
24
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
@@ -371,13 +371,14 @@ const TSX_FILE_EXTENSION = ".tsx";
|
|
|
371
371
|
const APP_TITLE_PLACEHOLDER = "APP_TITLE";
|
|
372
372
|
const WEB_SOURCE_ENTRYPOINT_FILE = "index.html";
|
|
373
373
|
const WEB_SOURCE_IMPORT_ALIAS = "#web/*";
|
|
374
|
+
const WEB_SOURCE_REQUIRED_FILES = [".babelrc"];
|
|
374
375
|
const WEB_SOURCE_TSCONFIG_FILE = "tsconfig.json";
|
|
375
376
|
const LEADING_DOT_SLASH_PATTERN$1 = /^\.\//u;
|
|
376
377
|
/** Runtime dependencies required by the generated web-src app. */
|
|
377
378
|
const WEB_SOURCE_DEPENDENCIES = [
|
|
378
379
|
{
|
|
379
380
|
name: "@adobe/aio-commerce-lib-admin-ui",
|
|
380
|
-
version: "^1.1.0
|
|
381
|
+
version: "^1.1.0"
|
|
381
382
|
},
|
|
382
383
|
{
|
|
383
384
|
name: "react",
|
|
@@ -392,14 +393,26 @@ const WEB_SOURCE_DEPENDENCIES = [
|
|
|
392
393
|
version: "^1.5.1"
|
|
393
394
|
}
|
|
394
395
|
];
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
version: "^19.2.17"
|
|
396
|
+
const WEB_SOURCE_BABEL_DEV_DEPENDENCIES = [{
|
|
397
|
+
name: "@babel/core",
|
|
398
|
+
version: "^7.29.7"
|
|
399
399
|
}, {
|
|
400
|
-
name: "@
|
|
401
|
-
version: "^
|
|
400
|
+
name: "@babel/preset-react",
|
|
401
|
+
version: "^7.29.7"
|
|
402
402
|
}];
|
|
403
|
+
/** Development dependencies required by the generated web-src app. */
|
|
404
|
+
const WEB_SOURCE_DEV_DEPENDENCIES = [
|
|
405
|
+
...WEB_SOURCE_BABEL_DEV_DEPENDENCIES,
|
|
406
|
+
{
|
|
407
|
+
name: "@types/react",
|
|
408
|
+
version: "^19.2.17"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: "@types/react-dom",
|
|
412
|
+
version: "^19.2.3"
|
|
413
|
+
}
|
|
414
|
+
];
|
|
415
|
+
const WEB_SOURCE_REQUIRED_DEV_DEPENDENCIES = WEB_SOURCE_BABEL_DEV_DEPENDENCIES;
|
|
403
416
|
const WEB_SOURCE_SHARED_BUNDLES = [{
|
|
404
417
|
assets: ["**/@react-spectrum/s2/**", "src/commerce-backend-ui-2/web-src/*.{js,jsx,ts,tsx}"],
|
|
405
418
|
name: "s2-styles",
|
|
@@ -444,34 +457,37 @@ function getWebSourceEntrypoint(extConfig) {
|
|
|
444
457
|
* @param projectRoot - Resolved project root containing package.json.
|
|
445
458
|
* @param extension - Web source extension whose tooling is configured.
|
|
446
459
|
*/
|
|
447
|
-
async function prepareWebSourcePackage(projectRoot, extension) {
|
|
460
|
+
async function prepareWebSourcePackage(projectRoot, extension, scaffoldRequired) {
|
|
448
461
|
const pkg = await require_index_node.loadPackageJson(projectRoot);
|
|
449
462
|
if (pkg === null) throw new Error("Could not find package.json.");
|
|
450
|
-
const
|
|
451
|
-
const
|
|
463
|
+
const dependencies = scaffoldRequired ? WEB_SOURCE_DEPENDENCIES : [];
|
|
464
|
+
const requiredDevDependencies = scaffoldRequired ? [...WEB_SOURCE_DEV_DEPENDENCIES, ...extension === "tsx" ? SHARED_TYPESCRIPT_DEV_DEPENDENCIES : []] : WEB_SOURCE_REQUIRED_DEV_DEPENDENCIES;
|
|
465
|
+
const installPlan = await require_index_node.getPackageDependencyInstallPlan([...dependencies, ...requiredDevDependencies], projectRoot);
|
|
452
466
|
if (installPlan.incompatible.length > 0) {
|
|
453
467
|
const incompatibleDependencies = installPlan.incompatible.map(({ name, version, installedVersion }) => `${name}@${installedVersion} does not satisfy ${version}`).join("\n");
|
|
454
468
|
throw new Error(`Cannot scaffold web-src because installed dependencies are incompatible:\n${incompatibleDependencies}`);
|
|
455
469
|
}
|
|
456
|
-
const
|
|
470
|
+
const existingDependencies = pkg.content.dependencies ?? {};
|
|
457
471
|
const devDependencies = pkg.content.devDependencies ?? {};
|
|
458
|
-
const dependencyMaps = [
|
|
472
|
+
const dependencyMaps = [existingDependencies, devDependencies];
|
|
459
473
|
const declaredDependencyNames = new Set(dependencyMaps.flatMap((depMap) => Object.keys(depMap)));
|
|
460
|
-
const dependenciesToDeclare = [...
|
|
474
|
+
const dependenciesToDeclare = [...dependencies, ...requiredDevDependencies].filter(({ name }) => !declaredDependencyNames.has(name));
|
|
461
475
|
if (dependenciesToDeclare.length > 0) {
|
|
462
476
|
consola.consola.info("Adding web-src dependencies in package.json:");
|
|
463
477
|
consola.consola.log.raw((0, consola_utils.formatTree)(dependenciesToDeclare.map(({ name, version }) => ` ${name}@${version}`)));
|
|
464
478
|
} else consola.consola.info("web-src dependencies are already declared in package.json.");
|
|
465
479
|
pkg.update({
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
480
|
+
...scaffoldRequired && {
|
|
481
|
+
"@parcel/bundler-default": {
|
|
482
|
+
...pkg.content["@parcel/bundler-default"],
|
|
483
|
+
manualSharedBundles: WEB_SOURCE_SHARED_BUNDLES
|
|
484
|
+
},
|
|
485
|
+
"@parcel/resolver-default": {
|
|
486
|
+
...pkg.content["@parcel/resolver-default"],
|
|
487
|
+
packageExports: true
|
|
488
|
+
},
|
|
489
|
+
dependencies: require_index_node.mergePackageJsonDependencies(existingDependencies, WEB_SOURCE_DEPENDENCIES, dependencyMaps)
|
|
473
490
|
},
|
|
474
|
-
dependencies: require_index_node.mergePackageJsonDependencies(dependencies, WEB_SOURCE_DEPENDENCIES, dependencyMaps),
|
|
475
491
|
devDependencies: require_index_node.mergePackageJsonDependencies(devDependencies, requiredDevDependencies, dependencyMaps)
|
|
476
492
|
});
|
|
477
493
|
await pkg.save();
|
|
@@ -485,6 +501,20 @@ async function prepareWebSourcePackage(projectRoot, extension) {
|
|
|
485
501
|
runProjectInstall(packageManager, projectRoot);
|
|
486
502
|
}
|
|
487
503
|
/**
|
|
504
|
+
* Copies required web-src support files that are not already present.
|
|
505
|
+
* @param sourceDir - Directory containing required web source files.
|
|
506
|
+
* @param targetDir - Generated or existing web source directory.
|
|
507
|
+
* @param projectRoot - Resolved project root used to format output paths.
|
|
508
|
+
*/
|
|
509
|
+
async function copyMissingWebSourceFiles(sourceDir, targetDir, projectRoot) {
|
|
510
|
+
return (await Promise.all(WEB_SOURCE_REQUIRED_FILES.map(async (file) => {
|
|
511
|
+
const targetPath = (0, path.join)(targetDir, file);
|
|
512
|
+
if ((0, fs.existsSync)(targetPath)) return null;
|
|
513
|
+
await (0, fs_promises.copyFile)((0, path.join)(sourceDir, file), targetPath, fs.constants.COPYFILE_EXCL);
|
|
514
|
+
return ` ${(0, path.relative)(projectRoot, targetPath)}`;
|
|
515
|
+
}))).filter((path$10) => path$10 !== null);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
488
518
|
* Add the package import alias for an existing or generated web-src.
|
|
489
519
|
* @param extConfig - Extension config containing the view operation.
|
|
490
520
|
* @param projectRoot - Resolved project root containing package.json.
|
|
@@ -557,23 +587,29 @@ async function generateWebSrc(extConfig, appName, projectRoot, templatesDir = TE
|
|
|
557
587
|
const entrypoint = getWebSourceEntrypoint(extConfig);
|
|
558
588
|
if (entrypoint === null) return;
|
|
559
589
|
const entrypointPath = (0, path.join)(projectRoot, entrypoint);
|
|
560
|
-
|
|
561
|
-
consola.consola.info(`web-src entrypoint already exists, skipping scaffold: ${(0, path.relative)(projectRoot, entrypointPath)}`);
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
consola.consola.start(`Scaffolding web-src for ${BACKEND_UI_V2_EXTENSION_POINT_ID}...`);
|
|
565
|
-
const sourceDir = (0, path.join)(templatesDir, "admin-ui", "web-src");
|
|
590
|
+
const scaffoldRequired = !(0, fs.existsSync)(entrypointPath);
|
|
566
591
|
const targetDir = (0, path.dirname)(entrypointPath);
|
|
567
592
|
const extension = await resolveWebSourceExtension(projectRoot);
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
await
|
|
593
|
+
const sourceDir = (0, path.join)(templatesDir, "admin-ui", "web-src");
|
|
594
|
+
let outputFiles = [];
|
|
595
|
+
if (scaffoldRequired) {
|
|
596
|
+
consola.consola.start(`Scaffolding web-src for ${BACKEND_UI_V2_EXTENSION_POINT_ID}...`);
|
|
597
|
+
outputFiles = await copyWebSourceTemplates(sourceDir, targetDir, extension, appName, projectRoot);
|
|
598
|
+
if (extension === "tsx") {
|
|
599
|
+
const tsconfigPath = await writeWebSourceTypeScriptConfig(targetDir);
|
|
600
|
+
outputFiles.push(` ${(0, path.relative)(projectRoot, tsconfigPath)}`);
|
|
601
|
+
await syncWebSourceTypecheckScript(projectRoot);
|
|
602
|
+
}
|
|
603
|
+
} else consola.consola.info(`web-src entrypoint already exists, skipping scaffold: ${(0, path.relative)(projectRoot, entrypointPath)}`);
|
|
604
|
+
const requiredFiles = await copyMissingWebSourceFiles(sourceDir, targetDir, projectRoot);
|
|
605
|
+
if (scaffoldRequired || requiredFiles.length > 0) await prepareWebSourcePackage(projectRoot, extension, scaffoldRequired);
|
|
606
|
+
if (scaffoldRequired) {
|
|
607
|
+
consola.consola.success(`Scaffolded ${(0, path.relative)(projectRoot, targetDir)}`);
|
|
608
|
+
consola.consola.log.raw((0, consola_utils.formatTree)([...outputFiles, ...requiredFiles]));
|
|
609
|
+
} else if (requiredFiles.length > 0) {
|
|
610
|
+
consola.consola.success(`Added required files to ${(0, path.relative)(projectRoot, targetDir)}`);
|
|
611
|
+
consola.consola.log.raw((0, consola_utils.formatTree)(requiredFiles));
|
|
573
612
|
}
|
|
574
|
-
await prepareWebSourcePackage(projectRoot, extension);
|
|
575
|
-
consola.consola.success(`Scaffolded ${(0, path.relative)(projectRoot, targetDir)}`);
|
|
576
|
-
consola.consola.log.raw((0, consola_utils.formatTree)(outputFiles));
|
|
577
613
|
}
|
|
578
614
|
|
|
579
615
|
//#endregion
|
|
@@ -1021,14 +1057,16 @@ async function updateAppConfigImportAlias(projectRoot, runtimeConfigPath) {
|
|
|
1021
1057
|
async function writeJavaScriptAppConfigModule(configFilePath, outputPath) {
|
|
1022
1058
|
const configImportPath = normalizeImportPath((0, path.relative)((0, path.dirname)(outputPath), configFilePath));
|
|
1023
1059
|
const isJson = (0, path.extname)(configFilePath) === ".json";
|
|
1060
|
+
const importAttributes = isJson ? " with { type: \"json\" }" : "";
|
|
1061
|
+
const defaultExport = isJson ? `export default /** @type {import("@adobe/aio-commerce-lib-app/config").CommerceAppConfig} */ (appConfig);` : "export default appConfig;";
|
|
1024
1062
|
await (0, fs_promises.writeFile)(outputPath, [
|
|
1025
1063
|
"// This file has been auto-generated by `@adobe/aio-commerce-lib-app`",
|
|
1026
1064
|
"// Do not modify this file directly",
|
|
1027
1065
|
"",
|
|
1028
|
-
`import appConfig from "${configImportPath}"${
|
|
1066
|
+
`import appConfig from "${configImportPath}"${importAttributes};`,
|
|
1029
1067
|
"",
|
|
1030
1068
|
isJson ? null : `export * from "${configImportPath}";`,
|
|
1031
|
-
|
|
1069
|
+
defaultExport,
|
|
1032
1070
|
""
|
|
1033
1071
|
].filter((item) => item !== null).join("\n"), "utf-8");
|
|
1034
1072
|
}
|
|
@@ -1212,7 +1250,7 @@ async function run$8(appManifest, projectRoot, templatesDir = TEMPLATES_DIR) {
|
|
|
1212
1250
|
const businessConfigExtConfig = await updateExtConfig(appManifest, CONFIGURATION_EXTENSION_POINT_ID, projectRoot);
|
|
1213
1251
|
await generateActionFiles(appManifest, getRuntimeActions(businessConfigExtConfig, "business-configuration"), CONFIGURATION_EXTENSION_POINT_ID, templatesDir, projectRoot);
|
|
1214
1252
|
}
|
|
1215
|
-
if (require_webhooks.
|
|
1253
|
+
if (require_webhooks.hasBackendUiV2Components(appManifest)) {
|
|
1216
1254
|
const extConfig = await updateExtConfig(appManifest, BACKEND_UI_V2_EXTENSION_POINT_ID, projectRoot);
|
|
1217
1255
|
if (extConfig.operations?.view) {
|
|
1218
1256
|
await prepareWebSourceImportAlias(extConfig, projectRoot);
|
|
@@ -1621,7 +1659,7 @@ async function run$3(extension, projectRoot, templatesDir = TEMPLATES_DIR) {
|
|
|
1621
1659
|
return;
|
|
1622
1660
|
}
|
|
1623
1661
|
if (extension === "backend-ui/2") {
|
|
1624
|
-
if (require_webhooks.
|
|
1662
|
+
if (require_webhooks.hasBackendUiV2Components(appManifest)) {
|
|
1625
1663
|
const extConfig = await updateExtConfig(appManifest, BACKEND_UI_V2_EXTENSION_POINT_ID, projectRoot);
|
|
1626
1664
|
if (extConfig.operations?.view) {
|
|
1627
1665
|
await prepareWebSourceImportAlias(extConfig, projectRoot);
|
|
@@ -2041,11 +2079,12 @@ async function writePostinstallHook(execCommand, projectRoot) {
|
|
|
2041
2079
|
/**
|
|
2042
2080
|
* Ensures app.config.yaml references the enabled domain extensions.
|
|
2043
2081
|
* @param domains - Domains enabled in the app configuration.
|
|
2082
|
+
* @param config - The validated app configuration.
|
|
2044
2083
|
* @param projectRoot - Resolved project root containing app.config.yaml.
|
|
2045
2084
|
*/
|
|
2046
|
-
async function ensureAppConfig(domains, projectRoot) {
|
|
2085
|
+
async function ensureAppConfig(domains, config, projectRoot) {
|
|
2047
2086
|
if (domains.has("businessConfig.schema")) await addExtensionPointToAppConfig(CONFIGURATION_EXTENSION_POINT_ID, projectRoot, " This extension is required for business configuration. Do not remove.");
|
|
2048
|
-
if (
|
|
2087
|
+
if (require_webhooks.hasBackendUiV2Components(config)) await addExtensionPointToAppConfig(BACKEND_UI_V2_EXTENSION_POINT_ID, projectRoot, " This extension is required for Admin UI. Do not remove.");
|
|
2049
2088
|
await addExtensionPointToAppConfig(EXTENSIBILITY_EXTENSION_POINT_ID, projectRoot, " This extension is required for app management. Do not remove.");
|
|
2050
2089
|
}
|
|
2051
2090
|
/**
|
|
@@ -2056,7 +2095,7 @@ async function ensureAppConfig(domains, projectRoot) {
|
|
|
2056
2095
|
*/
|
|
2057
2096
|
function installDependencies(packageManager, domains, projectRoot) {
|
|
2058
2097
|
const packages = [];
|
|
2059
|
-
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.
|
|
2098
|
+
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.0`);
|
|
2060
2099
|
if (packages.length === 0) {
|
|
2061
2100
|
consola.consola.info("No additional domain dependencies to install.");
|
|
2062
2101
|
return;
|
|
@@ -2081,17 +2120,18 @@ async function runGeneration(appConfig, execCommand, projectRoot) {
|
|
|
2081
2120
|
/**
|
|
2082
2121
|
* Ensures install.yaml references the enabled domain extensions.
|
|
2083
2122
|
* @param domains - Domains enabled in the app configuration.
|
|
2123
|
+
* @param config - The validated app configuration.
|
|
2084
2124
|
* @param projectRoot - Resolved project root containing install.yaml.
|
|
2085
2125
|
*/
|
|
2086
|
-
async function ensureInstallYaml(domains, projectRoot) {
|
|
2126
|
+
async function ensureInstallYaml(domains, config, projectRoot) {
|
|
2087
2127
|
if (domains.has("businessConfig.schema")) await addExtensionPointToInstallYaml(CONFIGURATION_EXTENSION_POINT_ID, projectRoot, " This extension is required for business configuration. Do not remove.");
|
|
2088
|
-
if (
|
|
2128
|
+
if (require_webhooks.hasBackendUiV2Components(config)) await addExtensionPointToInstallYaml(BACKEND_UI_V2_EXTENSION_POINT_ID, projectRoot, " This extension is required for Admin UI. Do not remove.");
|
|
2089
2129
|
await addExtensionPointToInstallYaml(EXTENSIBILITY_EXTENSION_POINT_ID, projectRoot, " This extension is required for app management. Do not remove.");
|
|
2090
2130
|
}
|
|
2091
2131
|
|
|
2092
2132
|
//#endregion
|
|
2093
2133
|
//#region source/commands/init/main.ts
|
|
2094
|
-
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.0.0
|
|
2134
|
+
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.0.0`];
|
|
2095
2135
|
/**
|
|
2096
2136
|
* Initializes a Commerce App project.
|
|
2097
2137
|
* @param flags - Non-interactive initialization answers.
|
|
@@ -2116,8 +2156,8 @@ async function run(flags, extraOptions) {
|
|
|
2116
2156
|
await pkg.save();
|
|
2117
2157
|
if (isTypeScriptProject) await syncActionsTypecheckScript(projectRoot);
|
|
2118
2158
|
await runGeneration(config, execCommand, projectRoot);
|
|
2119
|
-
await ensureAppConfig(domains, projectRoot);
|
|
2120
|
-
await ensureInstallYaml(domains, projectRoot);
|
|
2159
|
+
await ensureAppConfig(domains, config, projectRoot);
|
|
2160
|
+
await ensureInstallYaml(domains, config, projectRoot);
|
|
2121
2161
|
await writePostinstallHook(execCommand, projectRoot);
|
|
2122
2162
|
consola.consola.success("Initialization complete!");
|
|
2123
2163
|
consola.consola.box([
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"development": {
|
|
4
|
+
"presets": [
|
|
5
|
+
["@babel/preset-react", { "runtime": "automatic", "development": true }]
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
"production": {
|
|
9
|
+
"presets": [
|
|
10
|
+
["@babel/preset-react", { "runtime": "automatic", "development": false }]
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -5,5 +5,11 @@ import { configRuntimeAction } from "@adobe/aio-commerce-lib-app/actions/config"
|
|
|
5
5
|
|
|
6
6
|
import config from "#app.commerce.config";
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const businessConfig = /** @type {NonNullable<typeof config.businessConfig>} */ (
|
|
9
|
+
config.businessConfig
|
|
10
|
+
);
|
|
11
|
+
const configSchema = /** @type {NonNullable<typeof businessConfig.schema>} */ (
|
|
12
|
+
businessConfig.schema
|
|
13
|
+
);
|
|
14
|
+
const args = { configSchema };
|
|
9
15
|
export const main = configRuntimeAction(args);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const require_management = require('./management-
|
|
15
|
+
const require_management = require('./management-Bki3hlxL.cjs');
|
|
16
16
|
let _adobe_aio_lib_state = require("@adobe/aio-lib-state");
|
|
17
17
|
let _adobe_aio_commerce_lib_core_headers = require("@adobe/aio-commerce-lib-core/headers");
|
|
18
18
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
@@ -469,6 +469,13 @@ async function getInstallationSnapshot() {
|
|
|
469
469
|
id: installSnapshot.id
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* Reads the persisted custom installation step history from a lifecycle snapshot's data. Returns
|
|
474
|
+
* `[]` when there's no snapshot or none was recorded (e.g. an install from before this feature).
|
|
475
|
+
*/
|
|
476
|
+
function getExecutedCustomInstallationSteps(data) {
|
|
477
|
+
return (data?.installation?.customInstallationSteps?.reconciliation)?.executedSteps ?? [];
|
|
478
|
+
}
|
|
472
479
|
/** Creates the shared storage read/write dependencies used by lifecycle orchestration. */
|
|
473
480
|
async function createLifecyclePersistence() {
|
|
474
481
|
const [stateStore, snapshotStore] = await Promise.all([createOrchestrationStateStore(), createAppStateSnapshotStore()]);
|
|
@@ -483,7 +490,7 @@ async function createLifecycleRuntime(params, appConfig, logger) {
|
|
|
483
490
|
return {
|
|
484
491
|
...await createLifecyclePersistence(),
|
|
485
492
|
lifecycleContext: buildLifecycleContext(params, appConfig, logger),
|
|
486
|
-
rootStep: require_management.createRootInstallationStep(appConfig)
|
|
493
|
+
rootStep: require_management.createRootInstallationStep(appConfig, { forUpgrade: true })
|
|
487
494
|
};
|
|
488
495
|
}
|
|
489
496
|
|
|
@@ -566,6 +573,12 @@ Object.defineProperty(exports, 'getCurrentLifecycleBaseline', {
|
|
|
566
573
|
return getCurrentLifecycleBaseline;
|
|
567
574
|
}
|
|
568
575
|
});
|
|
576
|
+
Object.defineProperty(exports, 'getExecutedCustomInstallationSteps', {
|
|
577
|
+
enumerable: true,
|
|
578
|
+
get: function () {
|
|
579
|
+
return getExecutedCustomInstallationSteps;
|
|
580
|
+
}
|
|
581
|
+
});
|
|
569
582
|
Object.defineProperty(exports, 'getStorageKey', {
|
|
570
583
|
enumerable: true,
|
|
571
584
|
get: function () {
|
|
@@ -13,15 +13,16 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_index_node = require('../index.node-
|
|
16
|
+
const require_index_node = require('../index.node-vcOo1rt0.cjs');
|
|
17
17
|
const require_define = require('../define-C-Xq1pCa.cjs');
|
|
18
|
-
const require_webhooks = require('../webhooks-
|
|
19
|
-
const require_validate = require('../validate-
|
|
18
|
+
const require_webhooks = require('../webhooks-Bcq2Qy7q.cjs');
|
|
19
|
+
const require_validate = require('../validate-CwWYtRsS.cjs');
|
|
20
20
|
|
|
21
21
|
exports.CommerceAppConfigSchemas = require_validate.CommerceAppConfigSchemas;
|
|
22
22
|
exports.defineConfig = require_define.defineConfig;
|
|
23
23
|
exports.getConfigDomains = require_validate.getConfigDomains;
|
|
24
24
|
exports.hasAdminUi = require_webhooks.hasAdminUi;
|
|
25
|
+
exports.hasBackendUiV2Components = require_webhooks.hasBackendUiV2Components;
|
|
25
26
|
exports.hasBusinessConfig = require_validate.hasBusinessConfig;
|
|
26
27
|
exports.hasBusinessConfigSchema = require_validate.hasBusinessConfigSchema;
|
|
27
28
|
exports.hasCommerceEvents = require_webhooks.hasCommerceEvents;
|