Skip to content

Commit

Permalink
chore: more fully remove assetgraph-builder and canvas (#5175)
Browse files Browse the repository at this point in the history
* chore: more fully remove assetgraph-builder and canvas

* fixed up images too

* Remove last postbuild bit

* fix: netlify build.publish trailing slash
  • Loading branch information
JoshuaKGoldberg authored Aug 3, 2024
1 parent a8f8c8b commit 1883c41
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 7,352 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Mocha-specific
docs/_site
docs/_dist
docs/images/supporters
docs/api
mocha.js
Expand Down
1 change: 0 additions & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ global:
timeout: 1000
watch-ignore:
- '.*'
- 'docs/_dist/**'
- 'docs/_site/**'
- 'node_modules'
- 'coverage'
Expand Down
17 changes: 1 addition & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions docs/_data/supporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions docs/_includes/supporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<ul class="image-list" id="sponsors">
<ul class="image-list image-list-wide" id="sponsors">
{%- for supporter in supporters.sponsors -%}
<li>
{%- if supporter.website -%}
<a href="{{ supporter.website }}" target="_blank" rel="noopener sponsored">
{%- endif -%}
<div class="sponsor" title="{{ supporter.name }}" style="width: {{ supporter.dimensions.width }}px; background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
<div class="sponsor" title="{{ supporter.name }}" style="background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
{%- if supporter.website -%}
</a>
{%- endif -%}
Expand Down
21 changes: 14 additions & 7 deletions docs/css/supporters.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
.image-list-wide a,
.image-list-wide li {
width: 100%;
}

.backer,
.sponsor {
background-position: center;
background-repeat: no-repeat;
background-size: contain;
}

.sponsor {
-sprite-selector-for-group: sponsors;
-sprite-location: url(/images/sprite-sponsors.png?pngquant);
-sprite-image-format: png;
height: 64px;
width: 100%;
}

.backer {
-sprite-selector-for-group: backers;
-sprite-location: url(/images/sprite-backers.png?pngquant);
-sprite-image-format: png;
-sprite-padding: 0 10;
width: 32px;
height: 32px;
}
Binary file modified docs/images/emacs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/jetbrains-plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/matomo-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/mocha_side_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/reporter-dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/test-duration-range.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/wallaby-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/wallaby.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# that is where we will look for package.json/.nvmrc/etc not repo root!

[build]
publish = "docs/_dist/"
publish = "docs/_site/"
command = "npm start docs.production"

[build.environment]
Expand Down
Loading

0 comments on commit 1883c41

Please sign in to comment.