From e581691d80ca678cfc3cc3d9d9d30cc738f0be5f Mon Sep 17 00:00:00 2001 From: Daniel Sil Date: Mon, 27 Jan 2025 11:54:27 +0100 Subject: [PATCH] docs: adapt build to not include tracking --- docs/plugins/sandbox/gatsby-node.ts | 3 +- docs/plugins/sandbox/gatsby/onCreateNode.ts | 37 --------------------- 2 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 docs/plugins/sandbox/gatsby/onCreateNode.ts diff --git a/docs/plugins/sandbox/gatsby-node.ts b/docs/plugins/sandbox/gatsby-node.ts index c4a616d658..87eee6818c 100644 --- a/docs/plugins/sandbox/gatsby-node.ts +++ b/docs/plugins/sandbox/gatsby-node.ts @@ -1,5 +1,4 @@ import sourceNodes from "./gatsby/sourceNodes"; import createSchemaCustomization from "./gatsby/createSchemeCustomization"; -import onCreateNode from "./gatsby/onCreateNode"; -export { onCreateNode, sourceNodes, createSchemaCustomization }; +export { sourceNodes, createSchemaCustomization }; diff --git a/docs/plugins/sandbox/gatsby/onCreateNode.ts b/docs/plugins/sandbox/gatsby/onCreateNode.ts deleted file mode 100644 index 8c98be113c..0000000000 --- a/docs/plugins/sandbox/gatsby/onCreateNode.ts +++ /dev/null @@ -1,37 +0,0 @@ -import path from "path"; -import fs from "fs-extra"; - -// internal used components -const EXCLUDED = [ - "Translate", - "Icon", - "ErrorFormTooltip", - // used with different import names (probably ask to rename) - "Toast", - "SmartPassIllustrations", - "Seat", - "Stepper", -]; - -const getCurrentComponentsList = async () => { - const componentsPath = path.resolve(__dirname, "../../../../packages/orbit-components/src"); - const components = await fs - .readdir(componentsPath) - .then(data => - data.filter(n => /^\s*([A-Z]\w*\s*)*$/.test(n)).filter(n => !EXCLUDED.includes(n)), - ); - return components; -}; - -export default async function onCreateNode({ node, actions }) { - if (node.internal.type === "Tracking") { - const { createNodeField } = actions; - const currentComponents = await getCurrentComponentsList(); - - createNodeField({ - node, - name: "currentComponents", - value: currentComponents, - }); - } -}