From ca0daa36c241d929f511a292f5471bd213aedb9f Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Mon, 18 May 2020 14:26:57 -0700 Subject: [PATCH] do not commit generated content to VCS; closes #3713 (#4289) * do not commit generated content to VCS This removes `markdown-magic` and replaces its functionality with the built-in data capabilities of 11ty. The TOC, `--help` output, and source files are now all done via global data scripts in `docs/_data`. When building documentation, we will no longer get changes to e.g., `docs/index.md` because of the automatically generated content. * add inclusive language plugin to eleventy Usage of the words as defined in options will result in a warning, and will not break the build. Also: Eleventy should ignore the historical changelogs in `docs/changelogs`. --- .eleventy.js | 8 + .eslintrc.yml | 1 + docs/.eleventyignore | 1 + docs/README.md | 2 +- docs/_data/files.js | 50 ++ docs/_data/toc.js | 21 + docs/_data/usage.js | 21 + docs/api-tutorials/custom-reporter.md | 67 +-- docs/changelogs/README.md | 7 + docs/index.md | 153 +----- package-lock.json | 700 ++++++++++++++++++-------- package-scripts.js | 20 +- package.json | 3 +- scripts/markdown-magic.config.js | 105 ---- 14 files changed, 611 insertions(+), 548 deletions(-) create mode 100644 docs/_data/files.js create mode 100644 docs/_data/toc.js create mode 100644 docs/_data/usage.js create mode 100644 docs/changelogs/README.md delete mode 100644 scripts/markdown-magic.config.js diff --git a/.eleventy.js b/.eleventy.js index 7f0b10c975..04a49f2df9 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,6 +1,14 @@ 'use strict'; module.exports = function(eleventyConfig) { + eleventyConfig.addPlugin( + require('@11ty/eleventy-plugin-inclusive-language'), + { + words: + 'simply,obviously,basically,of course,clearly,everyone knows,however,easy' + } + ); + eleventyConfig.addPassthroughCopy('docs/css'); eleventyConfig.addPassthroughCopy('docs/js'); eleventyConfig.addPassthroughCopy('docs/images'); diff --git a/.eslintrc.yml b/.eslintrc.yml index 0834c5c9d2..2a3fa281df 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -36,6 +36,7 @@ overrides: - test/integration/options/watch.spec.js - test/integration/helpers.js - lib/growl.js + - docs/_data/**/*.js parserOptions: ecmaVersion: 2018 env: diff --git a/docs/.eleventyignore b/docs/.eleventyignore index c81ddf9d39..cb6f694698 100644 --- a/docs/.eleventyignore +++ b/docs/.eleventyignore @@ -4,3 +4,4 @@ LICENSE* .* _dist/ example/ +changelogs/ diff --git a/docs/README.md b/docs/README.md index ab083fe29d..f85b53adec 100644 --- a/docs/README.md +++ b/docs/README.md @@ -34,7 +34,7 @@ _So you wanna build the site?_ cp: docs/_dist/_headers: No such file or directory ``` -- See `package-scripts.js` for details on what the builds are actually doing; especially see [markdown-magic](https://npm.im/markdown-magic) for how we're dynamically inserting information into `docs/index.md`. +- See `package-scripts.js` for details on what the builds are actually doing. ## License diff --git a/docs/_data/files.js b/docs/_data/files.js new file mode 100644 index 0000000000..abbf25cbfe --- /dev/null +++ b/docs/_data/files.js @@ -0,0 +1,50 @@ +'use strict'; + +const {resolve, relative, dirname} = require('path'); +const {readFileSync} = require('fs'); + +const PROJECT_ROOT_DIR = resolve(__dirname, '..', '..'); +const FILES = [ + { + slug: 'simplereporter', + path: require.resolve('../../test/integration/fixtures/simple-reporter.js'), + header: '// my-reporter.js' + } +]; + +const HEADER = '```js\n'; +const FOOTER = '```\n'; + +const loadFile = (path, {header} = {}) => { + const relativeDir = relative(dirname(path), PROJECT_ROOT_DIR); + let content = readFileSync(path, 'utf-8'); + // replace relative paths in `require()` to root with "mocha". + // might not work in the general case. not gonna parse an AST for this + // e.g. `require('../../lib/foo')` => `require('mocha/lib/foo')` + // also trim any trailing whitespace + content = content + .replace( + new RegExp(`require\\(['"]${relativeDir}(.*?)['"]\\)`, 'g'), + "require('mocha$1')" + ) + .trim(); + return `${HEADER}${header}\n\n${content}${FOOTER}`; +}; + +/** + * Loads files from disk (see `FILES` above) to be shown as data. + * Used for embedding sources directly into pages + */ +module.exports = () => { + const files = FILES.map(({path, header, slug}) => { + const content = loadFile(path, {header}); + return {slug, content}; + }); + return files.reduce( + (files, {slug, content}) => ({ + ...files, + [slug]: content + }), + {} + ); +}; diff --git a/docs/_data/toc.js b/docs/_data/toc.js new file mode 100644 index 0000000000..9937c6fc10 --- /dev/null +++ b/docs/_data/toc.js @@ -0,0 +1,21 @@ +'use strict'; + +const markdownToc = require('markdown-toc'); +const {readFileSync} = require('fs'); +const {resolve} = require('path'); + +const IGNORED_HEADINGS_REGEXP = /Features|Table of Contents|Backers|Sponsors/i; +const DOCUMENT_PATH = resolve(__dirname, '..', 'index.md'); + +module.exports = () => { + const doc = readFileSync(DOCUMENT_PATH, 'utf-8'); + return markdownToc(doc, { + slugify: require('uslug'), + firsth1: false, + bullets: '-', + maxdepth: 2, + // if filter is supplied, maxdepth is apparently ignored, + // so we have to do it ourselves. + filter: (str, ele) => ele.lvl < 2 && !IGNORED_HEADINGS_REGEXP.test(str) + }).content; +}; diff --git a/docs/_data/usage.js b/docs/_data/usage.js new file mode 100644 index 0000000000..ee13a19de9 --- /dev/null +++ b/docs/_data/usage.js @@ -0,0 +1,21 @@ +'use strict'; + +const stripAnsi = require('strip-ansi'); +const {resolve} = require('path'); +const {execSync} = require('child_process'); + +const executable = require.resolve('../../bin/mocha'); +const flag = '--help'; + +/** + * Return the output of `mocha --help` for display + */ +module.exports = () => { + return stripAnsi( + String( + execSync(`"${process.execPath}" ${executable} ${flag}`, { + cwd: resolve(__dirname, '..') + }) + ).trim() + ); +}; diff --git a/docs/api-tutorials/custom-reporter.md b/docs/api-tutorials/custom-reporter.md index a0cfe48d66..d858b99970 100644 --- a/docs/api-tutorials/custom-reporter.md +++ b/docs/api-tutorials/custom-reporter.md @@ -6,70 +6,7 @@ For example, if `mocha-foo-reporter` was published to the npm registry, you coul If you're looking to get started quickly, here's an example of a custom reporter: - - -```js -// my-reporter.js -'use strict'; - -const Mocha = require('mocha'); -const { - EVENT_RUN_BEGIN, - EVENT_RUN_END, - EVENT_TEST_FAIL, - EVENT_TEST_PASS, - EVENT_SUITE_BEGIN, - EVENT_SUITE_END -} = Mocha.Runner.constants; - -// this reporter outputs test results, indenting two spaces per suite -class MyReporter { - constructor(runner) { - this._indents = 0; - const stats = runner.stats; - - runner - .once(EVENT_RUN_BEGIN, () => { - console.log('start'); - }) - .on(EVENT_SUITE_BEGIN, () => { - this.increaseIndent(); - }) - .on(EVENT_SUITE_END, () => { - this.decreaseIndent(); - }) - .on(EVENT_TEST_PASS, test => { - // Test#fullTitle() returns the suite name(s) - // prepended to the test title - console.log(`${this.indent()}pass: ${test.fullTitle()}`); - }) - .on(EVENT_TEST_FAIL, (test, err) => { - console.log( - `${this.indent()}fail: ${test.fullTitle()} - error: ${err.message}` - ); - }) - .once(EVENT_RUN_END, () => { - console.log(`end: ${stats.passes}/${stats.passes + stats.failures} ok`); - }); - } - - indent() { - return Array(this._indents).join(' '); - } - - increaseIndent() { - this._indents++; - } - - decreaseIndent() { - this._indents--; - } -} - -module.exports = MyReporter; -``` - - +{{ files.simplereporter }} To use this reporter, execute `mocha --reporter /path/to/my-reporter.js`. @@ -110,4 +47,4 @@ The event names are exported from the `constants` property of `Mocha.Runner`: **Please use these constants** instead of the event names in your own reporter! This will ensure compatibility with future versions of Mocha. -> It's important to understand that all `Suite` callbacks will be run _before_ the {@link Runner} emits `EVENT_RUN_BEGIN`. Hooks and tests, however, won't run until _after_ the {@link Runner} emits `EVENT_RUN_BEGIN`. +> It's important to understand that all `Suite` callbacks will be run _before_ the {@link Runner} emits `EVENT_RUN_BEGIN`. Hooks and tests won't run until _after_ the {@link Runner} emits `EVENT_RUN_BEGIN`. diff --git a/docs/changelogs/README.md b/docs/changelogs/README.md new file mode 100644 index 0000000000..2c059575d2 --- /dev/null +++ b/docs/changelogs/README.md @@ -0,0 +1,7 @@ +# Historical Changelogs + +These are changelogs for (very) old versions of Mocha. + +These changelogs are _not_ included in the website, and are here only for archival purposes. + +_If you're looking for the current changelog, [here is the current changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)._ diff --git a/docs/index.md b/docs/index.md index 415430a3d4..7f44f34acc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,12 +8,12 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in -{% include backers.md %} {% include sponsors.md %} +{% include backers.md %} ## Features @@ -49,39 +49,7 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in ## Table of Contents - - -- [Installation](#installation) -- [Getting Started](#getting-started) -- [Run Cycle Overview](#run-cycle-overview) -- [Detects Multiple Calls to `done()`](#detects-multiple-calls-to-done) -- [Assertions](#assertions) -- [Asynchronous Code](#asynchronous-code) -- [Synchronous Code](#synchronous-code) -- [Arrow Functions](#arrow-functions) -- [Hooks](#hooks) -- [Pending Tests](#pending-tests) -- [Exclusive Tests](#exclusive-tests) -- [Inclusive Tests](#inclusive-tests) -- [Retry Tests](#retry-tests) -- [Dynamically Generating Tests](#dynamically-generating-tests) -- [Timeouts](#timeouts) -- [Diffs](#diffs) -- [Command-Line Usage](#command-line-usage) -- [Interfaces](#interfaces) -- [Reporters](#reporters) -- [Node.JS native ESM support](#nodejs-native-esm-support) -- [Running Mocha in the Browser](#running-mocha-in-the-browser) -- [Desktop Notification Support](#desktop-notification-support) -- [Configuring Mocha (Node.js)](#configuring-mocha-nodejs) -- [The `test/` Directory](#the-test-directory) -- [Error Codes](#error-codes) -- [Editor Plugins](#editor-plugins) -- [Examples](#examples) -- [Testing Mocha](#testing-mocha) -- [More Information](#more-information) - - +{{ toc }} ## Installation @@ -233,7 +201,7 @@ Mocha allows you to use any assertion library you wish. In the above example, we ## Asynchronous Code -Testing asynchronous code with Mocha could not be simpler! Simply invoke the callback when your test is complete. By adding a callback (usually named `done`) to `it()`, Mocha will know that it should wait for this function to be called to complete the test. This callback accepts both an `Error` instance (or subclass thereof) _or_ a falsy value; anything else is invalid usage and throws an error (usually causing a failed test). +By adding an argument (usually named `done`) to `it()` to a test callback, Mocha will know that it should wait for this function to be called to complete the test. This callback accepts both an `Error` instance (or subclass thereof) _or_ a falsy value; anything else is invalid usage and throws an error (usually causing a failed test). ```js describe('User', function() { @@ -249,7 +217,7 @@ describe('User', function() { }); ``` -Alternatively, just use the `done()` callback directly (which will handle an error argument, if it exists): +Alternatively, use the `done()` callback directly (which will handle an error argument, if it exists): ```js describe('User', function() { @@ -345,7 +313,7 @@ describe('my suite', () => { }); ``` -_If you do not need to use_ Mocha's context, lambdas should work. However, the result will be more difficult to refactor if the need eventually arises. +_If you do not need to use_ Mocha's context, lambdas should work. Be aware that using lambdas will be more painful to refactor if the need eventually arises! ## Hooks @@ -451,7 +419,7 @@ setTimeout(function() { ## Pending Tests -"Pending"--as in "someone should write these test cases eventually"--test-cases are simply those _without_ a callback: +"Pending"--as in "someone should write these test cases eventually"--test-cases are those _without_ a callback: ```js describe('Array', function() { @@ -565,7 +533,7 @@ _Note_: Hooks, if present, will still be executed. ## Inclusive Tests -This feature is the inverse of `.only()`. By appending `.skip()`, you may tell Mocha to simply ignore test case(s). Anything skipped will be marked as [pending](#pending-tests), and reported as such. Here's an example of skipping an individual test: +This feature is the inverse of `.only()`. By appending `.skip()`, you may tell Mocha to ignore test case(s). Anything skipped will be marked as [pending](#pending-tests), and reported as such. Here's an example of skipping an individual test: ```js describe('Array', function() { @@ -820,92 +788,9 @@ Mocha supports the `err.expected` and `err.actual` properties of any thrown `Ass ## Command-Line Usage - - -```text - -mocha [spec..] - -Run tests with Mocha - -Commands - mocha inspect [spec..] Run tests with Mocha [default] - mocha init create a client-side Mocha setup at - -Rules & Behavior - --allow-uncaught Allow uncaught errors to propagate [boolean] - --async-only, -A Require all tests to use a callback (async) or - return a Promise [boolean] - --bail, -b Abort ("bail") after first test failure [boolean] - --check-leaks Check for global variable leaks [boolean] - --delay Delay initial execution of root suite [boolean] - --exit Force Mocha to quit after tests complete [boolean] - --forbid-only Fail if exclusive test(s) encountered [boolean] - --forbid-pending Fail if pending test(s) encountered [boolean] - --global, --globals List of allowed global variables [array] - --retries Retry failed tests this many times [number] - --slow, -s Specify "slow" test threshold (in milliseconds) - [string] [default: 75] - --timeout, -t, --timeouts Specify test timeout threshold (in milliseconds) - [string] [default: 2000] - --ui, -u Specify user interface [string] [default: "bdd"] - -Reporting & Output - --color, -c, --colors Force-enable color output [boolean] - --diff Show diff on failure - [boolean] [default: true] - --full-trace Display full stack traces [boolean] - --growl, -G Enable Growl notifications [boolean] - --inline-diffs Display actual/expected differences - inline within each string [boolean] - --reporter, -R Specify reporter to use - [string] [default: "spec"] - --reporter-option, --reporter-options, Reporter-specific options - -O () [array] - -Configuration - --config Path to config file [string] [default: (nearest rc file)] - --package Path to package.json for config [string] - -File Handling - --extension File extension(s) to load - [array] [default: ["js","cjs","mjs"]] - --file Specify file(s) to be loaded prior to root suite - execution [array] [default: (none)] - --ignore, --exclude Ignore file(s) or glob pattern(s) - [array] [default: (none)] - --recursive Look for tests in subdirectories [boolean] - --require, -r Require module [array] [default: (none)] - --sort, -S Sort test files [boolean] - --watch, -w Watch files in the current working directory for changes - [boolean] - --watch-files List of paths or globs to watch [array] - --watch-ignore List of paths or globs to exclude from watching - [array] [default: ["node_modules",".git"]] - -Test Filters - --fgrep, -f Only run tests containing this string [string] - --grep, -g Only run tests matching this string or regexp [string] - --invert, -i Inverts --grep and --fgrep matches [boolean] - -Positional Arguments - spec One or more files, directories, or globs to test - [array] [default: ["test"]] - -Other Options - --help, -h Show usage information & exit [boolean] - --version, -V Show version number & exit [boolean] - --list-interfaces List built-in user interfaces & exit [boolean] - --list-reporters List built-in reporters & exit [boolean] - -Mocha Resources - Chat: https://gitter.im/mochajs/mocha - GitHub: https://github.com/mochajs/mocha.git - Docs: https://mochajs.org/ - ``` - - +{{ usage }} +``` ### `--allow-uncaught` @@ -943,7 +828,7 @@ _Prior to_ version v4.0.0, _by default_, Mocha would force its own process to ex The _default behavior_ in v4.0.0 (and newer) is `--no-exit`, where previously it was `--exit`. -**The easiest way to "fix" the issue is to simply pass `--exit` to the Mocha process.** It _can_ be time-consuming to debug — because it's not always obvious where the problem is — but it _is_ recommended to do so. +**The easiest way to "fix" the issue is to pass `--exit` to the Mocha process.** It _can_ be time-consuming to debug — because it's not always obvious where the problem is — but it _is_ recommended to do so. To ensure your tests aren't leaving messes around, here are some ideas to get started: @@ -970,7 +855,7 @@ Enforce a rule that tests may not be skipped (use of e.g., `describe.skip()`, `i Define a global variable name. For example, suppose your app deliberately exposes a global named `app` and `YUI`, you may want to add `--global app --global YUI`. -`--global` accepts wildcards. You could do `--global '*bar'` and it would match `foobar`, `barbar`, etc. You can also simply pass in `'*'` to ignore all globals. +`--global` accepts wildcards. You could do `--global '*bar'` and it would match `foobar`, `barbar`, etc. You can also pass in `'*'` to ignore all globals. `--global` can accept a comma-delimited list; `--global app,YUI` is equivalent to `--global app --global YUI`. @@ -1243,7 +1128,7 @@ Mocha's "interface" system allows developers to choose their style of DSL. Mocha The **BDD** interface provides `describe()`, `context()`, `it()`, `specify()`, `before()`, `after()`, `beforeEach()`, and `afterEach()`. -`context()` is just an alias for `describe()`, and behaves the same way; it just provides a way to keep tests easier to read and organized. Similarly, `specify()` is an alias for `it()`. +`context()` is just an alias for `describe()`, and behaves the same way; it provides a way to keep tests easier to read and organized. Similarly, `specify()` is an alias for `it()`. > All of the previous examples were written using the **BDD** interface. @@ -1313,7 +1198,7 @@ module.exports = { ### QUnit -The [QUnit][]-inspired interface matches the "flat" look of QUnit, where the test suite title is simply defined before the test-cases. Like TDD, it uses `suite()` and `test()`, but resembling BDD, it also contains `before()`, `after()`, `beforeEach()`, and `afterEach()`. +The [QUnit][]-inspired interface matches the "flat" look of QUnit, where the test suite title is defined _before_ the test-cases. Like TDD, it uses `suite()` and `test()`, but resembling BDD, it also contains `before()`, `after()`, `beforeEach()`, and `afterEach()`. ```js function ok(expr, msg) { @@ -1383,7 +1268,7 @@ This is the default reporter. The Spec reporter outputs a hierarchical view nest Alias: `Dot`, `dot` -The Dot Matrix reporter is simply a series of characters which represent test cases. Failures highlight in red exclamation marks (`!`), pending tests with a blue comma (`,`), and slow tests as yellow. Good if you prefer minimal output. +The Dot Matrix reporter is a series of characters which represent test cases. Failures highlight in red exclamation marks (`!`), pending tests with a blue comma (`,`), and slow tests as yellow. Good if you prefer minimal output. ![dot matrix reporter](images/reporter-dot.png?withoutEnlargement&resize=920,9999){:class="screenshot" lazyload="on"} @@ -1863,7 +1748,7 @@ The plugin is titled **NodeJS**, and can be installed via **Preferences** > **Pl #### Features - see all tests in VS Code sidebar menu -- run & debug tests for each level hierarchy from all tests to a single test (and each describe of course) +- run & debug tests for each level hierarchy from all tests to a single test (and each suite) - auto run tests on file save - see tests results directly in the code editor @@ -1969,9 +1854,3 @@ or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js). [wallaby.js]: https://wallabyjs.com/ [yargs-configobject-extends]: http://yargs.js.org/docs/#api-configobject-extends-keyword [zsh-globbing]: http://zsh.sourceforge.net/Doc/Release/Expansion.html#Recursive-Globbing - - - -[gitter]: https://gitter.im/mochajs/mocha - - diff --git a/package-lock.json b/package-lock.json index 21ae2b1c3e..d848f8692e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -129,6 +129,182 @@ } } }, + "@11ty/eleventy-plugin-inclusive-language": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@11ty/eleventy-plugin-inclusive-language/-/eleventy-plugin-inclusive-language-1.0.0.tgz", + "integrity": "sha512-YRQl/w1CUc+0+aZGIjN5XiyBb9SWQKJkGtImKWqiW7DaboFld8AQCFeTpLWhdOrifR5yblRW/oPePTT+pjgfZQ==", + "dev": true, + "requires": { + "@11ty/eleventy": "^0.5.4", + "chalk": "^2.4.1" + }, + "dependencies": { + "@11ty/eleventy": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@11ty/eleventy/-/eleventy-0.5.4.tgz", + "integrity": "sha512-fGZzs00HQEIUyuVUWFBstLGswMj8JJwlmEBYgK8uf1Cu2Y/ksveBdHVV1JxCc/fMA4NdZdxDz1vM4Nsa3HPjNg==", + "dev": true, + "requires": { + "browser-sync": "^2.24.4", + "chalk": "^2.4.1", + "debug": "^3.1.0", + "ejs": "^2.6.1", + "fast-glob": "^2.2.2", + "fs-extra": "^6.0.1", + "glob-watcher": "^5.0.1", + "gray-matter": "^4.0.1", + "hamljs": "^0.6.2", + "handlebars": "^4.0.11", + "liquidjs": "^5.1.0", + "lodash.chunk": "^4.2.0", + "lodash.clone": "^4.5.0", + "lodash.get": "^4.4.2", + "lodash.isobject": "^3.0.2", + "lodash.merge": "^4.6.1", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "luxon": "^1.3.0", + "markdown-it": "^8.4.1", + "minimist": "^1.2.0", + "multimatch": "^2.1.0", + "mustache": "^2.3.0", + "normalize-path": "^3.0.0", + "nunjucks": "^3.1.3", + "parse-filepath": "^1.0.2", + "please-upgrade-node": "^3.1.1", + "pretty": "^2.0.0", + "pug": "^2.0.3", + "recursive-copy": "^2.0.9", + "semver": "^5.5.0", + "slugify": "^1.3.0", + "time-require": "^0.1.2", + "valid-url": "^1.0.9" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + } + }, + "fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "liquidjs": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-5.2.0.tgz", + "integrity": "sha512-bIDYRWlo8f09dNd8Hz3lHVPOpgw33jtDCebMEDj2D9g54/KhTao7/lVv+3hYtsWTW2PId4hH+1X0iuuYnQHnTg==", + "dev": true, + "requires": { + "resolve-url": "^0.2.1" + } + }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "@babel/code-frame": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", @@ -437,6 +613,16 @@ "taffydb": "^2.7.3" } }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, "@munter/tap-render": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@munter/tap-render/-/tap-render-0.2.0.tgz", @@ -976,6 +1162,12 @@ "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", "dev": true }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, "array-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", @@ -1011,6 +1203,12 @@ "integrity": "sha1-3103v8XC7wdV4qpPkv6ufUtaly8=", "dev": true }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -1328,6 +1526,18 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, + "async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + } + }, "async-each": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", @@ -3380,6 +3590,12 @@ } } }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -4820,12 +5036,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "deepmerge": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz", - "integrity": "sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==", - "dev": true - }, "default-require-extensions": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", @@ -6773,30 +6983,6 @@ "semver-regex": "^2.0.0" } }, - "findup": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", - "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", - "dev": true, - "requires": { - "colors": "~0.6.0-1", - "commander": "~2.1.0" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true - }, - "commander": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.1.0.tgz", - "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", - "dev": true - } - } - }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -6865,6 +7051,15 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -7153,6 +7348,206 @@ "is-glob": "^4.0.1" } }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "glob-watcher": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.3.tgz", + "integrity": "sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "object.defaults": "^1.1.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + } + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -7666,25 +8061,6 @@ "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true }, - "http-basic": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-2.5.1.tgz", - "integrity": "sha1-jORHvbW2xXf4pj4/p4BW7Eu02/s=", - "dev": true, - "requires": { - "caseless": "~0.11.0", - "concat-stream": "^1.4.6", - "http-response-object": "^1.0.0" - }, - "dependencies": { - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", - "dev": true - } - } - }, "http-cache-semantics": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", @@ -7722,12 +8098,6 @@ "requires-port": "1.x.x" } }, - "http-response-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-1.1.0.tgz", - "integrity": "sha1-p8TnWq6C87tJBOT0P2FWc7TVGMM=", - "dev": true - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -8497,18 +8867,18 @@ "is-path-inside": "^1.0.0" } }, - "is-local-path": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-local-path/-/is-local-path-0.1.6.tgz", - "integrity": "sha1-gV0USxTVac7L6tTVaTCX8Aqb9sU=", - "dev": true - }, "is-natural-number": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=", "dev": true }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, "is-npm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", @@ -9252,6 +9622,12 @@ "integrity": "sha1-h75jSIZJy9ym9Tqzm+yczSNH9ZI=", "dev": true }, + "just-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", + "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", + "dev": true + }, "just-extend": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", @@ -10064,6 +10440,12 @@ "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", "dev": true }, + "lodash.chunk": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.chunk/-/lodash.chunk-4.2.0.tgz", + "integrity": "sha1-ZuXOH3btJ7QwPYxlEujRIW6BBrw=", + "dev": true + }, "lodash.clone": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", @@ -10106,18 +10488,36 @@ "integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M=", "dev": true }, + "lodash.isobject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=", + "dev": true + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=", "dev": true }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", + "dev": true + }, "lodash.some": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", @@ -10465,133 +10865,6 @@ "integrity": "sha1-MsXGUZmmRXMWMi0eQinRNAfIx88=", "dev": true }, - "markdown-magic": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/markdown-magic/-/markdown-magic-1.0.0.tgz", - "integrity": "sha512-H2Y8eGA19kF5EPs1vdJp0+21mqEkJylFu134anEtolygwvaHZDyBKQVE5mUXxWkuvWizBp5QQU8O8BA8hradmA==", - "dev": true, - "requires": { - "commander": "^2.9.0", - "deepmerge": "^1.3.0", - "find-up": "^2.1.0", - "fs-extra": "^1.0.0", - "globby": "^6.1.0", - "is-local-path": "^0.1.6", - "markdown-toc": "^1.2.0", - "sync-request": "^3.0.1" - }, - "dependencies": { - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0" - } - }, - "globby": { - "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "markdown-magic-package-json": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/markdown-magic-package-json/-/markdown-magic-package-json-2.0.1.tgz", - "integrity": "sha512-ahEHLW4ovxjGEDkNdirKl01uU6dcZkjtqhc4iJIgwxXwDVq4ThN7cHf1rIA4uaDD4JHAK2hsTHAr7F1TggGt2Q==", - "dev": true, - "requires": { - "findup": "^0.1.5" - } - }, "markdown-table": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", @@ -12068,6 +12341,18 @@ "object-keys": "^1.0.11" } }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, "object.getownpropertydescriptors": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", @@ -16022,6 +16307,12 @@ "readable-stream": "^2.0.2" } }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, "stream-http": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.1.0.tgz", @@ -16422,17 +16713,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "sync-request": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-3.0.1.tgz", - "integrity": "sha1-yqEjWq+Im6UBB2oYNMQ2gwqC+3M=", - "dev": true, - "requires": { - "concat-stream": "^1.4.7", - "http-response-object": "^1.0.1", - "then-request": "^2.0.1" - } - }, "syntax-error": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", @@ -16734,28 +17014,6 @@ } } }, - "then-request": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/then-request/-/then-request-2.2.0.tgz", - "integrity": "sha1-ZnizL6DKIY/laZgbvYhxtZQGDYE=", - "dev": true, - "requires": { - "caseless": "~0.11.0", - "concat-stream": "^1.4.7", - "http-basic": "^2.5.1", - "http-response-object": "^1.1.0", - "promise": "^7.1.1", - "qs": "^6.1.0" - }, - "dependencies": { - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", - "dev": true - } - } - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", diff --git a/package-scripts.js b/package-scripts.js index 7406018366..f3775db177 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -261,7 +261,7 @@ module.exports = { description: 'Build documentation' }, prebuild: { - script: 'rimraf docs/_dist docs/_site && nps docs.preprocess', + script: 'rimraf docs/_dist docs/_site', description: 'Prepare system for doc building', hiddenFromHelp: true }, @@ -275,26 +275,12 @@ module.exports = { description: 'Post-process docs after build', hiddenFromHelp: true }, - preprocess: { - default: { - script: - 'md-magic --config ./scripts/markdown-magic.config.js --path docs/index.md', - description: 'Preprocess documentation', - hiddenFromHelp: true - }, - api: { - script: - 'md-magic --config ./scripts/markdown-magic.config.js --path "docs/api-tutorials/*.md"', - description: 'Preprocess API documentation', - hiddenFromHelp: true - } - }, watch: { - script: 'nps docs.preprocess && eleventy --serve', + script: 'eleventy --serve', description: 'Watch docs for changes & build' }, api: { - script: 'nps docs.preprocess.api && jsdoc -c jsdoc.conf.json', + script: 'jsdoc -c jsdoc.conf.json', description: 'Build API docs' } }, diff --git a/package.json b/package.json index 73b65cfb12..7ceda0d79a 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ }, "devDependencies": { "@11ty/eleventy": "^0.10.0", + "@11ty/eleventy-plugin-inclusive-language": "^1.0.0", "@mocha/docdash": "^2.1.3", "assetgraph-builder": "^8.0.0", "autoprefixer": "^9.7.4", @@ -112,8 +113,6 @@ "markdown-it-attrs": "^3.0.2", "markdown-it-emoji": "^1.4.0", "markdown-it-prism": "^2.0.5", - "markdown-magic": "^1.0.0", - "markdown-magic-package-json": "^2.0.1", "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.22.0", "nps": "^5.9.12", diff --git a/scripts/markdown-magic.config.js b/scripts/markdown-magic.config.js deleted file mode 100644 index f800a5c9f0..0000000000 --- a/scripts/markdown-magic.config.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -/** - * Add autogenerated stuff to our docs (`docs/index.md`) - * @see https://npm.im/markdown-magic - * @private - * @module - */ - -const {execSync} = require('child_process'); -const fs = require('fs'); -const path = require('path'); -const markdownToc = require('markdown-toc'); -const stripAnsi = require('strip-ansi'); - -exports.transforms = { - /** - * Takes STDOUT of some command and injects it into the markdown - */ - usage: (content, options) => { - const {executable} = options; - const flag = options.flag || '--help'; - const header = options.header || '\n```'; - const footer = options.footer || '```\n'; - const output = stripAnsi( - String( - execSync(`"${process.execPath}" ${executable} ${flag}`, { - cwd: path.join(__dirname, '..') - }) - ).trim() - ); - return [header, output, footer].join('\n\n'); - }, - /** - * We can't use the builtin `TOC` plugin in markdown-magic - * because it's simply not flexible enough; we can't pad with newlines, - * nor can we provide a custom filter. the custom filter would be required - * since the `TOC` plugin supplies its own which means we can't use the - * `maxdepth` option, which we need! - */ - toc: (content, options, config) => { - const IGNORED_HEADINGS_REGEXP = /Features|Table of Contents/i; - const toc = markdownToc(config.outputContent, { - slugify: require('uslug'), - bullets: options.bullets, - firsth1: false, - // if filter is supplied, maxdepth is apparently ignored, - // so we have to do it ourselves. - filter: (str, ele) => ele.lvl < 2 && !IGNORED_HEADINGS_REGEXP.test(str) - }).content; - return '\n' + toc + '\n'; - }, - manifest: require('markdown-magic-package-json'), - /** - * Inserts the contents of a file; takes same options as builtin CODE plugin, - * but does not fetch remote URLs, tries to replace relative paths, and - * formats in a way our markdown linter likes. - */ - file: (content, options, config) => { - let output; - if (!options.src) { - return false; - } - const fileDir = path.dirname(config.originalPath); - const filePath = path.join(fileDir, options.src); - const rootDir = path.join(__dirname, '..'); - const relativeDir = path.relative(path.dirname(filePath), rootDir); - - const syntax = options.syntax || path.extname(filePath).replace(/^./, ''); - try { - output = fs.readFileSync(filePath, 'utf8', (err, contents) => { - if (err) { - console.log(`FILE NOT FOUND: ${filePath}`); - throw err; - } - return contents; - }); - } catch (err) { - console.log(`FILE NOT FOUND: ${filePath}`); - throw err; - } - - // replace relative paths in `require()` to root with "mocha". - // might not work in the general case. not gonna parse an AST for this - // e.g. `require('../../lib/foo')` => `require('mocha/lib/foo')` - // also trim any trailing whitespace - output = output - .replace( - new RegExp(`require\\(['"]${relativeDir}(.*?)['"]\\)`, 'g'), - "require('mocha$1')" - ) - .trim(); - - let header = ''; - if (options.header) { - header = `\n${options.header}`; - } - - return ` -\`\`\`${syntax}${header} -${output} -\`\`\` -`; - } -};