From 6e1777223597ed02c5e1992d19a25ee18990e00d Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Wed, 5 Feb 2025 13:44:00 -0500 Subject: [PATCH] stash: mdx-bundler fork --- .../fern-docs/mdx-bundler/.depcheckrc.json | 4 + .../fern-docs/mdx-bundler/.stylelintrc.json | 1 + packages/fern-docs/mdx-bundler/package.json | 58 +++ packages/fern-docs/mdx-bundler/src/client.ts | 35 ++ packages/fern-docs/mdx-bundler/src/server.ts | 404 ++++++++++++++++++ .../mdx-bundler/tsconfig.eslint.json | 8 + packages/fern-docs/mdx-bundler/tsconfig.json | 8 + .../fern-docs/mdx-bundler/vitest.config.ts | 7 + pnpm-lock.yaml | 157 ++++--- 9 files changed, 627 insertions(+), 55 deletions(-) create mode 100644 packages/fern-docs/mdx-bundler/.depcheckrc.json create mode 100644 packages/fern-docs/mdx-bundler/.stylelintrc.json create mode 100644 packages/fern-docs/mdx-bundler/package.json create mode 100644 packages/fern-docs/mdx-bundler/src/client.ts create mode 100644 packages/fern-docs/mdx-bundler/src/server.ts create mode 100644 packages/fern-docs/mdx-bundler/tsconfig.eslint.json create mode 100644 packages/fern-docs/mdx-bundler/tsconfig.json create mode 100644 packages/fern-docs/mdx-bundler/vitest.config.ts diff --git a/packages/fern-docs/mdx-bundler/.depcheckrc.json b/packages/fern-docs/mdx-bundler/.depcheckrc.json new file mode 100644 index 0000000000..9335a9197e --- /dev/null +++ b/packages/fern-docs/mdx-bundler/.depcheckrc.json @@ -0,0 +1,4 @@ +{ + "ignores": ["@fern-platform/configs", "@types/node", "vite", "@types/react"], + "ignore-patterns": ["dist"] +} diff --git a/packages/fern-docs/mdx-bundler/.stylelintrc.json b/packages/fern-docs/mdx-bundler/.stylelintrc.json new file mode 100644 index 0000000000..0d2e3ff61d --- /dev/null +++ b/packages/fern-docs/mdx-bundler/.stylelintrc.json @@ -0,0 +1 @@ +{ "extends": ["../../../shared/stylelintrc.shared.json"] } diff --git a/packages/fern-docs/mdx-bundler/package.json b/packages/fern-docs/mdx-bundler/package.json new file mode 100644 index 0000000000..05cc48da31 --- /dev/null +++ b/packages/fern-docs/mdx-bundler/package.json @@ -0,0 +1,58 @@ +{ + "name": "@fern-docs/auth", + "version": "0.0.0", + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/fern-api/fern-platform.git", + "directory": "packages/fern-docs/auth" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "files": [ + "dist" + ], + "scripts": { + "clean": "rm -rf ./lib && tsc --build --clean", + "compile": "tsc --build", + "depcheck": "depcheck", + "dev": "tsc --watch", + "docs:dev": "pnpm dev", + "format": "prettier --write --ignore-unknown \"**\"", + "format:check": "prettier --check --ignore-unknown \"**\"", + "lint:eslint": "eslint --max-warnings 0 .", + "lint:eslint:fix": "pnpm lint:eslint --fix", + "lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0", + "lint:style:fix": "pnpm lint:style --fix", + "test": "vitest --run --passWithNoTests --globals" + }, + "dependencies": { + "@esbuild-plugins/node-resolve": "^0.2.2", + "@fal-works/esbuild-plugin-global-externals": "^2.1.2", + "@mdx-js/esbuild": "^3.1.0", + "esbuild": "0.24.2", + "gray-matter": "^4.0.3", + "react": "18.3.1", + "react-dom": "18.3.1", + "remark-frontmatter": "^5.0.0", + "remark-mdx-frontmatter": "^5.0.0", + "uuid": "^9.0.0", + "vfile": "^6.0.3" + }, + "devDependencies": { + "@fern-platform/configs": "workspace:*", + "@types/node": "^18.7.18", + "depcheck": "^1.4.7", + "eslint": "^9", + "prettier": "^3.4.2", + "stylelint": "^16.1.0", + "typescript": "^5", + "vitest": "^2.1.4" + } +} diff --git a/packages/fern-docs/mdx-bundler/src/client.ts b/packages/fern-docs/mdx-bundler/src/client.ts new file mode 100644 index 0000000000..dc0f8d19a8 --- /dev/null +++ b/packages/fern-docs/mdx-bundler/src/client.ts @@ -0,0 +1,35 @@ +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import * as _jsx_runtime from "react/jsx-runtime"; + +/** + * @typedef {import('./types').MDXContentProps} MDXContentProps + */ + +/** + * + * @param {string} code - The string of code you got from bundleMDX + * @param {Record} [globals] - Any variables your MDX needs to have accessible when it runs + * @return {React.FunctionComponent} + */ +function getMDXComponent(code, globals) { + const mdxExport = getMDXExport(code, globals); + return mdxExport.default; +} + +/** + * @template ExportedObject + * @template Frontmatter + * @type {import('./types').MDXExportFunction} + * @param {string} code - The string of code you got from bundleMDX + * @param {Record} [globals] - Any variables your MDX needs to have accessible when it runs + * + */ +function getMDXExport(code, globals) { + const scope = { React, ReactDOM, _jsx_runtime, ...globals }; + // eslint-disable-next-line + const fn = new Function(...Object.keys(scope), code); + return fn(...Object.values(scope)); +} + +export { getMDXComponent, getMDXExport }; diff --git a/packages/fern-docs/mdx-bundler/src/server.ts b/packages/fern-docs/mdx-bundler/src/server.ts new file mode 100644 index 0000000000..95b8e446ee --- /dev/null +++ b/packages/fern-docs/mdx-bundler/src/server.ts @@ -0,0 +1,404 @@ +import { NodeResolvePlugin } from "@esbuild-plugins/node-resolve"; +import { + globalExternals, + ModuleInfo, +} from "@fal-works/esbuild-plugin-global-externals"; +import type { Options } from "@mdx-js/esbuild"; +import mdxESBuild from "@mdx-js/esbuild"; +import crypto from "crypto"; +import type { BuildOptions as ESBuildOptions } from "esbuild"; +import * as esbuild from "esbuild"; +import { readFile, unlink } from "fs/promises"; +import grayMatter, { type GrayMatterOption, type Input } from "gray-matter"; +import path from "path"; +import remarkFrontmatter from "remark-frontmatter"; +import remarkMdxFrontmatter from "remark-mdx-frontmatter"; +import { StringDecoder } from "string_decoder"; +import type { VFile, VFileOptions } from "vfile"; + +type BundleMDXOptions = { + source: string | VFile | VFileOptions; + + /** + * The dependencies of the MDX code to be bundled + * + * @example + * ``` + * bundleMDX({ + * source: mdxString, + * files: { + * './components.tsx': ` + * import * as React from 'react' + * + * type CounterProps = {initialCount: number, step: number} + * + * function Counter({initialCount = 0, step = 1}: CounterProps) { + * const [count, setCount] = React.useState(initialCount) + * const increment = () => setCount(c => c + step) + * return + * } + * ` + * }, + * }) + * ``` + */ + files?: Record; + /** + * This allows you to modify the built-in MDX configuration (passed to @mdx-js/mdx compile). + * This can be helpful for specifying your own remarkPlugins/rehypePlugins. + * + * @param vfileCompatible the path and contents of the mdx file being compiled + * @param options the default options which you are expected to modify and return + * @returns the options to be passed to @mdx-js/mdx compile + * + * @example + * ``` + * bundleMDX({ + * source: mdxString, + * mdxOptions(options) { + * // this is the recommended way to add custom remark/rehype plugins: + * // The syntax might look weird, but it protects you in case we add/remove + * // plugins in the future. + * options.remarkPlugins = [...(options.remarkPlugins ?? []), myRemarkPlugin] + * options.rehypePlugins = [...(options.rehypePlugins ?? []), myRehypePlugin] + * + * return options + * } + * }) + * ``` + */ + mdxOptions?: (options: Options, frontmatter: Frontmatter) => Options; + /** + * This allows you to modify the built-in esbuild configuration. This can be + * especially helpful for specifying the compilation target. + * + * @example + * ``` + * bundleMDX({ + * source: mdxString, + * esbuildOptions(options) { + * options.target = [ + * 'es2020', + * 'chrome58', + * 'firefox57', + * 'safari11', + * 'edge16', + * 'node12', + * ] + * return options + * } + * }) + * ``` + */ + esbuildOptions?: ( + options: ESBuildOptions, + frontmatter: Frontmatter + ) => ESBuildOptions; + /** + * Any variables you want treated as global variables in the bundling. + * + * NOTE: These do not have to be technically global as you will be providing + * their values when you use getMDXComponent, but as far as esbuild is concerned + * it will treat these values as global variables so they will not be included + * in the bundle. + * + * @example + * ``` + * bundlMDX({ + * source: mdxString, + * globals: {'left-pad': 'myLeftPad'}, + * }) + * + * // on the client side + * + * import leftPad from 'left-pad' + * + * const Component = getMDXComponent(result.code, {myLeftPad: leftPad}) + * ``` + */ + globals?: Record; + /** + * The current working directory for the mdx bundle. Supplying this allows + * esbuild to resolve paths itself instead of using `files`. + * + * This could be the directory the mdx content was read from or in the case + * of off-disk content a common root directory. + * + * @example + * ``` + * bundleMDX({ + * source: mdxString + * cwd: '/users/you/site/mdx_root' + * }) + * ``` + */ + cwd?: string; + /** + * This allows you to configure the gray matter options. + * + * @example + * ``` + * bundleMDX({ + * source: mdxString, + * grayMatterOptions: (options) => { + * options.excerpt = true + * + * return options + * } + * }) + * ``` + */ + grayMatterOptions?: ( + options: GrayMatterOption + ) => GrayMatterOption; + /** + * This allows you to set the output directory of the bundle. You will need + * to set `bundlePath` as well to give esbuild the public url to the folder. + * + * *Note, the javascrpt bundle will not be placed here, only assets + * that can't be part of the main bundle.* + * + * @example + * ``` + * bundleMDX({ + * file: '/path/to/file.mdx', + * bundleDirectory: '/path/to/bundle' + * bundlePath: '/path/to/public/bundle' + * }) + * ``` + */ + bundleDirectory?: string; + /** + * @see bundleDirectory + */ + bundlePath?: string; +}; + +async function bundleMDX>({ + source, + files = {}, + mdxOptions = (options) => options, + esbuildOptions = (options) => options, + globals = {}, + cwd = path.join(process.cwd(), `__mdx_bundler_fake_dir__`), + grayMatterOptions = (options) => options, + bundleDirectory, + bundlePath, +}: BundleMDXOptions) { + if (!process.env.ESBUILD_BINARY_PATH) { + console.warn( + `mdx-bundler warning: esbuild maybe unable to find its binary, if your build fails you'll need to set ESBUILD_BINARY_PATH. Learn more: https://github.com/kentcdodds/mdx-bundler/blob/main/README.md#nextjs-esbuild-enoent` + ); + } + + let code: string; + let entryPath: string; + let matter: Omit, "data"> & { + data: Frontmatter; + }; + + /** @type Record */ + const absoluteFiles = {}; + + const isWriting = typeof bundleDirectory === "string"; + + if (typeof bundleDirectory !== typeof bundlePath) { + throw new Error( + "When using `bundleDirectory` or `bundlePath` the other must be set." + ); + } + + function isVFile(vfile: unknown): vfile is VFile { + return typeof vfile === "object" && vfile !== null && "value" in vfile; + } + + if (typeof source === "string") { + // The user has supplied MDX source. + /** @type any */ // Slight type hack to get the graymatter front matter typed correctly. + const gMatter = grayMatter(source, grayMatterOptions({})); + matter = gMatter; + entryPath = path.join( + cwd, + `./_mdx_bundler_entry_point-${crypto.randomUUID()}.mdx` + ); + absoluteFiles[entryPath] = source; + } else if (isVFile(source)) { + const value = String(source.value); + /** @type any */ // Slight type hack to get the graymatter front matter typed correctly. + const gMatter = grayMatter(value, grayMatterOptions({})); + matter = gMatter; + entryPath = source.path + ? path.isAbsolute(source.path) + ? source.path + : path.join(source.cwd, source.path) + : path.join(cwd, `./_mdx_bundler_entry_point-${crypto.randomUUID()}.mdx`); + absoluteFiles[entryPath] = value; + } else { + // The user supplied neither file or source. + // The typings should prevent reaching this point. + // It is ignored from coverage as the tests wouldn't run in a way that can get here. + throw new Error("`source` must be defined"); + } + /* c8 ignore end*/ + + for (const [filepath, fileCode] of Object.entries(files)) { + absoluteFiles[path.join(cwd, filepath)] = fileCode; + } + + /** @type import('esbuild').Plugin */ + const inMemoryPlugin = { + name: "inMemory", + setup(build) { + build.onResolve({ filter: /.*/ }, ({ path: filePath, importer }) => { + if (filePath === entryPath) { + return { + path: filePath, + pluginData: { inMemory: true, contents: absoluteFiles[filePath] }, + }; + } + + const modulePath = path.resolve(path.dirname(importer), filePath); + + if (modulePath in absoluteFiles) { + return { + path: modulePath, + pluginData: { inMemory: true, contents: absoluteFiles[modulePath] }, + }; + } + + for (const ext of [".js", ".ts", ".jsx", ".tsx", ".json", ".mdx"]) { + const fullModulePath = `${modulePath}${ext}`; + if (fullModulePath in absoluteFiles) { + return { + path: fullModulePath, + pluginData: { + inMemory: true, + contents: absoluteFiles[fullModulePath], + }, + }; + } + } + + // Return an empty object so that esbuild will handle resolving the file itself. + return {}; + }); + + build.onLoad({ filter: /.*/ }, async ({ path: filePath, pluginData }) => { + if (pluginData === undefined || !pluginData.inMemory) { + // Return an empty object so that esbuild will load & parse the file contents itself. + return null; + } + + // the || .js allows people to exclude a file extension + const fileType = (path.extname(filePath) || ".jsx").slice(1); + const contents = absoluteFiles[filePath]; + + if (fileType === "mdx") return null; + + /** @type import('esbuild').Loader */ + let loader; + + if ( + build.initialOptions.loader && + build.initialOptions.loader[`.${fileType}`] + ) { + loader = build.initialOptions.loader[`.${fileType}`]; + } else { + loader = /** @type import('esbuild').Loader */ fileType; + } + + return { + contents, + loader, + }; + }); + }, + }; + + const buildOptions = esbuildOptions( + { + entryPoints: [entryPath], + write: isWriting, + outdir: isWriting ? bundleDirectory : undefined, + publicPath: isWriting ? bundlePath : undefined, + absWorkingDir: cwd, + define: { + "process.env.NODE_ENV": JSON.stringify( + process.env.NODE_ENV ?? "production" + ), + }, + plugins: [ + globalExternals({ + ...globals, + react: { + varName: "React", + type: "cjs", + }, + "react-dom": { + varName: "ReactDOM", + type: "cjs", + }, + "react/jsx-runtime": { + varName: "_jsx_runtime", + type: "cjs", + }, + }), + // eslint-disable-next-line new-cap + NodeResolvePlugin({ + extensions: [".js", ".ts", ".jsx", ".tsx"], + resolveOptions: { basedir: cwd }, + }), + inMemoryPlugin, + mdxESBuild( + mdxOptions( + { + remarkPlugins: [ + remarkFrontmatter, + [remarkMdxFrontmatter, { name: "frontmatter" }], + ], + }, + matter.data + ) + ), + ], + bundle: true, + format: "iife", + globalName: "Component", + minify: true, + }, + matter.data + ); + + const bundled = await esbuild.build(buildOptions); + + if (bundled.outputFiles) { + const decoder = new StringDecoder("utf8"); + + code = decoder.write(Buffer.from(bundled.outputFiles[0].contents)); + } else if (buildOptions.outdir && buildOptions.write) { + // We know that this has to be an array of entry point strings, with a single entry + const entryFile = + /** @type {{entryPoints: string[]}} */ buildOptions.entryPoints[0]; + + const fileName = path.basename(entryFile).replace(/\.[^/.]+$/, ".js"); + + code = ( + await readFile(path.join(buildOptions.outdir, fileName)) + ).toString(); + + await unlink(path.join(buildOptions.outdir, fileName)); + } else { + throw new Error( + "You must either specify `write: false` or `write: true` and `outdir: '/path'` in your esbuild options" + ); + } + + return { + code: `${code};return Component;`, + frontmatter: matter.data, + errors: bundled.errors, + matter, + }; +} + +export { bundleMDX }; diff --git a/packages/fern-docs/mdx-bundler/tsconfig.eslint.json b/packages/fern-docs/mdx-bundler/tsconfig.eslint.json new file mode 100644 index 0000000000..e3a2df3598 --- /dev/null +++ b/packages/fern-docs/mdx-bundler/tsconfig.eslint.json @@ -0,0 +1,8 @@ +{ + "extends": "@fern-platform/configs/tsconfig/library.json", + "compilerOptions": { + "rootDir": ".", + "noEmit": true + }, + "include": ["src/**/*", "vitest.config.ts"] +} diff --git a/packages/fern-docs/mdx-bundler/tsconfig.json b/packages/fern-docs/mdx-bundler/tsconfig.json new file mode 100644 index 0000000000..472cb9ece1 --- /dev/null +++ b/packages/fern-docs/mdx-bundler/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@fern-platform/configs/tsconfig/library.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"] +} diff --git a/packages/fern-docs/mdx-bundler/vitest.config.ts b/packages/fern-docs/mdx-bundler/vitest.config.ts new file mode 100644 index 0000000000..e2ec332940 --- /dev/null +++ b/packages/fern-docs/mdx-bundler/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + globals: true, + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f2d7fbeef..406a563f72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -713,7 +713,7 @@ importers: version: link:../../commons/core-utils '@fern-docs/auth': specifier: workspace:* - version: link:../auth + version: link:../mdx-bundler '@fern-docs/cache': specifier: workspace:* version: link:../cache @@ -794,7 +794,7 @@ importers: version: 5.13.0 braintrust: specifier: ^0.0.182 - version: 0.0.182(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.682.0))(react@18.3.1)(sswr@2.1.0(svelte@5.19.2))(svelte@5.19.2)(vue@3.5.13(typescript@5.7.2))(zod@3.23.8) + version: 0.0.182(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.723.0))(react@18.3.1)(sswr@2.1.0(svelte@5.19.2))(svelte@5.19.2)(vue@3.5.13(typescript@5.7.2))(zod@3.23.8) cssnano: specifier: ^6.0.3 version: 6.1.2(postcss@8.4.31) @@ -1194,7 +1194,7 @@ importers: dependencies: '@fern-docs/auth': specifier: workspace:* - version: link:../auth + version: link:../mdx-bundler '@fern-docs/utils': specifier: workspace:* version: link:../utils @@ -1601,6 +1601,67 @@ importers: specifier: ^2.1.4 version: 2.1.4(@edge-runtime/vm@5.0.0)(@types/node@18.19.33)(jsdom@24.0.0)(less@4.2.0)(sass@1.77.0)(stylus@0.62.0)(terser@5.31.0) + packages/fern-docs/mdx-bundler: + dependencies: + '@esbuild-plugins/node-resolve': + specifier: ^0.2.2 + version: 0.2.2(esbuild@0.24.2) + '@fal-works/esbuild-plugin-global-externals': + specifier: ^2.1.2 + version: 2.1.2 + '@mdx-js/esbuild': + specifier: ^3.1.0 + version: 3.1.0(esbuild@0.24.2) + esbuild: + specifier: 0.24.2 + version: 0.24.2 + gray-matter: + specifier: ^4.0.3 + version: 4.0.3 + react: + specifier: 18.3.1 + version: 18.3.1 + react-dom: + specifier: 18.3.1 + version: 18.3.1(react@18.3.1) + remark-frontmatter: + specifier: ^5.0.0 + version: 5.0.0 + remark-mdx-frontmatter: + specifier: ^5.0.0 + version: 5.0.0 + uuid: + specifier: ^9.0.0 + version: 9.0.1 + vfile: + specifier: ^6.0.3 + version: 6.0.3 + devDependencies: + '@fern-platform/configs': + specifier: workspace:* + version: link:../../configs + '@types/node': + specifier: ^18.7.18 + version: 18.19.33 + depcheck: + specifier: ^1.4.7 + version: 1.4.7 + eslint: + specifier: 9.17.0 + version: 9.17.0(jiti@1.21.7) + prettier: + specifier: ^3.4.2 + version: 3.4.2 + stylelint: + specifier: ^16.1.0 + version: 16.5.0(typescript@5.7.2) + typescript: + specifier: 5.7.2 + version: 5.7.2 + vitest: + specifier: ^2.1.4 + version: 2.1.4(@edge-runtime/vm@5.0.0)(@types/node@18.19.33)(jsdom@24.0.0)(less@4.2.0)(sass@1.77.0)(stylus@0.62.0)(terser@5.31.0) + packages/fern-docs/search-server: dependencies: '@fern-api/fdr-sdk': @@ -2289,7 +2350,7 @@ importers: version: 1.4.0(react@18.3.1) '@fern-docs/auth': specifier: workspace:* - version: link:../auth + version: link:../mdx-bundler '@fern-platform/configs': specifier: workspace:* version: link:../../configs @@ -8920,9 +8981,6 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - ajv@8.13.0: - resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==} - ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} @@ -12235,9 +12293,6 @@ packages: is-promise@2.2.2: resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} - is-reference@3.0.2: - resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} - is-reference@3.0.3: resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} @@ -15084,6 +15139,9 @@ packages: remark-mdx-frontmatter@4.0.0: resolution: {integrity: sha512-PZzAiDGOEfv1Ua7exQ8S5kKxkD8CDaSb4nM+1Mprs6u8dyvQifakh+kCj6NovfGXW+bTvrhjaR3srzjS2qJHKg==} + remark-mdx-frontmatter@5.0.0: + resolution: {integrity: sha512-kI75pshe27TM71R+0iX7C3p4MbGMdygkvSbrk1WYSar88WAwR2JfQilofcDGgDNFAWUo5IwTPyq9XvGpifTwqQ==} + remark-mdx@3.0.1: resolution: {integrity: sha512-3Pz3yPQ5Rht2pM5R+0J2MrGoBSrzf+tJG94N+t/ilfdh8YLyyKYtidAYwTveB20BoHAcwIopOUqhcmh2F7hGYA==} @@ -16833,6 +16891,9 @@ packages: vfile@6.0.1: resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==} + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite-node@2.1.4: resolution: {integrity: sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -17202,11 +17263,6 @@ packages: resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} - yaml@2.4.2: - resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} - engines: {node: '>= 14'} - hasBin: true - yaml@2.7.0: resolution: {integrity: sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==} engines: {node: '>= 14'} @@ -18674,16 +18730,6 @@ snapshots: '@smithy/types': 3.6.0 tslib: 2.8.1 - '@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.682.0)': - dependencies: - '@aws-sdk/client-sts': 3.682.0 - '@aws-sdk/core': 3.723.0 - '@aws-sdk/types': 3.723.0 - '@smithy/property-provider': 4.0.0 - '@smithy/types': 4.1.0 - tslib: 2.8.1 - optional: true - '@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.723.0)': dependencies: '@aws-sdk/client-sts': 3.723.0 @@ -19939,7 +19985,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.24.5 '@babel/parser': 7.24.5 '@babel/types': 7.24.5 - debug: 4.3.4(supports-color@5.5.0) + debug: 4.3.7 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -21137,7 +21183,7 @@ snapshots: '@types/unist': 3.0.3 esbuild: 0.24.2 source-map: 0.7.4 - vfile: 6.0.1 + vfile: 6.0.3 vfile-message: 4.0.2 transitivePeerDependencies: - supports-color @@ -21166,7 +21212,7 @@ snapshots: unist-util-position-from-estree: 2.0.0 unist-util-stringify-position: 4.0.0 unist-util-visit: 5.0.0 - vfile: 6.0.1 + vfile: 6.0.3 transitivePeerDependencies: - supports-color @@ -24830,9 +24876,9 @@ snapshots: transitivePeerDependencies: - typescript - '@vercel/functions@1.5.2(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.682.0))': + '@vercel/functions@1.5.2(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.723.0))': optionalDependencies: - '@aws-sdk/credential-provider-web-identity': 3.723.0(@aws-sdk/client-sts@3.682.0) + '@aws-sdk/credential-provider-web-identity': 3.723.0(@aws-sdk/client-sts@3.723.0) '@vercel/kv@2.0.0': dependencies: @@ -26191,13 +26237,6 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ajv@8.13.0: - dependencies: - fast-deep-equal: 3.1.3 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - uri-js: 4.4.1 - ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 @@ -26464,7 +26503,7 @@ snapshots: asl-path-validator: 0.12.0 commander: 10.0.1 jsonpath-plus: 10.0.7 - yaml: 2.4.2 + yaml: 2.7.0 asn1.js@4.10.1: dependencies: @@ -26737,12 +26776,12 @@ snapshots: dependencies: fill-range: 7.1.1 - braintrust@0.0.182(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.682.0))(react@18.3.1)(sswr@2.1.0(svelte@5.19.2))(svelte@5.19.2)(vue@3.5.13(typescript@5.7.2))(zod@3.23.8): + braintrust@0.0.182(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.723.0))(react@18.3.1)(sswr@2.1.0(svelte@5.19.2))(svelte@5.19.2)(vue@3.5.13(typescript@5.7.2))(zod@3.23.8): dependencies: '@ai-sdk/provider': 1.0.4 '@braintrust/core': 0.0.76 '@next/env': 14.2.9 - '@vercel/functions': 1.5.2(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.682.0)) + '@vercel/functions': 1.5.2(@aws-sdk/credential-provider-web-identity@3.723.0(@aws-sdk/client-sts@3.723.0)) ai: 3.4.33(react@18.3.1)(sswr@2.1.0(svelte@5.19.2))(svelte@5.19.2)(vue@3.5.13(typescript@5.7.2))(zod@3.23.8) argparse: 2.0.1 chalk: 4.1.2 @@ -29638,7 +29677,7 @@ snapshots: devlop: 1.1.0 hast-util-from-parse5: 8.0.1 parse5: 7.1.2 - vfile: 6.0.1 + vfile: 6.0.3 vfile-message: 4.0.2 hast-util-from-parse5@7.1.2: @@ -29658,7 +29697,7 @@ snapshots: devlop: 1.1.0 hastscript: 8.0.0 property-information: 6.5.0 - vfile: 6.0.1 + vfile: 6.0.3 vfile-location: 5.0.2 web-namespaces: 2.0.1 @@ -30313,10 +30352,6 @@ snapshots: is-promise@2.2.2: {} - is-reference@3.0.2: - dependencies: - '@types/estree': 1.0.6 - is-reference@3.0.3: dependencies: '@types/estree': 1.0.6 @@ -32872,7 +32907,7 @@ snapshots: dependencies: '@types/estree': 1.0.6 estree-walker: 3.0.3 - is-reference: 3.0.2 + is-reference: 3.0.3 picocolors@1.0.0: {} @@ -33019,7 +33054,7 @@ snapshots: postcss-load-config@4.0.2(postcss@8.4.31)(ts-node@10.9.2(@swc/core@1.5.7)(@types/node@18.19.33)(typescript@5.7.2)): dependencies: lilconfig: 3.1.3 - yaml: 2.4.2 + yaml: 2.7.0 optionalDependencies: postcss: 8.4.31 ts-node: 10.9.2(@swc/core@1.5.7)(@types/node@18.19.33)(typescript@5.7.2) @@ -33953,6 +33988,15 @@ snapshots: unified: 11.0.4 yaml: 2.7.0 + remark-mdx-frontmatter@5.0.0: + dependencies: + '@types/mdast': 4.0.4 + estree-util-is-identifier-name: 3.0.0 + estree-util-value-to-estree: 3.2.1 + toml: 3.0.0 + unified: 11.0.4 + yaml: 2.7.0 + remark-mdx@3.0.1: dependencies: mdast-util-mdx: 3.0.0 @@ -33990,7 +34034,7 @@ snapshots: '@types/mdast': 4.0.4 mdast-util-to-hast: 13.2.0 unified: 11.0.4 - vfile: 6.0.1 + vfile: 6.0.3 remark-smartypants@2.1.0: dependencies: @@ -35143,7 +35187,7 @@ snapshots: table@6.8.2: dependencies: - ajv: 8.13.0 + ajv: 8.17.1 lodash.truncate: 4.4.2 slice-ansi: 4.0.0 string-width: 4.2.3 @@ -36023,12 +36067,12 @@ snapshots: vfile-location@5.0.2: dependencies: '@types/unist': 3.0.3 - vfile: 6.0.1 + vfile: 6.0.3 vfile-matter@5.0.0: dependencies: - vfile: 6.0.1 - yaml: 2.4.2 + vfile: 6.0.3 + yaml: 2.7.0 vfile-message@3.1.4: dependencies: @@ -36053,6 +36097,11 @@ snapshots: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.3 + vfile-message: 4.0.2 + vite-node@2.1.4(@types/node@18.19.33)(less@4.2.0)(sass@1.77.0)(stylus@0.62.0)(terser@5.31.0): dependencies: cac: 6.7.14 @@ -36636,8 +36685,6 @@ snapshots: yaml@2.3.1: {} - yaml@2.4.2: {} - yaml@2.7.0: {} yargs-parser@20.2.9: {}