Skip to content

Commit 1883c41

Browse files
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
1 parent a8f8c8b commit 1883c41

18 files changed

+23
-7352
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Mocha-specific
22
docs/_site
3-
docs/_dist
43
docs/images/supporters
54
docs/api
65
mocha.js

.mocharc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ global:
77
timeout: 1000
88
watch-ignore:
99
- '.*'
10-
- 'docs/_dist/**'
1110
- 'docs/_site/**'
1211
- 'node_modules'
1312
- 'coverage'

docs/README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,7 @@ _So you wanna build the site?_
1818

1919
- The content lives in `docs/index.md`; everything else is markup, scripts, assets, etc.
2020
- This file (`docs/README.md`) should _not_ be included in the build.
21-
- `docs/_dist` is where the deployed site lives. `docs/_site` is essentially a build step. These directories are _not_ under version control.
22-
- 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.
23-
24-
```console
25-
⚠ WARN: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
26-
(node:45255) UnhandledPromiseRejectionWarning: Error: docs/_site/images/matomo-logo.png: Error executing Stream: The gm stream ended without emitting any data
27-
at Socket.stdout.on.once (/Users/username/mocha/node_modules/express-processimage/lib/getFilterInfosAndTargetContentTypeFromQueryString.js:821:31)
28-
at Object.onceWrapper (events.js:286:20)
29-
at Socket.emit (events.js:203:15)
30-
at endReadableNT (_stream_readable.js:1145:12)
31-
at process._tickCallback (internal/process/next_tick.js:63:19)
32-
(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)
33-
(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.
34-
cp: docs/_dist/_headers: No such file or directory
35-
```
36-
21+
- `docs/_site_` is where the deployed site lives. This directories are _not_ under version control.
3722
- See `package-scripts.js` for details on what the builds are actually doing.
3823

3924
## License

docs/_data/supporters.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
'use strict';
1919

20-
const {loadImage} = require('canvas');
2120
const {writeFile, mkdir, rm} = require('fs').promises;
2221
const {resolve} = require('path');
2322
const debug = require('debug')('mocha:docs:data:supporters');
@@ -115,13 +114,6 @@ const fetchImage = process.env.MOCHA_DOCS_SKIP_IMAGE_DOWNLOAD
115114
);
116115
}
117116
debug('fetched %s', url);
118-
const canvasImage = await loadImage(imageBuf);
119-
debug('ok %s', url);
120-
supporter.dimensions = {
121-
width: canvasImage.width,
122-
height: canvasImage.height
123-
};
124-
// debug('dimensions %s %dw %dh', url, canvasImage.width, canvasImage.height);
125117
const filePath = resolve(SUPPORTER_IMAGE_PATH, supporter.id + '.png');
126118
await writeFile(filePath, imageBuf);
127119
debug('wrote %s', filePath);

docs/_includes/supporters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
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).
44

5-
<ul class="image-list" id="sponsors">
5+
<ul class="image-list image-list-wide" id="sponsors">
66
{%- for supporter in supporters.sponsors -%}
77
<li>
88
{%- if supporter.website -%}
99
<a href="{{ supporter.website }}" target="_blank" rel="noopener sponsored">
1010
{%- endif -%}
11-
<div class="sponsor" title="{{ supporter.name }}" style="width: {{ supporter.dimensions.width }}px; background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
11+
<div class="sponsor" title="{{ supporter.name }}" style="background-image: url(/images/supporters/{{ supporter.id }}.png?sprite=sponsors)"></div>
1212
{%- if supporter.website -%}
1313
</a>
1414
{%- endif -%}

docs/css/supporters.css

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1+
.image-list-wide a,
2+
.image-list-wide li {
3+
width: 100%;
4+
}
5+
6+
.backer,
7+
.sponsor {
8+
background-position: center;
9+
background-repeat: no-repeat;
10+
background-size: contain;
11+
}
12+
113
.sponsor {
2-
-sprite-selector-for-group: sponsors;
3-
-sprite-location: url(/images/sprite-sponsors.png?pngquant);
4-
-sprite-image-format: png;
514
height: 64px;
15+
width: 100%;
616
}
17+
718
.backer {
8-
-sprite-selector-for-group: backers;
9-
-sprite-location: url(/images/sprite-backers.png?pngquant);
10-
-sprite-image-format: png;
11-
-sprite-padding: 0 10;
1219
width: 32px;
1320
height: 32px;
1421
}

docs/images/emacs.png

-411 KB
Loading

docs/images/jetbrains-plugin.png

9.53 KB
Loading

docs/images/matomo-logo.png

-11.7 KB
Loading

docs/images/mocha_side_bar.png

-17.6 KB
Loading

0 commit comments

Comments
 (0)