@dotdev/headless-core-node
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -41,3 +41,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}); | ||
exports.writeRedirects = (config, firebase, file, data, createRedirect) => __awaiter(this, void 0, void 0, function* () { | ||
exports.writeRedirects = (config, firebase, file, data, createRedirect, gatsbyFile = false) => __awaiter(this, void 0, void 0, function* () { | ||
if (firebase && data.length) { | ||
@@ -58,2 +58,6 @@ const defaultRedirects = config.settings.defaultRedirects; | ||
] }), { spaces: 2 }); | ||
if (gatsbyFile) | ||
yield jsonfile.writeFileSync(gatsbyFile, { | ||
hosting: Object.assign(Object.assign({}, firebase.hosting.filter(site => site.public.includes("app/public"))[0]), { redirects: finalRedirects }), | ||
}, { spaces: 2 }); | ||
} | ||
@@ -66,4 +70,2 @@ }); | ||
data = data.filter(({ node }) => node && node.handle && (!node.tags || (node.tags && !node.tags.find(tag => tag === config.queries.products.hidden)))); | ||
if (config.queries.products.filterUnpublished) | ||
data = data.filter(({ node }) => node && node.shopify && !node.shopify.published); | ||
data.forEach(({ node }) => { | ||
@@ -87,4 +89,2 @@ var _a, _b, _c, _d, _e; | ||
data = data.filter(({ node }) => { var _a; return node && ((_a = node === null || node === void 0 ? void 0 : node.shopify) === null || _a === void 0 ? void 0 : _a.handle) && (!node.tags || (node.tags && !node.tags.find(tag => tag === config.queries.collections.hidden))); }); | ||
if (config.queries.collections.filterUnpublished) | ||
data = data.filter(({ node }) => node && node.shopify && !node.shopify.published); | ||
data.forEach(({ node }) => { | ||
@@ -91,0 +91,0 @@ var _a; |
{ | ||
"name": "@dotdev/headless-core-node", | ||
"description": "Node package for Headless Core", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"author": "DotDev <info@dotdev.com.au>", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
16581