diff --git a/examples/blog/src/components/Heading.astro b/examples/blog/src/components/Heading.astro new file mode 100644 index 000000000..f1805aaf7 --- /dev/null +++ b/examples/blog/src/components/Heading.astro @@ -0,0 +1,9 @@ +

+ +

+ + diff --git a/examples/blog/src/layouts/BlogPost.astro b/examples/blog/src/layouts/BlogPost.astro index 76cb749d4..95ad97564 100644 --- a/examples/blog/src/layouts/BlogPost.astro +++ b/examples/blog/src/layouts/BlogPost.astro @@ -1,12 +1,12 @@ --- -import { Markdown } from 'astro/components'; import BaseHead from '../components/BaseHead.astro'; -import BlogHeader from '../components/BlogHeader.astro'; -import BlogPost from '../components/BlogPost.astro'; +// import BlogHeader from '../components/BlogHeader.astro'; +// import BlogPost from '../components/BlogPost.astro'; const {content} = Astro.props; const {title, description, publishDate, author, heroImage, permalink, alt} = content; --- + @@ -14,10 +14,13 @@ const {title, description, publishDate, author, heroImage, permalink, alt} = con - - +

Hello world!

+
- +
+ + + diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index b082088c8..6a5da500a 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -18,7 +18,7 @@ let permalink = 'https://example.com/'; // Data Fetching: List all Markdown posts in the repo. -let allPosts = Astro.fetchContent('./posts/*.md'); +let allPosts = await Astro.fetchContent('./posts/*.md'); allPosts = allPosts.sort((a, b) => new Date(b.publishDate).valueOf() - new Date(a.publishDate).valueOf()); // Full Astro Component Syntax: diff --git a/examples/blog/src/pages/posts/index.md b/examples/blog/src/pages/posts/index.md new file mode 100644 index 000000000..34ab17a8b --- /dev/null +++ b/examples/blog/src/pages/posts/index.md @@ -0,0 +1,15 @@ +--- +setup: | + import Layout from '../../layouts/BlogPost.astro' + import Cool from '../../components/Author.astro' +name: Nate Moore +value: 128 +--- + +# Hello world! + + + +This is so cool! + +Do variables work {frontmatter.value * 2}? diff --git a/package.json b/package.json index 7cbad4381..8b408e525 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,11 @@ "build": "yarn build:core", "build:one": "lerna run build --scope", "build:all": "lerna run build --scope \"{astro,@astrojs/*}\"", - "build:core": "lerna run build --scope \"{astro,@astrojs/parser,@astrojs/markdown-support}\"", + "build:core": "lerna run build --scope \"{astro,@astrojs/parser,@astrojs/markdown-remark}\"", "dev": "yarn dev:core --parallel --stream", "dev:one": "lerna run dev --scope --parallel --stream", "dev:all": "lerna run dev --scope \"{astro,@astrojs/*}\" --parallel --stream", - "dev:core": "lerna run dev --scope \"{astro,@astrojs/parser,@astrojs/markdown-support}\" --parallel --stream", + "dev:core": "lerna run dev --scope \"{astro,@astrojs/parser,@astrojs/markdown-remark}\" --parallel --stream", "format": "prettier -w .", "lint": "eslint \"packages/**/*.ts\"", "test": "yarn workspace astro run test", @@ -24,6 +24,7 @@ }, "workspaces": [ "compiled/*", + "packages/markdown/*", "packages/renderers/*", "packages/*", "examples/*", @@ -45,6 +46,7 @@ "devDependencies": { "@changesets/cli": "^2.16.0", "@types/jest": "^27.0.1", + "@octokit/action": "^3.15.4", "@typescript-eslint/eslint-plugin": "^4.22.0", "@typescript-eslint/parser": "^4.18.0", "autoprefixer": "^10.2.6", diff --git a/packages/astro/components/Markdown.astro b/packages/astro/components/Markdown.astro index 99999751e..c03eb73c8 100644 --- a/packages/astro/components/Markdown.astro +++ b/packages/astro/components/Markdown.astro @@ -1,5 +1,26 @@ --- -import { renderMarkdown } from '@astrojs/markdown-support'; +import { renderMarkdown } from '@astrojs/markdown-remark'; + +export interface Props { + content?: string; +} + +// Internal props that should not be part of the external interface. +interface InternalProps extends Props { + $scope: string; +} + +const __TopLevelAstro = { + site: new URL("http://localhost:3000"), + fetchContent: (globResult) => fetchContent(globResult, import.meta.url), + resolve(...segments) { + return segments.reduce( + (url, segment) => new URL(segment, url), + new URL("http://localhost:3000/packages/astro/components/Markdown.astro") + ).pathname + }, +}; +const Astro = __TopLevelAstro; export interface Props { content?: string; diff --git a/packages/astro/package.json b/packages/astro/package.json index 34e6f9e80..4f521ff1b 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -39,8 +39,8 @@ "test": "NODE_OPTIONS=--experimental-vm-modules jest" }, "dependencies": { - "@astrojs/compiler": "^0.1.0-canary.36", - "@astrojs/markdown-support": "^0.3.1", + "@astrojs/compiler": "^0.1.0-canary.37", + "@astrojs/markdown-remark": "^0.3.1", "@babel/core": "^7.15.0", "@web/rollup-plugin-html": "^1.9.1", "astring": "^1.7.5", diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 668efc18e..2642eab4d 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1,12 +1,9 @@ -import type { AstroMarkdownOptions } from '@astrojs/markdown-support'; import type babel from '@babel/core'; import type vite from 'vite'; import type { z } from 'zod'; import type { AstroConfigSchema } from '../config'; import type { AstroComponentFactory } from '../internal'; -export { AstroMarkdownOptions }; - export interface AstroComponentMetadata { displayName: string; hydrate?: 'load' | 'idle' | 'visible' | 'media' | 'only'; @@ -59,7 +56,9 @@ export interface AstroUserConfig { */ renderers?: string[]; /** Options for rendering markdown content */ - markdownOptions?: Partial; + markdownOptions?: { + render?: [string, Record]; + }; /** Options specific to `astro build` */ buildOptions?: { /** Your public domain, e.g.: https://my-site.dev/. Used to generate sitemaps and canonical URLs. */ @@ -103,9 +102,7 @@ export interface AstroUserConfig { // export interface AstroUserConfig extends z.input { // markdownOptions?: Partial; // } -export interface AstroConfig extends z.output { - markdownOptions: Partial; -} +export type AstroConfig = z.output; export type AsyncRendererComponentFn = (Component: any, props: any, children: string | undefined, metadata?: AstroComponentMetadata) => Promise; diff --git a/packages/astro/src/@types/config.ts b/packages/astro/src/@types/config.ts deleted file mode 100644 index 19103a9c4..000000000 --- a/packages/astro/src/@types/config.ts +++ /dev/null @@ -1,95 +0,0 @@ -import type { AstroMarkdownOptions } from '@astrojs/markdown-support'; -import type { AstroConfigSchema } from '../config'; -import type { z } from 'zod'; - -/** - * The Astro User Config Format: - * This is the type interface for your astro.config.mjs default export. - */ -export interface AstroUserConfig { - /** - * Where to resolve all URLs relative to. Useful if you have a monorepo project. - * Default: '.' (current working directory) - */ - projectRoot?: string; - /** - * Path to the `astro build` output. - * Default: './dist' - */ - dist?: string; - /** - * Path to all of your Astro components, pages, and data. - * Default: './src' - */ - src?: string; - /** - * Path to your Astro/Markdown pages. Each file in this directory - * becomes a page in your final build. - * Default: './src/pages' - */ - pages?: string; - /** - * Path to your public files. These are copied over into your build directory, untouched. - * Useful for favicons, images, and other files that don't need processing. - * Default: './public' - */ - public?: string; - /** - * Framework component renderers enable UI framework rendering (static and dynamic). - * When you define this in your configuration, all other defaults are disabled. - * Default: [ - * '@astrojs/renderer-svelte', - * '@astrojs/renderer-vue', - * '@astrojs/renderer-react', - * '@astrojs/renderer-preact', - * ], - */ - renderers?: string[]; - /** Options for rendering markdown content */ - markdownOptions?: Partial; - /** Options specific to `astro build` */ - buildOptions?: { - /** Your public domain, e.g.: https://my-site.dev/. Used to generate sitemaps and canonical URLs. */ - site?: string; - /** Generate an automatically-generated sitemap for your build. - * Default: true - */ - sitemap?: boolean; - /** - * Control the output file URL format of each page. - * If 'file', Astro will generate a matching HTML file (ex: "/foo.html") instead of a directory. - * If 'directory', Astro will generate a directory with a nested index.html (ex: "/foo/index.html") for each page. - * Default: 'directory' - */ - pageUrlFormat?: 'file' | 'directory'; - }; - /** Options for the development server run with `astro dev`. */ - devOptions?: { - hostname?: string; - /** The port to run the dev server on. */ - port?: number; - /** Path to tailwind.config.js, if used */ - tailwindConfig?: string; - /** - * Configure The trailing slash behavior of URL route matching: - * 'always' - Only match URLs that include a trailing slash (ex: "/foo/") - * 'never' - Never match URLs that include a trailing slash (ex: "/foo") - * 'ignore' - Match URLs regardless of whether a trailing "/" exists - * Default: 'always' - */ - trailingSlash?: 'always' | 'never' | 'ignore'; - }; -} - -// NOTE(fks): We choose to keep our hand-generated AstroUserConfig interface so that -// we can add JSDoc-style documentation and link to the definition file in our repo. -// However, Zod comes with the ability to auto-generate AstroConfig from the schema -// above. If we ever get to the point where we no longer need the dedicated -// @types/config.ts file, consider replacing it with the following lines: -// -// export interface AstroUserConfig extends z.input { -// markdownOptions?: Partial; -// } -export interface AstroConfig extends z.output { - markdownOptions: Partial; -} diff --git a/packages/astro/src/@types/public.ts b/packages/astro/src/@types/public.ts index 89ab25e62..b53c3dea1 100644 --- a/packages/astro/src/@types/public.ts +++ b/packages/astro/src/@types/public.ts @@ -1 +1 @@ -export { AstroConfig, AstroUserConfig } from './config'; +export { AstroConfig, AstroUserConfig } from './astro'; diff --git a/packages/astro/src/config.ts b/packages/astro/src/config.ts index abbdb6494..89d99f469 100644 --- a/packages/astro/src/config.ts +++ b/packages/astro/src/config.ts @@ -1,4 +1,4 @@ -import type { AstroConfig } from './@types/astro'; +import type { AstroConfig, AstroUserConfig } from './@types/astro'; import { existsSync } from 'fs'; import getPort from 'get-port'; @@ -6,7 +6,6 @@ import * as colors from 'kleur/colors'; import path from 'path'; import { pathToFileURL } from 'url'; import { z } from 'zod'; -import { AstroUserConfig } from './@types/config'; export const AstroConfigSchema = z.object({ projectRoot: z @@ -41,6 +40,7 @@ export const AstroConfigSchema = z.object({ gfm: z.boolean().optional(), remarkPlugins: z.array(z.any()).optional(), rehypePlugins: z.array(z.any()).optional(), + render: z.any().optional().default(['@astrojs/markdown-remark', {}]), }) .optional() .default({}), diff --git a/packages/astro/src/dev/index.ts b/packages/astro/src/dev/index.ts index 8756f0b08..cfb6a4c9b 100644 --- a/packages/astro/src/dev/index.ts +++ b/packages/astro/src/dev/index.ts @@ -12,6 +12,8 @@ import { performance } from 'perf_hooks'; import { fileURLToPath } from 'url'; import { createRequire } from 'module'; import stripAnsi from 'strip-ansi'; +import path from 'path'; +import { promises as fs } from 'fs'; import vite from 'vite'; import { defaultLogOptions, error, info } from '../logger.js'; import { createRouteManifest, matchRoute } from '../runtime/routing.js'; diff --git a/packages/astro/src/internal/index.ts b/packages/astro/src/internal/index.ts index aa5b9b81d..47183e4e4 100644 --- a/packages/astro/src/internal/index.ts +++ b/packages/astro/src/internal/index.ts @@ -3,9 +3,10 @@ import type { AstroComponentMetadata } from '../@types/astro'; import { valueToEstree, Value } from 'estree-util-value-to-estree'; import * as astring from 'astring'; import shorthash from 'shorthash'; -import { renderAstroComponent } from '../runtime/astro.js'; +import { renderToString, renderAstroComponent } from '../runtime/astro.js'; const { generate, GENERATOR } = astring; + // A more robust version alternative to `JSON.stringify` that can handle most values // see https://github.com/remcohaszing/estree-util-value-to-estree#readme const customGenerator: astring.Generator = { @@ -25,16 +26,21 @@ const serialize = (value: Value) => generator: customGenerator, }); -async function _render(child: any) { - // Special: If a child is a function, call it automatically. - // This lets you do {() => ...} without the extra boilerplate - // of wrapping it in a function and calling it. - if (typeof child === 'function') { +async function _render(child: any): Promise { + child = await child; + if (Array.isArray(child)) { + return (await Promise.all(child.map((value) => _render(value)))).join('\n'); + } else if (typeof child === 'function') { + // Special: If a child is a function, call it automatically. + // This lets you do {() => ...} without the extra boilerplate + // of wrapping it in a function and calling it. return await child(); } else if (typeof child === 'string') { return child; } else if (!child && child !== 0) { // do nothing, safe to ignore falsey values. + } else if (child instanceof AstroComponent) { + return await renderAstroComponent(child); } else { return child; } @@ -43,7 +49,6 @@ async function _render(child: any) { export class AstroComponent { private htmlParts: string[]; private expressions: TemplateStringsArray; - constructor(htmlParts: string[], expressions: TemplateStringsArray) { this.htmlParts = htmlParts; this.expressions = expressions; @@ -129,12 +134,20 @@ setup("${astroId}", {${metadata.hydrateArgs ? `value: ${JSON.stringify(metadata. return hydrationScript; } -export const renderComponent = async (result: any, displayName: string, Component: unknown, _props: Record, children: any) => { +export const renderSlot = async (result: any, slotted: string, fallback?: any) => { + if (slotted) { + return _render(slotted); + } + return fallback; +}; + +export const renderComponent = async (result: any, displayName: string, Component: unknown, _props: Record, slots?: any) => { Component = await Component; // children = await renderGenerator(children); const { renderers } = result._metadata; + if (Component && (Component as any).isAstroComponentFactory) { - const output = await renderAstroComponent(await (Component as any)(result, Component, _props, children)); + const output = await renderToString(result, Component as any, _props, slots); return output; } diff --git a/packages/astro/src/runtime/hmr.ts b/packages/astro/src/runtime/hmr.ts index 23c48d5e7..0a7ce4e3c 100644 --- a/packages/astro/src/runtime/hmr.ts +++ b/packages/astro/src/runtime/hmr.ts @@ -1,4 +1,4 @@ -import '@vite/client'; +import '/@vite/client'; if (import.meta.hot) { const parser = new DOMParser(); diff --git a/packages/astro/src/runtime/markdown.ts b/packages/astro/src/runtime/markdown.ts deleted file mode 100644 index e88cf0d0a..000000000 --- a/packages/astro/src/runtime/markdown.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SourceDescription } from 'rollup'; - -import { renderMarkdownWithFrontmatter } from '@astrojs/markdown-support'; -import astroParser from '@astrojs/parser'; -import { SourceMapGenerator } from 'source-map'; - -/** transform .md contents into Astro h() function */ -export async function markdownToH(filename: string, contents: string): Promise { - const { astro, content } = await renderMarkdownWithFrontmatter(contents); - const map = new SourceMapGenerator(); - return { - code: content, - map: null, - }; -} diff --git a/packages/astro/src/runtime/ssr.ts b/packages/astro/src/runtime/ssr.ts index 6c0596d8c..f6dd1058f 100644 --- a/packages/astro/src/runtime/ssr.ts +++ b/packages/astro/src/runtime/ssr.ts @@ -2,6 +2,7 @@ import type { BuildResult } from 'esbuild'; import type { ViteDevServer } from 'vite'; import type { AstroConfig, ComponentInstance, GetStaticPathsResult, Params, Props, RouteCache, RouteData, RuntimeMode, SSRError } from '../@types/astro'; import type { LogOptions } from '../logger'; +import type { PathsOutput } from 'fdir'; import cheerio from 'cheerio'; import * as eslexer from 'es-module-lexer'; @@ -9,6 +10,7 @@ import { fileURLToPath } from 'url'; import fs from 'fs'; import path from 'path'; import { renderPage } from './astro.js'; +import { fdir } from 'fdir'; import { generatePaginateFunction } from './paginate.js'; import { getParams, validateGetStaticPathsModule, validateGetStaticPathsResult } from './routing.js'; import { parseNpmName, canonicalURL as getCanonicalURL, codeFrame } from './util.js'; @@ -95,7 +97,6 @@ async function resolveImportedModules(viteServer: ViteDevServer, file: string) { let importedModules: Record = {}; const moduleNodes = Array.from(modulesByFile); - // Loop over the importedModules and grab the exports from each one. // We'll pass these to the shared $$result so renderers can match // components to their exported identifier and URL @@ -168,41 +169,71 @@ export async function ssr({ astroConfig, filePath, logging, mode, origin, pathna pageProps = { ...matchedStaticPath.props } || {}; } - // 3. render page - if (!browserHash && (viteServer as any)._optimizeDepsMetadata?.browserHash) browserHash = (viteServer as any)._optimizeDepsMetadata.browserHash; // note: this is "private" and may change over time - const fullURL = new URL(pathname, origin); + // 3. render page + if (!browserHash && (viteServer as any)._optimizeDepsMetadata?.browserHash) browserHash = (viteServer as any)._optimizeDepsMetadata.browserHash; // note: this is "private" and may change over time + const fullURL = new URL(pathname, origin); - const Component = await mod.default; - if (!Component) throw new Error(`Expected an exported Astro component but recieved typeof ${typeof Component}`); - if (!Component.isAstroComponentFactory) throw new Error(`Unable to SSR non-Astro component (${route?.component})`); + const Component = await mod.default; + const ext = path.posix.extname(filePath.pathname); + if (!Component) + throw new Error(`Expected an exported Astro component but recieved typeof ${typeof Component}`); + + if (!Component.isAstroComponentFactory) throw new Error(`Unable to SSR non-Astro component (${route?.component})`); - let html = await renderPage( - { - styles: new Set(), - scripts: new Set(), - /** This function returns the `Astro` faux-global */ - createAstro(props: any) { - const site = new URL(origin); - const url = new URL('.' + pathname, site); - const canonicalURL = getCanonicalURL(pathname, astroConfig.buildOptions.site || origin); - return { isPage: true, site, request: { url, canonicalURL }, props }; - }, - _metadata: { importedModules, renderers }, - }, - Component, - {}, - null - ); + const result = { + styles: new Set(), + scripts: new Set(), + /** This function returns the `Astro` faux-global */ + createAstro: (props: any) => { + const site = new URL(origin); + const url = new URL('.' + pathname, site); + const canonicalURL = getCanonicalURL(pathname, astroConfig.buildOptions.site || origin) + const fetchContent = createFetchContent(fileURLToPath(filePath)); + return { + isPage: true, + site, + request: { url, canonicalURL }, + props, + fetchContent + }; + }, + _metadata: { importedModules, renderers }, + } - // 4. modify response - if (mode === 'development') { - // inject Astro HMR code - html = injectAstroHMR(html); - // inject Vite HMR code - html = injectViteClient(html); - // replace client hydration scripts - html = resolveNpmImports(html); + const createFetchContent = (currentFilePath: string) => { + return async (pattern: string) => { + const cwd = path.dirname(currentFilePath); + const crawler = new fdir().glob(pattern); + const files = await crawler.crawlWithOptions(cwd, { + resolvePaths: true, + includeBasePath: true, + filters: [(p) => p !== currentFilePath] + }).withPromise() as PathsOutput; + + const contents = await Promise.all(files.map(async file => { + const { default: ChildComponent } = (await viteServer.ssrLoadModule(file)) as ComponentInstance; + return renderPage({ + ...result, + createAstro: (props: any) => { + return { props } + }, + }, ChildComponent, {}, null); + })) + return contents; } + } + + let html = await renderPage(result, Component, {}, null); + + // 4. modify response + if (mode === 'development') { + // inject Astro HMR code + html = injectAstroHMR(html); + // inject Vite HMR code + html = injectViteClient(html); + // replace client hydration scripts + html = resolveNpmImports(html); + } // 5. finish return html; diff --git a/packages/astro/src/runtime/vite/config.ts b/packages/astro/src/runtime/vite/config.ts index dcc3715f7..8b1e2bb01 100644 --- a/packages/astro/src/runtime/vite/config.ts +++ b/packages/astro/src/runtime/vite/config.ts @@ -9,6 +9,7 @@ import { fileURLToPath } from 'url'; import { createRequire } from 'module'; import { getPackageJSON, parseNpmName } from '../util.js'; import astro from './plugin-astro.js'; +import markdown from './plugin-markdown.js'; import jsx from './plugin-jsx.js'; import { AstroDevServer } from '../../dev'; @@ -34,6 +35,7 @@ export async function loadViteConfig( }); const userDevDeps = Object.keys(packageJSON?.devDependencies || {}); const { external, noExternal } = await viteSSRDeps([...userDeps, ...userDevDeps]); + // console.log(external.has('tiny-glob'), noExternal.has('tiny-glob')); // load Astro renderers await Promise.all( @@ -78,7 +80,7 @@ export async function loadViteConfig( /** Always include these dependencies for optimization */ include: [...optimizedDeps], }, - plugins: [astro({ config: astroConfig, devServer }), jsx({ config: astroConfig, logging }), ...plugins], + plugins: [astro({ config: astroConfig, devServer }), markdown({ config: astroConfig, devServer }), jsx({ config: astroConfig, logging }), ...plugins], publicDir: fileURLToPath(astroConfig.public), resolve: { dedupe: [...dedupe], diff --git a/packages/astro/src/runtime/vite/plugin-astro.ts b/packages/astro/src/runtime/vite/plugin-astro.ts index d9b9e0bdf..c9cdcf2c0 100644 --- a/packages/astro/src/runtime/vite/plugin-astro.ts +++ b/packages/astro/src/runtime/vite/plugin-astro.ts @@ -1,10 +1,11 @@ +import type { TransformResult } from '@astrojs/compiler'; import type { Plugin } from 'vite'; import type { AstroConfig, Renderer } from '../../@types/astro.js'; -import type { LogOptions } from '../../logger'; import esbuild from 'esbuild'; import fs from 'fs'; import { transform } from '@astrojs/compiler'; +import { decode } from 'sourcemap-codec'; import { AstroDevServer } from '../../dev/index.js'; interface AstroPluginOptions { @@ -13,33 +14,42 @@ interface AstroPluginOptions { } /** Transform .astro files for Vite */ -export default function astro({ devServer }: AstroPluginOptions): Plugin { +export default function astro({ config, devServer }: AstroPluginOptions): Plugin { return { name: '@astrojs/vite-plugin-astro', enforce: 'pre', // run transforms before other plugins can // note: don’t claim .astro files with resolveId() — it prevents Vite from transpiling the final JS (import.meta.globEager, etc.) async load(id) { - if (id.endsWith('.astro') || id.endsWith('.md')) { + if (id.endsWith('.astro')) { + // const isPage = id.startsWith(fileURLToPath(config.pages)); let source = await fs.promises.readFile(id, 'utf8'); + let tsResult: TransformResult | undefined; - // 1. Transform from `.astro` to valid `.ts` - // use `sourcemap: "inline"` so that the sourcemap is included in the "code" result that we pass to esbuild. - const tsResult = await transform(source, { sourcefile: id, sourcemap: 'inline' }); - // 2. Compile `.ts` to `.js` - const { code, map } = await esbuild.transform(tsResult.code, { loader: 'ts', sourcemap: 'inline', sourcefile: id }); + try { + // 1. Transform from `.astro` to valid `.ts` + // use `sourcemap: "inline"` so that the sourcemap is included in the "code" result that we pass to esbuild. + tsResult = await transform(source, { sourcefile: id, sourcemap: 'inline', internalURL: 'astro/internal' }); + // 2. Compile `.ts` to `.js` + const { code, map } = await esbuild.transform(tsResult.code, { loader: 'ts', sourcemap: 'inline', sourcefile: id }); - return { - code, - map, - }; + return { + code, + map, + }; + } catch (err: any) { + // if esbuild threw the error, find original code source to display + if (err.errors) { + const sourcemapb64 = (tsResult?.code.match(/^\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,(.*)/m) || [])[1]; + if (!sourcemapb64) throw err; + const json = JSON.parse(new Buffer(sourcemapb64, 'base64').toString()); + const mappings = decode(json.mappings); + const focusMapping = mappings[err.errors[0].location.line + 1]; + err.sourceLoc = { file: id, line: (focusMapping[0][2] || 0) + 1, column: (focusMapping[0][3] || 0) + 1 }; + } + throw err; + } } - // UNCOMMENT WHEN MARKDOWN SUPPORT LANDS - // } else if (id.endsWith('.md')) { - // let contents = await fs.promises.readFile(id, 'utf8'); - // const filename = slash(id.replace(fileURLToPath(config.projectRoot), '')); - // return markdownToH(filename, contents); - // } return null; }, async handleHotUpdate(context) { diff --git a/packages/astro/src/runtime/vite/plugin-markdown.ts b/packages/astro/src/runtime/vite/plugin-markdown.ts new file mode 100644 index 000000000..02a9caf46 --- /dev/null +++ b/packages/astro/src/runtime/vite/plugin-markdown.ts @@ -0,0 +1,68 @@ +import type { Plugin } from 'vite'; +import type { AstroConfig, Renderer } from '../../@types/astro.js'; + +import esbuild from 'esbuild'; +import fs from 'fs'; +import { transform } from '@astrojs/compiler'; +import { AstroDevServer } from '../../dev/index.js'; + +interface AstroPluginOptions { + config: AstroConfig; + devServer?: AstroDevServer; +} + +/** Transform .astro files for Vite */ +export default function markdown({ config }: AstroPluginOptions): Plugin { + return { + name: '@astrojs/vite-plugin-markdown', + enforce: 'pre', // run transforms before other plugins can + async load(id) { + if (id.endsWith('.md')) { + let source = await fs.promises.readFile(id, 'utf8'); + + // 2. Transform from `.md` to valid `.astro` + let render = config.markdownOptions.render; + let renderOpts = {}; + if (Array.isArray(render)) { + render = render[0]; + renderOpts = render[1]; + } + if (typeof render === 'string') { + ({ default: render } = await import(render)); + } + let { frontmatter, metadata, code: astroResult } = await render(source, renderOpts); + + // Extract special frontmatter keys + const { layout = '', components = '', setup = '', ...content } = frontmatter; + const prelude = `--- +${layout ? `import Layout from '${layout}';` : ''} +${components ? `import * from '${components}';` : ''} +${setup} +---`; + // If the user imported "Layout", wrap the content in a Layout + if (/\bLayout\b/.test(prelude)) { + astroResult = `${prelude}\n\n\n${astroResult}\n\n`; + } else { + astroResult = `${prelude}\n${astroResult}`; + } + + // 2. Transform from `.astro` to valid `.ts` + let { code: tsResult } = await transform(astroResult, { sourcefile: id, sourcemap: 'inline', internalURL: 'astro/internal' }); + + tsResult = `\nexport const metadata = ${JSON.stringify(metadata)}; +export const frontmatter = ${JSON.stringify(content)}; +${tsResult}`; + + // 3. Compile `.ts` to `.js` + const { code, map } = await esbuild.transform(tsResult, { loader: 'ts', sourcemap: 'inline', sourcefile: id }); + + return { + code, + map: null, + }; + } + + return null; + }, + }; +} diff --git a/packages/markdown-support/src/gray-matter/index.js b/packages/markdown-support/src/gray-matter/index.js deleted file mode 100644 index 6f5876960..000000000 --- a/packages/markdown-support/src/gray-matter/index.js +++ /dev/null @@ -1,229 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2014-2018, Jon Schlinkert. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -'use strict'; - -import sections from 'section-matter'; -import defaults from './lib/defaults.js'; -import stringify from './lib/stringify.js'; -import excerpt from './lib/excerpt.js'; -import engines from './lib/engines.js'; -import toFile from './lib/to-file.js'; -import parse from './lib/parse.js'; -import * as utils from './lib/utils.js'; - -/** - * Takes a string or object with `content` property, extracts - * and parses front-matter from the string, then returns an object - * with `data`, `content` and other [useful properties](#returned-object). - * - * ```js - * const matter = require('gray-matter'); - * console.log(matter('---\ntitle: Home\n---\nOther stuff')); - * //=> { data: { title: 'Home'}, content: 'Other stuff' } - * ``` - * @param {Object|String} `input` String, or object with `content` string - * @param {Object=} `options` - * @return {{content: string, data: Record}} - * @api public - */ -function matter(input, options) { - if (input === '') { - return { data: {}, content: input, excerpt: '', orig: input }; - } - - let file = toFile(input); - const cached = matter.cache[file.content]; - - if (!options) { - if (cached) { - file = Object.assign({}, cached); - file.orig = cached.orig; - return file; - } - - // only cache if there are no options passed. if we cache when options - // are passed, we would need to also cache options values, which would - // negate any performance benefits of caching - matter.cache[file.content] = file; - } - - return parseMatter(file, options); -} - -/** - * Parse front matter - */ - -function parseMatter(file, options) { - const opts = defaults(options); - const open = opts.delimiters[0]; - const close = '\n' + opts.delimiters[1]; - let str = file.content; - - if (opts.language) { - file.language = opts.language; - } - - // get the length of the opening delimiter - const openLen = open.length; - if (!utils.startsWith(str, open, openLen)) { - excerpt(file, opts); - return file; - } - - // if the next character after the opening delimiter is - // a character from the delimiter, then it's not a front- - // matter delimiter - if (str.charAt(openLen) === open.slice(-1)) { - return file; - } - - // strip the opening delimiter - str = str.slice(openLen); - const len = str.length; - - // use the language defined after first delimiter, if it exists - const language = matter.language(str, opts); - if (language.name) { - file.language = language.name; - str = str.slice(language.raw.length); - } - - // get the index of the closing delimiter - let closeIndex = str.indexOf(close); - if (closeIndex === -1) { - closeIndex = len; - } - - // get the raw front-matter block - file.matter = str.slice(0, closeIndex); - - const block = file.matter.replace(/^\s*#[^\n]+/gm, '').trim(); - if (block === '') { - file.isEmpty = true; - file.empty = file.content; - file.data = {}; - } else { - // create file.data by parsing the raw file.matter block - file.data = parse(file.language, file.matter, opts); - } - - // update file.content - if (closeIndex === len) { - file.content = ''; - } else { - file.content = str.slice(closeIndex + close.length); - if (file.content[0] === '\r') { - file.content = file.content.slice(1); - } - if (file.content[0] === '\n') { - file.content = file.content.slice(1); - } - } - - excerpt(file, opts); - - if (opts.sections === true || typeof opts.section === 'function') { - sections(file, opts.section); - } - return file; -} - -/** - * Expose engines - */ - -matter.engines = engines; - -/** - * Stringify an object to YAML or the specified language, and - * append it to the given string. By default, only YAML and JSON - * can be stringified. See the [engines](#engines) section to learn - * how to stringify other languages. - * - * ```js - * console.log(matter.stringify('foo bar baz', {title: 'Home'})); - * // results in: - * // --- - * // title: Home - * // --- - * // foo bar baz - * ``` - * @param {String|Object} `file` The content string to append to stringified front-matter, or a file object with `file.content` string. - * @param {Object} `data` Front matter to stringify. - * @param {Object} `options` [Options](#options) to pass to gray-matter and [js-yaml]. - * @return {String} Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string. - * @api public - */ - -matter.stringify = function (file, data, options) { - if (typeof file === 'string') file = matter(file, options); - return stringify(file, data, options); -}; - -/** - * Returns true if the given `string` has front matter. - * @param {String} `string` - * @param {Object} `options` - * @return {Boolean} True if front matter exists. - * @api public - */ - -matter.test = function (str, options) { - return utils.startsWith(str, defaults(options).delimiters[0]); -}; - -/** - * Detect the language to use, if one is defined after the - * first front-matter delimiter. - * @param {String} `string` - * @param {Object} `options` - * @return {Object} Object with `raw` (actual language string), and `name`, the language with whitespace trimmed - */ - -matter.language = function (str, options) { - const opts = defaults(options); - const open = opts.delimiters[0]; - - if (matter.test(str)) { - str = str.slice(open.length); - } - - const language = str.slice(0, str.search(/\r?\n/)); - return { - raw: language, - name: language ? language.trim() : '', - }; -}; - -/** - * Expose `matter` - */ - -matter.cache = {}; -matter.clearCache = function () { - matter.cache = {}; -}; -export default matter; diff --git a/packages/markdown-support/src/gray-matter/lib/defaults.js b/packages/markdown-support/src/gray-matter/lib/defaults.js deleted file mode 100644 index 8cf6b5378..000000000 --- a/packages/markdown-support/src/gray-matter/lib/defaults.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -import engines from './engines.js'; -import * as utils from './utils.js'; - -export default function (options) { - const opts = Object.assign({}, options); - - // ensure that delimiters are an array - opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || '---'); - if (opts.delimiters.length === 1) { - opts.delimiters.push(opts.delimiters[0]); - } - - opts.language = (opts.language || opts.lang || 'yaml').toLowerCase(); - opts.engines = Object.assign({}, engines, opts.parsers, opts.engines); - return opts; -} diff --git a/packages/markdown-support/src/gray-matter/lib/engine.js b/packages/markdown-support/src/gray-matter/lib/engine.js deleted file mode 100644 index 5987c3e03..000000000 --- a/packages/markdown-support/src/gray-matter/lib/engine.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -export default function (name, options) { - let engine = options.engines[name] || options.engines[aliase(name)]; - if (typeof engine === 'undefined') { - throw new Error('gray-matter engine "' + name + '" is not registered'); - } - if (typeof engine === 'function') { - engine = { parse: engine }; - } - return engine; -} - -function aliase(name) { - switch (name.toLowerCase()) { - case 'js': - case 'javascript': - return 'javascript'; - case 'coffee': - case 'coffeescript': - case 'cson': - return 'coffee'; - case 'yaml': - case 'yml': - return 'yaml'; - default: { - return name; - } - } -} diff --git a/packages/markdown-support/src/gray-matter/lib/engines.js b/packages/markdown-support/src/gray-matter/lib/engines.js deleted file mode 100644 index 45e094e49..000000000 --- a/packages/markdown-support/src/gray-matter/lib/engines.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -import yaml from 'js-yaml'; - -/** - * Default engines - */ - -const engines = {}; - -/** - * YAML - */ - -engines.yaml = { - parse: yaml.safeLoad.bind(yaml), - stringify: yaml.safeDump.bind(yaml), -}; - -/** - * JSON - */ - -engines.json = { - parse: JSON.parse.bind(JSON), - stringify: function (obj, options) { - const opts = Object.assign({ replacer: null, space: 2 }, options); - return JSON.stringify(obj, opts.replacer, opts.space); - }, -}; - -/** - * JavaScript - */ - -engines.javascript = { - parse: function parse(str, options, wrap) { - /* eslint no-eval: 0 */ - try { - if (wrap !== false) { - str = '(function() {\nreturn ' + str.trim() + ';\n}());'; - } - return eval(str) || {}; - } catch (err) { - if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) { - return parse(str, options, false); - } - throw new SyntaxError(err); - } - }, - stringify: function () { - throw new Error('stringifying JavaScript is not supported'); - }, -}; - -export default engines; diff --git a/packages/markdown-support/src/gray-matter/lib/excerpt.js b/packages/markdown-support/src/gray-matter/lib/excerpt.js deleted file mode 100644 index 1ab36be88..000000000 --- a/packages/markdown-support/src/gray-matter/lib/excerpt.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -import defaults from './defaults.js'; - -export default function (file, options) { - const opts = defaults(options); - - if (file.data == null) { - file.data = {}; - } - - if (typeof opts.excerpt === 'function') { - return opts.excerpt(file, opts); - } - - const sep = file.data.excerpt_separator || opts.excerpt_separator; - if (sep == null && (opts.excerpt === false || opts.excerpt == null)) { - return file; - } - - const delimiter = typeof opts.excerpt === 'string' ? opts.excerpt : sep || opts.delimiters[0]; - - // if enabled, get the excerpt defined after front-matter - const idx = file.content.indexOf(delimiter); - if (idx !== -1) { - file.excerpt = file.content.slice(0, idx); - } - - return file; -} diff --git a/packages/markdown-support/src/gray-matter/lib/parse.js b/packages/markdown-support/src/gray-matter/lib/parse.js deleted file mode 100644 index 3e892d599..000000000 --- a/packages/markdown-support/src/gray-matter/lib/parse.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -import getEngine from './engine.js'; -import defaults from './defaults.js'; - -export default function (language, str, options) { - const opts = defaults(options); - const engine = getEngine(language, opts); - if (typeof engine.parse !== 'function') { - throw new TypeError('expected "' + language + '.parse" to be a function'); - } - return engine.parse(str, opts); -} diff --git a/packages/markdown-support/src/gray-matter/lib/stringify.js b/packages/markdown-support/src/gray-matter/lib/stringify.js deleted file mode 100644 index 03e74806c..000000000 --- a/packages/markdown-support/src/gray-matter/lib/stringify.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -import typeOf from 'kind-of'; -import getEngine from './engine.js'; -import defaults from './defaults.js'; - -export default function (file, data, options) { - if (data == null && options == null) { - switch (typeOf(file)) { - case 'object': - data = file.data; - options = {}; - break; - case 'string': - return file; - default: { - throw new TypeError('expected file to be a string or object'); - } - } - } - - const str = file.content; - const opts = defaults(options); - if (data == null) { - if (!opts.data) return file; - data = opts.data; - } - - const language = file.language || opts.language; - const engine = getEngine(language, opts); - if (typeof engine.stringify !== 'function') { - throw new TypeError('expected "' + language + '.stringify" to be a function'); - } - - data = Object.assign({}, file.data, data); - const open = opts.delimiters[0]; - const close = opts.delimiters[1]; - const matter = engine.stringify(data, options).trim(); - let buf = ''; - - if (matter !== '{}') { - buf = newline(open) + newline(matter) + newline(close); - } - - if (typeof file.excerpt === 'string' && file.excerpt !== '') { - if (str.indexOf(file.excerpt.trim()) === -1) { - buf += newline(file.excerpt) + newline(close); - } - } - - return buf + newline(str); -} - -function newline(str) { - return str.slice(-1) !== '\n' ? str + '\n' : str; -} diff --git a/packages/markdown-support/src/gray-matter/lib/to-file.js b/packages/markdown-support/src/gray-matter/lib/to-file.js deleted file mode 100644 index 47731d4f8..000000000 --- a/packages/markdown-support/src/gray-matter/lib/to-file.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -import typeOf from 'kind-of'; -import stringify from './stringify.js'; -import * as utils from './utils.js'; - -/** - * Normalize the given value to ensure an object is returned - * with the expected properties. - */ - -export default function (file) { - if (typeOf(file) !== 'object') { - file = { content: file }; - } - - if (typeOf(file.data) !== 'object') { - file.data = {}; - } - - // if file was passed as an object, ensure that - // "file.content" is set - if (file.contents && file.content == null) { - file.content = file.contents; - } - - // set non-enumerable properties on the file object - utils.define(file, 'orig', utils.toBuffer(file.content)); - utils.define(file, 'language', file.language || ''); - utils.define(file, 'matter', file.matter || ''); - utils.define(file, 'stringify', function (data, options) { - if (options && options.language) { - file.language = options.language; - } - return stringify(file, data, options); - }); - - // strip BOM and ensure that "file.content" is a string - file.content = utils.toString(file.content); - file.isEmpty = false; - file.excerpt = ''; - return file; -} diff --git a/packages/markdown-support/src/gray-matter/lib/utils.js b/packages/markdown-support/src/gray-matter/lib/utils.js deleted file mode 100644 index 825f95f43..000000000 --- a/packages/markdown-support/src/gray-matter/lib/utils.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -import stripBom from 'strip-bom-string'; -import typeOf from 'kind-of'; - -export function define(obj, key, val) { - Reflect.defineProperty(obj, key, { - enumerable: false, - configurable: true, - writable: true, - value: val, - }); -} - -/** - * Returns true if `val` is a buffer - */ - -export function isBuffer(val) { - return typeOf(val) === 'buffer'; -} - -/** - * Returns true if `val` is an object - */ - -export function isObject(val) { - return typeOf(val) === 'object'; -} - -/** - * Cast `input` to a buffer - */ - -export function toBuffer(input) { - return typeof input === 'string' ? Buffer.from(input) : input; -} - -/** - * Cast `val` to a string. - */ - -export function toString(input) { - if (isBuffer(input)) return stripBom(String(input)); - if (typeof input !== 'string') { - throw new TypeError('expected input to be a string or buffer'); - } - return stripBom(input); -} - -/** - * Cast `val` to an array. - */ - -export function arrayify(val) { - return val ? (Array.isArray(val) ? val : [val]) : []; -} - -/** - * Returns true if `str` starts with `substr`. - */ - -export function startsWith(str, substr, len) { - if (typeof len !== 'number') len = substr.length; - return str.slice(0, len) === substr; -} diff --git a/packages/markdown-support/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md similarity index 100% rename from packages/markdown-support/CHANGELOG.md rename to packages/markdown/remark/CHANGELOG.md diff --git a/packages/markdown-support/package.json b/packages/markdown/remark/package.json similarity index 74% rename from packages/markdown-support/package.json rename to packages/markdown/remark/package.json index 6b3c043f7..ce7c9d3ac 100644 --- a/packages/markdown-support/package.json +++ b/packages/markdown/remark/package.json @@ -1,12 +1,12 @@ { - "name": "@astrojs/markdown-support", + "name": "@astrojs/markdown-remark", "version": "0.3.1", "main": "./dist/index.js", "type": "module", "repository": { "type": "git", "url": "https://github.com/snowpackjs/astro.git", - "directory": "packages/markdown-support" + "directory": "packages/markdown/remark" }, "exports": { ".": "./dist/index.js" @@ -23,10 +23,13 @@ "github-slugger": "^1.3.0", "mdast-util-mdx-expression": "^1.1.0", "micromark-extension-mdx-expression": "^1.0.0", + "micromark-extension-mdx-jsx": "^1.0.0", + "mdast-util-mdx-jsx": "^1.1.0", "rehype-raw": "^6.0.0", "rehype-stringify": "^9.0.1", "remark-footnotes": "^4.0.1", "remark-gfm": "^2.0.0", + "remark-mdx": "^1.6.22", "remark-parse": "^10.0.0", "remark-rehype": "^9.0.0", "remark-slug": "^7.0.0", @@ -34,7 +37,9 @@ "unist-util-map": "^3.0.0", "unist-util-visit": "^4.0.0" }, + "//": "Important that gray-matter is in devDependencies so it gets bundled by esbuild!", "devDependencies": { - "@types/github-slugger": "^1.3.0" + "@types/github-slugger": "^1.3.0", + "gray-matter": "^4.0.3" } } diff --git a/packages/markdown-support/src/codeblock.ts b/packages/markdown/remark/src/codeblock.ts similarity index 97% rename from packages/markdown-support/src/codeblock.ts rename to packages/markdown/remark/src/codeblock.ts index 3f0c2894d..3e471ed65 100644 --- a/packages/markdown-support/src/codeblock.ts +++ b/packages/markdown/remark/src/codeblock.ts @@ -23,7 +23,7 @@ export function rehypeCodeBlock() { const escapeCode = (code: Element): void => { code.children = code.children.map((child) => { if (child.type === 'text') { - return { ...child, value: child.value.replace(/\{/g, 'ASTRO_ESCAPED_LEFT_CURLY_BRACKET\0') }; + return { ...child, value: child.value.replace(/\{/g, '{') }; } return child; }); diff --git a/packages/markdown-support/src/index.ts b/packages/markdown/remark/src/index.ts similarity index 63% rename from packages/markdown-support/src/index.ts rename to packages/markdown/remark/src/index.ts index da0d81592..dc043bd7a 100644 --- a/packages/markdown-support/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -4,16 +4,17 @@ import createCollectHeaders from './rehype-collect-headers.js'; import scopedStyles from './remark-scoped-styles.js'; import { remarkExpressions, loadRemarkExpressions } from './remark-expressions.js'; import rehypeExpressions from './rehype-expressions.js'; +import { remarkJsx, loadRemarkJsx } from './remark-jsx.js'; +import rehypeJsx from './rehype-jsx.js'; import { remarkCodeBlock, rehypeCodeBlock } from './codeblock.js'; +import remarkSlug from './remark-slug.js'; import { loadPlugins } from './load-plugins.js'; -import raw from 'rehype-raw'; import { unified } from 'unified'; import markdown from 'remark-parse'; import markdownToHtml from 'remark-rehype'; import rehypeStringify from 'rehype-stringify'; -import remarkSlug from 'remark-slug'; -import matter from './gray-matter/index.js'; +import matter from 'gray-matter'; export { AstroMarkdownOptions, MarkdownRenderingOptions }; @@ -24,29 +25,29 @@ export async function renderMarkdownWithFrontmatter(contents: string, opts?: Mar return { ...value, frontmatter }; } +export const DEFAULT_REMARK_PLUGINS = [ + 'remark-gfm', + 'remark-footnotes', + // TODO: reenable smartypants! + '@silvenon/remark-smartypants' +] + +export const DEFAULT_REHYPE_PLUGINS = [ + // empty +] + /** Shared utility for rendering markdown */ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOptions | null) { - const { $: { scopedClassName = null } = {}, footnotes: useFootnotes = true, gfm: useGfm = true, remarkPlugins = [], rehypePlugins = [] } = opts ?? {}; + const { remarkPlugins = DEFAULT_REMARK_PLUGINS, rehypePlugins = DEFAULT_REHYPE_PLUGINS } = opts ?? {}; const { headers, rehypeCollectHeaders } = createCollectHeaders(); - await loadRemarkExpressions(); // Vite bug: dynamically import() these because of CJS interop (this will cache) + await Promise.all([loadRemarkExpressions(), loadRemarkJsx()]); // Vite bug: dynamically import() these because of CJS interop (this will cache) let parser = unified() .use(markdown) - .use(remarkSlug) - .use([remarkExpressions, { addResult: true }]); + .use([remarkJsx]) + .use([remarkExpressions]) - if (remarkPlugins.length === 0) { - if (useGfm) { - remarkPlugins.push('remark-gfm'); - } - - if (useFootnotes) { - remarkPlugins.push('remark-footnotes'); - } - - remarkPlugins.push('@silvenon/remark-smartypants'); - } const loadedRemarkPlugins = await Promise.all(loadPlugins(remarkPlugins)); const loadedRehypePlugins = await Promise.all(loadPlugins(rehypePlugins)); @@ -54,25 +55,25 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp parser.use(plugin, opts); }); - if (scopedClassName) { - parser.use(scopedStyles(scopedClassName)); - } + // if (scopedClassName) { + // parser.use(scopedStyles(scopedClassName)); + // } parser.use(remarkCodeBlock); - parser.use(markdownToHtml, { allowDangerousHtml: true, passThrough: ['raw', 'mdxTextExpression'] }); - parser.use(rehypeExpressions); + parser.use(markdownToHtml, { allowDangerousHtml: true, passThrough: ['raw', 'mdxTextExpression', 'mdxJsxTextElement', 'mdxJsxFlowElement']}); loadedRehypePlugins.forEach(([plugin, opts]) => { parser.use(plugin, opts); }); + + parser.use(rehypeJsx).use(rehypeExpressions) let result: string; try { const vfile = await parser - .use(raw) .use(rehypeCollectHeaders) .use(rehypeCodeBlock) - .use(rehypeStringify, { entities: { useNamedReferences: true } }) + .use(rehypeStringify, { allowParseErrors: true, preferUnquoted: true, allowDangerousHtml: true }) .process(content); result = vfile.toString(); } catch (err) { @@ -80,7 +81,9 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp } return { - astro: { headers, source: content, html: result.toString() }, - content: result.toString(), + metadata: { headers, source: content, html: result.toString() }, + code: result.toString(), }; } + +export default renderMarkdownWithFrontmatter; diff --git a/packages/markdown-support/src/load-plugins.ts b/packages/markdown/remark/src/load-plugins.ts similarity index 100% rename from packages/markdown-support/src/load-plugins.ts rename to packages/markdown/remark/src/load-plugins.ts diff --git a/packages/markdown-support/src/rehype-collect-headers.ts b/packages/markdown/remark/src/rehype-collect-headers.ts similarity index 100% rename from packages/markdown-support/src/rehype-collect-headers.ts rename to packages/markdown/remark/src/rehype-collect-headers.ts diff --git a/packages/markdown-support/src/rehype-expressions.ts b/packages/markdown/remark/src/rehype-expressions.ts similarity index 100% rename from packages/markdown-support/src/rehype-expressions.ts rename to packages/markdown/remark/src/rehype-expressions.ts diff --git a/packages/markdown/remark/src/rehype-jsx.ts b/packages/markdown/remark/src/rehype-jsx.ts new file mode 100644 index 000000000..dab12f2e6 --- /dev/null +++ b/packages/markdown/remark/src/rehype-jsx.ts @@ -0,0 +1,27 @@ +import { map } from 'unist-util-map'; + +const MDX_ELEMENTS = new Set(['mdxJsxFlowElement', 'mdxJsxTextElement']); +export default function rehypeJsx(): any { + return function (node: any): any { + return map(node, (child) => { + if (child.type === 'element') { + return { ...child, tagName: `${child.tagName}` } + } + if (MDX_ELEMENTS.has(child.type)) { + return { + ...child, + type: 'element', + tagName: `${child.name}`, + properties: child.attributes.reduce((acc, entry) => { + let attr = entry.value; + if (attr && typeof attr === 'object') { + attr = `{${attr.value}}` + } + return Object.assign(acc, { [entry.name]: attr }); + }, {}) + }; + } + return child; + }); + }; +} diff --git a/packages/markdown-support/src/remark-expressions.ts b/packages/markdown/remark/src/remark-expressions.ts similarity index 100% rename from packages/markdown-support/src/remark-expressions.ts rename to packages/markdown/remark/src/remark-expressions.ts diff --git a/packages/markdown/remark/src/remark-jsx.ts b/packages/markdown/remark/src/remark-jsx.ts new file mode 100644 index 000000000..6750e87d1 --- /dev/null +++ b/packages/markdown/remark/src/remark-jsx.ts @@ -0,0 +1,31 @@ +// Vite bug: dynamically import() modules needed for CJS. Cache in memory to keep side effects +let mdxJsx: any; +let mdxJsxFromMarkdown: any; +let mdxJsxToMarkdown: any; + +export function remarkJsx(this: any, options: any) { + let settings = options || {}; + let data = this.data(); + + add('micromarkExtensions', mdxJsx({})); + add('fromMarkdownExtensions', mdxJsxFromMarkdown); + add('toMarkdownExtensions', mdxJsxToMarkdown); + + function add(field: any, value: any) { + /* istanbul ignore if - other extensions. */ + if (data[field]) data[field].push(value); + else data[field] = [value]; + } +} + +export async function loadRemarkJsx() { + if (!mdxJsx) { + const micromarkMdxJsx = await import('micromark-extension-mdx-jsx'); + mdxJsx = micromarkMdxJsx.mdxJsx; + } + if (!mdxJsxFromMarkdown || !mdxJsxToMarkdown) { + const mdastUtilMdxJsx = await import('mdast-util-mdx-jsx'); + mdxJsxFromMarkdown = mdastUtilMdxJsx.mdxJsxFromMarkdown; + mdxJsxToMarkdown = mdastUtilMdxJsx.mdxJsxToMarkdown; + } +} diff --git a/packages/markdown-support/src/remark-scoped-styles.ts b/packages/markdown/remark/src/remark-scoped-styles.ts similarity index 100% rename from packages/markdown-support/src/remark-scoped-styles.ts rename to packages/markdown/remark/src/remark-scoped-styles.ts diff --git a/packages/markdown/remark/src/remark-slug.ts b/packages/markdown/remark/src/remark-slug.ts new file mode 100644 index 000000000..b7c9c29de --- /dev/null +++ b/packages/markdown/remark/src/remark-slug.ts @@ -0,0 +1,34 @@ +/** + * @typedef {import('mdast').Root} Root + * @typedef {import('hast').Properties} Properties + */ + +import {toString} from 'mdast-util-to-string' +import {visit} from 'unist-util-visit' +import BananaSlug from 'github-slugger' + +const slugs = new BananaSlug() + +/** + * Plugin to add anchors headings using GitHub’s algorithm. + * + * @type {import('unified').Plugin} + */ +export default function remarkSlug() { + return (tree: any) => { + slugs.reset() + visit(tree, (node) => { + console.log(node); + }); + visit(tree, 'heading', (node) => { + const data = node.data || (node.data = {}) + const props = /** @type {Properties} */ ( + data.hProperties || (data.hProperties = {}) + ) + let id = props.id + id = id ? slugs.slug(String(id), true) : slugs.slug(toString(node)) + data.id = id; + props.id = id; + }) + } +} diff --git a/packages/markdown-support/src/types.ts b/packages/markdown/remark/src/types.ts similarity index 65% rename from packages/markdown-support/src/types.ts rename to packages/markdown/remark/src/types.ts index be73db6a5..fb5cdf4ac 100644 --- a/packages/markdown-support/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -4,12 +4,8 @@ export type UnifiedPluginImport = Promise<{ default: unified.Plugin }>; export type Plugin = string | [string, any] | UnifiedPluginImport | [UnifiedPluginImport, any]; export interface AstroMarkdownOptions { - /** Enable or disable footnotes syntax extension */ - footnotes: boolean; - /** Enable or disable GitHub-flavored Markdown syntax extension */ - gfm: boolean; - remarkPlugins: Plugin[]; - rehypePlugins: Plugin[]; + remarkPlugins?: Plugin[]; + rehypePlugins?: Plugin[]; } export interface MarkdownRenderingOptions extends Partial { diff --git a/packages/markdown-support/tsconfig.json b/packages/markdown/remark/tsconfig.json similarity index 100% rename from packages/markdown-support/tsconfig.json rename to packages/markdown/remark/tsconfig.json diff --git a/yarn.lock b/yarn.lock index 874ec14b0..61ffbbbaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -106,10 +106,10 @@ "@algolia/logger-common" "4.10.5" "@algolia/requester-common" "4.10.5" -"@astrojs/compiler@^0.1.0-canary.36": - version "0.1.0-canary.36" - resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-0.1.0-canary.36.tgz#097b364e28093cca883e73797db9e8d1407e4dab" - integrity sha512-T4pTA+GJQoMzfJYb9SQnQEQjqUZo1LgcLNFNkziZijAANnbCF6GBGg5d1IWCyHuMaCKvPUrAWBi0olLzzuracw== +"@astrojs/compiler@^0.1.0-canary.37": + version "0.1.0-canary.37" + resolved "https://registry.yarnpkg.com/@astrojs/compiler/-/compiler-0.1.0-canary.37.tgz#12a601c6cd1abd5644ad658b290e6cb0fc3fabcf" + integrity sha512-6E1KsO8jk3TfswWe5ulYSWNF26NIQM9QPO/ixxFG2rIgA9Q2GUq2KahdxexDroz8JYqgjjOtjNgpIEG6zqm82A== dependencies: typescript "^4.3.5" @@ -120,7 +120,7 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== @@ -132,6 +132,28 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== +"@babel/core@7.12.9": + version "7.12.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" + integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.5" + "@babel/helper-module-transforms" "^7.12.1" + "@babel/helpers" "^7.12.5" + "@babel/parser" "^7.12.7" + "@babel/template" "^7.12.7" + "@babel/traverse" "^7.12.9" + "@babel/types" "^7.12.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.19" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/core@^7.1.0", "@babel/core@^7.15.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.0.tgz#749e57c68778b73ad8082775561f67f5196aafa8" @@ -153,6 +175,15 @@ semver "^6.3.0" source-map "^0.5.0" +"@babel/generator@^7.12.5", "@babel/generator@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" + integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== + dependencies: + "@babel/types" "^7.15.4" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/generator@^7.14.8", "@babel/generator@^7.15.0", "@babel/generator@^7.7.2": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.0.tgz#a7d0c172e0d814974bad5aa77ace543b97917f15" @@ -197,6 +228,15 @@ "@babel/template" "^7.14.5" "@babel/types" "^7.14.5" +"@babel/helper-function-name@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" + integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== + dependencies: + "@babel/helper-get-function-arity" "^7.15.4" + "@babel/template" "^7.15.4" + "@babel/types" "^7.15.4" + "@babel/helper-get-function-arity@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" @@ -204,6 +244,13 @@ dependencies: "@babel/types" "^7.14.5" +"@babel/helper-get-function-arity@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" + integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== + dependencies: + "@babel/types" "^7.15.4" + "@babel/helper-hoist-variables@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" @@ -211,6 +258,13 @@ dependencies: "@babel/types" "^7.14.5" +"@babel/helper-hoist-variables@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" + integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== + dependencies: + "@babel/types" "^7.15.4" + "@babel/helper-member-expression-to-functions@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.0.tgz#0ddaf5299c8179f27f37327936553e9bba60990b" @@ -218,6 +272,13 @@ dependencies: "@babel/types" "^7.15.0" +"@babel/helper-member-expression-to-functions@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" + integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== + dependencies: + "@babel/types" "^7.15.4" + "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" @@ -225,6 +286,27 @@ dependencies: "@babel/types" "^7.14.5" +"@babel/helper-module-imports@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" + integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-module-transforms@^7.12.1": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz#962cc629a7f7f9a082dd62d0307fa75fe8788d7c" + integrity sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw== + dependencies: + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.14.9" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + "@babel/helper-module-transforms@^7.15.0": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.0.tgz#679275581ea056373eddbe360e1419ef23783b08" @@ -246,6 +328,18 @@ dependencies: "@babel/types" "^7.14.5" +"@babel/helper-optimise-call-expression@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" + integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== + dependencies: + "@babel/types" "^7.15.4" + +"@babel/helper-plugin-utils@7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" + integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== + "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" @@ -261,6 +355,16 @@ "@babel/traverse" "^7.15.0" "@babel/types" "^7.15.0" +"@babel/helper-replace-supers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" + integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.15.4" + "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + "@babel/helper-simple-access@^7.14.8": version "7.14.8" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz#82e1fec0644a7e775c74d305f212c39f8fe73924" @@ -268,6 +372,13 @@ dependencies: "@babel/types" "^7.14.8" +"@babel/helper-simple-access@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" + integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== + dependencies: + "@babel/types" "^7.15.4" + "@babel/helper-split-export-declaration@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" @@ -275,6 +386,13 @@ dependencies: "@babel/types" "^7.14.5" +"@babel/helper-split-export-declaration@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" + integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== + dependencies: + "@babel/types" "^7.15.4" + "@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.8", "@babel/helper-validator-identifier@^7.14.9": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" @@ -285,6 +403,15 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== +"@babel/helpers@^7.12.5": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" + integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== + dependencies: + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + "@babel/helpers@^7.14.8": version "7.15.3" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.3.tgz#c96838b752b95dcd525b4e741ed40bb1dc2a1357" @@ -308,11 +435,25 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.3.tgz#3416d9bea748052cfcb63dbcc27368105b1ed862" integrity sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA== +"@babel/parser@^7.12.7", "@babel/parser@^7.15.4": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.6.tgz#043b9aa3c303c0722e5377fef9197f4cf1796549" + integrity sha512-S/TSCcsRuCkmpUuoWijua0Snt+f3ewU/8spLo+4AXJCZfT0bVCzLD5MuOKdrx0mlAptbKzn5AdgEIIKXxXkz9Q== + "@babel/parser@^7.14.5", "@babel/parser@^7.4.5": version "7.14.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.8.tgz#66fd41666b2d7b840bd5ace7f7416d5ac60208d4" integrity sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA== +"@babel/plugin-proposal-object-rest-spread@7.12.1": + version "7.12.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" + integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.0" + "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -348,6 +489,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-jsx@7.12.1": + version "7.12.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" + integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx@^7.10.4", "@babel/plugin-syntax-jsx@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz#000e2e25d8673cce49300517a3eda44c263e4201" @@ -376,7 +524,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -411,6 +559,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" +"@babel/plugin-transform-parameters@^7.12.1": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz#5f2285cc3160bf48c8502432716b48504d29ed62" + integrity sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + "@babel/plugin-transform-react-jsx@^7.14.5": version "7.14.9" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.9.tgz#3314b2163033abac5200a869c4de242cd50a914c" @@ -429,6 +584,15 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/template@^7.12.7", "@babel/template@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" + integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + "@babel/template@^7.14.5", "@babel/template@^7.3.3": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" @@ -453,6 +617,21 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.12.9", "@babel/traverse@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" + integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-function-name" "^7.15.4" + "@babel/helper-hoist-variables" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + debug "^4.1.0" + globals "^11.1.0" + "@babel/traverse@^7.4.5": version "7.14.8" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.8.tgz#c0253f02677c5de1a8ff9df6b0aacbec7da1a8ce" @@ -476,6 +655,14 @@ "@babel/helper-validator-identifier" "^7.14.8" to-fast-properties "^2.0.0" +"@babel/types@^7.12.7", "@babel/types@^7.15.4": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" + integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + to-fast-properties "^2.0.0" + "@babel/types@^7.14.9", "@babel/types@^7.15.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.15.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.0.tgz#61af11f2286c4e9c69ca8deb5f4375a73c72dcbd" @@ -1663,6 +1850,11 @@ globby "^11.0.0" read-yaml-file "^1.1.0" +"@mdx-js/util@1.6.22": + version "1.6.22" + resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" + integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1741,6 +1933,33 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" +"@octokit/action@^3.15.4": + version "3.15.8" + resolved "https://registry.yarnpkg.com/@octokit/action/-/action-3.15.8.tgz#6e89b4fab5f4d44740f3984d432352e402cbb0cb" + integrity sha512-PgVlqD9H9T0SNIaErEOBK8rXJ6kPvbJPqKy3kZ6NGQV1ekrlstv3txut17MtVzQ7NLPRncwVX47Lgi1usN7xcQ== + dependencies: + "@octokit/auth-action" "^1.2.0" + "@octokit/core" "^3.0.0" + "@octokit/plugin-paginate-rest" "^2.2.4" + "@octokit/plugin-rest-endpoint-methods" "5.10.4" + "@octokit/types" "^6.16.1" + proxy-agent "^5.0.0" + +"@octokit/auth-action@^1.2.0": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@octokit/auth-action/-/auth-action-1.3.3.tgz#20004fbf0b4a7012f4f7fc2c54d263749239cd5f" + integrity sha512-8v4c/pw6HTxsF7pCgJoox/q4KKov4zkgLxEGGqLOZPSZaHf1LqdLlj5m5x5c1bKNn38uQXNvJKEnKX1qJlGeQQ== + dependencies: + "@octokit/auth-token" "^2.4.0" + "@octokit/types" "^6.0.3" + +"@octokit/auth-token@^2.4.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== + dependencies: + "@octokit/types" "^6.0.3" + "@octokit/auth-token@^2.4.4": version "2.4.5" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.5.tgz#568ccfb8cb46f36441fac094ce34f7a875b197f3" @@ -1748,7 +1967,7 @@ dependencies: "@octokit/types" "^6.0.3" -"@octokit/core@^3.5.0": +"@octokit/core@^3.0.0", "@octokit/core@^3.5.0": version "3.5.1" resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== @@ -1779,6 +1998,11 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" +"@octokit/openapi-types@^10.2.2": + version "10.2.2" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-10.2.2.tgz#6c1c839d7d169feabaf1d2a69c79439c75d979cd" + integrity sha512-EVcXQ+ZrC04cg17AMg1ofocWMxHDn17cB66ZHgYc0eUwjFtxS0oBzkyw2VqIrHBwVgtfoYrq1WMQfQmMjUwthw== + "@octokit/openapi-types@^9.5.0": version "9.7.0" resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-9.7.0.tgz#9897cdefd629cd88af67b8dbe2e5fb19c63426b2" @@ -1789,6 +2013,13 @@ resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== +"@octokit/plugin-paginate-rest@^2.2.4": + version "2.16.3" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.3.tgz#6dbf74a12a53e04da6ca731d4c93f20c0b5c6fe9" + integrity sha512-kdc65UEsqze/9fCISq6BxLzeB9qf0vKvKojIfzgwf4tEF+Wy6c9dXnPFE6vgpoDFB1Z5Jek5WFVU6vL1w22+Iw== + dependencies: + "@octokit/types" "^6.28.1" + "@octokit/plugin-paginate-rest@^2.6.2": version "2.15.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.15.1.tgz#264189dd3ce881c6c33758824aac05a4002e056a" @@ -1801,6 +2032,14 @@ resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== +"@octokit/plugin-rest-endpoint-methods@5.10.4": + version "5.10.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.10.4.tgz#97e85eb7375e30b9bf193894670f9da205e79408" + integrity sha512-Dh+EAMCYR9RUHwQChH94Skl0lM8Fh99auT8ggck/xTzjJrwVzvsd0YH68oRPqp/HxICzmUjLfaQ9sy1o1sfIiA== + dependencies: + "@octokit/types" "^6.28.1" + deprecation "^2.3.1" + "@octokit/plugin-rest-endpoint-methods@5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.8.0.tgz#33b342fe41f2603fdf8b958e6652103bb3ea3f3b" @@ -1847,6 +2086,13 @@ dependencies: "@octokit/openapi-types" "^9.5.0" +"@octokit/types@^6.28.1": + version "6.28.1" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.28.1.tgz#ab990d1fe952226055e81c7650480e6bacfb877c" + integrity sha512-XlxDoQLFO5JnFZgKVQTYTvXRsQFfr/GwDUU108NJ9R5yFPkA2qXhTJjYuul3vE4eLXP40FA2nysOu2zd6boE+w== + dependencies: + "@octokit/openapi-types" "^10.2.2" + "@rollup/pluginutils@^4.1.1": version "4.1.1" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec" @@ -2445,7 +2691,7 @@ add-stream@^1.0.0: resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -agent-base@6, agent-base@^6.0.2: +agent-base@6, agent-base@^6.0.0, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== @@ -2706,6 +2952,13 @@ assert@^2.0.0: object-is "^1.0.1" util "^0.12.0" +ast-types@^0.13.2: + version "0.13.4" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.4.tgz#ee0d77b343263965ecc3fb62da16e7222b2b6782" + integrity sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== + dependencies: + tslib "^2.0.1" + astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" @@ -3071,7 +3324,7 @@ byte-size@^7.0.0: resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-7.0.1.tgz#b1daf3386de7ab9d706b941a748dbfc71130dee3" integrity sha512-crQdqyCwhokxwV1UyDzLZanhkugAgft7vt0qbbdt60C6Zf3CAiGmtUCylbtYwrU6loOUw3euGrNtW1J651ot1A== -bytes@^3.0.0: +bytes@3.1.0, bytes@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== @@ -3194,6 +3447,11 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +ccount@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" + integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== + ccount@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.0.tgz#3d6fb55803832766a24c6f339abc507297eb5d25" @@ -3261,16 +3519,31 @@ character-entities-html4@^2.0.0: resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.0.0.tgz#55fcf3ed00febfe41f8f6a5709d25ab8ed73a449" integrity sha512-dwT2xh5ZhUAjyP96k57ilMKoTQyASaw9IAMR9U5c1lCu2RUni6O6jxfpUEdO2RcPT6TJFvr8pqsbami4Jk+2oA== +character-entities-legacy@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" + integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== + character-entities-legacy@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-2.0.0.tgz#57f4d00974c696e8f74e9f493e7fcb75b44d7ee7" integrity sha512-YwaEtEvWLpFa6Wh3uVLrvirA/ahr9fki/NUd/Bd4OR6EdJ8D22hovYQEOUCBfQfcqnC4IAMGMsHXY1eXgL4ZZA== +character-entities@^1.0.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" + integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== + character-entities@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.0.tgz#508355fcc8c73893e0909efc1a44d28da2b6fdf3" integrity sha512-oHqMj3eAuJ77/P5PaIRcqk+C3hdfNwyCD2DAUcD5gyXkegAuF2USC40CEqPscDk4I8FRGMTojGJQkXDsN5QlJA== +character-reference-invalid@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" + integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== + character-reference-invalid@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.0.tgz#a0bdeb89c051fe7ed5d3158b2f06af06984f2813" @@ -3451,6 +3724,11 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +collapse-white-space@^1.0.2: + version "1.0.6" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287" + integrity sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ== + collect-v8-coverage@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" @@ -3889,6 +4167,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-uri-to-buffer@3: + version "3.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" + integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== + data-urls@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b" @@ -4010,6 +4293,16 @@ defined@^1.0.0: resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= +degenerator@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-3.0.1.tgz#7ef78ec0c8577a544477308ddf1d2d6e88d51f5b" + integrity sha512-LFsIFEeLPlKvAKXu7j3ssIG6RT0TbI7/GhsqrI0DnHASEQjXQ0LUSYcjJteGgRGmZbl1TnMSxpNQIAiJ7Du5TQ== + dependencies: + ast-types "^0.13.2" + escodegen "^1.8.1" + esprima "^4.0.0" + vm2 "^3.9.3" + degit@^2.8.4: version "2.8.4" resolved "https://registry.yarnpkg.com/degit/-/degit-2.8.4.tgz#3bb9c5c00f157c44724dd4a50724e4aa75a54d38" @@ -4421,6 +4714,18 @@ escape-string-regexp@^5.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== +escodegen@^1.8.1: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -4551,7 +4856,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: +estraverse@^4.1.1, estraverse@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== @@ -4561,6 +4866,11 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== +estree-util-is-identifier-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/estree-util-is-identifier-name/-/estree-util-is-identifier-name-2.0.0.tgz#e2d3d2ae3032c017b2112832bfc5d8ba938c8010" + integrity sha512-aXXZFVMnBBDRP81vS4YtAYJ0hUkgEsXea7lNKWCOeaAquGb1Jm2rcONPB5fpzwgbNxulTvrWuKnp9UElUGAKeQ== + estree-util-value-to-estree@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/estree-util-value-to-estree/-/estree-util-value-to-estree-1.2.0.tgz#5ee543913e07f3e5395a59cb42011133ef008215" @@ -4654,6 +4964,13 @@ expect@^27.1.0: jest-message-util "^27.1.0" jest-regex-util "^27.0.6" +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + extend@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-2.0.2.tgz#1b74985400171b85554894459c978de6ef453ab7" @@ -4774,6 +5091,11 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +file-uri-to-path@2: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz#7b415aeba227d575851e0a5b0c640d7656403fba" + integrity sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg== + file-url@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/file-url/-/file-url-4.0.0.tgz#6fe05262d3187da70bc69889091932b6bc7df270" @@ -5003,6 +5325,14 @@ fstream@^1.0.0, fstream@^1.0.12: mkdirp ">=0.5 0" rimraf "2" +ftp@^0.3.10: + version "0.3.10" + resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" + integrity sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0= + dependencies: + readable-stream "1.1.x" + xregexp "2.0.0" + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -5034,7 +5364,7 @@ generic-names@^2.0.1: dependencies: loader-utils "^1.1.0" -gensync@^1.0.0-beta.2: +gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== @@ -5090,6 +5420,18 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== +get-uri@3: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-3.0.2.tgz#f0ef1356faabc70e1f9404fa3b66b2ba9bfc725c" + integrity sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg== + dependencies: + "@tootallnate/once" "1" + data-uri-to-buffer "3" + debug "4" + file-uri-to-path "2" + fs-extra "^8.1.0" + ftp "^0.3.10" + getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -5232,6 +5574,16 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +gray-matter@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" + integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q== + dependencies: + js-yaml "^3.13.1" + kind-of "^6.0.2" + section-matter "^1.0.0" + strip-bom-string "^1.0.0" + handlebars@^4.7.6: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" @@ -5569,6 +5921,17 @@ http-equiv-refresh@^1.0.0: resolved "https://registry.yarnpkg.com/http-equiv-refresh/-/http-equiv-refresh-1.0.0.tgz#8ec538866042be5f3f7afa737d198d94beb1b07b" integrity sha1-jsU4hmBCvl8/evpzfRmNlL6xsHs= +http-errors@1.7.3, http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + http-errors@^1.6.3, http-errors@^1.7.3, http-errors@~1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" @@ -5590,18 +5953,7 @@ http-errors@~1.6.2: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-proxy-agent@^4.0.1: +http-proxy-agent@^4.0.0, http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== @@ -5619,6 +5971,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +https-proxy-agent@5, https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + https-proxy-agent@^2.2.1: version "2.2.4" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" @@ -5627,14 +5987,6 @@ https-proxy-agent@^2.2.1: agent-base "^4.3.0" debug "^3.1.0" -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - human-id@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/human-id/-/human-id-1.0.2.tgz#e654d4b2b0d8b07e45da9f6020d8af17ec0a5df3" @@ -5818,11 +6170,24 @@ ip@^1.1.5: resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= +is-alphabetical@1.0.4, is-alphabetical@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" + integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== + is-alphabetical@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.0.tgz#ef6e2caea57c63450fffc7abb6cbdafc5eb96e96" integrity sha512-5OV8Toyq3oh4eq6sbWTYzlGdnMT/DPI5I0zxUBxjiigQsZycpkKF3kskkao3JyYGuYDHvhgJF+DrjMQp9SX86w== +is-alphanumerical@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" + integrity sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A== + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-alphanumerical@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.0.tgz#0fbfeb6a72d21d91143b3d182bf6cf5909ee66f6" @@ -5914,11 +6279,21 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" +is-decimal@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" + integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== + is-decimal@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.0.tgz#db1140337809fd043a056ae40a9bd1cdc563034c" integrity sha512-QfrfjQV0LjoWQ1K1XSoEZkTAzSa14RKVMa5zg3SdAfzEmQzRM4+tbSFWb78creCeA9rNBzaZal92opi1TwPWZw== +is-extendable@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -5965,6 +6340,11 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-hexadecimal@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" + integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== + is-hexadecimal@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.0.tgz#8e1ec9f48fe3eabd90161109856a23e0907a65d5" @@ -6126,11 +6506,21 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= +is-whitespace-character@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz#0858edd94a95594c7c9dd0b5c174ec6e45ee4aa7" + integrity sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w== + is-windows@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== +is-word-character@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.4.tgz#ce0e73216f98599060592f62ff31354ddbeb0230" + integrity sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA== + is@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/is/-/is-3.3.0.tgz#61cff6dd3c4193db94a3d62582072b44e5645d79" @@ -6777,7 +7167,7 @@ keygrip@~1.1.0: dependencies: tsscmp "1.0.6" -kind-of@^6.0.2, kind-of@^6.0.3: +kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== @@ -7252,6 +7642,11 @@ map-stream@~0.1.0: resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= +markdown-escapes@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" + integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== + markdown-table@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.1.tgz#88c48957aaf2a8014ccb2ba026776a1d736fe3dc" @@ -7357,6 +7752,20 @@ mdast-util-mdx-expression@^1.1.0: "@types/estree-jsx" "^0.0.1" strip-indent "^4.0.0" +mdast-util-mdx-jsx@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-1.1.0.tgz#e44bf620c3d218b0d9d836b30927098f1c080d72" + integrity sha512-iPeyjvvPU7biH1bw/1VM9PLSM9ZXy7409RRB4GKMWl2CASjwz27i6DIHAyjAsYdwdtPXXvX/TJ6AsfWP9M5DSA== + dependencies: + "@types/estree-jsx" "^0.0.1" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.0.0" + parse-entities "^3.0.0" + stringify-entities "^4.0.0" + unist-util-remove-position "^4.0.0" + unist-util-stringify-position "^3.0.0" + vfile-message "^3.0.0" + mdast-util-to-hast@^11.0.0: version "11.2.0" resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-11.2.0.tgz#54d76f1539be21a6559b2aa36e97bb07d2ab43ab" @@ -7585,6 +7994,20 @@ micromark-extension-mdx-expression@^1.0.0: micromark-util-symbol "^1.0.0" micromark-util-types "^1.0.0" +micromark-extension-mdx-jsx@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.0.tgz#1fd643c4ab495d69e05d5c40dd0d767a2224a127" + integrity sha512-NlczaEmtFQ+Zguris0E6Vn9K16RL0WIOnhVdDwTUzNgvJOFkD8niuGYn6ieKQw5+l/VnFFn8F0CanPi8+bwQFw== + dependencies: + "@types/acorn" "^4.0.0" + estree-util-is-identifier-name "^2.0.0" + micromark-factory-mdx-expression "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + vfile-message "^3.0.0" + micromark-factory-destination@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz#fef1cb59ad4997c496f887b6977aa3034a5a277e" @@ -8022,6 +8445,11 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +netmask@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" + integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -8733,6 +9161,30 @@ pa11y@~5.3.1: puppeteer "~1.19.0" semver "~5.7.0" +pac-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz#b718f76475a6a5415c2efbe256c1c971c84f635e" + integrity sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ== + dependencies: + "@tootallnate/once" "1" + agent-base "6" + debug "4" + get-uri "3" + http-proxy-agent "^4.0.1" + https-proxy-agent "5" + pac-resolver "^5.0.0" + raw-body "^2.2.0" + socks-proxy-agent "5" + +pac-resolver@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-5.0.0.tgz#1d717a127b3d7a9407a16d6e1b012b13b9ba8dc0" + integrity sha512-H+/A6KitiHNNW+bxBKREk2MCGSxljfqRX76NjummWEYIat7ldVXRU3dhRIE3iXZ0nvGBk6smv3nntxKkzRL8NA== + dependencies: + degenerator "^3.0.1" + ip "^1.1.5" + netmask "^2.0.1" + pacote@^11.2.6: version "11.3.5" resolved "https://registry.yarnpkg.com/pacote/-/pacote-11.3.5.tgz#73cf1fc3772b533f575e39efa96c50be8c3dc9d2" @@ -8778,6 +9230,18 @@ parse-domain@~0.2.0: resolved "https://registry.yarnpkg.com/parse-domain/-/parse-domain-0.2.2.tgz#188989b1e2e7398bff3c4f4fd7dca157eb51fac1" integrity sha1-GImJseLnOYv/PE9P19yhV+tR+sE= +parse-entities@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" + integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-entities@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-3.0.0.tgz#9ed6d6569b6cfc95ade058d683ddef239dad60dc" @@ -9239,6 +9703,20 @@ protocols@^1.1.0, protocols@^1.4.0: resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== +proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-5.0.0.tgz#d31405c10d6e8431fde96cba7a0c027ce01d633b" + integrity sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g== + dependencies: + agent-base "^6.0.0" + debug "4" + http-proxy-agent "^4.0.0" + https-proxy-agent "^5.0.0" + lru-cache "^5.1.1" + pac-proxy-agent "^5.0.0" + proxy-from-env "^1.0.0" + socks-proxy-agent "^5.0.0" + proxy-from-env@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -9350,6 +9828,16 @@ range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== +raw-body@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" + integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== + dependencies: + bytes "3.1.0" + http-errors "1.7.3" + iconv-lite "0.4.24" + unpipe "1.0.0" + rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -9487,6 +9975,16 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" +readable-stream@1.1.x: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" @@ -9639,6 +10137,42 @@ remark-gfm@^2.0.0: micromark-extension-gfm "^1.0.0" unified "^10.0.0" +remark-mdx@^1.6.22: + version "1.6.22" + resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" + integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== + dependencies: + "@babel/core" "7.12.9" + "@babel/helper-plugin-utils" "7.10.4" + "@babel/plugin-proposal-object-rest-spread" "7.12.1" + "@babel/plugin-syntax-jsx" "7.12.1" + "@mdx-js/util" "1.6.22" + is-alphabetical "1.0.4" + remark-parse "8.0.3" + unified "9.2.0" + +remark-parse@8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" + integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q== + dependencies: + ccount "^1.0.0" + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^2.0.0" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^2.0.0" + vfile-location "^3.0.0" + xtend "^4.0.1" + remark-parse@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.0.tgz#65e2b2b34d8581d36b97f12a2926bb2126961cb4" @@ -9679,6 +10213,11 @@ remark-slug@^7.0.0: unified "^10.0.0" unist-util-visit "^4.0.0" +repeat-string@^1.5.4: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + request@^2.87.0, request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -9755,7 +10294,7 @@ resolve-path@^1.4.0: http-errors "~1.6.2" path-is-absolute "1.0.1" -resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.13.1, resolve@^1.20.0: +resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.13.1, resolve@^1.20.0, resolve@^1.3.2: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -9932,6 +10471,14 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" +section-matter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167" + integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA== + dependencies: + extend-shallow "^2.0.1" + kind-of "^6.0.0" + "semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1, semver@~5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -10109,7 +10656,7 @@ smartwrap@^1.2.3: wcwidth "^1.0.1" yargs "^15.1.0" -socks-proxy-agent@^5.0.0: +socks-proxy-agent@5, socks-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== @@ -10330,6 +10877,11 @@ start-server-and-test@^1.12.6: ps-tree "1.2.0" wait-on "6.0.0" +state-toggle@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" + integrity sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ== + "statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@^1.5.0, statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -10511,6 +11063,11 @@ strip-ansi@^7.0.1: dependencies: ansi-regex "^6.0.1" +strip-bom-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" + integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -10911,6 +11468,16 @@ trim-off-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= +trim-trailing-lines@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz#bd4abbec7cc880462f10b2c8b5ce1d8d1ec7c2c0" + integrity sha512-rjUWSqnfTNrjbB9NQWfPMH/xRK1deHeGsHoVfpxJ++XeYXE0d6B1En37AHfw3jtfTU7dzMzZL2jjpe8Qb5gLIQ== + +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0= + trough@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" @@ -10931,7 +11498,7 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.2.0: +tslib@^2.0.1, tslib@^2.0.3, tslib@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -11089,6 +11656,18 @@ unherit@^1.0.4: inherits "^2.0.0" xtend "^4.0.0" +unified@9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" + integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-buffer "^2.0.0" + is-plain-obj "^2.0.0" + trough "^1.0.0" + vfile "^4.0.0" + unified@^10.0.0, unified@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/unified/-/unified-10.1.0.tgz#4e65eb38fc2448b1c5ee573a472340f52b9346fe" @@ -11180,6 +11759,21 @@ unist-util-position@^4.0.0: resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-4.0.1.tgz#f8484b2da19a897a0180556d160c28633070dbb9" integrity sha512-mgy/zI9fQ2HlbOtTdr2w9lhVaiFUHWQnZrFF2EUoVOqtAUdzqMtNiD99qA5a1IcjWVR8O6aVYE9u7Z2z1v0SQA== +unist-util-remove-position@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" + integrity sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA== + dependencies: + unist-util-visit "^2.0.0" + +unist-util-remove-position@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-4.0.1.tgz#d5b46a7304ac114c8d91990ece085ca7c2c135c8" + integrity sha512-0yDkppiIhDlPrfHELgB+NLQD5mfjup3a8UYclHruTJWmY74je8g+CIFr79x5f6AkmzSwlvKLbs63hC0meOMowQ== + dependencies: + "@types/unist" "^2.0.0" + unist-util-visit "^4.0.0" + unist-util-stringify-position@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" @@ -11279,7 +11873,7 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== -unpipe@~1.0.0: +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= @@ -11413,6 +12007,11 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vfile-location@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" + integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA== + vfile-location@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-4.0.1.tgz#06f2b9244a3565bef91f099359486a08b10d3a95" @@ -11469,6 +12068,11 @@ vite@^2.5.7: optionalDependencies: fsevents "~2.3.2" +vm2@^3.9.3: + version "3.9.3" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.3.tgz#29917f6cc081cc43a3f580c26c5b553fd3c91f40" + integrity sha512-smLS+18RjXYMl9joyJxMNI9l4w7biW8ilSDaVRvFBDwOH8P0BK1ognFQTpg0wyQ6wIKLTblHJvROW692L/E53Q== + vscode-textmate@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e" @@ -11736,7 +12340,12 @@ xmlchars@^2.2.0: resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== -xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.1: +xregexp@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" + integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= + +xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==