create-brainerce-store 1.25.0 → 1.27.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/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "create-brainerce-store",
34
- version: "1.25.0",
34
+ version: "1.27.0",
35
35
  description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
36
36
  bin: {
37
37
  "create-brainerce-store": "dist/index.js"
@@ -459,8 +459,11 @@ async function fetchStoreInfo(connectionId, baseUrl = KNOWN_API_URLS.production)
459
459
  } catch {
460
460
  throw new Error(`Invalid response from ${baseUrl}`);
461
461
  }
462
+ const storeName = json.storeName || json.name || "My Store";
463
+ const displayName = json.channelName || storeName;
462
464
  return {
463
- name: json.name || json.storeName || "My Store",
465
+ name: displayName,
466
+ storeName,
464
467
  currency: json.currency || "USD",
465
468
  language: json.language || "en",
466
469
  ...json.i18n ? { i18n: json.i18n } : {}
@@ -610,8 +613,9 @@ program.name("create-brainerce-store").description("Scaffold a production-ready
610
613
  resolvedApiUrl = resolved.apiBaseUrl;
611
614
  const envLabel = resolved.apiBaseUrl === KNOWN_API_URLS.staging ? " [staging]" : resolved.apiBaseUrl === KNOWN_API_URLS.production ? "" : ` [${resolved.apiBaseUrl}]`;
612
615
  const i18nStatus = storeInfo.i18n?.enabled && storeInfo.i18n.supportedLocales.length > 1 ? ` | i18n: ${storeInfo.i18n.supportedLocales.join(", ")}` : "";
616
+ const channelLabel = storeInfo.name !== storeInfo.storeName ? `"${storeInfo.name}" (channel in "${storeInfo.storeName}")` : `"${storeInfo.name}"`;
613
617
  prefetchSpinner.succeed(
614
- `Store: "${storeInfo.name}" | ${storeInfo.currency} | ${storeInfo.language}${i18nStatus}${envLabel}`
618
+ `Channel: ${channelLabel} | ${storeInfo.currency} | ${storeInfo.language}${i18nStatus}${envLabel}`
615
619
  );
616
620
  } catch (err) {
617
621
  prefetchSpinner.fail("Could not fetch store info");
@@ -658,15 +662,21 @@ program.name("create-brainerce-store").description("Scaffold a production-ready
658
662
  resolvedApiUrl = resolved.apiBaseUrl;
659
663
  const envLabel = resolved.apiBaseUrl === KNOWN_API_URLS.staging ? " [staging]" : resolved.apiBaseUrl === KNOWN_API_URLS.production ? "" : ` [${resolved.apiBaseUrl}]`;
660
664
  const i18nStatus = storeInfo.i18n?.enabled && storeInfo.i18n.supportedLocales.length > 1 ? ` | i18n: ${storeInfo.i18n.supportedLocales.join(", ")}` : "";
665
+ const channelLabel = storeInfo.name !== storeInfo.storeName ? `"${storeInfo.name}" (channel in "${storeInfo.storeName}")` : `"${storeInfo.name}"`;
661
666
  spinner.succeed(
662
- `Store: "${storeInfo.name}" | ${storeInfo.currency} | ${storeInfo.language}${i18nStatus}${envLabel}`
667
+ `Channel: ${channelLabel} | ${storeInfo.currency} | ${storeInfo.language}${i18nStatus}${envLabel}`
663
668
  );
664
669
  } catch (err) {
665
670
  spinner.fail("Could not fetch store info");
666
671
  logger.warn(
667
672
  err instanceof Error ? err.message : "Using defaults. Make sure the connection ID is correct and the Brainerce API is reachable."
668
673
  );
669
- storeInfo = { name: projectName, currency: "USD", language: "en" };
674
+ storeInfo = {
675
+ name: projectName,
676
+ storeName: projectName,
677
+ currency: "USD",
678
+ language: "en"
679
+ };
670
680
  }
671
681
  }
672
682
  if (!pkgManager) {