create-brainerce-store 1.27.2 → 1.27.3
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 +15 -59
- package/package.json +1 -1
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.27.
|
|
34
|
+
version: "1.27.3",
|
|
35
35
|
description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
|
|
36
36
|
bin: {
|
|
37
37
|
"create-brainerce-store": "dist/index.js"
|
|
@@ -163,29 +163,16 @@ async function installDependencies(projectDir, pkgManager) {
|
|
|
163
163
|
// src/cli.ts
|
|
164
164
|
async function runInteractive(defaults) {
|
|
165
165
|
const questions = [];
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
});
|
|
177
|
-
} else {
|
|
178
|
-
questions.push({
|
|
179
|
-
type: "text",
|
|
180
|
-
name: "projectName",
|
|
181
|
-
message: "Project name:",
|
|
182
|
-
initial: defaults.projectName,
|
|
183
|
-
validate: (value) => {
|
|
184
|
-
const error = validateProjectName(value);
|
|
185
|
-
return error || true;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
166
|
+
questions.push({
|
|
167
|
+
type: "text",
|
|
168
|
+
name: "projectName",
|
|
169
|
+
message: "Project name:",
|
|
170
|
+
initial: defaults.projectName || "",
|
|
171
|
+
validate: (value) => {
|
|
172
|
+
const error = validateProjectName(value);
|
|
173
|
+
return error || true;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
189
176
|
if (!defaults.connectionId) {
|
|
190
177
|
questions.push({
|
|
191
178
|
type: "text",
|
|
@@ -624,41 +611,10 @@ program.name("create-brainerce-store").description("Scaffold a production-ready
|
|
|
624
611
|
);
|
|
625
612
|
}
|
|
626
613
|
}
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
\u05D3: "d",
|
|
632
|
-
\u05D4: "h",
|
|
633
|
-
\u05D5: "v",
|
|
634
|
-
\u05D6: "z",
|
|
635
|
-
\u05D7: "ch",
|
|
636
|
-
\u05D8: "t",
|
|
637
|
-
\u05D9: "y",
|
|
638
|
-
\u05DB: "k",
|
|
639
|
-
\u05DA: "k",
|
|
640
|
-
\u05DC: "l",
|
|
641
|
-
\u05DE: "m",
|
|
642
|
-
\u05DD: "m",
|
|
643
|
-
\u05E0: "n",
|
|
644
|
-
\u05DF: "n",
|
|
645
|
-
\u05E1: "s",
|
|
646
|
-
\u05E2: "a",
|
|
647
|
-
\u05E4: "p",
|
|
648
|
-
\u05E3: "f",
|
|
649
|
-
\u05E6: "ts",
|
|
650
|
-
\u05E5: "ts",
|
|
651
|
-
\u05E7: "k",
|
|
652
|
-
\u05E8: "r",
|
|
653
|
-
\u05E9: "sh",
|
|
654
|
-
\u05EA: "t"
|
|
655
|
-
};
|
|
656
|
-
const transliterate = (s) => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").split("").map((ch) => HEBREW_TO_LATIN[ch] ?? ch).join("");
|
|
657
|
-
const slugify = (s) => {
|
|
658
|
-
const slug = transliterate(s).toLowerCase().trim().replace(/[^a-z0-9._-]+/g, "-").replace(/^[.-]+|[.-]+$/g, "").slice(0, 50);
|
|
659
|
-
return slug || "my-store";
|
|
660
|
-
};
|
|
661
|
-
const projectNameDefault = projectName || (storeInfo ? slugify(storeInfo.name) : void 0);
|
|
614
|
+
const slugify = (s) => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9._-]+/g, "-").replace(/^[.-]+|[.-]+$/g, "").slice(0, 50);
|
|
615
|
+
const channelSlug = storeInfo ? slugify(storeInfo.name) : "";
|
|
616
|
+
const storeSlug = storeInfo ? slugify(storeInfo.storeName) : "";
|
|
617
|
+
const projectNameDefault = projectName || channelSlug || storeSlug || void 0;
|
|
662
618
|
const languageDefault = language || storeInfo?.language;
|
|
663
619
|
if (!projectName || !connectionId || !language) {
|
|
664
620
|
const answers = await runInteractive({
|