From 05f823509595fd47cb1148583bfd72d301584cf9 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 12:02:21 -0500 Subject: [PATCH 01/10] Set up prepublish scripts. --- lerna.json | 2 +- package.json | 3 ++- packages/code-snippets/package.json | 5 +++-- packages/gatsby-remark-code-snippets/package.json | 5 +++-- packages/remark-code-snippets/package.json | 5 +++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index 0e4c8a0..b2fe4c2 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "packages": ["packages/*"], - "version": "0.0.1" + "version": "1.0.0-beta1" } diff --git a/package.json b/package.json index 6c711ab..d3c4704 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "build": "yarn run build:core && yarn run build:remark-plugin && yarn run build:gatsby-plugin", "watch-all": "lerna run watch", "test": "lerna run test -- --silent", - "test:vscode": "lerna run test --stream --no-sort --" + "test:vscode": "lerna run test --stream --no-sort --", + "prepublishOnly": "lerna run prepublishOnly" }, "devDependencies": { "lerna": "^4.0.0" diff --git a/packages/code-snippets/package.json b/packages/code-snippets/package.json index 6b78f32..ab09d15 100644 --- a/packages/code-snippets/package.json +++ b/packages/code-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/code-snippets", - "version": "0.0.1", + "version": "1.0.0-beta1", "description": "Helpers to extract or remove code snippets from code snippets.", "author": "John Rom ", "license": "ISC", @@ -10,7 +10,8 @@ "scripts": { "test": "jest", "build": "rollup -c", - "watch": "rollup -c -w" + "watch": "rollup -c -w", + "prepublishOnly": "yarn build" }, "devDependencies": { "@babel/cli": "^7.15.7", diff --git a/packages/gatsby-remark-code-snippets/package.json b/packages/gatsby-remark-code-snippets/package.json index 377c341..15545eb 100644 --- a/packages/gatsby-remark-code-snippets/package.json +++ b/packages/gatsby-remark-code-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/gatsby-remark-code-snippets", - "version": "1.0.0", + "version": "1.0.0-beta1", "description": "Takes code blocks and extracts snippets from them in GatsbyJS.", "author": "John Rom ", "license": "ISC", @@ -10,7 +10,8 @@ "scripts": { "build": "rollup -c", "watch": "rollup -c -w", - "test": "jest" + "test": "jest", + "prepublishOnly": "yarn build" }, "devDependencies": { "@babel/cli": "^7.15.7", diff --git a/packages/remark-code-snippets/package.json b/packages/remark-code-snippets/package.json index c0b910d..0ec3b27 100644 --- a/packages/remark-code-snippets/package.json +++ b/packages/remark-code-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/remark-code-snippets", - "version": "0.0.1", + "version": "1.0.0-beta1", "description": "Takes code blocks and extracts snippets from them.", "author": "John Rom ", "license": "ISC", @@ -10,7 +10,8 @@ "scripts": { "build": "rollup -c", "watch": "rollup -c -w", - "test": "jest" + "test": "jest", + "prepublishOnly": "yarn build" }, "devDependencies": { "@babel/cli": "^7.15.7", From 0f544039db0af9aae8823f28245dd44cc81336c6 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 12:05:20 -0500 Subject: [PATCH 02/10] Remove prerelease from lerna.json. --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index b2fe4c2..41e3a3a 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "packages": ["packages/*"], - "version": "1.0.0-beta1" + "version": "1.0.0" } From a9e24ad5b292e015a8b27976b3d448320dba3c51 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 12:10:08 -0500 Subject: [PATCH 03/10] Set initial lerna version to 0 to make first release 1. --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 41e3a3a..0e4c8a0 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "packages": ["packages/*"], - "version": "1.0.0" + "version": "0.0.1" } From 95ad5b4bcde64f8adaf57ba511b4b635e5c37010 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 12:14:10 -0500 Subject: [PATCH 04/10] More testing with yarn version semver. --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 0e4c8a0..5daeebb 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "packages": ["packages/*"], - "version": "0.0.1" + "version": "1.0.0-beta" } From ac3ce5b524c9e425daa5c8502e822d6927e3e0e7 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 12:14:39 -0500 Subject: [PATCH 05/10] v1.0.0-beta.0 --- lerna.json | 6 ++++-- packages/code-snippets-website/package.json | 2 +- packages/code-snippets/package.json | 2 +- packages/gatsby-remark-code-snippets/package.json | 2 +- packages/remark-code-snippets/package.json | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lerna.json b/lerna.json index 5daeebb..d4056cc 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,8 @@ { "npmClient": "yarn", "useWorkspaces": true, - "packages": ["packages/*"], - "version": "1.0.0-beta" + "packages": [ + "packages/*" + ], + "version": "1.0.0-beta.0" } diff --git a/packages/code-snippets-website/package.json b/packages/code-snippets-website/package.json index 6005639..68dda02 100644 --- a/packages/code-snippets-website/package.json +++ b/packages/code-snippets-website/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/code-snippets-website", - "version": "0.0.1", + "version": "1.0.0-beta.0", "private": true, "description": "Nmbl Code Snippets - Website", "main": "index.js", diff --git a/packages/code-snippets/package.json b/packages/code-snippets/package.json index ab09d15..34a26fa 100644 --- a/packages/code-snippets/package.json +++ b/packages/code-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/code-snippets", - "version": "1.0.0-beta1", + "version": "1.0.0-beta.0", "description": "Helpers to extract or remove code snippets from code snippets.", "author": "John Rom ", "license": "ISC", diff --git a/packages/gatsby-remark-code-snippets/package.json b/packages/gatsby-remark-code-snippets/package.json index 15545eb..a68978b 100644 --- a/packages/gatsby-remark-code-snippets/package.json +++ b/packages/gatsby-remark-code-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/gatsby-remark-code-snippets", - "version": "1.0.0-beta1", + "version": "1.0.0-beta.0", "description": "Takes code blocks and extracts snippets from them in GatsbyJS.", "author": "John Rom ", "license": "ISC", diff --git a/packages/remark-code-snippets/package.json b/packages/remark-code-snippets/package.json index 0ec3b27..fdc6098 100644 --- a/packages/remark-code-snippets/package.json +++ b/packages/remark-code-snippets/package.json @@ -1,6 +1,6 @@ { "name": "@nmbl/remark-code-snippets", - "version": "1.0.0-beta1", + "version": "1.0.0-beta.0", "description": "Takes code blocks and extracts snippets from them.", "author": "John Rom ", "license": "ISC", From 2dc8dea064067fec57d247ea93597953640bf651 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 12:21:24 -0500 Subject: [PATCH 06/10] Set up correct package dependencies. This makes a lot of sense. --- packages/code-snippets-website/package.json | 2 +- packages/gatsby-remark-code-snippets/package.json | 2 +- packages/remark-code-snippets/package.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/code-snippets-website/package.json b/packages/code-snippets-website/package.json index 68dda02..4ca229d 100644 --- a/packages/code-snippets-website/package.json +++ b/packages/code-snippets-website/package.json @@ -16,6 +16,7 @@ "clean": "gatsby clean" }, "dependencies": { + "@nmbl/gatsby-remark-code-snippets": "1.0.0-beta.0", "@tailwindcss/typography": "^0.4.1", "autoprefixer": "^10.4.0", "gatsby": "^4.2.0", @@ -29,7 +30,6 @@ "react-dom": "^17.0.2" }, "devDependencies": { - "@johnrom/remark-code-import": "0.4.1-beta1", "@types/react": "^17.0.35", "@types/react-dom": "^17.0.11", "postcss": "^8.3.11", diff --git a/packages/gatsby-remark-code-snippets/package.json b/packages/gatsby-remark-code-snippets/package.json index a68978b..6770754 100644 --- a/packages/gatsby-remark-code-snippets/package.json +++ b/packages/gatsby-remark-code-snippets/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@nmbl/remark-code-snippets": "^0.0.1", + "@nmbl/remark-code-snippets": "1.0.0-beta.0", "to-gatsby-remark-plugin": "^0.1.0", "unist-util-visit": "^4.1.0" }, diff --git a/packages/remark-code-snippets/package.json b/packages/remark-code-snippets/package.json index fdc6098..8c1194e 100644 --- a/packages/remark-code-snippets/package.json +++ b/packages/remark-code-snippets/package.json @@ -38,6 +38,7 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", + "@nmbl/code-snippets": "1.0.0-beta.0", "unist-util-visit": "^4.1.0" }, "jest": { From 6d67ebae6dc31b18855fc45d2c2cf3e63efc20a5 Mon Sep 17 00:00:00 2001 From: John Rom Date: Mon, 29 Nov 2021 18:42:30 -0500 Subject: [PATCH 07/10] Test switching to MDX but it hurts. --- helpers/getBaseRollupConfig.js | 28 +- helpers/getBaseRollupConfig.ts | 34 +- package.json | 15 +- .../content/docs/index.md | 1 + .../content/docs/installing.md | 151 ++ .../code-snippets-website/gatsby-config.js | 1225 ++++++++++++++++- .../gatsby-config.src.js | 56 + packages/code-snippets-website/package.json | 8 +- .../code-snippets-website/rollup.config.js | 14 + ..._slug}.tsx => {mdx.frontmatter__slug}.tsx} | 13 +- .../src/code-snippet-definitions.ts | 13 +- .../code-snippets/src/extract-code-snippet.ts | 12 +- .../code-snippets/src/remove-code-snippets.ts | 26 +- .../gatsby-remark-code-snippets/src/index.ts | 2 +- .../tests/integration.test.ts | 8 +- packages/remark-code-snippets/src/index.ts | 2 - .../tests/integration.test.ts | 24 + yarn.lock | 918 +++++++++++- 18 files changed, 2407 insertions(+), 143 deletions(-) create mode 100644 packages/code-snippets-website/content/docs/installing.md create mode 100644 packages/code-snippets-website/gatsby-config.src.js create mode 100644 packages/code-snippets-website/rollup.config.js rename packages/code-snippets-website/src/pages/{{MarkdownRemark.frontmatter__slug}.tsx => {mdx.frontmatter__slug}.tsx} (60%) diff --git a/helpers/getBaseRollupConfig.js b/helpers/getBaseRollupConfig.js index 2abad3b..f6d5f63 100644 --- a/helpers/getBaseRollupConfig.js +++ b/helpers/getBaseRollupConfig.js @@ -7,22 +7,22 @@ import babel from '@rollup/plugin-babel'; import typescript from 'rollup-plugin-typescript2'; import path from 'path'; const extensions = ['.js', '.jsx', '.ts', '.tsx']; -const esmOnlyPackages = [/unist/]; +const esmOnlyPackages = [/unist/, /rehype/, /hast/]; const esmExternal = (source) => !source.startsWith('.') && !path.isAbsolute(source); // we pack ESM-only packages for CJS users, just to be nice. -const cjsExternal = (source) => esmExternal(source) && +export const cjsExternal = (source) => esmExternal(source) && !esmOnlyPackages.find((esmOnlyPackage) => esmOnlyPackage.test(source)); +export const getBaseBuildConfig = (include = ['src/**/*']) => ({ + plugins: [ + // Allows node_modules resolution + resolve({ extensions }), + // Allow bundling cjs modules. Rollup doesn't understand cjs + commonjs(), + // Compile TypeScript/JavaScript files + babel({ extensions, include: ['src/**/*'], babelHelpers: 'runtime' }), + ], +}); export const getBaseRollupConfig = (tsConfig, esmCallback, cjsCallback) => { - const baseBuildConfig = { - plugins: [ - // Allows node_modules resolution - resolve({ extensions }), - // Allow bundling cjs modules. Rollup doesn't understand cjs - commonjs(), - // Compile TypeScript/JavaScript files - babel({ extensions, include: ['src/**/*'], babelHelpers: 'runtime' }), - ], - }; const tsDefinitionsConfig = tsConfig ? [ { @@ -42,11 +42,11 @@ export const getBaseRollupConfig = (tsConfig, esmCallback, cjsCallback) => { : []; return tsDefinitionsConfig.concat([ esmCallback({ - ...baseBuildConfig, + ...getBaseBuildConfig(), external: esmExternal, }), cjsCallback({ - ...baseBuildConfig, + ...getBaseBuildConfig(), external: cjsExternal, }), ]); diff --git a/helpers/getBaseRollupConfig.ts b/helpers/getBaseRollupConfig.ts index 6afea9c..ec7b078 100644 --- a/helpers/getBaseRollupConfig.ts +++ b/helpers/getBaseRollupConfig.ts @@ -12,34 +12,34 @@ type RollupConfigCallback = (config: RollupOptions) => RollupOptions; const extensions = ['.js', '.jsx', '.ts', '.tsx']; -const esmOnlyPackages = [/unist/]; +const esmOnlyPackages = [/unist/, /rehype/, /hast/]; const esmExternal = (source: string) => !source.startsWith('.') && !path.isAbsolute(source); // we pack ESM-only packages for CJS users, just to be nice. -const cjsExternal = (source: string) => +export const cjsExternal = (source: string) => esmExternal(source) && !esmOnlyPackages.find((esmOnlyPackage) => esmOnlyPackage.test(source)); +export const getBaseBuildConfig = (include = ['src/**/*']): RollupOptions => ({ + plugins: [ + // Allows node_modules resolution + resolve({ extensions }), + + // Allow bundling cjs modules. Rollup doesn't understand cjs + commonjs(), + + // Compile TypeScript/JavaScript files + babel({ extensions, include: ['src/**/*'], babelHelpers: 'runtime' }), + ], +}); + export const getBaseRollupConfig = ( tsConfig: string | false, esmCallback: RollupConfigCallback, cjsCallback: RollupConfigCallback ): (RollupOptions | [])[] => { - const baseBuildConfig: RollupOptions = { - plugins: [ - // Allows node_modules resolution - resolve({ extensions }), - - // Allow bundling cjs modules. Rollup doesn't understand cjs - commonjs(), - - // Compile TypeScript/JavaScript files - babel({ extensions, include: ['src/**/*'], babelHelpers: 'runtime' }), - ], - }; - const tsDefinitionsConfig: RollupOptions[] = tsConfig ? [ { @@ -60,11 +60,11 @@ export const getBaseRollupConfig = ( return tsDefinitionsConfig.concat([ esmCallback({ - ...baseBuildConfig, + ...getBaseBuildConfig(), external: esmExternal, }), cjsCallback({ - ...baseBuildConfig, + ...getBaseBuildConfig(), external: cjsExternal, }), ]); diff --git a/package.json b/package.json index d3c4704..3a3e7b1 100644 --- a/package.json +++ b/package.json @@ -7,22 +7,21 @@ "author": "John Rom ", "scripts": { "start": "lerna run start --stream", - "build:core": "yarn --cwd packages/code-snippets build", - "build:remark-plugin": "yarn --cwd packages/remark-code-snippets build", - "build:gatsby-plugin": "yarn --cwd packages/gatsby-remark-code-snippets build", - "build": "yarn run build:core && yarn run build:remark-plugin && yarn run build:gatsby-plugin", + "build": "lerna run build", "watch-all": "lerna run watch", - "test": "lerna run test -- --silent", + "serve": "lerna run serve --stream", + "test": "lerna run test --stream --concurrency=1", "test:vscode": "lerna run test --stream --no-sort --", - "prepublishOnly": "lerna run prepublishOnly" + "prepublishOnly": "lerna run prepublishOnly --stream", + "release": "lerna publish", + "release:dryRun": "lerna publish --no-git-tag-version --no-push" }, "devDependencies": { "lerna": "^4.0.0" }, "workspaces": { "packages": [ - "packages/*", - "examples/*" + "packages/*" ] } } diff --git a/packages/code-snippets-website/content/docs/index.md b/packages/code-snippets-website/content/docs/index.md index 50e8828..5f579b5 100644 --- a/packages/code-snippets-website/content/docs/index.md +++ b/packages/code-snippets-website/content/docs/index.md @@ -44,6 +44,7 @@ I've created a snippet surrounding the header of this very website. If there is If you're reading this on an actual website (not the source code, silly), and there is output above, then I have proven my point. Convinced? Here's some further reading: +- [Installing](installing) - [Preserving Snippets](preserving-snippets) Not convinced? That's ok, too. Here's a llama: diff --git a/packages/code-snippets-website/content/docs/installing.md b/packages/code-snippets-website/content/docs/installing.md new file mode 100644 index 0000000..fe4be2b --- /dev/null +++ b/packages/code-snippets-website/content/docs/installing.md @@ -0,0 +1,151 @@ +--- +slug: '/docs/installing' +--- + +# Installing + +The code snippets tool itself can be used by itself by manually passing in markdown, or you can use a tool built for + +- [Remark](#remark-plugin), or +- [Gatsby](#gatsby-plugin) + - [Plain Markdown](#gatsby-plugin-plain-markdown) + - [MDX](#gatsby-plugin-mdx) + +## Remark Plugin + +`@nmbl/code-snippets` can be used as a remark plugin. + +### First, install the Remark Plugin + +#### Yarn + +```sh +yarn add remark @nmbl/remark-code-snippets +``` + +#### NPM + +```sh +npm install remark @nmbl/remark-code-snippets +``` + +### Then, add it as a plugin to remark: + +```ts file=../remark-code-snippets/tests/integration.test.ts snippet=remark-plugin + +``` + +## Gatsby Plugin: Plain Markdown + +> This documentation assumes you have initialized a Gatsby project already and are sourcing markdown from somewhere to process. + +`@nmbl/code-snippets` can be used as a Gatsby plugin for plain markdown, like with `gatsby-transformer-remark`. + +### `gatsby-transformer-remark` + +#### First, install the plugins: + +##### Yarn + +```sh +yarn add gatsby-transformer-remark @nmbl/gatsby-remark-code-snippets +``` + +##### NPM + +```sh +npm install gatsby-transformer-remark @nmbl/gatsby-remark-code-snippets +``` + +#### Then, add it as a plugin + +```js +module.exports = { + plugins: [ + { + resolve: `gatsby-transformer-remark`, + options: { + plugins: [ + { + resolve: '@johnrom/remark-code-import/gatsby', + options: { + async: true, + basePath: process.cwd(), + }, + }, + { + resolve: '@nmbl/gatsby-remark-code-snippets', + options: {}, + }, + ], + }, + }, + ], +}; +``` + +## Gatsby Plugin: `MDX` + +> This documentation assumes you have initialized a Gatsby project already and are sourcing markdown from somewhere to process. + +With `gatsby-plugin-mdx`, either the plugin `@nmbl/remark-code-snippets` can be used as a plugin via `remarkPlugins`, or `@nmbl/gatsby-remark-code-snippets` can be used as a plugin via `plugins`. + +Choosing one or the other for all of your plugins is preferable, so they can be reliably called in order. I prefer using remarkPlugins + rehypePlugins for full power. + +### `gatsby-plugin-mdx`: `remarkPlugins`. + +With `remarkPlugins`, install just the plain remark plugin: + +#### Yarn + +```sh +yarn add gatsby-plugin-mdx @nmbl/remark-code-snippets +``` + +##### NPM + +```sh +npm install gatsby-plugin-mdx @nmbl/remark-code-snippets +``` + +Then, add it to remarkPlugins: + +```js file=../code-snippets-website/gatsby-config.js snippet=gatsby-plugin-mdx--remarkPlugins + +``` + +### `gatsby-plugin-mdx`: `gatsbyRemarkPlugins`. + +With `gatsbyRemarkPlugins`, install the Gatsby plugin: + +#### Yarn + +```sh +yarn add gatsby-plugin-mdx @nmbl/gatsby-remark-code-snippets +``` + +##### NPM + +```sh +npm install gatsby-plugin-mdx @nmbl/gatsby-remark-code-snippets +``` + +Then, add it to gatsbyRemarkPlugins: + +```js +module.exports = { + plugins: [ + { + resolve: `gatsby-plugin-mdx`, + options: { + gatsbyRemarkPlugins: [ + { + resolve: `@nmbl/gatsby-remark-code-snippets`, + options: {}, + }, + ], + }, + }, + ], +}; +``` diff --git a/packages/code-snippets-website/gatsby-config.js b/packages/code-snippets-website/gatsby-config.js index 849f05f..579b61c 100644 --- a/packages/code-snippets-website/gatsby-config.js +++ b/packages/code-snippets-website/gatsby-config.js @@ -1,9 +1,1216 @@ +'use strict'; + +var remarkCodeImport = require('@johnrom/remark-code-import'); +var remarkCodeSnippets = require('@nmbl/remark-code-snippets'); +var Slugger = require('github-slugger'); +var extend = require('extend'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var remarkCodeImport__default = /*#__PURE__*/_interopDefaultLegacy(remarkCodeImport); +var Slugger__default = /*#__PURE__*/_interopDefaultLegacy(Slugger); +var extend__default = /*#__PURE__*/_interopDefaultLegacy(extend); + +var own = {}.hasOwnProperty; + +/** + * Check if `node` has a set `name` property. + * + * @param {unknown} node + * @param {string} name + * @returns {boolean} + */ +function hasProperty(node, name) { + /** @type {unknown} */ + var value = + name && + node && + typeof node === 'object' && + // @ts-ignore Looks like a node. + node.type === 'element' && + // @ts-ignore Looks like an element. + node.properties && + // @ts-ignore Looks like an element. + own.call(node.properties, name) && + // @ts-ignore Looks like an element. + node.properties[name]; + + return value !== null && value !== undefined && value !== false +} + +/** + * @typedef {import('hast').Parent} Parent + * @typedef {import('hast').Root} Root + * @typedef {Root|Parent['children'][number]} Node + */ + +/** + * Rank of a heading: H1 -> 1, H2 -> 2, etc. + * + * @param {Node} node + * @returns {number|null} + */ +function headingRank(node) { + var name = + (node && node.type === 'element' && node.tagName.toLowerCase()) || ''; + var code = + name.length === 2 && name.charCodeAt(0) === 104 /* `h` */ + ? name.charCodeAt(1) + : 0; + return code > 48 /* `0` */ && code < 55 /* `7` */ ? code - 48 /* `0` */ : null +} + +/** + * @fileoverview + * Get the plain-text value of a hast node. + * @longdescription + * ## Use + * + * ```js + * import {h} from 'hastscript' + * import {toString} from 'hast-util-to-string' + * + * toString(h('p', 'Alpha')) + * //=> 'Alpha' + * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.'])) + * //=> 'Bold and italic.' + * ``` + * + * ## API + * + * ### `toString(node)` + * + * Transform a node to a string. + */ + +/** + * @typedef {import('hast').Root} Root + * @typedef {import('hast').Element} Element + * @typedef {Root|Root['children'][number]} Node + */ + +/** + * Get the plain-text value of a hast node. + * + * @param {Node} node + * @returns {string} + */ +function toString(node) { + // “The concatenation of data of all the Text node descendants of the context + // object, in tree order.” + if ('children' in node) { + return all(node) + } + + // “Context object’s data.” + return 'value' in node ? node.value : '' +} + +/** + * @param {Node} node + * @returns {string} + */ +function one(node) { + if (node.type === 'text') { + return node.value + } + + return 'children' in node ? all(node) : '' +} + +/** + * @param {Root|Element} node + * @returns {string} + */ +function all(node) { + let index = -1; + /** @type {string[]} */ + const result = []; + + while (++index < node.children.length) { + result[index] = one(node.children[index]); + } + + return result.join('') +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * + * @typedef {string} Type + * @typedef {Object} Props + * + * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test + */ + +const convert$1 = + /** + * @type {( + * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) & + * ((test?: Test) => AssertAnything) + * )} + */ + ( + /** + * Generate an assertion from a check. + * @param {Test} [test] + * When nullish, checks if `node` is a `Node`. + * When `string`, works like passing `function (node) {return node.type === test}`. + * When `function` checks if function passed the node is true. + * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. + * When `array`, checks any one of the subtests pass. + * @returns {AssertAnything} + */ + function (test) { + if (test === undefined || test === null) { + return ok$1 + } + + if (typeof test === 'string') { + return typeFactory$1(test) + } + + if (typeof test === 'object') { + return Array.isArray(test) ? anyFactory$2(test) : propsFactory$1(test) + } + + if (typeof test === 'function') { + return castFactory$2(test) + } + + throw new Error('Expected function, string, or object as test') + } + ); +/** + * @param {Array.} tests + * @returns {AssertAnything} + */ +function anyFactory$2(tests) { + /** @type {Array.} */ + const checks = []; + let index = -1; + + while (++index < tests.length) { + checks[index] = convert$1(tests[index]); + } + + return castFactory$2(any) + + /** + * @this {unknown} + * @param {unknown[]} parameters + * @returns {boolean} + */ + function any(...parameters) { + let index = -1; + + while (++index < checks.length) { + if (checks[index].call(this, ...parameters)) return true + } + + return false + } +} + +/** + * Utility to assert each property in `test` is represented in `node`, and each + * values are strictly equal. + * + * @param {Props} check + * @returns {AssertAnything} + */ +function propsFactory$1(check) { + return castFactory$2(all) + + /** + * @param {Node} node + * @returns {boolean} + */ + function all(node) { + /** @type {string} */ + let key; + + for (key in check) { + // @ts-expect-error: hush, it sure works as an index. + if (node[key] !== check[key]) return false + } + + return true + } +} + +/** + * Utility to convert a string into a function which checks a given node’s type + * for said string. + * + * @param {Type} check + * @returns {AssertAnything} + */ +function typeFactory$1(check) { + return castFactory$2(type) + + /** + * @param {Node} node + */ + function type(node) { + return node && node.type === check + } +} + +/** + * Utility to convert a string into a function which checks a given node’s type + * for said string. + * @param {TestFunctionAnything} check + * @returns {AssertAnything} + */ +function castFactory$2(check) { + return assertion + + /** + * @this {unknown} + * @param {Array.} parameters + * @returns {boolean} + */ + function assertion(...parameters) { + // @ts-expect-error: spreading is fine. + return Boolean(check.call(this, ...parameters)) + } +} + +// Utility to return true. +function ok$1() { + return true +} + +/** + * @param {string} d + * @returns {string} + */ +function color$1(d) { + return '\u001B[33m' + d + '\u001B[39m' +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * @typedef {import('unist-util-is').Test} Test + * @typedef {import('./complex-types').Action} Action + * @typedef {import('./complex-types').Index} Index + * @typedef {import('./complex-types').ActionTuple} ActionTuple + * @typedef {import('./complex-types').VisitorResult} VisitorResult + * @typedef {import('./complex-types').Visitor} Visitor + */ + +/** + * Continue traversing as normal + */ +const CONTINUE$1 = true; +/** + * Do not traverse this node’s children + */ +const SKIP$1 = 'skip'; +/** + * Stop traversing immediately + */ +const EXIT$1 = false; + +/** + * Visit children of tree which pass a test + * + * @param tree Abstract syntax tree to walk + * @param test Test node, optional + * @param visitor Function to run for each node + * @param reverse Visit the tree in reverse order, defaults to false + */ +const visitParents$1 = + /** + * @type {( + * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & + * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) + * )} + */ + ( + /** + * @param {Node} tree + * @param {Test} test + * @param {import('./complex-types').Visitor} visitor + * @param {boolean} [reverse] + */ + function (tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + // @ts-expect-error no visitor given, so `visitor` is test. + visitor = test; + test = null; + } + + const is = convert$1(test); + const step = reverse ? -1 : 1; + + factory(tree, null, [])(); + + /** + * @param {Node} node + * @param {number?} index + * @param {Array.} parents + */ + function factory(node, index, parents) { + /** @type {Object.} */ + // @ts-expect-error: hush + const value = typeof node === 'object' && node !== null ? node : {}; + /** @type {string|undefined} */ + let name; + + if (typeof value.type === 'string') { + name = + typeof value.tagName === 'string' + ? value.tagName + : typeof value.name === 'string' + ? value.name + : undefined; + + Object.defineProperty(visit, 'name', { + value: + 'node (' + + color$1(value.type + (name ? '<' + name + '>' : '')) + + ')' + }); + } + + return visit + + function visit() { + /** @type {ActionTuple} */ + let result = []; + /** @type {ActionTuple} */ + let subresult; + /** @type {number} */ + let offset; + /** @type {Array.} */ + let grandparents; + + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult$1(visitor(node, parents)); + + if (result[0] === EXIT$1) { + return result + } + } + + // @ts-expect-error looks like a parent. + if (node.children && result[0] !== SKIP$1) { + // @ts-expect-error looks like a parent. + offset = (reverse ? node.children.length : -1) + step; + // @ts-expect-error looks like a parent. + grandparents = parents.concat(node); + + // @ts-expect-error looks like a parent. + while (offset > -1 && offset < node.children.length) { + // @ts-expect-error looks like a parent. + subresult = factory(node.children[offset], offset, grandparents)(); + + if (subresult[0] === EXIT$1) { + return subresult + } + + offset = + typeof subresult[1] === 'number' ? subresult[1] : offset + step; + } + } + + return result + } + } + } + ); + +/** + * @param {VisitorResult} value + * @returns {ActionTuple} + */ +function toResult$1(value) { + if (Array.isArray(value)) { + return value + } + + if (typeof value === 'number') { + return [CONTINUE$1, value] + } + + return [value] +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * @typedef {import('unist-util-is').Test} Test + * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult + * @typedef {import('./complex-types').Visitor} Visitor + */ + +/** + * Visit children of tree which pass a test + * + * @param tree Abstract syntax tree to walk + * @param test Test, optional + * @param visitor Function to run for each node + * @param reverse Fisit the tree in reverse, defaults to false + */ +const visit$1 = + /** + * @type {( + * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & + * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) + * )} + */ + ( + /** + * @param {Node} tree + * @param {Test} test + * @param {import('./complex-types').Visitor} visitor + * @param {boolean} [reverse] + */ + function (tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + + visitParents$1(tree, test, overload, reverse); + + /** + * @param {Node} node + * @param {Array.} parents + */ + function overload(node, parents) { + const parent = parents[parents.length - 1]; + return visitor( + node, + parent ? parent.children.indexOf(node) : null, + parent + ) + } + } + ); + +/** + * @typedef {import('hast').Root} Root + */ + +const slugs = new Slugger__default["default"](); + +/** + * Plugin to add `id`s to headings. + * + * @type {import('unified').Plugin<[], Root>} + */ +function rehypeSlug() { + return (tree) => { + slugs.reset(); + + visit$1(tree, 'element', (node) => { + if (headingRank(node) && node.properties && !hasProperty(node, 'id')) { + node.properties.id = slugs.slug(toString(node)); + } + }); + } +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * @typedef {import('hast').Element} Element + * + * @typedef {string} TagName + * @typedef {null|undefined|TagName|TestFunctionAnything|Array.} Test + */ + +const convertElement = + /** + * @type {( + * ((test: T['tagName']|TestFunctionPredicate) => AssertPredicate) & + * ((test?: Test) => AssertAnything) + * )} + */ + ( + /** + * Generate an assertion from a check. + * @param {Test} [test] + * When nullish, checks if `node` is a `Node`. + * When `string`, works like passing `function (node) {return node.type === test}`. + * When `function` checks if function passed the node is true. + * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. + * When `array`, checks any one of the subtests pass. + * @returns {AssertAnything} + */ + function (test) { + if (test === undefined || test === null) { + return element + } + + if (typeof test === 'string') { + return tagNameFactory(test) + } + + if (typeof test === 'object') { + return anyFactory$1(test) + } + + if (typeof test === 'function') { + return castFactory$1(test) + } + + throw new Error('Expected function, string, or array as test') + } + ); + +/** + * @param {Array.} tests + * @returns {AssertAnything} + */ +function anyFactory$1(tests) { + /** @type {Array.} */ + const checks = []; + let index = -1; + + while (++index < tests.length) { + checks[index] = convertElement(tests[index]); + } + + return castFactory$1(any) + + /** + * @this {unknown} + * @param {unknown[]} parameters + * @returns {boolean} + */ + function any(...parameters) { + let index = -1; + + while (++index < checks.length) { + if (checks[index].call(this, ...parameters)) { + return true + } + } + + return false + } +} + +/** + * Utility to convert a string into a function which checks a given node’s tag + * name for said string. + * + * @param {TagName} check + * @returns {AssertAnything} + */ +function tagNameFactory(check) { + return tagName + + /** + * @param {unknown} node + * @returns {boolean} + */ + function tagName(node) { + return element(node) && node.tagName === check + } +} + +/** + * @param {TestFunctionAnything} check + * @returns {AssertAnything} + */ +function castFactory$1(check) { + return assertion + + /** + * @this {unknown} + * @param {unknown} node + * @param {Array.} parameters + * @returns {boolean} + */ + function assertion(node, ...parameters) { + // @ts-expect-error: fine. + return element(node) && Boolean(check.call(this, node, ...parameters)) + } +} + +/** + * Utility to return true if this is an element. + * @param {unknown} node + * @returns {node is Element} + */ +function element(node) { + return Boolean( + node && + typeof node === 'object' && + // @ts-expect-error Looks like a node. + node.type === 'element' && + // @ts-expect-error Looks like an element. + typeof node.tagName === 'string' + ) +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * + * @typedef {string} Type + * @typedef {Object} Props + * + * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test + */ + +const convert = + /** + * @type {( + * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) & + * ((test?: Test) => AssertAnything) + * )} + */ + ( + /** + * Generate an assertion from a check. + * @param {Test} [test] + * When nullish, checks if `node` is a `Node`. + * When `string`, works like passing `function (node) {return node.type === test}`. + * When `function` checks if function passed the node is true. + * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. + * When `array`, checks any one of the subtests pass. + * @returns {AssertAnything} + */ + function (test) { + if (test === undefined || test === null) { + return ok + } + + if (typeof test === 'string') { + return typeFactory(test) + } + + if (typeof test === 'object') { + return Array.isArray(test) ? anyFactory(test) : propsFactory(test) + } + + if (typeof test === 'function') { + return castFactory(test) + } + + throw new Error('Expected function, string, or object as test') + } + ); +/** + * @param {Array.} tests + * @returns {AssertAnything} + */ +function anyFactory(tests) { + /** @type {Array.} */ + const checks = []; + let index = -1; + + while (++index < tests.length) { + checks[index] = convert(tests[index]); + } + + return castFactory(any) + + /** + * @this {unknown} + * @param {unknown[]} parameters + * @returns {boolean} + */ + function any(...parameters) { + let index = -1; + + while (++index < checks.length) { + if (checks[index].call(this, ...parameters)) return true + } + + return false + } +} + +/** + * Utility to assert each property in `test` is represented in `node`, and each + * values are strictly equal. + * + * @param {Props} check + * @returns {AssertAnything} + */ +function propsFactory(check) { + return castFactory(all) + + /** + * @param {Node} node + * @returns {boolean} + */ + function all(node) { + /** @type {string} */ + let key; + + for (key in check) { + // @ts-expect-error: hush, it sure works as an index. + if (node[key] !== check[key]) return false + } + + return true + } +} + +/** + * Utility to convert a string into a function which checks a given node’s type + * for said string. + * + * @param {Type} check + * @returns {AssertAnything} + */ +function typeFactory(check) { + return castFactory(type) + + /** + * @param {Node} node + */ + function type(node) { + return node && node.type === check + } +} + +/** + * Utility to convert a string into a function which checks a given node’s type + * for said string. + * @param {TestFunctionAnything} check + * @returns {AssertAnything} + */ +function castFactory(check) { + return assertion + + /** + * @this {unknown} + * @param {Array.} parameters + * @returns {boolean} + */ + function assertion(...parameters) { + // @ts-expect-error: spreading is fine. + return Boolean(check.call(this, ...parameters)) + } +} + +// Utility to return true. +function ok() { + return true +} + +/** + * @param {string} d + * @returns {string} + */ +function color(d) { + return '\u001B[33m' + d + '\u001B[39m' +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * @typedef {import('unist-util-is').Test} Test + * @typedef {import('./complex-types').Action} Action + * @typedef {import('./complex-types').Index} Index + * @typedef {import('./complex-types').ActionTuple} ActionTuple + * @typedef {import('./complex-types').VisitorResult} VisitorResult + * @typedef {import('./complex-types').Visitor} Visitor + */ + +/** + * Continue traversing as normal + */ +const CONTINUE = true; +/** + * Do not traverse this node’s children + */ +const SKIP = 'skip'; +/** + * Stop traversing immediately + */ +const EXIT = false; + +/** + * Visit children of tree which pass a test + * + * @param tree Abstract syntax tree to walk + * @param test Test node, optional + * @param visitor Function to run for each node + * @param reverse Visit the tree in reverse order, defaults to false + */ +const visitParents = + /** + * @type {( + * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & + * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) + * )} + */ + ( + /** + * @param {Node} tree + * @param {Test} test + * @param {import('./complex-types').Visitor} visitor + * @param {boolean} [reverse] + */ + function (tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + // @ts-expect-error no visitor given, so `visitor` is test. + visitor = test; + test = null; + } + + const is = convert(test); + const step = reverse ? -1 : 1; + + factory(tree, null, [])(); + + /** + * @param {Node} node + * @param {number?} index + * @param {Array.} parents + */ + function factory(node, index, parents) { + /** @type {Object.} */ + // @ts-expect-error: hush + const value = typeof node === 'object' && node !== null ? node : {}; + /** @type {string|undefined} */ + let name; + + if (typeof value.type === 'string') { + name = + typeof value.tagName === 'string' + ? value.tagName + : typeof value.name === 'string' + ? value.name + : undefined; + + Object.defineProperty(visit, 'name', { + value: + 'node (' + + color(value.type + (name ? '<' + name + '>' : '')) + + ')' + }); + } + + return visit + + function visit() { + /** @type {ActionTuple} */ + let result = []; + /** @type {ActionTuple} */ + let subresult; + /** @type {number} */ + let offset; + /** @type {Array.} */ + let grandparents; + + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)); + + if (result[0] === EXIT) { + return result + } + } + + // @ts-expect-error looks like a parent. + if (node.children && result[0] !== SKIP) { + // @ts-expect-error looks like a parent. + offset = (reverse ? node.children.length : -1) + step; + // @ts-expect-error looks like a parent. + grandparents = parents.concat(node); + + // @ts-expect-error looks like a parent. + while (offset > -1 && offset < node.children.length) { + // @ts-expect-error looks like a parent. + subresult = factory(node.children[offset], offset, grandparents)(); + + if (subresult[0] === EXIT) { + return subresult + } + + offset = + typeof subresult[1] === 'number' ? subresult[1] : offset + step; + } + } + + return result + } + } + } + ); + +/** + * @param {VisitorResult} value + * @returns {ActionTuple} + */ +function toResult(value) { + if (Array.isArray(value)) { + return value + } + + if (typeof value === 'number') { + return [CONTINUE, value] + } + + return [value] +} + +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Parent} Parent + * @typedef {import('unist-util-is').Test} Test + * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult + * @typedef {import('./complex-types').Visitor} Visitor + */ + +/** + * Visit children of tree which pass a test + * + * @param tree Abstract syntax tree to walk + * @param test Test, optional + * @param visitor Function to run for each node + * @param reverse Fisit the tree in reverse, defaults to false + */ +const visit = + /** + * @type {( + * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & + * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) + * )} + */ + ( + /** + * @param {Node} tree + * @param {Test} test + * @param {import('./complex-types').Visitor} visitor + * @param {boolean} [reverse] + */ + function (tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + + visitParents(tree, test, overload, reverse); + + /** + * @param {Node} node + * @param {Array.} parents + */ + function overload(node, parents) { + const parent = parents[parents.length - 1]; + return visitor( + node, + parent ? parent.children.indexOf(node) : null, + parent + ) + } + } + ); + +/** + * @typedef {import('hast').Root} Root + * @typedef {import('hast').Parent} Parent + * @typedef {import('hast').Element} Element + * @typedef {Element['children'][number]} ElementChild + * @typedef {import('hast').Properties} Properties + * @typedef {import('hast-util-is-element').Test} Test + * + * @typedef {'prepend'|'append'|'wrap'|'before'|'after'} Behavior + * + * @callback Build + * @param {Element} node + * @returns {ElementChild|ElementChild[]} + * + * @typedef Options + * Configuration. + * @property {Behavior} [behavior='prepend'] + * How to create links. + * @property {Behavior} [behaviour] + * Please use `behavior` instead + * @property {Properties} [properties] + * Extra properties to set on the link when injecting. + * Defaults to `{ariaHidden: true, tabIndex: -1}` when `'prepend'` or + * `'append'`. + * @property {ElementChild|ElementChild[]|Build} [content={type: 'element', tagName: 'span', properties: {className: ['icon', 'icon-link']}, children: []}] + * hast nodes to insert in the link. + * @property {ElementChild|ElementChild[]|Build} [group] + * hast node to wrap the heading and link with, if `behavior` is `'before'` or + * `'after'`. + * There is no default. + * @property {Test} [test] + * Test to define which heading elements are linked. + * Any test that can be given to `hast-util-is-element` is supported. + * The default (no test) is to link all headings. + * Can be used to link only h1-h3, or for example all except h1. + */ + +/** @type {Element} */ +const contentDefaults = { + type: 'element', + tagName: 'span', + properties: {className: ['icon', 'icon-link']}, + children: [] +}; + +/** + * Plugin to automatically add links to headings (h1-h6). + * + * @type {import('unified').Plugin<[Options?]|void[], Root>} + */ +function rehypeAutolinkHeadings(options = {}) { + let props = options.properties; + const behavior = options.behaviour || options.behavior || 'prepend'; + const content = options.content || contentDefaults; + const group = options.group; + const is = convertElement(options.test); + + /** @type {import('unist-util-visit').Visitor} */ + let method; + + if (behavior === 'wrap') { + method = wrap; + } else if (behavior === 'before' || behavior === 'after') { + method = around; + } else { + if (!props) { + props = {ariaHidden: 'true', tabIndex: -1}; + } + + method = inject; + } + + return (tree) => { + visit(tree, 'element', (node, index, parent) => { + if ( + headingRank(node) && + hasProperty(node, 'id') && + is(node, index, parent) + ) { + return method(node, index, parent) + } + }); + } + + /** @type {import('unist-util-visit').Visitor} */ + function inject(node) { + node.children[behavior === 'prepend' ? 'unshift' : 'push']( + create(node, extend__default["default"](true, {}, props), toChildren(content, node)) + ); + + return [SKIP] + } + + /** @type {import('unist-util-visit').Visitor} */ + function around(node, index, parent) { + // Uncommon. + /* c8 ignore next */ + if (typeof index !== 'number' || !parent) return + + const link = create( + node, + extend__default["default"](true, {}, props), + toChildren(content, node) + ); + let nodes = behavior === 'before' ? [link, node] : [node, link]; + + if (group) { + const grouping = toNode(group, node); + + if (grouping && !Array.isArray(grouping) && grouping.type === 'element') { + grouping.children = nodes; + nodes = [grouping]; + } + } + + parent.children.splice(index, 1, ...nodes); + + return [SKIP, index + nodes.length] + } + + /** @type {import('unist-util-visit').Visitor} */ + function wrap(node) { + node.children = [create(node, extend__default["default"](true, {}, props), node.children)]; + return [SKIP] + } + + /** + * @param {ElementChild|ElementChild[]|Build} value + * @param {Element} node + * @returns {ElementChild[]} + */ + function toChildren(value, node) { + const result = toNode(value, node); + return Array.isArray(result) ? result : [result] + } + + /** + * @param {ElementChild|ElementChild[]|Build} value + * @param {Element} node + * @returns {ElementChild|ElementChild[]} + */ + function toNode(value, node) { + if (typeof value === 'function') return value(node) + return extend__default["default"](true, Array.isArray(value) ? [] : {}, value) + } + + /** + * @param {Element} node + * @param {Properties} props + * @param {ElementChild[]} children + * @returns {Element} + */ + function create(node, props, children) { + return { + type: 'element', + tagName: 'a', + properties: Object.assign({}, props, { + // Fix hast types and make them required. + /* c8 ignore next */ + href: '#' + (node.properties || {}).id + }), + children + } + } +} + module.exports = { siteMetadata: { siteUrl: 'https://codesnip.local', title: 'Nmbl Code Snippets - Documentation', }, plugins: [ + // @snippet:start gatsby-plugin-mdx + { + resolve: `gatsby-plugin-mdx`, + options: { + extensions: [`.md`, `.mdx`], + remarkPlugins: [ + [ + remarkCodeImport__default["default"], + { + async: true, + basePath: process.cwd(), + }, + ], + [remarkCodeSnippets.RemarkPluginCodeSnippets, {}], + ], + rehypePlugins: [ + // Generate heading ids for rehype-autolink-headings + rehypeSlug, + // To pass options, use a 2-element array with the + // configuration in an object in the second element + [rehypeAutolinkHeadings, { behavior: 'wrap' }], + ], + }, + }, + // @snippet:end gatsby-plugin-mdx 'gatsby-plugin-postcss', 'gatsby-plugin-typescript', { @@ -22,23 +1229,5 @@ module.exports = { }, __key: 'content', }, - { - resolve: `gatsby-transformer-remark`, - options: { - plugins: [ - { - resolve: '@johnrom/remark-code-import/gatsby', - options: { - async: true, - basePath: process.cwd(), - }, - }, - { - resolve: '@nmbl/gatsby-remark-code-snippets', - options: {}, - }, - ], - }, - }, ], }; diff --git a/packages/code-snippets-website/gatsby-config.src.js b/packages/code-snippets-website/gatsby-config.src.js new file mode 100644 index 0000000..575203d --- /dev/null +++ b/packages/code-snippets-website/gatsby-config.src.js @@ -0,0 +1,56 @@ +import remarkCodeImport from '@johnrom/remark-code-import'; +import { RemarkPluginCodeSnippets } from '@nmbl/remark-code-snippets'; +import rehypeSlug from 'rehype-slug'; +import rehypeAutolinkHeadings from 'rehype-autolink-headings'; + +module.exports = { + siteMetadata: { + siteUrl: 'https://codesnip.local', + title: 'Nmbl Code Snippets - Documentation', + }, + plugins: [ + // @snippet:start gatsby-plugin-mdx + { + resolve: `gatsby-plugin-mdx`, + options: { + extensions: [`.md`, `.mdx`], + remarkPlugins: [ + [ + remarkCodeImport, + { + async: false, + basePath: process.cwd(), + }, + ], + [RemarkPluginCodeSnippets, {}], + ], + rehypePlugins: [ + // Generate heading ids for rehype-autolink-headings + [rehypeSlug, {}], + // To pass options, use a 2-element array with the + // configuration in an object in the second element + [rehypeAutolinkHeadings, { behavior: 'wrap' }], + ], + }, + }, + // @snippet:end gatsby-plugin-mdx + 'gatsby-plugin-postcss', + 'gatsby-plugin-typescript', + { + resolve: 'gatsby-source-filesystem', + options: { + name: 'pages', + path: `${__dirname}/src/pages/`, + }, + __key: 'pages', + }, + { + resolve: 'gatsby-source-filesystem', + options: { + name: 'content', + path: `${__dirname}/content`, + }, + __key: 'content', + }, + ], +}; diff --git a/packages/code-snippets-website/package.json b/packages/code-snippets-website/package.json index 4ca229d..f901b0a 100644 --- a/packages/code-snippets-website/package.json +++ b/packages/code-snippets-website/package.json @@ -16,10 +16,14 @@ "clean": "gatsby clean" }, "dependencies": { + "@johnrom/remark-code-import": "0.4.1-beta1", + "@mdx-js/mdx": "^1.6.22", + "@mdx-js/react": "^1.6.22", "@nmbl/gatsby-remark-code-snippets": "1.0.0-beta.0", "@tailwindcss/typography": "^0.4.1", "autoprefixer": "^10.4.0", "gatsby": "^4.2.0", + "gatsby-plugin-mdx": "^3.2.0", "gatsby-plugin-postcss": "^5.2.0", "gatsby-plugin-typegen": "^2.2.4", "gatsby-plugin-typescript": "^4.2.0", @@ -27,7 +31,9 @@ "gatsby-source-filesystem": "^4.2.0", "gatsby-transformer-remark": "^5.2.0", "react": "^17.0.2", - "react-dom": "^17.0.2" + "react-dom": "^17.0.2", + "rehype-autolink-headings": "^6.1.0", + "rehype-slug": "^5.0.0" }, "devDependencies": { "@types/react": "^17.0.35", diff --git a/packages/code-snippets-website/rollup.config.js b/packages/code-snippets-website/rollup.config.js new file mode 100644 index 0000000..fc80404 --- /dev/null +++ b/packages/code-snippets-website/rollup.config.js @@ -0,0 +1,14 @@ +import { getBaseBuildConfig } from '../../helpers/getBaseRollupConfig'; +import { cjsExternal } from '../../helpers/getBaseRollupConfig'; + +export default { + ...getBaseBuildConfig(['./gatsby-config.js']), + input: './gatsby-config.src.js', + external: cjsExternal, + output: [ + { + file: './gatsby-config.js', + format: 'cjs', + }, + ], +}; diff --git a/packages/code-snippets-website/src/pages/{MarkdownRemark.frontmatter__slug}.tsx b/packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx similarity index 60% rename from packages/code-snippets-website/src/pages/{MarkdownRemark.frontmatter__slug}.tsx rename to packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx index fcb7551..d1ee363 100644 --- a/packages/code-snippets-website/src/pages/{MarkdownRemark.frontmatter__slug}.tsx +++ b/packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx @@ -1,20 +1,17 @@ import * as React from 'react'; import { graphql } from 'gatsby'; import { SharedLayout } from '../shared-layout'; +import { MDXRenderer } from 'gatsby-plugin-mdx'; interface MarkdownPageProps { data: any; } const MarkdownPage = ({ data }: MarkdownPageProps) => { - const { markdownRemark } = data; // data.markdownRemark holds your post data - const { html } = markdownRemark; + const { mdx } = data; return ( -
+ {mdx.body} ); }; @@ -23,8 +20,8 @@ export default MarkdownPage; export const pageQuery = graphql` query ($id: String!) { - markdownRemark(id: { eq: $id }) { - html + mdx(id: { eq: $id }) { + body frontmatter { slug } diff --git a/packages/code-snippets/src/code-snippet-definitions.ts b/packages/code-snippets/src/code-snippet-definitions.ts index 001dfb5..7ccc710 100644 --- a/packages/code-snippets/src/code-snippet-definitions.ts +++ b/packages/code-snippets/src/code-snippet-definitions.ts @@ -45,17 +45,14 @@ export const getCodeSnippetRegexDefinitions = ( }, ], js: [doubleSlashedComment], - cs: [doubleSlashedComment], + jsx: [doubleSlashedComment], ts: [doubleSlashedComment], + tsx: [doubleSlashedComment], + cs: [doubleSlashedComment], + cshtml: [doubleSlashedComment], }; - if (!extension || !(extension in allDefinitions)) { - throw new Error( - `@nmbl/code-snippets: The extension "${extension}" doesn't exist in our definitions. Feel free to open a PR to support your language of choice! A link to our repository is available in package.json.` - ); - } - return extension && extension in allDefinitions ? allDefinitions[extension] - : allDefinitions.default; + : undefined; }; diff --git a/packages/code-snippets/src/extract-code-snippet.ts b/packages/code-snippets/src/extract-code-snippet.ts index c3cc2b4..1ffc0de 100644 --- a/packages/code-snippets/src/extract-code-snippet.ts +++ b/packages/code-snippets/src/extract-code-snippet.ts @@ -21,12 +21,18 @@ export const extractCodeSnippet = ( // otherwise, no match! if (!snippetId.match(snippetIdRegex)) { throw new Error( - '@nmbl/code-snippets: SnippetId should only contain alphanumeric characters, dashes and underscores.' + `@nmbl/code-snippets: SnippetId should only contain alphanumeric characters, dashes and underscores: '${snippetId}'` ); } const regexDefinitions = getCodeSnippetRegexDefinitions(extension, snippetId); + if (!regexDefinitions) { + throw new Error( + `@nmbl/code-snippets: The extension "${extension}" doesn't exist in our definitions. Feel free to open a PR to support your language of choice! A link to our repository is available in package.json.` + ); + } + for (let i = 0; i < regexDefinitions.length; i++) { const regexDefinition = regexDefinitions[i]; @@ -57,5 +63,7 @@ export const extractCodeSnippet = ( return snippet; } - throw new Error('@nmbl/code-snippets: SnippetId does not exist.'); + throw new Error( + `@nmbl/code-snippets: SnippetId does not exist: '${snippetId}'` + ); }; diff --git a/packages/code-snippets/src/remove-code-snippets.ts b/packages/code-snippets/src/remove-code-snippets.ts index 8b415e6..a28fa43 100644 --- a/packages/code-snippets/src/remove-code-snippets.ts +++ b/packages/code-snippets/src/remove-code-snippets.ts @@ -7,20 +7,22 @@ export const removeCodeSnippets = ( ) => { const regexDefinitions = getCodeSnippetRegexDefinitions(extension); - for (let i = 0; i < regexDefinitions.length; i++) { - const regexDefinition = regexDefinitions[i]; + if (regexDefinitions) { + for (let i = 0; i < regexDefinitions.length; i++) { + const regexDefinition = regexDefinitions[i]; - const startRegex = new RegExp(`${regexDefinition.start}${eol}?`, 'igm'); - const endRegex = new RegExp(`${regexDefinition.end}${eol}?`, 'igm'); - const emptyEndRegex = new RegExp( - `${regexDefinition.emptyEnd}${eol}?`, - 'igm' - ); + const startRegex = new RegExp(`${regexDefinition.start}${eol}?`, 'igm'); + const endRegex = new RegExp(`${regexDefinition.end}${eol}?`, 'igm'); + const emptyEndRegex = new RegExp( + `${regexDefinition.emptyEnd}${eol}?`, + 'igm' + ); - codeBlock = codeBlock - .replace(startRegex, '') - .replace(endRegex, '') - .replace(emptyEndRegex, ''); + codeBlock = codeBlock + .replace(startRegex, '') + .replace(endRegex, '') + .replace(emptyEndRegex, ''); + } } return codeBlock; diff --git a/packages/gatsby-remark-code-snippets/src/index.ts b/packages/gatsby-remark-code-snippets/src/index.ts index 9f28b63..e5640d9 100644 --- a/packages/gatsby-remark-code-snippets/src/index.ts +++ b/packages/gatsby-remark-code-snippets/src/index.ts @@ -1,4 +1,4 @@ -const RemarkPluginCodeSnippets = require('@nmbl/remark-code-snippets'); +const { RemarkPluginCodeSnippets } = require('@nmbl/remark-code-snippets'); const toGatsbyRemarkPlugin = require('to-gatsby-remark-plugin'); export const GatsbyRemarkPluginCodeSnippets = toGatsbyRemarkPlugin( diff --git a/packages/gatsby-remark-code-snippets/tests/integration.test.ts b/packages/gatsby-remark-code-snippets/tests/integration.test.ts index 31bbed1..d172526 100644 --- a/packages/gatsby-remark-code-snippets/tests/integration.test.ts +++ b/packages/gatsby-remark-code-snippets/tests/integration.test.ts @@ -10,11 +10,11 @@ const testArgs: PluginOptions = { }; const GatsbyRemarkPluginCodeSnippets = require('../src/index'); -const RemarkPluginCodeSnippets = require('@nmbl/remark-code-snippets'); +const { RemarkPluginCodeSnippets } = require('@nmbl/remark-code-snippets'); -jest.mock('@nmbl/remark-code-snippets', () => - jest.fn().mockImplementation(() => jest.fn()) -); +jest.mock('@nmbl/remark-code-snippets', () => ({ + RemarkPluginCodeSnippets: jest.fn().mockImplementation(() => jest.fn()), +})); test('Correctly instantiates underlying remark plugin.', () => { const markdownAST = remark.parse(''); diff --git a/packages/remark-code-snippets/src/index.ts b/packages/remark-code-snippets/src/index.ts index 18724f7..09754dd 100644 --- a/packages/remark-code-snippets/src/index.ts +++ b/packages/remark-code-snippets/src/index.ts @@ -75,5 +75,3 @@ export const RemarkPluginCodeSnippets: Plugin< }); }; }; - -export default RemarkPluginCodeSnippets; diff --git a/packages/remark-code-snippets/tests/integration.test.ts b/packages/remark-code-snippets/tests/integration.test.ts index ad5f238..bf34c75 100644 --- a/packages/remark-code-snippets/tests/integration.test.ts +++ b/packages/remark-code-snippets/tests/integration.test.ts @@ -22,6 +22,30 @@ const getJsMarkdownWithoutExtension = (eol: string = '\n') => const getTonsOfNewlines = (eol: string = '\n') => `\`\`\`${eol}Test Newlines${eol}${eol}${eol}${eol}/Test Newlines${eol}\`\`\``; +test('Plugin works.', () => { + expect( + // @snippet:start remark-plugin + remark() + .use(RemarkPluginCodeSnippets, {}) + .processSync( + `\`\`\`js snippet=test-snippet + const hello = () => { + // @snippet:start test-snippet + console.log('world'); + // @snippet:end test-snippet + } + \`\`\`` + ) + .toString() + // @snippet:end remark-plugin + ).toMatchInlineSnapshot(` + "\`\`\`js snippet=test-snippet + console.log('world') + \`\`\` + " + `); +}); + test("Doesn't affect extensionless blocks.", () => { expect( remark() diff --git a/yarn.lock b/yarn.lock index d5eee0f..3c05e52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -73,6 +73,28 @@ semver "^5.4.1" source-map "^0.5.0" +"@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.12.3", "@babel/core@^7.14.0", "@babel/core@^7.15.5", "@babel/core@^7.15.8", "@babel/core@^7.7.2", "@babel/core@^7.7.5": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" @@ -103,7 +125,7 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.10.5", "@babel/generator@^7.12.13", "@babel/generator@^7.14.0", "@babel/generator@^7.15.4", "@babel/generator@^7.16.0", "@babel/generator@^7.7.2": +"@babel/generator@^7.10.5", "@babel/generator@^7.12.13", "@babel/generator@^7.12.5", "@babel/generator@^7.14.0", "@babel/generator@^7.15.4", "@babel/generator@^7.16.0", "@babel/generator@^7.7.2": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== @@ -215,7 +237,7 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-module-transforms@^7.10.5", "@babel/helper-module-transforms@^7.16.0": +"@babel/helper-module-transforms@^7.10.5", "@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== @@ -306,7 +328,7 @@ "@babel/traverse" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/helpers@^7.10.4", "@babel/helpers@^7.16.0": +"@babel/helpers@^7.10.4", "@babel/helpers@^7.12.5", "@babel/helpers@^7.16.0": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" integrity sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w== @@ -334,7 +356,7 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.3.tgz#271bafcb811080905a119222edbc17909c82261d" integrity sha512-dcNwU1O4sx57ClvLBVFbEgx0UZWfd0JQX5X6fxFRCLHelFBGXFfSz6Y0FAq2PEwUqlqLkdVjVr4VASEOuUnLJw== -"@babel/parser@^7.12.13", "@babel/parser@^7.14.0": +"@babel/parser@^7.12.13", "@babel/parser@^7.12.7", "@babel/parser@^7.14.0": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== @@ -438,7 +460,16 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-transform-parameters" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.16.0": +"@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-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.14.7", "@babel/plugin-proposal-object-rest-spread@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.0.tgz#5fb32f6d924d6e6712810362a60e12a2609872e6" integrity sha512-LU/+jp89efe5HuWJLmMmFG0+xbz+I2rSI7iLc1AlaeSMDMOGzWlc5yJrMN1d04osXN4sSfpo4O+azkBNBes0jg== @@ -562,6 +593,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" +"@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.0.0", "@babel/plugin-syntax-jsx@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.0.tgz#f9624394317365a9a88c82358d3f8471154698f1" @@ -590,7 +628,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.0.0", "@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== @@ -809,7 +847,7 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-replace-supers" "^7.16.0" -"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.10.4", "@babel/plugin-transform-parameters@^7.16.0": +"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.10.4", "@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.16.0": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.3.tgz#fa9e4c874ee5223f891ee6fa8d737f4766d31d15" integrity sha512-3MaDpJrOXT1MZ/WCmkOFo7EtmVVC8H4EUZVrHvFOsmwkk4lOjQj8rzv8JKUZV4YoQKeoIgk07GO+acPU9IMu/w== @@ -1074,7 +1112,7 @@ resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.16.3.tgz#7a546b4c8530a77b0db68158542552a803af7e03" integrity sha512-hoStDfHl2+EYUv1LNHhZTysa+lMSwIEkkT4HnDNX+F0zqvPdoE2QLF7qtkd45cgCGOwQjrvwe2mOKcX3f6Wr8A== -"@babel/template@^7.10.4", "@babel/template@^7.15.4", "@babel/template@^7.16.0", "@babel/template@^7.3.3": +"@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.15.4", "@babel/template@^7.16.0", "@babel/template@^7.3.3": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== @@ -1098,7 +1136,7 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.10.5", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.10.5", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.15.4", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.7.2": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== @@ -1122,7 +1160,7 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.10.5", "@babel/types@^7.12.13", "@babel/types@^7.15.4", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.10.5", "@babel/types@^7.12.13", "@babel/types@^7.12.7", "@babel/types@^7.15.4", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== @@ -2460,6 +2498,41 @@ npmlog "^4.1.2" write-file-atomic "^3.0.3" +"@mdx-js/mdx@^1.6.22": + version "1.6.22" + resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" + integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== + dependencies: + "@babel/core" "7.12.9" + "@babel/plugin-syntax-jsx" "7.12.1" + "@babel/plugin-syntax-object-rest-spread" "7.8.3" + "@mdx-js/util" "1.6.22" + babel-plugin-apply-mdx-type-prop "1.6.22" + babel-plugin-extract-import-names "1.6.22" + camelcase-css "2.0.1" + detab "2.0.4" + hast-util-raw "6.0.1" + lodash.uniq "4.5.0" + mdast-util-to-hast "10.0.1" + remark-footnotes "2.0.0" + remark-mdx "1.6.22" + remark-parse "8.0.3" + remark-squeeze-paragraphs "4.0.0" + style-to-object "0.3.0" + unified "9.2.0" + unist-builder "2.0.3" + unist-util-visit "2.0.3" + +"@mdx-js/react@^1.6.22": + version "1.6.22" + resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" + integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== + +"@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== + "@mdx-js/util@^2.0.0-next.8": version "2.0.0-next.8" resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-2.0.0-next.8.tgz#66ecc27b78e07a3ea2eb1a8fc5a99dfa0ba96690" @@ -3216,6 +3289,22 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== +"@types/vfile-message@*": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-2.0.0.tgz#690e46af0fdfc1f9faae00cd049cc888957927d5" + integrity sha512-GpTIuDpb9u4zIO165fUy9+fXcULdD8HFRNli04GehoMVbeNq7D6OBnqSmg3lxZnC+UvgUhEWKxdKiwYUkGltIw== + dependencies: + vfile-message "*" + +"@types/vfile@^3.0.0": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/vfile/-/vfile-3.0.2.tgz#19c18cd232df11ce6fa6ad80259bc86c366b09b9" + integrity sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw== + dependencies: + "@types/node" "*" + "@types/unist" "*" + "@types/vfile-message" "*" + "@types/websocket@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.2.tgz#d2855c6a312b7da73ed16ba6781815bf30c6187a" @@ -4054,6 +4143,14 @@ babel-plugin-add-module-exports@^1.0.4: resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-1.0.4.tgz#6caa4ddbe1f578c6a5264d4d3e6c8a2720a7ca2b" integrity sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg== +babel-plugin-apply-mdx-type-prop@1.6.22: + version "1.6.22" + resolved "https://registry.yarnpkg.com/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b" + integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ== + dependencies: + "@babel/helper-plugin-utils" "7.10.4" + "@mdx-js/util" "1.6.22" + babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -4061,6 +4158,13 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" +babel-plugin-extract-import-names@1.6.22: + version "1.6.22" + resolved "https://registry.yarnpkg.com/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc" + integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ== + dependencies: + "@babel/helper-plugin-utils" "7.10.4" + babel-plugin-istanbul@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" @@ -4336,7 +4440,7 @@ bl@^4.0.0: inherits "^2.0.4" readable-stream "^3.4.0" -bluebird@^3.7.2: +bluebird@^3.0.5, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -4357,7 +4461,7 @@ body-parser@1.19.0, body-parser@^1.19.0: raw-body "2.4.0" type-is "~1.6.17" -boolbase@^1.0.0: +boolbase@^1.0.0, boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= @@ -4610,7 +4714,15 @@ camel-case@4.1.2, camel-case@^4.1.2: pascal-case "^3.1.2" tslib "^2.0.3" -camelcase-css@^2.0.1: +camel-case@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= + dependencies: + no-case "^2.2.0" + upper-case "^1.1.1" + +camelcase-css@2.0.1, camelcase-css@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== @@ -4720,6 +4832,30 @@ change-case-all@1.0.14: upper-case "^2.0.2" upper-case-first "^2.0.2" +change-case@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.1.0.tgz#0e611b7edc9952df2e8513b27b42de72647dd17e" + integrity sha512-2AZp7uJZbYEzRPsFoa+ijKdvp9zsrnnt6+yFokfwEpeJm0xuJDVoxiRCAaTzyJND8GJkofo2IcKWaUZ/OECVzw== + dependencies: + camel-case "^3.0.0" + constant-case "^2.0.0" + dot-case "^2.1.0" + header-case "^1.0.0" + is-lower-case "^1.1.0" + is-upper-case "^1.1.0" + lower-case "^1.1.1" + lower-case-first "^1.0.0" + no-case "^2.3.2" + param-case "^2.1.0" + pascal-case "^2.0.0" + path-case "^2.1.0" + sentence-case "^2.1.0" + snake-case "^2.1.0" + swap-case "^1.1.0" + title-case "^2.1.0" + upper-case "^1.1.1" + upper-case-first "^1.1.0" + change-case@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12" @@ -4788,6 +4924,28 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +cheerio@^0.22.0: + version "0.22.0" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" + integrity sha1-qbqoYKP5tZWmuBsahocxIe06Jp4= + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.0" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash.assignin "^4.0.9" + lodash.bind "^4.1.4" + lodash.defaults "^4.0.1" + lodash.filter "^4.4.0" + lodash.flatten "^4.2.0" + lodash.foreach "^4.3.0" + lodash.map "^4.4.0" + lodash.merge "^4.4.0" + lodash.pick "^4.2.1" + lodash.reduce "^4.4.0" + lodash.reject "^4.4.0" + lodash.some "^4.4.0" + chokidar@^2.0.4: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -5165,6 +5323,14 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= +constant-case@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-2.0.0.tgz#4175764d389d3fa9c8ecd29186ed6005243b6a46" + integrity sha1-QXV2TTidP6nI7NKRhu1gBSQ7akY= + dependencies: + snake-case "^2.1.0" + upper-case "^1.1.1" + constant-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" @@ -5520,6 +5686,16 @@ css-select@^4.1.3: domutils "^2.6.0" nth-check "^2.0.0" +css-select@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + css-selector-parser@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/css-selector-parser/-/css-selector-parser-1.4.1.tgz#03f9cb8a81c3e5ab2c51684557d5aaf6d2569759" @@ -5538,6 +5714,11 @@ css-unit-converter@^1.1.1: resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.2.tgz#4c77f5a1954e6dbff60695ecb214e3270436ab21" integrity sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA== +css-what@2.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" + integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== + css-what@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" @@ -5681,6 +5862,11 @@ dataloader@2.0.0: resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.0.0.tgz#41eaf123db115987e21ca93c005cd7753c55fe6f" integrity sha512-YzhyDAwA4TaQIhM5go+vCLmU0UikghC/t9DTQYZR2M/UvZ1MdOhPezSDZcjj9uqQJOMqjLcpWtyW2iNINdlatQ== +dataloader@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" + integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw== + date-fns@^2.25.0: version "2.25.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.25.0.tgz#8c5c8f1d958be3809a9a03f4b742eba894fc5680" @@ -5874,6 +6060,13 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +detab@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43" + integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g== + dependencies: + repeat-string "^1.5.4" + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -6024,6 +6217,14 @@ dom-converter@^0.2.0: dependencies: utila "~0.4" +dom-serializer@0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" + integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== + dependencies: + domelementtype "^2.0.1" + entities "^2.0.0" + dom-serializer@^1.0.1: version "1.3.2" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91" @@ -6033,6 +6234,19 @@ dom-serializer@^1.0.1: domhandler "^4.2.0" entities "^2.0.0" +dom-serializer@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== + dependencies: + domelementtype "^1.3.0" + entities "^1.1.1" + +domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + domelementtype@^2.0.1, domelementtype@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57" @@ -6045,6 +6259,13 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + domhandler@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.3.0.tgz#6db7ea46e4617eb15cf875df68b2b8524ce0037a" @@ -6059,6 +6280,22 @@ domhandler@^4.0.0, domhandler@^4.2.0: dependencies: domelementtype "^2.2.0" +domutils@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= + dependencies: + dom-serializer "0" + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + domutils@^2.0.0, domutils@^2.5.2, domutils@^2.6.0: version "2.8.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" @@ -6068,6 +6305,13 @@ domutils@^2.0.0, domutils@^2.5.2, domutils@^2.6.0: domelementtype "^2.2.0" domhandler "^4.2.0" +dot-case@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.1.tgz#34dcf37f50a8e93c2b3bca8bb7fb9155c7da3bee" + integrity sha1-NNzzf1Co6TwrO8qLt/uRVcfaO+4= + dependencies: + no-case "^2.2.0" + dot-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" @@ -6218,6 +6462,11 @@ enquirer@^2.3.5: dependencies: ansi-colors "^4.1.1" +entities@^1.1.1, entities@~1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" @@ -6718,6 +6967,13 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +eval@^0.1.0, eval@^0.1.4: + version "0.1.6" + resolved "https://registry.yarnpkg.com/eval/-/eval-0.1.6.tgz#9620d7d8c85515e97e6b47c5814f46ae381cb3cc" + integrity sha512-o0XUw+5OGkXw4pJZzQoXUk+H87DHuC+7ZE//oSrRGtatTmr12oTnLfg6QOq9DyTt0c/p4TwzgmkKrBzWTSizyQ== + dependencies: + require-like ">= 0.1.1" + event-emitter@^0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" @@ -7394,6 +7650,50 @@ gatsby-page-utils@^2.2.0: lodash "^4.17.21" micromatch "^4.0.4" +gatsby-plugin-mdx@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/gatsby-plugin-mdx/-/gatsby-plugin-mdx-3.2.0.tgz#afac39e92e1aaadfc1f6a10437e3bb972f337fe2" + integrity sha512-hxk8LE127ip9jj6QtMVNEdu+m2nbMna1phUR0ownTha4viCSEAGAAIySd9yyR0k7CljJ7LEQLCMs9/DkAdU0DQ== + dependencies: + "@babel/core" "^7.15.5" + "@babel/generator" "^7.15.4" + "@babel/helper-plugin-utils" "^7.14.0" + "@babel/plugin-proposal-object-rest-spread" "^7.14.7" + "@babel/preset-env" "^7.15.4" + "@babel/preset-react" "^7.14.0" + "@babel/runtime" "^7.15.4" + "@babel/types" "^7.15.4" + camelcase-css "^2.0.1" + change-case "^3.1.0" + core-js "^3.17.2" + dataloader "^1.4.0" + debug "^4.3.1" + escape-string-regexp "^1.0.5" + eval "^0.1.4" + fs-extra "^10.0.0" + gatsby-core-utils "^3.2.0" + gray-matter "^4.0.2" + json5 "^2.1.3" + loader-utils "^1.4.0" + lodash "^4.17.21" + mdast-util-to-string "^1.1.0" + mdast-util-toc "^3.1.0" + mime "^2.4.6" + mkdirp "^1.0.4" + p-queue "^6.6.2" + pretty-bytes "^5.3.0" + remark "^10.0.1" + remark-retext "^3.1.3" + retext-english "^3.0.4" + slugify "^1.4.4" + static-site-generator-webpack-plugin "^3.4.2" + style-to-object "^0.3.0" + underscore.string "^3.3.5" + unified "^8.4.2" + unist-util-map "^1.0.5" + unist-util-remove "^1.0.3" + unist-util-visit "^1.4.1" + gatsby-plugin-page-creator@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-4.2.0.tgz#680b5cd446be8f569fa900c45bc602c58799abff" @@ -7917,7 +8217,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -github-slugger@^1.2.1: +github-slugger@^1.1.1, github-slugger@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.4.0.tgz#206eb96cdb22ee56fdc53a28d5a302338463444e" integrity sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ== @@ -8153,7 +8453,7 @@ graphql@^15.4.0, graphql@^15.7.2: resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.7.2.tgz#85ab0eeb83722977151b3feb4d631b5f2ab287ef" integrity sha512-AnnKk7hFQFmU/2I9YSQf3xw44ctnSFCfp3zE0N6W174gqe9fWG/2rKaKxROK7CcI3XtERpjEKFqts8o319Kf7A== -gray-matter@^4.0.3: +gray-matter@^4.0.2, 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== @@ -8321,16 +8621,52 @@ hast-util-from-parse5@^6.0.0: vfile-location "^3.2.0" web-namespaces "^1.0.0" +hast-util-has-property@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-2.0.0.tgz#c15cd6180f3e535540739fcc9787bcffb5708cae" + integrity sha512-4Qf++8o5v14us4Muv3HRj+Er6wTNGA/N9uCaZMty4JWvyFKLdhULrv4KE1b65AthsSO9TXSZnjuxS8ecIyhb0w== + +hast-util-heading-rank@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/hast-util-heading-rank/-/hast-util-heading-rank-2.1.0.tgz#c39f34fa8330ebfec03a08b5d5019ed56122029c" + integrity sha512-w+Rw20Q/iWp2Bcnr6uTrYU6/ftZLbHKhvc8nM26VIWpDqDMlku2iXUVTeOlsdoih/UKQhY7PHQ+vZ0Aqq8bxtQ== + dependencies: + "@types/hast" "^2.0.0" + hast-util-is-element@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz#3b3ed5159a2707c6137b48637fbfe068e175a425" integrity sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ== +hast-util-is-element@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-2.1.1.tgz#863019a27400dc4f1aedfa4900627f42fd75c2b7" + integrity sha512-ag0fiZfRWsPiR1udvnSbaazJLGv8qd8E+/e3rW8rUZhbKG4HNJmFL4QkEceN+22BgE+uozXY30z/s+2dL6Z++g== + dependencies: + "@types/hast" "^2.0.0" + "@types/unist" "^2.0.0" + hast-util-parse-selector@^2.0.0: version "2.2.5" resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a" integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ== +hast-util-raw@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977" + integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig== + dependencies: + "@types/hast" "^2.0.0" + hast-util-from-parse5 "^6.0.0" + hast-util-to-parse5 "^6.0.0" + html-void-elements "^1.0.0" + parse5 "^6.0.0" + unist-util-position "^3.0.0" + vfile "^4.0.0" + web-namespaces "^1.0.0" + xtend "^4.0.0" + zwitch "^1.0.0" + hast-util-raw@^6.0.2: version "6.1.0" resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.1.0.tgz#e16a3c2642f65cc7c480c165400a40d604ab75d0" @@ -8375,6 +8711,13 @@ hast-util-to-parse5@^6.0.0: xtend "^4.0.0" zwitch "^1.0.0" +hast-util-to-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-2.0.0.tgz#b008b0a4ea472bf34dd390b7eea1018726ae152a" + integrity sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A== + dependencies: + "@types/hast" "^2.0.0" + hast-util-whitespace@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41" @@ -8391,6 +8734,14 @@ hastscript@^6.0.0: property-information "^5.0.0" space-separated-tokens "^1.0.0" +header-case@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/header-case/-/header-case-1.0.1.tgz#9535973197c144b09613cd65d317ef19963bd02d" + integrity sha1-lTWXMZfBRLCWE81l0xfvGZY70C0= + dependencies: + no-case "^2.2.0" + upper-case "^1.1.3" + header-case@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/header-case/-/header-case-2.0.4.tgz#5a42e63b55177349cf405beb8d775acabb92c063" @@ -8478,6 +8829,18 @@ html-void-elements@^1.0.0: resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== +htmlparser2@^3.9.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" + htmlparser2@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-4.1.0.tgz#9a4ef161f2e4625ebf7dfbe6c0a2f52d18a59e78" @@ -8705,7 +9068,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -8815,7 +9178,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@^1.0.0: +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== @@ -9077,6 +9440,13 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= +is-lower-case@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-1.1.3.tgz#7e147be4768dc466db3bfb21cc60b31e6ad69393" + integrity sha1-fhR75HaNxGbbO/shzGCzHmrWk5M= + dependencies: + lower-case "^1.1.0" + is-lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-2.0.2.tgz#1c0884d3012c841556243483aa5d522f47396d2a" @@ -9269,6 +9639,13 @@ is-unc-path@^1.0.0: dependencies: unc-path-regex "^0.1.2" +is-upper-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-1.1.2.tgz#8d0b1fa7e7933a1e58483600ec7d9661cbaf756f" + integrity sha1-jQsfp+eTOh5YSDYA7H2WYcuvdW8= + dependencies: + upper-case "^1.1.0" + is-upper-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-2.0.2.tgz#f1105ced1fe4de906a5f39553e7d3803fd804649" @@ -9996,7 +10373,7 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2: +json5@^2.1.2, json5@^2.1.3: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== @@ -10286,6 +10663,16 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= +lodash.assignin@^4.0.9: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2" + integrity sha1-uo31+4QesKPoBEIysOJjqNxqKKI= + +lodash.bind@^4.1.4: + version "4.2.1" + resolved "https://registry.yarnpkg.com/lodash.bind/-/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35" + integrity sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU= + lodash.castarray@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.castarray/-/lodash.castarray-4.4.0.tgz#c02513515e309daddd4c24c60cfddcf5976d9115" @@ -10306,12 +10693,22 @@ lodash.deburr@^4.1.0: resolved "https://registry.yarnpkg.com/lodash.deburr/-/lodash.deburr-4.1.0.tgz#ddb1bbb3ef07458c0177ba07de14422cb033ff9b" integrity sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s= +lodash.defaults@^4.0.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= + lodash.every@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.every/-/lodash.every-4.6.0.tgz#eb89984bebc4364279bb3aefbbd1ca19bfa6c6a7" integrity sha1-64mYS+vENkJ5uzrvu9HKGb+mxqc= -lodash.flatten@^4.4.0: +lodash.filter@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.filter/-/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace" + integrity sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4= + +lodash.flatten@^4.2.0, lodash.flatten@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= @@ -10321,7 +10718,7 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= -lodash.foreach@^4.5.0: +lodash.foreach@^4.3.0, lodash.foreach@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53" integrity sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM= @@ -10346,7 +10743,7 @@ lodash.isstring@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= -lodash.map@^4.6.0: +lodash.map@^4.4.0, lodash.map@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM= @@ -10361,11 +10758,31 @@ lodash.memoize@^4.1.2: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.merge@^4.6.2: +lodash.merge@^4.4.0, lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash.pick@^4.2.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= + +lodash.reduce@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b" + integrity sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs= + +lodash.reject@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.reject/-/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415" + integrity sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU= + +lodash.some@^4.4.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" + integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= + lodash.template@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" @@ -10391,7 +10808,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash.uniq@^4.5.0: +lodash.uniq@4.5.0, lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= @@ -10423,6 +10840,13 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +lower-case-first@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-1.0.2.tgz#e5da7c26f29a7073be02d52bac9980e5922adfa1" + integrity sha1-5dp8JvKacHO+AtUrrJmA5ZIq36E= + dependencies: + lower-case "^1.1.2" + lower-case-first@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-2.0.2.tgz#64c2324a2250bf7c37c5901e76a5b5309301160b" @@ -10430,6 +10854,11 @@ lower-case-first@^2.0.2: dependencies: tslib "^2.0.3" +lower-case@^1.1.0, lower-case@^1.1.1, lower-case@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= + lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" @@ -10588,6 +11017,11 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== +markdown-table@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" + integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== + markdown-table@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" @@ -10600,6 +11034,20 @@ md5-file@^5.0.0: resolved "https://registry.yarnpkg.com/md5-file/-/md5-file-5.0.0.tgz#e519f631feca9c39e7f9ea1780b63c4745012e20" integrity sha512-xbEFXCYVWrSx/gEKS1VPlg84h/4L20znVIulKw6kMfmBUAZNAnF00eczz9ICMl+/hjQGo5KSXRxbL/47X3rmMw== +mdast-squeeze-paragraphs@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" + integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ== + dependencies: + unist-util-remove "^2.0.0" + +mdast-util-compact@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.4.tgz#d531bb7667b5123abf20859be086c4d06c894593" + integrity sha512-3YDMQHI5vRiS2uygEFYaqckibpJtKq5Sj2c8JioeOQBU6INpKbdWzfyLqFFnDwEcEnRFIdMsguzs5pC1Jp4Isg== + dependencies: + unist-util-visit "^1.1.0" + mdast-util-compact@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz#cabc69a2f43103628326f35b1acf735d55c99490" @@ -10742,6 +11190,20 @@ mdast-util-mdxjs-esm@^1.0.0: mdast-util-from-markdown "^1.0.0" mdast-util-to-markdown "^1.0.0" +mdast-util-to-hast@10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" + integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + mdast-util-definitions "^4.0.0" + mdurl "^1.0.0" + unist-builder "^2.0.0" + unist-util-generated "^1.0.0" + unist-util-position "^3.0.0" + unist-util-visit "^2.0.0" + mdast-util-to-hast@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz#61875526a017d8857b71abc9333942700b2d3604" @@ -10781,6 +11243,16 @@ mdast-util-to-markdown@^1.0.0: unist-util-visit "^4.0.0" zwitch "^2.0.0" +mdast-util-to-nlcst@^3.2.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/mdast-util-to-nlcst/-/mdast-util-to-nlcst-3.2.3.tgz#dcd0f51b59515b11a0700aeb40f168ed7ba9ed3d" + integrity sha512-hPIsgEg7zCvdU6/qvjcR6lCmJeRuIEpZGY5xBV+pqzuMOvQajyyF8b6f24f8k3Rw8u40GwkI3aAxUXr3bB2xag== + dependencies: + nlcst-to-string "^2.0.0" + repeat-string "^1.5.2" + unist-util-position "^3.0.0" + vfile-location "^2.0.0" + mdast-util-to-nlcst@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/mdast-util-to-nlcst/-/mdast-util-to-nlcst-4.0.1.tgz#ff8b5339c960b38209273fa8bf4dd7a9498f8636" @@ -10791,6 +11263,11 @@ mdast-util-to-nlcst@^4.0.0: unist-util-position "^3.0.0" vfile-location "^3.1.0" +mdast-util-to-string@^1.0.5, mdast-util-to-string@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527" + integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== + mdast-util-to-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" @@ -10801,6 +11278,16 @@ mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" integrity sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA== +mdast-util-toc@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-toc/-/mdast-util-toc-3.1.0.tgz#395eeb877f067f9d2165d990d77c7eea6f740934" + integrity sha512-Za0hqL1PqWrvxGtA/3NH9D5nhGAUS9grMM4obEAz5+zsk1RIw/vWUchkaoDLNdrwk05A0CSC5eEXng36/1qE5w== + dependencies: + github-slugger "^1.2.1" + mdast-util-to-string "^1.0.5" + unist-util-is "^2.1.2" + unist-util-visit "^1.1.0" + mdast-util-toc@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/mdast-util-toc/-/mdast-util-toc-5.1.0.tgz#3af0f9c9a764b993538af03f1f79f4e3cec22736" @@ -11298,7 +11785,7 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.4.4, mime@^2.5.2: +mime@^2.4.4, mime@^2.4.6, mime@^2.5.2: version "2.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== @@ -11623,6 +12110,13 @@ nlcst-to-string@^2.0.0: resolved "https://registry.yarnpkg.com/nlcst-to-string/-/nlcst-to-string-2.0.4.tgz#9315dfab80882bbfd86ddf1b706f53622dc400cc" integrity sha512-3x3jwTd6UPG7vi5k4GEzvxJ5rDA7hVUIRNHPblKuMVP9Z3xmlsd9cgLcpAMkc5uPOBna82EeshROFhsPkbnTZg== +no-case@^2.2.0, no-case@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== + dependencies: + lower-case "^1.1.1" + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -11904,6 +12398,13 @@ nth-check@^2.0.0: dependencies: boolbase "^1.0.0" +nth-check@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== + dependencies: + boolbase "~1.0.0" + null-loader@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/null-loader/-/null-loader-4.0.1.tgz#8e63bd3a2dd3c64236a4679428632edd0a6dbc6a" @@ -11932,7 +12433,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -12288,6 +12789,13 @@ pacote@^11.2.6: ssri "^8.0.1" tar "^6.1.0" +param-case@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" + integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= + dependencies: + no-case "^2.2.0" + param-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" @@ -12313,7 +12821,7 @@ parse-english@^4.0.0: unist-util-modify-children "^2.0.0" unist-util-visit-children "^1.0.0" -parse-entities@^1.1.0: +parse-entities@^1.0.2, parse-entities@^1.1.0: version "1.2.2" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50" integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg== @@ -12431,6 +12939,14 @@ parseurl@^1.3.3, parseurl@~1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== +pascal-case@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-2.0.1.tgz#2d578d3455f660da65eca18ef95b4e0de912761e" + integrity sha1-LVeNNFX2YNpl7KGO+VtODekSdh4= + dependencies: + camel-case "^3.0.0" + upper-case-first "^1.1.0" + pascal-case@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" @@ -12452,6 +12968,13 @@ password-prompt@^1.0.4: ansi-escapes "^3.1.0" cross-spawn "^6.0.5" +path-case@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/path-case/-/path-case-2.1.1.tgz#94b8037c372d3fe2906e465bb45e25d226e8eea5" + integrity sha1-lLgDfDctP+KQbkZbtF4l0ibo7qU= + dependencies: + no-case "^2.2.0" + path-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f" @@ -13185,7 +13708,7 @@ prettier@^2.4.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== -pretty-bytes@^5.4.1: +pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== @@ -13337,6 +13860,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -13391,6 +13919,11 @@ query-string@^6.13.8, query-string@^6.14.1: split-on-first "^1.0.0" strict-uri-encode "^2.0.0" +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + querystring@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" @@ -13650,7 +14183,7 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -13823,6 +14356,32 @@ regjsparser@^0.7.0: dependencies: jsesc "~0.5.0" +rehype-autolink-headings@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/rehype-autolink-headings/-/rehype-autolink-headings-6.1.0.tgz#9a06ae5446bfbe8148e0ed98329a566c4d7472e9" + integrity sha512-v8xnvhDtxc2jTgnhVlR2sG168TyNTK93Myx+uTzQNpNxzkRnQKz3hZQKoh7fxuOzJhCGa/z6qqZSPB2BOi/HRw== + dependencies: + "@types/hast" "^2.0.0" + extend "^3.0.0" + hast-util-has-property "^2.0.0" + hast-util-heading-rank "^2.0.0" + hast-util-is-element "^2.0.0" + unified "^10.0.0" + unist-util-visit "^4.0.0" + +rehype-slug@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/rehype-slug/-/rehype-slug-5.0.0.tgz#dfafa1d11577e206970f2d0de023f8490a99dc31" + integrity sha512-jnYsFKxRh+/tQa1L+SU/ykAPGOSVCqd0BwaOBPUANcvCu8d0/SZB4IalJkdJ+n6d1eAAS2YkvjUPi+2EGYtfCQ== + dependencies: + "@types/hast" "^2.0.0" + github-slugger "^1.1.1" + hast-util-has-property "^2.0.0" + hast-util-heading-rank "^2.0.0" + hast-util-to-string "^2.0.0" + unified "^10.0.0" + unist-util-visit "^4.0.0" + relay-compiler@12.0.0: version "12.0.0" resolved "https://registry.yarnpkg.com/relay-compiler/-/relay-compiler-12.0.0.tgz#9f292d483fb871976018704138423a96c8a45439" @@ -13863,6 +14422,11 @@ remark-code-import@^0.4.0: to-gatsby-remark-plugin "^0.1.0" unist-util-visit "^2.0.1" +remark-footnotes@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" + integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== + remark-footnotes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remark-footnotes/-/remark-footnotes-3.0.0.tgz#5756b56f8464fa7ed80dbba0c966136305d8cb8d" @@ -13879,6 +14443,20 @@ remark-gfm@^1.0.0: mdast-util-gfm "^0.1.0" micromark-extension-gfm "^0.3.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-mdx@^2.0.0-next.4: version "2.0.0-rc.2" resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.0.0-rc.2.tgz#07676a08f34cd292505414e5440927e1b7d26289" @@ -13898,6 +14476,28 @@ remark-mdxjs@^2.0.0-next.4: "@babel/plugin-syntax-jsx" "7.10.4" "@mdx-js/util" "^2.0.0-next.8" +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" @@ -13907,7 +14507,7 @@ remark-parse@^10.0.0: mdast-util-from-markdown "^1.0.0" unified "^10.0.0" -remark-parse@^6.0.3: +remark-parse@^6.0.0, remark-parse@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-6.0.3.tgz#c99131052809da482108413f87b0ee7f52180a3a" integrity sha512-QbDXWN4HfKTUC0hHa4teU463KclLAnwpn/FBn87j9cKYJWWawbiLgMfP2Q4XwhxxuuuOxHlw+pSN0OKuJwyVvg== @@ -13935,6 +14535,13 @@ remark-parse@^9.0.0: dependencies: mdast-util-from-markdown "^0.8.0" +remark-retext@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/remark-retext/-/remark-retext-3.1.3.tgz#77173b1d9d13dab15ce5b38d996195fea522ee7f" + integrity sha512-UujXAm28u4lnUvtOZQFYfRIhxX+auKI9PuA2QpQVTT7gYk1OgX6o0OUrSo1KOa6GNrFX+OODOtS5PWIHPxM7qw== + dependencies: + mdast-util-to-nlcst "^3.2.0" + remark-retext@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/remark-retext/-/remark-retext-4.0.0.tgz#255ed98ac3e0a68da5c6ba4f172299b8d062bb28" @@ -13942,6 +14549,13 @@ remark-retext@^4.0.0: dependencies: mdast-util-to-nlcst "^4.0.0" +remark-squeeze-paragraphs@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead" + integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw== + dependencies: + mdast-squeeze-paragraphs "^4.0.0" + remark-stringify@^10.0.0: version "10.0.1" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-10.0.1.tgz#9422dd20803892570a5e3d16801ffe081340ff06" @@ -13951,6 +14565,26 @@ remark-stringify@^10.0.0: mdast-util-to-markdown "^1.0.0" unified "^10.0.0" +remark-stringify@^6.0.0: + version "6.0.4" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-6.0.4.tgz#16ac229d4d1593249018663c7bddf28aafc4e088" + integrity sha512-eRWGdEPMVudijE/psbIDNcnJLRVx3xhfuEsTDGgH4GsFF91dVhw5nhmnBppafJ7+NWINW6C7ZwWbi30ImJzqWg== + dependencies: + ccount "^1.0.0" + is-alphanumeric "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + longest-streak "^2.0.1" + markdown-escapes "^1.0.0" + markdown-table "^1.1.0" + mdast-util-compact "^1.0.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + stringify-entities "^1.0.1" + unherit "^1.0.4" + xtend "^4.0.1" + remark-stringify@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-8.1.1.tgz#e2a9dc7a7bf44e46a155ec78996db896780d8ce5" @@ -13978,6 +14612,15 @@ remark-stringify@^9.0.0, remark-stringify@^9.0.1: dependencies: mdast-util-to-markdown "^0.6.0" +remark@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/remark/-/remark-10.0.1.tgz#3058076dc41781bf505d8978c291485fe47667df" + integrity sha512-E6lMuoLIy2TyiokHprMjcWNJ5UxfGQjaMSMhV+f4idM625UjjK4j798+gPs5mfjzDE6vL0oFKVeZM6gZVSVrzQ== + dependencies: + remark-parse "^6.0.0" + remark-stringify "^6.0.0" + unified "^7.0.0" + remark@^13.0.0: version "13.0.0" resolved "https://registry.yarnpkg.com/remark/-/remark-13.0.0.tgz#d15d9bf71a402f40287ebe36067b66d54868e425" @@ -14018,11 +14661,16 @@ repeat-element@^1.1.2: resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== -repeat-string@^1.0.0, repeat-string@^1.5.4, repeat-string@^1.6.1: +repeat-string@^1.0.0, repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= +replace-ext@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= + request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -14059,6 +14707,11 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +"require-like@>= 0.1.1": + version "0.1.2" + resolved "https://registry.yarnpkg.com/require-like/-/require-like-0.1.2.tgz#ad6f30c13becd797010c468afa775c0c0a6b47fa" + integrity sha1-rW8wwTvs15cBDEaK+ndcDAprR/o= + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -14356,6 +15009,14 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" +sentence-case@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-2.1.1.tgz#1f6e2dda39c168bf92d13f86d4a918933f667ed4" + integrity sha1-H24t2jnBaL+S0T+G1KkYkz9mftQ= + dependencies: + no-case "^2.2.0" + upper-case-first "^1.1.2" + sentence-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-3.0.4.tgz#3645a7b8c117c787fde8702056225bb62a45131f" @@ -14527,6 +15188,11 @@ slide@^1.1.6: resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= +slugify@^1.4.4: + version "1.6.3" + resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.6.3.tgz#325aec50871acfb17976f2d3cb09ee1e7ab563be" + integrity sha512-1MPyqnIhgiq+/0iDJyqSJHENdnH5MMIlgJIBxmkRMzTNKlS/QsN5dXsB+MdDq4E6w0g9jFA4XOTRkVDjDae/2w== + slugify@^1.6.1: version "1.6.2" resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.6.2.tgz#4cb97220a2278e1b86fb017c6da668e6a865354c" @@ -14537,6 +15203,13 @@ smart-buffer@^4.1.0: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== +snake-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-2.1.0.tgz#41bdb1b73f30ec66a04d4e2cad1b76387d4d6d9f" + integrity sha1-Qb2xtz8w7GagTU4srRt2OH1NbZ8= + dependencies: + no-case "^2.2.0" + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -14657,6 +15330,11 @@ sort-keys@^4.0.0: dependencies: is-plain-obj "^2.0.0" +source-list-map@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1" + integrity sha1-mIkBnRAkzOVc3AaUmDN+9hhqEaE= + source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -14696,7 +15374,7 @@ source-map@0.7.3, source-map@^0.7.3, source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -source-map@^0.5.0, source-map@^0.5.6: +source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -14855,6 +15533,17 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +static-site-generator-webpack-plugin@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/static-site-generator-webpack-plugin/-/static-site-generator-webpack-plugin-3.4.2.tgz#ad9fd0a4fb8b6f439a7a66018320b459bdb6d916" + integrity sha512-39Kn+fZDVjolLYuX5y1rDvksJIW0QEUaEC/AVO/UewNXxGzoSQI1UYnRsL+ocAcN5Yti6d6rJgEL0qZ5tNXfdw== + dependencies: + bluebird "^3.0.5" + cheerio "^0.22.0" + eval "^0.1.0" + url "^0.11.0" + webpack-sources "^0.2.0" + "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -14966,6 +15655,16 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +stringify-entities@^1.0.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.2.tgz#a98417e5471fd227b3e45d3db1861c11caf668f7" + integrity sha512-nrBAQClJAPN2p+uGCVJRPIPakKeKWZ9GtBCmormE7pWOSlHat7+x5A8gx85M7HM5Dt0BP3pP5RhVW77WdbJJ3A== + dependencies: + character-entities-html4 "^1.0.0" + character-entities-legacy "^1.0.0" + is-alphanumerical "^1.0.0" + is-hexadecimal "^1.0.0" + stringify-entities@^3.0.0, stringify-entities@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-3.1.0.tgz#b8d3feac256d9ffcc9fa1fefdcf3ca70576ee903" @@ -15078,7 +15777,7 @@ style-loader@^2.0.0: loader-utils "^2.0.0" schema-utils "^3.0.0" -style-to-object@^0.3.0: +style-to-object@0.3.0, style-to-object@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== @@ -15156,6 +15855,14 @@ svgo@^2.7.0: picocolors "^1.0.0" stable "^0.1.8" +swap-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-1.1.2.tgz#c39203a4587385fad3c850a0bd1bcafa081974e3" + integrity sha1-w5IDpFhzhfrTyFCgvRvK+ggZdOM= + dependencies: + lower-case "^1.1.1" + upper-case "^1.1.1" + swap-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-2.0.2.tgz#671aedb3c9c137e2985ef51c51f9e98445bf70d9" @@ -15371,6 +16078,14 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= +title-case@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" + integrity sha1-PhJyFtpY0rxb7PE3q5Ha46fNj6o= + dependencies: + no-case "^2.2.0" + upper-case "^1.0.3" + title-case@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/title-case/-/title-case-3.0.3.tgz#bc689b46f02e411f1d1e1d081f7c3deca0489982" @@ -15765,6 +16480,18 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== +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" @@ -15778,6 +16505,20 @@ unified@^10.0.0, unified@^10.1.0: trough "^2.0.0" vfile "^5.0.0" +unified@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13" + integrity sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw== + dependencies: + "@types/unist" "^2.0.0" + "@types/vfile" "^3.0.0" + bail "^1.0.0" + extend "^3.0.0" + is-plain-obj "^1.1.0" + trough "^1.0.0" + vfile "^3.0.0" + x-is-string "^0.1.0" + unified@^8.4.2: version "8.4.2" resolved "https://registry.yarnpkg.com/unified/-/unified-8.4.2.tgz#13ad58b4a437faa2751a4a4c6a16f680c500fff1" @@ -15832,7 +16573,7 @@ unique-string@^2.0.0: dependencies: crypto-random-string "^2.0.0" -unist-builder@^2.0.0: +unist-builder@2.0.3, unist-builder@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== @@ -15842,6 +16583,11 @@ unist-util-generated@^1.0.0: resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== +unist-util-is@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.3.tgz#459182db31f4742fceaea88d429693cbf0043d20" + integrity sha512-4WbQX2iwfr/+PfM4U3zd2VNXY+dWtZsN1fLnWEi2QQXA4qyDYAZcDMfXUX0Cu6XZUHHAO9q4nyxxLT4Awk1qUA== + unist-util-is@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" @@ -15857,6 +16603,13 @@ unist-util-is@^5.0.0: resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.1.1.tgz#e8aece0b102fa9bc097b0fef8f870c496d4a6236" integrity sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ== +unist-util-map@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/unist-util-map/-/unist-util-map-1.0.5.tgz#701069b72e1d1cc02db265502a5e82b77c2eb8b7" + integrity sha512-dFil/AN6vqhnQWNCZk0GF/G3+Q5YwsB+PqjnzvpO2wzdRtUJ1E8PN+XRE/PRr/G3FzKjRTJU0haqE0Ekl+O3Ag== + dependencies: + object-assign "^4.0.1" + unist-util-modify-children@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-2.0.0.tgz#9c9c30d4e32502aabb3fde10d7872a17c86801e2" @@ -15883,6 +16636,13 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" +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@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-3.0.0.tgz#4cd19e82c8e665f462b6acfcfd0a8353235a88e9" @@ -15898,6 +16658,13 @@ unist-util-remove-position@^4.0.0: "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" +unist-util-remove@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unist-util-remove/-/unist-util-remove-1.0.3.tgz#58ec193dfa84b52d5a055ffbc58e5444eb8031a3" + integrity sha512-mB6nCHCQK0pQffUAcCVmKgIWzG/AXs/V8qpS8K72tMPtOSCMSjDeMc5yN+Ye8rB0FhcE+JvW++o1xRNc0R+++g== + dependencies: + unist-util-is "^3.0.0" + unist-util-remove@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588" @@ -15916,6 +16683,11 @@ unist-util-select@^3.0.4: unist-util-is "^4.0.0" zwitch "^1.0.0" +unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" + integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== + 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" @@ -15958,14 +16730,7 @@ unist-util-visit-parents@^5.0.0: "@types/unist" "^2.0.0" unist-util-is "^5.0.0" -unist-util-visit@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" - integrity sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw== - dependencies: - unist-util-visit-parents "^2.0.0" - -unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-util-visit@^2.0.2, unist-util-visit@^2.0.3: +unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-util-visit@^2.0.2, unist-util-visit@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== @@ -15974,6 +16739,13 @@ unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-util-visit@^2.0.2, unist unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" +unist-util-visit@^1.1.0, unist-util-visit@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" + integrity sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw== + dependencies: + unist-util-visit-parents "^2.0.0" + unist-util-visit@^4.0.0, unist-util-visit@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.0.tgz#f41e407a9e94da31594e6b1c9811c51ab0b3d8f5" @@ -16048,6 +16820,13 @@ update-notifier@^5.1.0: semver-diff "^3.1.1" xdg-basedir "^4.0.0" +upper-case-first@^1.1.0, upper-case-first@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-1.1.2.tgz#5d79bedcff14419518fd2edb0a0507c9b6859115" + integrity sha1-XXm+3P8UQZUY/S7bCgUHybaFkRU= + dependencies: + upper-case "^1.1.1" + upper-case-first@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" @@ -16055,6 +16834,11 @@ upper-case-first@^2.0.2: dependencies: tslib "^2.0.3" +upper-case@^1.0.3, upper-case@^1.1.0, upper-case@^1.1.1, upper-case@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= + upper-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-2.0.2.tgz#d89810823faab1df1549b7d97a76f8662bae6f7a" @@ -16090,6 +16874,14 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -16201,11 +16993,26 @@ vfile-location@^2.0.0: resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e" integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA== -vfile-location@^3.1.0, vfile-location@^3.2.0: +vfile-location@^3.0.0, vfile-location@^3.1.0, vfile-location@^3.2.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-message@*, vfile-message@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-3.0.2.tgz#db7eaebe7fecb853010f2ef1664427f52baf8f74" + integrity sha512-UUjZYIOg9lDRwwiBAuezLIsu9KlXntdxwG+nXnjuQAHvBpcX3x0eN8h+I7TkY5nkCXj+cWVp4ZqebtGBvok8ww== + dependencies: + "@types/unist" "^2.0.0" + unist-util-stringify-position "^3.0.0" + +vfile-message@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" + integrity sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA== + dependencies: + unist-util-stringify-position "^1.1.1" + vfile-message@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" @@ -16214,13 +17021,15 @@ vfile-message@^2.0.0: "@types/unist" "^2.0.0" unist-util-stringify-position "^2.0.0" -vfile-message@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-3.0.2.tgz#db7eaebe7fecb853010f2ef1664427f52baf8f74" - integrity sha512-UUjZYIOg9lDRwwiBAuezLIsu9KlXntdxwG+nXnjuQAHvBpcX3x0eN8h+I7TkY5nkCXj+cWVp4ZqebtGBvok8ww== +vfile@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" + integrity sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ== dependencies: - "@types/unist" "^2.0.0" - unist-util-stringify-position "^3.0.0" + is-buffer "^2.0.0" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + vfile-message "^1.0.0" vfile@^4.0.0: version "4.2.1" @@ -16323,6 +17132,14 @@ webpack-merge@^5.8.0: clone-deep "^4.0.1" wildcard "^2.0.0" +webpack-sources@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb" + integrity sha1-F8Yr+vE8cH+dAsR54Nzd6DgGl/s= + dependencies: + source-list-map "^1.1.1" + source-map "~0.5.3" + webpack-sources@^1.1.0: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" @@ -16563,6 +17380,11 @@ ws@~7.4.2: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +x-is-string@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + integrity sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI= + xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" From 96f16af6f1d760ae9b79cd82de2329abbf32b5b7 Mon Sep 17 00:00:00 2001 From: John Rom Date: Tue, 30 Nov 2021 10:40:41 -0500 Subject: [PATCH 08/10] Allow disabling errors on missing snippets, add an automatic watch task for generating gatsby-config.js. --- .vscode/tasks.json | 12 ++++++++++++ packages/code-snippets-website/gatsby-config.js | 9 ++++----- .../code-snippets-website/gatsby-config.src.js | 7 +++---- packages/code-snippets-website/package.json | 3 ++- .../code-snippets/src/extract-code-snippet.ts | 4 +--- packages/remark-code-snippets/src/index.ts | 15 ++++++++++++++- 6 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 43a2013..abd13a4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -34,6 +34,18 @@ "runOptions": { "runOn": "folderOpen" } + }, + { + "type": "npm", + "script": "watch:config", + "path": "packages/code-snippets-website/", + "group": "none", + "problemMatcher": [], + "label": "npm: watch:config - packages/code-snippets-website", + "detail": "rollup -c -w", + "runOptions": { + "runOn": "folderOpen" + } } ] } diff --git a/packages/code-snippets-website/gatsby-config.js b/packages/code-snippets-website/gatsby-config.js index 579b61c..c5c6497 100644 --- a/packages/code-snippets-website/gatsby-config.js +++ b/packages/code-snippets-website/gatsby-config.js @@ -1192,18 +1192,17 @@ module.exports = { options: { extensions: [`.md`, `.mdx`], remarkPlugins: [ + [remarkCodeImport__default["default"], { async: false, basePath: process.cwd() }], [ - remarkCodeImport__default["default"], + remarkCodeSnippets.RemarkPluginCodeSnippets, { - async: true, - basePath: process.cwd(), + throwOnMissingSnippet: false, }, ], - [remarkCodeSnippets.RemarkPluginCodeSnippets, {}], ], rehypePlugins: [ // Generate heading ids for rehype-autolink-headings - rehypeSlug, + [rehypeSlug, {}], // To pass options, use a 2-element array with the // configuration in an object in the second element [rehypeAutolinkHeadings, { behavior: 'wrap' }], diff --git a/packages/code-snippets-website/gatsby-config.src.js b/packages/code-snippets-website/gatsby-config.src.js index 575203d..dc5e5f3 100644 --- a/packages/code-snippets-website/gatsby-config.src.js +++ b/packages/code-snippets-website/gatsby-config.src.js @@ -15,14 +15,13 @@ module.exports = { options: { extensions: [`.md`, `.mdx`], remarkPlugins: [ + [remarkCodeImport, { async: false, basePath: process.cwd() }], [ - remarkCodeImport, + RemarkPluginCodeSnippets, { - async: false, - basePath: process.cwd(), + throwOnMissingSnippet: false, }, ], - [RemarkPluginCodeSnippets, {}], ], rehypePlugins: [ // Generate heading ids for rehype-autolink-headings diff --git a/packages/code-snippets-website/package.json b/packages/code-snippets-website/package.json index f901b0a..529797a 100644 --- a/packages/code-snippets-website/package.json +++ b/packages/code-snippets-website/package.json @@ -13,7 +13,8 @@ "start": "gatsby develop", "build": "gatsby build", "serve": "gatsby serve", - "clean": "gatsby clean" + "clean": "gatsby clean", + "watch:config": "rollup -c -w" }, "dependencies": { "@johnrom/remark-code-import": "0.4.1-beta1", diff --git a/packages/code-snippets/src/extract-code-snippet.ts b/packages/code-snippets/src/extract-code-snippet.ts index 1ffc0de..391beb2 100644 --- a/packages/code-snippets/src/extract-code-snippet.ts +++ b/packages/code-snippets/src/extract-code-snippet.ts @@ -63,7 +63,5 @@ export const extractCodeSnippet = ( return snippet; } - throw new Error( - `@nmbl/code-snippets: SnippetId does not exist: '${snippetId}'` - ); + return undefined; }; diff --git a/packages/remark-code-snippets/src/index.ts b/packages/remark-code-snippets/src/index.ts index 09754dd..a20c5a0 100644 --- a/packages/remark-code-snippets/src/index.ts +++ b/packages/remark-code-snippets/src/index.ts @@ -13,6 +13,7 @@ export interface PluginOptions { extractSnippets?: boolean; removeSnippets?: boolean; removeDuplicateEmptyNewlines?: boolean | 'always'; + throwOnMissingSnippet?: boolean; } export const RemarkPluginCodeSnippets: Plugin< @@ -24,6 +25,7 @@ export const RemarkPluginCodeSnippets: Plugin< extractSnippets = true, removeSnippets = true, removeDuplicateEmptyNewlines: configRemoveDuplicateEmptyNewlines = false, + throwOnMissingSnippet = true, } = options ?? {}; return (tree) => { visit(tree, 'code', (node) => { @@ -43,12 +45,23 @@ export const RemarkPluginCodeSnippets: Plugin< return; } - node.value = extractCodeSnippet( + let snippet = extractCodeSnippet( node.lang, node.value, snippetId, eol ); + + if (typeof snippet === 'undefined') { + if (throwOnMissingSnippet) { + throw new Error( + `@nmbl/remark-code-snippets: SnippetId does not exist: '${snippetId}'` + ); + } + } + + node.value = snippet ?? ''; + processed = true; } } From e20dcec5ad1b1707ea01b360627cb558ca0d8f38 Mon Sep 17 00:00:00 2001 From: John Rom Date: Tue, 30 Nov 2021 10:54:51 -0500 Subject: [PATCH 09/10] Add styles back and ignore gatsby-config.js (it is built by a task). --- packages/code-snippets-website/.gitignore | 3 +- .../code-snippets-website/gatsby-config.js | 1232 ----------------- .../gatsby-config.src.js | 36 +- .../src/pages/{mdx.frontmatter__slug}.tsx | 4 +- 4 files changed, 23 insertions(+), 1252 deletions(-) delete mode 100644 packages/code-snippets-website/gatsby-config.js diff --git a/packages/code-snippets-website/.gitignore b/packages/code-snippets-website/.gitignore index 816462c..839fbca 100644 --- a/packages/code-snippets-website/.gitignore +++ b/packages/code-snippets-website/.gitignore @@ -1,4 +1,5 @@ node_modules/ .cache/ public -.generated/ \ No newline at end of file +.generated/ +/gatsby-config.js \ No newline at end of file diff --git a/packages/code-snippets-website/gatsby-config.js b/packages/code-snippets-website/gatsby-config.js deleted file mode 100644 index c5c6497..0000000 --- a/packages/code-snippets-website/gatsby-config.js +++ /dev/null @@ -1,1232 +0,0 @@ -'use strict'; - -var remarkCodeImport = require('@johnrom/remark-code-import'); -var remarkCodeSnippets = require('@nmbl/remark-code-snippets'); -var Slugger = require('github-slugger'); -var extend = require('extend'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var remarkCodeImport__default = /*#__PURE__*/_interopDefaultLegacy(remarkCodeImport); -var Slugger__default = /*#__PURE__*/_interopDefaultLegacy(Slugger); -var extend__default = /*#__PURE__*/_interopDefaultLegacy(extend); - -var own = {}.hasOwnProperty; - -/** - * Check if `node` has a set `name` property. - * - * @param {unknown} node - * @param {string} name - * @returns {boolean} - */ -function hasProperty(node, name) { - /** @type {unknown} */ - var value = - name && - node && - typeof node === 'object' && - // @ts-ignore Looks like a node. - node.type === 'element' && - // @ts-ignore Looks like an element. - node.properties && - // @ts-ignore Looks like an element. - own.call(node.properties, name) && - // @ts-ignore Looks like an element. - node.properties[name]; - - return value !== null && value !== undefined && value !== false -} - -/** - * @typedef {import('hast').Parent} Parent - * @typedef {import('hast').Root} Root - * @typedef {Root|Parent['children'][number]} Node - */ - -/** - * Rank of a heading: H1 -> 1, H2 -> 2, etc. - * - * @param {Node} node - * @returns {number|null} - */ -function headingRank(node) { - var name = - (node && node.type === 'element' && node.tagName.toLowerCase()) || ''; - var code = - name.length === 2 && name.charCodeAt(0) === 104 /* `h` */ - ? name.charCodeAt(1) - : 0; - return code > 48 /* `0` */ && code < 55 /* `7` */ ? code - 48 /* `0` */ : null -} - -/** - * @fileoverview - * Get the plain-text value of a hast node. - * @longdescription - * ## Use - * - * ```js - * import {h} from 'hastscript' - * import {toString} from 'hast-util-to-string' - * - * toString(h('p', 'Alpha')) - * //=> 'Alpha' - * toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.'])) - * //=> 'Bold and italic.' - * ``` - * - * ## API - * - * ### `toString(node)` - * - * Transform a node to a string. - */ - -/** - * @typedef {import('hast').Root} Root - * @typedef {import('hast').Element} Element - * @typedef {Root|Root['children'][number]} Node - */ - -/** - * Get the plain-text value of a hast node. - * - * @param {Node} node - * @returns {string} - */ -function toString(node) { - // “The concatenation of data of all the Text node descendants of the context - // object, in tree order.” - if ('children' in node) { - return all(node) - } - - // “Context object’s data.” - return 'value' in node ? node.value : '' -} - -/** - * @param {Node} node - * @returns {string} - */ -function one(node) { - if (node.type === 'text') { - return node.value - } - - return 'children' in node ? all(node) : '' -} - -/** - * @param {Root|Element} node - * @returns {string} - */ -function all(node) { - let index = -1; - /** @type {string[]} */ - const result = []; - - while (++index < node.children.length) { - result[index] = one(node.children[index]); - } - - return result.join('') -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test - */ - -const convert$1 = - /** - * @type {( - * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok$1 - } - - if (typeof test === 'string') { - return typeFactory$1(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory$2(test) : propsFactory$1(test) - } - - if (typeof test === 'function') { - return castFactory$2(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.} tests - * @returns {AssertAnything} - */ -function anyFactory$2(tests) { - /** @type {Array.} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert$1(tests[index]); - } - - return castFactory$2(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory$1(check) { - return castFactory$2(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory$1(check) { - return castFactory$2(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$2(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok$1() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color$1(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('./complex-types').Action} Action - * @typedef {import('./complex-types').Index} Index - * @typedef {import('./complex-types').ActionTuple} ActionTuple - * @typedef {import('./complex-types').VisitorResult} VisitorResult - * @typedef {import('./complex-types').Visitor} Visitor - */ - -/** - * Continue traversing as normal - */ -const CONTINUE$1 = true; -/** - * Do not traverse this node’s children - */ -const SKIP$1 = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT$1 = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents$1 = - /** - * @type {( - * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & - * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {import('./complex-types').Visitor} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert$1(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.} parents - */ - function factory(node, index, parents) { - /** @type {Object.} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color$1(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult$1(visitor(node, parents)); - - if (result[0] === EXIT$1) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP$1) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT$1) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult$1(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE$1, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - * @typedef {import('./complex-types').Visitor} Visitor - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit$1 = - /** - * @type {( - * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & - * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {import('./complex-types').Visitor} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents$1(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('hast').Root} Root - */ - -const slugs = new Slugger__default["default"](); - -/** - * Plugin to add `id`s to headings. - * - * @type {import('unified').Plugin<[], Root>} - */ -function rehypeSlug() { - return (tree) => { - slugs.reset(); - - visit$1(tree, 'element', (node) => { - if (headingRank(node) && node.properties && !hasProperty(node, 'id')) { - node.properties.id = slugs.slug(toString(node)); - } - }); - } -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('hast').Element} Element - * - * @typedef {string} TagName - * @typedef {null|undefined|TagName|TestFunctionAnything|Array.} Test - */ - -const convertElement = - /** - * @type {( - * ((test: T['tagName']|TestFunctionPredicate) => AssertPredicate) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return element - } - - if (typeof test === 'string') { - return tagNameFactory(test) - } - - if (typeof test === 'object') { - return anyFactory$1(test) - } - - if (typeof test === 'function') { - return castFactory$1(test) - } - - throw new Error('Expected function, string, or array as test') - } - ); - -/** - * @param {Array.} tests - * @returns {AssertAnything} - */ -function anyFactory$1(tests) { - /** @type {Array.} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convertElement(tests[index]); - } - - return castFactory$1(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) { - return true - } - } - - return false - } -} - -/** - * Utility to convert a string into a function which checks a given node’s tag - * name for said string. - * - * @param {TagName} check - * @returns {AssertAnything} - */ -function tagNameFactory(check) { - return tagName - - /** - * @param {unknown} node - * @returns {boolean} - */ - function tagName(node) { - return element(node) && node.tagName === check - } -} - -/** - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory$1(check) { - return assertion - - /** - * @this {unknown} - * @param {unknown} node - * @param {Array.} parameters - * @returns {boolean} - */ - function assertion(node, ...parameters) { - // @ts-expect-error: fine. - return element(node) && Boolean(check.call(this, node, ...parameters)) - } -} - -/** - * Utility to return true if this is an element. - * @param {unknown} node - * @returns {node is Element} - */ -function element(node) { - return Boolean( - node && - typeof node === 'object' && - // @ts-expect-error Looks like a node. - node.type === 'element' && - // @ts-expect-error Looks like an element. - typeof node.tagName === 'string' - ) -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * - * @typedef {string} Type - * @typedef {Object} Props - * - * @typedef {null|undefined|Type|Props|TestFunctionAnything|Array.} Test - */ - -const convert = - /** - * @type {( - * ((test: T['type']|Partial|TestFunctionPredicate) => AssertPredicate) & - * ((test?: Test) => AssertAnything) - * )} - */ - ( - /** - * Generate an assertion from a check. - * @param {Test} [test] - * When nullish, checks if `node` is a `Node`. - * When `string`, works like passing `function (node) {return node.type === test}`. - * When `function` checks if function passed the node is true. - * When `object`, checks that all keys in test are in node, and that they have (strictly) equal values. - * When `array`, checks any one of the subtests pass. - * @returns {AssertAnything} - */ - function (test) { - if (test === undefined || test === null) { - return ok - } - - if (typeof test === 'string') { - return typeFactory(test) - } - - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory(test) : propsFactory(test) - } - - if (typeof test === 'function') { - return castFactory(test) - } - - throw new Error('Expected function, string, or object as test') - } - ); -/** - * @param {Array.} tests - * @returns {AssertAnything} - */ -function anyFactory(tests) { - /** @type {Array.} */ - const checks = []; - let index = -1; - - while (++index < tests.length) { - checks[index] = convert(tests[index]); - } - - return castFactory(any) - - /** - * @this {unknown} - * @param {unknown[]} parameters - * @returns {boolean} - */ - function any(...parameters) { - let index = -1; - - while (++index < checks.length) { - if (checks[index].call(this, ...parameters)) return true - } - - return false - } -} - -/** - * Utility to assert each property in `test` is represented in `node`, and each - * values are strictly equal. - * - * @param {Props} check - * @returns {AssertAnything} - */ -function propsFactory(check) { - return castFactory(all) - - /** - * @param {Node} node - * @returns {boolean} - */ - function all(node) { - /** @type {string} */ - let key; - - for (key in check) { - // @ts-expect-error: hush, it sure works as an index. - if (node[key] !== check[key]) return false - } - - return true - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * - * @param {Type} check - * @returns {AssertAnything} - */ -function typeFactory(check) { - return castFactory(type) - - /** - * @param {Node} node - */ - function type(node) { - return node && node.type === check - } -} - -/** - * Utility to convert a string into a function which checks a given node’s type - * for said string. - * @param {TestFunctionAnything} check - * @returns {AssertAnything} - */ -function castFactory(check) { - return assertion - - /** - * @this {unknown} - * @param {Array.} parameters - * @returns {boolean} - */ - function assertion(...parameters) { - // @ts-expect-error: spreading is fine. - return Boolean(check.call(this, ...parameters)) - } -} - -// Utility to return true. -function ok() { - return true -} - -/** - * @param {string} d - * @returns {string} - */ -function color(d) { - return '\u001B[33m' + d + '\u001B[39m' -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('./complex-types').Action} Action - * @typedef {import('./complex-types').Index} Index - * @typedef {import('./complex-types').ActionTuple} ActionTuple - * @typedef {import('./complex-types').VisitorResult} VisitorResult - * @typedef {import('./complex-types').Visitor} Visitor - */ - -/** - * Continue traversing as normal - */ -const CONTINUE = true; -/** - * Do not traverse this node’s children - */ -const SKIP = 'skip'; -/** - * Stop traversing immediately - */ -const EXIT = false; - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test node, optional - * @param visitor Function to run for each node - * @param reverse Visit the tree in reverse order, defaults to false - */ -const visitParents = - /** - * @type {( - * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & - * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {import('./complex-types').Visitor} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - // @ts-expect-error no visitor given, so `visitor` is test. - visitor = test; - test = null; - } - - const is = convert(test); - const step = reverse ? -1 : 1; - - factory(tree, null, [])(); - - /** - * @param {Node} node - * @param {number?} index - * @param {Array.} parents - */ - function factory(node, index, parents) { - /** @type {Object.} */ - // @ts-expect-error: hush - const value = typeof node === 'object' && node !== null ? node : {}; - /** @type {string|undefined} */ - let name; - - if (typeof value.type === 'string') { - name = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : undefined; - - Object.defineProperty(visit, 'name', { - value: - 'node (' + - color(value.type + (name ? '<' + name + '>' : '')) + - ')' - }); - } - - return visit - - function visit() { - /** @type {ActionTuple} */ - let result = []; - /** @type {ActionTuple} */ - let subresult; - /** @type {number} */ - let offset; - /** @type {Array.} */ - let grandparents; - - if (!test || is(node, index, parents[parents.length - 1] || null)) { - result = toResult(visitor(node, parents)); - - if (result[0] === EXIT) { - return result - } - } - - // @ts-expect-error looks like a parent. - if (node.children && result[0] !== SKIP) { - // @ts-expect-error looks like a parent. - offset = (reverse ? node.children.length : -1) + step; - // @ts-expect-error looks like a parent. - grandparents = parents.concat(node); - - // @ts-expect-error looks like a parent. - while (offset > -1 && offset < node.children.length) { - // @ts-expect-error looks like a parent. - subresult = factory(node.children[offset], offset, grandparents)(); - - if (subresult[0] === EXIT) { - return subresult - } - - offset = - typeof subresult[1] === 'number' ? subresult[1] : offset + step; - } - } - - return result - } - } - } - ); - -/** - * @param {VisitorResult} value - * @returns {ActionTuple} - */ -function toResult(value) { - if (Array.isArray(value)) { - return value - } - - if (typeof value === 'number') { - return [CONTINUE, value] - } - - return [value] -} - -/** - * @typedef {import('unist').Node} Node - * @typedef {import('unist').Parent} Parent - * @typedef {import('unist-util-is').Test} Test - * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult - * @typedef {import('./complex-types').Visitor} Visitor - */ - -/** - * Visit children of tree which pass a test - * - * @param tree Abstract syntax tree to walk - * @param test Test, optional - * @param visitor Function to run for each node - * @param reverse Fisit the tree in reverse, defaults to false - */ -const visit = - /** - * @type {( - * ((tree: Tree, test: Check, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) & - * ((tree: Tree, visitor: import('./complex-types').BuildVisitor, reverse?: boolean) => void) - * )} - */ - ( - /** - * @param {Node} tree - * @param {Test} test - * @param {import('./complex-types').Visitor} visitor - * @param {boolean} [reverse] - */ - function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - - visitParents(tree, test, overload, reverse); - - /** - * @param {Node} node - * @param {Array.} parents - */ - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor( - node, - parent ? parent.children.indexOf(node) : null, - parent - ) - } - } - ); - -/** - * @typedef {import('hast').Root} Root - * @typedef {import('hast').Parent} Parent - * @typedef {import('hast').Element} Element - * @typedef {Element['children'][number]} ElementChild - * @typedef {import('hast').Properties} Properties - * @typedef {import('hast-util-is-element').Test} Test - * - * @typedef {'prepend'|'append'|'wrap'|'before'|'after'} Behavior - * - * @callback Build - * @param {Element} node - * @returns {ElementChild|ElementChild[]} - * - * @typedef Options - * Configuration. - * @property {Behavior} [behavior='prepend'] - * How to create links. - * @property {Behavior} [behaviour] - * Please use `behavior` instead - * @property {Properties} [properties] - * Extra properties to set on the link when injecting. - * Defaults to `{ariaHidden: true, tabIndex: -1}` when `'prepend'` or - * `'append'`. - * @property {ElementChild|ElementChild[]|Build} [content={type: 'element', tagName: 'span', properties: {className: ['icon', 'icon-link']}, children: []}] - * hast nodes to insert in the link. - * @property {ElementChild|ElementChild[]|Build} [group] - * hast node to wrap the heading and link with, if `behavior` is `'before'` or - * `'after'`. - * There is no default. - * @property {Test} [test] - * Test to define which heading elements are linked. - * Any test that can be given to `hast-util-is-element` is supported. - * The default (no test) is to link all headings. - * Can be used to link only h1-h3, or for example all except h1. - */ - -/** @type {Element} */ -const contentDefaults = { - type: 'element', - tagName: 'span', - properties: {className: ['icon', 'icon-link']}, - children: [] -}; - -/** - * Plugin to automatically add links to headings (h1-h6). - * - * @type {import('unified').Plugin<[Options?]|void[], Root>} - */ -function rehypeAutolinkHeadings(options = {}) { - let props = options.properties; - const behavior = options.behaviour || options.behavior || 'prepend'; - const content = options.content || contentDefaults; - const group = options.group; - const is = convertElement(options.test); - - /** @type {import('unist-util-visit').Visitor} */ - let method; - - if (behavior === 'wrap') { - method = wrap; - } else if (behavior === 'before' || behavior === 'after') { - method = around; - } else { - if (!props) { - props = {ariaHidden: 'true', tabIndex: -1}; - } - - method = inject; - } - - return (tree) => { - visit(tree, 'element', (node, index, parent) => { - if ( - headingRank(node) && - hasProperty(node, 'id') && - is(node, index, parent) - ) { - return method(node, index, parent) - } - }); - } - - /** @type {import('unist-util-visit').Visitor} */ - function inject(node) { - node.children[behavior === 'prepend' ? 'unshift' : 'push']( - create(node, extend__default["default"](true, {}, props), toChildren(content, node)) - ); - - return [SKIP] - } - - /** @type {import('unist-util-visit').Visitor} */ - function around(node, index, parent) { - // Uncommon. - /* c8 ignore next */ - if (typeof index !== 'number' || !parent) return - - const link = create( - node, - extend__default["default"](true, {}, props), - toChildren(content, node) - ); - let nodes = behavior === 'before' ? [link, node] : [node, link]; - - if (group) { - const grouping = toNode(group, node); - - if (grouping && !Array.isArray(grouping) && grouping.type === 'element') { - grouping.children = nodes; - nodes = [grouping]; - } - } - - parent.children.splice(index, 1, ...nodes); - - return [SKIP, index + nodes.length] - } - - /** @type {import('unist-util-visit').Visitor} */ - function wrap(node) { - node.children = [create(node, extend__default["default"](true, {}, props), node.children)]; - return [SKIP] - } - - /** - * @param {ElementChild|ElementChild[]|Build} value - * @param {Element} node - * @returns {ElementChild[]} - */ - function toChildren(value, node) { - const result = toNode(value, node); - return Array.isArray(result) ? result : [result] - } - - /** - * @param {ElementChild|ElementChild[]|Build} value - * @param {Element} node - * @returns {ElementChild|ElementChild[]} - */ - function toNode(value, node) { - if (typeof value === 'function') return value(node) - return extend__default["default"](true, Array.isArray(value) ? [] : {}, value) - } - - /** - * @param {Element} node - * @param {Properties} props - * @param {ElementChild[]} children - * @returns {Element} - */ - function create(node, props, children) { - return { - type: 'element', - tagName: 'a', - properties: Object.assign({}, props, { - // Fix hast types and make them required. - /* c8 ignore next */ - href: '#' + (node.properties || {}).id - }), - children - } - } -} - -module.exports = { - siteMetadata: { - siteUrl: 'https://codesnip.local', - title: 'Nmbl Code Snippets - Documentation', - }, - plugins: [ - // @snippet:start gatsby-plugin-mdx - { - resolve: `gatsby-plugin-mdx`, - options: { - extensions: [`.md`, `.mdx`], - remarkPlugins: [ - [remarkCodeImport__default["default"], { async: false, basePath: process.cwd() }], - [ - remarkCodeSnippets.RemarkPluginCodeSnippets, - { - throwOnMissingSnippet: false, - }, - ], - ], - rehypePlugins: [ - // Generate heading ids for rehype-autolink-headings - [rehypeSlug, {}], - // To pass options, use a 2-element array with the - // configuration in an object in the second element - [rehypeAutolinkHeadings, { behavior: 'wrap' }], - ], - }, - }, - // @snippet:end gatsby-plugin-mdx - 'gatsby-plugin-postcss', - 'gatsby-plugin-typescript', - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'pages', - path: `${__dirname}/src/pages/`, - }, - __key: 'pages', - }, - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'content', - path: `${__dirname}/content`, - }, - __key: 'content', - }, - ], -}; diff --git a/packages/code-snippets-website/gatsby-config.src.js b/packages/code-snippets-website/gatsby-config.src.js index dc5e5f3..e077f51 100644 --- a/packages/code-snippets-website/gatsby-config.src.js +++ b/packages/code-snippets-website/gatsby-config.src.js @@ -9,6 +9,24 @@ module.exports = { title: 'Nmbl Code Snippets - Documentation', }, plugins: [ + 'gatsby-plugin-postcss', + 'gatsby-plugin-typescript', + { + resolve: 'gatsby-source-filesystem', + options: { + name: 'pages', + path: `${__dirname}/src/pages/`, + }, + __key: 'pages', + }, + { + resolve: 'gatsby-source-filesystem', + options: { + name: 'content', + path: `${__dirname}/content`, + }, + __key: 'content', + }, // @snippet:start gatsby-plugin-mdx { resolve: `gatsby-plugin-mdx`, @@ -33,23 +51,5 @@ module.exports = { }, }, // @snippet:end gatsby-plugin-mdx - 'gatsby-plugin-postcss', - 'gatsby-plugin-typescript', - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'pages', - path: `${__dirname}/src/pages/`, - }, - __key: 'pages', - }, - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'content', - path: `${__dirname}/content`, - }, - __key: 'content', - }, ], }; diff --git a/packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx b/packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx index d1ee363..419bca0 100644 --- a/packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx +++ b/packages/code-snippets-website/src/pages/{mdx.frontmatter__slug}.tsx @@ -11,7 +11,9 @@ const MarkdownPage = ({ data }: MarkdownPageProps) => { const { mdx } = data; return ( - {mdx.body} +
+ {mdx.body} +
); }; From c1cf1e71e688bfb4f881293fefe5c18427430f8a Mon Sep 17 00:00:00 2001 From: John Rom Date: Tue, 30 Nov 2021 13:49:29 -0500 Subject: [PATCH 10/10] Autolink, syntax highlighting, docs fixes. --- helpers/getBaseRollupConfig.js | 2 +- helpers/getBaseRollupConfig.ts | 2 +- .../content/docs/index.md | 2 +- .../content/docs/installing.md | 2 +- .../gatsby-config.src.js | 18 +++---- packages/code-snippets-website/package.json | 3 +- .../src/shared-layout.tsx | 1 + yarn.lock | 54 +++++++++++++++++++ 8 files changed, 70 insertions(+), 14 deletions(-) diff --git a/helpers/getBaseRollupConfig.js b/helpers/getBaseRollupConfig.js index f6d5f63..a47862b 100644 --- a/helpers/getBaseRollupConfig.js +++ b/helpers/getBaseRollupConfig.js @@ -7,7 +7,7 @@ import babel from '@rollup/plugin-babel'; import typescript from 'rollup-plugin-typescript2'; import path from 'path'; const extensions = ['.js', '.jsx', '.ts', '.tsx']; -const esmOnlyPackages = [/unist/, /rehype/, /hast/]; +const esmOnlyPackages = [/unist/, /rehype/, /hast/, /lowlight/, /fault/]; const esmExternal = (source) => !source.startsWith('.') && !path.isAbsolute(source); // we pack ESM-only packages for CJS users, just to be nice. export const cjsExternal = (source) => esmExternal(source) && diff --git a/helpers/getBaseRollupConfig.ts b/helpers/getBaseRollupConfig.ts index ec7b078..066da38 100644 --- a/helpers/getBaseRollupConfig.ts +++ b/helpers/getBaseRollupConfig.ts @@ -12,7 +12,7 @@ type RollupConfigCallback = (config: RollupOptions) => RollupOptions; const extensions = ['.js', '.jsx', '.ts', '.tsx']; -const esmOnlyPackages = [/unist/, /rehype/, /hast/]; +const esmOnlyPackages = [/unist/, /rehype/, /hast/, /lowlight/, /fault/]; const esmExternal = (source: string) => !source.startsWith('.') && !path.isAbsolute(source); diff --git a/packages/code-snippets-website/content/docs/index.md b/packages/code-snippets-website/content/docs/index.md index 5f579b5..2cc72ff 100644 --- a/packages/code-snippets-website/content/docs/index.md +++ b/packages/code-snippets-website/content/docs/index.md @@ -49,7 +49,7 @@ If you're reading this on an actual website (not the source code, silly), and th Not convinced? That's ok, too. Here's a llama: -> ``` +> ```plaintext > \\ > l'> > ll diff --git a/packages/code-snippets-website/content/docs/installing.md b/packages/code-snippets-website/content/docs/installing.md index fe4be2b..b54ac1c 100644 --- a/packages/code-snippets-website/content/docs/installing.md +++ b/packages/code-snippets-website/content/docs/installing.md @@ -110,7 +110,7 @@ npm install gatsby-plugin-mdx @nmbl/remark-code-snippets Then, add it to remarkPlugins: -```js file=../code-snippets-website/gatsby-config.js snippet=gatsby-plugin-mdx--remarkPlugins +```js file=../code-snippets-website/gatsby-config.src.js snippet=gatsby-plugin-mdx ``` diff --git a/packages/code-snippets-website/gatsby-config.src.js b/packages/code-snippets-website/gatsby-config.src.js index e077f51..c541f22 100644 --- a/packages/code-snippets-website/gatsby-config.src.js +++ b/packages/code-snippets-website/gatsby-config.src.js @@ -2,6 +2,7 @@ import remarkCodeImport from '@johnrom/remark-code-import'; import { RemarkPluginCodeSnippets } from '@nmbl/remark-code-snippets'; import rehypeSlug from 'rehype-slug'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; +import rehypeHighlight from 'rehype-highlight'; module.exports = { siteMetadata: { @@ -34,19 +35,18 @@ module.exports = { extensions: [`.md`, `.mdx`], remarkPlugins: [ [remarkCodeImport, { async: false, basePath: process.cwd() }], - [ - RemarkPluginCodeSnippets, - { - throwOnMissingSnippet: false, - }, - ], + [RemarkPluginCodeSnippets, {}], ], rehypePlugins: [ // Generate heading ids for rehype-autolink-headings [rehypeSlug, {}], - // To pass options, use a 2-element array with the - // configuration in an object in the second element - [rehypeAutolinkHeadings, { behavior: 'wrap' }], + [ + rehypeAutolinkHeadings, + { + behavior: 'wrap', + }, + ], + [rehypeHighlight], ], }, }, diff --git a/packages/code-snippets-website/package.json b/packages/code-snippets-website/package.json index 529797a..d69975c 100644 --- a/packages/code-snippets-website/package.json +++ b/packages/code-snippets-website/package.json @@ -11,7 +11,7 @@ "develop": "gatsby develop", "debug": "node --nolazy --inspect-brk=9016 -- ../../node_modules/gatsby/dist/bin/gatsby develop", "start": "gatsby develop", - "build": "gatsby build", + "build": "rollup -c && gatsby build", "serve": "gatsby serve", "clean": "gatsby clean", "watch:config": "rollup -c -w" @@ -34,6 +34,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "rehype-autolink-headings": "^6.1.0", + "rehype-highlight": "^5.0.0", "rehype-slug": "^5.0.0" }, "devDependencies": { diff --git a/packages/code-snippets-website/src/shared-layout.tsx b/packages/code-snippets-website/src/shared-layout.tsx index e1fd8f6..b3c0f80 100644 --- a/packages/code-snippets-website/src/shared-layout.tsx +++ b/packages/code-snippets-website/src/shared-layout.tsx @@ -2,6 +2,7 @@ import React, { PropsWithChildren } from 'react'; import { Footer } from './footer/footer'; import { Header } from './header/header'; import './style.css'; +import 'highlight.js/styles/vs2015.css'; export const SharedLayout = (props: PropsWithChildren<{}>) => (
diff --git a/yarn.lock b/yarn.lock index 3c05e52..2a1503e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7224,6 +7224,13 @@ fastq@^1.13.0, fastq@^1.6.0: dependencies: reusify "^1.0.4" +fault@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fault/-/fault-2.0.1.tgz#d47ca9f37ca26e4bd38374a7c500b5a384755b6c" + integrity sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ== + dependencies: + format "^0.2.0" + fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -7443,6 +7450,11 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +format@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" + integrity sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs= + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -8718,6 +8730,15 @@ hast-util-to-string@^2.0.0: dependencies: "@types/hast" "^2.0.0" +hast-util-to-text@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/hast-util-to-text/-/hast-util-to-text-3.1.1.tgz#b7699a75f7a61af6e0befb67660cd78460d96dc6" + integrity sha512-7S3mOBxACy8syL45hCn3J7rHqYaXkxRfsX6LXEU5Shz4nt4GxdjtMUtG+T6G/ZLUHd7kslFAf14kAN71bz30xA== + dependencies: + "@types/hast" "^2.0.0" + hast-util-is-element "^2.0.0" + unist-util-find-after "^4.0.0" + hast-util-whitespace@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41" @@ -8768,6 +8789,11 @@ highlight.js@^10.4.1: resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== +highlight.js@~11.3.0: + version "11.3.1" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.3.1.tgz#813078ef3aa519c61700f84fe9047231c5dc3291" + integrity sha512-PUhCRnPjLtiLHZAQ5A/Dt5F8cWZeMyj9KRsACsWT+OD6OP0x6dp5OmT5jdx0JgEyPxPZZIPQpRN2TciUT7occw== + hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" @@ -10876,6 +10902,15 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lowlight@^2.0.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-2.4.1.tgz#59ea891967ec83395f2d61de8cbfe3fa9cd401c7" + integrity sha512-mQkAG0zGQ9lcYecEft+hl9uV1fD6HpURA83/TYrsxKvb8xX2mfyB+aaV/A/aWmhhEcWVzr9Cc+l/fvUYfEUumw== + dependencies: + "@types/hast" "^2.0.0" + fault "^2.0.0" + highlight.js "~11.3.0" + lru-cache@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.0.tgz#b5cbf01556c16966febe54ceec0fb4dc90df6c28" @@ -14369,6 +14404,17 @@ rehype-autolink-headings@^6.1.0: unified "^10.0.0" unist-util-visit "^4.0.0" +rehype-highlight@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/rehype-highlight/-/rehype-highlight-5.0.0.tgz#a1814e31180bcc55c37f66c289df69c3d004ece1" + integrity sha512-LXbdRzHM0PNzVfHvbiF+r/BZzCHSdtpSTCnJej6ZuvJKDKRVfwl0Io5b81gWqUnfZmpzjhPAzm5es4iikv1jzg== + dependencies: + "@types/hast" "^2.0.0" + hast-util-to-text "^3.0.0" + lowlight "^2.0.0" + unified "^10.0.0" + unist-util-visit "^4.0.0" + rehype-slug@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/rehype-slug/-/rehype-slug-5.0.0.tgz#dfafa1d11577e206970f2d0de023f8490a99dc31" @@ -16578,6 +16624,14 @@ unist-builder@2.0.3, unist-builder@^2.0.0: resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== +unist-util-find-after@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/unist-util-find-after/-/unist-util-find-after-4.0.0.tgz#1101cebf5fed88ae3c6f3fa676e86fd5772a4f32" + integrity sha512-gfpsxKQde7atVF30n5Gff2fQhAc4/HTOV4CvkXpTg9wRfQhZWdXitpyXHWB6YcYgnsxLx+4gGHeVjCTAAp9sjw== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^5.0.0" + unist-util-generated@^1.0.0: version "1.1.6" resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b"