From 1883c41a49fad009bd407efc1bece3a5c75fd10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 3 Aug 2024 09:21:43 -0400 Subject: [PATCH] chore: more fully remove assetgraph-builder and canvas (#5175) * chore: more fully remove assetgraph-builder and canvas * fixed up images too * Remove last postbuild bit * fix: netlify build.publish trailing slash --- .gitignore | 1 - .mocharc.yml | 1 - docs/README.md | 17 +- docs/_data/supporters.js | 8 - docs/_includes/supporters.md | 4 +- docs/css/supporters.css | 21 +- docs/images/emacs.png | Bin 605262 -> 184587 bytes docs/images/jetbrains-plugin.png | Bin 89142 -> 98903 bytes docs/images/matomo-logo.png | Bin 26528 -> 14525 bytes docs/images/mocha_side_bar.png | Bin 219533 -> 201525 bytes docs/images/reporter-dot.png | Bin 13461 -> 7005 bytes docs/images/test-duration-range.png | Bin 5755 -> 4095 bytes docs/images/wallaby-logo.png | Bin 578 -> 126 bytes docs/images/wallaby.png | Bin 49021 -> 32044 bytes netlify.toml | 2 +- package-lock.json | 7309 +-------------------------- package-scripts.js | 10 +- package.json | 2 - 18 files changed, 23 insertions(+), 7352 deletions(-) diff --git a/.gitignore b/.gitignore index adce588d9e..467827414e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Mocha-specific docs/_site -docs/_dist docs/images/supporters docs/api mocha.js diff --git a/.mocharc.yml b/.mocharc.yml index dfb82e07f6..5f788099d3 100644 --- a/.mocharc.yml +++ b/.mocharc.yml @@ -7,7 +7,6 @@ global: timeout: 1000 watch-ignore: - '.*' - - 'docs/_dist/**' - 'docs/_site/**' - 'node_modules' - 'coverage' diff --git a/docs/README.md b/docs/README.md index 0c3e69e53f..27d1a62b1b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -18,22 +18,7 @@ _So you wanna build the site?_ - The content lives in `docs/index.md`; everything else is markup, scripts, assets, etc. - This file (`docs/README.md`) should _not_ be included in the build. -- `docs/_dist` is where the deployed site lives. `docs/_site` is essentially a build step. These directories are _not_ under version control. -- If you get the error message below when running `npm start docs`, follow [this guide](https://www.npmjs.com/package/gm) to install GraphicsMagick or ImageMagick. - -```console -⚠ WARN: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data -(node:45255) UnhandledPromiseRejectionWarning: Error: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data - at Socket.stdout.on.once (/Users/username/mocha/node_modules/express-processimage/lib/getFilterInfosAndTargetContentTypeFromQueryString.js:821:31) - at Object.onceWrapper (events.js:286:20) - at Socket.emit (events.js:203:15) - at endReadableNT (_stream_readable.js:1145:12) - at process._tickCallback (internal/process/next_tick.js:63:19) -(node:45255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) -(node:45255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. -cp: docs/_dist/_headers: No such file or directory -``` - +- `docs/_site_` is where the deployed site lives. This directories are _not_ under version control. - See `package-scripts.js` for details on what the builds are actually doing. ## License diff --git a/docs/_data/supporters.js b/docs/_data/supporters.js index d31bebd524..6ee9c712db 100755 --- a/docs/_data/supporters.js +++ b/docs/_data/supporters.js @@ -17,7 +17,6 @@ 'use strict'; -const {loadImage} = require('canvas'); const {writeFile, mkdir, rm} = require('fs').promises; const {resolve} = require('path'); const debug = require('debug')('mocha:docs:data:supporters'); @@ -115,13 +114,6 @@ const fetchImage = process.env.MOCHA_DOCS_SKIP_IMAGE_DOWNLOAD ); } debug('fetched %s', url); - const canvasImage = await loadImage(imageBuf); - debug('ok %s', url); - supporter.dimensions = { - width: canvasImage.width, - height: canvasImage.height - }; - // debug('dimensions %s %dw %dh', url, canvasImage.width, canvasImage.height); const filePath = resolve(SUPPORTER_IMAGE_PATH, supporter.id + '.png'); await writeFile(filePath, imageBuf); debug('wrote %s', filePath); diff --git a/docs/_includes/supporters.md b/docs/_includes/supporters.md index 96d13eb5d9..3ef3e050ba 100644 --- a/docs/_includes/supporters.md +++ b/docs/_includes/supporters.md @@ -2,13 +2,13 @@ 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). -