From 93272ef1026396b19928821a5d7c69e6c4e997f5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:02:03 +0000 Subject: [PATCH] Update docusaurus monorepo to v3.0.1 (#163) * Update docusaurus monorepo to v3.0.1 | datasource | package | from | to | | ---------- | ------------------------------- | ----- | ----- | | npm | @docusaurus/core | 3.0.0 | 3.0.1 | | npm | @docusaurus/module-type-aliases | 3.0.0 | 3.0.1 | | npm | @docusaurus/preset-classic | 3.0.0 | 3.0.1 | | npm | @docusaurus/theme-mermaid | 3.0.0 | 3.0.1 | | npm | @docusaurus/tsconfig | 3.0.0 | 3.0.1 | | npm | @docusaurus/types | 3.0.0 | 3.0.1 | * ide: add word to dictionary * test * test * refactor: replace core.io file and dir operation code with deno api code * ci,fix: fix and improve doc processing * ci,fix: fix issue with dir check logic * ci,fix: fix issue and improve version side bar service * refactor: improve playground script * ide: adjust dictionaries * ide,config: improve and adjust deno settings * ide: improve launch configs * refactor: adjust imports * config: adjust settings and launch config * deps: update deno json and lock * ci: updated built status check and improved script * ci: make simple workflow improvement * ide: improve and update tasks * refactor: reformat code using deno fmt * config: exclude script from formatting * ide: add words to dictionary --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Calvin Wilkinson --- .github/cicd/.vscode/settings.json | 18 +- .github/cicd/core/DefaultDocTool.ts | 41 +-- .github/cicd/core/DocProcessor.ts | 103 ++++++-- .github/cicd/core/FileLoader.ts | 10 - .github/cicd/core/Utils.ts | 16 ++ .github/cicd/core/io/Directory.ts | 144 ---------- .github/cicd/core/io/File.ts | 104 -------- .github/cicd/core/io/Path.ts | 248 ------------------ .../core/services/DeleteAPIVersionService.ts | 29 +- .../services/MarkdownFileContentService.ts | 17 +- .../services/UpdateWebsiteVersionService.ts | 4 +- .../core/services/ValidateReleaseService.ts | 2 +- .../core/services/VersionSidebarService.ts | 28 +- .../cicd/core/services/VersionsFileService.ts | 30 ++- .github/cicd/deno.json | 64 ++--- .github/cicd/deno.lock | 84 ------ .github/cicd/deps.ts | 12 +- .../cicd/manual-testing/next-versioning.ts | 6 +- .github/cicd/manual-testing/testing-env.ts | 68 ++++- .github/cicd/playground.ts | 2 + .../cicd/scripts/create-docusaurus-version.ts | 4 +- .github/cicd/scripts/delete-api-docs.ts | 38 ++- .../cicd/scripts/delete-oldest-api-docs.ts | 16 +- .github/cicd/scripts/deno-check.ts | 52 ++-- .github/cicd/scripts/generate-new-api-docs.ts | 4 +- .github/cicd/scripts/update-tut-links.ts | 47 ++-- .../cicd/scripts/update-velaptor-nugets.ts | 34 +-- .../cicd/scripts/update-website-version.ts | 2 +- .../cicd/scripts/velaptor-version-exists.ts | 8 +- .github/workflows/build-status-check.yml | 6 +- .vscode/launch.json | 20 +- .vscode/settings.json | 12 +- .vscode/tasks.json | 38 ++- VelaptorDocs.code-workspace | 7 - package.json | 2 +- pnpm-lock.yaml | 237 ++++++++++++++++- 36 files changed, 706 insertions(+), 851 deletions(-) delete mode 100644 .github/cicd/core/FileLoader.ts delete mode 100644 .github/cicd/core/io/Directory.ts delete mode 100644 .github/cicd/core/io/File.ts delete mode 100644 .github/cicd/core/io/Path.ts diff --git a/.github/cicd/.vscode/settings.json b/.github/cicd/.vscode/settings.json index eb61a2a8..2c7c140e 100644 --- a/.github/cicd/.vscode/settings.json +++ b/.github/cicd/.vscode/settings.json @@ -1,15 +1,7 @@ { - "deno.enable": true, - "deno.enablePaths": ["${workspaceFolder}/../"], - "[typescript]": { - "editor.insertSpaces": false, - "editor.tabSize": 4, - }, - "editor.detectIndentation": false, - "cSpell.words": [ - "cicd", - "defaultdocumentation", - "kinsondigital", - "velaptor" - ], + "deno.enable": true, + "deno.config": "../deno.json", + "cSpell.words": [ + "cicd" + ], } diff --git a/.github/cicd/core/DefaultDocTool.ts b/.github/cicd/core/DefaultDocTool.ts index 2dbc73de..fe864026 100644 --- a/.github/cicd/core/DefaultDocTool.ts +++ b/.github/cicd/core/DefaultDocTool.ts @@ -1,7 +1,7 @@ -import { RepoClient } from "../deps.ts"; -import { Directory } from "io/Directory.ts"; -import { DotNetToolService } from "services/DotNetToolService.ts"; +import { existsSync, RepoClient } from "../deps.ts"; +import { DotNetToolService } from "./services/DotNetToolService.ts"; import { Utils } from "./Utils.ts"; +import { CLI } from "./CLI.ts"; /** * Provides ability to generate documentation. @@ -57,30 +57,31 @@ export class DefaultDocTool { await this.dotNetToolService.setupDotNetTools(this.defaultDocToolName, defaultDocToolVersion); - if (Directory.exists(outputDirPath)) { + if (existsSync(outputDirPath)) { Deno.removeSync(outputDirPath, { recursive: true }); } Deno.mkdirSync(outputDirPath, { recursive: true }); - const command = new Deno.Command("defaultdocumentation", { - args: [ - "--AssemblyFilePath", - `${assemblyPath}`, - "--OutputDirectoryPath", - `${outputDirPath}`, - "--ConfigurationFilePath", - `${configFilePath}`, - ], - }); + const cli = new CLI(); + + const args = [ + "--AssemblyFilePath", + `${assemblyPath}`, + "--OutputDirectoryPath", + `${outputDirPath}`, + "--ConfigurationFilePath", + `${configFilePath}`, + ]; - const { code, stdout, stderr } = await command.output(); + const command = `defaultdocumentation ${args.join(" ")}`; + const commandResult = await cli.runAsync(command); - if (code === 0) { - console.log(new TextDecoder().decode(stdout)); - } else { - console.log(new TextDecoder().decode(stderr)); - Deno.exit(code); + if (commandResult instanceof Error) { + Utils.printGitHubError(commandResult.message); + Deno.exit(1); } + + console.log(commandResult); } } diff --git a/.github/cicd/core/DocProcessor.ts b/.github/cicd/core/DocProcessor.ts index 2f239e7d..261bcaf8 100644 --- a/.github/cicd/core/DocProcessor.ts +++ b/.github/cicd/core/DocProcessor.ts @@ -1,14 +1,11 @@ -import { CloneRepoService } from "services/CloneRepoService.ts"; -import { MarkdownFileContentService } from "services/MarkdownFileContentService.ts"; -import { ValidateReleaseService } from "services/ValidateReleaseService.ts"; -import { MarkdownService } from "services/MarkdownService.ts"; +import { CloneRepoService } from "./services/CloneRepoService.ts"; +import { MarkdownFileContentService } from "./services/MarkdownFileContentService.ts"; +import { ValidateReleaseService } from "./services/ValidateReleaseService.ts"; +import { MarkdownService } from "./services/MarkdownService.ts"; import { DefaultDocTool } from "./DefaultDocTool.ts"; -import { Directory } from "io/Directory.ts"; -import { File } from "io/File.ts"; -import { Path } from "io/Path.ts"; import { Utils } from "./Utils.ts"; import { Yarn } from "./Yarn.ts"; -import chalk from "../deps.ts"; +import chalk, { existsSync, walkSync } from "../deps.ts"; /** * Generates and performs post-processing on Velaptor API documentation. @@ -86,9 +83,11 @@ export class DocProcessor { * @param tagOrBranch The Velaptor release tag or branch name. */ private async run(apiDocDirPath: string, tagOrBranch: string): Promise { + const cwd = Deno.cwd(); // Remove the RepoSrc directory if it exists. const repoSrcDirPath = `${Deno.cwd()}/RepoSrc`; - if (Directory.exists(repoSrcDirPath)) { + + if (existsSync(repoSrcDirPath)) { await this.runProcess( "Cleaning up previous clone and build. . .", () => Deno.removeSync(repoSrcDirPath, { recursive: true }), @@ -114,12 +113,18 @@ export class DocProcessor { // Generate the documentation. await this.runProcess( "Generating Documentation. . .", - () => - this.defaultDocTool.generateDocumentation( - `${Deno.cwd()}/RepoSrc/BuildOutput/Velaptor.dll`, - `${Deno.cwd()}/docs/api`, - `${Deno.cwd()}/default-doc-config.json`, - ), + () => { + const velaptorFilePath = this.findFilePaths(repoSrcDirPath, ["RepoSrc/BuildOutput/Velaptor.dll"]) + .filter((filePath) => filePath.endsWith("RepoSrc/BuildOutput/Velaptor.dll"))[0]; + + const docsApiDirPath = this.findDirPaths(cwd, ["docs/api"]) + .filter((dirPath) => dirPath.endsWith("docs/api"))[0]; + + const defaultDocConfigFilePath = this.findFilePaths(cwd, ["default-doc-config.json"]) + .filter((filePath) => filePath.endsWith("default-doc-config.json"))[0]; + + return this.defaultDocTool.generateDocumentation(docsApiDirPath, velaptorFilePath, defaultDocConfigFilePath); + }, "Documentation Generation Complete.", ); @@ -172,20 +177,20 @@ export class DocProcessor { * @param apiDocDirPath The directory path to the generated API documentation. */ private runPostProcessing(apiDocDirPath: string): void { - const baseAPIDirPath: string = Path.normalizeSeparators(apiDocDirPath); const fileContentService: MarkdownFileContentService = new MarkdownFileContentService(); const markDownService: MarkdownService = new MarkdownService(); try { - const oldNamespaceFilePath = `${baseAPIDirPath}index.md`; - const newNamespaceFilePath = `${baseAPIDirPath}Namespaces.md`; - File.renameFileSync(oldNamespaceFilePath, newNamespaceFilePath); + const oldNamespaceFilePath = `${apiDocDirPath}index.md`; + const newNamespaceFilePath = `${apiDocDirPath}Namespaces.md`; + + Deno.renameSync(oldNamespaceFilePath, newNamespaceFilePath); console.log(`File renamed from '${oldNamespaceFilePath}' to '${newNamespaceFilePath}'.`); console.log("Performing post-processing on the API documentation. . ."); // Replace the extra table column in the Namespaces.md file - let namespaceFileContent: string = File.readTextFileSync(newNamespaceFilePath); + let namespaceFileContent: string = Deno.readTextFileSync(newNamespaceFilePath); // Remove the extra column from the header and divider namespaceFileContent = namespaceFileContent.replace("| Namespaces | |", "| Namespaces |"); @@ -193,9 +198,15 @@ export class DocProcessor { // Remove the extra column from each row namespaceFileContent = namespaceFileContent.replaceAll(") | |", ") |"); - File.writeTextFileSync(newNamespaceFilePath, namespaceFileContent); + Deno.writeTextFileSync(newNamespaceFilePath, namespaceFileContent); + + const filePathEntries = walkSync(apiDocDirPath, { + includeDirs: false, + includeFiles: true, + exts: [".md"], + }); - const filePaths: string[] = Directory.getFiles(baseAPIDirPath, ".md"); + const filePaths: string[] = [...filePathEntries].map((entry) => entry.path); // Go through each file and perform content processing filePaths.forEach((filePath: string) => { @@ -203,14 +214,14 @@ export class DocProcessor { fileContentService.processMarkdownFile(filePath); }); - let namespaceContent: string = File.readTextFileSync(newNamespaceFilePath); + let namespaceContent: string = Deno.readTextFileSync(newNamespaceFilePath); namespaceContent = markDownService.renameHeader( namespaceContent, "Velaptor Assembly", "Velaptor API Namespaces", ); - File.writeTextFileSync(newNamespaceFilePath, namespaceContent); + Deno.writeTextFileSync(newNamespaceFilePath, namespaceContent); console.log("API documentation post-processing complete."); } catch (error) { @@ -218,4 +229,48 @@ export class DocProcessor { throw error; } } + + private findDirPaths(dirStartPath: string, inclusions: string[]): string[] { + inclusions = inclusions.map((inclusion) => inclusion.trim().replaceAll("\\", "/").replaceAll("/", "(/|\\\\)")); + const matches = inclusions.map((inclusion) => new RegExp(`.*${inclusion}.*`)); + + const entries = walkSync(dirStartPath, { + includeDirs: true, + includeFiles: false, + match: matches, + }); + + const result = [...entries].map((entry) => entry.path.replaceAll("\\", "/")); + + if (Utils.isNothing(result)) { + const errorMsg = `Could not find the directories relative to the directory '${dirStartPath}'.` + + `\nInclusions: ${inclusions.join(", ")}`; + Utils.printGitHubError(errorMsg); + Deno.exit(1); + } + + return result; + } + + private findFilePaths(dirStartPath: string, inclusions: string[]): string[] { + inclusions = inclusions.map((inclusion) => inclusion.trim().replaceAll("\\", "/").replaceAll("/", "(/|\\\\)")); + const matches = inclusions.map((inclusion) => new RegExp(`.*${inclusion}.*`)); + + const entries = walkSync(dirStartPath, { + includeDirs: false, + includeFiles: true, + match: matches, + }); + + const result = [...entries].map((entry) => entry.path.replaceAll("\\", "/")); + + if (Utils.isNothing(result)) { + const errorMsg = `Could not find the files relative to the directory '${dirStartPath}'.` + + `\nInclusions: ${inclusions.join(", ")}`; + Utils.printGitHubError(errorMsg); + Deno.exit(1); + } + + return result; + } } diff --git a/.github/cicd/core/FileLoader.ts b/.github/cicd/core/FileLoader.ts deleted file mode 100644 index 4d391b40..00000000 --- a/.github/cicd/core/FileLoader.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { File } from "io/File.ts"; - -export class FileLoader { - public readAllLinesSync(filePath: string): string[] { - const data = File.readTextFileSync(filePath); - const lines = data.split(/\r?\n/); - - return lines; - } -} diff --git a/.github/cicd/core/Utils.ts b/.github/cicd/core/Utils.ts index aa761a36..84c0658b 100644 --- a/.github/cicd/core/Utils.ts +++ b/.github/cicd/core/Utils.ts @@ -191,4 +191,20 @@ export class Utils { return 0; } + + /** + * Prints the given {@link errorMsg} to the console as a GitHub error. + * @param errorMsg The error message to print. + */ + public static printGitHubError(errorMsg: string): void { + console.log(`::error::${errorMsg}`); + } + + /** + * Prints the given {@link errorMsg} to the console as a GitHub notice. + * @param errorMsg The error message to print. + */ + public static printGitHubNotice(errorMsg: string): void { + console.log(`::notice::${errorMsg}`); + } } diff --git a/.github/cicd/core/io/Directory.ts b/.github/cicd/core/io/Directory.ts deleted file mode 100644 index e418d843..00000000 --- a/.github/cicd/core/io/Directory.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { Guard } from "../Guard.ts"; -import { Path } from "io/Path.ts"; -import { Utils } from "../Utils.ts"; - -/** - * Provides directory related operations. - */ -export class Directory { - /** - * Returns a value indicating whether or not the given directory path exists. - * @param {string} dirPath The directory path to check. - * @returns {boolean} True if the directory exists, otherwise false. - */ - public static exists(dirPath: string): boolean { - try { - return Deno.statSync(dirPath).isDirectory; - } catch (error) { - if (error instanceof (Deno.errors.NotFound)) { - return false; - } else { - throw error; - } - } - } - - /** - * Returns a value indicating whether or not the given directory path does not exist. - * @param {string} dirPath The directory path to check. - * @returns {boolean} True if the directory does not exist, otherwise false. - */ - public static doesNotExist(dirPath: string): boolean { - return !this.exists(dirPath); - } - - /** - * Gets a list of files in the given {@link dirPath}. This will search recursively - * if {@link recursive} is true. - * @param dirPath The path of the directory start searching. - * @param extension The file extension to search for. - * @param recursive True to search recursively, otherwise false. - * @returns {string[]} A list of files in the given {@link dirPath}. - */ - public static getFiles(dirPath: string, extension:string, recursive = false): string[] { - let files: string[] = []; - - extension = Utils.isNothing(extension) ? "*.*" : extension; - extension = extension.startsWith("*") ? extension.substring(1) : extension; - extension = extension.startsWith(".") ? extension : `.${extension}`; - - if (dirPath === undefined || dirPath === null || dirPath === "") { - const errorMsg = "The dirPath parameter cannot be null or empty."; - console.log(errorMsg); - Deno.exit(1); - } - - dirPath = dirPath === "." || dirPath === "/" ? "." : dirPath; - - for (const dirEntry of Deno.readDirSync(dirPath)) { - const entry = dirPath + "/" + dirEntry.name; - - if (recursive && dirEntry.isDirectory) { - files = [...files, ...(Directory.getFiles(entry, extension, recursive))]; - } else if (dirEntry.isFile) { - if (extension === "*.*") { - files.push(entry); - } else { - if (entry.endsWith(extension)) { - files.push(entry); - } - } - } - } - - return files; - } - - /** - * Returns all of the sub-directories of the given directory. - * @param {string} dirPath The path to the directory to get the sub-directories of. - * @returns {string[]} All of the sub-directories of the given directory. - */ - public static getDirs(dirPath: string): string[] { - Guard.isNotUndefinedOrEmpty(dirPath); - - if (Path.isNotDirPath(dirPath)) { - throw new Error(`The path '${dirPath}' is not a directory path.`); - } - - if (this.doesNotExist(dirPath)) { - throw new Error(`The path '${dirPath}' does not exist.`); - } - - dirPath = Path.normalizeSeparators(dirPath); - - const filePaths: string[] = []; - - for (const dirEntry of Deno.readDirSync(dirPath)) { - if (dirEntry.isDirectory) { - filePaths.push(`${dirPath}${dirEntry.name}`); - } - } - - return filePaths; - } - - /** - * Renames a directory from the old directory path to the new directory path. - * @param {string} oldDirPath The old directory to rename. - * @param {string} newDirPath The new directory name. - */ - public static rename(oldDirPath: string, newDirPath: string): void { - Guard.isNotUndefinedOrEmpty(oldDirPath, "oldDirPath"); - Guard.isNotUndefinedOrEmpty(newDirPath, "newDirPath"); - - const oldDirDoesNotExist: boolean = Directory.doesNotExist(oldDirPath); - - if (oldDirDoesNotExist && Directory.exists(newDirPath)) { - return; - } - - const oldDirLocation: string = Path.removeLastDir(oldDirPath); - const newDirLocation: string = Path.removeLastDir(newDirPath); - - if (oldDirLocation != newDirLocation) { - throw new Error(`The 'oldDirPath' and 'newDirPath' must be in the same directory.`); - } - - Deno.renameSync(oldDirPath, newDirPath); - } - - /** - * Deletes a directory and all of its contents recursively. - * @param {string} dirPath The path to the directory to delete. - */ - public static delete(dirPath: string): void { - if (Utils.isNothing(dirPath)) { - return; - } - - if (this.exists(dirPath)) { - Deno.removeSync(dirPath, { recursive: true }); - } - } -} diff --git a/.github/cicd/core/io/File.ts b/.github/cicd/core/io/File.ts deleted file mode 100644 index 2b238d75..00000000 --- a/.github/cicd/core/io/File.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { Guard } from "../Guard.ts"; -import { Path } from "./Path.ts"; -import { Utils } from "../Utils.ts"; - -/** - * Provides file related operations. - */ -export class File { - public static exists(filePath: string): boolean { - try { - return Deno.statSync(filePath).isFile; - } catch (error) { - if (error instanceof (Deno.errors.NotFound)) { - return false; - } else { - throw error; - } - } - } - - public static doesNotExist(filePath: string): boolean { - return !this.exists(filePath); - } - - public static readTextFileSync(filePath: string): string { - Guard.isNotUndefinedOrEmpty(filePath, "filePath"); - - if (this.doesNotExist(filePath)) { - throw new Error(`The file '${filePath}' does not exist.`); - } - - return Deno.readTextFileSync(filePath); - } - - public static writeTextFileSync(filePath: string, fileContent: string): void { - Guard.isNotUndefinedOrEmpty(filePath, "filePath"); - - if (Utils.isNothing(fileContent)) { - return; - } - - if (Utils.isNothing(filePath)) { - throw new Error(`The parameter '${filePath}' must not be null or empty.`); - } - - Deno.writeTextFileSync(filePath, fileContent, { - create: true, - }); - } - - public static renameFileSync(oldFilePath: string, newFilePath: string): void { - Guard.isNotUndefinedOrEmpty(oldFilePath, "oldFilePath"); - Guard.isNotUndefinedOrEmpty(newFilePath, "newFilePath"); - - if (!Path.isFilePath(oldFilePath)) { - throw new Error( - `The 'oldFilePath' parameter value of '${oldFilePath}' must be a file path, not a directory path.`, - ); - } - - if (!Path.isFilePath(newFilePath)) { - throw new Error( - `The 'newFilePath' parameter value of '${newFilePath}' must be a file path, not a directory path.`, - ); - } - - const oldFileDoesNotExist: boolean = File.doesNotExist(oldFilePath); - - if (oldFileDoesNotExist && File.exists(newFilePath)) { - return; - } - - const oldDirPath: string = Path.getDirectory(oldFilePath); - const newDirPath: string = Path.getDirectory(newFilePath); - - if (oldDirPath != newDirPath) { - throw new Error(`The 'oldFilePath' and 'newFilePath' must be in the same directory.`); - } - - if (Path.isFilePath(oldFilePath)) { - Deno.renameSync(oldFilePath, newFilePath); - } - } - - /** - * Deletes the specified file. - * @param {string} filePath The file to delete. - */ - public static deleteFile(filePath: string): void { - if (Utils.isNothing(filePath)) { - throw new Error(`The 'filePath' parameter must not be null or empty.`); - } - - if (File.doesNotExist(filePath)) { - throw new Error(`The file '${filePath}' does not exist.`); - } - - if (!Path.isFilePath(filePath)) { - throw new Error(`The path '${filePath}' is not a file path.`); - } - - Deno.removeSync(filePath); - } -} diff --git a/.github/cicd/core/io/Path.ts b/.github/cicd/core/io/Path.ts deleted file mode 100644 index 3191892f..00000000 --- a/.github/cicd/core/io/Path.ts +++ /dev/null @@ -1,248 +0,0 @@ -import { Utils } from "../Utils.ts"; -import { dirname, extname } from "../../deps.ts"; - -/** - * Provides path related operations. - */ -export class Path { - /** - * Gets the file name from the given file path. - * @param filePath The file path to get the file name from. - * @returns The file name. - */ - public static getFileName(filePath: string): string { - if (Utils.isNothing(filePath)) { - return ""; - } - - const hasPathSeparator = this.containsPathSeparator(filePath); - - if (hasPathSeparator) { - filePath = hasPathSeparator ? filePath = filePath.replace("\\", "/") : filePath; - - if (filePath.endsWith("/")) { - return ""; - } - - const pathSections = filePath.split("/"); - - return pathSections[pathSections.length - 1]; - } else { - return filePath; - } - } - - /** - * Gets the file name without the extension from the given file path. - * @param filePath The file path to get the file name from. - * @returns The file name without the extension. - */ - public static getFileNameWithoutExtension(filePath: string): string { - let fileName: string = this.getFileName(filePath); - - if (fileName.indexOf(".") === -1) { - return fileName; - } else { - const lastPeriodIndex: number = fileName.lastIndexOf("."); - fileName = fileName.replaceAll(".", "*"); - - let newFileName = ""; - for (let i = 0; i < fileName.length; i++) { - newFileName += i === lastPeriodIndex ? "." : fileName[i]; - } - - let sections: string[] = newFileName.split("."); - sections.pop(); // Remove the extension - - // Remove empty entires - sections = sections.filter((value: string) => value != ""); - - newFileName = sections[0]; - newFileName = newFileName.replaceAll("*", "."); - - return newFileName; - } - } - - /** - * Gets the directory path from the given file path. - * @param filePath The file path to get the directory from. - * @returns The directory path. - */ - public static getDirectory(filePath: string): string { - if (Utils.isNothing(filePath)) { - return ""; - } - - if (this.isFilePath(filePath)) { - const fileName: string = this.getFileName(filePath); - - return this.normalizeSeparators(filePath.replace(fileName, "")); - } - - return this.normalizeSeparators(filePath); - } - - /** - * Returns a value indicating whether or not the given {@link path} is a file path. - * @param path The path to check. - * @returns True if the path is a file path, otherwise false. - */ - public static isFilePath(path: string): boolean { - if (Utils.isNothing(path)) { - return false; - } - - return this.containsPathSeparator(path) && this.hasExtension(path); - } - - /** - * Returns a value indicating whether or not the given {@link path} has the given {@link extension}. - * @param path The path to check. - * @param extension The extension to check for. - * @returns True if the path has the given extension, otherwise false. - * @remarks If no extension is provided, then this will return true if the path any extension. - */ - public static hasExtension(path: string, extension = ""): boolean { - extension = extension === undefined ? "" : extension; - - extension = extension.startsWith("*") ? extension.slice(1, extension.length - 2) : extension; - - const pathExtension: string = extname(path); - - if (extension === "") { - return pathExtension != ""; - } else { - return pathExtension === extension; - } - } - - /** - * Gets the extension of the given file path. - * @param filePath The file path to get the extension from. - * @returns The extension of the file path. - */ - public static getExtension(filePath: string): string { - if (Utils.isNothing(filePath)) { - return ""; - } - - if (filePath.indexOf(".") === -1) { - return ""; - } - - return `.${filePath.split(".").pop()}`; - } - - /** - * Returns a value indicating whether or not the given {@link path} contains a path separator. - * @param path The path to check. - * @returns True if the path contains a path separator, otherwise false. - */ - public static containsPathSeparator(path: string): boolean { - if (Utils.isNothing(path)) { - return false; - } - - path = this.normalizeSeparators(path); - const containsForwardSlashes: boolean = path.indexOf("/") != -1; - - return containsForwardSlashes; - } - - /** - * Returns a value indicating whether or not the given {@link dirPath} is a directory path. - * @param dirPath The directory path to check. - * @returns True if the directory path is a directory path, otherwise false. - */ - public static isDirPath(dirPath: string): boolean { - if (Utils.isNothing(dirPath)) { - return false; - } - - dirPath = Path.normalizeSeparators(dirPath); - - const containsPathSeparator: boolean = this.containsPathSeparator(dirPath); - const doesNotContainExtension = !this.hasExtension(dirPath); - - return containsPathSeparator && doesNotContainExtension; - } - - /** - * Returns a value indicating whether or not the given {@link dirPath} is not a directory path. - * @param dirPath The directory path to check. - * @returns True if the directory path is not a directory path, otherwise false. - */ - public static isNotDirPath(dirPath: string): boolean { - return !this.isDirPath(dirPath); - } - - /** - * Normalizes the path separators to forward slashes. - * @param path The path to normalize. - * @returns The normalized path. - */ - public static normalizeSeparators(path: string): string { - if (Utils.isNothing(path)) { - return ""; - } - - path = path.replaceAll("\\", "/"); - - return path.endsWith("/") ? path : `${path}/`; - } - - /** - * Gets the the last directory name from the given directory path. - * @param dirPath The directory path to get the last directory name from. - * @returns The last directory name. - */ - public static getLastDirName(dirPath: string): string { - if (Utils.isNothing(dirPath)) { - return ""; - } - - const sectionToRemove = dirname(dirPath); - - const lastDir = dirPath.replace(`${sectionToRemove}/`, ""); - - return lastDir.endsWith("/") ? lastDir.slice(0, lastDir.length - 1) : lastDir; - } - - /** - * Returns a list of the last directory names from the directory paths. - * @param dirPaths The directory paths to pull the last directory name from. - * @returns The list of directory names from the directory paths. - */ - public static getLastDirNames(dirPaths: string[]): string[] { - dirPaths = Utils.isNothing(dirPaths) ? [] : dirPaths; - - const result: string[] = []; - - dirPaths.forEach(path => { - result.push(this.getLastDirName(path)); - }); - - return result; - } - - /** - * Removes the last directory from the given path. - * @param path The path to remove the last directory from. - * @returns The path with the last directory removed. - */ - public static removeLastDir(path: string): string { - if (Utils.isNothing(path)) { - return ""; - } - - if (!this.containsPathSeparator(path)) { - return path; - } - - const lastDirName: string = this.getLastDirName(path); - const lastDirIndex: number = path.lastIndexOf(lastDirName); - - return path.slice(0, lastDirIndex); - } -} diff --git a/.github/cicd/core/services/DeleteAPIVersionService.ts b/.github/cicd/core/services/DeleteAPIVersionService.ts index ff6fa998..a6bb7025 100644 --- a/.github/cicd/core/services/DeleteAPIVersionService.ts +++ b/.github/cicd/core/services/DeleteAPIVersionService.ts @@ -1,7 +1,8 @@ -import { Directory } from "io/Directory.ts"; import { Guard } from "../Guard.ts"; -import { VersionSideBarService } from "services/VersionSidebarService.ts"; -import { VersionsFileService } from "services/VersionsFileService.ts"; +import { VersionSideBarService } from "./VersionSidebarService.ts"; +import { VersionsFileService } from "./VersionsFileService.ts"; +import { walkSync } from "../../deps.ts"; +import { Utils } from "../Utils.ts"; /** * Deletes API docs for a specific version and updates the config files. @@ -9,13 +10,17 @@ import { VersionsFileService } from "services/VersionsFileService.ts"; export class DeleteAPIVersionService { private readonly versionFileService: VersionsFileService; private readonly sideBarService: VersionSideBarService; + private readonly baseDirPath: string; /** * Creates a new instance of the DeleteAPIVersionService class. + * @param {string} baseDirPath The directory path to start the deletion process. */ - constructor() { - this.versionFileService = new VersionsFileService(); + constructor(baseDirPath: string) { + this.versionFileService = new VersionsFileService(baseDirPath); this.sideBarService = new VersionSideBarService(); + + this.baseDirPath = baseDirPath; } /** @@ -27,15 +32,21 @@ export class DeleteAPIVersionService { version = version.startsWith("v") ? version.replace("v", "") : version; - const versionDirPaths: string[] = Directory.getDirs("./versioned_docs"); + const dirEntries = walkSync(this.baseDirPath, { + includeDirs: true, + includeFiles: false, + match: [new RegExp(`version-.+`, "gm")], + }); - const apiDocDirPath: string | undefined = versionDirPaths.find((p) => p.indexOf(version) != -1); + const apiDocDirPath = [...dirEntries].filter((entry) => entry.name === `version-${version}`) + .map((entry) => entry.path)[0]; - if (apiDocDirPath === undefined) { + if (Utils.isNothing(apiDocDirPath)) { throw new Error(`Could not find the API docs directory path for version '${version}'.`); } - Directory.delete(apiDocDirPath); + Deno.removeSync(apiDocDirPath, { recursive: true }); + console.log(`Deleted '${version}' API docs.`); this.versionFileService.deleteVersion(version); diff --git a/.github/cicd/core/services/MarkdownFileContentService.ts b/.github/cicd/core/services/MarkdownFileContentService.ts index 5ba69740..acb27b10 100644 --- a/.github/cicd/core/services/MarkdownFileContentService.ts +++ b/.github/cicd/core/services/MarkdownFileContentService.ts @@ -1,10 +1,9 @@ -import { File } from "io/File.ts"; -import { Path } from "io/Path.ts"; -import { CodeBlockService } from "services/CodeBlockService.ts"; -import { HTMLService } from "services/HTMLService.ts"; -import { MarkdownHeaderService } from "services/MarkdownHeaderService.ts"; -import { MarkdownService } from "services/MarkdownService.ts"; +import { CodeBlockService } from "./CodeBlockService.ts"; +import { HTMLService } from "./HTMLService.ts"; +import { MarkdownHeaderService } from "./MarkdownHeaderService.ts"; +import { MarkdownService } from "./MarkdownService.ts"; import { Utils } from "../Utils.ts"; +import { extname } from "../../deps.ts"; export class MarkdownFileContentService { private readonly markDownService: MarkdownService; @@ -25,7 +24,7 @@ export class MarkdownFileContentService { } public processMarkdownFile(filePath: string): void { - let fileContent: string = File.readTextFileSync(filePath); + let fileContent: string = Deno.readTextFileSync(filePath); fileContent = fileContent.replaceAll(this.htmlArrow, "→"); // Replace all links to the 'index.md' file with the 'namespaces.md' file @@ -55,12 +54,12 @@ export class MarkdownFileContentService { // Process all headers to change them to the appropriate size fileContent = this.markdownHeaderService.processHeaders(fileContent); - const title: string = Utils.underscoresToAngles(Path.getFileNameWithoutExtension(filePath)); + const title: string = Utils.underscoresToAngles(extname(filePath)); const frontMatter: string = this.markDownService.createFrontMatter(title); fileContent = `${frontMatter}${fileContent}`; - File.writeTextFileSync(filePath, fileContent); + Deno.writeTextFileSync(filePath, fileContent); } private processLinkTags(fileContent: string): string { diff --git a/.github/cicd/core/services/UpdateWebsiteVersionService.ts b/.github/cicd/core/services/UpdateWebsiteVersionService.ts index 939153fa..976d6f8d 100644 --- a/.github/cicd/core/services/UpdateWebsiteVersionService.ts +++ b/.github/cicd/core/services/UpdateWebsiteVersionService.ts @@ -1,4 +1,4 @@ -import { File } from "io/File.ts"; +import { existsSync } from "../../deps.ts"; /** * Updates the version in the docusaurus.config.js file. @@ -114,7 +114,7 @@ export class UpdateWebsiteVersionService { private saveToOutputFile(name: string, value: string): void { const output = `${name}=${value}`; - if (File.doesNotExist(this.outputFilePath)) { + if (existsSync(this.outputFilePath, { isDirectory: true, isReadable: true })) { throw new Error(`The GitHub outputs file '${this.outputFilePath}' does not exist.`); } diff --git a/.github/cicd/core/services/ValidateReleaseService.ts b/.github/cicd/core/services/ValidateReleaseService.ts index 6dc9daa0..3e8ab1ef 100644 --- a/.github/cicd/core/services/ValidateReleaseService.ts +++ b/.github/cicd/core/services/ValidateReleaseService.ts @@ -1,4 +1,4 @@ -import { TagClient, NuGetClient } from "../../deps.ts"; +import { NuGetClient, TagClient } from "../../deps.ts"; import { Utils } from "../Utils.ts"; /** diff --git a/.github/cicd/core/services/VersionSidebarService.ts b/.github/cicd/core/services/VersionSidebarService.ts index 58fe44bd..e123360c 100644 --- a/.github/cicd/core/services/VersionSidebarService.ts +++ b/.github/cicd/core/services/VersionSidebarService.ts @@ -1,17 +1,15 @@ -import { File } from "io/File.ts"; import { Guard } from "../Guard.ts"; +import { existsSync, walkSync } from "../../deps.ts"; +import { Utils } from "../Utils.ts"; /** * Provides management of versioned sidebars. */ export class VersionSideBarService { - private readonly sidebarDirPath: string; - /** * Creates a new instance of the VersionSideBarService class. */ constructor() { - this.sidebarDirPath = `${Deno.cwd()}/versioned_sidebars`; } /** @@ -21,15 +19,27 @@ export class VersionSideBarService { public deleteSideBar(version: string): void { Guard.isNotUndefinedOrEmpty(version, "version"); + const foundDirEntries = walkSync(Deno.cwd(), { + includeDirs: true, + includeFiles: false, + match: [new RegExp(`.*versioned_sidebars.*`, "gm")], + }); + + const foundDirs = [...foundDirEntries].map((entry) => entry.path); + + if (foundDirs.length <= 0) { + const errorMsg = "Could not find the versioned sidebar directory 'versioned_sidebars'."; + Utils.printGitHubError(errorMsg); + Deno.exit(1); + } + // If the version begins with a 'v', remove it version = version.startsWith("v") ? version.replace("v", "") : version; - const sidebarFilePath = `${this.sidebarDirPath}/version-${version}-sidebars.json`; + const sidebarFilePath = `${sidebarDirPath}/version-${version}-sidebars.json`; - if (File.doesNotExist(sidebarFilePath)) { - throw new Error(`Could not find the sidebar file for version '${version}'.`); + if (existsSync(sidebarFilePath, { isDirectory: true, isReadable: true })) { + Deno.removeSync(sidebarFilePath); } - - File.deleteFile(sidebarFilePath); } } diff --git a/.github/cicd/core/services/VersionsFileService.ts b/.github/cicd/core/services/VersionsFileService.ts index cef228a1..1f815937 100644 --- a/.github/cicd/core/services/VersionsFileService.ts +++ b/.github/cicd/core/services/VersionsFileService.ts @@ -1,4 +1,4 @@ -import { extname } from "../../deps.ts"; +import { basename, extname, walkSync } from "../../deps.ts"; import { Guard } from "../Guard.ts"; import { Utils } from "../Utils.ts"; @@ -9,9 +9,30 @@ export class VersionsFileService { private readonly newLine: string; private readonly filePath: string; - constructor() { + /** + * Creates a new instance of the ${@link VersionsFileService} class. + * @param {string} dirPath The directory path to start searching for the versions file. + */ + constructor(dirPath: string) { this.newLine = Deno.build.os === "windows" ? "\r\n" : "\n"; - this.filePath = `${Deno.cwd()}/versions.json`; + + const filePathEntries = walkSync(dirPath, { + includeDirs: false, + includeFiles: true, + exts: [".json"], + match: [new RegExp("versions")], + skip: [new RegExp("node_modules")], + }); + + const foundFilePath = [...filePathEntries] + .map((entry) => entry.path) + .find((path) => basename(path) === "versions.json"); + + if (Utils.isNothing(foundFilePath)) { + throw new Error(`The versions file 'version.json' could not be found in the directory '${dirPath}'.`); + } + + this.filePath = foundFilePath; } /** @@ -36,6 +57,9 @@ export class VersionsFileService { console.log(`\tDeleted version '${version}' from '${this.filePath}'`); } + /** + * Enables the testing version of the api docs. + */ public enableTestVersion(): void { if (this.filePath === undefined || this.filePath === "") { throw new Error("The 'this.filePath' parameter must not be null or empty."); diff --git a/.github/cicd/deno.json b/.github/cicd/deno.json index d511c6ac..367015d3 100644 --- a/.github/cicd/deno.json +++ b/.github/cicd/deno.json @@ -16,7 +16,9 @@ "**/blog/", "**/RepoSrc/", "**/versioned_docs/", - "**/unprocessed-docs/" + "**/SampleProjects/", + "**/unprocessed-docs/", + "playground.ts" ], "useTabs": true, "lineWidth": 130, @@ -24,31 +26,26 @@ "semiColons": true, "singleQuote": false }, + "nodeModulesDir": false, "lint": { - "include": [".github/cicd/.*\\.ts$"], + "include": ["./.github/cicd/.*\\.ts$"], "exclude": [ - "**/playground.ts", - "README.md", - "versions.json", - "tsconfig.json", - "package.json", - "package-lock.json", - "deno.json", - "settings.json", - "default-doc-config.json", - "sidebars.js", - "docusaurus.config.js", - "babel.config.js", + "**/*.json", + "**/*.md", + "**/*.mdx", + "**/*.js", ".docusaurus/", - "code_coverage/", - "build/", - "src/", - "static/", - "versioned_docs/", - "versioned_sidebars/", - "docs/", - "blog/", - "RepoSrc/" + "**/code_coverage/", + "**/build/", + "**/src/", + "**/static/", + "**/versioned_docs/", + "**/versioned_sidebars/", + "**/SampleProjects/", + "**/node_modules/", + "**/docs/", + "**/blog/", + "**/RepoSrc/" ], "rules": { "include": [ @@ -57,7 +54,6 @@ } }, "exclude": [ - "**/playground.ts", "**/*.md", "**/*.mdx", "**/*.json", @@ -69,15 +65,13 @@ "docs/", "src/", "static/", - "SampleProjects/", - "versioned_docs/", - "versioned_sidebars/", - "blog/", - "build/", - "RepoSrc/" - ], - "imports": { - "io/": "./core/io/", - "services/": "./core/services/" - } + "**/SampleProjects/", + "**/versioned_docs/", + "**/versioned_sidebars/", + "**/node_modules/", + "**/package.json", + "**/blog/", + "**/build/", + "**/RepoSrc/" + ] } diff --git a/.github/cicd/deno.lock b/.github/cicd/deno.lock index bc90669c..01e53708 100644 --- a/.github/cicd/deno.lock +++ b/.github/cicd/deno.lock @@ -104,90 +104,6 @@ "https://deno.land/std@0.204.0/assert/unreachable.ts": "4600dc0baf7d9c15a7f7d234f00c23bca8f3eba8b140286aaca7aa998cf9a536", "https://deno.land/std@0.204.0/fmt/colors.ts": "c51c4642678eb690dcf5ffee5918b675bf01a33fba82acf303701ae1a4f8c8d9", "https://deno.land/std@0.204.0/testing/mock.ts": "6576b4aa55ee20b1990d656a78fff83599e190948c00e9f25a7f3ac5e9d6492d", - "https://deno.land/std@0.205.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", - "https://deno.land/std@0.205.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", - "https://deno.land/std@0.205.0/fs/_util.ts": "fbf57dcdc9f7bc8128d60301eece608246971a7836a3bb1e78da75314f08b978", - "https://deno.land/std@0.205.0/fs/copy.ts": "ca19e4837965914471df38fbd61e16f9e8adfe89f9cffb0c83615c83ea3fc2bf", - "https://deno.land/std@0.205.0/fs/empty_dir.ts": "0b4a2508232446eed232ad1243dd4b0f07ac503a281633ae1324d1528df70964", - "https://deno.land/std@0.205.0/fs/ensure_dir.ts": "dc64c4c75c64721d4e3fb681f1382f803ff3d2868f08563ff923fdd20d071c40", - "https://deno.land/std@0.205.0/fs/ensure_file.ts": "39ac83cc283a20ec2735e956adf5de3e8a3334e0b6820547b5772f71c49ae083", - "https://deno.land/std@0.205.0/fs/ensure_link.ts": "c15e69c48556d78aae31b83e0c0ece04b7b8bc0951412f5b759aceb6fde7f0ac", - "https://deno.land/std@0.205.0/fs/ensure_symlink.ts": "b389c8568f0656d145ac7ece472afe710815cccbb2ebfd19da7978379ae143fe", - "https://deno.land/std@0.205.0/fs/eol.ts": "f1f2eb348a750c34500741987b21d65607f352cf7205f48f4319d417fff42842", - "https://deno.land/std@0.205.0/fs/exists.ts": "cb59a853d84871d87acab0e7936a4dac11282957f8e195102c5a7acb42546bb8", - "https://deno.land/std@0.205.0/fs/expand_glob.ts": "4f98c508fc9e40d6311d2f7fd88aaad05235cc506388c22dda315e095305811d", - "https://deno.land/std@0.205.0/fs/mod.ts": "bc3d0acd488cc7b42627044caf47d72019846d459279544e1934418955ba4898", - "https://deno.land/std@0.205.0/fs/move.ts": "b4f8f46730b40c32ea3c0bc8eb0fd0e8139249a698883c7b3756424cf19785c9", - "https://deno.land/std@0.205.0/fs/walk.ts": "c1e6b43f72a46e89b630140308bd51a4795d416a416b4cfb7cd4bd1e25946723", - "https://deno.land/std@0.205.0/path/_common/assert_path.ts": "061e4d093d4ba5aebceb2c4da3318bfe3289e868570e9d3a8e327d91c2958946", - "https://deno.land/std@0.205.0/path/_common/basename.ts": "0d978ff818f339cd3b1d09dc914881f4d15617432ae519c1b8fdc09ff8d3789a", - "https://deno.land/std@0.205.0/path/_common/common.ts": "9e4233b2eeb50f8b2ae10ecc2108f58583aea6fd3e8907827020282dc2b76143", - "https://deno.land/std@0.205.0/path/_common/constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", - "https://deno.land/std@0.205.0/path/_common/dirname.ts": "2ba7fb4cc9fafb0f38028f434179579ce61d4d9e51296fad22b701c3d3cd7397", - "https://deno.land/std@0.205.0/path/_common/format.ts": "11aa62e316dfbf22c126917f5e03ea5fe2ee707386555a8f513d27ad5756cf96", - "https://deno.land/std@0.205.0/path/_common/from_file_url.ts": "ef1bf3197d2efbf0297a2bdbf3a61d804b18f2bcce45548ae112313ec5be3c22", - "https://deno.land/std@0.205.0/path/_common/glob_to_reg_exp.ts": "5c3c2b79fc2294ec803d102bd9855c451c150021f452046312819fbb6d4dc156", - "https://deno.land/std@0.205.0/path/_common/is_glob.ts": "567dce5c6656bdedfc6b3ee6c0833e1e4db2b8dff6e62148e94a917f289c06ad", - "https://deno.land/std@0.205.0/path/_common/normalize.ts": "2ba7fb4cc9fafb0f38028f434179579ce61d4d9e51296fad22b701c3d3cd7397", - "https://deno.land/std@0.205.0/path/_common/normalize_string.ts": "88c472f28ae49525f9fe82de8c8816d93442d46a30d6bb5063b07ff8a89ff589", - "https://deno.land/std@0.205.0/path/_common/relative.ts": "1af19d787a2a84b8c534cc487424fe101f614982ae4851382c978ab2216186b4", - "https://deno.land/std@0.205.0/path/_common/strip_trailing_separators.ts": "7ffc7c287e97bdeeee31b155828686967f222cd73f9e5780bfe7dfb1b58c6c65", - "https://deno.land/std@0.205.0/path/_common/to_file_url.ts": "a8cdd1633bc9175b7eebd3613266d7c0b6ae0fb0cff24120b6092ac31662f9ae", - "https://deno.land/std@0.205.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", - "https://deno.land/std@0.205.0/path/_os.ts": "30b0c2875f360c9296dbe6b7f2d528f0f9c741cecad2e97f803f5219e91b40a2", - "https://deno.land/std@0.205.0/path/basename.ts": "04bb5ef3e86bba8a35603b8f3b69537112cdd19ce64b77f2522006da2977a5f3", - "https://deno.land/std@0.205.0/path/common.ts": "f4d061c7d0b95a65c2a1a52439edec393e906b40f1caf4604c389fae7caa80f5", - "https://deno.land/std@0.205.0/path/dirname.ts": "88a0a71c21debafc4da7a4cd44fd32e899462df458fbca152390887d41c40361", - "https://deno.land/std@0.205.0/path/extname.ts": "2da4e2490f3b48b7121d19fb4c91681a5e11bd6bd99df4f6f47d7a71bb6ecdf2", - "https://deno.land/std@0.205.0/path/format.ts": "3457530cc85d1b4bab175f9ae73998b34fd456c830d01883169af0681b8894fb", - "https://deno.land/std@0.205.0/path/from_file_url.ts": "e7fa233ea1dff9641e8d566153a24d95010110185a6f418dd2e32320926043f8", - "https://deno.land/std@0.205.0/path/glob.ts": "9c77cf47db1d786e2ebf66670824d03fd84ecc7c807cac24441eb9d5cb6a2986", - "https://deno.land/std@0.205.0/path/is_absolute.ts": "67232b41b860571c5b7537f4954c88d86ae2ba45e883ee37d3dec27b74909d13", - "https://deno.land/std@0.205.0/path/join.ts": "98d3d76c819af4a11a81d5ba2dbb319f1ce9d63fc2b615597d4bcfddd4a89a09", - "https://deno.land/std@0.205.0/path/mod.ts": "2d62a0a8b78a60e8e6f485d881bac6b61d58573b11cf585fb7c8fc50d9b20d80", - "https://deno.land/std@0.205.0/path/normalize.ts": "aa95be9a92c7bd4f9dc0ba51e942a1973e2b93d266cd74f5ca751c136d520b66", - "https://deno.land/std@0.205.0/path/parse.ts": "d87ff0deef3fb495bc0d862278ff96da5a06acf0625ca27769fc52ac0d3d6ece", - "https://deno.land/std@0.205.0/path/posix/_util.ts": "ecf49560fedd7dd376c6156cc5565cad97c1abe9824f4417adebc7acc36c93e5", - "https://deno.land/std@0.205.0/path/posix/basename.ts": "a630aeb8fd8e27356b1823b9dedd505e30085015407caa3396332752f6b8406a", - "https://deno.land/std@0.205.0/path/posix/common.ts": "e781d395dc76f6282e3f7dd8de13194abb8b04a82d109593141abc6e95755c8b", - "https://deno.land/std@0.205.0/path/posix/dirname.ts": "f48c9c42cc670803b505478b7ef162c7cfa9d8e751b59d278b2ec59470531472", - "https://deno.land/std@0.205.0/path/posix/extname.ts": "ee7f6571a9c0a37f9218fbf510c440d1685a7c13082c348d701396cc795e0be0", - "https://deno.land/std@0.205.0/path/posix/format.ts": "b94876f77e61bfe1f147d5ccb46a920636cd3cef8be43df330f0052b03875968", - "https://deno.land/std@0.205.0/path/posix/from_file_url.ts": "b97287a83e6407ac27bdf3ab621db3fccbf1c27df0a1b1f20e1e1b5acf38a379", - "https://deno.land/std@0.205.0/path/posix/glob.ts": "86c3f06d1c98303613c74650961c3e24bdb871cde2a97c3ae7f0f6d4abbef445", - "https://deno.land/std@0.205.0/path/posix/is_absolute.ts": "159900a3422d11069d48395568217eb7fc105ceda2683d03d9b7c0f0769e01b8", - "https://deno.land/std@0.205.0/path/posix/join.ts": "0c0d84bdc344876930126640011ec1b888e6facf74153ffad9ef26813aa2a076", - "https://deno.land/std@0.205.0/path/posix/mod.ts": "6bfa8a42d85345b12dbe8571028ca2c62d460b6ef968125e498602b43b6cf6b6", - "https://deno.land/std@0.205.0/path/posix/normalize.ts": "11de90a94ab7148cc46e5a288f7d732aade1d616bc8c862f5560fa18ff987b4b", - "https://deno.land/std@0.205.0/path/posix/parse.ts": "199208f373dd93a792e9c585352bfc73a6293411bed6da6d3bc4f4ef90b04c8e", - "https://deno.land/std@0.205.0/path/posix/relative.ts": "e2f230608b0f083e6deaa06e063943e5accb3320c28aef8d87528fbb7fe6504c", - "https://deno.land/std@0.205.0/path/posix/resolve.ts": "51579d83159d5c719518c9ae50812a63959bbcb7561d79acbdb2c3682236e285", - "https://deno.land/std@0.205.0/path/posix/separator.ts": "0b6573b5f3269a3164d8edc9cefc33a02dd51003731c561008c8bb60220ebac1", - "https://deno.land/std@0.205.0/path/posix/to_file_url.ts": "08d43ea839ee75e9b8b1538376cfe95911070a655cd312bc9a00f88ef14967b6", - "https://deno.land/std@0.205.0/path/posix/to_namespaced_path.ts": "c9228a0e74fd37e76622cd7b142b8416663a9b87db643302fa0926b5a5c83bdc", - "https://deno.land/std@0.205.0/path/relative.ts": "23d45ede8b7ac464a8299663a43488aad6b561414e7cbbe4790775590db6349c", - "https://deno.land/std@0.205.0/path/resolve.ts": "5b184efc87155a0af9fa305ff68a109e28de9aee81fc3e77cd01380f19daf867", - "https://deno.land/std@0.205.0/path/separator.ts": "40a3e9a4ad10bef23bc2cd6c610291b6c502a06237c2c4cd034a15ca78dedc1f", - "https://deno.land/std@0.205.0/path/to_file_url.ts": "edaafa089e0bce386e1b2d47afe7c72e379ff93b28a5829a5885e4b6c626d864", - "https://deno.land/std@0.205.0/path/to_namespaced_path.ts": "cf8734848aac3c7527d1689d2adf82132b1618eff3cc523a775068847416b22a", - "https://deno.land/std@0.205.0/path/windows/_util.ts": "f32b9444554c8863b9b4814025c700492a2b57ff2369d015360970a1b1099d54", - "https://deno.land/std@0.205.0/path/windows/basename.ts": "8a9dbf7353d50afbc5b221af36c02a72c2d1b2b5b9f7c65bf6a5a2a0baf88ad3", - "https://deno.land/std@0.205.0/path/windows/common.ts": "e781d395dc76f6282e3f7dd8de13194abb8b04a82d109593141abc6e95755c8b", - "https://deno.land/std@0.205.0/path/windows/dirname.ts": "5c2aa541384bf0bd9aca821275d2a8690e8238fa846198ef5c7515ce31a01a94", - "https://deno.land/std@0.205.0/path/windows/extname.ts": "07f4fa1b40d06a827446b3e3bcc8d619c5546b079b8ed0c77040bbef716c7614", - "https://deno.land/std@0.205.0/path/windows/format.ts": "343019130d78f172a5c49fdc7e64686a7faf41553268961e7b6c92a6d6548edf", - "https://deno.land/std@0.205.0/path/windows/from_file_url.ts": "d53335c12b0725893d768be3ac6bf0112cc5b639d2deb0171b35988493b46199", - "https://deno.land/std@0.205.0/path/windows/glob.ts": "0286fb89ecd21db5cbf3b6c79e2b87c889b03f1311e66fb769e6b905d4142332", - "https://deno.land/std@0.205.0/path/windows/is_absolute.ts": "245b56b5f355ede8664bd7f080c910a97e2169972d23075554ae14d73722c53c", - "https://deno.land/std@0.205.0/path/windows/join.ts": "e6600bf88edeeef4e2276e155b8de1d5dec0435fd526ba2dc4d37986b2882f16", - "https://deno.land/std@0.205.0/path/windows/mod.ts": "c3d1a36fbf9f6db1320bcb4fbda8de011d25461be3497105e15cbea1e3726198", - "https://deno.land/std@0.205.0/path/windows/normalize.ts": "9deebbf40c81ef540b7b945d4ccd7a6a2c5a5992f791e6d3377043031e164e69", - "https://deno.land/std@0.205.0/path/windows/parse.ts": "120faf778fe1f22056f33ded069b68e12447668fcfa19540c0129561428d3ae5", - "https://deno.land/std@0.205.0/path/windows/relative.ts": "026855cd2c36c8f28f1df3c6fbd8f2449a2aa21f48797a74700c5d872b86d649", - "https://deno.land/std@0.205.0/path/windows/resolve.ts": "5ff441ab18a2346abadf778121128ee71bda4d0898513d4639a6ca04edca366b", - "https://deno.land/std@0.205.0/path/windows/separator.ts": "ae21f27015f10510ed1ac4a0ba9c4c9c967cbdd9d9e776a3e4967553c397bd5d", - "https://deno.land/std@0.205.0/path/windows/to_file_url.ts": "8e9ea9e1ff364aa06fa72999204229952d0a279dbb876b7b838b2b2fea55cce3", - "https://deno.land/std@0.205.0/path/windows/to_namespaced_path.ts": "e0f4d4a5e77f28a5708c1a33ff24360f35637ba6d8f103d19661255ef7bfd50d", "https://deno.land/std@0.207.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", "https://deno.land/std@0.207.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", "https://deno.land/std@0.207.0/fs/_util.ts": "fbf57dcdc9f7bc8128d60301eece608246971a7836a3bb1e78da75314f08b978", diff --git a/.github/cicd/deps.ts b/.github/cicd/deps.ts index 0ca9e108..5e854813 100644 --- a/.github/cicd/deps.ts +++ b/.github/cicd/deps.ts @@ -1,13 +1,13 @@ -import { emptyDirSync, copySync, ensureDirSync } from "https://deno.land/std@0.207.0/fs/mod.ts"; -import { resolve, dirname, extname } from "https://deno.land/std@0.207.0/path/mod.ts"; +import { copySync, emptyDirSync, ensureDirSync, existsSync, walkSync } from "https://deno.land/std@0.207.0/fs/mod.ts"; +import { basename, dirname, extname, parse, resolve } from "https://deno.land/std@0.207.0/path/mod.ts"; import { Input, Select } from "https://deno.land/x/cliffy@v1.0.0-rc.3/prompt/mod.ts"; -import { TagClient, RepoClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.5/GitHubClients/mod.ts"; +import { RepoClient, TagClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.5/GitHubClients/mod.ts"; import { NuGetClient } from "https://deno.land/x/kd_clients@v1.0.0-preview.5/PackageClients/NuGetClient.ts"; import chalk from "npm:chalk@4.1.0"; -export { emptyDirSync, copySync, ensureDirSync }; -export { resolve, dirname, extname }; +export { copySync, emptyDirSync, ensureDirSync, existsSync, walkSync }; +export { basename, dirname, extname, parse, resolve }; export { Input, Select }; -export { TagClient, RepoClient, NuGetClient }; +export { NuGetClient, RepoClient, TagClient }; export default chalk; diff --git a/.github/cicd/manual-testing/next-versioning.ts b/.github/cicd/manual-testing/next-versioning.ts index eb4cd70e..7759d46c 100644 --- a/.github/cicd/manual-testing/next-versioning.ts +++ b/.github/cicd/manual-testing/next-versioning.ts @@ -1,5 +1,5 @@ -import { File } from "io/File.ts"; -import { FlagService } from "services/FlagService.ts"; +import { FlagService } from "../core/services/FlagService.ts"; +import { existsSync } from "../deps.ts"; // Check the arguments if (Deno.args.length < 3) { @@ -10,7 +10,7 @@ if (Deno.args.length < 3) { } // Validate the file path argument -if (File.doesNotExist(Deno.args[0])) { +if (!existsSync(Deno.args[0], { isDirectory: true, isReadable: true })) { throw Error(`The file path '${Deno.args[0]}' does not exist.`); } diff --git a/.github/cicd/manual-testing/testing-env.ts b/.github/cicd/manual-testing/testing-env.ts index 4d85a8ef..573e9ed1 100644 --- a/.github/cicd/manual-testing/testing-env.ts +++ b/.github/cicd/manual-testing/testing-env.ts @@ -1,27 +1,69 @@ -import { FlagService } from "services/FlagService.ts"; -import { VersionsFileService } from "services/VersionsFileService.ts"; +import { FlagService } from "../core/services/FlagService.ts"; +import { VersionsFileService } from "../core/services/VersionsFileService.ts"; +import { Utils } from "../core/Utils.ts"; +import { existsSync, walkSync } from "../deps.ts"; if (Deno.args.length <= 0) { - let errorMsg = "The testing environment script must provide a single argument"; - errorMsg += "with the values of 'enable', 'disable', or 'toggle'."; - throw new Error(errorMsg); + const errorMsg = "The testing environment script must provide a single argument" + + "with the values of 'enable', 'disable', or 'toggle'."; + Utils.printGitHubError(errorMsg); + Deno.exit(1); } -const arg: string = Deno.args[0].toLowerCase(); +const arg: string = Deno.args[0].toLowerCase().trim(); const isNotCorrectValue: boolean = arg != "enable" && arg != "disable" && arg != "toggle"; if (isNotCorrectValue) { - let errorMsg = `The argument value of '${arg}' to the 'testing-env.ts' script `; - errorMsg += "is not a value of 'enable', 'disable', or 'toggle'."; - throw new Error(errorMsg); + const errorMsg = `The argument value of '${arg}' sent to the 'testing-env.ts' script ` + + "must be the value 'enable', 'disable', or 'toggle'."; + Utils.printGitHubError(errorMsg); + Deno.exit(1); } -const baseDirPath: string = Deno.cwd(); -const docusaurusConfigFilePath = `${baseDirPath}/docusaurus.config.js`; -const sidebarsConfigFilePath = `${baseDirPath}/sidebars.js`; +const baseDirPath: string = Deno.cwd().trim(); + +Utils.printGitHubNotice(`Script executed in the working directory '${baseDirPath}'.`); + +if (!existsSync(baseDirPath)) { + const errorMsg = `The current working directory '${baseDirPath}' does not exist.`; + Utils.printGitHubError(errorMsg); + Deno.exit(1); +} + +const docusaurusConfigFilePathEntries = walkSync(baseDirPath, { + includeDirs: false, + includeFiles: true, + exts: [".js"], + match: [new RegExp(`.*docusaurus.config.js$`, "gm")], + skip: [new RegExp(".*node_modules.*")], +}); + +const docusaurusConfigFilePath = [...docusaurusConfigFilePathEntries].map((entry) => entry.path)[0]; + +if (Utils.isNothing(docusaurusConfigFilePath)) { + const errorMsg = `The docusaurus config file could not be recursively found in the working directory '${baseDirPath}'.`; + Utils.printGitHubError(errorMsg); + Deno.exit(1); +} + +const sidebarsConfigFilePathEntries = walkSync(baseDirPath, { + includeDirs: false, + includeFiles: true, + exts: [".js"], + match: [new RegExp(`.*sidebars.js$`, "gm")], + skip: [new RegExp(".*node_modules.*")], +}); + +const sidebarsConfigFilePath = [...sidebarsConfigFilePathEntries].map((entry) => entry.path)[0]; + +if (Utils.isNothing(sidebarsConfigFilePath)) { + const errorMsg = `The side bars js file could not be recursively found in the working directory '${baseDirPath}'.`; + Utils.printGitHubError(errorMsg); + Deno.exit(1); +} const flagService: FlagService = new FlagService(); -const versionService: VersionsFileService = new VersionsFileService(); +const versionService: VersionsFileService = new VersionsFileService(baseDirPath); switch (arg) { case "enable": diff --git a/.github/cicd/playground.ts b/.github/cicd/playground.ts index 76307df2..f7e6db52 100644 --- a/.github/cicd/playground.ts +++ b/.github/cicd/playground.ts @@ -1 +1,3 @@ + const _rootRepoDirPath = Deno.args[0]; +const _token = Deno.args[1]; diff --git a/.github/cicd/scripts/create-docusaurus-version.ts b/.github/cicd/scripts/create-docusaurus-version.ts index 4b1f3e4f..b3b74760 100644 --- a/.github/cicd/scripts/create-docusaurus-version.ts +++ b/.github/cicd/scripts/create-docusaurus-version.ts @@ -17,7 +17,7 @@ const version = await Input.prompt({ input = input.trim(); return input.startsWith("v") ? input.substring(1) : input; - } + }, }); console.log(`Chosen Version: ${version}`); @@ -41,4 +41,4 @@ console.assert(code === 0); console.log(new TextDecoder().decode(stdout)); console.log(new TextDecoder().decode(stderr)); -console.log(`API Docs Version '${version}' Created Successfully!`); \ No newline at end of file +console.log(`API Docs Version '${version}' Created Successfully!`); diff --git a/.github/cicd/scripts/delete-api-docs.ts b/.github/cicd/scripts/delete-api-docs.ts index b9f4828a..988a2860 100644 --- a/.github/cicd/scripts/delete-api-docs.ts +++ b/.github/cicd/scripts/delete-api-docs.ts @@ -1,8 +1,7 @@ -import { Directory } from "io/Directory.ts"; -import { Path } from "io/Path.ts"; -import { Select } from "../deps.ts"; -import { DeleteAPIVersionService } from "services/DeleteAPIVersionService.ts"; +import { existsSync, Select, walkSync } from "../deps.ts"; +import { DeleteAPIVersionService } from "../core/services/DeleteAPIVersionService.ts"; import chalk from "../deps.ts"; +import { Utils } from "../core/Utils.ts"; /** * DESCRIPTION: This script is used locally by VSCode to make it easy to delete @@ -10,12 +9,33 @@ import chalk from "../deps.ts"; * eventually will be as time goes on. */ -const versionDirPaths: string[] = Directory.getDirs("./versioned_docs"); -const apiDocVersions: string[] = Path.getLastDirNames(versionDirPaths) - .map((d) => `v${d.replace("version-", "")}`); +if (Deno.args.length <= 0) { + throw new Error("The script must have at least one argument."); +} -//"This will delete the API docs for the chosen version locally." +const baseDirPath = Deno.args[0].trim(); + +if (!existsSync(baseDirPath)) { + throw new Error(`The current working directory '${baseDirPath}' does not exist.`); +} + +const dirEntries = walkSync(baseDirPath, { + includeDirs: true, + includeFiles: false, + match: [new RegExp(`version-.+`, "gm")], +}); + +const apiDocVersions = [...dirEntries].filter((entry) => { + const dirName = `v${entry.name.trim().replace("version-", "")}`; + return Utils.isPrevOrProdVersion(dirName); +}).map((entry) => { + const result = entry.name.replace("version-", "v"); + + return result; +}); + +//"This will delete the API docs for the chosen version locally." const chosenVersion: string = await Select.prompt({ message: chalk.yellow("Choose a version to delete:"), options: apiDocVersions, @@ -25,7 +45,7 @@ const chosenVersion: string = await Select.prompt({ console.log(chalk.cyan(`Deleting '${chosenVersion}' API docs. . .`)); -const delAPIVersionService: DeleteAPIVersionService = new DeleteAPIVersionService(); +const delAPIVersionService: DeleteAPIVersionService = new DeleteAPIVersionService(baseDirPath); delAPIVersionService.deleteDocs(chosenVersion); console.log(chalk.cyan(`API docs for version '${chosenVersion}' fully removed.`)); diff --git a/.github/cicd/scripts/delete-oldest-api-docs.ts b/.github/cicd/scripts/delete-oldest-api-docs.ts index aca2565a..1cc2462c 100644 --- a/.github/cicd/scripts/delete-oldest-api-docs.ts +++ b/.github/cicd/scripts/delete-oldest-api-docs.ts @@ -1,17 +1,25 @@ import chalk from "../deps.ts"; import { Utils } from "../core/Utils.ts"; -import { DeleteAPIVersionService } from "services/DeleteAPIVersionService.ts"; -import { VersionsFileService } from "services/VersionsFileService.ts"; +import { DeleteAPIVersionService } from "../core/services/DeleteAPIVersionService.ts"; +import { VersionsFileService } from "../core/services/VersionsFileService.ts"; /** * DESCRIPTION: This script is used as part of the api docs release cicd process and is used * to delete the oldest api docs version from the repo. */ -const allVersions = new VersionsFileService().getVersions(); +if (Deno.args.length <= 0) { + const errorMsg = "The script requires a single argument of where to start searching for the versions file."; + Utils.printGitHubError(errorMsg); + Deno.exit(1); +} + +const versionsFileSearchDirPath = Deno.args[0].trim(); + +const allVersions = new VersionsFileService(versionsFileSearchDirPath).getVersions(); const oldestVersion = Utils.getOldestVersion(allVersions); -const versionsFileService: DeleteAPIVersionService = new DeleteAPIVersionService(); +const versionsFileService: DeleteAPIVersionService = new DeleteAPIVersionService(versionsFileSearchDirPath); console.log(chalk.cyan(`Deleting '${oldestVersion}' API docs. . .`)); diff --git a/.github/cicd/scripts/deno-check.ts b/.github/cicd/scripts/deno-check.ts index 755aa9ae..b33302a9 100644 --- a/.github/cicd/scripts/deno-check.ts +++ b/.github/cicd/scripts/deno-check.ts @@ -1,14 +1,17 @@ -import { Directory } from "io/Directory.ts"; import { CLI } from "../core/CLI.ts"; +import { walkSync } from "../deps.ts"; -const ignoreDirectories = [ - "./vendor/", - "./node_modules/" -]; +const cwd = Deno.cwd().trim(); -const files: string[] = Directory - .getFiles("/", ".ts", true) - .filter(f => ignoreDirectories.every(ignoreDir => !f.startsWith(ignoreDir))); +const fileEntries = walkSync(cwd, { + includeDirs: false, + includeFiles: true, + exts: [".ts"], + match: [new RegExp(".*cicd.*")], + skip: [new RegExp(".*node_modules.*"), new RegExp(".*vendor.*")], +}); + +const files = [...fileEntries].map((entry) => entry.path); const cli: CLI = new CLI(); @@ -33,58 +36,57 @@ const checkFile = async (file: string): Promise => { const checkResult: CheckResult = { file: file, result: "", - hasPassed: true // Default to passed + hasPassed: true, // Default to passed }; - + checkResult.result += `Checking ${file}`; - + const result = await cli.runAsync(`deno check ${file}`); - + let commandResult = ""; - + // If the result is an error type - if (result instanceof Error) - { + if (result instanceof Error) { checkResult.hasPassed = false; commandResult = "❌\n"; - + const lines = result.message.split("\n"); // Prefix each command output line with 3 spaces - lines.forEach(line => { + lines.forEach((line) => { commandResult += ` ${line}\n`; }); } else { commandResult = "✅\n"; } - + checkResult.result += commandResult; return checkResult; -} +}; const filesToCheck: Promise[] = []; // Perform a deno check on all of the files for await (const file of files) { - filesToCheck.push(checkFile(file)); -}; + filesToCheck.push(checkFile(file)); +} // Wait for all of the checks to complete const allCheckResults = await Promise.all(filesToCheck); // Print all of the results -allCheckResults.forEach(checkResult => { +allCheckResults.forEach((checkResult) => { Deno.stdout.writeSync(new TextEncoder().encode(checkResult.result)); }); // Collect the total number of passed and failed checks -const totalPassed = allCheckResults.filter(r => r.hasPassed).length; -const totalFailed = allCheckResults.filter(r => !r.hasPassed).length; +const totalPassed = allCheckResults.filter((r) => r.hasPassed).length; +const totalFailed = allCheckResults.filter((r) => !r.hasPassed).length; const resultsMsg = new TextEncoder().encode(`\nTotal Checks Passed✅: ${totalPassed}\nTotal Checks Failed❌: ${totalFailed}\n`); Deno.stdout.writeSync(resultsMsg); -if (failed) { +if (totalFailed > 0) { Deno.exit(1); } diff --git a/.github/cicd/scripts/generate-new-api-docs.ts b/.github/cicd/scripts/generate-new-api-docs.ts index a21a7edf..0a6e196b 100644 --- a/.github/cicd/scripts/generate-new-api-docs.ts +++ b/.github/cicd/scripts/generate-new-api-docs.ts @@ -40,9 +40,7 @@ if (isInteractive) { options: ["branch", "api version"], }); - const message = generateSrcType === "api version" - ? "Enter the release version" - : "Enter the branch name"; + const message = generateSrcType === "api version" ? "Enter the release version" : "Enter the branch name"; const minLength = generateSrcType === "api version" ? 5 : 0; diff --git a/.github/cicd/scripts/update-tut-links.ts b/.github/cicd/scripts/update-tut-links.ts index adffae21..df91ce0f 100644 --- a/.github/cicd/scripts/update-tut-links.ts +++ b/.github/cicd/scripts/update-tut-links.ts @@ -1,23 +1,22 @@ import { Utils } from "../core/Utils.ts"; -import { Select, TagClient } from "../deps.ts"; -import { Directory } from "io/Directory.ts"; -import { File } from "io/File.ts"; +import { existsSync, Select, TagClient, walkSync } from "../deps.ts"; // If no args were passed if (Deno.args.length < 3) { - const errorMsg = "::error::Please provide 3 arguments to update the tutorial projects." + + const errorMsg = "Please provide 3 arguments to update the tutorial projects." + "\n1. The root directory path to start searching for tutorial projects." + "\n2. The version number to update the Velaptor NuGet packages to." + "\n3. The GitHub token."; - console.log(errorMsg); + Utils.printGitHubError(errorMsg); Deno.exit(100); } const rootDirPath = Deno.args[0].trim().replaceAll("\\", "/"); // If the directory does not exist, throw and error -if (Directory.doesNotExist(rootDirPath)) { + +if (!existsSync(rootDirPath, { isDirectory: true, isReadable: true })) { console.log(`::error::The given directory path '${rootDirPath}' does not exist.`); Deno.exit(200); } @@ -33,7 +32,7 @@ if (isInteractive) { const token = Deno.args[2].trim(); const tagClient = new TagClient("KinsonDigital", "Velaptor", token); - const tags = (await tagClient.getAllTags()).map(tag => tag.name); + const tags = (await tagClient.getAllTags()).map((tag) => tag.name); newVersion = await Select.prompt({ message: "Select a Velaptor version", @@ -48,40 +47,46 @@ if (isInteractive) { newVersion = newVersion.startsWith("v") ? newVersion : `v${newVersion}`; -const tutCompRegex = - //; +const tutCompRegex = //; // Get all the mdx files -const csprojFiles = Directory.getFiles(rootDirPath, ".mdx", true); +const projFileEntries = walkSync(rootDirPath, { + includeDirs: false, + includeFiles: true, + exts: [".mdx"], +}); + +const mdxFiles = [...projFileEntries].map((entry) => entry.path); // Replace the tutorial link component with the new one -csprojFiles.forEach(file => { - const fileData = File.readTextFileSync(file); +mdxFiles.forEach((file) => { + const fileData = Deno.readTextFileSync(file); - const tutCompRefs = tutCompRegex.exec(fileData)?.map(match => match.toString()) ?? []; + const tutCompRefs = tutCompRegex.exec(fileData)?.map((match) => match.toString()) ?? []; if (tutCompRefs.length === 0) { - console.log(`::notice::The file '${file}' does not contain any tutorial components.`); + Utils.printGitHubNotice(`The file '${file}' does not contain any tutorial components.`); return; } const tutCompRef = tutCompRefs.length >= 0 ? tutCompRefs[0] : ""; const containsTutCompRef = !Utils.isNothing(tutCompRef); - + // If the file contains the nuget package if (containsTutCompRef) { - const projName = tutCompRef.split("projectName=")[1].split(" ")[0].replaceAll("\"", ""); + const projName = tutCompRef.split("projectName=")[1].split(" ")[0].replaceAll('"', ""); const newTutComp = ``; const versionRegex = /v[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+/; - const oldVersion = versionRegex.exec(tutCompRef)?.map(match => match.toString())[0] ?? ""; + const oldVersion = versionRegex.exec(tutCompRef)?.map((match) => match.toString())[0] ?? ""; const newFileData = fileData.replace(tutCompRegex, newTutComp); - File.writeTextFileSync(file, newFileData); + Deno.writeTextFileSync(file, newFileData); + + const updateFileMsg = `The tutorial component was updated from version` + + `'${oldVersion}' to version '${newVersion}' in the mdx file '${file}`; - const updateFileMsg = `::notice::The tutorial component was updated from version` + - `'${oldVersion}' to version '${newVersion}' in the mdx file '${file}`; - console.log(updateFileMsg); + Utils.printGitHubNotice(updateFileMsg); } }); diff --git a/.github/cicd/scripts/update-velaptor-nugets.ts b/.github/cicd/scripts/update-velaptor-nugets.ts index 136cfe40..5a010c7a 100644 --- a/.github/cicd/scripts/update-velaptor-nugets.ts +++ b/.github/cicd/scripts/update-velaptor-nugets.ts @@ -1,23 +1,21 @@ import { Utils } from "../core/Utils.ts"; -import { Select, TagClient } from "../deps.ts"; -import { Directory } from "io/Directory.ts"; -import { File } from "io/File.ts"; +import { existsSync, Select, TagClient, walkSync } from "../deps.ts"; // If no args were passed if (Deno.args.length < 3) { - const errorMsg = "::error::Please provide 3 arguments to update the tutorial projects." + + const errorMsg = "Please provide 3 arguments to update the tutorial projects." + "\n1. The root directory path to start searching for tutorial projects." + "\n2. The version number to update the Velaptor NuGet packages to." + "\n3. The GitHub token."; - console.log(errorMsg); + Utils.printGitHubError(errorMsg); Deno.exit(100); } const rootDirPath = Deno.args[0].trim().replaceAll("\\", "/"); // If the directory does not exist, throw and error -if (Directory.doesNotExist(rootDirPath)) { +if (!existsSync(rootDirPath, { isDirectory: true, isReadable: true })) { console.log(`::error::The given directory path '${rootDirPath}' does not exist.`); Deno.exit(200); } @@ -33,7 +31,7 @@ if (isInteractive) { const token = Deno.args[2].trim(); const tagClient = new TagClient("KinsonDigital", "Velaptor", token); - const tags = (await tagClient.getAllTags()).map(tag => tag.name); + const tags = (await tagClient.getAllTags()).map((tag) => tag.name); newVersion = await Select.prompt({ message: "Select a Velaptor version", @@ -54,13 +52,19 @@ const velaptorNuGetRegex = //; // Get all the csproj files -const csprojFiles = Directory.getFiles(rootDirPath, ".csproj", true); +const projEntries = walkSync(rootDirPath, { + includeDirs: false, + includeFiles: true, + exts: [".csproj"], +}); + +const csprojFiles = [...projEntries].map((entry) => entry.path); // Replace the nuget package reference with the new version -csprojFiles.forEach(file => { - const fileData = File.readTextFileSync(file); +csprojFiles.forEach((file) => { + const fileData = Deno.readTextFileSync(file); - const nugetRefs = velaptorNuGetRegex.exec(fileData)?.map(match => match.toString()) ?? []; + const nugetRefs = velaptorNuGetRegex.exec(fileData)?.map((match) => match.toString()) ?? []; const velaptorNuGetRef = nugetRefs.length >= 0 ? nugetRefs[0] : ""; const containsVelaptorNuGetRef = !Utils.isNothing(velaptorNuGetRef); @@ -68,14 +72,14 @@ csprojFiles.forEach(file => { // If the file contains the nuget package if (containsVelaptorNuGetRef) { const versionRegex = /[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+/; - const oldVersion = versionRegex.exec(velaptorNuGetRef)?.map(match => match.toString())[0] ?? ""; + const oldVersion = versionRegex.exec(velaptorNuGetRef)?.map((match) => match.toString())[0] ?? ""; const newFileData = fileData.replace(velaptorNuGetRegex, newNugetPackage); - File.writeTextFileSync(file, newFileData); + Deno.writeTextFileSync(file, newFileData); - const updateFileMsg = `::notice::The NuGet package 'KinsonDigital.Velaptor' was updated from version` + + const updateFileMsg = `The NuGet package 'KinsonDigital.Velaptor' was updated from version` + `'${oldVersion}' to version '${newVersion}' in the csproj file '${file}`; - console.log(updateFileMsg); + Utils.printGitHubNotice(updateFileMsg); } }); diff --git a/.github/cicd/scripts/update-website-version.ts b/.github/cicd/scripts/update-website-version.ts index 52677ae7..5cc195a4 100644 --- a/.github/cicd/scripts/update-website-version.ts +++ b/.github/cicd/scripts/update-website-version.ts @@ -1,4 +1,4 @@ -import { UpdateWebsiteVersionService } from "services/UpdateWebsiteVersionService.ts"; +import { UpdateWebsiteVersionService } from "../core/services/UpdateWebsiteVersionService.ts"; const service = new UpdateWebsiteVersionService(); service.updateVersion(); diff --git a/.github/cicd/scripts/velaptor-version-exists.ts b/.github/cicd/scripts/velaptor-version-exists.ts index 990ea663..d2a86a60 100644 --- a/.github/cicd/scripts/velaptor-version-exists.ts +++ b/.github/cicd/scripts/velaptor-version-exists.ts @@ -7,11 +7,11 @@ if (Deno.args.length < 2) { } const containsPAT = (value: string): boolean => { - const fineGrainedTokenPrefix = "github_pat_"; - const classicTokenPrefix = "ghp_"; + const fineGrainedTokenPrefix = "github_pat_"; + const classicTokenPrefix = "ghp_"; - return value.startsWith(fineGrainedTokenPrefix) || value.startsWith(classicTokenPrefix); -} + return value.startsWith(fineGrainedTokenPrefix) || value.startsWith(classicTokenPrefix); +}; const versionRegex = /^v[0-9]+\.[0-9]+\.[0-9]+(|-preview\.[0-9]+)$/gm; const version = Deno.args[0].trim().toLowerCase(); diff --git a/.github/workflows/build-status-check.yml b/.github/workflows/build-status-check.yml index dd197efc..c8379981 100644 --- a/.github/workflows/build-status-check.yml +++ b/.github/workflows/build-status-check.yml @@ -8,6 +8,7 @@ defaults: on: + workflow_dispatch: pull_request_target: branches: main @@ -41,8 +42,9 @@ jobs: run: pnpm install - name: Disable Testing Env - working-directory: ${{ github.workspace }}/.github/cicd - run: deno run --allow-read --allow-write "${{ github.workspace }}\.github\cicd\manual-testing\testing-env.ts" "disable"; + working-directory: ${{ github.workspace }} + run: deno run --allow-read --allow-write ` + "${{ github.workspace }}\.github\cicd\manual-testing\testing-env.ts" "disable"; - name: Build run: pnpm build diff --git a/.vscode/launch.json b/.vscode/launch.json index 5d149b18..bc26f9e5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "request": "launch", "type": "node", "program": "${workspaceFolder}/.github/cicd/playground.ts", - "cwd": "${workspaceFolder}/.github/cicd", + "cwd": "${workspaceFolder}", "runtimeArgs": [ "run", "--inspect-wait", @@ -46,13 +46,14 @@ "name": "Delete API Docs (DEBUG)", "type": "node", "program": "${workspaceFolder}/.github/cicd/scripts/delete-api-docs.ts", - "cwd": "${workspaceFolder}/.github/cicd", + "cwd": "${workspaceFolder}", "runtimeExecutable": "${userHome}/.deno/bin/deno.EXE", "runtimeArgs": [ "run", "--inspect-wait", "--allow-all", ], + "args": ["${workspaceFolder}"], "attachSimplePort": 9229, "console": "integratedTerminal" }, @@ -61,23 +62,26 @@ "name": "Delete Oldest API Docs (DEBUG)", "type": "node", "program": "${workspaceFolder}/.github/cicd/scripts/delete-oldest-api-docs.ts", - "cwd": "${workspaceFolder}/.github/cicd", + "cwd": "${workspaceFolder}", "runtimeExecutable": "${userHome}/.deno/bin/deno.EXE", "runtimeArgs": [ "run", "--inspect-wait", "--allow-read", "--allow-write", + "--allow-sys", ], + "args": [ + "${workspaceFolder}", + ], "attachSimplePort": 9229, - "console": "integratedTerminal" }, { // ENABLE TESTING ENVIRONMENT "request": "launch", "name": "Enable Testing Env", "type": "node", "program": "${workspaceFolder}/.github/cicd/manual-testing/testing-env.ts", - "cwd": "${workspaceFolder}/.github/cicd", + "cwd": "${workspaceFolder}", "runtimeExecutable": "${userHome}/.deno/bin/deno.EXE", "runtimeArgs": [ "run", @@ -108,7 +112,7 @@ "name": "Generate New API Docs", "type": "node", "program": "${workspaceFolder}/.github/cicd/scripts/generate-new-api-docs.ts", - "cwd": "${workspaceFolder}/.github/cicd", + "cwd": "${workspaceFolder}", "runtimeExecutable": "${userHome}/.deno/bin/deno.EXE", "runtimeArgs": [ "run", @@ -149,7 +153,7 @@ }, { // GENERATE DOCUSAURUS API DOCS VERSION "request": "launch", - "name": "Genererate Docusaurus API Version", + "name": "Generate Docusaurus API Version", "type": "node", "program": "${workspaceFolder}/.github/cicd/scripts/create-docusaurus-version.ts", "cwd": "${workspaceFolder}/.github/cicd", @@ -167,7 +171,7 @@ "name": "Deno Check All Files", "type": "node", "program": "${workspaceFolder}/.github/cicd/scripts/deno-check.ts", - "cwd": "${workspaceFolder}/.github/cicd", + "cwd": "${workspaceFolder}", "runtimeExecutable": "${userHome}/.deno/bin/deno.EXE", "runtimeArgs": [ "run", diff --git a/.vscode/settings.json b/.vscode/settings.json index bc78cb58..e06f0fa6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,13 +4,12 @@ "cicd", "clsx", "defaultdocumentation", - "Deno", - "denoland", - "endgroup", "Kinson", - "pwsh", + "KXVA", + "Multiauthor", + "preinstall", "Structs", - "tasklist", + "Texinfo", "typecheck", "Velaptor" ], @@ -22,7 +21,6 @@ ".github/cicd/": true, ".config": false, "RepoSrc/": true, - "*lock*.json": true, "*.lock": true, "SampleProjects": true, }, @@ -53,4 +51,4 @@ "editor.tabSize": 2, "editor.insertSpaces": true } -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d4759eab..6e2ac9d4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,8 +1,37 @@ { "version": "2.0.0", "tasks": [ + { // CLEAR TERMINAL + "label": "clear-terminal", + "detail": "Clears the terminal.", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}/.github/cicd" + }, + "windows": { + "command": "cls" + }, + "linux": { + "command": "clear" + } + }, + { // FORMAT CODE + "label": "Format Code", + "detail": "Formats the code using deno fmt.", + "type": "shell", + "options": { + "cwd": "${workspaceFolder}/.github/cicd" + }, + "dependsOn": ["clear-terminal"], + "command": "deno", + "args": [ + "fmt", + "${workspaceFolder}/.github/cicd", + ] + }, { // GENERATE API DOCS "label": "Generate API Docs", + "detail": "Generates the API docs for the website.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" @@ -24,6 +53,7 @@ }, { // RESET DOCS "label": "Reset Docs", + "detail": "Resets the docs to the default state.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" @@ -38,6 +68,7 @@ }, { // DISABLE TESTING ENVIRONMENT "label": "Disable Testing Environment", + "detail": "Disables the testing environment for the project.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" @@ -52,6 +83,7 @@ }, { // ENABLE TESTING ENVIRONMENT "label": "Enable Testing Environment", + "detail": "Enables the testing environment for the project.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" @@ -66,6 +98,7 @@ }, { // TOGGLE TESTING ENVIRONMENT "label": "Toggle Testing Environment", + "detail": "Toggles the testing environment for the project.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" @@ -80,6 +113,7 @@ }, { // DISABLE NEXT VERSION "label": "Disable Next Version", + "detail": "Disables the next version feature of docusaurus.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" @@ -96,8 +130,8 @@ }, { // ENABLE NEXT VERSION "label": "Enable Next Version", - "type": "shell", "detail": "Enables the next version feature of docusaurus.", + "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" }, @@ -141,10 +175,10 @@ }, { // DELETE API DOCS "label": "Delete API Docs", + "detail": "Deletes a version of the API docs.", "dependsOn": [ "Disable Testing Environment" ], - "detail": "Deletes a version of the API docs.", "type": "shell", "options": { "cwd": "${workspaceFolder}/.github/cicd" diff --git a/VelaptorDocs.code-workspace b/VelaptorDocs.code-workspace index 894dd1a3..e1181c33 100644 --- a/VelaptorDocs.code-workspace +++ b/VelaptorDocs.code-workspace @@ -14,13 +14,6 @@ } ], "settings": { - "cSpell.words": [ - "cicd", - "defaultdocumentation", - "Gaurd", - "TLDR", - "Velaptor" - ], "testing.followRunningTest": true, "testing.gutterEnabled": false, "testing.openTesting": "neverOpen", diff --git a/package.json b/package.json index 4151770f..32991b1f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^3.0.0", "@docusaurus/tsconfig": "^3.0.0", - "@docusaurus/types": "3.0.0", + "@docusaurus/types": "3.0.1", "@types/react": "^18.2.29", "typescript": "~5.2.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc4cf77a..0a2ae608 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,7 +7,7 @@ settings: dependencies: '@docusaurus/core': specifier: ^3.0.0 - version: 3.0.0(@docusaurus/types@3.0.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2) + version: 3.0.0(@docusaurus/types@3.0.1)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2) '@docusaurus/preset-classic': specifier: ^3.0.0 version: 3.0.0(@algolia/client-search@4.20.0)(@types/react@18.2.36)(react-dom@18.2.0)(react@18.2.0)(search-insights@2.10.0)(typescript@5.2.2) @@ -38,8 +38,8 @@ devDependencies: specifier: ^3.0.0 version: 3.0.0 '@docusaurus/types': - specifier: 3.0.0 - version: 3.0.0(react-dom@18.2.0)(react@18.2.0) + specifier: 3.0.1 + version: 3.0.1(react-dom@18.2.0)(react@18.2.0) '@types/react': specifier: ^18.2.29 version: 18.2.36 @@ -1638,6 +1638,105 @@ packages: - webpack-cli dev: false + /@docusaurus/core@3.0.0(@docusaurus/types@3.0.1)(react-dom@18.2.0)(react@18.2.0)(typescript@5.2.2): + resolution: {integrity: sha512-bHWtY55tJTkd6pZhHrWz1MpWuwN4edZe0/UWgFF7PW/oJeDZvLSXKqwny3L91X1/LGGoypBGkeZn8EOuKeL4yQ==} + engines: {node: '>=18.0'} + hasBin: true + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@babel/core': 7.23.2 + '@babel/generator': 7.23.0 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.23.2) + '@babel/plugin-transform-runtime': 7.23.2(@babel/core@7.23.2) + '@babel/preset-env': 7.23.2(@babel/core@7.23.2) + '@babel/preset-react': 7.22.15(@babel/core@7.23.2) + '@babel/preset-typescript': 7.23.2(@babel/core@7.23.2) + '@babel/runtime': 7.23.2 + '@babel/runtime-corejs3': 7.23.2 + '@babel/traverse': 7.23.2 + '@docusaurus/cssnano-preset': 3.0.0 + '@docusaurus/logger': 3.0.0 + '@docusaurus/mdx-loader': 3.0.0(@docusaurus/types@3.0.1)(react-dom@18.2.0)(react@18.2.0) + '@docusaurus/react-loadable': 5.5.2(react@18.2.0) + '@docusaurus/utils': 3.0.0(@docusaurus/types@3.0.1) + '@docusaurus/utils-common': 3.0.0(@docusaurus/types@3.0.1) + '@docusaurus/utils-validation': 3.0.0(@docusaurus/types@3.0.1) + '@slorber/static-site-generator-webpack-plugin': 4.0.7 + '@svgr/webpack': 6.5.1 + autoprefixer: 10.4.16(postcss@8.4.31) + babel-loader: 9.1.3(@babel/core@7.23.2)(webpack@5.89.0) + babel-plugin-dynamic-import-node: 2.3.3 + boxen: 6.2.1 + chalk: 4.1.2 + chokidar: 3.5.3 + clean-css: 5.3.2 + cli-table3: 0.6.3 + combine-promises: 1.2.0 + commander: 5.1.0 + copy-webpack-plugin: 11.0.0(webpack@5.89.0) + core-js: 3.33.2 + css-loader: 6.8.1(webpack@5.89.0) + css-minimizer-webpack-plugin: 4.2.2(clean-css@5.3.2)(webpack@5.89.0) + cssnano: 5.1.15(postcss@8.4.31) + del: 6.1.1 + detect-port: 1.5.1 + escape-html: 1.0.3 + eta: 2.2.0 + file-loader: 6.2.0(webpack@5.89.0) + fs-extra: 11.1.1 + html-minifier-terser: 7.2.0 + html-tags: 3.3.1 + html-webpack-plugin: 5.5.3(webpack@5.89.0) + leven: 3.1.0 + lodash: 4.17.21 + mini-css-extract-plugin: 2.7.6(webpack@5.89.0) + postcss: 8.4.31 + postcss-loader: 7.3.3(postcss@8.4.31)(typescript@5.2.2)(webpack@5.89.0) + prompts: 2.4.2 + react: 18.2.0 + react-dev-utils: 12.0.1(typescript@5.2.2)(webpack@5.89.0) + react-dom: 18.2.0(react@18.2.0) + react-helmet-async: 1.3.0(react-dom@18.2.0)(react@18.2.0) + react-loadable: /@docusaurus/react-loadable@5.5.2(react@18.2.0) + react-loadable-ssr-addon-v5-slorber: 1.0.1(@docusaurus/react-loadable@5.5.2)(webpack@5.89.0) + react-router: 5.3.4(react@18.2.0) + react-router-config: 5.1.1(react-router@5.3.4)(react@18.2.0) + react-router-dom: 5.3.4(react@18.2.0) + rtl-detect: 1.0.4 + semver: 7.5.4 + serve-handler: 6.1.5 + shelljs: 0.8.5 + terser-webpack-plugin: 5.3.9(webpack@5.89.0) + tslib: 2.6.2 + update-notifier: 6.0.2 + url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.89.0) + wait-on: 7.1.0 + webpack: 5.89.0 + webpack-bundle-analyzer: 4.9.1 + webpack-dev-server: 4.15.1(webpack@5.89.0) + webpack-merge: 5.10.0 + webpackbar: 5.0.2(webpack@5.89.0) + transitivePeerDependencies: + - '@docusaurus/types' + - '@parcel/css' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli + dev: false + /@docusaurus/cssnano-preset@3.0.0: resolution: {integrity: sha512-FHiRfwmVvIVdIGsHcijUOaX7hMn0mugVYB7m4GkpYI6Mi56zwQV4lH5p7DxcW5CUYNWMVxz2loWSCiWEm5ikwA==} engines: {node: '>=18.0'} @@ -1700,6 +1799,50 @@ packages: - webpack-cli dev: false + /@docusaurus/mdx-loader@3.0.0(@docusaurus/types@3.0.1)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-JkGge6WYDrwjNgMxwkb6kNQHnpISt5L1tMaBWFDBKeDToFr5Kj29IL35MIQm0RfrnoOfr/29RjSH4aRtvlAR0A==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@babel/parser': 7.23.0 + '@babel/traverse': 7.23.2 + '@docusaurus/logger': 3.0.0 + '@docusaurus/utils': 3.0.0(@docusaurus/types@3.0.1) + '@docusaurus/utils-validation': 3.0.0(@docusaurus/types@3.0.1) + '@mdx-js/mdx': 3.0.0 + '@slorber/remark-comment': 1.0.0 + escape-html: 1.0.3 + estree-util-value-to-estree: 3.0.1 + file-loader: 6.2.0(webpack@5.89.0) + fs-extra: 11.1.1 + image-size: 1.0.2 + mdast-util-mdx: 3.0.0 + mdast-util-to-string: 4.0.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + rehype-raw: 7.0.0 + remark-directive: 3.0.0 + remark-emoji: 4.0.1 + remark-frontmatter: 5.0.0 + remark-gfm: 4.0.0 + stringify-object: 3.3.0 + tslib: 2.6.2 + unified: 11.0.4 + unist-util-visit: 5.0.0 + url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.89.0) + vfile: 6.0.1 + webpack: 5.89.0 + transitivePeerDependencies: + - '@docusaurus/types' + - '@swc/core' + - esbuild + - supports-color + - uglify-js + - webpack-cli + dev: false + /@docusaurus/module-type-aliases@3.0.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-CfC6CgN4u/ce+2+L1JdsHNyBd8yYjl4De2B2CBj2a9F7WuJ5RjV1ciuU7KDg8uyju+NRVllRgvJvxVUjCdkPiw==} peerDependencies: @@ -2272,6 +2415,28 @@ packages: - uglify-js - webpack-cli + /@docusaurus/types@3.0.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-plyX2iU1tcUsF46uQ01pAd4JhexR7n0iiQ5MSnBFX6M6NSJgDYdru/i1/YNPKOnQHBoXGLHv0dNT6OAlDWNjrg==} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@types/history': 4.7.11 + '@types/react': 18.2.36 + commander: 5.1.0 + joi: 17.11.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-helmet-async: 1.3.0(react-dom@18.2.0)(react@18.2.0) + utility-types: 3.10.0 + webpack: 5.89.0 + webpack-merge: 5.10.0 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + - webpack-cli + /@docusaurus/utils-common@3.0.0(@docusaurus/types@3.0.0): resolution: {integrity: sha512-7iJWAtt4AHf4PFEPlEPXko9LZD/dbYnhLe0q8e3GRK1EXZyRASah2lznpMwB3lLmVjq/FR6ZAKF+E0wlmL5j0g==} engines: {node: '>=18.0'} @@ -2285,6 +2450,19 @@ packages: tslib: 2.6.2 dev: false + /@docusaurus/utils-common@3.0.0(@docusaurus/types@3.0.1): + resolution: {integrity: sha512-7iJWAtt4AHf4PFEPlEPXko9LZD/dbYnhLe0q8e3GRK1EXZyRASah2lznpMwB3lLmVjq/FR6ZAKF+E0wlmL5j0g==} + engines: {node: '>=18.0'} + peerDependencies: + '@docusaurus/types': '*' + peerDependenciesMeta: + '@docusaurus/types': + optional: true + dependencies: + '@docusaurus/types': 3.0.1(react-dom@18.2.0)(react@18.2.0) + tslib: 2.6.2 + dev: false + /@docusaurus/utils-validation@3.0.0(@docusaurus/types@3.0.0): resolution: {integrity: sha512-MlIGUspB/HBW5CYgHvRhmkZbeMiUWKbyVoCQYvbGN8S19SSzVgzyy97KRpcjCOYYeEdkhmRCUwFBJBlLg3IoNQ==} engines: {node: '>=18.0'} @@ -2303,6 +2481,24 @@ packages: - webpack-cli dev: false + /@docusaurus/utils-validation@3.0.0(@docusaurus/types@3.0.1): + resolution: {integrity: sha512-MlIGUspB/HBW5CYgHvRhmkZbeMiUWKbyVoCQYvbGN8S19SSzVgzyy97KRpcjCOYYeEdkhmRCUwFBJBlLg3IoNQ==} + engines: {node: '>=18.0'} + dependencies: + '@docusaurus/logger': 3.0.0 + '@docusaurus/utils': 3.0.0(@docusaurus/types@3.0.1) + joi: 17.11.0 + js-yaml: 4.1.0 + tslib: 2.6.2 + transitivePeerDependencies: + - '@docusaurus/types' + - '@swc/core' + - esbuild + - supports-color + - uglify-js + - webpack-cli + dev: false + /@docusaurus/utils@3.0.0(@docusaurus/types@3.0.0): resolution: {integrity: sha512-JwGjh5mtjG9XIAESyPxObL6CZ6LO/yU4OSTpq7Q0x+jN25zi/AMbvLjpSyZzWy+qm5uQiFiIhqFaOxvy+82Ekg==} engines: {node: '>=18.0'} @@ -2338,6 +2534,41 @@ packages: - webpack-cli dev: false + /@docusaurus/utils@3.0.0(@docusaurus/types@3.0.1): + resolution: {integrity: sha512-JwGjh5mtjG9XIAESyPxObL6CZ6LO/yU4OSTpq7Q0x+jN25zi/AMbvLjpSyZzWy+qm5uQiFiIhqFaOxvy+82Ekg==} + engines: {node: '>=18.0'} + peerDependencies: + '@docusaurus/types': '*' + peerDependenciesMeta: + '@docusaurus/types': + optional: true + dependencies: + '@docusaurus/logger': 3.0.0 + '@docusaurus/types': 3.0.1(react-dom@18.2.0)(react@18.2.0) + '@svgr/webpack': 6.5.1 + escape-string-regexp: 4.0.0 + file-loader: 6.2.0(webpack@5.89.0) + fs-extra: 11.1.1 + github-slugger: 1.5.0 + globby: 11.1.0 + gray-matter: 4.0.3 + jiti: 1.21.0 + js-yaml: 4.1.0 + lodash: 4.17.21 + micromatch: 4.0.5 + resolve-pathname: 3.0.0 + shelljs: 0.8.5 + tslib: 2.6.2 + url-loader: 4.1.1(file-loader@6.2.0)(webpack@5.89.0) + webpack: 5.89.0 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - supports-color + - uglify-js + - webpack-cli + dev: false + /@hapi/hoek@9.3.0: resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==}