@akqa-denmark/shopify-theme-build 0.1.1 → 0.1.2
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.
|
@@ -81,7 +81,7 @@ var SCHEMA_TYPES = [
|
|
|
81
81
|
"section-blocks",
|
|
82
82
|
"section-groups"
|
|
83
83
|
];
|
|
84
|
-
var LIQUID_SCHEMA_TYPES = ["sections", "blocks"
|
|
84
|
+
var LIQUID_SCHEMA_TYPES = ["sections", "blocks"];
|
|
85
85
|
var LOCALE_SCHEMA_TYPES = [
|
|
86
86
|
"settings",
|
|
87
87
|
"configs",
|
|
@@ -301,8 +301,7 @@ ${spaces}}`;
|
|
|
301
301
|
};
|
|
302
302
|
var LIQUID_DIR_MAP = {
|
|
303
303
|
sections: "sections",
|
|
304
|
-
blocks: "blocks"
|
|
305
|
-
"section-blocks": "snippets"
|
|
304
|
+
blocks: "blocks"
|
|
306
305
|
};
|
|
307
306
|
async function buildLiquidSchema(filePath, schema, type, name, themeDir) {
|
|
308
307
|
const directory = LIQUID_DIR_MAP[type];
|
|
@@ -702,6 +701,8 @@ async function orchestrate(options) {
|
|
|
702
701
|
const paths = getStorePaths(config, store);
|
|
703
702
|
const startTime = Date.now();
|
|
704
703
|
log("info", `Building store: ${store}`);
|
|
704
|
+
const { createJiti } = await import("jiti");
|
|
705
|
+
const jiti = createJiti(config.rootDir);
|
|
705
706
|
const localeAccumulator = {};
|
|
706
707
|
for (const schemaType of SCHEMA_TYPES) {
|
|
707
708
|
const schemaDir = `${paths.schemasDir}/${schemaType}`;
|
|
@@ -720,8 +721,8 @@ async function orchestrate(options) {
|
|
|
720
721
|
batch.map(async (file) => {
|
|
721
722
|
const { name } = pathParse(file);
|
|
722
723
|
try {
|
|
723
|
-
const
|
|
724
|
-
let schema =
|
|
724
|
+
const mod = await jiti.import(resolve4(file));
|
|
725
|
+
let schema = mod.default || mod[formatToName(name, schemaType)];
|
|
725
726
|
if (typeof schema === "function") schema = schema();
|
|
726
727
|
if (!schema) return;
|
|
727
728
|
if (!skipSchemas && LIQUID_SCHEMA_TYPES.includes(schemaType)) {
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ var [, , command, ...args] = process.argv;
|
|
|
5
5
|
async function main() {
|
|
6
6
|
switch (command) {
|
|
7
7
|
case "prepare": {
|
|
8
|
-
const { runPrepare } = await import("./prepare-
|
|
8
|
+
const { runPrepare } = await import("./prepare-VXDIYQBN.js");
|
|
9
9
|
await runPrepare(args);
|
|
10
10
|
break;
|
|
11
11
|
}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var SCHEMA_TYPES = [
|
|
|
18
18
|
"section-blocks",
|
|
19
19
|
"section-groups"
|
|
20
20
|
];
|
|
21
|
-
var LIQUID_SCHEMA_TYPES = ["sections", "blocks"
|
|
21
|
+
var LIQUID_SCHEMA_TYPES = ["sections", "blocks"];
|
|
22
22
|
var LOCALE_SCHEMA_TYPES = [
|
|
23
23
|
"settings",
|
|
24
24
|
"configs",
|
|
@@ -211,8 +211,7 @@ ${spaces}}`;
|
|
|
211
211
|
};
|
|
212
212
|
var LIQUID_DIR_MAP = {
|
|
213
213
|
sections: "sections",
|
|
214
|
-
blocks: "blocks"
|
|
215
|
-
"section-blocks": "snippets"
|
|
214
|
+
blocks: "blocks"
|
|
216
215
|
};
|
|
217
216
|
async function buildLiquidSchema(filePath, schema, type, name, themeDir) {
|
|
218
217
|
const directory = LIQUID_DIR_MAP[type];
|
|
@@ -628,6 +627,8 @@ async function orchestrate(options) {
|
|
|
628
627
|
const paths = getStorePaths(config, store);
|
|
629
628
|
const startTime = Date.now();
|
|
630
629
|
log("info", `Building store: ${store}`);
|
|
630
|
+
const { createJiti } = await import("jiti");
|
|
631
|
+
const jiti = createJiti(config.rootDir);
|
|
631
632
|
const localeAccumulator = {};
|
|
632
633
|
for (const schemaType of SCHEMA_TYPES) {
|
|
633
634
|
const schemaDir = `${paths.schemasDir}/${schemaType}`;
|
|
@@ -646,8 +647,8 @@ async function orchestrate(options) {
|
|
|
646
647
|
batch.map(async (file) => {
|
|
647
648
|
const { name } = pathParse(file);
|
|
648
649
|
try {
|
|
649
|
-
const
|
|
650
|
-
let schema =
|
|
650
|
+
const mod = await jiti.import(resolve3(file));
|
|
651
|
+
let schema = mod.default || mod[formatToName(name, schemaType)];
|
|
651
652
|
if (typeof schema === "function") schema = schema();
|
|
652
653
|
if (!schema) return;
|
|
653
654
|
if (!skipSchemas && LIQUID_SCHEMA_TYPES.includes(schemaType)) {
|
package/dist/vite.js
CHANGED