create-brainerce-store 1.40.0 → 1.41.1
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 +32 -6
- package/messages/en.json +441 -435
- package/messages/he.json +441 -435
- package/package.json +2 -2
- package/templates/nextjs/base/package.json.ejs +3 -0
- package/templates/nextjs/base/src/app/faq/page.tsx.ejs +46 -46
- package/templates/nextjs/base/src/app/page.tsx +17 -6
- package/templates/nextjs/base/src/app/pages/[slug]/page.tsx.ejs +92 -87
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +5 -2
- package/templates/nextjs/base/src/components/content/announcement-bar.tsx.ejs +125 -125
- package/templates/nextjs/base/src/components/content/faq-section.tsx.ejs +103 -75
- package/templates/nextjs/base/src/components/content/rich-text-block.tsx.ejs +32 -32
- package/templates/nextjs/base/src/components/content/site-footer.tsx.ejs +164 -164
- package/templates/nextjs/base/src/components/content/site-header.tsx.ejs +166 -142
- package/templates/nextjs/base/src/components/seo/organization-json-ld.tsx +1 -1
- package/templates/nextjs/base/src/lib/sanitize.ts.ejs +26 -26
- package/templates/nextjs/base/src/lib/seo.ts +1 -4
- package/templates/nextjs/base/src/lib/utils.ts +21 -6
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.
|
|
34
|
+
version: "1.41.1",
|
|
35
35
|
description: "Scaffold a production-ready e-commerce storefront connected to Brainerce",
|
|
36
36
|
bin: {
|
|
37
37
|
"create-brainerce-store": "dist/index.js"
|
|
@@ -65,7 +65,7 @@ var require_package = __commonJS({
|
|
|
65
65
|
typescript: "^5.4.0"
|
|
66
66
|
},
|
|
67
67
|
engines: {
|
|
68
|
-
node: ">=
|
|
68
|
+
node: "^20.19.0 || ^22.13.0 || >=24.0.0"
|
|
69
69
|
},
|
|
70
70
|
keywords: [
|
|
71
71
|
"brainerce",
|
|
@@ -124,6 +124,25 @@ function validateProjectName(name) {
|
|
|
124
124
|
}
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
|
+
var MIN_NODE_RANGE = {
|
|
128
|
+
description: "^20.19.0 || ^22.13.0 || >=24.0.0",
|
|
129
|
+
ranges: [
|
|
130
|
+
{ major: 20, minMinor: 19 },
|
|
131
|
+
{ major: 22, minMinor: 13 }
|
|
132
|
+
],
|
|
133
|
+
minMajor: 24
|
|
134
|
+
};
|
|
135
|
+
function validateNodeVersion(versionString) {
|
|
136
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)/.exec(versionString);
|
|
137
|
+
if (!match) return null;
|
|
138
|
+
const major = Number(match[1]);
|
|
139
|
+
const minor = Number(match[2]);
|
|
140
|
+
if (major >= MIN_NODE_RANGE.minMajor) return null;
|
|
141
|
+
for (const range of MIN_NODE_RANGE.ranges) {
|
|
142
|
+
if (major === range.major && minor >= range.minMinor) return null;
|
|
143
|
+
}
|
|
144
|
+
return `Node ${versionString} is not supported. Brainerce storefronts depend on jsdom@29 (via isomorphic-dompurify), which requires Node ${MIN_NODE_RANGE.description}. Please upgrade Node \u2014 older versions cannot \`require()\` the ESM \`@exodus/bytes\` module and the dev server will crash on first request.`;
|
|
145
|
+
}
|
|
127
146
|
function validateApiUrl(url) {
|
|
128
147
|
if (!url) return null;
|
|
129
148
|
let parsed;
|
|
@@ -153,10 +172,12 @@ var ALLOWED_PACKAGE_MANAGERS = [
|
|
|
153
172
|
"bun"
|
|
154
173
|
];
|
|
155
174
|
var BRAINERCE_RUNTIME_DEPS = Object.freeze({
|
|
156
|
-
// 1.
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
|
|
175
|
+
// 1.27 = first published cut with client.content namespace (FAQ / Footer /
|
|
176
|
+
// Header / Announcement / RichText / Page) + getDirectionForLocale helper.
|
|
177
|
+
// Scaffolded stores need this minimum to use the content components shipped
|
|
178
|
+
// under src/components/content/ and the homepage RichTextBlock mount-point.
|
|
179
|
+
// 1.26 had the namespace in source but was published before the cut.
|
|
180
|
+
brainerce: "^1.27.0",
|
|
160
181
|
"isomorphic-dompurify": "^3.8.0"
|
|
161
182
|
});
|
|
162
183
|
|
|
@@ -677,6 +698,11 @@ program.name("create-brainerce-store").description("Scaffold a production-ready
|
|
|
677
698
|
).option("--language <lang>", "Store language (en, he)").option("--framework <framework>", "Framework to use", "nextjs").option("--theme <theme>", "Theme to apply", "minimal").option("--pkg-manager <manager>", "Package manager (npm, pnpm, yarn, bun)").option("--no-git", "Skip git initialization").option("--no-install", "Skip dependency installation").action(async (projectNameArg, options) => {
|
|
678
699
|
try {
|
|
679
700
|
logger.banner(pkg.version);
|
|
701
|
+
const nodeError = validateNodeVersion(process.versions.node);
|
|
702
|
+
if (nodeError) {
|
|
703
|
+
logger.error(nodeError);
|
|
704
|
+
process.exit(1);
|
|
705
|
+
}
|
|
680
706
|
const updateCheck = checkForUpdate(pkg.name, pkg.version);
|
|
681
707
|
let projectName = projectNameArg;
|
|
682
708
|
let scaffoldInPlace = false;
|