diff --git a/.vscode/settings.json b/.vscode/settings.json index fe28509..7909412 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,12 +3,6 @@ "typescript.enablePromptUseWorkspaceTsdk": true, "cSpell.words": ["netcanvas", "Tipbox"], "editor.defaultFormatter": "biomejs.biome", - "[typescriptreact]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[typescript]": { - "editor.defaultFormatter": "biomejs.biome" - }, "editor.codeActionsOnSave": { "source.organizeImports": "always", "source.fixAll": "always" diff --git a/apps/documentation/lib/writeSidebarJson.ts b/apps/documentation/lib/writeSidebarJson.ts index a6f0d6b..ead2c44 100644 --- a/apps/documentation/lib/writeSidebarJson.ts +++ b/apps/documentation/lib/writeSidebarJson.ts @@ -1,8 +1,8 @@ import "dotenv/config"; // This is essential here, because helper functions (below) use env variables, but they are not available in the Node.js environment without dotenv! This file is run directly in Node via tsc. import matter from "gray-matter"; -import { readFileSync, readdirSync, writeFileSync } from "node:fs"; +import { readdirSync, readFileSync, writeFileSync } from "node:fs"; import { join } from "node:path"; -import { type Locale, type TSideBar, locales } from "~/app/types"; +import { locales, type Locale, type SidebarLocaleDefinition, type TSideBar } from "~/app/types"; import { createFolderEntry, createPageEntry, @@ -25,7 +25,7 @@ function generateSidebarData() { // Set up initial structure for sidebar data. const sidebarData: TSideBar = locales.reduce((acc, locale) => { - acc[locale] = {} as TSideBar[Locale]; + acc[locale] = {} as SidebarLocaleDefinition; return acc; }, {} as TSideBar); @@ -34,16 +34,19 @@ function generateSidebarData() { for (const file of sortedFiles) { if (file.isDirectory()) { const metadata = getMetaDataForDirectory(join(file.path, file.name)); + const currentLocales = Object.keys(sidebarData); if (metadata.type === "project") { - for (const locale of Object.keys(sidebarData) as Locale[]) { + for (const l of currentLocales) { + const locale = l as Locale; + sidebarData[locale] = { ...sidebarData[locale], [file.name]: createProjectEntry(file, locale, metadata), }; } - return; + continue; } // If this is a folder, create a folder entry @@ -51,39 +54,45 @@ function generateSidebarData() { const nestedPath = getNestedPath(file.path); // Insert folder entry for each locale in the nested path - for (const locale of Object.keys(sidebarData) as Locale[]) { + for (const l of currentLocales) { + const locale = l as Locale; set(sidebarData[locale], [...nestedPath, file.name], createFolderEntry(file, locale, metadata)); } - return; + continue; } } // Only process files ending in .md or .mdx - if (!file.name.endsWith(".md") && !file.name.endsWith(".mdx")) return; + if (!file.name.endsWith(".md") && !file.name.endsWith(".mdx")) { + continue; + } // Determine locale based on file name (format is `index.en.mdx` or `index.en.md`) const locale = file.name.split(".")[1] as Locale | undefined; // If there's no locale, or the locale isn't included in the type, ignore it. if (!locale || !locales.includes(locale as Locale)) { + // eslint-disable-next-line no-console console.warn( `File ${file.name} is missing a locale or has a locale not defined in Locale. Locale is ${locale}. Skipping.`, ); - return; + continue; } - // create a key based on the filename without the locale or extension - // biome-ignore lint/style/noNonNullAssertion: filename is known to have a value here + // Create a key based on the filename without the locale or extension + // biome-ignore lint/style/noNonNullAssertion: structure is known const key = file.name.split(".")[0]!; - const nestedPath = getNestedPath(file.parentPath); + const nestedPath = getNestedPath(file.path); - const markdownFile = readFileSync(join(file.parentPath, file.name), "utf-8"); + const markdownFile = readFileSync(join(file.path, file.name), "utf-8"); const matterResult = matter(markdownFile); // If file has "hidden: true" in frontmatter, skip it - if (matterResult.data.hidden) return; + if (matterResult.data.hidden) { + continue; + } set(sidebarData[locale], [...nestedPath, key], createPageEntry(file, matterResult)); } @@ -94,7 +103,9 @@ function generateSidebarData() { try { const sidebarData = generateSidebarData(); - writeFileSync(join(process.cwd(), "public", "sidebar.json"), JSON.stringify(sidebarData, null, 2), "utf-8"); + writeFileSync(join(process.cwd(), "public", "sidebar.json"), JSON.stringify(sidebarData, null, "\t"), "utf-8"); } catch (e) { + // eslint-disable-next-line no-console console.log("Error writing sidebar data!", e); + throw e; } diff --git a/apps/documentation/public/sidebar.json b/apps/documentation/public/sidebar.json index 4bc7f5f..d8ef199 100644 --- a/apps/documentation/public/sidebar.json +++ b/apps/documentation/public/sidebar.json @@ -422,4 +422,4 @@ } } } -} +} \ No newline at end of file diff --git a/apps/documentation/public/sitemap-0.xml b/apps/documentation/public/sitemap-0.xml index b148fd2..a86bcbb 100644 --- a/apps/documentation/public/sitemap-0.xml +++ b/apps/documentation/public/sitemap-0.xml @@ -1,67 +1,67 @@ -https://documentation.networkcanvas.com/manifest.webmanifest2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/icon.svg2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/advanced-topics/network-canvas-graphml2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/advanced-topics/node-labelling2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/advanced-topics/protocol-file-format2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/advanced-topics/protocol-schema-information2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/getting-started/choosing-hardware2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/getting-started/configuring-devices2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/getting-started/installation-guide2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/categorical-bin2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/dyad-census2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/ego-form2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/information2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/large-roster-name-generator2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/name-generator-roster2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/name-generator-using-forms2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/name-generator-using-quick-add2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/narrative2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/ordinal-bin2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/per-alter-edge-form2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/per-alter-form2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/shared2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/small-roster-name-generator2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/sociogram2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/interface-documentation/tie-strength-census2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/additional-variables2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/codebook2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/field-validation2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/forms2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/input-controls2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/interfaces2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/network-filtering2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/preview-mode2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/prompts2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/resources2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/skip-logic2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/key-concepts/the-protocol-file2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/citing-the-software2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/contributing-code2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/faq2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/irb-best-practices2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/project-overview2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/requests-for-collaboration2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/project-information/security-model2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/tutorials/building-a-protocol2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/tutorials/protocol-and-data-workflows2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/tutorials/using-interviewer2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/tutorials/working-with-data2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/desktop/tutorials/working-with-rosters2024-11-20T19:47:48.014Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/about2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/advanced-topics/integration2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/deployment/advanced2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/deployment/cloud-pricing2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/deployment/guide2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/deployment/troubleshooting2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/deployment/upgrading2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/faq2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/sandbox2024-11-20T19:47:48.015Zdaily0.7 -https://documentation.networkcanvas.com/en/fresco/using-fresco2024-11-20T19:47:48.015Zdaily0.7 +https://documentation.networkcanvas.com/icon.svg2024-11-21T09:35:52.966Zdaily0.7 +https://documentation.networkcanvas.com2024-11-21T09:35:52.966Zdaily0.7 +https://documentation.networkcanvas.com/en2024-11-21T09:35:52.966Zdaily0.7 +https://documentation.networkcanvas.com/manifest.webmanifest2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/advanced-topics/network-canvas-graphml2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/advanced-topics/node-labelling2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/advanced-topics/protocol-file-format2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/advanced-topics/protocol-schema-information2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/getting-started/choosing-hardware2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/getting-started/configuring-devices2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/getting-started/installation-guide2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/categorical-bin2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/dyad-census2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/ego-form2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/information2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/large-roster-name-generator2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/name-generator-roster2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/name-generator-using-forms2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/name-generator-using-quick-add2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/narrative2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/ordinal-bin2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/per-alter-edge-form2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/per-alter-form2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/shared2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/small-roster-name-generator2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/sociogram2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/interface-documentation/tie-strength-census2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/additional-variables2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/codebook2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/field-validation2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/forms2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/input-controls2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/interfaces2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/network-filtering2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/preview-mode2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/prompts2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/resources2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/skip-logic2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/key-concepts/the-protocol-file2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/citing-the-software2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/contributing-code2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/faq2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/irb-best-practices2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/project-overview2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/requests-for-collaboration2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/project-information/security-model2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/tutorials/building-a-protocol2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/tutorials/protocol-and-data-workflows2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/tutorials/using-interviewer2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/tutorials/working-with-data2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/desktop/tutorials/working-with-rosters2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/about2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/advanced-topics/integration2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/deployment/advanced2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/deployment/cloud-pricing2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/deployment/guide2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/deployment/troubleshooting2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/deployment/upgrading2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/faq2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/sandbox2024-11-21T09:35:52.967Zdaily0.7 +https://documentation.networkcanvas.com/en/fresco/using-fresco2024-11-21T09:35:52.967Zdaily0.7 \ No newline at end of file diff --git a/biome.json b/biome.json index cd382fd..c019ae5 100644 --- a/biome.json +++ b/biome.json @@ -22,5 +22,8 @@ "clientKind": "git", "useIgnoreFile": true }, + "files": { + "ignore": ["public/**/*.*"] + }, "javascript": { "formatter": { "quoteStyle": "double" } } }