From 396a9b60224ea0d0665aa32d67ffae2f767a8ac6 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 11:10:55 -0400 Subject: [PATCH 01/30] wip --- docs/.env.example | 2 + docs/package.json | 2 +- docs/src/config.ts | 31 +++ docs/src/github.ts | 95 +++++++-- docs/src/local.ts | 10 + docs/src/markdown.ts | 226 ++++++++++++++++++++ docs/src/validate-docs-links.ts | 364 ++++---------------------------- 7 files changed, 387 insertions(+), 343 deletions(-) create mode 100644 docs/.env.example create mode 100644 docs/src/config.ts create mode 100644 docs/src/local.ts create mode 100644 docs/src/markdown.ts diff --git a/docs/.env.example b/docs/.env.example new file mode 100644 index 0000000000000..8a916b07807c2 --- /dev/null +++ b/docs/.env.example @@ -0,0 +1,2 @@ +GITHUB_TOKEN=INSERT_YOUR_GITHUB_TOKEN_HERE +GITHUB_REPOSITORY=github.com/vercel/turborepo diff --git a/docs/package.json b/docs/package.json index 87d663c202714..d544f675ff6b9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -6,7 +6,7 @@ "src" ], "scripts": { - "check-links": "tsx src/validate-docs-links.ts" + "check-links": "tsx --env-file=.env src/validate-docs-links.ts" }, "devDependencies": { "@types/github-slugger": "^1.3.0", diff --git a/docs/src/config.ts b/docs/src/config.ts new file mode 100644 index 0000000000000..65bdd5b11bc09 --- /dev/null +++ b/docs/src/config.ts @@ -0,0 +1,31 @@ +export interface Document { + body: string; + path: string; + headings: string[]; + source?: string; + related?: { + links: string[]; + }; +} + +export type ErrorType = "link" | "hash" | "source" | "related"; + +export type LinkError = { + type: ErrorType; + href: string; + doc: Document; +}; + +export type ReportRow = { + link: LinkError["href"]; + type: LinkError["type"]; + path: Document["path"]; +}; + +export interface DocumentReport { + doc: Document; + errors: LinkError[]; +} + +export const DOCS_PATH = "."; +export const EXCLUDED_HASHES = ["top"]; diff --git a/docs/src/github.ts b/docs/src/github.ts index 480281a63018c..22aeee06016de 100644 --- a/docs/src/github.ts +++ b/docs/src/github.ts @@ -1,5 +1,7 @@ import * as github from "@actions/github"; import { setFailed } from "@actions/core"; +import { WebhookPayload } from "@actions/github/lib/interfaces"; +import { ReportRow } from "./config"; interface Comment { id: number; @@ -11,21 +13,26 @@ export const COMMENT_TAG = ""; const { context, getOctokit } = github; const octokit = getOctokit(process.env.GITHUB_TOKEN!); const { owner, repo } = context.repo; -const pullRequest = context.payload.pull_request; -if (!pullRequest) { - console.log("Skipping since this is not a pull request"); - process.exit(0); -} -export const sha = pullRequest.head.sha; -const isFork = pullRequest.head.repo.fork; -const prNumber = pullRequest.number; -export async function findBotComment(): Promise { +export type PullRequest = NonNullable & { + head: { + sha: string; + repo: { + fork: boolean; + }; + }; +}; + +export const pullRequest = context.payload.pull_request as PullRequest; + +export async function findBotComment( + pullRequest: PullRequest +): Promise { try { const { data: comments } = await octokit.rest.issues.listComments({ owner, repo, - issue_number: prNumber, + issue_number: pullRequest.number, }); return comments.find((c) => c.body?.includes(COMMENT_TAG)); @@ -54,8 +61,11 @@ export async function updateComment( } } -export async function createComment(comment: string): Promise { - if (isFork) { +export async function createComment( + comment: string, + pullRequest: PullRequest +): Promise { + if (pullRequest.head.repo.fork) { setFailed( "The action could not create a GitHub comment because it is initiated from a forked repo. View the action logs for a list of broken links." ); @@ -66,7 +76,7 @@ export async function createComment(comment: string): Promise { const { data } = await octokit.rest.issues.createComment({ owner, repo, - issue_number: prNumber, + issue_number: pullRequest.number, body: comment, }); @@ -80,7 +90,8 @@ export async function createComment(comment: string): Promise { export async function updateCheckStatus( errorsExist: boolean, - commentUrl?: string + commentUrl: string | undefined, + pullRequest: PullRequest ): Promise { const checkName = "Docs Link Validation"; @@ -98,7 +109,7 @@ export async function updateCheckStatus( owner, repo, name: checkName, - head_sha: sha, + head_sha: pullRequest.head.sha, status: "completed", conclusion: errorsExist ? "failure" : "success", output: { @@ -108,7 +119,7 @@ export async function updateCheckStatus( }, }; - if (isFork) { + if (pullRequest.head.repo.fork) { if (errorsExist) { setFailed( "This PR introduces broken links to the docs. The action could not create a GitHub check because it is initiated from a forked repo." @@ -124,3 +135,55 @@ export async function updateCheckStatus( } } } + +export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { + if (!pullRequest) { + return; + } + + try { + const botComment = await findBotComment(pullRequest); + let commentUrl: string; + + if (reportRows.length > 0) { + const errorComment = [ + "Hi there :wave:", + "", + "", + "It looks like this PR introduces broken links to the docs, please take a moment to fix them before merging:", + "", + "", + "| Broken link | Type | File |", + "| ----------- | ----------- | ----------- |", + ...reportRows, + "", + "Thank you :pray:", + ].join("\n"); + + let comment; + + comment = `${COMMENT_TAG}\n${errorComment}`; + if (botComment) { + commentUrl = await updateComment(comment, botComment); + } else { + commentUrl = await createComment(comment, pullRequest); + } + process.exit(1); + } + + if (botComment) { + const comment = `${COMMENT_TAG}\nAll broken links are now fixed, thank you!`; + commentUrl = await updateComment(comment, botComment); + } else { + commentUrl = ""; // ?? + } + + try { + await updateCheckStatus(reportRows.length > 0, commentUrl, pullRequest); + } catch (error) { + setFailed("Failed to create GitHub check: " + error); + } + } catch (error) { + setFailed("Error validating internal links: " + error); + } +}; diff --git a/docs/src/local.ts b/docs/src/local.ts new file mode 100644 index 0000000000000..edd8c375735d2 --- /dev/null +++ b/docs/src/local.ts @@ -0,0 +1,10 @@ +import { ReportRow } from "./config"; + +/** this will report errors locally, on standard out */ +export const reportErrorsLocally = (reportRows: ReportRow[]) => { + if (reportRows.length === 0) { + return; + } + console.log("This PR introduces broken links to the docs:"); + console.table(reportRows); +}; diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts new file mode 100644 index 0000000000000..4499a93c92e72 --- /dev/null +++ b/docs/src/markdown.ts @@ -0,0 +1,226 @@ +import fs from "fs/promises"; +import path from "path"; +import unified from "unified"; +import markdown from "remark-parse"; +import remarkToRehype from "remark-rehype"; +import raw from "rehype-raw"; +import visit from "unist-util-visit"; +import GitHubSlugger from "github-slugger"; +import matter from "gray-matter"; +import { setFailed } from "./github"; +import { DOCS_PATH, Document, EXCLUDED_HASHES, LinkError } from "./config"; + +const slugger = new GitHubSlugger(); + +/** Collect the paths of all .mdx files in the passed directories */ +const getAllMdxFilePaths = async ( + directoriesToScan: string[], + fileList: string[] = [] +): Promise => { + for (const dir of directoriesToScan) { + const dirPath = path.join(".", dir); + const files = await fs.readdir(dirPath); + for (const file of files) { + const filePath = path.join(dirPath, file); + const stats = await fs.stat(filePath); + if (stats.isDirectory()) { + fileList = await getAllMdxFilePaths([filePath], fileList); + } else if (path.extname(file) === ".mdx") { + fileList.push(filePath); + } + } + } + + return fileList; +}; + +// Returns the slugs of all headings in a tree +const getHeadingsFromMarkdownTree = ( + tree: ReturnType +): string[] => { + const headings: string[] = []; + slugger.reset(); + + visit(tree, "heading", (node) => { + let headingText = ""; + // Account for headings with inline code blocks by concatenating the + // text values of all children of a heading node. + visit(node, (innerNode: any) => { + if (innerNode.value) { + headingText += innerNode.value; + } + }); + headings.push(slugger.slug(headingText)); + }); + + return headings; +}; + +/** Create a processor to parse MDX content */ +const markdownProcessor = unified() + .use(markdown) + .use(remarkToRehype, { allowDangerousHTML: true }) + .use(raw) + .use(function compiler() { + // A compiler is required, and we only need the AST, so we can + // just return it. + // @ts-ignore + this.Compiler = function treeCompiler(tree) { + return tree; + }; + }); + +const normalizePath = (filePath: string): string => { + const normalized = filePath + .replace("repo-docs", "/repo/docs") + .replace("pack-docs", "/pack/docs") + .replace(".mdx", ""); + + return normalized; +}; + +/** + * Create a map of documents with their paths as keys and + * document content and metadata as values + * The key varies between doc pages and error pages + * error pages: `/docs/messages/example` + * doc pages: `api/example` + */ +const prepareDocumentMapEntry = async ( + filePath: string +): Promise<[string, Document]> => { + try { + const mdxContent = await fs.readFile(filePath, "utf8"); + const { content, data } = matter(mdxContent); + const tree = markdownProcessor.parse(content); + const headings = getHeadingsFromMarkdownTree(tree); + const normalizedUrlPath = normalizePath(filePath); + + return [ + normalizedUrlPath, + { body: content, path: filePath, headings, ...data }, + ]; + } catch (error) { + setFailed(`Error preparing document map for file ${filePath}: ${error}`); + return ["", {} as Document]; + } +}; + +/** Checks if the links point to existing documents */ +const validateInternalLink = + (documentMap: Map) => (doc: Document, href: string) => { + // /docs/api/example#heading -> ["api/example", "heading""] + const [link, hash] = href.replace(DOCS_PATH, "").split("#", 2); + + // These paths exist, just not in our Markdown files + const ignorePaths = ["/api/remote-cache-spec", "/repo"]; + if (ignorePaths.includes(link)) { + return []; + } + + let foundPage = documentMap.get(link); + + if (!foundPage) { + foundPage = documentMap.get(`${link}/index`); + } + + let errors: LinkError[] = []; + + if (!foundPage) { + errors.push({ + type: "link", + href, + doc, + }); + } else if (hash && !EXCLUDED_HASHES.includes(hash)) { + // Check if the hash link points to an existing section within the document + const hashFound = foundPage.headings.includes(hash); + + if (!hashFound) { + errors.push({ + type: "hash", + href, + doc, + }); + } + } + + return errors; + }; + +/** Checks if the hash links point to existing sections within the same document */ +const validateHashLink = (doc: Document, href: string) => { + const hashLink = href.replace("#", ""); + + if (!EXCLUDED_HASHES.includes(hashLink) && !doc.headings.includes(hashLink)) { + let linkError: LinkError = { + type: "hash", + href, + doc, + }; + return [linkError]; + } + return []; +}; + +// corresponds to vfile.VFile['contents'] +type Tree = string | Uint8Array; + +/** Traverse the document tree and validate links */ +const traverseTreeAndValidateLinks = ( + documentMap: Map, + tree: any, // TODO: Tree + doc: Document +): LinkError[] => { + let errors: LinkError[] = []; + + try { + visit(tree, (node: any) => { + if (node.type === "element" && node.tagName === "a") { + const href = node.properties.href; + + if (!href) { + return; + } + + if (href.startsWith("/")) { + errors.push(...validateInternalLink(documentMap)(doc, href)); + } else if (href.startsWith("#")) { + errors.push(...validateHashLink(doc, href)); + } + } + }); + } catch (error) { + setFailed("Error traversing tree: " + error); + } + + return errors; +}; + +/** + * this function will look through all Mdx files and compile a list of `LinkError`s + */ +export const collectLinkErrors = async (): Promise => { + const allMdxFilePaths = await getAllMdxFilePaths([DOCS_PATH]); + + const documentMap = new Map( + await Promise.all(allMdxFilePaths.map(prepareDocumentMapEntry)) + ); + + const reportsWithErrors = allMdxFilePaths.map(async (filePath) => { + const doc = documentMap.get(normalizePath(filePath)); + if (!doc) { + return null; + } + const { contents: tree } = await markdownProcessor.process(doc.body); + const linkErrors = traverseTreeAndValidateLinks(documentMap, tree, doc); + if (linkErrors.length > 0) { + return linkErrors; + } + return null; + }); + + const results = await Promise.all(reportsWithErrors); + const linkErrors = results.filter((report) => report !== null).flat(); + return linkErrors; +}; diff --git a/docs/src/validate-docs-links.ts b/docs/src/validate-docs-links.ts index 788fe32c54961..7a623b0d8bc19 100644 --- a/docs/src/validate-docs-links.ts +++ b/docs/src/validate-docs-links.ts @@ -1,333 +1,45 @@ -import fs from "fs/promises"; -import path from "path"; -import unified from "unified"; -import markdown from "remark-parse"; -import remarkToRehype from "remark-rehype"; -import raw from "rehype-raw"; -import visit from "unist-util-visit"; -import GitHubSlugger from "github-slugger"; -import matter from "gray-matter"; -import { - COMMENT_TAG, - createComment, - findBotComment, - updateCheckStatus, - updateComment, - setFailed, - sha, -} from "./github"; +import { reportErrorsToGitHub } from "./github"; +import { ReportRow } from "./config"; +import { reportErrorsLocally } from "./local"; +import { collectLinkErrors } from "./markdown"; + +/* + This script validates internal links in /docs and /errors including internal, + hash, source and related links. It does not validate external links. + 1. Collects all .mdx files in /docs. + 2. For each file, it extracts the content, metadata, and heading slugs. + 3. It creates a document map to efficiently lookup documents by path. + 4. It then traverses each document modified in the PR and... + - Checks if each internal link (links starting with "/docs/") points + to an existing document + - Validates hash links (links starting with "#") against the list of + headings in the current document. + - Checks the source and related links found in the metadata of each + document. + 5. Any broken links discovered during these checks are categorized and a + comment is added to the PR. +*/ /** - * This script validates internal links in /docs and /errors including internal, - * hash, source and related links. It does not validate external links. - * 1. Collects all .mdx files in /docs. - * 2. For each file, it extracts the content, metadata, and heading slugs. - * 3. It creates a document map to efficiently lookup documents by path. - * 4. It then traverses each document modified in the PR and... - * - Checks if each internal link (links starting with "/docs/") points - * to an existing document - * - Validates hash links (links starting with "#") against the list of - * headings in the current document. - * - Checks the source and related links found in the metadata of each - * document. - * 5. Any broken links discovered during these checks are categorized and a - * comment is added to the PR. + * this function will return a list of `ReportRow`s, preparing for presentation */ - -interface Document { - body: string; - path: string; - headings: string[]; - source?: string; - related?: { - links: string[]; - }; -} - -interface Errors { - doc: Document; - link: string[]; - hash: string[]; - source: string[]; - related: string[]; -} - -type ErrorType = Exclude; - -const DOCS_PATH = "."; -const EXCLUDED_HASHES = ["top"]; - -const slugger = new GitHubSlugger(); - -// Collect the paths of all .mdx files in the passed directories -async function getAllMdxFilePaths( - directoriesToScan: string[], - fileList: string[] = [] -): Promise { - for (const dir of directoriesToScan) { - const dirPath = path.join(".", dir); - const files = await fs.readdir(dirPath); - for (const file of files) { - const filePath = path.join(dirPath, file); - const stats = await fs.stat(filePath); - if (stats.isDirectory()) { - fileList = await getAllMdxFilePaths([filePath], fileList); - } else if (path.extname(file) === ".mdx") { - fileList.push(filePath); - } - } - } - - return fileList; -} - -// Returns the slugs of all headings in a tree -function getHeadingsFromMarkdownTree( - tree: ReturnType -): string[] { - const headings: string[] = []; - slugger.reset(); - - visit(tree, "heading", (node) => { - let headingText = ""; - // Account for headings with inline code blocks by concatenating the - // text values of all children of a heading node. - visit(node, (innerNode: any) => { - if (innerNode.value) { - headingText += innerNode.value; - } - }); - headings.push(slugger.slug(headingText)); - }); - - return headings; -} - -// Create a processor to parse MDX content -const markdownProcessor = unified() - .use(markdown) - .use(remarkToRehype, { allowDangerousHTML: true }) - .use(raw) - .use(function compiler() { - // A compiler is required, and we only need the AST, so we can - // just return it. - // @ts-ignore - this.Compiler = function treeCompiler(tree) { - return tree; - }; - }); - -function normalizePath(filePath: string): string { - const normalized = filePath - .replace("repo-docs", "/repo/docs") - .replace("pack-docs", "/pack/docs") - .replace(".mdx", ""); - - return normalized; -} - -// use Map for faster lookup -let documentMap: Map; - -// Create a map of documents with their paths as keys and -// document content and metadata as values -// The key varies between doc pages and error pages -// error pages: `/docs/messages/example` -// doc pages: `api/example` -async function prepareDocumentMapEntry( - filePath: string -): Promise<[string, Document]> { - try { - const mdxContent = await fs.readFile(filePath, "utf8"); - const { content, data } = matter(mdxContent); - const tree = markdownProcessor.parse(content); - const headings = getHeadingsFromMarkdownTree(tree); - const normalizedUrlPath = normalizePath(filePath); - - return [ - normalizedUrlPath, - { body: content, path: filePath, headings, ...data }, - ]; - } catch (error) { - setFailed(`Error preparing document map for file ${filePath}: ${error}`); - return ["", {} as Document]; - } -} - -// Checks if the links point to existing documents -function validateInternalLink(errors: Errors, href: string): void { - // /docs/api/example#heading -> ["api/example", "heading""] - const [link, hash] = href.replace(DOCS_PATH, "").split("#", 2); - - // These paths exist, just not in our Markdown files - const ignorePaths = ["/api/remote-cache-spec", "/repo"]; - if (ignorePaths.includes(link)) { - return; - } - - let foundPage = documentMap.get(link); - - if (!foundPage) { - foundPage = documentMap.get(`${link}/index`); - } - - if (!foundPage) { - errors.link.push(href); - } else if (hash && !EXCLUDED_HASHES.includes(hash)) { - // Check if the hash link points to an existing section within the document - const hashFound = foundPage.headings.includes(hash); - - if (!hashFound) { - errors.hash.push(href); - } - } -} - -// Checks if the hash links point to existing sections within the same document -function validateHashLink(errors: Errors, href: string, doc: Document): void { - const hashLink = href.replace("#", ""); - - if (!EXCLUDED_HASHES.includes(hashLink) && !doc.headings.includes(hashLink)) { - errors.hash.push(href); - } -} - -// Traverse the document tree and validate links -function traverseTreeAndValidateLinks(tree: any, doc: Document): Errors { - const errors: Errors = { - doc, - link: [], - hash: [], - source: [], - related: [], - }; - - try { - visit(tree, (node: any) => { - if (node.type === "element" && node.tagName === "a") { - const href = node.properties.href; - - if (!href) return; - - if (href.startsWith("/")) { - validateInternalLink(errors, href); - } else if (href.startsWith("#")) { - validateHashLink(errors, href, doc); - } - } - }); - } catch (error) { - setFailed("Error traversing tree: " + error); - } - - return errors; -} - -const formatTableRow = ( - link: string, - errorType: ErrorType, - rawDocPath: string -) => { - const docPath = rawDocPath.replace("../../../", ""); - - return `| ${link} | ${errorType} | [/${docPath}](https://github.com/vercel/turborepo/blob/${sha}/${docPath}) | \n`; +const getReportRows = async (): Promise => { + let errorReports = await collectLinkErrors(); + + return errorReports + .map((linkError) => ({ + link: linkError.href, + type: linkError.type, + path: linkError.doc.path, //.replace("../../../", "")// [/${docPath}](https://github.com/vercel/turborepo/blob/${pullRequest.head.sha}/${docPath}) | \n`; + })) + .sort((a, b) => a.type.localeCompare(b.type)); }; -// Main function that triggers link validation across .mdx files -async function validateAllInternalLinks(): Promise { - try { - const allMdxFilePaths = await getAllMdxFilePaths([DOCS_PATH]); - - documentMap = new Map( - await Promise.all(allMdxFilePaths.map(prepareDocumentMapEntry)) - ); - - const docProcessingPromises = allMdxFilePaths.map(async (filePath) => { - const doc = documentMap.get(normalizePath(filePath)); - if (doc) { - const tree = (await markdownProcessor.process(doc.body)).contents; - return traverseTreeAndValidateLinks(tree, doc); - } else { - return { - doc: {} as Document, - link: [], - hash: [], - source: [], - related: [], - } as Errors; - } - }); - - const allErrors = await Promise.all(docProcessingPromises); - - let errorsExist = false; - - let errorRows: string[] = []; - - const errorTypes: ErrorType[] = ["link", "hash", "source", "related"]; - allErrors.forEach((errors) => { - const { - doc: { path: docPath }, - } = errors; - - errorTypes.forEach((errorType) => { - if (errors[errorType].length > 0) { - errorsExist = true; - errors[errorType].forEach((link) => { - errorRows.push(formatTableRow(link, errorType, docPath)); - }); - } - }); - }); - - const errorComment = [ - "Hi there :wave:\n\nIt looks like this PR introduces broken links to the docs, please take a moment to fix them before merging:\n\n| Broken link | Type | File | \n| ----------- | ----------- | ----------- | \n", - ...errorRows, - "\nThank you :pray:", - ].join(""); - - let commentUrl; - let botComment; - let comment; - - botComment = await findBotComment(); - - if (errorsExist) { - comment = `${COMMENT_TAG}\n${errorComment}`; - if (botComment) { - commentUrl = await updateComment(comment, botComment); - } else { - commentUrl = await createComment(comment); - } - - const errorTableData = allErrors.flatMap((errors) => { - const { doc } = errors; - - return errorTypes.flatMap((errorType) => - errors[errorType].map((link) => ({ - docPath: doc.path, - errorType, - link, - })) - ); - }); - - console.log("This PR introduces broken links to the docs:"); - console.table(errorTableData, ["link", "type", "docPath"]); - process.exit(1); - } else if (botComment) { - const comment = `${COMMENT_TAG}\nAll broken links are now fixed, thank you!`; - commentUrl = await updateComment(comment, botComment); - } - - try { - await updateCheckStatus(errorsExist, commentUrl); - } catch (error) { - setFailed("Failed to create GitHub check: " + error); - } - } catch (error) { - setFailed("Error validating internal links: " + error); - } -} +/** Main function that triggers link validation across .mdx files */ +const validateAllInternalLinks = async (): Promise => { + const reportRows = await getReportRows(); + reportErrorsLocally(reportRows); + reportErrorsToGitHub(reportRows); +}; validateAllInternalLinks(); From fc108ad631906162b9ade627f6c471f461224d51 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 12:25:56 -0400 Subject: [PATCH 02/30] update all the things* *as much as possible: there's a problem with the latest version of @actions/github --- docs/package.json | 28 +- docs/src/config.ts | 14 +- docs/src/github.ts | 84 +++-- docs/src/markdown.ts | 49 ++- docs/types.d.ts | 2 - pnpm-lock.yaml | 877 ++++++++++++++++++++++++------------------- 6 files changed, 592 insertions(+), 462 deletions(-) delete mode 100644 docs/types.d.ts diff --git a/docs/package.json b/docs/package.json index d544f675ff6b9..8f01d268d8e49 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,21 +9,21 @@ "check-links": "tsx --env-file=.env src/validate-docs-links.ts" }, "devDependencies": { - "@types/github-slugger": "^1.3.0", - "@types/node": "^22.1.0", - "@vercel/ncc": "0.34.0", - "tsx": "^4.7.2", - "typescript": "5.1.6" + "@octokit/webhooks-definitions": "3.67.3", + "@types/node": "22.7.8", + "@vercel/ncc": "0.38.2", + "tsx": "4.19.1", + "typescript": "5.6.3" }, "dependencies": { - "@actions/core": "^1.10.0", - "@actions/github": "^5.1.1", - "github-slugger": "1.2.0", - "gray-matter": "4.0.2", - "rehype-raw": "4.0.1", - "remark-parse": "7.0.1", - "remark-rehype": "5.0.0", - "unified": "8.4.1", - "unist-util-visit": "2.0.0" + "@actions/core": "1.11.1", + "@actions/github": "5.1.1", + "github-slugger": "2.0.0", + "gray-matter": "4.0.3", + "rehype-raw": "7.0.0", + "remark-parse": "11.0.0", + "remark-rehype": "11.1.1", + "unified": "11.0.5", + "unist-util-visit": "5.0.0" } } diff --git a/docs/src/config.ts b/docs/src/config.ts index 65bdd5b11bc09..a32baf83f0442 100644 --- a/docs/src/config.ts +++ b/docs/src/config.ts @@ -1,10 +1,16 @@ export interface Document { - body: string; + /** the Markdown file itself, without from-matter */ + content: string; + + /** the path to this markdown file */ path: string; + + /** the headings found in this markdown file */ headings: string[]; - source?: string; - related?: { - links: string[]; + + frontMatter: { + title: string; + description: string; }; } diff --git a/docs/src/github.ts b/docs/src/github.ts index 22aeee06016de..64e6045c74b70 100644 --- a/docs/src/github.ts +++ b/docs/src/github.ts @@ -1,34 +1,22 @@ -import * as github from "@actions/github"; import { setFailed } from "@actions/core"; -import { WebhookPayload } from "@actions/github/lib/interfaces"; +import { context, getOctokit } from "@actions/github"; +import { PullRequest } from "@octokit/webhooks-definitions/schema"; import { ReportRow } from "./config"; interface Comment { id: number; } -export { setFailed }; export const COMMENT_TAG = ""; -const { context, getOctokit } = github; -const octokit = getOctokit(process.env.GITHUB_TOKEN!); -const { owner, repo } = context.repo; - -export type PullRequest = NonNullable & { - head: { - sha: string; - repo: { - fork: boolean; - }; - }; -}; - -export const pullRequest = context.payload.pull_request as PullRequest; +type Octokit = ReturnType; -export async function findBotComment( +export const findBotComment = async ( + octokit: Octokit, pullRequest: PullRequest -): Promise { +): Promise => { try { + const { owner, repo } = context.repo; const { data: comments } = await octokit.rest.issues.listComments({ owner, repo, @@ -40,13 +28,15 @@ export async function findBotComment( setFailed("Error finding bot comment: " + error); return undefined; } -} +}; -export async function updateComment( +export const updateComment = async ( + octokit: Octokit, comment: string, botComment: Comment -): Promise { +): Promise => { try { + const { owner, repo } = context.repo; const { data } = await octokit.rest.issues.updateComment({ owner, repo, @@ -59,12 +49,13 @@ export async function updateComment( setFailed("Error updating comment: " + error); return ""; } -} +}; -export async function createComment( +export const createComment = async ( + octokit: Octokit, comment: string, pullRequest: PullRequest -): Promise { +): Promise => { if (pullRequest.head.repo.fork) { setFailed( "The action could not create a GitHub comment because it is initiated from a forked repo. View the action logs for a list of broken links." @@ -73,6 +64,7 @@ export async function createComment( return ""; } else { try { + const { owner, repo } = context.repo; const { data } = await octokit.rest.issues.createComment({ owner, repo, @@ -86,15 +78,14 @@ export async function createComment( return ""; } } -} +}; -export async function updateCheckStatus( +export const updateCheckStatus = async ( + octokit: Octokit, errorsExist: boolean, commentUrl: string | undefined, pullRequest: PullRequest -): Promise { - const checkName = "Docs Link Validation"; - +): Promise => { let summary, text; if (errorsExist) { @@ -105,19 +96,21 @@ export async function updateCheckStatus( summary = "No broken links found"; } + const { owner, repo } = context.repo; + const title = "Docs Link Validation"; const checkParams = { owner, repo, - name: checkName, + name: title, head_sha: pullRequest.head.sha, status: "completed", conclusion: errorsExist ? "failure" : "success", output: { - title: checkName, - summary: summary, - text: text, + title, + summary, + text, }, - }; + } as const; if (pullRequest.head.repo.fork) { if (errorsExist) { @@ -134,15 +127,19 @@ export async function updateCheckStatus( setFailed("Failed to create check: " + error); } } -} +}; export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { + const octokit = getOctokit(process.env.GITHUB_TOKEN!); + + const pullRequest = context.payload.pull_request as PullRequest; + if (!pullRequest) { return; } try { - const botComment = await findBotComment(pullRequest); + const botComment = await findBotComment(octokit, pullRequest); let commentUrl: string; if (reportRows.length > 0) { @@ -164,22 +161,27 @@ export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { comment = `${COMMENT_TAG}\n${errorComment}`; if (botComment) { - commentUrl = await updateComment(comment, botComment); + commentUrl = await updateComment(octokit, comment, botComment); } else { - commentUrl = await createComment(comment, pullRequest); + commentUrl = await createComment(octokit, comment, pullRequest); } process.exit(1); } if (botComment) { const comment = `${COMMENT_TAG}\nAll broken links are now fixed, thank you!`; - commentUrl = await updateComment(comment, botComment); + commentUrl = await updateComment(octokit, comment, botComment); } else { commentUrl = ""; // ?? } try { - await updateCheckStatus(reportRows.length > 0, commentUrl, pullRequest); + await updateCheckStatus( + octokit, + reportRows.length > 0, + commentUrl, + pullRequest + ); } catch (error) { setFailed("Failed to create GitHub check: " + error); } diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index 4499a93c92e72..fc8e304cc5c97 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -1,13 +1,12 @@ import fs from "fs/promises"; import path from "path"; -import unified from "unified"; -import markdown from "remark-parse"; -import remarkToRehype from "remark-rehype"; -import raw from "rehype-raw"; -import visit from "unist-util-visit"; +import { unified } from "unified"; +import remarkParse from "remark-parse"; +import remarkRehype from "remark-rehype"; +import rehypeRaw from "rehype-raw"; +import { visit } from "unist-util-visit"; import GitHubSlugger from "github-slugger"; import matter from "gray-matter"; -import { setFailed } from "./github"; import { DOCS_PATH, Document, EXCLUDED_HASHES, LinkError } from "./config"; const slugger = new GitHubSlugger(); @@ -58,9 +57,9 @@ const getHeadingsFromMarkdownTree = ( /** Create a processor to parse MDX content */ const markdownProcessor = unified() - .use(markdown) - .use(remarkToRehype, { allowDangerousHTML: true }) - .use(raw) + .use(remarkParse) + .use(remarkRehype) + .use(rehypeRaw) .use(function compiler() { // A compiler is required, and we only need the AST, so we can // just return it. @@ -79,6 +78,19 @@ const normalizePath = (filePath: string): string => { return normalized; }; +const validateFrontmatter = (path: string, data: Record) => { + if (!data.title) { + throw new Error(`Document is missing a title: ${path}`); + } + if (!data.description) { + throw new Error(`Document is missing a description: ${path}`); + } + return data as { + title: string; + description: string; + }; +}; + /** * Create a map of documents with their paths as keys and * document content and metadata as values @@ -87,21 +99,21 @@ const normalizePath = (filePath: string): string => { * doc pages: `api/example` */ const prepareDocumentMapEntry = async ( - filePath: string + path: string ): Promise<[string, Document]> => { try { - const mdxContent = await fs.readFile(filePath, "utf8"); + const mdxContent = await fs.readFile(path, "utf8"); const { content, data } = matter(mdxContent); + const frontMatter = validateFrontmatter(path, data); + const tree = markdownProcessor.parse(content); const headings = getHeadingsFromMarkdownTree(tree); - const normalizedUrlPath = normalizePath(filePath); + const normalizedUrlPath = normalizePath(path); - return [ - normalizedUrlPath, - { body: content, path: filePath, headings, ...data }, - ]; + return [normalizedUrlPath, { content, path, headings, frontMatter }]; } catch (error) { - setFailed(`Error preparing document map for file ${filePath}: ${error}`); + // TODO: handle error without needing GitHub + // setFailed(`Error preparing document map for file ${path}: ${error}`); return ["", {} as Document]; } }; @@ -212,7 +224,8 @@ export const collectLinkErrors = async (): Promise => { if (!doc) { return null; } - const { contents: tree } = await markdownProcessor.process(doc.body); + const vFile = await markdownProcessor.process(doc.content); + const tree = vFile.result; const linkErrors = traverseTreeAndValidateLinks(documentMap, tree, doc); if (linkErrors.length > 0) { return linkErrors; diff --git a/docs/types.d.ts b/docs/types.d.ts deleted file mode 100644 index 0d78462e62f01..0000000000000 --- a/docs/types.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare module "remark-rehype"; -declare module "rehype-raw"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87d0714c5a9bb..85be10c09fd59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,48 +54,48 @@ importers: docs: dependencies: '@actions/core': - specifier: ^1.10.0 - version: 1.10.1 + specifier: 1.11.1 + version: 1.11.1 '@actions/github': - specifier: ^5.1.1 + specifier: 5.1.1 version: 5.1.1 github-slugger: - specifier: 1.2.0 - version: 1.2.0 + specifier: 2.0.0 + version: 2.0.0 gray-matter: - specifier: 4.0.2 - version: 4.0.2 + specifier: 4.0.3 + version: 4.0.3 rehype-raw: - specifier: 4.0.1 - version: 4.0.1 + specifier: 7.0.0 + version: 7.0.0 remark-parse: - specifier: 7.0.1 - version: 7.0.1 + specifier: 11.0.0 + version: 11.0.0 remark-rehype: - specifier: 5.0.0 - version: 5.0.0 + specifier: 11.1.1 + version: 11.1.1 unified: - specifier: 8.4.1 - version: 8.4.1 + specifier: 11.0.5 + version: 11.0.5 unist-util-visit: - specifier: 2.0.0 - version: 2.0.0 + specifier: 5.0.0 + version: 5.0.0 devDependencies: - '@types/github-slugger': - specifier: ^1.3.0 - version: 1.3.0 + '@octokit/webhooks-definitions': + specifier: 3.67.3 + version: 3.67.3 '@types/node': - specifier: ^22.1.0 - version: 22.1.0 + specifier: 22.7.8 + version: 22.7.8 '@vercel/ncc': - specifier: 0.34.0 - version: 0.34.0 + specifier: 0.38.2 + version: 0.38.2 tsx: - specifier: ^4.7.2 - version: 4.7.2 + specifier: 4.19.1 + version: 4.19.1 typescript: - specifier: 5.1.6 - version: 5.1.6 + specifier: 5.6.3 + version: 5.6.3 examples: {} @@ -173,7 +173,7 @@ importers: devDependencies: '@vercel/style-guide': specifier: ^5.1.0 - version: 5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.3.3) + version: 5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.6.3) packages/eslint-config-turbo: dependencies: @@ -1017,10 +1017,17 @@ packages: /@actions/core@1.10.1: resolution: {integrity: sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==} dependencies: - '@actions/http-client': 2.2.0 + '@actions/http-client': 2.1.1 uuid: 8.3.2 dev: false + /@actions/core@1.11.1: + resolution: {integrity: sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==} + dependencies: + '@actions/exec': 1.1.1 + '@actions/http-client': 2.1.1 + dev: false + /@actions/exec@1.1.1: resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} dependencies: @@ -1044,6 +1051,12 @@ packages: tunnel: 0.0.6 dev: false + /@actions/http-client@2.1.1: + resolution: {integrity: sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==} + dependencies: + tunnel: 0.0.6 + dev: false + /@actions/http-client@2.2.0: resolution: {integrity: sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==} dependencies: @@ -2776,6 +2789,11 @@ packages: '@octokit/openapi-types': 12.11.0 dev: false + /@octokit/webhooks-definitions@3.67.3: + resolution: {integrity: sha512-do4Z1r2OVhuI0ihJhQ8Hg+yPWnBYEBNuFNCrvtPKoYT1w81jD7pBXgGe86lYuuNirkDHb0Nxt+zt4O5GiFJfgA==} + deprecated: Use @octokit/webhooks-types, @octokit/webhooks-schemas, or @octokit/webhooks-examples instead. See https://github.com/octokit/webhooks/issues/447 + dev: true + /@pkgjs/parseargs@0.11.0: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -2886,6 +2904,12 @@ packages: '@types/node': 20.11.30 '@types/responselike': 1.0.0 + /@types/debug@4.1.12: + resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + dependencies: + '@types/ms': 0.7.34 + dev: false + /@types/diff@5.0.2: resolution: {integrity: sha512-uw8eYMIReOwstQ0QKF0sICefSy8cNO/v7gOTiIy9SbwuHyEecJUm7qlgueOO5S1udZ5I/irVydHVwMchgzbKTg==} dev: true @@ -2927,10 +2951,6 @@ packages: resolution: {integrity: sha512-MHmwBtCb7OCv1DSivz2UNJXPGU/1btAWRKlqJ2saEhVJkpkvqHMMaOpKg0v4sAbDWSQekHGvPVMM8nQ+Jen03Q==} dev: false - /@types/github-slugger@1.3.0: - resolution: {integrity: sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==} - dev: true - /@types/glob@7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: @@ -2949,6 +2969,12 @@ packages: '@types/tinycolor2': 1.4.3 dev: true + /@types/hast@3.0.4: + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + dependencies: + '@types/unist': 3.0.3 + dev: false + /@types/http-cache-semantics@4.0.1: resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==} @@ -3027,9 +3053,19 @@ packages: '@types/node': 20.11.30 dev: true + /@types/mdast@4.0.4: + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + dependencies: + '@types/unist': 3.0.3 + dev: false + /@types/minimatch@5.1.1: resolution: {integrity: sha512-v55NF6Dz0wrj14Rn8iEABTWrhYRmgkJYuokduunSiq++t3hZ9VZ6dvcDt+850Pm5sGJZk8RaHzkFCXPxVINZ+g==} + /@types/ms@0.7.34: + resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} + dev: false + /@types/ndjson@2.0.2: resolution: {integrity: sha512-bvLIjknQTfXdWoJ2iljOpZXNB14d8VOH6NMXAlDle9T8jdpMsKqQs4M5+F7NnlU8WMPErtuGnJsLfERO8W9Oow==} dependencies: @@ -3066,10 +3102,10 @@ packages: resolution: {integrity: sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==} dev: true - /@types/node@22.1.0: - resolution: {integrity: sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==} + /@types/node@22.7.8: + resolution: {integrity: sha512-a922jJy31vqR5sk+kAdIENJjHblqcZ4RmERviFsER4WJcEONqxKcjNOlk0q7OUfrF5sddT+vng070cdfMlrPLg==} dependencies: - undici-types: 6.13.0 + undici-types: 6.19.8 dev: true /@types/normalize-package-data@2.4.1: @@ -3139,8 +3175,8 @@ packages: /@types/tinycolor2@1.4.3: resolution: {integrity: sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==} - /@types/unist@2.0.10: - resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} + /@types/unist@3.0.3: + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} dev: false /@types/uuid@9.0.0: @@ -3165,7 +3201,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3177,10 +3213,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) '@typescript-eslint/scope-manager': 6.18.1 - '@typescript-eslint/type-utils': 6.18.1(eslint@8.55.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.6.3) '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 eslint: 8.55.0 @@ -3188,13 +3224,13 @@ packages: ignore: 5.3.0 natural-compare: 1.4.0 semver: 7.5.4 - ts-api-utils: 1.0.2(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.2(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.18.1(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/parser@6.18.1(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3206,11 +3242,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.18.1 '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.6.3) '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 eslint: 8.55.0 - typescript: 5.3.3 + typescript: 5.6.3 transitivePeerDependencies: - supports-color dev: true @@ -3231,7 +3267,7 @@ packages: '@typescript-eslint/visitor-keys': 6.18.1 dev: true - /@typescript-eslint/type-utils@6.18.1(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/type-utils@6.18.1(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3241,12 +3277,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) - '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.6.3) + '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.6.3) debug: 4.3.4 eslint: 8.55.0 - ts-api-utils: 1.0.2(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.2(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color dev: true @@ -3261,7 +3297,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3): + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.6.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3276,13 +3312,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.3.3) - typescript: 5.3.3 + tsutils: 3.21.0(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.18.1(typescript@5.3.3): + /@typescript-eslint/typescript-estree@6.18.1(typescript@5.6.3): resolution: {integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3298,13 +3334,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.5.4 - ts-api-utils: 1.0.2(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.0.2(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3315,7 +3351,7 @@ packages: '@types/semver': 7.5.1 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.6.3) eslint: 8.55.0 eslint-scope: 5.1.1 semver: 7.5.4 @@ -3324,7 +3360,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.18.1(eslint@8.55.0)(typescript@5.3.3): + /@typescript-eslint/utils@6.18.1(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3335,7 +3371,7 @@ packages: '@types/semver': 7.5.1 '@typescript-eslint/scope-manager': 6.18.1 '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.6.3) eslint: 8.55.0 semver: 7.5.4 transitivePeerDependencies: @@ -3361,7 +3397,6 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true /@vercel/blob@0.22.1: resolution: {integrity: sha512-LtHmiYAdJhiSAfBP+5hHXtVyqZUND2G+ild/XVY0SOiB46ab7VUrQctwUMGcVx+yZyXZ2lXPT1HvRJtXFnKvHA==} @@ -3373,17 +3408,17 @@ packages: undici: 5.28.3 dev: false - /@vercel/ncc@0.34.0: - resolution: {integrity: sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==} + /@vercel/ncc@0.36.0: + resolution: {integrity: sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==} hasBin: true dev: true - /@vercel/ncc@0.36.0: - resolution: {integrity: sha512-/ZTUJ/ZkRt694k7KJNimgmHjtQcRuVwsST2Z6XfYveQIuBbHR+EqkTc1jfgPkQmMyk/vtpxo3nVxe8CNuau86A==} + /@vercel/ncc@0.38.2: + resolution: {integrity: sha512-3yel3jaxUg9pHBv4+KeC9qlbdZPug+UMtUOlhvpDYCMSgcNSrS2Hv1LoqMsOV7hf2lYscx+BESfJOIla1WsmMQ==} hasBin: true dev: true - /@vercel/style-guide@5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.3.3): + /@vercel/style-guide@5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.6.3): resolution: {integrity: sha512-L9lWYePIycm7vIOjDLj+mmMdmmPkW3/brHjgq+nJdvMOrL7Hdk/19w8X583HYSk0vWsq494o5Qkh6x5+uW7ljg==} engines: {node: '>=16'} peerDependencies: @@ -3404,25 +3439,25 @@ packages: '@babel/core': 7.23.6 '@babel/eslint-parser': 7.22.11(@babel/core@7.23.6)(eslint@8.55.0) '@rushstack/eslint-patch': 1.3.3 - '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.3.3) - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) eslint: 8.55.0 eslint-config-prettier: 9.0.0(eslint@8.55.0) eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.28.1) eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.28.1)(eslint@8.55.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.55.0) eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-typescript@3.6.0)(eslint@8.55.0) - eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.3.3) + eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.6.3) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.55.0) eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.2.3)(eslint@8.55.0) eslint-plugin-react: 7.33.2(eslint@8.55.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.55.0) - eslint-plugin-testing-library: 6.0.1(eslint@8.55.0)(typescript@5.3.3) + eslint-plugin-testing-library: 6.0.1(eslint@8.55.0)(typescript@5.6.3) eslint-plugin-tsdoc: 0.2.17 eslint-plugin-unicorn: 48.0.1(eslint@8.55.0) prettier: 2.8.7 prettier-plugin-packagejson: 2.4.5(prettier@2.8.7) - typescript: 5.3.3 + typescript: 5.6.3 transitivePeerDependencies: - eslint-import-resolver-node - eslint-import-resolver-webpack @@ -3839,8 +3874,8 @@ packages: babel-preset-current-node-syntax: 1.0.1(@babel/core@7.23.6) dev: true - /bail@1.0.5: - resolution: {integrity: sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==} + /bail@2.0.2: + resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} dev: false /balanced-match@1.0.2: @@ -4109,10 +4144,6 @@ packages: upper-case-first: 2.0.2 dev: true - /ccount@1.1.0: - resolution: {integrity: sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==} - dev: false - /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -4185,16 +4216,8 @@ packages: engines: {node: '>=10'} dev: true - /character-entities-legacy@1.1.4: - resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} - dev: false - - /character-entities@1.2.4: - resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} - dev: false - - /character-reference-invalid@1.1.4: - resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} + /character-entities@2.0.2: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} dev: false /chardet@0.7.0: @@ -4315,10 +4338,6 @@ packages: engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} dev: true - /collapse-white-space@1.0.6: - resolution: {integrity: sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==} - dev: false - /collect-v8-coverage@1.0.1: resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} dev: true @@ -4373,8 +4392,8 @@ packages: dependencies: delayed-stream: 1.0.0 - /comma-separated-tokens@1.0.8: - resolution: {integrity: sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==} + /comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} dev: false /commander@10.0.0: @@ -4694,6 +4713,12 @@ packages: resolution: {integrity: sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg==} dev: true + /decode-named-character-reference@1.0.2: + resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} + dependencies: + character-entities: 2.0.2 + dev: false + /decode-uri-component@0.2.2: resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} engines: {node: '>=0.10'} @@ -4848,13 +4873,6 @@ packages: /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} - dev: true - - /detab@2.0.4: - resolution: {integrity: sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g==} - dependencies: - repeat-string: 1.6.1 - dev: false /detect-file@1.0.0: resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} @@ -4881,6 +4899,12 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dependencies: + dequal: 2.0.3 + dev: false + /diff-sequences@27.5.1: resolution: {integrity: sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -4956,10 +4980,6 @@ packages: engines: {node: '>=10'} dev: true - /emoji-regex@6.1.1: - resolution: {integrity: sha512-WfVwM9e+M9B/4Qjh9SRnPX2A74Tom3WlVfWF9QWJ8f2BPa1u+/q4aEp1tizZ3vBKAZTg7B6yxn3t9iMjT+dv4w==} - dev: false - /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -4980,6 +5000,11 @@ packages: tapable: 2.2.1 dev: true + /entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + dev: false + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -5718,7 +5743,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) debug: 3.2.7 eslint: 8.55.0 eslint-import-resolver-node: 0.3.9 @@ -5748,7 +5773,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) array-includes: 3.1.6 array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 @@ -5773,7 +5798,7 @@ packages: - supports-color dev: true - /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.3.3): + /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -5786,8 +5811,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.3.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.6.3) eslint: 8.55.0 transitivePeerDependencies: - supports-color @@ -5829,7 +5854,7 @@ packages: optional: true dependencies: eslint: 8.55.0 - eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.3.3) + eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.6.3) dev: true /eslint-plugin-react-hooks@4.6.0(eslint@8.55.0): @@ -5866,13 +5891,13 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /eslint-plugin-testing-library@6.0.1(eslint@8.55.0)(typescript@5.3.3): + /eslint-plugin-testing-library@6.0.1(eslint@8.55.0)(typescript@5.6.3): resolution: {integrity: sha512-CEYtjpcF3hAaQtYsTZqciR7s5z+T0LCMTwJeW+pz6kBnGtc866wAKmhaiK2Gsjc2jWNP7Gt6zhNr2DE1ZW4e+g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.6.3) eslint: 8.55.0 transitivePeerDependencies: - supports-color @@ -6554,10 +6579,8 @@ packages: resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} dev: true - /github-slugger@1.2.0: - resolution: {integrity: sha512-wIaa75k1vZhyPm9yWrD08A5Xnx/V+RmzGrpjQuLemGKSb77Qukiaei58Bogrl/LZSADDfPzKJX8jhLs4CRTl7Q==} - dependencies: - emoji-regex: 6.1.1 + /github-slugger@2.0.0: + resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} dev: false /glob-parent@5.1.2: @@ -6728,8 +6751,8 @@ packages: /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - /gray-matter@4.0.2: - resolution: {integrity: sha512-7hB/+LxrOjq/dd8APlK0r24uL/67w7SkYnfwhNFwg/VDIGWGmduTDYf3WNstLW2fbbmRwrDGCVSJ2isuf2+4Hw==} + /gray-matter@4.0.3: + resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} engines: {node: '>=6.0'} dependencies: js-yaml: 3.14.1 @@ -6822,61 +6845,63 @@ packages: dependencies: function-bind: 1.1.1 - /hast-to-hyperscript@7.0.4: - resolution: {integrity: sha512-vmwriQ2H0RPS9ho4Kkbf3n3lY436QKLq6VaGA1pzBh36hBi3tm1DO9bR+kaJIbpT10UqaANDkMjxvjVfr+cnOA==} + /hast-util-from-parse5@8.0.1: + resolution: {integrity: sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==} dependencies: - comma-separated-tokens: 1.0.8 - property-information: 5.6.0 - space-separated-tokens: 1.1.5 - style-to-object: 0.2.3 - unist-util-is: 3.0.0 - web-namespaces: 1.1.4 + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + devlop: 1.1.0 + hastscript: 8.0.0 + property-information: 6.5.0 + vfile: 6.0.3 + vfile-location: 5.0.3 + web-namespaces: 2.0.1 dev: false - /hast-util-from-parse5@5.0.3: - resolution: {integrity: sha512-gOc8UB99F6eWVWFtM9jUikjN7QkWxB3nY0df5Z0Zq1/Nkwl5V4hAAsl0tmwlgWl/1shlTF8DnNYLO8X6wRV9pA==} + /hast-util-parse-selector@4.0.0: + resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==} dependencies: - ccount: 1.1.0 - hastscript: 5.1.2 - property-information: 5.6.0 - web-namespaces: 1.1.4 - xtend: 4.0.2 + '@types/hast': 3.0.4 dev: false - /hast-util-parse-selector@2.2.5: - resolution: {integrity: sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==} - dev: false - - /hast-util-raw@5.0.2: - resolution: {integrity: sha512-3ReYQcIHmzSgMq8UrDZHFL0oGlbuVGdLKs8s/Fe8BfHFAyZDrdv1fy/AGn+Fim8ZuvAHcJ61NQhVMtyfHviT/g==} + /hast-util-raw@9.0.4: + resolution: {integrity: sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA==} dependencies: - hast-util-from-parse5: 5.0.3 - hast-util-to-parse5: 5.1.2 - html-void-elements: 1.0.5 - parse5: 5.1.1 - unist-util-position: 3.1.0 - web-namespaces: 1.1.4 - xtend: 4.0.2 - zwitch: 1.0.5 + '@types/hast': 3.0.4 + '@types/unist': 3.0.3 + '@ungap/structured-clone': 1.2.0 + hast-util-from-parse5: 8.0.1 + hast-util-to-parse5: 8.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + parse5: 7.2.0 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + web-namespaces: 2.0.1 + zwitch: 2.0.4 dev: false - /hast-util-to-parse5@5.1.2: - resolution: {integrity: sha512-ZgYLJu9lYknMfsBY0rBV4TJn2xiwF1fXFFjbP6EE7S0s5mS8LIKBVWzhA1MeIs1SWW6GnnE4In6c3kPb+CWhog==} + /hast-util-to-parse5@8.0.0: + resolution: {integrity: sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==} dependencies: - hast-to-hyperscript: 7.0.4 - property-information: 5.6.0 - web-namespaces: 1.1.4 - xtend: 4.0.2 - zwitch: 1.0.5 + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + web-namespaces: 2.0.1 + zwitch: 2.0.4 dev: false - /hastscript@5.1.2: - resolution: {integrity: sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ==} + /hastscript@8.0.0: + resolution: {integrity: sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==} dependencies: - comma-separated-tokens: 1.0.8 - hast-util-parse-selector: 2.2.5 - property-information: 5.6.0 - space-separated-tokens: 1.1.5 + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + hast-util-parse-selector: 4.0.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 dev: false /header-case@1.0.1: @@ -6915,8 +6940,8 @@ packages: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true - /html-void-elements@1.0.5: - resolution: {integrity: sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w==} + /html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} dev: false /http-cache-semantics@4.1.1: @@ -7060,10 +7085,6 @@ packages: /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - /inline-style-parser@0.1.1: - resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} - dev: false - /inquirer-file-tree-selection-prompt@1.0.19: resolution: {integrity: sha512-aL01njANm5bJhQtUNBKWurniroUJ9I+rnJ20DBG3xY9gtKBxgpRFSRs0lzjx42iCRJ4J083IZ2SrN4t8ejPlEQ==} dependencies: @@ -7178,17 +7199,6 @@ packages: kind-of: 6.0.3 dev: false - /is-alphabetical@1.0.4: - resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} - dev: false - - /is-alphanumerical@1.0.4: - resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} - dependencies: - is-alphabetical: 1.0.4 - is-decimal: 1.0.4 - dev: false - /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: @@ -7288,10 +7298,6 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-decimal@1.0.4: - resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} - dev: false - /is-descriptor@0.1.6: resolution: {integrity: sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==} engines: {node: '>=0.10.0'} @@ -7380,10 +7386,6 @@ packages: dependencies: is-extglob: 2.1.1 - /is-hexadecimal@1.0.4: - resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} - dev: false - /is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -7447,15 +7449,9 @@ packages: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} - /is-plain-obj@2.1.0: - resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} - engines: {node: '>=8'} - dev: false - /is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} - dev: true /is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} @@ -7575,18 +7571,10 @@ packages: get-intrinsic: 1.2.1 dev: true - /is-whitespace-character@1.0.4: - resolution: {integrity: sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==} - dev: false - /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - /is-word-character@1.0.4: - resolution: {integrity: sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==} - dev: false - /is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} @@ -8570,10 +8558,6 @@ packages: object-visit: 1.0.1 dev: false - /markdown-escapes@1.0.4: - resolution: {integrity: sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==} - dev: false - /maxstache-stream@1.0.4: resolution: {integrity: sha512-v8qlfPN0pSp7bdSoLo1NTjG43GXGqk5W2NWFnOCq2GlmFFqebGzPCjLKSbShuqIOVorOtZSAy7O/S1OCCRONUw==} dependencies: @@ -8587,30 +8571,43 @@ packages: resolution: {integrity: sha512-53ZBxHrZM+W//5AcRVewiLpDunHnucfdzZUGz54Fnvo4tE+J3p8EL66kBrs2UhBXvYKTWckWYYWBqJqoTcenqg==} dev: false - /mdast-util-definitions@1.2.5: - resolution: {integrity: sha512-CJXEdoLfiISCDc2JB6QLb79pYfI6+GcIH+W2ox9nMc7od0Pz+bovcHsiq29xAQY6ayqe/9CsK2VzkSJdg1pFYA==} - dependencies: - unist-util-visit: 1.4.1 + /mdast-util-from-markdown@2.0.1: + resolution: {integrity: sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==} + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-decode-string: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color dev: false - /mdast-util-to-hast@6.0.2: - resolution: {integrity: sha512-GjcOimC9qHI0yNFAQdBesrZXzUkRdFleQlcoU8+TVNfDW6oLUazUx8MgUoTaUyCJzBOnE5AOgqhpURrSlf0QwQ==} + /mdast-util-to-hast@13.2.0: + resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} dependencies: - collapse-white-space: 1.0.6 - detab: 2.0.4 - mdast-util-definitions: 1.2.5 - mdurl: 1.0.1 - trim: 0.0.1 - trim-lines: 1.1.3 - unist-builder: 1.0.4 - unist-util-generated: 1.1.6 - unist-util-position: 3.1.0 - unist-util-visit: 1.4.1 - xtend: 4.0.2 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.2.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.0 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 dev: false - /mdurl@1.0.1: - resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} + /mdast-util-to-string@4.0.0: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + dependencies: + '@types/mdast': 4.0.4 dev: false /merge-stream@2.0.0: @@ -8620,6 +8617,181 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + /micromark-core-commonmark@2.0.1: + resolution: {integrity: sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==} + dependencies: + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-factory-destination: 2.0.0 + micromark-factory-label: 2.0.0 + micromark-factory-space: 2.0.0 + micromark-factory-title: 2.0.0 + micromark-factory-whitespace: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-classify-character: 2.0.0 + micromark-util-html-tag-name: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-subtokenize: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-factory-destination@2.0.0: + resolution: {integrity: sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==} + dependencies: + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-factory-label@2.0.0: + resolution: {integrity: sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==} + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-factory-space@2.0.0: + resolution: {integrity: sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==} + dependencies: + micromark-util-character: 2.1.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-factory-title@2.0.0: + resolution: {integrity: sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==} + dependencies: + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-factory-whitespace@2.0.0: + resolution: {integrity: sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==} + dependencies: + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-util-character@2.1.0: + resolution: {integrity: sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==} + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-util-chunked@2.0.0: + resolution: {integrity: sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==} + dependencies: + micromark-util-symbol: 2.0.0 + dev: false + + /micromark-util-classify-character@2.0.0: + resolution: {integrity: sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==} + dependencies: + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-util-combine-extensions@2.0.0: + resolution: {integrity: sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==} + dependencies: + micromark-util-chunked: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-util-decode-numeric-character-reference@2.0.1: + resolution: {integrity: sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==} + dependencies: + micromark-util-symbol: 2.0.0 + dev: false + + /micromark-util-decode-string@2.0.0: + resolution: {integrity: sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==} + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 2.1.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-symbol: 2.0.0 + dev: false + + /micromark-util-encode@2.0.0: + resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} + dev: false + + /micromark-util-html-tag-name@2.0.0: + resolution: {integrity: sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==} + dev: false + + /micromark-util-normalize-identifier@2.0.0: + resolution: {integrity: sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==} + dependencies: + micromark-util-symbol: 2.0.0 + dev: false + + /micromark-util-resolve-all@2.0.0: + resolution: {integrity: sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==} + dependencies: + micromark-util-types: 2.0.0 + dev: false + + /micromark-util-sanitize-uri@2.0.0: + resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==} + dependencies: + micromark-util-character: 2.1.0 + micromark-util-encode: 2.0.0 + micromark-util-symbol: 2.0.0 + dev: false + + /micromark-util-subtokenize@2.0.1: + resolution: {integrity: sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==} + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + + /micromark-util-symbol@2.0.0: + resolution: {integrity: sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==} + dev: false + + /micromark-util-types@2.0.0: + resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + dev: false + + /micromark@4.0.0: + resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} + dependencies: + '@types/debug': 4.1.12 + debug: 4.3.4 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.1 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-combine-extensions: 2.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-encode: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-subtokenize: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + transitivePeerDependencies: + - supports-color + dev: false + /micromatch@3.1.10: resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} engines: {node: '>=0.10.0'} @@ -9274,17 +9446,6 @@ packages: dependencies: callsites: 3.1.0 - /parse-entities@1.2.2: - resolution: {integrity: sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==} - dependencies: - character-entities: 1.2.4 - character-entities-legacy: 1.1.4 - character-reference-invalid: 1.1.4 - is-alphanumerical: 1.0.4 - is-decimal: 1.0.4 - is-hexadecimal: 1.0.4 - dev: false - /parse-filepath@1.0.2: resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} engines: {node: '>=0.8'} @@ -9309,14 +9470,16 @@ packages: engines: {node: '>=0.10.0'} dev: true - /parse5@5.1.1: - resolution: {integrity: sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==} - dev: false - /parse5@6.0.1: resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} dev: true + /parse5@7.2.0: + resolution: {integrity: sha512-ZkDsAOcxsUMZ4Lz5fVciOehNcJ+Gb8gTzcA4yl3wnc273BAybYWrQ+Ks/OjCjSEpjvQkDSeZbybK9qj2VHHdGA==} + dependencies: + entities: 4.5.0 + dev: false + /pascal-case@2.0.1: resolution: {integrity: sha512-qjS4s8rBOJa2Xm0jmxXiyh1+OFf6ekCWOvUaRgAQSktzlTbMotS0nmG9gyYAybCWBcuP4fsBeRCKNwGBnMe2OQ==} dependencies: @@ -9527,10 +9690,8 @@ packages: react-is: 16.13.1 dev: true - /property-information@5.6.0: - resolution: {integrity: sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==} - dependencies: - xtend: 4.0.2 + /property-information@6.5.0: + resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} dev: false /proxy-agent@6.2.2: @@ -9750,36 +9911,33 @@ packages: jsesc: 0.5.0 dev: true - /rehype-raw@4.0.1: - resolution: {integrity: sha512-g74dPCUWeB9EBfTfGF3lGOHSnZwFwN1ssc3Je9OwQO9f8yTkkAIrMqUVxT34h8zpi4ICU051tTLBZbOrzRWpxg==} + /rehype-raw@7.0.0: + resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==} dependencies: - hast-util-raw: 5.0.2 + '@types/hast': 3.0.4 + hast-util-raw: 9.0.4 + vfile: 6.0.3 dev: false - /remark-parse@7.0.1: - resolution: {integrity: sha512-WOZLa545jYXtSy+txza6ACudKWByQac4S2DmGk+tAGO/3XnVTOxwyCIxB7nTcLlk8Aayhcuf3cV1WV6U6L7/DQ==} + /remark-parse@11.0.0: + resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} dependencies: - collapse-white-space: 1.0.6 - is-alphabetical: 1.0.4 - is-decimal: 1.0.4 - is-whitespace-character: 1.0.4 - is-word-character: 1.0.4 - markdown-escapes: 1.0.4 - parse-entities: 1.2.2 - repeat-string: 1.6.1 - state-toggle: 1.0.3 - trim: 0.0.1 - trim-trailing-lines: 1.1.4 - unherit: 1.1.3 - unist-util-remove-position: 1.1.4 - vfile-location: 2.0.6 - xtend: 4.0.2 + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.1 + micromark-util-types: 2.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color dev: false - /remark-rehype@5.0.0: - resolution: {integrity: sha512-tgo+AeOotuh9FnGMkEPbE6C3OfdARqqSxT0H/KNGAiTwJLiDoRSm6x/ytqPZTyYSiQ/exbi/kx7k6uUvqYL1wQ==} + /remark-rehype@11.1.1: + resolution: {integrity: sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ==} dependencies: - mdast-util-to-hast: 6.0.2 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + mdast-util-to-hast: 13.2.0 + unified: 11.0.5 + vfile: 6.0.3 dev: false /repeat-element@1.1.4: @@ -10322,8 +10480,8 @@ packages: whatwg-url: 7.1.0 dev: true - /space-separated-tokens@1.1.5: - resolution: {integrity: sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==} + /space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} dev: false /spdx-correct@3.1.1: @@ -10377,10 +10535,6 @@ packages: escape-string-regexp: 2.0.0 dev: true - /state-toggle@1.0.3: - resolution: {integrity: sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==} - dev: false - /static-extend@0.1.2: resolution: {integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==} engines: {node: '>=0.10.0'} @@ -10526,12 +10680,6 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - /style-to-object@0.2.3: - resolution: {integrity: sha512-1d/k4EY2N7jVLOqf2j04dTc37TPOv/hHxZmvpg8Pdh8UYydxeu/C1W1U4vD8alzf5V2Gt7rLsmkr4dxAlDm9ng==} - dependencies: - inline-style-parser: 0.1.1 - dev: false - /sucrase@3.24.0: resolution: {integrity: sha512-SevqflhW356TKEyWjFHg2e5f3eH+5rzmsMJxrVMDvZIEHh/goYrpzDGA6APEj4ME9MdGm8oNgIzi1eF3c3dDQA==} engines: {node: '>=8'} @@ -10777,30 +10925,21 @@ packages: hasBin: true dev: true - /trim-lines@1.1.3: - resolution: {integrity: sha512-E0ZosSWYK2mkSu+KEtQ9/KqarVjA9HztOSX+9FDdNacRAq29RRV6ZQNgob3iuW8Htar9vAfEa6yyt5qBAHZDBA==} + /trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} dev: false - /trim-trailing-lines@1.1.4: - resolution: {integrity: sha512-rjUWSqnfTNrjbB9NQWfPMH/xRK1deHeGsHoVfpxJ++XeYXE0d6B1En37AHfw3jtfTU7dzMzZL2jjpe8Qb5gLIQ==} + /trough@2.2.0: + resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} dev: false - /trim@0.0.1: - resolution: {integrity: sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ==} - deprecated: Use String.prototype.trim() instead - dev: false - - /trough@1.0.5: - resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==} - dev: false - - /ts-api-utils@1.0.2(typescript@5.3.3): + /ts-api-utils@1.0.2(typescript@5.6.3): resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.3.3 + typescript: 5.6.3 dev: true /ts-interface-checker@0.1.13: @@ -10927,7 +11066,7 @@ packages: normalize-path: 3.0.0 safe-stable-stringify: 2.4.3 tslib: 2.6.3 - typescript: 5.5.4 + typescript: 5.6.3 dev: true /ts-node@10.9.1(@types/node@18.17.4)(typescript@5.3.3): @@ -11086,14 +11225,14 @@ packages: - ts-node dev: true - /tsutils@3.21.0(typescript@5.3.3): + /tsutils@3.21.0(typescript@5.6.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.3.3 + typescript: 5.6.3 dev: true /tsx@4.19.0: @@ -11107,6 +11246,17 @@ packages: fsevents: 2.3.3 dev: true + /tsx@4.19.1: + resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.23.1 + get-tsconfig: 4.7.6 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /tsx@4.7.2: resolution: {integrity: sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==} engines: {node: '>=18.0.0'} @@ -11202,12 +11352,6 @@ packages: is-typedarray: 1.0.0 dev: true - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - /typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} @@ -11219,8 +11363,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - /typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + /typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -11249,8 +11393,8 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - /undici-types@6.13.0: - resolution: {integrity: sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==} + /undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} dev: true /undici@5.28.3: @@ -11260,22 +11404,16 @@ packages: '@fastify/busboy': 2.1.0 dev: false - /unherit@1.1.3: - resolution: {integrity: sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==} - dependencies: - inherits: 2.0.4 - xtend: 4.0.2 - dev: false - - /unified@8.4.1: - resolution: {integrity: sha512-YPj/uIIZSO7mMIZQj/5Z3hDl4lshWYRQGs5TgUCjHTVdklUWH+O94mK5Cy77SEcmEUwGhnUcudMuH/zIwporqw==} + /unified@11.0.5: + resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} dependencies: - '@types/unist': 2.0.10 - bail: 1.0.5 + '@types/unist': 3.0.3 + bail: 2.0.2 + devlop: 1.1.0 extend: 3.0.2 - is-plain-obj: 2.1.0 - trough: 1.0.5 - vfile: 4.2.1 + is-plain-obj: 4.1.0 + trough: 2.2.0 + vfile: 6.0.3 dev: false /union-value@1.0.1: @@ -11288,65 +11426,37 @@ packages: set-value: 2.0.1 dev: false - /unist-builder@1.0.4: - resolution: {integrity: sha512-v6xbUPP7ILrT15fHGrNyHc1Xda8H3xVhP7/HAIotHOhVPjH5dCXA097C3Rry1Q2O+HbOLCao4hfPB+EYEjHgVg==} - dependencies: - object-assign: 4.1.1 - dev: false - - /unist-util-generated@1.1.6: - resolution: {integrity: sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg==} - dev: false - - /unist-util-is@3.0.0: - resolution: {integrity: sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==} - dev: false - - /unist-util-is@4.1.0: - resolution: {integrity: sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==} - dev: false - - /unist-util-position@3.1.0: - resolution: {integrity: sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==} - dev: false - - /unist-util-remove-position@1.1.4: - resolution: {integrity: sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A==} + /unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} dependencies: - unist-util-visit: 1.4.1 + '@types/unist': 3.0.3 dev: false - /unist-util-stringify-position@2.0.3: - resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} + /unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} dependencies: - '@types/unist': 2.0.10 + '@types/unist': 3.0.3 dev: false - /unist-util-visit-parents@2.1.2: - resolution: {integrity: sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==} + /unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} dependencies: - unist-util-is: 3.0.0 + '@types/unist': 3.0.3 dev: false - /unist-util-visit-parents@3.1.1: - resolution: {integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==} + /unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} dependencies: - '@types/unist': 2.0.10 - unist-util-is: 4.1.0 + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 dev: false - /unist-util-visit@1.4.1: - resolution: {integrity: sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==} + /unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} dependencies: - unist-util-visit-parents: 2.1.2 - dev: false - - /unist-util-visit@2.0.0: - resolution: {integrity: sha512-kiTpWKsF54u/78L/UU/i7lxrnqGiEWBgqCpaIZBYP0gwUC+Akq0Ajm4U8JiNIoQNfAioBdsyarnOcTEAb9mLeQ==} - dependencies: - '@types/unist': 2.0.10 - unist-util-is: 4.1.0 - unist-util-visit-parents: 3.1.1 + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 dev: false /universal-user-agent@6.0.0: @@ -11804,24 +11914,25 @@ packages: - encoding dev: false - /vfile-location@2.0.6: - resolution: {integrity: sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==} + /vfile-location@5.0.3: + resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} + dependencies: + '@types/unist': 3.0.3 + vfile: 6.0.3 dev: false - /vfile-message@2.0.4: - resolution: {integrity: sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==} + /vfile-message@4.0.2: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} dependencies: - '@types/unist': 2.0.10 - unist-util-stringify-position: 2.0.3 + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 dev: false - /vfile@4.2.1: - resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==} + /vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} dependencies: - '@types/unist': 2.0.10 - is-buffer: 2.0.5 - unist-util-stringify-position: 2.0.3 - vfile-message: 2.0.4 + '@types/unist': 3.0.3 + vfile-message: 4.0.2 dev: false /vm2@3.9.19: @@ -11884,8 +11995,8 @@ packages: dependencies: defaults: 1.0.4 - /web-namespaces@1.1.4: - resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} + /web-namespaces@2.0.1: + resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} dev: false /webidl-conversions@3.0.1: @@ -12128,6 +12239,6 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - /zwitch@1.0.5: - resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} + /zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: false From 66911765701ea8295a8260d7d7e02831ab25d7b8 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 12:29:23 -0400 Subject: [PATCH 03/30] error handling supported locally --- docs/src/markdown.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index fc8e304cc5c97..98c3d935218ec 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -112,9 +112,7 @@ const prepareDocumentMapEntry = async ( return [normalizedUrlPath, { content, path, headings, frontMatter }]; } catch (error) { - // TODO: handle error without needing GitHub - // setFailed(`Error preparing document map for file ${path}: ${error}`); - return ["", {} as Document]; + throw new Error(`Error preparing document map for file ${path}: ${error}`); } }; @@ -203,7 +201,7 @@ const traverseTreeAndValidateLinks = ( } }); } catch (error) { - setFailed("Error traversing tree: " + error); + throw new Error(`Error traversing tree: ${error}`); } return errors; From bad577d8e9a675e623e7e4697fdc6b762b89bffb Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 12:32:57 -0400 Subject: [PATCH 04/30] format reportRows for GitHub --- docs/src/github.ts | 7 +++++-- docs/src/validate-docs-links.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/src/github.ts b/docs/src/github.ts index 64e6045c74b70..0eb8c53253b08 100644 --- a/docs/src/github.ts +++ b/docs/src/github.ts @@ -151,8 +151,11 @@ export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { "", "", "| Broken link | Type | File |", - "| ----------- | ----------- | ----------- |", - ...reportRows, + "| ----------- | ---- | ---- |", + ...reportRows.map(({ link, path, type }) => { + const docPath = path.replace("../../../", ""); + return `| ${link} | ${type} | [/${docPath}](https://github.com/vercel/turborepo/blob/${pullRequest.head.sha}/${docPath}) |`; + }), "", "Thank you :pray:", ].join("\n"); diff --git a/docs/src/validate-docs-links.ts b/docs/src/validate-docs-links.ts index 7a623b0d8bc19..805deae889644 100644 --- a/docs/src/validate-docs-links.ts +++ b/docs/src/validate-docs-links.ts @@ -30,7 +30,7 @@ const getReportRows = async (): Promise => { .map((linkError) => ({ link: linkError.href, type: linkError.type, - path: linkError.doc.path, //.replace("../../../", "")// [/${docPath}](https://github.com/vercel/turborepo/blob/${pullRequest.head.sha}/${docPath}) | \n`; + path: linkError.doc.path, })) .sort((a, b) => a.type.localeCompare(b.type)); }; From b131796634f4166b469d18f6fc4c065bb1556cd7 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 12:36:30 -0400 Subject: [PATCH 05/30] improve comment reporting --- docs/src/github.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/src/github.ts b/docs/src/github.ts index 0eb8c53253b08..8d0517830fc8d 100644 --- a/docs/src/github.ts +++ b/docs/src/github.ts @@ -140,7 +140,6 @@ export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { try { const botComment = await findBotComment(octokit, pullRequest); - let commentUrl: string; if (reportRows.length > 0) { const errorComment = [ @@ -160,17 +159,15 @@ export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { "Thank you :pray:", ].join("\n"); - let comment; - - comment = `${COMMENT_TAG}\n${errorComment}`; - if (botComment) { - commentUrl = await updateComment(octokit, comment, botComment); - } else { - commentUrl = await createComment(octokit, comment, pullRequest); - } + await updateComment( + octokit, + `${COMMENT_TAG}\n${errorComment}`, + botComment ?? pullRequest + ); process.exit(1); } + let commentUrl: string; if (botComment) { const comment = `${COMMENT_TAG}\nAll broken links are now fixed, thank you!`; commentUrl = await updateComment(octokit, comment, botComment); From 2a45689c153ff111a5367e232269df65f00139bb Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 13:10:18 -0400 Subject: [PATCH 06/30] this is the thing that's been breaking our docs links checker.. :not-impressed-face: --- docs/repo-docs/guides/tools/typescript.mdx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index d0f6257b25763..73dd8e7f3c4f6 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -73,7 +73,9 @@ Inside `packages/typescript-config`, you have a few `json` files which represent } ``` -`tsconfig` options reference + + `tsconfig` options reference + ### Creating the rest of the package @@ -292,15 +294,15 @@ In [Compiled packages](https://turbo.build/repo/docs/core-concepts/internal-pack + ```tsx title="./packages/ui/button.tsx" -import { MY_STRING } from "#utils.js" // Uses .js extension // [!code highlight] +import { MY_STRING } from '#utils.js'; // Uses .js extension // [!code highlight] export const Button = () => { - return ( - - ) -} + return ; +}; ``` + From 0663d7c6fe1d2dfc7219967a806d33a374c863f5 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 15:35:41 -0400 Subject: [PATCH 07/30] ready to test GitHub --- docs/src/github.ts | 28 ++++++++++++++-------------- docs/src/local.ts | 1 + docs/src/markdown.ts | 28 +++++++++++++++++++--------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/src/github.ts b/docs/src/github.ts index 8d0517830fc8d..c658ecc5cbbe0 100644 --- a/docs/src/github.ts +++ b/docs/src/github.ts @@ -86,25 +86,33 @@ export const updateCheckStatus = async ( commentUrl: string | undefined, pullRequest: PullRequest ): Promise => { - let summary, text; + let summary, text, conclusion; if (errorsExist) { summary = "This PR introduces broken links to the docs. Click details for a list."; text = `[See the comment for details](${commentUrl})`; + conclusion = "failure" as const; + + if (pullRequest.head.repo.fork) { + setFailed( + "This PR introduces broken links to the docs. The action could not create a GitHub check because it is initiated from a forked repo." + ); + } } else { summary = "No broken links found"; + conclusion = "success" as const; + text = ""; } - const { owner, repo } = context.repo; const title = "Docs Link Validation"; const checkParams = { - owner, - repo, + owner: context.repo.owner, + repo: context.repo.repo, name: title, head_sha: pullRequest.head.sha, status: "completed", - conclusion: errorsExist ? "failure" : "success", + conclusion, output: { title, summary, @@ -112,15 +120,7 @@ export const updateCheckStatus = async ( }, } as const; - if (pullRequest.head.repo.fork) { - if (errorsExist) { - setFailed( - "This PR introduces broken links to the docs. The action could not create a GitHub check because it is initiated from a forked repo." - ); - } else { - console.log("Link validation was successful."); - } - } else { + if (!pullRequest.head.repo.fork) { try { await octokit.rest.checks.create(checkParams); } catch (error) { diff --git a/docs/src/local.ts b/docs/src/local.ts index edd8c375735d2..24ea8be44d59b 100644 --- a/docs/src/local.ts +++ b/docs/src/local.ts @@ -3,6 +3,7 @@ import { ReportRow } from "./config"; /** this will report errors locally, on standard out */ export const reportErrorsLocally = (reportRows: ReportRow[]) => { if (reportRows.length === 0) { + console.log("Link validation was successful."); return; } console.log("This PR introduces broken links to the docs:"); diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index 98c3d935218ec..2af2c4a2ba1bc 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -1,3 +1,4 @@ +import { inspect } from "util"; import fs from "fs/promises"; import path from "path"; import { unified } from "unified"; @@ -40,6 +41,8 @@ const getHeadingsFromMarkdownTree = ( const headings: string[] = []; slugger.reset(); + // console.log(inspect(tree, { depth: null, colors: false })); + visit(tree, "heading", (node) => { let headingText = ""; // Account for headings with inline code blocks by concatenating the @@ -49,7 +52,8 @@ const getHeadingsFromMarkdownTree = ( headingText += innerNode.value; } }); - headings.push(slugger.slug(headingText)); + const slugified = slugger.slug(headingText); + headings.push(slugified); }); return headings; @@ -161,16 +165,22 @@ const validateInternalLink = /** Checks if the hash links point to existing sections within the same document */ const validateHashLink = (doc: Document, href: string) => { const hashLink = href.replace("#", ""); + if (EXCLUDED_HASHES.includes(hashLink)) { + return []; + } - if (!EXCLUDED_HASHES.includes(hashLink) && !doc.headings.includes(hashLink)) { - let linkError: LinkError = { - type: "hash", - href, - doc, - }; - return [linkError]; + if (doc.headings.includes(hashLink)) { + return []; } - return []; + + let linkError: LinkError = { + type: "hash", + href, + doc, + }; + const { content, ...docWithoutContent } = doc; + console.log(docWithoutContent); + return [linkError]; }; // corresponds to vfile.VFile['contents'] From 38efd11742b3776463fb366477380c702cefba66 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 15:44:35 -0400 Subject: [PATCH 08/30] remove local env (it now works locally without it) --- docs/.env.example | 2 -- docs/package.json | 2 +- docs/src/github.ts | 24 ++++++++++++++++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) delete mode 100644 docs/.env.example diff --git a/docs/.env.example b/docs/.env.example deleted file mode 100644 index 8a916b07807c2..0000000000000 --- a/docs/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -GITHUB_TOKEN=INSERT_YOUR_GITHUB_TOKEN_HERE -GITHUB_REPOSITORY=github.com/vercel/turborepo diff --git a/docs/package.json b/docs/package.json index 8f01d268d8e49..885cadca42bed 100644 --- a/docs/package.json +++ b/docs/package.json @@ -6,7 +6,7 @@ "src" ], "scripts": { - "check-links": "tsx --env-file=.env src/validate-docs-links.ts" + "check-links": "tsx src/validate-docs-links.ts" }, "devDependencies": { "@octokit/webhooks-definitions": "3.67.3", diff --git a/docs/src/github.ts b/docs/src/github.ts index c658ecc5cbbe0..76487c1f417ab 100644 --- a/docs/src/github.ts +++ b/docs/src/github.ts @@ -130,12 +130,32 @@ export const updateCheckStatus = async ( }; export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { - const octokit = getOctokit(process.env.GITHUB_TOKEN!); + const { GITHUB_TOKEN, GITHUB_REPOSITORY, CI, GITHUB_ACTIONS } = process.env; + + if (!CI) { + // we only want to run this in CI + return; + } + + if (!GITHUB_ACTIONS) { + // we only want to run this in GitHub Actions + return; + } + + if (!GITHUB_TOKEN) { + throw new Error("No GITHUB_TOKEN found, skipping GitHub reporting"); + } + + if (!GITHUB_REPOSITORY) { + throw new Error("No GITHUB_REPOSITORY found, skipping GitHub reporting"); + } + + const octokit = getOctokit(GITHUB_TOKEN); const pullRequest = context.payload.pull_request as PullRequest; if (!pullRequest) { - return; + throw new Error("No pullRequest found, skipping GitHub reporting"); } try { From ab2b0e107c378391a893fc4d83e278e3b7816a02 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 15:49:46 -0400 Subject: [PATCH 09/30] update node on docs link check runner --- .github/workflows/docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 73c74fa917de3..21b8ab6701fcd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,9 @@ jobs: - uses: actions/checkout@v4 - name: "Setup Node" - uses: ./.github/actions/setup-node + uses: ./.github/actions/setup-node@v4 + with: + node-version: 20 - name: "Run link checker" run: cd docs && pnpm run check-links From 8793489bda61397658cb180092b51199b5eade34 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 15:50:51 -0400 Subject: [PATCH 10/30] fix path for action --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 21b8ab6701fcd..c88d29f6bae9b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - name: "Setup Node" - uses: ./.github/actions/setup-node@v4 + uses: actions/setup-node@v4 with: node-version: 20 From 126f0442e10fd4e46d0b0f9441bc089b4421519f Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 15:52:04 -0400 Subject: [PATCH 11/30] include pnpm --- .github/workflows/docs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c88d29f6bae9b..548850bde024b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,12 +16,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: "Setup Node" + - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20 + cache: pnpm - - name: "Run link checker" + - name: Run link checker run: cd docs && pnpm run check-links env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 84dfac90cb31ae3fcaeb0f2240462650409bf80f Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 15:59:04 -0400 Subject: [PATCH 12/30] use the thing we have for this --- .github/workflows/docs.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 548850bde024b..c920db365822d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,13 +14,12 @@ jobs: validate-docs-links: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 + - uses: ./.github/actions/setup-node with: node-version: 20 - cache: pnpm - name: Run link checker run: cd docs && pnpm run check-links From f42931ecec88cc908dc7ca118619a403c4c4922a Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 16:17:17 -0400 Subject: [PATCH 13/30] make it fail and see what happens --- docs/repo-docs/guides/tools/typescript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 73dd8e7f3c4f6..97155cb35cbae 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -12,7 +12,7 @@ TypeScript is an excellent tool in monorepos, allowing teams to safely add types - [Sharing TypeScript configuration](#sharing-tsconfigjson) - [Building a TypeScript package](#building-a-typescript-package) -- [Making type checking faster across your workspace](/repo/docs/guides/tools/typescript#linting-your-codebase) +- [Making type checking faster across your workspace](/repo/docs/guides/tools/typfescript#linting-your-codebase) This guide assumes you are using a recent version of TypeScript and uses some From f3c80ac370dafb68c1c915517a1bf2960b821d1b Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 16:25:08 -0400 Subject: [PATCH 14/30] what would it be like if we just failed normally --- docs/src/github.ts | 211 -------------------------------- docs/src/local.ts | 11 -- docs/src/validate-docs-links.ts | 23 ++-- 3 files changed, 10 insertions(+), 235 deletions(-) delete mode 100644 docs/src/github.ts delete mode 100644 docs/src/local.ts diff --git a/docs/src/github.ts b/docs/src/github.ts deleted file mode 100644 index 76487c1f417ab..0000000000000 --- a/docs/src/github.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { setFailed } from "@actions/core"; -import { context, getOctokit } from "@actions/github"; -import { PullRequest } from "@octokit/webhooks-definitions/schema"; -import { ReportRow } from "./config"; - -interface Comment { - id: number; -} - -export const COMMENT_TAG = ""; - -type Octokit = ReturnType; - -export const findBotComment = async ( - octokit: Octokit, - pullRequest: PullRequest -): Promise => { - try { - const { owner, repo } = context.repo; - const { data: comments } = await octokit.rest.issues.listComments({ - owner, - repo, - issue_number: pullRequest.number, - }); - - return comments.find((c) => c.body?.includes(COMMENT_TAG)); - } catch (error) { - setFailed("Error finding bot comment: " + error); - return undefined; - } -}; - -export const updateComment = async ( - octokit: Octokit, - comment: string, - botComment: Comment -): Promise => { - try { - const { owner, repo } = context.repo; - const { data } = await octokit.rest.issues.updateComment({ - owner, - repo, - comment_id: botComment.id, - body: comment, - }); - - return data.html_url; - } catch (error) { - setFailed("Error updating comment: " + error); - return ""; - } -}; - -export const createComment = async ( - octokit: Octokit, - comment: string, - pullRequest: PullRequest -): Promise => { - if (pullRequest.head.repo.fork) { - setFailed( - "The action could not create a GitHub comment because it is initiated from a forked repo. View the action logs for a list of broken links." - ); - - return ""; - } else { - try { - const { owner, repo } = context.repo; - const { data } = await octokit.rest.issues.createComment({ - owner, - repo, - issue_number: pullRequest.number, - body: comment, - }); - - return data.html_url; - } catch (error) { - setFailed("Error creating comment: " + error); - return ""; - } - } -}; - -export const updateCheckStatus = async ( - octokit: Octokit, - errorsExist: boolean, - commentUrl: string | undefined, - pullRequest: PullRequest -): Promise => { - let summary, text, conclusion; - - if (errorsExist) { - summary = - "This PR introduces broken links to the docs. Click details for a list."; - text = `[See the comment for details](${commentUrl})`; - conclusion = "failure" as const; - - if (pullRequest.head.repo.fork) { - setFailed( - "This PR introduces broken links to the docs. The action could not create a GitHub check because it is initiated from a forked repo." - ); - } - } else { - summary = "No broken links found"; - conclusion = "success" as const; - text = ""; - } - - const title = "Docs Link Validation"; - const checkParams = { - owner: context.repo.owner, - repo: context.repo.repo, - name: title, - head_sha: pullRequest.head.sha, - status: "completed", - conclusion, - output: { - title, - summary, - text, - }, - } as const; - - if (!pullRequest.head.repo.fork) { - try { - await octokit.rest.checks.create(checkParams); - } catch (error) { - setFailed("Failed to create check: " + error); - } - } -}; - -export const reportErrorsToGitHub = async (reportRows: ReportRow[]) => { - const { GITHUB_TOKEN, GITHUB_REPOSITORY, CI, GITHUB_ACTIONS } = process.env; - - if (!CI) { - // we only want to run this in CI - return; - } - - if (!GITHUB_ACTIONS) { - // we only want to run this in GitHub Actions - return; - } - - if (!GITHUB_TOKEN) { - throw new Error("No GITHUB_TOKEN found, skipping GitHub reporting"); - } - - if (!GITHUB_REPOSITORY) { - throw new Error("No GITHUB_REPOSITORY found, skipping GitHub reporting"); - } - - const octokit = getOctokit(GITHUB_TOKEN); - - const pullRequest = context.payload.pull_request as PullRequest; - - if (!pullRequest) { - throw new Error("No pullRequest found, skipping GitHub reporting"); - } - - try { - const botComment = await findBotComment(octokit, pullRequest); - - if (reportRows.length > 0) { - const errorComment = [ - "Hi there :wave:", - "", - "", - "It looks like this PR introduces broken links to the docs, please take a moment to fix them before merging:", - "", - "", - "| Broken link | Type | File |", - "| ----------- | ---- | ---- |", - ...reportRows.map(({ link, path, type }) => { - const docPath = path.replace("../../../", ""); - return `| ${link} | ${type} | [/${docPath}](https://github.com/vercel/turborepo/blob/${pullRequest.head.sha}/${docPath}) |`; - }), - "", - "Thank you :pray:", - ].join("\n"); - - await updateComment( - octokit, - `${COMMENT_TAG}\n${errorComment}`, - botComment ?? pullRequest - ); - process.exit(1); - } - - let commentUrl: string; - if (botComment) { - const comment = `${COMMENT_TAG}\nAll broken links are now fixed, thank you!`; - commentUrl = await updateComment(octokit, comment, botComment); - } else { - commentUrl = ""; // ?? - } - - try { - await updateCheckStatus( - octokit, - reportRows.length > 0, - commentUrl, - pullRequest - ); - } catch (error) { - setFailed("Failed to create GitHub check: " + error); - } - } catch (error) { - setFailed("Error validating internal links: " + error); - } -}; diff --git a/docs/src/local.ts b/docs/src/local.ts deleted file mode 100644 index 24ea8be44d59b..0000000000000 --- a/docs/src/local.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ReportRow } from "./config"; - -/** this will report errors locally, on standard out */ -export const reportErrorsLocally = (reportRows: ReportRow[]) => { - if (reportRows.length === 0) { - console.log("Link validation was successful."); - return; - } - console.log("This PR introduces broken links to the docs:"); - console.table(reportRows); -}; diff --git a/docs/src/validate-docs-links.ts b/docs/src/validate-docs-links.ts index 805deae889644..3624e8a02d256 100644 --- a/docs/src/validate-docs-links.ts +++ b/docs/src/validate-docs-links.ts @@ -1,6 +1,4 @@ -import { reportErrorsToGitHub } from "./github"; import { ReportRow } from "./config"; -import { reportErrorsLocally } from "./local"; import { collectLinkErrors } from "./markdown"; /* @@ -20,26 +18,25 @@ import { collectLinkErrors } from "./markdown"; comment is added to the PR. */ -/** - * this function will return a list of `ReportRow`s, preparing for presentation - */ -const getReportRows = async (): Promise => { +/** Main function that triggers link validation across .mdx files */ +const validateAllInternalLinks = async (): Promise => { let errorReports = await collectLinkErrors(); + if (errorReports.length === 0) { + console.log("Link validation was successful."); + return; + } - return errorReports + const reportRows: ReportRow[] = errorReports .map((linkError) => ({ link: linkError.href, type: linkError.type, path: linkError.doc.path, })) .sort((a, b) => a.type.localeCompare(b.type)); -}; -/** Main function that triggers link validation across .mdx files */ -const validateAllInternalLinks = async (): Promise => { - const reportRows = await getReportRows(); - reportErrorsLocally(reportRows); - reportErrorsToGitHub(reportRows); + console.log("This PR introduces broken links to the docs:"); + console.table(reportRows); + process.exit(1); }; validateAllInternalLinks(); From b9d41fdda24474c167a8ffaa23bc68ae2a8117a5 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 16:28:17 -0400 Subject: [PATCH 15/30] Revert "make it fail and see what happens" This reverts commit f42931ecec88cc908dc7ca118619a403c4c4922a. --- docs/repo-docs/guides/tools/typescript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 97155cb35cbae..73dd8e7f3c4f6 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -12,7 +12,7 @@ TypeScript is an excellent tool in monorepos, allowing teams to safely add types - [Sharing TypeScript configuration](#sharing-tsconfigjson) - [Building a TypeScript package](#building-a-typescript-package) -- [Making type checking faster across your workspace](/repo/docs/guides/tools/typfescript#linting-your-codebase) +- [Making type checking faster across your workspace](/repo/docs/guides/tools/typescript#linting-your-codebase) This guide assumes you are using a recent version of TypeScript and uses some From 9816349b8fcda48508f8b8f493fdd875e4e83e23 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 16:40:20 -0400 Subject: [PATCH 16/30] removes more --- docs/package.json | 4 ---- docs/src/config.ts | 37 --------------------------------- docs/src/markdown.ts | 37 +++++++++++++++++++++++++-------- docs/src/validate-docs-links.ts | 10 ++++++--- pnpm-lock.yaml | 29 -------------------------- 5 files changed, 35 insertions(+), 82 deletions(-) delete mode 100644 docs/src/config.ts diff --git a/docs/package.json b/docs/package.json index 885cadca42bed..96f01d16915e9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,15 +9,11 @@ "check-links": "tsx src/validate-docs-links.ts" }, "devDependencies": { - "@octokit/webhooks-definitions": "3.67.3", "@types/node": "22.7.8", - "@vercel/ncc": "0.38.2", "tsx": "4.19.1", "typescript": "5.6.3" }, "dependencies": { - "@actions/core": "1.11.1", - "@actions/github": "5.1.1", "github-slugger": "2.0.0", "gray-matter": "4.0.3", "rehype-raw": "7.0.0", diff --git a/docs/src/config.ts b/docs/src/config.ts deleted file mode 100644 index a32baf83f0442..0000000000000 --- a/docs/src/config.ts +++ /dev/null @@ -1,37 +0,0 @@ -export interface Document { - /** the Markdown file itself, without from-matter */ - content: string; - - /** the path to this markdown file */ - path: string; - - /** the headings found in this markdown file */ - headings: string[]; - - frontMatter: { - title: string; - description: string; - }; -} - -export type ErrorType = "link" | "hash" | "source" | "related"; - -export type LinkError = { - type: ErrorType; - href: string; - doc: Document; -}; - -export type ReportRow = { - link: LinkError["href"]; - type: LinkError["type"]; - path: Document["path"]; -}; - -export interface DocumentReport { - doc: Document; - errors: LinkError[]; -} - -export const DOCS_PATH = "."; -export const EXCLUDED_HASHES = ["top"]; diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index 2af2c4a2ba1bc..8dbefd7dba105 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -1,4 +1,3 @@ -import { inspect } from "util"; import fs from "fs/promises"; import path from "path"; import { unified } from "unified"; @@ -8,7 +7,33 @@ import rehypeRaw from "rehype-raw"; import { visit } from "unist-util-visit"; import GitHubSlugger from "github-slugger"; import matter from "gray-matter"; -import { DOCS_PATH, Document, EXCLUDED_HASHES, LinkError } from "./config"; + +export interface Document { + /** the Markdown file itself, without from-matter */ + content: string; + + /** the path to this markdown file */ + path: string; + + /** the headings found in this markdown file */ + headings: string[]; + + frontMatter: { + title: string; + description: string; + }; +} + +export type ErrorType = "link" | "hash" | "source" | "related"; + +export type LinkError = { + type: ErrorType; + href: string; + doc: Document; +}; + +export const DOCS_PATH = "."; +export const EXCLUDED_HASHES = ["top"]; const slugger = new GitHubSlugger(); @@ -41,8 +66,6 @@ const getHeadingsFromMarkdownTree = ( const headings: string[] = []; slugger.reset(); - // console.log(inspect(tree, { depth: null, colors: false })); - visit(tree, "heading", (node) => { let headingText = ""; // Account for headings with inline code blocks by concatenating the @@ -179,17 +202,13 @@ const validateHashLink = (doc: Document, href: string) => { doc, }; const { content, ...docWithoutContent } = doc; - console.log(docWithoutContent); return [linkError]; }; -// corresponds to vfile.VFile['contents'] -type Tree = string | Uint8Array; - /** Traverse the document tree and validate links */ const traverseTreeAndValidateLinks = ( documentMap: Map, - tree: any, // TODO: Tree + tree: unknown, doc: Document ): LinkError[] => { let errors: LinkError[] = []; diff --git a/docs/src/validate-docs-links.ts b/docs/src/validate-docs-links.ts index 3624e8a02d256..380dce1bad713 100644 --- a/docs/src/validate-docs-links.ts +++ b/docs/src/validate-docs-links.ts @@ -1,4 +1,3 @@ -import { ReportRow } from "./config"; import { collectLinkErrors } from "./markdown"; /* @@ -26,7 +25,7 @@ const validateAllInternalLinks = async (): Promise => { return; } - const reportRows: ReportRow[] = errorReports + const reportRows = errorReports .map((linkError) => ({ link: linkError.href, type: linkError.type, @@ -34,7 +33,12 @@ const validateAllInternalLinks = async (): Promise => { })) .sort((a, b) => a.type.localeCompare(b.type)); - console.log("This PR introduces broken links to the docs:"); + const plural = errorReports.length > 1; + console.log( + `Found ${plural ? "these" : "a"} broken link${ + plural ? "s" : "" + } in the docs:` + ); console.table(reportRows); process.exit(1); }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85be10c09fd59..505127606eb03 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,12 +53,6 @@ importers: docs: dependencies: - '@actions/core': - specifier: 1.11.1 - version: 1.11.1 - '@actions/github': - specifier: 5.1.1 - version: 5.1.1 github-slugger: specifier: 2.0.0 version: 2.0.0 @@ -81,15 +75,9 @@ importers: specifier: 5.0.0 version: 5.0.0 devDependencies: - '@octokit/webhooks-definitions': - specifier: 3.67.3 - version: 3.67.3 '@types/node': specifier: 22.7.8 version: 22.7.8 - '@vercel/ncc': - specifier: 0.38.2 - version: 0.38.2 tsx: specifier: 4.19.1 version: 4.19.1 @@ -1021,13 +1009,6 @@ packages: uuid: 8.3.2 dev: false - /@actions/core@1.11.1: - resolution: {integrity: sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==} - dependencies: - '@actions/exec': 1.1.1 - '@actions/http-client': 2.1.1 - dev: false - /@actions/exec@1.1.1: resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} dependencies: @@ -2789,11 +2770,6 @@ packages: '@octokit/openapi-types': 12.11.0 dev: false - /@octokit/webhooks-definitions@3.67.3: - resolution: {integrity: sha512-do4Z1r2OVhuI0ihJhQ8Hg+yPWnBYEBNuFNCrvtPKoYT1w81jD7pBXgGe86lYuuNirkDHb0Nxt+zt4O5GiFJfgA==} - deprecated: Use @octokit/webhooks-types, @octokit/webhooks-schemas, or @octokit/webhooks-examples instead. See https://github.com/octokit/webhooks/issues/447 - dev: true - /@pkgjs/parseargs@0.11.0: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -3413,11 +3389,6 @@ packages: hasBin: true dev: true - /@vercel/ncc@0.38.2: - resolution: {integrity: sha512-3yel3jaxUg9pHBv4+KeC9qlbdZPug+UMtUOlhvpDYCMSgcNSrS2Hv1LoqMsOV7hf2lYscx+BESfJOIla1WsmMQ==} - hasBin: true - dev: true - /@vercel/style-guide@5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.6.3): resolution: {integrity: sha512-L9lWYePIycm7vIOjDLj+mmMdmmPkW3/brHjgq+nJdvMOrL7Hdk/19w8X583HYSk0vWsq494o5Qkh6x5+uW7ljg==} engines: {node: '>=16'} From d3b769e13416f66f72e801359f4cdc7debb538fc Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 16:45:43 -0400 Subject: [PATCH 17/30] really not sure why these lint errors are suddenly appearing on this PR.. --- packages/turbo-gen/src/utils/plop.ts | 2 +- packages/turbo-utils/src/createProject.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/turbo-gen/src/utils/plop.ts b/packages/turbo-gen/src/utils/plop.ts index 295dba929fe9e..a4c7de62d23b4 100644 --- a/packages/turbo-gen/src/utils/plop.ts +++ b/packages/turbo-gen/src/utils/plop.ts @@ -96,7 +96,7 @@ export function getPlop({ // add in all the workspace configs workspaceConfigs.forEach((c) => { try { - plop?.load(c.config, { + plop.load(c.config, { destBasePath: c.root, force: false, }); diff --git a/packages/turbo-utils/src/createProject.ts b/packages/turbo-utils/src/createProject.ts index 798c24b564af6..cddabeac680c6 100644 --- a/packages/turbo-utils/src/createProject.ts +++ b/packages/turbo-utils/src/createProject.ts @@ -154,8 +154,7 @@ export async function createProject({ try { if (!isDefaultExample && repoInfo) { loader.start(); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- this is type guarded above (wtf TS) - await retry(() => downloadAndExtractRepo(root, repoInfo!), { + await retry(() => downloadAndExtractRepo(root, repoInfo), { retries: 3, }); } else { From de6b47f274b4bcfde0c06268b8b31a4b83c44dd6 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Tue, 22 Oct 2024 16:53:32 -0400 Subject: [PATCH 18/30] Revert "really not sure why these lint errors are suddenly appearing on this PR.." This reverts commit d3b769e13416f66f72e801359f4cdc7debb538fc. --- packages/turbo-gen/src/utils/plop.ts | 2 +- packages/turbo-utils/src/createProject.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/turbo-gen/src/utils/plop.ts b/packages/turbo-gen/src/utils/plop.ts index a4c7de62d23b4..295dba929fe9e 100644 --- a/packages/turbo-gen/src/utils/plop.ts +++ b/packages/turbo-gen/src/utils/plop.ts @@ -96,7 +96,7 @@ export function getPlop({ // add in all the workspace configs workspaceConfigs.forEach((c) => { try { - plop.load(c.config, { + plop?.load(c.config, { destBasePath: c.root, force: false, }); diff --git a/packages/turbo-utils/src/createProject.ts b/packages/turbo-utils/src/createProject.ts index cddabeac680c6..798c24b564af6 100644 --- a/packages/turbo-utils/src/createProject.ts +++ b/packages/turbo-utils/src/createProject.ts @@ -154,7 +154,8 @@ export async function createProject({ try { if (!isDefaultExample && repoInfo) { loader.start(); - await retry(() => downloadAndExtractRepo(root, repoInfo), { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- this is type guarded above (wtf TS) + await retry(() => downloadAndExtractRepo(root, repoInfo!), { retries: 3, }); } else { From 1e67c5d6361ddaa3a9b6031e0c3421f3f71f931b Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 11:07:04 -0400 Subject: [PATCH 19/30] bounch back to typescript 5.3.3 --- docs/package.json | 2 +- pnpm-lock.yaml | 90 +++++++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/docs/package.json b/docs/package.json index 96f01d16915e9..28b7a4811d976 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,7 +11,7 @@ "devDependencies": { "@types/node": "22.7.8", "tsx": "4.19.1", - "typescript": "5.6.3" + "typescript": "5.3.3" }, "dependencies": { "github-slugger": "2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 505127606eb03..ea2b5fcefa3b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,8 +82,8 @@ importers: specifier: 4.19.1 version: 4.19.1 typescript: - specifier: 5.6.3 - version: 5.6.3 + specifier: 5.3.3 + version: 5.3.3 examples: {} @@ -161,7 +161,7 @@ importers: devDependencies: '@vercel/style-guide': specifier: ^5.1.0 - version: 5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.6.3) + version: 5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.3.3) packages/eslint-config-turbo: dependencies: @@ -3177,7 +3177,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.6.3): + /@typescript-eslint/eslint-plugin@6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-nISDRYnnIpk7VCFrGcu1rnZfM1Dh9LRHnfgdkjcbi/l7g16VYRri3TjXi9Ir4lOZSw5N/gnV/3H7jIPQ8Q4daA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3189,10 +3189,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': 6.18.1 - '@typescript-eslint/type-utils': 6.18.1(eslint@8.55.0)(typescript@5.6.3) - '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/type-utils': 6.18.1(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 eslint: 8.55.0 @@ -3200,13 +3200,13 @@ packages: ignore: 5.3.0 natural-compare: 1.4.0 semver: 7.5.4 - ts-api-utils: 1.0.2(typescript@5.6.3) - typescript: 5.6.3 + ts-api-utils: 1.0.2(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.18.1(eslint@8.55.0)(typescript@5.6.3): + /@typescript-eslint/parser@6.18.1(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-zct/MdJnVaRRNy9e84XnVtRv9Vf91/qqe+hZJtKanjojud4wAVy/7lXxJmMyX6X6J+xc6c//YEWvpeif8cAhWA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3218,11 +3218,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.18.1 '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) '@typescript-eslint/visitor-keys': 6.18.1 debug: 4.3.4 eslint: 8.55.0 - typescript: 5.6.3 + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true @@ -3243,7 +3243,7 @@ packages: '@typescript-eslint/visitor-keys': 6.18.1 dev: true - /@typescript-eslint/type-utils@6.18.1(eslint@8.55.0)(typescript@5.6.3): + /@typescript-eslint/type-utils@6.18.1(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-wyOSKhuzHeU/5pcRDP2G2Ndci+4g653V43gXTpt4nbyoIOAASkGDA9JIAgbQCdCkcr1MvpSYWzxTz0olCn8+/Q==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3253,12 +3253,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.6.3) - '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) + '@typescript-eslint/utils': 6.18.1(eslint@8.55.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.55.0 - ts-api-utils: 1.0.2(typescript@5.6.3) - typescript: 5.6.3 + ts-api-utils: 1.0.2(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true @@ -3273,7 +3273,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.6.3): + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.3.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3288,13 +3288,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.6.3) - typescript: 5.6.3 + tsutils: 3.21.0(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.18.1(typescript@5.6.3): + /@typescript-eslint/typescript-estree@6.18.1(typescript@5.3.3): resolution: {integrity: sha512-fv9B94UAhywPRhUeeV/v+3SBDvcPiLxRZJw/xZeeGgRLQZ6rLMG+8krrJUyIf6s1ecWTzlsbp0rlw7n9sjufHA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3310,13 +3310,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.5.4 - ts-api-utils: 1.0.2(typescript@5.6.3) - typescript: 5.6.3 + ts-api-utils: 1.0.2(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@5.6.3): + /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3327,7 +3327,7 @@ packages: '@types/semver': 7.5.1 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.3.3) eslint: 8.55.0 eslint-scope: 5.1.1 semver: 7.5.4 @@ -3336,7 +3336,7 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.18.1(eslint@8.55.0)(typescript@5.6.3): + /@typescript-eslint/utils@6.18.1(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-zZmTuVZvD1wpoceHvoQpOiewmWu3uP9FuTWo8vqpy2ffsmfCE8mklRPi+vmnIYAIk9t/4kOThri2QCDgor+OpQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3347,7 +3347,7 @@ packages: '@types/semver': 7.5.1 '@typescript-eslint/scope-manager': 6.18.1 '@typescript-eslint/types': 6.18.1 - '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 6.18.1(typescript@5.3.3) eslint: 8.55.0 semver: 7.5.4 transitivePeerDependencies: @@ -3389,7 +3389,7 @@ packages: hasBin: true dev: true - /@vercel/style-guide@5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.6.3): + /@vercel/style-guide@5.1.0(eslint@8.55.0)(prettier@2.8.7)(typescript@5.3.3): resolution: {integrity: sha512-L9lWYePIycm7vIOjDLj+mmMdmmPkW3/brHjgq+nJdvMOrL7Hdk/19w8X583HYSk0vWsq494o5Qkh6x5+uW7ljg==} engines: {node: '>=16'} peerDependencies: @@ -3410,25 +3410,25 @@ packages: '@babel/core': 7.23.6 '@babel/eslint-parser': 7.22.11(@babel/core@7.23.6)(eslint@8.55.0) '@rushstack/eslint-patch': 1.3.3 - '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.6.3) - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) eslint: 8.55.0 eslint-config-prettier: 9.0.0(eslint@8.55.0) eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.28.1) eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/parser@6.18.1)(eslint-plugin-import@2.28.1)(eslint@8.55.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.55.0) eslint-plugin-import: 2.28.1(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-typescript@3.6.0)(eslint@8.55.0) - eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.6.3) + eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.3.3) eslint-plugin-jsx-a11y: 6.7.1(eslint@8.55.0) eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.2.3)(eslint@8.55.0) eslint-plugin-react: 7.33.2(eslint@8.55.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.55.0) - eslint-plugin-testing-library: 6.0.1(eslint@8.55.0)(typescript@5.6.3) + eslint-plugin-testing-library: 6.0.1(eslint@8.55.0)(typescript@5.3.3) eslint-plugin-tsdoc: 0.2.17 eslint-plugin-unicorn: 48.0.1(eslint@8.55.0) prettier: 2.8.7 prettier-plugin-packagejson: 2.4.5(prettier@2.8.7) - typescript: 5.6.3 + typescript: 5.3.3 transitivePeerDependencies: - eslint-import-resolver-node - eslint-import-resolver-webpack @@ -5714,7 +5714,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.55.0 eslint-import-resolver-node: 0.3.9 @@ -5744,7 +5744,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/parser': 6.18.1(eslint@8.55.0)(typescript@5.3.3) array-includes: 3.1.6 array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 @@ -5769,7 +5769,7 @@ packages: - supports-color dev: true - /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.6.3): + /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -5782,8 +5782,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.6.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.55.0)(typescript@5.3.3) + '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.3) eslint: 8.55.0 transitivePeerDependencies: - supports-color @@ -5825,7 +5825,7 @@ packages: optional: true dependencies: eslint: 8.55.0 - eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.6.3) + eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.55.0)(typescript@5.3.3) dev: true /eslint-plugin-react-hooks@4.6.0(eslint@8.55.0): @@ -5862,13 +5862,13 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /eslint-plugin-testing-library@6.0.1(eslint@8.55.0)(typescript@5.6.3): + /eslint-plugin-testing-library@6.0.1(eslint@8.55.0)(typescript@5.3.3): resolution: {integrity: sha512-CEYtjpcF3hAaQtYsTZqciR7s5z+T0LCMTwJeW+pz6kBnGtc866wAKmhaiK2Gsjc2jWNP7Gt6zhNr2DE1ZW4e+g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.6.3) + '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.3) eslint: 8.55.0 transitivePeerDependencies: - supports-color @@ -10904,13 +10904,13 @@ packages: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} dev: false - /ts-api-utils@1.0.2(typescript@5.6.3): + /ts-api-utils@1.0.2(typescript@5.3.3): resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.6.3 + typescript: 5.3.3 dev: true /ts-interface-checker@0.1.13: @@ -11196,14 +11196,14 @@ packages: - ts-node dev: true - /tsutils@3.21.0(typescript@5.6.3): + /tsutils@3.21.0(typescript@5.3.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.6.3 + typescript: 5.3.3 dev: true /tsx@4.19.0: From 9470a656789a8b847b321833f049dc7b1855b886 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 12:58:56 -0400 Subject: [PATCH 20/30] normalizePath -> filePathToUrl --- docs/src/markdown.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index 8dbefd7dba105..f6ddf7fe74727 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -96,15 +96,12 @@ const markdownProcessor = unified() }; }); -const normalizePath = (filePath: string): string => { - const normalized = filePath +const filePathToUrl = (filePath: string): string => + filePath .replace("repo-docs", "/repo/docs") .replace("pack-docs", "/pack/docs") .replace(".mdx", ""); - return normalized; -}; - const validateFrontmatter = (path: string, data: Record) => { if (!data.title) { throw new Error(`Document is missing a title: ${path}`); @@ -135,7 +132,7 @@ const prepareDocumentMapEntry = async ( const tree = markdownProcessor.parse(content); const headings = getHeadingsFromMarkdownTree(tree); - const normalizedUrlPath = normalizePath(path); + const normalizedUrlPath = filePathToUrl(path); return [normalizedUrlPath, { content, path, headings, frontMatter }]; } catch (error) { @@ -247,7 +244,7 @@ export const collectLinkErrors = async (): Promise => { ); const reportsWithErrors = allMdxFilePaths.map(async (filePath) => { - const doc = documentMap.get(normalizePath(filePath)); + const doc = documentMap.get(filePathToUrl(filePath)); if (!doc) { return null; } From 03e547a8091de86e7640af14869e14f85efc5d57 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:01:23 -0400 Subject: [PATCH 21/30] move EXCLUDED_PATHS to top level --- docs/src/markdown.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index f6ddf7fe74727..246f2ecbf1ae1 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -32,8 +32,11 @@ export type LinkError = { doc: Document; }; -export const DOCS_PATH = "."; -export const EXCLUDED_HASHES = ["top"]; +const DOCS_PATH = "."; +const EXCLUDED_HASHES = ["top"]; + +/** These paths exist, just not in our Markdown files */ +const EXCLUDED_PATHS = ["/api/remote-cache-spec", "/repo"]; const slugger = new GitHubSlugger(); @@ -146,9 +149,7 @@ const validateInternalLink = // /docs/api/example#heading -> ["api/example", "heading""] const [link, hash] = href.replace(DOCS_PATH, "").split("#", 2); - // These paths exist, just not in our Markdown files - const ignorePaths = ["/api/remote-cache-spec", "/repo"]; - if (ignorePaths.includes(link)) { + if (EXCLUDED_PATHS.includes(link)) { return []; } From fb9543ed192548c25042b7a23730dced7bb99666 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:03:21 -0400 Subject: [PATCH 22/30] Update docs/src/markdown.ts Co-authored-by: Chris Olszewski --- docs/src/markdown.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index 246f2ecbf1ae1..57749301334ce 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -146,7 +146,7 @@ const prepareDocumentMapEntry = async ( /** Checks if the links point to existing documents */ const validateInternalLink = (documentMap: Map) => (doc: Document, href: string) => { - // /docs/api/example#heading -> ["api/example", "heading""] + // /docs/api/example#heading -> ["/docs/api/example", "heading""] const [link, hash] = href.replace(DOCS_PATH, "").split("#", 2); if (EXCLUDED_PATHS.includes(link)) { From ef2d43be6bda7984cec9dc321e3e9d0342a1d715 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:19:19 -0400 Subject: [PATCH 23/30] vastly simplify getAllMdxFilePaths --- docs/src/markdown.ts | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index 57749301334ce..c7e3e79831504 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -32,6 +32,7 @@ export type LinkError = { doc: Document; }; +/** where to look for docs (.mdx files) */ const DOCS_PATH = "."; const EXCLUDED_HASHES = ["top"]; @@ -40,26 +41,10 @@ const EXCLUDED_PATHS = ["/api/remote-cache-spec", "/repo"]; const slugger = new GitHubSlugger(); -/** Collect the paths of all .mdx files in the passed directories */ -const getAllMdxFilePaths = async ( - directoriesToScan: string[], - fileList: string[] = [] -): Promise => { - for (const dir of directoriesToScan) { - const dirPath = path.join(".", dir); - const files = await fs.readdir(dirPath); - for (const file of files) { - const filePath = path.join(dirPath, file); - const stats = await fs.stat(filePath); - if (stats.isDirectory()) { - fileList = await getAllMdxFilePaths([filePath], fileList); - } else if (path.extname(file) === ".mdx") { - fileList.push(filePath); - } - } - } - - return fileList; +/** Collect the paths of all .mdx files we care about */ +const getAllMdxFilePaths = async (): Promise => { + const allFiles = await fs.readdir(DOCS_PATH, { recursive: true }); + return allFiles.filter((file) => file.endsWith(".mdx")); }; // Returns the slugs of all headings in a tree @@ -238,7 +223,7 @@ const traverseTreeAndValidateLinks = ( * this function will look through all Mdx files and compile a list of `LinkError`s */ export const collectLinkErrors = async (): Promise => { - const allMdxFilePaths = await getAllMdxFilePaths([DOCS_PATH]); + const allMdxFilePaths = await getAllMdxFilePaths(); const documentMap = new Map( await Promise.all(allMdxFilePaths.map(prepareDocumentMapEntry)) From 6426209027a50e38c3d694edafabc26770cf0d3f Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:25:34 -0400 Subject: [PATCH 24/30] last intentional check before merging (will revert) --- docs/repo-docs/guides/tools/typescript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 73dd8e7f3c4f6..8399f811df0c8 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -12,7 +12,7 @@ TypeScript is an excellent tool in monorepos, allowing teams to safely add types - [Sharing TypeScript configuration](#sharing-tsconfigjson) - [Building a TypeScript package](#building-a-typescript-package) -- [Making type checking faster across your workspace](/repo/docs/guides/tools/typescript#linting-your-codebase) +- [Making type checking faster across your workspace](/repo/dasdfkljhasdflkjhasdflkjhasdlfkjlfhocs/guides/tools/typescript#linting-your-codebase) This guide assumes you are using a recent version of TypeScript and uses some From 4c4f0002131e0487857727711856cdbbe599491d Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:26:22 -0400 Subject: [PATCH 25/30] Revert "last intentional check before merging (will revert)" This reverts commit 6426209027a50e38c3d694edafabc26770cf0d3f. --- docs/repo-docs/guides/tools/typescript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 8399f811df0c8..73dd8e7f3c4f6 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -12,7 +12,7 @@ TypeScript is an excellent tool in monorepos, allowing teams to safely add types - [Sharing TypeScript configuration](#sharing-tsconfigjson) - [Building a TypeScript package](#building-a-typescript-package) -- [Making type checking faster across your workspace](/repo/dasdfkljhasdflkjhasdflkjhasdlfkjlfhocs/guides/tools/typescript#linting-your-codebase) +- [Making type checking faster across your workspace](/repo/docs/guides/tools/typescript#linting-your-codebase) This guide assumes you are using a recent version of TypeScript and uses some From 048e3f53c0a49db9e98ea68bb90df2ecf4bba084 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:34:14 -0400 Subject: [PATCH 26/30] fix formatting --- docs/src/markdown.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/markdown.ts b/docs/src/markdown.ts index c7e3e79831504..13f4043480427 100644 --- a/docs/src/markdown.ts +++ b/docs/src/markdown.ts @@ -1,5 +1,4 @@ import fs from "fs/promises"; -import path from "path"; import { unified } from "unified"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; From 91ef9fca1b9f8adce13bb14cf72ccf711a7555bc Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:39:06 -0400 Subject: [PATCH 27/30] revert unnecessary mdx formatting change --- docs/repo-docs/guides/tools/typescript.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 73dd8e7f3c4f6..96af53fd87748 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -73,9 +73,7 @@ Inside `packages/typescript-config`, you have a few `json` files which represent } ``` - - `tsconfig` options reference - +`tsconfig` options reference ### Creating the rest of the package From 84591252fc6aec6a7113914d1d0d8a38e7bf0a6f Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:44:28 -0400 Subject: [PATCH 28/30] fix formatting --- docs/repo-docs/guides/tools/typescript.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 96af53fd87748..73dd8e7f3c4f6 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -73,7 +73,9 @@ Inside `packages/typescript-config`, you have a few `json` files which represent } ``` -`tsconfig` options reference + + `tsconfig` options reference + ### Creating the rest of the package From da62c4b7fbe72b62756fce19e088ba7af73d89e7 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:46:22 -0400 Subject: [PATCH 29/30] Revert "fix formatting" This reverts commit 84591252fc6aec6a7113914d1d0d8a38e7bf0a6f. --- docs/repo-docs/guides/tools/typescript.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 73dd8e7f3c4f6..96af53fd87748 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -73,9 +73,7 @@ Inside `packages/typescript-config`, you have a few `json` files which represent } ``` - - `tsconfig` options reference - +`tsconfig` options reference ### Creating the rest of the package From 5ded22cce281d503c5a6e03957bb2223c8bf7c3e Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Wed, 23 Oct 2024 13:46:43 -0400 Subject: [PATCH 30/30] fix formatting --- docs/repo-docs/guides/tools/typescript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/guides/tools/typescript.mdx b/docs/repo-docs/guides/tools/typescript.mdx index 96af53fd87748..4a5f8dbae5dc3 100644 --- a/docs/repo-docs/guides/tools/typescript.mdx +++ b/docs/repo-docs/guides/tools/typescript.mdx @@ -294,7 +294,7 @@ In [Compiled packages](https://turbo.build/repo/docs/core-concepts/internal-pack ```tsx title="./packages/ui/button.tsx" -import { MY_STRING } from '#utils.js'; // Uses .js extension // [!code highlight] +import { MY_STRING } from "#utils.js"; // Uses .js extension // [!code highlight] export const Button = () => { return ;