☕️ Classic, reliable, trusted test framework for Node.js and the browser
update all the things in preparation for v3.0.0 changes
Christopher Hillerb69ce7873b6e
diff --git a/Makefile b/Makefiledeleted file mode 100644index 18519e8b..00000000--- a/Makefile+++ /dev/null@@ -1,15 +0,0 @@-PORT ?= 3000-bundle := bundle--start: toc bundle- ${bundle} exec jekyll serve --safe --drafts --watch --port ${PORT}---build: toc bundle- ${bundle} exec jekyll build --safe--toc:- ./node_modules/.bin/toc-idx -i index.md --max-depth 1 --omit 'Backers' 'Sponsors' --bullet "\- " index.md--bundle:- ${bundle}diff --git a/README.md b/README.mdindex 538228fe..ef95c30e 100644--- a/README.md+++ b/README.md@@ -1,49 +1,32 @@-# [mochajs.org](http://mochajs.org): How to Build the Site+# mochajs.org*So you wanna build the site?*-[mochajs.org](http://mochajs.org) is now built using [Jekyll](http://jekyllrb.com), the popular static site generator.+[mochajs.org](https://mochajs.org) is built using [Jekyll](http://jekyllrb.com), the popular static site generator.## Prerequisites-1. Some recent version of Ruby-2. Some version of [RubyGems](https://rubygems.org)-3. Some recent version of Node.JS+- Ruby+- RubyGems+- Bundler+- (Optional) Node.js v4.0.0 or greater-## Installation+## Development-1. Execute `npm install`. This will install [Bundler](http://bundler.io), Jekyll, and [markdown-toc-index](https://www.npmjs.com/package/markdown-toc-index).-2. To build, execute `npm run build` or `make build`+1. Clone this repo+2. Execute `npm install` and follow the directions.-### Problems?+> Mac users: You may need to install Xcode command line tools if `bundle install` fails. Execute `xcode-select --install` if so.-#### Permissions-Related+### Notes-If `npm install` fails due to an `EACCESS` problem, try this:+- Node.js is only necessary if you need to rebuild the table of contents.+- To serve the site and rebuild as changes are made, execute `npm start serve`.+- To rebuild the site *once*, execute `npm start build`.+- To update the table of contents, execute: `npm start toc`. This will only alter `index.md`; it will not rebuild the site unless `npm start serve` is running in another process.+- The `_site` directory is where the generated static site lives (and is what you see at [mochajs.org](https://mochajs.org)). It is *not* under version control.+- `Gemfile.lock` is ignored as to always get the latest `github-pages` gem.-```shell-$ sudo gem install bundler-$ npm install --ignore-scripts-$ bundle install-```--#### Ruby-Related on OS X--You may need to install the Xcode command line tools if `bundle install` fails somewhere. Execute this:--```shell-$ xcode-select --install-```--## Local development--1. Run `make` to build the project and start a development server that auto-watches for changes on http://localhost:3000--For more information, refer to the [Jekyll Docs](http://jekyllrb.com/docs/home/) and [GitHub's Tutorial](https://help.github.com/articles/using-jekyll-with-pages/) on the subject.--## Notes--- To update `index.md` with the TOC, execute: `node_modules/.bin/toc-idx -i index.md --max-depth 1 --bullet "\- " index.md`-- `bundle exec jekyll build` rebuilds the site without updating the TOC-- The `_site` directory is where the generated site lives. It is *not* under version control, because GitHub Pages generates it for us.+## License+:copyright: 2016 mochajs.org contributors. Content licensed CC-BY-4.0; code licensed MIT.diff --git a/_config.yml b/_config.ymlindex 3230590e..c115cc7c 100644--- a/_config.yml+++ b/_config.yml@@ -5,7 +5,8 @@ exclude:- Gemfile*- package.json- CNAME- - Makefile- npm-debug.log*+ - scripts+ - .*diff --git a/_includes/backers.md b/_includes/backers.mdnew file mode 100644index 00000000..ccf561ab--- /dev/null+++ b/_includes/backers.md@@ -0,0 +1,6 @@+## Backers++Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation.++{: id="_backers" }+{% for i in (0..29) %}[{: onload="window.avatars.backerLoaded()" }](https://opencollective.com/mochajs/backer/{{ i }}/website){: target="_blank"} {% endfor %}diff --git a/_includes/ga.html b/_includes/ga.htmldeleted file mode 100644index 94bc6dc8..00000000--- a/_includes/ga.html+++ /dev/null@@ -1,10 +0,0 @@-<script>- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');-- ga('create', 'UA-65024936-1', 'auto');- ga('send', 'pageview');--</script>diff --git a/_includes/head.html b/_includes/head.htmlindex 725c4488..509d0b7e 100644--- a/_includes/head.html+++ b/_includes/head.html@@ -1,8 +1,7 @@<head><meta charset="utf-8"><title>{{ page.title }}</title>- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"/>- <link rel="stylesheet" href="css/normalize.min.css"/>+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css"/><link rel="stylesheet" href="css/style.css"/><link rel="stylesheet" href="css/pygments.css"/><link rel="shortcut icon" href="favicon.ico"/>@@ -10,5 +9,6 @@<!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script><![endif]-->- {% include ga.html %}+ <script src="js/ga.js"></script>+ <script src="js/avatars.js"></script></head>diff --git a/_includes/header.html b/_includes/header.htmlindex cc6a0c47..99427f5c 100644--- a/_includes/header.html+++ b/_includes/header.html@@ -1,7 +1,4 @@-<script>-window.onload = function () { window.document.body.classList.add('onload'); }-</script>-<header>- <h1><a href="http://mochajs.org/"><img src="https://cldup.com/xFVFxOioAU.svg"></a></h1>+<header id="_header">+ <h1><a href="/"><img onload="window.document.getElementById('_header').classList.add('onload');" src="//cldup.com/xFVFxOioAU.svg"></a></h1><p id="tag"><em>simple</em>, <em>flexible</em>, <em>fun</em></p></header>diff --git a/_includes/sponsors.md b/_includes/sponsors.mdnew file mode 100644index 00000000..5fe0c7d9--- /dev/null+++ b/_includes/sponsors.md@@ -0,0 +1,6 @@+## Sponsors++Use Mocha at Work? Ask your manager or marketing team if they'd help [support](https://opencollective.com/mochajs#support) our project. Your company's logo will also be displayed on [npmjs.com](http://npmjs.com/package/mocha) and our [GitHub repository](https://github.com/mochajs/mocha#sponsors).++{: id="_sponsors" }+{% for i in (0..29) %}[{: onload="window.avatars.sponsorLoaded()" }](https://opencollective.com/mochajs/sponsor/{{ i }}/website){: target="_blank"} {% endfor %}diff --git a/css/normalize.min.css b/css/normalize.min.cssdeleted file mode 100644index 429ec37e..00000000--- a/css/normalize.min.css+++ /dev/null@@ -1,2 +0,0 @@-/*! normalize.css v2.1.3 | MIT License | git.io/normalize */-article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}\ No newline at end of filediff --git a/css/style.css b/css/style.cssindex b0d8e8bb..8df06950 100644--- a/css/style.css+++ b/css/style.css@@ -24,15 +24,24 @@ h1 {transition: opacity 1s;}-.onload h1 {+#_backers a, #_sponsors a {+ opacity: 0;+ -webkit-transition: opacity .3s;+ -moz-transition: opacity .3s;+ -o-transition: opacity .3s;+ transition: opacity .3s;+}++.onload h1, #_backers.onload a, #_sponsors.onload a {opacity: 1;}h2 {margin-top: 80px;- font-weight: 100;+ font-weight: 400;letter-spacing: 1px;border-bottom: 1px solid #ddd;+ text-transform: uppercase;}h3 {@@ -40,6 +49,7 @@ h3 {letter-spacing: 1px;border-bottom: 1px solid #eee;margin-top: 40px;+ text-transform: uppercase;}#tag {@@ -67,19 +77,17 @@ h3 {}#content > p:first-child {- font-size: 22px;- font-weight: 100;+ font-size: 20px;+ font-weight: 200;letter-spacing: 1px;}a {- color: #8a6343;- font-weight: bold;- text-decoration: none;+ color: #8D6748;}a:hover {- text-decoration: underline;+ color: #717171;}ul {@@ -100,7 +108,6 @@ ul li {list-style: none;border-bottom: 1px solid #eee;padding: 5px 0;- font-size: 12px;-webkit-column-break-inside: avoid;-moz-column-break-inside: avoid;column-break-inside: avoid;@@ -152,24 +159,6 @@ img[src*="opencollective.com/mochajs"], img[src*=badges], img[src*=".svg"] {box-shadow: none;}-.badge {- margin-right: 8px;- display: inline-block;-}--.badge > img {- margin: 0;- padding: 0;- -webkit-border-radius: 0;- -moz-border-radius: 0;- -o-border-radius: 0;- border-radius: 0;- -webkit-box-shadow: none;- -moz-box-shadow: none;- box-shadow: none;- display: block;-}-footer {background-color: #eee;width: 100%;diff --git a/index.md b/index.mdindex 3831bfa6..283eae7d 100644--- a/index.md+++ b/index.md@@ -3,85 +3,14 @@ layout: defaulttitle: "Mocha - the fun, simple, flexible JavaScript test framework"---+Mocha is a feature-rich JavaScript test framework running on [Node.js](http://nodejs.org) and in the browser, making asynchronous testing *simple* and *fun*. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on [GitHub](https://github.com/mochajs/mocha).-Mocha is a feature-rich JavaScript test framework running on [Node.js](http://nodejs.org) and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on [GitHub](https://github.com/mochajs/mocha).--[](https://gitter.im/mochajs/mocha)-[](#backers)-[](#sponsors)---## Backers--Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/mochajs#backer)]--<a href="https://opencollective.com/mochajs/backer/0/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/0/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/1/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/1/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/2/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/2/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/3/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/3/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/4/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/4/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/5/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/5/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/6/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/6/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/7/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/7/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/8/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/8/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/9/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/9/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/10/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/10/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/11/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/11/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/12/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/12/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/13/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/13/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/14/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/14/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/15/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/15/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/16/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/16/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/17/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/17/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/18/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/18/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/19/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/19/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/20/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/20/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/21/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/21/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/22/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/22/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/23/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/23/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/24/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/24/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/25/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/25/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/26/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/26/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/27/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/27/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/28/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/28/avatar"></a>-<a href="https://opencollective.com/mochajs/backer/29/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/29/avatar"></a>---## Sponsors--Is your company using Mocha? Ask your manager to support us. Your company logo will show up here and on our [Github page](https://github.com/mochajs/mocha#sponsors). [[Become a sponsor](https://opencollective.com/mochajs#sponsor)]--<a href="https://opencollective.com/mochajs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/0/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/1/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/1/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/2/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/2/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/3/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/3/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/4/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/4/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/5/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/5/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/6/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/6/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/7/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/7/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/8/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/8/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/9/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/9/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/10/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/10/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/11/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/11/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/12/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/12/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/13/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/13/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/14/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/14/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/15/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/15/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/16/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/16/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/17/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/17/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/18/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/18/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/19/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/19/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/20/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/20/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/21/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/21/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/22/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/22/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/23/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/23/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/24/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/24/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/25/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/25/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/26/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/26/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/27/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/27/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/28/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/28/avatar"></a>-<a href="https://opencollective.com/mochajs/sponsor/29/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/29/avatar"></a>+ [](https://gitter.im/mochajs/mocha)+ [](#backers)+ [](#sponsors)+{% include backers.md %}+{% include sponsors.md %}## Features@@ -118,8 +47,8 @@ Is your company using Mocha? Ask your manager to support us. Your company logo w## Table of Contents-<!-- INDEX -->-- [Features](#features)+<!-- toc -->+- [Installation](#installation)- [Getting Started](#getting-started)- [Assertions](#assertions)@@ -145,11 +74,11 @@ Is your company using Mocha? Ask your manager to support us. Your company logo w- [Testing Mocha](#testing-mocha)- [More Information](#more-information)-<!-- /INDEX -->+<!-- tocstop -->## Installation-Install with [npm](http://npmjs.org):+Install with [npm](https://npmjs.org):```sh$ npm install -g mochadiff --git a/js/avatars.js b/js/avatars.jsnew file mode 100644index 00000000..153dba24--- /dev/null+++ b/js/avatars.js@@ -0,0 +1,12 @@+// dumb thing that helps with animation of avatars+function avatars (type) {+ return function avatarLoaded () {+ avatars[type] = typeof avatars[type] === 'number' ? avatars[type] + 1 : 1;+ if (avatars[type] === 30) {+ document.getElementById(type).classList.add('onload');+ }+ }+}++avatars.backerLoaded = avatars('_backers');+avatars.sponsorLoaded = avatars('_sponsors');diff --git a/js/ga.js b/js/ga.jsnew file mode 100644index 00000000..6e3ff194--- /dev/null+++ b/js/ga.js@@ -0,0 +1,7 @@+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');++ga('create', 'UA-65024936-1', 'auto');+ga('send', 'pageview');diff --git a/package.json b/package.jsonindex f6aa5331..25647acf 100644--- a/package.json+++ b/package.json@@ -3,25 +3,78 @@"version": "1.0.0","description": "Mocha's gh-pages branch","private": true,- "authors": [- "David da Silva Contín <[email protected]>",- "Christopher Hiller <[email protected]>",- "Travis Jeffery <[email protected]>"- ],"scripts": {- "prepublish": "gem install bundler && bundle install",- "build": "make build"+ "prepublish": "npm start postinstall",+ "start": "package-scripts --silent --config ./scripts/package-scripts.js"},"repository": {"type": "git","url": "https://github.com/mochajs/mochajs.github.io.git"},- "license": "MIT",+ "license": "CC-BY-4.0 AND MIT","bugs": {"url": "https://github.com/mochajs/mochajs.github.io/issues"},"homepage": "https://mochajs.org","devDependencies": {- "markdown-toc-index": "^0.2.0"- }+ "chalk": "^1.1.3",+ "markdown-toc": "^0.12.14",+ "p-s": "^1.0.4",+ "shx": "^0.1.2"+ },+ "engines": {+ "node": ">=4.0.0",+ "npm": ">=2.0.0"+ },+ "author": "TJ Holowaychuk <[email protected]> (https://github.com/tj)",+ "contributors": [+ "Alexander Shepelin (https://github.com/44px)",+ "Al Scott <[email protected]> (https://github.com/scottaj)",+ "amsul (https://github.com/amsul)",+ "Anders Olsen Sandvik (https://github.com/Andersos)",+ "Andy Matthews <[email protected]> (https://github.com/commadelimited)",+ "Ariel Mashraki <[email protected]> (https://github.com/a8m)",+ "Artem Govorov (https://github.com/ArtemGovorov)",+ "Bernard Kobos <[email protected]> (https://github.com/bernii)",+ "Christoffer Hallas (https://github.com/hallas)",+ "Christopher Hiller <[email protected]> (https://github.com/boneskull)",+ "Daniel St. Jules <[email protected]> (https://github.com/danielstjules)",+ "Dan Oved <[email protected]> (https://github.com/oveddan)",+ "David da Silva <[email protected]> (https://github.com/dasilvacontin)",+ "David Henderson (https://github.com/dhendo)",+ "Dmitriy Simushev (https://github.com/JustBlackBird)",+ "Domenic Denicola <[email protected]> (https://github.com/domenic)",+ "Erik Eng (https://github.com/ptz0n)",+ "Fabio M. Costa <[email protected]> (https://github.com/fabiomcosta)",+ "Fagner Brack <[email protected]> (https://github.com/FagnerMartinsBrack)",+ "Guillermo Rauch <[email protected]> (https://github.com/rauchg)",+ "Hugo Giraudel (https://github.com/HugoGiraudel)",+ "Jacob Wejendorp (https://github.com/wejendorp)",+ "Jake Verbaten <[email protected]> (https://github.com/Raynos)",+ "James Carr <[email protected]> (https://github.com/jamescarr)",+ "Jan Lehnardt <[email protected]> (https://github.com/janl)",+ "Joel Kemp <[email protected]> (https://github.com/mrjoelkemp)",+ "Jo Liss <[email protected]> (https://github.com/joliss)",+ "Jonathan Rajavuori <[email protected]> (https://github.com/jrajav)",+ "Kelong Wang (https://github.com/wkl)",+ "Kevin Reed (https://github.com/kavun)",+ "Long Ho <[email protected]> (https://github.com/longlho)",+ "Michiel de Jong (https://github.com/michielbdejong)",+ "Nik Nyby (https://github.com/nikolas)",+ "Oscar Godson <[email protected]> (https://github.com/OscarGodson)",+ "Peter Rust (https://github.com/prust)",+ "PoppinL <[email protected]> (https://github.com/poppinlp)",+ "Rich Trott (https://github.com/Trott)",+ "Rico Sta. Cruz <[email protected]> (https://github.com/rstacruz)",+ "Roman Shtylman (https://github.com/defunctzombie)",+ "Ryan Tablada (https://github.com/rtablada)",+ "Ryunosuke Sato <[email protected]> (https://github.com/tricknotes)",+ "sarehag (https://github.com/sarehag)",+ "Sune Simonsen <[email protected]> (https://github.com/sunesimonsen)",+ "Timothy Gu <[email protected]> (https://github.com/TimothyGu)",+ "Travis Jeffery <[email protected]> (https://github.com/travisjeffery)",+ "Will Langstroth (https://github.com/wlangstroth)",+ "Xavier Damman <[email protected]> (https://github.com/xdamman)",+ "XhmikosR <[email protected]> (https://github.com/XhmikosR)"+ ]}diff --git a/scripts/package-scripts.js b/scripts/package-scripts.jsnew file mode 100644index 00000000..db487e3b--- /dev/null+++ b/scripts/package-scripts.js@@ -0,0 +1,16 @@+'use strict';++const chalk = require('chalk');+const pkg = require('../package.json');++module.exports = {+ scripts: {+ postinstall: `shx echo "\uD83D\uDC49 ${chalk.yellow(pkg.name)} installation:+ 1. Follow directions for your platform at ${chalk.underline('https://git.io/vKcdH')} to install prereqs.+ 2. Execute ${chalk.bold('bundle install')} in this directory.+ 3. Execute ${chalk.bold('npm start serve')} to serve the site locally."`,+ serve: 'bundle exec jekyll serve --safe --drafts --watch',+ build: 'bundle exec jekyll build --safe --drafts',+ toc: require.resolve('./toc')+ }+};diff --git a/scripts/toc.js b/scripts/toc.jsnew file mode 100755index 00000000..8c25fa8f--- /dev/null+++ b/scripts/toc.js@@ -0,0 +1,34 @@+#!/usr/bin/env node++/**+ * The CLI included with markdown-toc doesn't support `bullets`+ * and `maxdepth` options, so that's why this exists.+ */++'use strict';++const toc = require('markdown-toc');+const utils = require('markdown-toc/lib/utils');+const fs = require('fs');+const path = require('path');+const filepath = path.join(__dirname, '..', 'index.md');++console.log('Updating TOC...');++const input = fs.createReadStream(filepath);++input.pipe(+ utils.concat(input => fs.writeFileSync(filepath, toc.insert(String(input), {+ bullets: '-',+ maxdepth: 2+ }))));++input.on('error', err => {+ console.log(err);+ process.exit(1);+});++input.on('close', () => {+ console.log('Done.');+ process.exit();+});