Compare commits

...

8 Commits

Author SHA1 Message Date
github-actions[bot]
e6d9c74510 Version Packages 2021-05-28 09:13:38 +02:00
Maarten Stolte
c338696482 chore: add changeset 2021-05-28 09:10:47 +02:00
Maarten Stolte
2ff4b4c542 chore: updated yarn.lock 2021-05-28 09:10:47 +02:00
Maarten Stolte
ba64b45ebf fix: update puppeteer to support M1 2021-05-28 09:10:47 +02:00
Maarten Stolte
e437e02cb9 fix(cli): Update eleventy-img to get M1 support 2021-05-28 09:10:47 +02:00
Thomas Allmer
ce9b12edd4 fix(mdjs-core): support importing via es module 2021-05-28 09:05:25 +02:00
github-actions[bot]
d034f799c0 Version Packages 2021-05-17 21:56:56 +02:00
Thomas Allmer
8bba4a88c8 feat: support for generating responsive images 2021-05-17 21:52:02 +02:00
38 changed files with 1017 additions and 98 deletions

View File

@@ -0,0 +1,223 @@
# Configuration >> Images ||40
Rocket does handle content images automatically by
- producing multiple sizes so users download images that are meant for their resolution
- outputting multiple formats so the device can choose the best image format it supports
And the best thing about is you don't need to do anything.
## Usage
If you are using markdown images you are good to go.
```md
![My Image](path/to/image.jpg)
```
will result in
```html
<picture>
<source
type="image/avif"
srcset="/images/5f03d82-300.avif 300w, /images/5f03d82-820.avif 820w"
sizes="(min-width: 1024px) 820px, calc(100vw - 20px)"
/>
<source
type="image/jpeg"
srcset="/images/5f03d82-300.jpeg 300w, /images/5f03d82-820.jpeg 820w"
sizes="(min-width: 1024px) 820px, calc(100vw - 20px)"
/>
<img
alt="My Image"
rocket-image="responsive"
src="/images/5f03d82-300.jpeg"
width="300"
height="158"
loading="lazy"
decoding="async"
/>
</picture>
```
## Benefits
The main benefit is that we can serve the correct size and optimal image format depending on the browser capabilities leading to optimal loading times on different systems.
- Smaller images for smaller screens
When providing `srcset` and `sizes` the browser can decide which image makes the most sense to download.
This will lead to much faster websites especially on mobile where smaller images can be served.
If you wanna know more check out [The anatomy of responsive images](https://jakearchibald.com/2015/anatomy-of-responsive-images/).
- Serve the best/smallest image format the browser understands
There are currently ~3 formats you may want to consider `avif`, `webp` and `jpg`. The improvements are huge [webp is ~30% and avif ~50%](https://www.ctrl.blog/entry/webp-avif-comparison.html) smaller then the original jpg.
## Adding a caption
If you want to describe your image in more detail you can add a caption
```md
![My Image](path/to/image.jpg 'My caption text')
```
will result in
```html
<figure>
<picture>
<!-- picture code the same as above -->
</picture>
<figcaption>My caption text</figcaption>
</figure>
```
## Adjusting options
Under the hood it is using [11ty/image](https://www.11ty.dev/docs/plugins/image/) and all it's options are available.
<inline-notification type="tip">
If you are using a layout preset like `@rocket/launch` then you probably don't want to touch/change these options as the preset will set it for you accordion to its layout needs.
The default preset for regular markdown content is available as `responsive`.
</inline-notification>
👉 `rocket.config.js`
```js
export default {
imagePresets: {
responsive: {
widths: [300, 820],
formats: ['avif', 'jpeg'],
sizes: '(min-width: 1024px) 820px, calc(100vw - 20px)',
},
},
};
```
## Defining your own presets
You can add your own image preset like so
```js
export default {
imagePresets: {
'my-image-preset': {
widths: [30, 60],
formats: ['avif', 'jpeg'],
sizes: '(min-width: 1024px) 30px, 60px',
},
},
};
```
Once that `imagePreset` is defined you can use it by adding it to any `img` tag.
```html
<img src="./path/to/image.jpg" alt="my alt" rocket-image="my-image-preset" />
```
## How does it work?
1. Each markdown image `![my image](path/to/image.jpg)` gets rendered as `<img src="path/to/image.jpg" alt="my image" rocket-image="responsive">`
2. We parse the html output and process every image which has `rocket-image`
3. Get the image preset settings from the name e.g. `rocket-image="my-image-preset"` reads `imagePreset['my-image-preset']`
4. Pass the settings onto `@11ty/image` to generate the image sizes and formats
5. With the metadata we render the html
## Default Formats
An [image file format](https://en.wikipedia.org/wiki/Image_file_formats) is a way of storing common image formats. Each format varies in capabilities like compression algorithm, availability, progressive rendering, encode and decode time, ...
Ultimately newer formats are usually smaller while retaining image quality which leads to faster websites.
By default, we generate `avif` and `jpg` because
- we only want to generate two versions to limit CI time and html size
- `avif` is significantly smaller than `webp`
- `avif` is available in
- Chrome since August 2020
- Firefox since June 2021
- `jpg` as a fallback for Edge, Safari, IE11
- `webp` would only help a small percentage of Edge & Safari on macOS 11 (Big Sur) users
This leads to the following situation:
- Chrome, Firefox gets the small `avif`
- Edge, Safari, IE11 gets the bigger `jpg`
To learn more about `avif` take a look at [AVIF has landed](https://jakearchibald.com/2020/avif-has-landed/).
If you want to add `webp` (or replace `avif` with it) you can do so by setting the formats
👉 `rocket.config.js`
```js
export default {
imagePresets: {
responsive: {
formats: ['avif', 'webp', 'jpeg'],
},
},
};
```
## Default widths
In order to understand the need for having a single image in multiple resolutions we need to understand the our website is served to many different environments and each may come with its own specific device pixel ratio (DPR). The device pixel ratio is the ratio between physical pixels and logical pixels. For instance, the Galaxy S20 report a device pixel ratio of 3, because the physical linear resolution is triple the logical linear resolution.
Physical resolution: 1440 x 3200
Logical resolution: 480 x 1067
And 1440 / 480 = 3.
By default, we generate the following widths `600`, `900` and `1640` because
- we only want to generate a small amount of widths to limit CI time and service worker cache size
- `600` is good for mobile with DRP 2
- `900` is good for mobile with DRP 3 and desktop with DPR of 1
- `1640` is good for desktop with DPR of 2
If you want to add more widths you can add them to `widths`.
👉 `rocket.config.js`
```js
export default {
imagePresets: {
responsive: {
widths: [300, 600, 900, 1200, 1640],
sizes: '(min-width: 1024px) 820px, calc(100vw - 20px)',
},
},
};
```
<inline-notification type="tip">
As an end user in most cases you don't want to mess with this as a layout preset should set this for you. If you are building your own layout preset then be sure to set `widths` and `sizes` via `adjustImagePresets`
```js
export function myPreset() {
return {
adjustImagePresets: imagePresets => ({
...imagePresets,
responsive: {
...imagePresets.responsive,
widths: [600, 900, 1640],
sizes: '(min-width: 1024px) 820px, calc(100vw - 40px)',
},
}),
};
}
```
</inline-notification>
```js script
import '@rocket/launch/inline-notification/inline-notification.js';
```

View File

@@ -75,7 +75,7 @@
"onchange": "^7.1.0",
"prettier": "^2.2.1",
"prettier-plugin-package": "^1.3.0",
"puppeteer": "^5.5.0",
"puppeteer": "^9.0.0",
"remark-emoji": "^2.1.0",
"rimraf": "^3.0.2",
"rollup": "^2.36.1",

View File

@@ -1,5 +1,30 @@
# @rocket/cli
## 0.8.1
### Patch Changes
- c338696: Updated dependency of eleventy-img for M1 compatibility
## 0.8.0
### Minor Changes
- 8bba4a8: Every content image in markdown will outputted in multiple widths and formats to ensure small image file sizes while retaining quality.
You can adjust the defaults by setting `imagePresets.responsive`.
```js
export default {
imagePresets: {
responsive: {
widths: [600, 900, 1640],
formats: ['avif', 'jpeg'],
sizes: '(min-width: 1024px) 820px, calc(100vw - 40px)',
},
},
};
```
## 0.7.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@rocket/cli",
"version": "0.7.0",
"version": "0.8.1",
"publishConfig": {
"access": "public"
},
@@ -56,7 +56,7 @@
],
"dependencies": {
"@11ty/eleventy": "^0.11.1",
"@11ty/eleventy-img": "^0.7.4",
"@11ty/eleventy-img": "^0.9.0",
"@rocket/building-rollup": "^0.3.0",
"@rocket/core": "^0.1.2",
"@rocket/eleventy-plugin-mdjs-unified": "^0.4.1",

View File

@@ -0,0 +1,244 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
const fs = require('fs');
const path = require('path');
const EleventyImage = require('@11ty/eleventy-img');
const { SaxEventType, SAXParser } = require('sax-wasm');
const { getComputedConfig } = require('../public/computedConfig.cjs');
const saxPath = require.resolve('sax-wasm/lib/sax-wasm.wasm');
const saxWasmBuffer = fs.readFileSync(saxPath);
/** @typedef {import('../types').Heading} Heading */
/** @typedef {import('sax-wasm').Text} Text */
/** @typedef {import('sax-wasm').Tag} Tag */
/** @typedef {import('sax-wasm').Position} Position */
// Instantiate
const parser = new SAXParser(
SaxEventType.CloseTag,
{ highWaterMark: 256 * 1024 }, // 256k chunks
);
/**
* @param {object} options
* @param {string} options.html
* @param {Position} options.start
* @param {Position} options.end
* @param {string} options.insert
*/
function replaceBetween({ html, start, end, insert = '' }) {
const lines = html.split('\n');
const i = start.line;
const line = lines[i];
const upToChange = line.slice(0, start.character);
const afterChange = line.slice(end.character - 4);
lines[i] = `${upToChange}${insert}${afterChange}`;
return lines.join('\n');
}
/**
* @param {Tag} data
* @param {string} name
*/
function getAttribute(data, name) {
if (data.attributes) {
const { attributes } = data;
const foundIndex = attributes.findIndex(entry => entry.name.value === name);
if (foundIndex !== -1) {
return attributes[foundIndex].value.value;
}
}
return null;
}
/**
* @param {Tag} data
*/
function getAttributes(data) {
if (data.attributes) {
const { attributes } = data;
return attributes.map(entry => ({ name: entry.name.value, value: entry.value.value }));
}
return [];
}
// /**
// * @param {Tag} data
// */
// function getText(data) {
// if (data.textNodes) {
// return data.textNodes.map(textNode => textNode.value).join('');
// }
// return null;
// }
// /**
// * @param {Tag} data
// */
// function getClassList(data) {
// const classString = getAttribute(data, 'class');
// return classString ? classString.split(' ') : [];
// }
/**
* @param {string} html
*/
function getImages(html) {
/** @type {Heading[]} */
const images = [];
parser.eventHandler = (ev, _data) => {
if (ev === SaxEventType.CloseTag) {
const data = /** @type {Tag} */ (/** @type {any} */ (_data));
if (data.name === 'img') {
const { openStart, closeEnd } = data;
const attributes = getAttributes(data);
const presetName = getAttribute(data, 'rocket-image');
const src = getAttribute(data, 'src');
const title = getAttribute(data, 'title');
const alt = getAttribute(data, 'alt');
if (presetName) {
images.push({
presetName,
attributes,
src,
title,
alt,
openStart,
closeEnd,
});
}
}
}
};
parser.write(Buffer.from(html, 'utf8'));
parser.end();
// @ts-ignore
return images;
}
function getSrcsetAttribute(imageFormat) {
return `srcset="${imageFormat.map(entry => entry.srcset).join(', ')}"`;
}
async function responsiveImages(images, { inputPath, outputDir, imagePresets = {} }) {
for (let i = 0; i < images.length; i += 1) {
const { alt, filePath, title, src, presetName, attributes } = images[i];
if (alt === undefined) {
throw new Error(`Missing \`alt\` on responsive image from: ${src} in ${inputPath}`);
}
const presetSettings = imagePresets[presetName];
if (!presetSettings) {
throw new Error(`Could not find imagePresets: { ${presetName}: {} }`);
}
const sizes = presetSettings.sizes || '100vw';
const metadata = await EleventyImage(filePath, {
outputDir: path.join(outputDir, 'images'),
urlPath: '/images/',
...presetSettings,
});
const lowsrc = metadata.jpeg[0];
let pictureStartWithSources = '';
let srcsetAttribute = '';
let sizesAttribute = '';
let pictureEnd = '';
if (Object.keys(metadata).length > 1) {
const sources = Object.values(metadata)
.map(imageFormat => {
return `<source type="${imageFormat[0].sourceType}" ${getSrcsetAttribute(
imageFormat,
)} sizes="${sizes}">`;
})
.join('\n');
pictureStartWithSources = `<picture>\n${sources}`;
pictureEnd = '</picture>';
} else {
srcsetAttribute = getSrcsetAttribute(Object.values(metadata)[0]);
sizesAttribute = `sizes="${sizes}"`;
}
const attributesString = attributes
.filter(attribute => !['src', 'title'].includes(attribute.name))
.map(attribute => `${attribute.name}="${attribute.value}"`)
.join(' ');
const figureStart = title ? '<figure>' : '';
const figureEndWithCaption = title ? `<figcaption>${title}</figcaption>\n</figure>` : '';
images[i].newHtml = `
${figureStart}
${pictureStartWithSources}
<img
${attributesString}
src="${lowsrc.url}"
${srcsetAttribute}
${sizesAttribute}
width="${lowsrc.width}"
height="${lowsrc.height}"
loading="lazy"
decoding="async"
/>
${pictureEnd}
${figureEndWithCaption}
`;
}
return images;
}
function updateHtml(html, changes) {
let newHtml = html;
for (const change of changes) {
newHtml = replaceBetween({
html: newHtml,
start: change.openStart,
end: change.closeEnd,
insert: change.newHtml,
});
}
return newHtml;
}
function resolveFilePath(images, { inputPath }) {
for (let i = 0; i < images.length; i += 1) {
images[i].filePath = path.join(path.dirname(inputPath), images[i].src);
}
return images;
}
let isSetup = false;
/**
* @param {string} html
*/
async function insertResponsiveImages(html) {
const config = getComputedConfig();
if (!isSetup) {
await parser.prepareWasm(saxWasmBuffer);
isSetup = true;
}
const options = {
inputPath: this.inputPath,
outputDir: this.outputDir,
imagePresets: config.imagePresets,
};
let images = getImages(html);
images = resolveFilePath(images, options);
images = await responsiveImages(images, options);
const newHtml = updateHtml(html, images);
return newHtml;
}
module.exports = {
insertResponsiveImages,
};

View File

@@ -1,6 +1,7 @@
const path = require('path');
const fs = require('fs');
const { processLocalReferences } = require('./processLocalReferences.cjs');
const { insertResponsiveImages } = require('./insertResponsiveImages.cjs');
function inlineFilePath(filePath) {
let data = fs.readFileSync(filePath, function (err, contents) {
@@ -24,6 +25,7 @@ const rocketFilters = {
eleventyConfig.addFilter('inlineFilePath', inlineFilePath);
eleventyConfig.addTransform('insertResponsiveImages', insertResponsiveImages);
eleventyConfig.addTransform('processLocalReferences', processLocalReferences);
},
};

View File

@@ -45,11 +45,24 @@ export async function normalizeConfig(inConfig) {
devServer: {},
...inConfig,
imagePresets: {
responsive: {
widths: [600, 900, 1640],
formats: ['avif', 'jpeg'],
sizes: '100vw',
},
},
};
if (inConfig && inConfig.devServer) {
config.devServer = { ...config.devServer, ...inConfig.devServer };
}
if (inConfig.imagePresets && inConfig.imagePresets.responsive) {
config.imagePresets.responsive = {
...config.imagePresets.responsive,
...inConfig.imagePresets.responsive,
};
}
let userConfigFile;
let __configDir = process.cwd();
@@ -73,7 +86,14 @@ export async function normalizeConfig(inConfig) {
...config.devServer,
...fileConfig.devServer,
},
imagePresets: config.imagePresets,
};
if (fileConfig.imagePresets && fileConfig.imagePresets.responsive) {
config.imagePresets.responsive = {
...config.imagePresets.responsive,
...fileConfig.imagePresets.responsive,
};
}
}
} catch (error) {
console.error('Could not read rocket config file', error);
@@ -88,6 +108,10 @@ export async function normalizeConfig(inConfig) {
for (const preset of config.presets) {
config._presetPathes.push(preset.path);
if (preset.adjustImagePresets) {
config.imagePresets = preset.adjustImagePresets(config.imagePresets);
}
if (preset.setupUnifiedPlugins) {
config.setupUnifiedPlugins = [...config.setupUnifiedPlugins, ...preset.setupUnifiedPlugins];
}

View File

@@ -5,6 +5,16 @@ const { getComputedConfig } = require('../public/computedConfig.cjs');
const rocketFilters = require('../eleventy-plugins/rocketFilters.cjs');
const rocketCopy = require('../eleventy-plugins/rocketCopy.cjs');
const rocketCollections = require('../eleventy-plugins/rocketCollections.cjs');
const { adjustPluginOptions } = require('plugins-manager');
const image = require('./mdjsImageHandler.cjs');
const defaultSetupUnifiedPlugins = [
adjustPluginOptions('remark2rehype', {
handlers: {
image,
},
}),
];
module.exports = function (eleventyConfig) {
const config = getComputedConfig();
@@ -28,7 +38,9 @@ module.exports = function (eleventyConfig) {
{
name: 'eleventy-plugin-mdjs-unified',
plugin: eleventyPluginMdjsUnified,
options: { setupUnifiedPlugins: config.setupUnifiedPlugins },
options: {
setupUnifiedPlugins: [...defaultSetupUnifiedPlugins, ...config.setupUnifiedPlugins],
},
},
{
name: 'eleventy-rocket-nav',

View File

@@ -0,0 +1,17 @@
const normalize = require('mdurl/encode');
function image(h, node) {
const props = {
src: normalize(node.url),
alt: node.alt,
'rocket-image': 'responsive',
};
if (node.title !== null && node.title !== undefined) {
props.title = node.title;
}
return h(node, 'img', props);
}
module.exports = image;

View File

@@ -106,31 +106,33 @@ describe('RocketCli computedConfig', () => {
cli = await executeStart('computed-config-fixtures/image-link/rocket.config.js');
const namedMdContent = [
'<p><a href="../">Root</a>',
'<a href="../one-level/raw/">Raw</a>',
'<img src="../images/my-img.svg" alt="my-img">',
'<img src="/images/my-img.svg" alt="absolute-img"></p>',
'<p>',
' <a href="../">Root</a>',
' <a href="../one-level/raw/">Raw</a>',
' <img src="../images/my-img.svg" alt="my-img" />',
' <img src="/images/my-img.svg" alt="absolute-img" />',
'</p>',
];
const namedHtmlContent = [
'<div id="with-anchor">',
' <a href="../">Root</a>',
' <a href="../one-level/raw/">Raw</a>',
' <img src="../images/my-img.svg" alt="my-img">',
' <img src="/images/my-img.svg" alt="absolute-img">',
' <img src="../images/my-img.svg" alt="my-img" />',
' <img src="/images/my-img.svg" alt="absolute-img" />',
' <picture>',
' <source media="(min-width:465px)" srcset="../images/picture-min-465.jpg">',
' <img src="../images/picture-fallback.jpg" alt="Fallback" style="width:auto;">',
' <source media="(min-width:465px)" srcset="../images/picture-min-465.jpg" />',
' <img src="../images/picture-fallback.jpg" alt="Fallback" style="width: auto" />',
' </picture>',
'</div>',
];
const templateHtml = await readStartOutput(cli, 'template/index.html');
const templateHtml = await readStartOutput(cli, 'template/index.html', { formatHtml: true });
expect(templateHtml, 'template/index.html does not match').to.equal(
namedHtmlContent.join('\n'),
);
const guidesHtml = await readStartOutput(cli, 'guides/index.html');
const guidesHtml = await readStartOutput(cli, 'guides/index.html', { formatHtml: true });
expect(guidesHtml, 'guides/index.html does not match').to.equal(
[...namedMdContent, ...namedHtmlContent].join('\n'),
);
@@ -157,27 +159,28 @@ describe('RocketCli computedConfig', () => {
);
// for index files no '../' will be added
const indexHtml = await readStartOutput(cli, 'index.html');
const indexHtml = await readStartOutput(cli, 'index.html', { formatHtml: true });
expect(indexHtml, 'index.html does not match').to.equal(
[
'<p><a href="./">Root</a>',
'<a href="guides/#with-anchor">Guides</a>',
'<a href="./one-level/raw/">Raw</a>',
'<a href="template/">Template</a>',
'<a href="./rules/tabindex/">EndingIndex</a>',
'<img src="./images/my-img.svg" alt="my-img">',
'<img src="/images/my-img.svg" alt="absolute-img"></p>',
'<div>',
'<p>',
' <a href="./">Root</a>',
' 👇<a href="guides/#with-anchor">Guides</a>',
' 👉 <a href="./one-level/raw/">Raw</a>',
' <a href="guides/#with-anchor">Guides</a>',
' <a href="./one-level/raw/">Raw</a>',
' <a href="template/">Template</a>',
' <a href="./rules/tabindex/">EndingIndex</a>',
' <img src="./images/my-img.svg" alt="my-img">',
' <img src="/images/my-img.svg" alt="absolute-img">',
' <img src="./images/my-img.svg" alt="my-img" />',
' <img src="/images/my-img.svg" alt="absolute-img" />',
'</p>',
'<div>',
' <a href="./">Root</a>',
' 👇<a href="guides/#with-anchor">Guides</a> 👉 <a href="./one-level/raw/">Raw</a>',
' <a href="template/">Template</a>',
' <a href="./rules/tabindex/">EndingIndex</a>',
' <img src="./images/my-img.svg" alt="my-img" />',
' <img src="/images/my-img.svg" alt="absolute-img" />',
' <picture>',
' <source media="(min-width:465px)" srcset="./images/picture-min-465.jpg">',
' <img src="./images/picture-fallback.jpg" alt="Fallback" style="width:auto;">',
' <source media="(min-width:465px)" srcset="./images/picture-min-465.jpg" />',
' <img src="./images/picture-fallback.jpg" alt="Fallback" style="width: auto" />',
' </picture>',
'</div>',
].join('\n'),

View File

@@ -0,0 +1,201 @@
import chai from 'chai';
import chalk from 'chalk';
import { executeStart, readStartOutput, setFixtureDir } from '@rocket/cli/test-helpers';
const { expect } = chai;
describe('RocketCli images', () => {
let cli;
before(() => {
// ignore colors in tests as most CIs won't support it
chalk.level = 0;
setFixtureDir(import.meta.url);
});
afterEach(async () => {
if (cli?.cleanup) {
await cli.cleanup();
}
});
describe('Images', () => {
it('does render content images responsive', async () => {
cli = await executeStart('e2e-fixtures/images/rocket.config.js');
const indexHtml = await readStartOutput(cli, 'index.html', { formatHtml: true });
expect(indexHtml).to.equal(
[
'<p>',
' <figure>',
' <picture>',
' <source',
' type="image/avif"',
' srcset="/images/d67643ad-600.avif 600w, /images/d67643ad-900.avif 900w"',
' sizes="100vw"',
' />',
' <source',
' type="image/jpeg"',
' srcset="/images/d67643ad-600.jpeg 600w, /images/d67643ad-900.jpeg 900w"',
' sizes="100vw"',
' />',
' <img',
' alt="My Image Alternative Text"',
' rocket-image="responsive"',
' src="/images/d67643ad-600.jpeg"',
' width="600"',
' height="316"',
' loading="lazy"',
' decoding="async"',
' />',
' </picture>',
' <figcaption>My Image Description</figcaption>',
' </figure>',
'</p>',
].join('\n'),
);
});
it('renders multiple images in the correct order', async () => {
cli = await executeStart('e2e-fixtures/images/rocket.config.js');
const indexHtml = await readStartOutput(cli, 'two-images/index.html', { formatHtml: true });
expect(indexHtml).to.equal(
[
'<p>',
' <picture>',
' <source',
' type="image/avif"',
' srcset="/images/d67643ad-600.avif 600w, /images/d67643ad-900.avif 900w"',
' sizes="100vw"',
' />',
' <source',
' type="image/jpeg"',
' srcset="/images/d67643ad-600.jpeg 600w, /images/d67643ad-900.jpeg 900w"',
' sizes="100vw"',
' />',
' <img',
' alt="one"',
' rocket-image="responsive"',
' src="/images/d67643ad-600.jpeg"',
' width="600"',
' height="316"',
' loading="lazy"',
' decoding="async"',
' />',
' </picture>',
'',
' <picture>',
' <source',
' type="image/avif"',
' srcset="/images/d67643ad-600.avif 600w, /images/d67643ad-900.avif 900w"',
' sizes="100vw"',
' />',
' <source',
' type="image/jpeg"',
' srcset="/images/d67643ad-600.jpeg 600w, /images/d67643ad-900.jpeg 900w"',
' sizes="100vw"',
' />',
' <img',
' alt="two"',
' rocket-image="responsive"',
' src="/images/d67643ad-600.jpeg"',
' width="600"',
' height="316"',
' loading="lazy"',
' decoding="async"',
' />',
' </picture>',
'</p>',
].join('\n'),
);
});
it('can configure those responsive images', async () => {
cli = await executeStart('e2e-fixtures/images/small.rocket.config.js');
const indexHtml = await readStartOutput(cli, 'index.html', { formatHtml: true });
expect(indexHtml).to.equal(
[
'<p>',
' <figure>',
' <picture>',
' <source',
' type="image/avif"',
' srcset="/images/d67643ad-30.avif 30w, /images/d67643ad-60.avif 60w"',
' sizes="(min-width: 1024px) 30px, 60px"',
' />',
' <source',
' type="image/jpeg"',
' srcset="/images/d67643ad-30.jpeg 30w, /images/d67643ad-60.jpeg 60w"',
' sizes="(min-width: 1024px) 30px, 60px"',
' />',
' <img',
' alt="My Image Alternative Text"',
' rocket-image="responsive"',
' src="/images/d67643ad-30.jpeg"',
' width="30"',
' height="15"',
' loading="lazy"',
' decoding="async"',
' />',
' </picture>',
' <figcaption>My Image Description</figcaption>',
' </figure>',
'</p>',
].join('\n'),
);
});
it('will only render a figure & figcaption if there is a caption/title', async () => {
cli = await executeStart('e2e-fixtures/images/small.rocket.config.js');
const indexHtml = await readStartOutput(cli, 'no-title/index.html', { formatHtml: true });
expect(indexHtml).to.equal(
[
'<p>',
' <picture>',
' <source',
' type="image/avif"',
' srcset="/images/d67643ad-30.avif 30w, /images/d67643ad-60.avif 60w"',
' sizes="(min-width: 1024px) 30px, 60px"',
' />',
' <source',
' type="image/jpeg"',
' srcset="/images/d67643ad-30.jpeg 30w, /images/d67643ad-60.jpeg 60w"',
' sizes="(min-width: 1024px) 30px, 60px"',
' />',
' <img',
' alt="My Image Alternative Text"',
' rocket-image="responsive"',
' src="/images/d67643ad-30.jpeg"',
' width="30"',
' height="15"',
' loading="lazy"',
' decoding="async"',
' />',
' </picture>',
'</p>',
].join('\n'),
);
});
it('will render an img with srcset and sizes if there is only one image format', async () => {
cli = await executeStart('e2e-fixtures/images/single-format.rocket.config.js');
const indexHtml = await readStartOutput(cli, 'no-title/index.html', { formatHtml: true });
expect(indexHtml).to.equal(
[
'<p>',
' <img',
' alt="My Image Alternative Text"',
' rocket-image="responsive"',
' src="/images/d67643ad-30.jpeg"',
' srcset="/images/d67643ad-30.jpeg 30w, /images/d67643ad-60.jpeg 60w"',
' sizes="(min-width: 1024px) 30px, 60px"',
' width="30"',
' height="15"',
' loading="lazy"',
' decoding="async"',
' />',
'</p>',
].join('\n'),
);
});
});
});

View File

@@ -104,4 +104,27 @@ describe('RocketCli preset', () => {
const indexHtml = await readStartOutput(cli, 'index.html');
expect(indexHtml).to.include('<meta name="added" content="at the top" />');
});
it('a preset can provide an adjustImagePresets() function', async () => {
cli = await executeStart('preset-fixtures/use-preset/rocket.config.js');
const indexHtml = await readStartOutput(cli, 'index.html', { formatHtml: true });
expect(indexHtml).to.equal(
[
'<p>',
' <img',
' alt="My Image Alternative Text"',
' rocket-image="responsive"',
' src="/images/1f847765-30.jpeg"',
' srcset="/images/1f847765-30.jpeg 30w, /images/1f847765-60.jpeg 60w"',
' sizes="30px"',
' width="30"',
' height="15"',
' loading="lazy"',
' decoding="async"',
' />',
'</p>',
].join('\n'),
);
});
});

View File

@@ -1,3 +1,20 @@
import { adjustPluginOptions } from 'plugins-manager';
function image(h, node) {
return h(node, 'img', {
src: node.url,
alt: node.alt,
});
}
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
const config = {};
const config = {
setupUnifiedPlugins: [
adjustPluginOptions('remark2rehype', {
handlers: {
image,
},
}),
],
};
export default config;

View File

@@ -0,0 +1 @@
**/*.njk

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -0,0 +1,5 @@
---
layout: layout-raw
---
![My Image Alternative Text](./_assets/my-image.jpg 'My Image Description')

View File

@@ -0,0 +1,5 @@
---
layout: layout-raw
---
![My Image Alternative Text](./_assets/my-image.jpg)

View File

@@ -0,0 +1,5 @@
---
layout: layout-raw
---
![one](./_assets/my-image.jpg)![two](./_assets/my-image.jpg)

View File

@@ -0,0 +1,3 @@
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
const config = {};
export default config;

View File

@@ -0,0 +1,11 @@
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
const config = {
imagePresets: {
responsive: {
widths: [30, 60],
formats: ['jpeg'],
sizes: '(min-width: 1024px) 30px, 60px',
},
},
};
export default config;

View File

@@ -0,0 +1,11 @@
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
const config = {
imagePresets: {
responsive: {
widths: [30, 60],
formats: ['avif', 'jpeg'],
sizes: '(min-width: 1024px) 30px, 60px',
},
},
};
export default config;

View File

@@ -7,4 +7,9 @@ export default {
data: '--config-override--',
},
},
imagePresets: {
responsive: {
sizes: '--override-sizes--',
},
},
};

View File

@@ -47,6 +47,13 @@ describe('normalizeConfig', () => {
{ commands: ['build'] },
{ commands: ['start', 'build', 'lint'] },
],
imagePresets: {
responsive: {
formats: ['avif', 'jpeg'],
sizes: '100vw',
widths: [600, 900, 1640],
},
},
inputDir: 'docs',
outputDir: '_site',
});
@@ -77,6 +84,13 @@ describe('normalizeConfig', () => {
setupCliPlugins: [],
setupEleventyComputedConfig: [],
presets: [],
imagePresets: {
responsive: {
formats: ['avif', 'jpeg'],
sizes: '100vw',
widths: [600, 900, 1640],
},
},
serviceWorkerName: 'service-worker.js',
plugins: [
{ commands: ['start'] },
@@ -110,6 +124,13 @@ describe('normalizeConfig', () => {
setupCliPlugins: [],
setupEleventyComputedConfig: [],
presets: [],
imagePresets: {
responsive: {
formats: ['avif', 'jpeg'],
sizes: '--override-sizes--',
widths: [600, 900, 1640],
},
},
serviceWorkerName: 'service-worker.js',
plugins: [
{ commands: ['start'] },
@@ -146,6 +167,13 @@ describe('normalizeConfig', () => {
setupCliPlugins: [],
setupEleventyComputedConfig: [],
presets: [],
imagePresets: {
responsive: {
formats: ['avif', 'jpeg'],
sizes: '100vw',
widths: [600, 900, 1640],
},
},
serviceWorkerName: 'service-worker.js',
plugins: [
{ commands: ['start'] },

View File

@@ -0,0 +1 @@
**/*.njk

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -0,0 +1 @@
module.exports = 'do-not-generate-a-social-media-image';

View File

@@ -0,0 +1,5 @@
---
layout: layout-raw
---
![My Image Alternative Text](./_assets/my-image.jpg)

View File

@@ -0,0 +1,19 @@
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export function myPreset() {
return {
path: path.resolve(__dirname),
adjustImagePresets: imagePresets => ({
...imagePresets,
responsive: {
...imagePresets.responsive,
widths: [30, 60],
formats: ['jpeg'],
sizes: '30px',
},
}),
};
}

View File

@@ -0,0 +1,8 @@
import { myPreset } from './my-preset.js';
/** @type {Partial<import("../../../types/main").RocketCliOptions>} */
const config = {
presets: [myPreset()],
};
export default config;

View File

@@ -17,6 +17,14 @@ interface RocketStartConfig {
createSocialMediaImages?: boolean;
}
type ImageFormat = 'avif' | 'webp' | 'jpg' | 'png' | 'svg';
interface ImagePreset {
widths: number[];
formats: ImageFormat[];
sizes: string;
}
export interface RocketCliOptions {
presets: Array<RocketPreset>;
pathPrefix?: string;
@@ -27,6 +35,9 @@ export interface RocketCliOptions {
absoluteBaseUrl?: string;
watch: boolean;
createSocialMediaImages?: boolean;
imagePresets: {
[key: string]: ImagePreset;
};
start?: RocketStartConfig;

View File

@@ -1,5 +1,12 @@
# @rocket/launch
## 0.5.0
### Minor Changes
- 8bba4a8: Configure responsive image sizes to align with the launch preset breakpoints.
The set value is `sizes: '(min-width: 1024px) 820px, calc(100vw - 40px)'`.
## 0.4.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@rocket/launch",
"version": "0.4.2",
"version": "0.5.0",
"publishConfig": {
"access": "public"
},

View File

@@ -106,7 +106,7 @@ hr {
#content-wrapper .content-area,
#main-header .content-area,
#main-footer .content-area {
padding: 0 30px;
padding: 0 20px;
}
#content-wrapper .content-area {

View File

@@ -463,9 +463,9 @@
}
.markdown-body img {
/* background-color: #fff; */
box-sizing: content-box;
max-width: 100%;
width: 100%;
height: auto;
}

View File

@@ -52,5 +52,13 @@ export function rocketLaunch() {
setupEleventyComputedConfig: [
adjustPluginOptions('layout', { defaultLayout: 'layout-sidebar' }),
],
adjustImagePresets: imagePresets => ({
...imagePresets,
responsive: {
...imagePresets.responsive,
widths: [600, 900, 1640],
sizes: '(min-width: 1024px) 820px, calc(100vw - 40px)',
},
}),
};
}

View File

@@ -1,5 +1,15 @@
# Change Log
## 0.7.2
### Patch Changes
- ce9b12e: Support importing via es module
```js
import { mdjsProcess } = from '@mdjs/core';
```
## 0.7.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@mdjs/core",
"version": "0.7.1",
"version": "0.7.2",
"publishConfig": {
"access": "public"
},
@@ -32,6 +32,7 @@
"files": [
"*.d.ts",
"*.js",
"*.mjs",
"dist-types",
"src",
"types"

111
yarn.lock
View File

@@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@11ty/dependency-tree/-/dependency-tree-1.0.0.tgz#b1fa53da49aafe0ab3fe38bc6b6058b704aa59a1"
integrity sha512-2FWYlkphQ/83MG7b9qqBJfJJ0K9zupNz/6n4EdDuNLw6hQHGp4Sp4UMDRyBvA/xCTYDBaPSuSjHuu45tSujegg==
"@11ty/eleventy-cache-assets@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.0.4.tgz#8a4da7b61c0933566877cda8db9a47d6c594c78e"
integrity sha512-EP3QYeHo3yfKF92R5Mh9MaLLgZjZNxWM8c0BwLNUCeZpOOA4Ry9HOs8k+6pNQ0wletUvMSnuzIa1hMiC67OcGw==
"@11ty/eleventy-cache-assets@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.2.1.tgz#465ebc794102b1e20b71207010de272c1a3191ab"
integrity sha512-RnbYXSFmj0d7+9kOPdCmdFou3616++aCNLBBNXxjVJF5tXdziO8PdjS9w0ktBgCIGfxz1/nwPHhL+HEqo3Iz/Q==
dependencies:
debug "^4.3.1"
flat-cache "^3.0.4"
@@ -18,17 +18,17 @@
p-queue "^6.6.2"
short-hash "^1.0.0"
"@11ty/eleventy-img@^0.7.4":
version "0.7.4"
resolved "https://registry.yarnpkg.com/@11ty/eleventy-img/-/eleventy-img-0.7.4.tgz#571f90f87bbfcfca1cffda9719de34965ada4a2e"
integrity sha512-yw1nxe9dBz7skrrcPoDodCGvqYjj4R77YWHsBz4UWBcyLcnWI+iJ+wJXhKfEhDkBNRmp9/28vJZFKqvL1q8fAQ==
"@11ty/eleventy-img@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@11ty/eleventy-img/-/eleventy-img-0.9.0.tgz#bf9e469f3c48778fa0c6f6f7f949524207420cc3"
integrity sha512-bw6++TlUokFuv/VUvnAyVQp5bykSleVvmvedIWkN8iKMykrNnf+UAUi9byXrlsFwgUvWBdMZH+0j1/1nKhv5VQ==
dependencies:
"@11ty/eleventy-cache-assets" "^2.0.4"
"@11ty/eleventy-cache-assets" "^2.2.1"
debug "^4.3.1"
fs-extra "^9.0.1"
image-size "^0.9.3"
p-queue "^6.6.2"
sharp "^0.27.0"
sharp "^0.28.2"
short-hash "^1.0.0"
"@11ty/eleventy@^0.11.1":
@@ -2184,11 +2184,6 @@ array-differ@^3.0.0:
resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b"
integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==
array-flatten@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-3.0.0.tgz#6428ca2ee52c7b823192ec600fa3ed2f157cd541"
integrity sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==
array-union@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
@@ -3274,13 +3269,6 @@ decompress-response@^4.2.0:
dependencies:
mimic-response "^2.0.0"
decompress-response@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc"
integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
dependencies:
mimic-response "^3.1.0"
dedent@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
@@ -3402,6 +3390,11 @@ devtools-protocol@0.0.818844:
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.818844.tgz#d1947278ec85b53e4c8ca598f607a28fa785ba9e"
integrity sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==
devtools-protocol@0.0.869402:
version "0.0.869402"
resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.869402.tgz#03ade701761742e43ae4de5dc188bcd80f156d8d"
integrity sha512-VvlVYY+VDJe639yHs5PHISzdWTLL3Aw8rO4cvUtwvoxFd6FHbE4OpHHcde52M6096uYYazAmd4l0o5VuFRO2WA==
diff@3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
@@ -5789,11 +5782,6 @@ mimic-response@^2.0.0:
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43"
integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==
mimic-response@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
min-indent@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
@@ -6001,10 +5989,10 @@ nise@^4.0.4:
just-extend "^4.0.2"
path-to-regexp "^1.7.0"
node-abi@^2.7.0:
version "2.19.3"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.19.3.tgz#252f5dcab12dad1b5503b2d27eddd4733930282d"
integrity sha512-9xZrlyfvKhWme2EXFKQhZRp1yNWT/uI1luYPr3sFl+H4keYY4xR+1jO7mvTTijIsHf1M+QDe9uWuKeEpLInIlg==
node-abi@^2.21.0:
version "2.26.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.26.0.tgz#355d5d4bc603e856f74197adbf3f5117a396ba40"
integrity sha512-ag/Vos/mXXpWLLAYWsAoQdgS+gW7IwvgMLOgqopm/DbzAjazLltzgzpVMsFlgmo9TzG5hGXeaBZx2AI731RIsQ==
dependencies:
semver "^5.4.1"
@@ -6107,7 +6095,7 @@ npm-run-path@^4.0.0:
dependencies:
path-key "^3.0.0"
npmlog@^4.0.1, npmlog@^4.1.2:
npmlog@^4.0.1:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
@@ -6617,10 +6605,10 @@ portscanner@2.1.1:
async "1.5.2"
is-number-like "^1.0.3"
prebuild-install@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.0.0.tgz#669022bcde57c710a869e39c5ca6bf9cd207f316"
integrity sha512-h2ZJ1PXHKWZpp1caLw0oX9sagVpL2YTk+ZwInQbQ3QqNd4J03O6MpFNmMTJlkfgPENWqe5kP0WjQLqz5OjLfsw==
prebuild-install@^6.1.2:
version "6.1.2"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.1.2.tgz#6ce5fc5978feba5d3cbffedca0682b136a0b5bff"
integrity sha512-PzYWIKZeP+967WuKYXlTOhYBgGOvTRSfaKI89XnfJ0ansRAH7hDU45X+K+FZeI1Wb/7p/NnuctPH3g0IqKUuSQ==
dependencies:
detect-libc "^1.0.3"
expand-template "^2.0.3"
@@ -6628,7 +6616,7 @@ prebuild-install@^6.0.0:
minimist "^1.2.3"
mkdirp-classic "^0.5.3"
napi-build-utils "^1.0.1"
node-abi "^2.7.0"
node-abi "^2.21.0"
noop-logger "^0.1.1"
npmlog "^4.0.1"
pump "^3.0.0"
@@ -6636,7 +6624,6 @@ prebuild-install@^6.0.0:
simple-get "^3.0.3"
tar-fs "^2.0.0"
tunnel-agent "^0.6.0"
which-pm-runs "^1.0.0"
preferred-pm@^3.0.0:
version "3.0.2"
@@ -6880,19 +6867,19 @@ puppeteer-core@^5.5.0:
unbzip2-stream "^1.3.3"
ws "^7.2.3"
puppeteer@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-5.5.0.tgz#331a7edd212ca06b4a556156435f58cbae08af00"
integrity sha512-OM8ZvTXAhfgFA7wBIIGlPQzvyEETzDjeRa4mZRCRHxYL+GNH5WAuYUQdja3rpWZvkX/JKqmuVgbsxDNsDFjMEg==
puppeteer@^9.0.0:
version "9.1.1"
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-9.1.1.tgz#f74b7facf86887efd6c6b9fabb7baae6fdce012c"
integrity sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==
dependencies:
debug "^4.1.0"
devtools-protocol "0.0.818844"
devtools-protocol "0.0.869402"
extract-zip "^2.0.0"
https-proxy-agent "^4.0.0"
https-proxy-agent "^5.0.0"
node-fetch "^2.6.1"
pkg-dir "^4.2.0"
progress "^2.0.1"
proxy-from-env "^1.0.0"
proxy-from-env "^1.1.0"
rimraf "^3.0.2"
tar-fs "^2.0.0"
unbzip2-stream "^1.3.3"
@@ -7463,6 +7450,13 @@ semver@^7.2.1, semver@^7.3.2, semver@^7.3.4:
dependencies:
lru-cache "^6.0.0"
semver@^7.3.5:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
dependencies:
lru-cache "^6.0.0"
send@0.16.2:
version "0.16.2"
resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
@@ -7544,19 +7538,17 @@ setprototypeof@1.2.0:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
sharp@^0.27.0:
version "0.27.0"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.27.0.tgz#523fba913ba674985dcc688a6a5237384079d80f"
integrity sha512-II+YBCW3JuVWQZdpTEA2IBjJcYXPuoKo3AUqYuW+FK9Um93v2gPE2ihICCsN5nHTUoP8WCjqA83c096e8n//Rw==
sharp@^0.28.2:
version "0.28.2"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.28.2.tgz#31c6ebdf8ddb9b4ca3e30179e3f4a73f0c7474e4"
integrity sha512-CdmySbsQVe/+ZM2j9zzvUfWumM0L0iHj1kpxJMFuyWvSuBULebvGCdOLb1f5vbbBrIGroX714Fx1wiWaKniz4A==
dependencies:
array-flatten "^3.0.0"
color "^3.1.3"
detect-libc "^1.0.3"
node-addon-api "^3.1.0"
npmlog "^4.1.2"
prebuild-install "^6.0.0"
semver "^7.3.4"
simple-get "^4.0.0"
prebuild-install "^6.1.2"
semver "^7.3.5"
simple-get "^3.1.0"
tar-fs "^2.1.1"
tunnel-agent "^0.6.0"
@@ -7611,7 +7603,7 @@ simple-concat@^1.0.0:
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f"
integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==
simple-get@^3.0.3:
simple-get@^3.0.3, simple-get@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3"
integrity sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==
@@ -7620,15 +7612,6 @@ simple-get@^3.0.3:
once "^1.3.1"
simple-concat "^1.0.0"
simple-get@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.0.tgz#73fa628278d21de83dadd5512d2cc1f4872bd675"
integrity sha512-ZalZGexYr3TA0SwySsr5HlgOOinS4Jsa8YB2GJ6lUNAazyAu4KG/VmzMTwAt2YVXzzVj8QmefmAonZIK2BSGcQ==
dependencies:
decompress-response "^6.0.0"
once "^1.3.1"
simple-concat "^1.0.0"
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"