create-brainerce-store 1.64.0 → 1.66.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.64.0",
34
+ version: "1.66.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"
@@ -201,7 +201,12 @@ var BRAINERCE_RUNTIME_DEPS = Object.freeze({
201
201
  // blog not-found paths call to 301 renamed slugs, and StoreInfo.seo gains
202
202
  // googleSiteVerification, which the scaffolded root layout renders as a
203
203
  // meta tag. Older SDKs fail type-check at scaffold time.
204
- brainerce: "^1.56.0",
204
+ // 1.57 adds automatic traffic attribution (brainerce_attr capture,
205
+ // auto-attached at setCheckoutCustomer/setShippingAddress) — powers the
206
+ // dashboard's "orders from ChatGPT/Google/…" reporting. No template code
207
+ // depends on it (fully automatic), but scaffolds should ship the SDK that
208
+ // actually reports attribution.
209
+ brainerce: "^1.58.0",
205
210
  "isomorphic-dompurify": "^3.8.0"
206
211
  });
207
212
 
@@ -471,6 +476,7 @@ async function scaffold(options) {
471
476
  const messagesRoot = findMessagesDir(__dirname);
472
477
  const targetMessages = import_path.default.join(targetDir, "messages");
473
478
  await import_fs_extra.default.ensureDir(targetMessages);
479
+ const safeLanguage = isValidLocale(options.language) ? options.language : "en";
474
480
  if (isMultiLocale) {
475
481
  for (const locale of supportedLocales) {
476
482
  const srcFile = import_path.default.join(messagesRoot, `${locale}.json`);
@@ -480,12 +486,12 @@ async function scaffold(options) {
480
486
  }
481
487
  const defaultFile = import_path.default.join(targetMessages, `${defaultLocale}.json`);
482
488
  if (!await import_fs_extra.default.pathExists(defaultFile)) {
483
- await import_fs_extra.default.copy(import_path.default.join(messagesRoot, `${options.language}.json`), defaultFile);
489
+ await import_fs_extra.default.copy(import_path.default.join(messagesRoot, `${safeLanguage}.json`), defaultFile);
484
490
  }
485
491
  } else {
486
492
  await import_fs_extra.default.copy(
487
- import_path.default.join(messagesRoot, `${options.language}.json`),
488
- import_path.default.join(targetMessages, `${options.language}.json`)
493
+ import_path.default.join(messagesRoot, `${safeLanguage}.json`),
494
+ import_path.default.join(targetMessages, `${safeLanguage}.json`)
489
495
  );
490
496
  }
491
497
  if (designName && designDir && !options.canvas) {