@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.
Files changed (54) hide show
  1. package/CHANGELOG.md +31 -5
  2. package/dist/cjs/actions/app-config/index.cjs +3 -3
  3. package/dist/cjs/actions/app-config/index.d.cts +3 -4
  4. package/dist/cjs/actions/association/index.d.cts +2 -3
  5. package/dist/cjs/actions/config/index.d.cts +2 -3
  6. package/dist/cjs/actions/installation/index.cjs +14 -7
  7. package/dist/cjs/actions/installation/index.d.cts +5 -5
  8. package/dist/cjs/actions/scope-tree/index.d.cts +2 -3
  9. package/dist/cjs/{app-Cf3EmtUh.d.cts → app-DwSqUkJA.d.cts} +122 -16
  10. package/dist/cjs/commands/index.cjs +91 -51
  11. package/dist/cjs/commands/templates/admin-ui/web-src/.babelrc +14 -0
  12. package/dist/cjs/commands/templates/business-configuration/config.js.template +7 -1
  13. package/dist/cjs/{common-B70f39vI.cjs → common-VSsQEHDv.cjs} +15 -2
  14. package/dist/cjs/config/index.browser.d.cts +1 -1
  15. package/dist/cjs/config/index.node.cjs +4 -3
  16. package/dist/cjs/config/index.node.d.cts +104 -50
  17. package/dist/{es/define-DSU8Kgu0.d.mts → cjs/define-Cc3AaVmY.d.cts} +1 -1
  18. package/dist/{es/index-COLnI6Ok.d.mts → cjs/index-C7dqTDHu.d.cts} +25 -3
  19. package/dist/cjs/index.d.cts +10 -10
  20. package/dist/cjs/{index.node-CXeIG8SS.cjs → index.node-vcOo1rt0.cjs} +1 -1
  21. package/dist/cjs/installation-D72LoQ_1.d.cts +39 -0
  22. package/dist/cjs/management/index.cjs +1 -1
  23. package/dist/cjs/management/index.d.cts +1 -1
  24. package/dist/cjs/{management-BhMdRr8i.cjs → management-Bki3hlxL.cjs} +207 -27
  25. package/dist/cjs/{openapi-DVJUTOXY.cjs → openapi-CAXgKam0.cjs} +317 -390
  26. package/dist/cjs/{validate-Dff0nrqM.cjs → validate-CwWYtRsS.cjs} +33 -2
  27. package/dist/cjs/{webhooks-E1KDx3Yu.cjs → webhooks-Bcq2Qy7q.cjs} +69 -8
  28. package/dist/es/actions/app-config/index.d.mts +3 -4
  29. package/dist/es/actions/app-config/index.mjs +3 -3
  30. package/dist/es/actions/association/index.d.mts +2 -3
  31. package/dist/es/actions/config/index.d.mts +2 -3
  32. package/dist/es/actions/installation/index.d.mts +5 -5
  33. package/dist/es/actions/installation/index.mjs +14 -7
  34. package/dist/es/actions/scope-tree/index.d.mts +2 -3
  35. package/dist/es/{app-Cf3EmtUh.d.mts → app-DwSqUkJA.d.mts} +122 -16
  36. package/dist/es/commands/index.mjs +92 -52
  37. package/dist/es/commands/templates/admin-ui/web-src/.babelrc +14 -0
  38. package/dist/es/commands/templates/business-configuration/config.js.template +7 -1
  39. package/dist/es/{common-BVG9tiX0.mjs → common-dy6NrZt8.mjs} +10 -3
  40. package/dist/es/config/index.browser.d.mts +1 -1
  41. package/dist/es/config/index.node.d.mts +104 -50
  42. package/dist/es/config/index.node.mjs +4 -4
  43. package/dist/{cjs/define-B-_oKmCe.d.cts → es/define-Bq1zw9Lr.d.mts} +1 -1
  44. package/dist/{cjs/index-CkwCGvut.d.cts → es/index-BryddQId.d.mts} +25 -3
  45. package/dist/es/index.d.mts +10 -10
  46. package/dist/es/{index.node-DRTF5Hue.mjs → index.node-CW46zuxW.mjs} +1 -1
  47. package/dist/es/installation-DqVDJ1ur.d.mts +39 -0
  48. package/dist/es/management/index.d.mts +1 -1
  49. package/dist/es/management/index.mjs +1 -1
  50. package/dist/es/{management-BTWQdJNO.mjs → management-DgwAhaaJ.mjs} +207 -27
  51. package/dist/es/{openapi-D18LT0Wp.mjs → openapi-BnR9OUac.mjs} +317 -390
  52. package/dist/es/{validate-8AXMGEwr.mjs → validate-NzW1FQwL.mjs} +29 -4
  53. package/dist/es/{webhooks-BQ8kSN2Z.mjs → webhooks-CHZ1SXxw.mjs} +64 -9
  54. 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-CXeIG8SS.cjs');
19
- const require_webhooks = require('../webhooks-E1KDx3Yu.cjs');
20
- const require_validate = require('../validate-Dff0nrqM.cjs');
21
- const require_common = require('../common-B70f39vI.cjs');
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-beta-20260820174436"
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
- /** Development dependencies required by the generated web-src app. */
396
- const WEB_SOURCE_DEV_DEPENDENCIES = [{
397
- name: "@types/react",
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: "@types/react-dom",
401
- version: "^19.2.3"
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 requiredDevDependencies = [...WEB_SOURCE_DEV_DEPENDENCIES, ...extension === "tsx" ? SHARED_TYPESCRIPT_DEV_DEPENDENCIES : []];
451
- const installPlan = await require_index_node.getPackageDependencyInstallPlan([...WEB_SOURCE_DEPENDENCIES, ...requiredDevDependencies], projectRoot);
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 dependencies = pkg.content.dependencies ?? {};
470
+ const existingDependencies = pkg.content.dependencies ?? {};
457
471
  const devDependencies = pkg.content.devDependencies ?? {};
458
- const dependencyMaps = [dependencies, devDependencies];
472
+ const dependencyMaps = [existingDependencies, devDependencies];
459
473
  const declaredDependencyNames = new Set(dependencyMaps.flatMap((depMap) => Object.keys(depMap)));
460
- const dependenciesToDeclare = [...WEB_SOURCE_DEPENDENCIES, ...requiredDevDependencies].filter(({ name }) => !declaredDependencyNames.has(name));
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
- "@parcel/bundler-default": {
467
- ...pkg.content["@parcel/bundler-default"],
468
- manualSharedBundles: WEB_SOURCE_SHARED_BUNDLES
469
- },
470
- "@parcel/resolver-default": {
471
- ...pkg.content["@parcel/resolver-default"],
472
- packageExports: true
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
- if ((0, fs.existsSync)(entrypointPath)) {
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 outputFiles = await copyWebSourceTemplates(sourceDir, targetDir, extension, appName, projectRoot);
569
- if (extension === "tsx") {
570
- const tsconfigPath = await writeWebSourceTypeScriptConfig(targetDir);
571
- outputFiles.push(` ${(0, path.relative)(projectRoot, tsconfigPath)}`);
572
- await syncWebSourceTypecheckScript(projectRoot);
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}"${isJson ? " with { type: \"json\" }" : ""};`,
1066
+ `import appConfig from "${configImportPath}"${importAttributes};`,
1029
1067
  "",
1030
1068
  isJson ? null : `export * from "${configImportPath}";`,
1031
- "export default appConfig;",
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.hasAdminUi(appManifest)) {
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.hasAdminUi(appManifest)) {
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 (domains.has("adminUi")) await addExtensionPointToAppConfig(BACKEND_UI_V2_EXTENSION_POINT_ID, projectRoot, " This extension is required for Admin UI. Do not remove.");
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.6.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 (domains.has("adminUi")) await addExtensionPointToInstallYaml(BACKEND_UI_V2_EXTENSION_POINT_ID, projectRoot, " This extension is required for Admin UI. Do not remove.");
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-beta-20260820174436`];
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 args = { configSchema: config.businessConfig.schema };
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-BhMdRr8i.cjs');
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 () {
@@ -12,5 +12,5 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { t as defineConfig } from "../define-B-_oKmCe.cjs";
15
+ import { t as defineConfig } from "../define-Cc3AaVmY.cjs";
16
16
  export { defineConfig };
@@ -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-CXeIG8SS.cjs');
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-E1KDx3Yu.cjs');
19
- const require_validate = require('../validate-Dff0nrqM.cjs');
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;