From d9b5795e37456548d3fa133063e5446819058cf8 Mon Sep 17 00:00:00 2001 From: GatsbyJS Bot Date: Tue, 6 Dec 2022 10:10:26 -0700 Subject: [PATCH 1/6] chore: remove tracedSVG (#37093) (#37137) * chore: remove tracedSVG (#37093) * init * gri * update shopify snapshot * gatsby-plugin-sharp tests * update gatsby-remark-images/gatsby-node tests * update gatsby-plugin-image tests * update schema print tests * remove traceSVG unit tests as it was removed * legacy gatsby-image fields * update polyfill tests * update cypress assertion * update contentful cypress assertions * drop few more packages from gatsby-plugin-sharp as they are no onger used * correct IMAGE_CDN fallback for TRACE_SVG * update generateImageData * update e2e-prod/assertions * update unit test * update snapshot * update e2e-dev/assertions * drop more unused * sync yarn.lock * a bit more prod warnings * adjust gatsby-remark-images plugin options warning * add link to gatsby-remark-images warning (cherry picked from commit 94c2d735ad378bf05836e74cc47f7ca9523cabdc) * gatsby recipe tests * cli tests * babel config tests * update assertion * some reverts? * update assertion * contentful extend node type * fallback in test * fix tracedSVG fields * fix(gatsby-cli): relax error location validation and ignore extra fields (#34559) * package.json removals Co-authored-by: Michal Piechowiak (cherry picked from commit 0c45654476ca506cb268b17784ae46399ae178d8) --- .../cypress/integration/traced.js | 12 +- examples/using-contentful/package.json | 1 + integration-tests/gatsby-cli/__tests__/new.js | 8 +- .../src/structured-errors/error-schema.ts | 12 +- .../gatsby-plugin-image/src/resolver-utils.ts | 10 +- packages/gatsby-plugin-sharp/package.json | 3 - .../src/__tests__/__snapshots__/index.js.snap | 8 +- .../src/__tests__/index.js | 12 +- .../src/__tests__/trace-svg.js | 219 -------- .../gatsby-plugin-sharp/src/image-data.ts | 13 +- packages/gatsby-plugin-sharp/src/index.js | 72 ++- packages/gatsby-plugin-sharp/src/trace-svg.js | 179 ------- .../npm/__snapshots__/package.test.js.snap | 4 +- .../src/providers/npm/package.js | 12 +- packages/gatsby-remark-images/package.json | 1 - .../src/__tests__/__snapshots__/index.js.snap | 60 +-- .../src/__tests__/gatsby-node.js | 168 ++++-- .../src/__tests__/index.js | 14 +- .../gatsby-remark-images/src/gatsby-node.js | 32 +- packages/gatsby-remark-images/src/index.js | 27 +- .../src/extend-node-type.js | 92 ++-- .../gatsby-transformer-sharp/package.json | 1 - .../src/customize-schema.js | 74 ++- .../gatsby-transformer-sharp/src/types.ts | 13 +- .../cache-dir/__tests__/minimal-config.js | 13 + yarn.lock | 477 +----------------- 26 files changed, 388 insertions(+), 1149 deletions(-) delete mode 100644 packages/gatsby-plugin-sharp/src/__tests__/trace-svg.js delete mode 100644 packages/gatsby-plugin-sharp/src/trace-svg.js diff --git a/e2e-tests/gatsby-static-image/cypress/integration/traced.js b/e2e-tests/gatsby-static-image/cypress/integration/traced.js index 1ae2902980036..b57574cfb16db 100644 --- a/e2e-tests/gatsby-static-image/cypress/integration/traced.js +++ b/e2e-tests/gatsby-static-image/cypress/integration/traced.js @@ -5,12 +5,14 @@ describe(`fixed`, () => { cy.visit(`/traced`).waitForRouteChange() }) - it(`renders a traced svg`, () => { + it(`traced svg (falls back to DOMINANT_COLOR)`, () => { cy.getTestElement(tracedTestId) - .find(`.gatsby-image-wrapper > img`) - .should(`have.attr`, `src`) - .and(src => { - ;[`data:image/svg+xml`].forEach(part => expect(src).to.include(part)) + .find(`.gatsby-image-wrapper > [data-placeholder-image]`) + .first() + .should($el => { + // traced falls + expect($el.prop("tagName")).to.be.equal("DIV") + expect($el).to.be.empty }) }) diff --git a/examples/using-contentful/package.json b/examples/using-contentful/package.json index 08617916457f1..f014c38716fcb 100644 --- a/examples/using-contentful/package.json +++ b/examples/using-contentful/package.json @@ -32,6 +32,7 @@ "scripts": { "develop": "gatsby develop", "build": "gatsby build", + "clean": "gatsby clean", "start": "gatsby serve" } } diff --git a/integration-tests/gatsby-cli/__tests__/new.js b/integration-tests/gatsby-cli/__tests__/new.js index 6cf61330aff15..b4e10b2d1ff69 100644 --- a/integration-tests/gatsby-cli/__tests__/new.js +++ b/integration-tests/gatsby-cli/__tests__/new.js @@ -29,7 +29,11 @@ describe(`gatsby new`, () => { }) it(`creates a gatsby site with the default starter`, () => { - const [code, logs] = GatsbyCLI.from(cwd).invoke([`new`, `gatsby-default`]) + const [code, logs] = GatsbyCLI.from(cwd).invoke([ + `new`, + `gatsby-default`, + `gatsbyjs/gatsby-starter-default#v3`, + ]) logs.should.contain( `info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git` @@ -48,7 +52,7 @@ describe(`gatsby new`, () => { const [code, logs] = GatsbyCLI.from(cwd).invoke([ `new`, `gatsby-blog`, - `gatsbyjs/gatsby-starter-blog`, + `gatsbyjs/gatsby-starter-blog#v3`, ]) logs.should.contain( diff --git a/packages/gatsby-cli/src/structured-errors/error-schema.ts b/packages/gatsby-cli/src/structured-errors/error-schema.ts index 873ba4496f8ee..8bc1cfa72af5f 100644 --- a/packages/gatsby-cli/src/structured-errors/error-schema.ts +++ b/packages/gatsby-cli/src/structured-errors/error-schema.ts @@ -1,10 +1,12 @@ import Joi from "@hapi/joi" import { ILocationPosition, IStructuredError } from "./types" -export const Position: Joi.ObjectSchema = Joi.object().keys({ - line: Joi.number(), - column: Joi.number(), -}) +export const Position: Joi.ObjectSchema = Joi.object() + .keys({ + line: Joi.number(), + column: Joi.number(), + }) + .unknown() export const errorSchema: Joi.ObjectSchema = Joi.object().keys( { @@ -27,7 +29,7 @@ export const errorSchema: Joi.ObjectSchema = Joi.object().keys location: Joi.object({ start: Position.required(), end: Position, - }), + }).unknown(), docsUrl: Joi.string().uri({ allowRelative: false, relativeOnly: false, diff --git a/packages/gatsby-plugin-image/src/resolver-utils.ts b/packages/gatsby-plugin-image/src/resolver-utils.ts index 84f6fb1995bb5..5a4fac1d55bad 100644 --- a/packages/gatsby-plugin-image/src/resolver-utils.ts +++ b/packages/gatsby-plugin-image/src/resolver-utils.ts @@ -77,11 +77,11 @@ export function getGatsbyImageFieldConfig( type: ImagePlaceholderType, defaultValue: `blurred`, description: stripIndent` - Format of generated placeholder image, displayed while the main image loads. - BLURRED: a blurred, low resolution image, encoded as a base64 data URI (default) - DOMINANT_COLOR: a solid color, calculated from the dominant color of the image. - TRACED_SVG: a low-resolution traced SVG of the image. - NONE: no placeholder. Set "background" to use a fixed background color.`, + Format of generated placeholder image, displayed while the main image loads. + BLURRED: a blurred, low resolution image, encoded as a base64 data URI. + DOMINANT_COLOR: a solid color, calculated from the dominant color of the image (default). + TRACED_SVG: deprecated. Will use DOMINANT_COLOR. + NONE: no placeholder. Set the argument "backgroundColor" to use a fixed background color.`, }, formats: { type: GraphQLList(ImageFormatType), diff --git a/packages/gatsby-plugin-sharp/package.json b/packages/gatsby-plugin-sharp/package.json index 0b0eb2a1281f1..f4bdf63b6f7d9 100644 --- a/packages/gatsby-plugin-sharp/package.json +++ b/packages/gatsby-plugin-sharp/package.json @@ -19,13 +19,10 @@ "imagemin-mozjpeg": "^9.0.0", "imagemin-pngquant": "^9.0.1", "lodash": "^4.17.20", - "mini-svg-data-uri": "^1.2.3", - "potrace": "^2.1.8", "probe-image-size": "^6.0.0", "progress": "^2.0.3", "semver": "^7.3.4", "sharp": "^0.27.0", - "svgo": "1.3.2", "uuid": "3.4.0" }, "devDependencies": { diff --git a/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap b/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap index a465d41701fea..671582ac7ac8a 100644 --- a/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap +++ b/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap @@ -1604,7 +1604,7 @@ Object { } `; -exports[`gatsby-plugin-sharp tracedSVG runs on demand 1`] = ` +exports[`gatsby-plugin-sharp tracedSVG runs on demand (and falls back to blurred): fixed 1`] = ` Object { "aspectRatio": 1, "base64": undefined, @@ -1612,12 +1612,12 @@ Object { "originalName": "test.png", "src": "/static/1234/7e516/test.png", "srcSet": "/static/1234/7e516/test.png 1x", - "tracedSVG": "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='100'%20height='100'%20viewBox='0%200%20100%20100'%20preserveAspectRatio='none'%3e%3cpath%20d='M41%2024c-18%207-24%2029-11%2043%2015%2017%2044%208%2046-15%201-19-17-34-35-28'%20fill='red'%20fill-rule='evenodd'/%3e%3c/svg%3e", + "tracedSVG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAAAsTAAALEwEAmpwYAAABP0lEQVQ4y2P4r8ZANmKgvuZ/agy/VaHojyopmv+CNf/XQCCoCEHNf1VBqv+oM5yVY1giwbBakuG2AkjknzoW/eh2/tdgOCPHYM7OwMDAwAgiGFgYGMJ5GF4og43ApRmuk58JqpMJRjIwMBizMbxTZviPaj8ihCD6rThAStkgljJATWEHc3P5wT5SxdD8B2ztERmQIiYGdAAxSpaF4T2q5TDN4HCaLgZSxMyAE1yQgwY+Fs1zxQloviSPTTMktM7JgVzIiKEH4hElFoavKogAQgltiJA3F0gdOyPC58yw8GsUwhFgUMvVGR4oMqiwogQbhOHLxfBLDcVabIlEneGxEkMMLwMvTLc4M0OdEMN3VfRIxp48/6mDnPdCieGkHCiRflRh+K+JPXljz1IQJ0AzhjrRGQPZC5As+ZeuhQGRmgHU8mT34D0STQAAAABJRU5ErkJggg==", "width": 100, } `; -exports[`gatsby-plugin-sharp tracedSVG runs on demand 2`] = ` +exports[`gatsby-plugin-sharp tracedSVG runs on demand (and falls back to blurred): fluid 1`] = ` Object { "aspectRatio": 1, "base64": undefined, @@ -1632,6 +1632,6 @@ Object { /static/1234/a1812/test.png 50w, /static/1234/7e516/test.png 100w", "srcSetType": "image/png", - "tracedSVG": "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='100'%20height='100'%20viewBox='0%200%20100%20100'%20preserveAspectRatio='none'%3e%3cpath%20d='M41%2024c-18%207-24%2029-11%2043%2015%2017%2044%208%2046-15%201-19-17-34-35-28'%20fill='red'%20fill-rule='evenodd'/%3e%3c/svg%3e", + "tracedSVG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAAAsTAAALEwEAmpwYAAABP0lEQVQ4y2P4r8ZANmKgvuZ/agy/VaHojyopmv+CNf/XQCCoCEHNf1VBqv+oM5yVY1giwbBakuG2AkjknzoW/eh2/tdgOCPHYM7OwMDAwAgiGFgYGMJ5GF4og43ApRmuk58JqpMJRjIwMBizMbxTZviPaj8ihCD6rThAStkgljJATWEHc3P5wT5SxdD8B2ztERmQIiYGdAAxSpaF4T2q5TDN4HCaLgZSxMyAE1yQgwY+Fs1zxQloviSPTTMktM7JgVzIiKEH4hElFoavKogAQgltiJA3F0gdOyPC58yw8GsUwhFgUMvVGR4oMqiwogQbhOHLxfBLDcVabIlEneGxEkMMLwMvTLc4M0OdEMN3VfRIxp48/6mDnPdCieGkHCiRflRh+K+JPXljz1IQJ0AzhjrRGQPZC5As+ZeuhQGRmgHU8mT34D0STQAAAABJRU5ErkJggg==", } `; diff --git a/packages/gatsby-plugin-sharp/src/__tests__/index.js b/packages/gatsby-plugin-sharp/src/__tests__/index.js index d077d78d14533..bbdbb6c8453b2 100644 --- a/packages/gatsby-plugin-sharp/src/__tests__/index.js +++ b/packages/gatsby-plugin-sharp/src/__tests__/index.js @@ -657,7 +657,7 @@ describe(`gatsby-plugin-sharp`, () => { expect(result.tracedSVG).toBeUndefined() }) - it(`runs on demand`, async () => { + it(`runs on demand (and falls back to blurred)`, async () => { const args = { maxWidth: 100, width: 100, @@ -671,14 +671,20 @@ describe(`gatsby-plugin-sharp`, () => { args, }) - expect(fixedSvg).toMatchSnapshot() + expect(fixedSvg).toMatchSnapshot(`fixed`) + + expect(fixedSvg.tracedSVG).toMatch(`data:image/png;base64`) + expect(fixedSvg.tracedSVG).not.toMatch(`data:image/svg+xml`) const fluidSvg = await fluid({ file, args, }) - expect(fluidSvg).toMatchSnapshot() + expect(fluidSvg).toMatchSnapshot(`fluid`) + + expect(fluidSvg.tracedSVG).toMatch(`data:image/png;base64`) + expect(fluidSvg.tracedSVG).not.toMatch(`data:image/svg+xml`) }) }) diff --git a/packages/gatsby-plugin-sharp/src/__tests__/trace-svg.js b/packages/gatsby-plugin-sharp/src/__tests__/trace-svg.js deleted file mode 100644 index e77506aa96e06..0000000000000 --- a/packages/gatsby-plugin-sharp/src/__tests__/trace-svg.js +++ /dev/null @@ -1,219 +0,0 @@ -jest.mock(`sharp`, () => { - const sharp = path => { - const pipeline = { - rotate: () => pipeline, - resize: () => pipeline, - png: () => pipeline, - jpeg: () => pipeline, - toFile: (_, cb) => cb(), - } - return pipeline - } - - sharp.simd = jest.fn() - sharp.concurrency = jest.fn() - - return sharp -}) - -jest.mock(`potrace`, () => { - const circleSvgString = `` - return { - trace: (_, _2, cb) => cb(null, circleSvgString), - Potrace: { - TURNPOLICY_MAJORITY: `wat`, - }, - } -}) - -const path = require(`path`) - -const traceSVGHelpers = require(`../trace-svg`) - -const notMemoizedtraceSVG = jest.spyOn(traceSVGHelpers, `notMemoizedtraceSVG`) -const notMemoizedPrepareTraceSVGInputFile = jest.spyOn( - traceSVGHelpers, - `notMemoizedPrepareTraceSVGInputFile` -) -// note that we started spying on not memoized functions first -// now we recreate memoized functions that will use function we just started -// spying on -traceSVGHelpers.createMemoizedFunctions() -const memoizedTraceSVG = jest.spyOn(traceSVGHelpers, `memoizedTraceSVG`) -const memoizedPrepareTraceSVGInputFile = jest.spyOn( - traceSVGHelpers, - `memoizedPrepareTraceSVGInputFile` -) - -const { traceSVG } = require(`../`) - -function getFileObject(absolutePath, name = path.parse(absolutePath).name) { - return { - id: `${absolutePath} absPath of file`, - name: name, - absolutePath, - extension: `png`, - internal: { - contentDigest: `1234`, - }, - } -} - -describe(`traceSVG memoization`, () => { - const file = getFileObject(path.join(__dirname, `images/test.png`)) - const copyOfFile = getFileObject(path.join(__dirname, `images/test-copy.png`)) - const differentFile = getFileObject( - path.join(__dirname, `images/different.png`) - ) - differentFile.internal.contentDigest = `4321` - - beforeEach(() => { - traceSVGHelpers.clearMemoizeCaches() - memoizedTraceSVG.mockClear() - notMemoizedtraceSVG.mockClear() - memoizedPrepareTraceSVGInputFile.mockClear() - notMemoizedPrepareTraceSVGInputFile.mockClear() - }) - - it(`Baseline`, async () => { - await traceSVG({ - file, - }) - - expect(memoizedTraceSVG).toBeCalledTimes(1) - expect(notMemoizedtraceSVG).toBeCalledTimes(1) - expect(memoizedPrepareTraceSVGInputFile).toBeCalledTimes(1) - expect(notMemoizedPrepareTraceSVGInputFile).toBeCalledTimes(1) - }) - - it(`Is memoizing results for same args`, async () => { - await traceSVG({ - file, - }) - - await traceSVG({ - file, - }) - - expect(memoizedTraceSVG).toBeCalledTimes(2) - expect(notMemoizedtraceSVG).toBeCalledTimes(1) - expect(memoizedPrepareTraceSVGInputFile).toBeCalledTimes(1) - expect(notMemoizedPrepareTraceSVGInputFile).toBeCalledTimes(1) - }) - - it(`Is calling functions with same input file when params change`, async () => { - await traceSVG({ - file, - args: { - color: `red`, - }, - fileArgs: { - width: 400, - }, - }) - await traceSVG({ - file, - args: { - color: `blue`, - }, - fileArgs: { - width: 400, - }, - }) - await traceSVG({ - file, - args: { - color: `red`, - }, - fileArgs: { - width: 200, - }, - }) - await traceSVG({ - file, - args: { - color: `blue`, - }, - fileArgs: { - width: 200, - }, - }) - await traceSVG({ - file: differentFile, - args: { - color: `red`, - }, - fileArgs: { - width: 400, - }, - }) - - expect(memoizedTraceSVG).toBeCalledTimes(5) - expect(notMemoizedtraceSVG).toBeCalledTimes(5) - expect(memoizedPrepareTraceSVGInputFile).toBeCalledTimes(5) - // trace svg should be actually created just 3 times - // because it's affected just by `fileArgs`, and not `args` - // this makes sure we don't try to write to same input file multiple times - expect(notMemoizedPrepareTraceSVGInputFile).toBeCalledTimes(3) - expect(notMemoizedPrepareTraceSVGInputFile).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ - file, - options: expect.objectContaining({ - width: 400, - }), - }) - ) - expect(notMemoizedPrepareTraceSVGInputFile).toHaveBeenNthCalledWith( - 2, - expect.objectContaining({ - file, - options: expect.objectContaining({ - width: 200, - }), - }) - ) - expect(notMemoizedPrepareTraceSVGInputFile).toHaveBeenNthCalledWith( - 3, - expect.objectContaining({ - file: differentFile, - options: expect.objectContaining({ - width: 400, - }), - }) - ) - - const usedTmpFilePaths = notMemoizedPrepareTraceSVGInputFile.mock.calls.map( - args => args[0].tmpFilePath - ) - - // tmpFilePath was always unique - expect(usedTmpFilePaths.length).toBe(new Set(usedTmpFilePaths).size) - }) - - it(`Use memoized results for file copies`, async () => { - await traceSVG({ - file, - args: { - color: `red`, - }, - fileArgs: { - width: 400, - }, - }) - await traceSVG({ - file: copyOfFile, - args: { - color: `red`, - }, - fileArgs: { - width: 400, - }, - }) - - expect(memoizedTraceSVG).toBeCalledTimes(2) - expect(notMemoizedtraceSVG).toBeCalledTimes(1) - expect(memoizedPrepareTraceSVGInputFile).toBeCalledTimes(1) - expect(notMemoizedPrepareTraceSVGInputFile).toBeCalledTimes(1) - }) -}) diff --git a/packages/gatsby-plugin-sharp/src/image-data.ts b/packages/gatsby-plugin-sharp/src/image-data.ts index 7c46add364945..6133deeb00558 100644 --- a/packages/gatsby-plugin-sharp/src/image-data.ts +++ b/packages/gatsby-plugin-sharp/src/image-data.ts @@ -86,6 +86,7 @@ function normalizeFormat(format: string): ImageFormat { return format as ImageFormat } +let didShowTraceSVGRemovalWarning = false export async function generateImageData({ file, args, @@ -95,7 +96,7 @@ export async function generateImageData({ }: IImageDataArgs): Promise { args = mergeDefaults(args) - const { + let { layout = `constrained`, placeholder = `dominantColor`, tracedSVGOptions = {}, @@ -112,6 +113,16 @@ export async function generateImageData({ : DEFAULT_BREAKPOINTS } + if (placeholder === `tracedSVG`) { + if (!didShowTraceSVGRemovalWarning) { + console.warn( + `"TRACED_SVG" placeholder argument value is no longer supported (used in gatsbyImageData processing), falling back to "DOMINANT_COLOR". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarning = true + } + placeholder = `dominantColor` + } + const { fit = `cover`, cropFocus = sharp.strategy.attention, diff --git a/packages/gatsby-plugin-sharp/src/index.js b/packages/gatsby-plugin-sharp/src/index.js index d388d4abb2485..3006b65b670db 100644 --- a/packages/gatsby-plugin-sharp/src/index.js +++ b/packages/gatsby-plugin-sharp/src/index.js @@ -16,7 +16,6 @@ const { createTransformObject, removeDefaultValues, } = require(`./plugin-options`) -const { memoizedTraceSVG, notMemoizedtraceSVG } = require(`./trace-svg`) const duotone = require(`./duotone`) const { IMAGE_PROCESSING_JOB_NAME } = require(`./gatsby-worker`) const { getDimensionsAndAspectRatio } = require(`./utils`) @@ -395,26 +394,17 @@ async function base64(arg) { return await memoizedBase64(arg) } +let didShowTraceSVGRemovalWarning = false async function traceSVG(args) { - if (args.cache) { - // Not all transformer plugins are going to provide cache - return await cachifiedProcess(args, generateCacheKey, notMemoizedtraceSVG) + if (!didShowTraceSVGRemovalWarning) { + console.warn( + `traceSVG placeholder generation is no longer supported, falling back to blurred. See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarning = true } - return await memoizedTraceSVG(args) -} -async function getTracedSVG({ file, options, cache, reporter }) { - if (options.generateTracedSVG && options.tracedSVG) { - const tracedSVG = await traceSVG({ - args: options.tracedSVG, - fileArgs: options, - file, - cache, - reporter, - }) - return tracedSVG - } - return undefined + const { src } = await base64(args) + return src } async function stats({ file, reporter }) { @@ -435,6 +425,7 @@ async function stats({ file, reporter }) { } } +let didShowTraceSVGRemovalWarningFluid = false async function fluid({ file, args = {}, reporter, cache }) { const options = healOptions(getPluginOptions(), args, file.extension) if (options.sizeByPixelDensity) { @@ -566,8 +557,17 @@ async function fluid({ file, args = {}, reporter, cache }) { reporter, }) + if (options.generateTracedSVG && options.tracedSVG) { + if (!didShowTraceSVGRemovalWarningFluid) { + console.warn( + `tracedSVG placeholder generation for fluid images is no longer supported, falling back to blurred. See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningFluid = true + } + } + let base64Image - if (options.base64) { + if (options.base64 || (options.generateTracedSVG && options.tracedSVG)) { const base64Width = options.base64Width const base64Height = Math.max( 1, @@ -590,8 +590,6 @@ async function fluid({ file, args = {}, reporter, cache }) { base64Image = await base64({ file, args: base64Args, reporter, cache }) } - const tracedSVG = await getTracedSVG({ options, file, cache, reporter }) - // Construct src and srcSet strings. const originalImg = _.maxBy(images, image => image.width).src const fallbackSrc = _.minBy(images, image => @@ -638,7 +636,7 @@ async function fluid({ file, args = {}, reporter, cache }) { `(max-width: ${presentationWidth}px) 100vw, ${presentationWidth}px` return { - base64: base64Image && base64Image.src, + base64: (options.base64 && base64Image && base64Image.src) || undefined, aspectRatio: images[0].aspectRatio, src: fallbackSrc, srcSet, @@ -649,10 +647,16 @@ async function fluid({ file, args = {}, reporter, cache }) { density, presentationWidth, presentationHeight, - tracedSVG, + tracedSVG: + (options.generateTracedSVG && + options.tracedSVG && + base64Image && + base64Image.src) || + undefined, } } +let didShowTraceSVGRemovalWarningFixed = false async function fixed({ file, args = {}, reporter, cache }) { const options = healOptions(getPluginOptions(), args, file.extension) @@ -705,8 +709,17 @@ async function fixed({ file, args = {}, reporter, cache }) { reporter, }) + if (options.generateTracedSVG && options.tracedSVG) { + if (!didShowTraceSVGRemovalWarningFixed) { + console.warn( + `tracedSVG placeholder generation for fixed images is no longer supported, falling back to blurred. See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningFixed = true + } + } + let base64Image - if (options.base64) { + if (options.base64 || (options.generateTracedSVG && options.tracedSVG)) { const base64Width = options.base64Width const base64Height = Math.max( 1, @@ -734,8 +747,6 @@ async function fixed({ file, args = {}, reporter, cache }) { }) } - const tracedSVG = await getTracedSVG({ options, file, reporter, cache }) - const fallbackSrc = images[0].src const srcSet = images .map((image, i) => { @@ -759,14 +770,19 @@ async function fixed({ file, args = {}, reporter, cache }) { const originalName = file.base return { - base64: base64Image && base64Image.src, + base64: (options.base64 && base64Image && base64Image.src) || undefined, aspectRatio: images[0].aspectRatio, width: images[0].width, height: images[0].height, src: fallbackSrc, srcSet, originalName: originalName, - tracedSVG, + tracedSVG: + (options.generateTracedSVG && + options.tracedSVG && + base64Image && + base64Image.src) || + undefined, } } diff --git a/packages/gatsby-plugin-sharp/src/trace-svg.js b/packages/gatsby-plugin-sharp/src/trace-svg.js deleted file mode 100644 index fe1a38819e13b..0000000000000 --- a/packages/gatsby-plugin-sharp/src/trace-svg.js +++ /dev/null @@ -1,179 +0,0 @@ -const { promisify } = require(`bluebird`) -const _ = require(`lodash`) -const tmpDir = require(`os`).tmpdir() -const path = require(`path`) -const sharp = require(`./safe-sharp`) -const filenamify = require(`filenamify`) -const duotone = require(`./duotone`) -const { getPluginOptions, healOptions } = require(`./plugin-options`) -const { reportError } = require(`./report-error`) -const { createContentDigest } = require(`gatsby-core-utils`) - -exports.notMemoizedPrepareTraceSVGInputFile = async ({ - file, - options, - tmpFilePath, - reporter, -}) => { - let pipeline - try { - pipeline = sharp(file.absolutePath) - - if (!options.rotate) { - pipeline.rotate() - } - } catch (err) { - reportError(`Failed to process image ${file.absolutePath}`, err, reporter) - return - } - - pipeline - .resize(options.width, options.height, { - position: options.cropFocus, - }) - .png({ - compressionLevel: options.pngCompressionLevel, - adaptiveFiltering: false, - force: options.toFormat === `png`, - }) - .jpeg({ - quality: options.quality, - progressive: options.jpegProgressive, - force: options.toFormat === `jpg`, - }) - - // grayscale - if (options.grayscale) { - pipeline = pipeline.grayscale() - } - - // rotate - if (options.rotate && options.rotate !== 0) { - pipeline = pipeline.rotate(options.rotate) - } - - // duotone - if (options.duotone) { - pipeline = await duotone(options.duotone, options.toFormat, pipeline) - } - - await new Promise((resolve, reject) => - pipeline.toFile(tmpFilePath, err => { - if (err) { - return reject(err) - } - return resolve() - }) - ) -} - -const optimize = svg => { - const SVGO = require(`svgo`) - const svgo = new SVGO({ - multipass: true, - floatPrecision: 0, - plugins: [ - { - removeViewBox: false, - }, - { - addAttributesToSVGElement: { - attributes: [ - { - preserveAspectRatio: `none`, - }, - ], - }, - }, - ], - }) - return svgo.optimize(svg).then(({ data }) => data) -} - -exports.notMemoizedtraceSVG = async ({ file, args, fileArgs, reporter }) => { - const options = healOptions( - getPluginOptions(), - { - // use maxWidth/maxHeight as width/height if available - // if width/height is used in fileArgs, the maxWidth/maxHeight - // values will be overritten - ...(fileArgs && fileArgs.maxWidth && fileArgs.maxHeight - ? { - height: fileArgs.maxHeight, - width: fileArgs.maxWidth, - } - : {}), - ...fileArgs, - }, - file.extension - ) - - const optionsHash = createContentDigest(options) - - const tmpFilePath = path.join( - tmpDir, - filenamify( - `${file.internal.contentDigest}-${file.name}-${optionsHash}.${file.extension}` - ) - ) - - try { - await exports.memoizedPrepareTraceSVGInputFile({ - tmpFilePath, - file, - options, - reporter, - }) - - const svgToMiniDataURI = require(`mini-svg-data-uri`) - const potrace = require(`potrace`) - const trace = promisify(potrace.trace) - - const defaultArgs = { - color: `lightgray`, - optTolerance: 0.4, - turdSize: 100, - turnPolicy: potrace.Potrace.TURNPOLICY_MAJORITY, - } - - const optionsSVG = _.defaults({}, args, defaultArgs) - - // `srcset` attribute rejects URIs with literal spaces - const encodeSpaces = str => str.replace(/ /gi, `%20`) - - return trace(tmpFilePath, optionsSVG) - .then(optimize) - .then(svgToMiniDataURI) - .then(encodeSpaces) - } catch (e) { - throw e - } -} - -let memoizedPrepareTraceSVGInputFile, memoizedTraceSVG -const createMemoizedFunctions = () => { - exports.memoizedPrepareTraceSVGInputFile = memoizedPrepareTraceSVGInputFile = _.memoize( - exports.notMemoizedPrepareTraceSVGInputFile, - ({ tmpFilePath }) => tmpFilePath - ) - - exports.memoizedTraceSVG = memoizedTraceSVG = _.memoize( - exports.notMemoizedtraceSVG, - ({ file, args, fileArgs }) => - `${file.internal.contentDigest}${JSON.stringify(args)}${JSON.stringify( - fileArgs - )}` - ) -} - -// This is very hacky, but memoized function are pretty tricky to spy on -// in tests ;( -createMemoizedFunctions() -exports.createMemoizedFunctions = () => { - createMemoizedFunctions() -} - -exports.clearMemoizeCaches = () => { - memoizedTraceSVG.cache.clear() - memoizedPrepareTraceSVGInputFile.cache.clear() -} diff --git a/packages/gatsby-recipes/src/providers/npm/__snapshots__/package.test.js.snap b/packages/gatsby-recipes/src/providers/npm/__snapshots__/package.test.js.snap index 1386303baa81e..029c6414cc4cc 100644 --- a/packages/gatsby-recipes/src/providers/npm/__snapshots__/package.test.js.snap +++ b/packages/gatsby-recipes/src/providers/npm/__snapshots__/package.test.js.snap @@ -48,11 +48,11 @@ Object { exports[`npm package resource installs 2 resources, one prod & one dev 1`] = ` Object { - "_message": "Installed NPM package div@2.0.0", + "_message": "Installed NPM package div@2.0.2", "description": "<Div row> Use flexbox with ease in React! </Div>", "id": "div", "name": "div", - "version": "2.0.0", + "version": "2.0.2", } `; diff --git a/packages/gatsby-recipes/src/providers/npm/package.js b/packages/gatsby-recipes/src/providers/npm/package.js index 6e8ce2bd0b5d1..3361a87715e95 100644 --- a/packages/gatsby-recipes/src/providers/npm/package.js +++ b/packages/gatsby-recipes/src/providers/npm/package.js @@ -170,9 +170,15 @@ const destroy = async ({ root }, resource) => { return undefined } - await execa(`yarn`, [`remove`, resource.name, `-W`], { - cwd: root, - }) + if (PACKAGE_MANGER === `yarn`) { + await execa(`yarn`, [`remove`, resource.name, `-W`], { + cwd: root, + }) + } else { + await execa(`npm`, [`uninstall`, resource.name], { + cwd: root, + }) + } return readResource } diff --git a/packages/gatsby-remark-images/package.json b/packages/gatsby-remark-images/package.json index 6355dc13d74fa..4d1b4498c3b37 100644 --- a/packages/gatsby-remark-images/package.json +++ b/packages/gatsby-remark-images/package.json @@ -14,7 +14,6 @@ "is-relative-url": "^3.0.0", "lodash": "^4.17.20", "mdast-util-definitions": "^1.2.5", - "potrace": "^2.1.8", "query-string": "^6.13.3", "unist-util-select": "^1.5.0", "unist-util-visit-parents": "^2.1.2" diff --git a/packages/gatsby-remark-images/src/__tests__/__snapshots__/index.js.snap b/packages/gatsby-remark-images/src/__tests__/__snapshots__/index.js.snap index b14f4f8629d85..0ceee1f336f50 100644 --- a/packages/gatsby-remark-images/src/__tests__/__snapshots__/index.js.snap +++ b/packages/gatsby-remark-images/src/__tests__/__snapshots__/index.js.snap @@ -120,6 +120,36 @@ exports[`disableBgImageOnAlpha does not disable background image on transparent " `; +exports[`it doesn't use tracedSVG placeholder (deprecated and fallback to base64) 1`] = ` +" + + + \\"image\\" + + " +`; + exports[`it handles goofy nesting properly 1`] = ` "" `; -exports[`it uses tracedSVG placeholder when enabled 1`] = ` -" - - - \\"image\\" - - " -`; - exports[`markdownCaptions display title in markdown as caption when showCaptions === true && markdownCaptions === true 1`] = ` "
{ + // silence warnings +}) + +beforeEach(() => { + warnSpy.mockClear() +}) describe(`pluginOptionsSchema`, () => { it(`should provide meaningful errors when fields are invalid`, async () => { @@ -42,24 +49,32 @@ describe(`pluginOptionsSchema`, () => { }) it(`should validate the schema`, async () => { - const { isValid } = await testPluginOptionsSchema(pluginOptionsSchema, { - maxWidth: 700, - linkImagesToOriginal: false, - showCaptions: true, - markdownCaptions: true, - sizeByPixelDensity: true, - wrapperStyle: { marginTop: `1rem`, padding: `1.5rem`, color: `blue` }, - backgroundColor: `red`, - quality: 77, - withWebp: true, - tracedSVG: true, - loading: `eager`, - disableBgImageOnAlpha: true, - disableBgImage: true, - srcSetBreakpoints: [400, 600, 800], - }) + const { isValid, errors } = await testPluginOptionsSchema( + pluginOptionsSchema, + { + maxWidth: 700, + linkImagesToOriginal: false, + showCaptions: true, + markdownCaptions: true, + sizeByPixelDensity: true, + wrapperStyle: { marginTop: `1rem`, padding: `1.5rem`, color: `blue` }, + backgroundColor: `red`, + quality: 77, + withWebp: true, + tracedSVG: true, + loading: `eager`, + disableBgImageOnAlpha: true, + disableBgImage: true, + srcSetBreakpoints: [400, 600, 800], + } + ) expect(isValid).toBe(true) + + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + expect(errors).toEqual([]) }) it(`should validate the withWebp prop`, async () => { @@ -110,49 +125,75 @@ describe(`pluginOptionsSchema`, () => { [`true`, true], [`false`, false], ])(`%s`, async (_title, booleanValue) => { - const { isValid } = await testPluginOptionsSchema(pluginOptionsSchema, { - tracedSVG: booleanValue, - }) + const { isValid, errors } = await testPluginOptionsSchema( + pluginOptionsSchema, + { + tracedSVG: booleanValue, + } + ) expect(isValid).toBe(true) + + if (booleanValue) { + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + } + expect(errors).toEqual([]) }) }) describe(`supports object notation`, () => { it(`should validate when all fields are set`, async () => { - const { isValid } = await testPluginOptionsSchema(pluginOptionsSchema, { - tracedSVG: { - turnPolicy: Potrace.TURNPOLICY_RIGHT, - turdSize: 50, - alphaMax: 0.5, - optCurve: false, - optTolerance: 0.9, - threshold: 230, - blackOnWhite: false, - color: `red`, - background: `green`, - }, - }) + const { isValid, errors } = await testPluginOptionsSchema( + pluginOptionsSchema, + { + tracedSVG: { + turnPolicy: `TURNPOLICY_RIGHT`, + turdSize: 50, + alphaMax: 0.5, + optCurve: false, + optTolerance: 0.9, + threshold: 230, + blackOnWhite: false, + color: `red`, + background: `green`, + }, + } + ) expect(isValid).toBe(true) + + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + expect(errors).toEqual([]) }) it(`should validate when some fields are set`, async () => { - const { isValid } = await testPluginOptionsSchema(pluginOptionsSchema, { - tracedSVG: { - turnPolicy: Potrace.TURNPOLICY_RIGHT, - turdSize: 50, - // alphaMax: 0.5, - // optCurve: 0.2, - // optTolerance: 0.9, - // threshold: 230, - // blackOnWhite: false, - color: `red`, - background: `green`, - }, - }) + const { isValid, errors } = await testPluginOptionsSchema( + pluginOptionsSchema, + { + tracedSVG: { + turnPolicy: `TURNPOLICY_RIGHT`, + turdSize: 50, + // alphaMax: 0.5, + // optCurve: 0.2, + // optTolerance: 0.9, + // threshold: 230, + // blackOnWhite: false, + color: `red`, + background: `green`, + }, + } + ) expect(isValid).toBe(true) + + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + expect(errors).toEqual([]) }) it(`should fail validation when unknown fields are set`, async () => { @@ -182,7 +223,7 @@ describe(`pluginOptionsSchema`, () => { `TURNPOLICY_MINORITY`, `TURNPOLICY_MAJORITY`, ])(`supports setting by policy name (%s)`, async name => { - const { isValid } = await testPluginOptionsSchema( + const { isValid, errors } = await testPluginOptionsSchema( pluginOptionsSchema, { tracedSVG: { turnPolicy: name }, @@ -190,17 +231,22 @@ describe(`pluginOptionsSchema`, () => { ) expect(isValid).toBe(true) + + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + expect(errors).toEqual([]) }) it.each([ - Potrace.TURNPOLICY_BLACK, - Potrace.TURNPOLICY_WHITE, - Potrace.TURNPOLICY_LEFT, - Potrace.TURNPOLICY_RIGHT, - Potrace.TURNPOLICY_MINORITY, - Potrace.TURNPOLICY_MAJORITY, + `black`, + `white`, + `left`, + `TURNPOLICY_RIGHT`, + `minority`, + `majority`, ])(`supports setting by policy value (%s)`, async value => { - const { isValid } = await testPluginOptionsSchema( + const { isValid, errors } = await testPluginOptionsSchema( pluginOptionsSchema, { tracedSVG: { turnPolicy: value }, @@ -208,6 +254,11 @@ describe(`pluginOptionsSchema`, () => { ) expect(isValid).toBe(true) + + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + expect(errors).toEqual([]) }) it(`Doesn't support arbitrary string values`, async () => { @@ -233,7 +284,7 @@ describe(`pluginOptionsSchema`, () => { [ `THRESHOLD_AUTO`, { - value: Potrace.THRESHOLD_AUTO, + value: -1, expectedIsValid: true, }, ], @@ -261,7 +312,7 @@ describe(`pluginOptionsSchema`, () => { value = titleAndMaybeValue } - const { isValid } = await testPluginOptionsSchema( + const { isValid, errors } = await testPluginOptionsSchema( pluginOptionsSchema, { tracedSVG: { threshold: value }, @@ -269,6 +320,11 @@ describe(`pluginOptionsSchema`, () => { ) expect(isValid).toBe(true) + + expect(warnSpy).toBeCalledWith( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + expect(errors).toEqual([]) }) // invalid settings diff --git a/packages/gatsby-remark-images/src/__tests__/index.js b/packages/gatsby-remark-images/src/__tests__/index.js index 622c6be488939..ee65a3ff5562c 100644 --- a/packages/gatsby-remark-images/src/__tests__/index.js +++ b/packages/gatsby-remark-images/src/__tests__/index.js @@ -25,7 +25,6 @@ jest.mock(`gatsby-plugin-sharp`, () => { }) const Remark = require(`remark`) -const { Potrace } = require(`potrace`) const queryString = require(`query-string`) const cheerio = require(`cheerio`) const toHAST = require(`mdast-util-to-hast`) @@ -360,7 +359,7 @@ test(`it transforms images in markdown with query strings`, async () => { expect(node.value).not.toMatch(``) }) -test(`it uses tracedSVG placeholder when enabled`, async () => { +test(`it doesn't use tracedSVG placeholder (deprecated and fallback to base64)`, async () => { const imagePath = `images/my-image.jpeg` const content = ` ![image](./${imagePath}) @@ -376,16 +375,7 @@ test(`it uses tracedSVG placeholder when enabled`, async () => { expect(node.type).toBe(`html`) expect(node.value).toMatchSnapshot() expect(node.value).not.toMatch(``) - expect(mockTraceSVG).toBeCalledTimes(1) - - expect(mockTraceSVG).toBeCalledWith( - expect.objectContaining({ - // fileArgs cannot be left undefined or traceSVG errors - fileArgs: expect.any(Object), - // args containing Potrace constants should be translated to their values - args: { color: Potrace.COLOR_AUTO, turnPolicy: Potrace.TURNPOLICY_LEFT }, - }) - ) + expect(mockTraceSVG).toBeCalledTimes(0) }) describe(`showCaptions`, () => { diff --git a/packages/gatsby-remark-images/src/gatsby-node.js b/packages/gatsby-remark-images/src/gatsby-node.js index eaa3e2c8b35ec..5f67225836eaa 100644 --- a/packages/gatsby-remark-images/src/gatsby-node.js +++ b/packages/gatsby-remark-images/src/gatsby-node.js @@ -1,5 +1,3 @@ -const { Potrace } = require(`potrace`) - exports.pluginOptionsSchema = function ({ Joi }) { return Joi.object({ maxWidth: Joi.number() @@ -68,30 +66,34 @@ exports.pluginOptionsSchema = function ({ Joi }) { `TURNPOLICY_MINORITY`, `TURNPOLICY_MAJORITY`, // it also allow using actual policy values - Potrace.TURNPOLICY_BLACK, - Potrace.TURNPOLICY_WHITE, - Potrace.TURNPOLICY_LEFT, - Potrace.TURNPOLICY_RIGHT, - Potrace.TURNPOLICY_MINORITY, - Potrace.TURNPOLICY_MAJORITY + `black`, + `white`, + `left`, + `right`, + `minority`, + `majority` ) - .default(Potrace.TURNPOLICY_MAJORITY), + .default(`majority`), turdSize: Joi.number().default(100), alphaMax: Joi.number(), optCurve: Joi.boolean().default(true), optTolerance: Joi.number().default(0.4), threshold: Joi.alternatives() - .try( - Joi.number().min(0).max(255), - Joi.number().valid(Potrace.THRESHOLD_AUTO) - ) - .default(Potrace.THRESHOLD_AUTO), + .try(Joi.number().min(0).max(255), Joi.number().valid(-1)) + .default(-1), blackOnWhite: Joi.boolean().default(true), color: Joi.string().default(`lightgray`), background: Joi.string().default(`transparent`), }) ) - .default(false) + .custom(value => { + if (!!value && !process.env.GATSBY_WORKER_ID) { + console.warn( + `"tracedSVG" plugin option for "gatsby-remark-images" is no longer supported. Blurred placeholder will be used. See https://gatsby.dev/tracesvg-removal/` + ) + } + return undefined + }) .description( `Use traced SVGs for placeholder images instead of the “blur up” effect. Pass true for traced SVGs with the default settings (seen here), or an object of options to override the default. For example, pass { color: "#F00", turnPolicy: "TURNPOLICY_MAJORITY" } to change the color of the trace to red and the turn policy to TURNPOLICY_MAJORITY. See node-potrace parameter documentation for a full listing and explanation of the available options.` ), diff --git a/packages/gatsby-remark-images/src/index.js b/packages/gatsby-remark-images/src/index.js index 9795bb795cc8b..536544ad0c943 100644 --- a/packages/gatsby-remark-images/src/index.js +++ b/packages/gatsby-remark-images/src/index.js @@ -285,32 +285,7 @@ module.exports = ( `.trim() } - let placeholderImageData = fluidResult.base64 - - // if options.tracedSVG is enabled generate the traced SVG and use that as the placeholder image - if (options.tracedSVG) { - let args = typeof options.tracedSVG === `object` ? options.tracedSVG : {} - - // Translate Potrace constants (e.g. TURNPOLICY_LEFT, COLOR_AUTO) to the values Potrace expects - const { Potrace } = require(`potrace`) - const argsKeys = Object.keys(args) - args = argsKeys.reduce((result, key) => { - const value = args[key] - result[key] = Potrace.hasOwnProperty(value) ? Potrace[value] : value - return result - }, {}) - - const tracedSVG = await traceSVG({ - file: imageNode, - args, - fileArgs: args, - cache, - reporter, - }) - - // Escape single quotes so the SVG data can be used in inline style attribute with single quotes - placeholderImageData = tracedSVG.replace(/'/g, `\\'`) - } + const placeholderImageData = fluidResult.base64 const ratio = `${(1 / fluidResult.aspectRatio) * 100}%` diff --git a/packages/gatsby-source-contentful/src/extend-node-type.js b/packages/gatsby-source-contentful/src/extend-node-type.js index 8f84d522f3918..4378788e95d51 100644 --- a/packages/gatsby-source-contentful/src/extend-node-type.js +++ b/packages/gatsby-source-contentful/src/extend-node-type.js @@ -470,7 +470,7 @@ const resolveResize = (image, options) => { exports.resolveResize = resolveResize -const fixedNodeType = ({ name, getTracedSVG }) => { +const fixedNodeType = ({ name }) => { return { type: new GraphQLObjectType({ name: name, @@ -481,7 +481,15 @@ const fixedNodeType = ({ name, getTracedSVG }) => { }, tracedSVG: { type: GraphQLString, - resolve: getTracedSVG, + resolve: imageProps => { + if (!didShowTraceSVGRemovalWarningFixed) { + console.warn( + `"tracedSVG" placeholder field is no longer supported (used in ContentfulAsset.fixed processing), falling back to "base64". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningFixed = true + } + return getBase64Image(imageProps) + }, }, aspectRatio: { type: GraphQLFloat }, width: { type: new GraphQLNonNull(GraphQLFloat) }, @@ -565,7 +573,7 @@ const fixedNodeType = ({ name, getTracedSVG }) => { } } -const fluidNodeType = ({ name, getTracedSVG }) => { +const fluidNodeType = ({ name }) => { return { type: new GraphQLObjectType({ name: name, @@ -576,7 +584,15 @@ const fluidNodeType = ({ name, getTracedSVG }) => { }, tracedSVG: { type: GraphQLString, - resolve: getTracedSVG, + resolve: imageProps => { + if (!didShowTraceSVGRemovalWarningFluid) { + console.warn( + `"tracedSVG" placeholder field is no longer supported (used in ContentfulAsset.fluid processing), falling back to "base64". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningFluid = true + } + return getBase64Image(imageProps) + }, }, aspectRatio: { type: new GraphQLNonNull(GraphQLFloat) }, src: { type: new GraphQLNonNull(GraphQLString) }, @@ -664,38 +680,16 @@ const fluidNodeType = ({ name, getTracedSVG }) => { let warnedForBeta = false +let didShowTraceSVGRemovalWarningImageData = false +let didShowTraceSVGRemovalWarningResize = false +let didShowTraceSVGRemovalWarningFixed = false +let didShowTraceSVGRemovalWarningFluid = false + exports.extendNodeType = ({ type, store, reporter }) => { if (type.name !== `ContentfulAsset`) { return {} } - const getTracedSVG = async args => { - const { traceSVG } = require(`gatsby-plugin-sharp`) - - const { image, options } = args - const { - file: { contentType }, - } = image - - if (contentType.indexOf(`image/`) !== 0) { - return null - } - - const absolutePath = await cacheImage(store, image, options) - const extension = path.extname(absolutePath) - - return traceSVG({ - file: { - internal: image.internal, - name: image.file.fileName, - extension, - absolutePath, - }, - args: { toFormat: `` }, - fileArgs: options, - }) - } - const getDominantColor = async ({ image, options }) => { try { const absolutePath = await cacheImage(store, image, options) @@ -718,6 +712,16 @@ exports.extendNodeType = ({ type, store, reporter }) => { } const resolveGatsbyImageData = async (image, options) => { + if (options?.placeholder === `tracedSVG`) { + if (!didShowTraceSVGRemovalWarningImageData) { + console.warn( + `"TRACED_SVG" placeholder argument value is no longer supported (used in ContentfulAsset.gatsbyImageData processing), falling back to "DOMINANT_COLOR". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningImageData = true + } + options.placeholder = `dominantColor` + } + const { baseUrl, ...sourceMetadata } = getBasicImageProps(image, options) const imageProps = generateImageData({ @@ -745,13 +749,6 @@ exports.extendNodeType = ({ type, store, reporter }) => { }) } - if (options.placeholder === `tracedSVG`) { - placeholderDataURI = await getTracedSVG({ - image, - options, - }) - } - if (placeholderDataURI) { imageProps.placeholder = { fallback: placeholderDataURI } } @@ -760,15 +757,16 @@ exports.extendNodeType = ({ type, store, reporter }) => { } // TODO: Remove resolutionsNode and sizesNode for Gatsby v3 - const fixedNode = fixedNodeType({ name: `ContentfulFixed`, getTracedSVG }) + const fixedNode = fixedNodeType({ + name: `ContentfulFixed`, + }) const resolutionsNode = fixedNodeType({ name: `ContentfulResolutions`, - getTracedSVG, }) resolutionsNode.deprecationReason = `Resolutions was deprecated in Gatsby v2. It's been renamed to "fixed" https://example.com/write-docs-and-fix-this-example-link` - const fluidNode = fluidNodeType({ name: `ContentfulFluid`, getTracedSVG }) - const sizesNode = fluidNodeType({ name: `ContentfulSizes`, getTracedSVG }) + const fluidNode = fluidNodeType({ name: `ContentfulFluid` }) + const sizesNode = fluidNodeType({ name: `ContentfulSizes` }) sizesNode.deprecationReason = `Sizes was deprecated in Gatsby v2. It's been renamed to "fluid" https://example.com/write-docs-and-fix-this-example-link` // gatsby-plugin-image @@ -828,7 +826,15 @@ exports.extendNodeType = ({ type, store, reporter }) => { }, tracedSVG: { type: GraphQLString, - resolve: getTracedSVG, + resolve: imageProps => { + if (!didShowTraceSVGRemovalWarningResize) { + console.warn( + `"tracedSVG" placeholder field is no longer supported (used in ContentfulAsset.resize processing), falling back to "base64". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningResize = true + } + return getBase64Image(imageProps) + }, }, src: { type: GraphQLString }, width: { type: GraphQLInt }, diff --git a/packages/gatsby-transformer-sharp/package.json b/packages/gatsby-transformer-sharp/package.json index 0b49a988cf951..841cff864994d 100644 --- a/packages/gatsby-transformer-sharp/package.json +++ b/packages/gatsby-transformer-sharp/package.json @@ -10,7 +10,6 @@ "@babel/runtime": "^7.12.5", "bluebird": "^3.7.2", "fs-extra": "^9.1.0", - "potrace": "^2.1.8", "probe-image-size": "^6.0.0", "semver": "^7.3.4", "sharp": "^0.27.0" diff --git a/packages/gatsby-transformer-sharp/src/customize-schema.js b/packages/gatsby-transformer-sharp/src/customize-schema.js index 00cb78af3a3e8..2e85f29df11f7 100644 --- a/packages/gatsby-transformer-sharp/src/customize-schema.js +++ b/packages/gatsby-transformer-sharp/src/customize-schema.js @@ -14,7 +14,6 @@ const { base64, fluid, fixed, - traceSVG, generateImageData, } = require(`gatsby-plugin-sharp`) @@ -54,15 +53,7 @@ function toArray(buf) { return arr } -const getTracedSVG = async ({ file, image, fieldArgs, cache, reporter }) => - traceSVG({ - file, - args: { ...fieldArgs.traceSVG }, - fileArgs: fieldArgs, - cache, - reporter, - }) - +let didShowTraceSVGRemovalWarningFixed = false const fixedNodeType = ({ pathPrefix, getNodeAndSavePathDependency, @@ -77,12 +68,15 @@ const fixedNodeType = ({ base64: { type: GraphQLString }, tracedSVG: { type: GraphQLString, - resolve: parent => - getTracedSVG({ - ...parent, - cache, - reporter, - }), + resolve: parent => { + if (!didShowTraceSVGRemovalWarningFixed) { + console.warn( + `"tracedSVG" placeholder field is no longer supported (used in ImageSharp.fixed processing), falling back to "base64". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningFixed = true + } + return parent.base64 + }, }, aspectRatio: { type: GraphQLFloat }, width: { type: new GraphQLNonNull(GraphQLFloat) }, @@ -220,6 +214,7 @@ const fixedNodeType = ({ } } +let didShowTraceSVGRemovalWarningFluid = false const fluidNodeType = ({ pathPrefix, getNodeAndSavePathDependency, @@ -234,12 +229,15 @@ const fluidNodeType = ({ base64: { type: GraphQLString }, tracedSVG: { type: GraphQLString, - resolve: parent => - getTracedSVG({ - ...parent, - cache, - reporter, - }), + resolve: parent => { + if (!didShowTraceSVGRemovalWarningFluid) { + console.warn( + `"tracedSVG" placeholder field is no longer supported (used in ImageSharp.fluid processing), falling back to "base64". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningFluid = true + } + return parent.base64 + }, }, aspectRatio: { type: new GraphQLNonNull(GraphQLFloat) }, src: { type: new GraphQLNonNull(GraphQLString) }, @@ -386,8 +384,8 @@ const fluidNodeType = ({ } } +let didShowTraceSVGRemovalWarningGatsbyImageData = false let warnedForBeta = false - const imageNodeType = ({ pathPrefix, getNodeAndSavePathDependency, @@ -521,6 +519,17 @@ const imageNodeType = ({ ) warnedForBeta = true } + + if (fieldArgs?.placeholder === `tracedSVG`) { + if (!didShowTraceSVGRemovalWarningGatsbyImageData) { + console.warn( + `"TRACED_SVG" placeholder argument value is no longer supported (used in ImageSharp.gatsbyImageData processing), falling back to "DOMINANT_COLOR". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningGatsbyImageData = true + } + fieldArgs.placeholder = `dominantColor` + } + const imageData = await generateImageData({ file, args: fieldArgs, @@ -540,6 +549,8 @@ const imageNodeType = ({ */ const inProgressCopy = new Set() +let didShowTraceSVGRemovalWarningResize = false + const createFields = ({ pathPrefix, getNodeAndSavePathDependency, @@ -631,12 +642,19 @@ const createFields = ({ src: { type: GraphQLString }, tracedSVG: { type: GraphQLString, - resolve: parent => - getTracedSVG({ - ...parent, + resolve: async parent => { + if (!didShowTraceSVGRemovalWarningResize) { + console.warn( + `"tracedSVG" placeholder field is no longer supported (used in ImageSharp.resize processing), falling back to "base64". See https://gatsby.dev/tracesvg-removal/` + ) + didShowTraceSVGRemovalWarningResize = true + } + const { src } = await base64({ + file: parent.file, cache, - reporter, - }), + }) + return src + }, }, width: { type: GraphQLInt }, height: { type: GraphQLInt }, diff --git a/packages/gatsby-transformer-sharp/src/types.ts b/packages/gatsby-transformer-sharp/src/types.ts index 22174df504a40..a3f1310ea9473 100644 --- a/packages/gatsby-transformer-sharp/src/types.ts +++ b/packages/gatsby-transformer-sharp/src/types.ts @@ -8,7 +8,6 @@ import { GraphQLNonNull, GraphQLInputFieldConfigMap, } from "gatsby/graphql" -import { Potrace } from "potrace" import type Sharp from "sharp" const sharp: typeof Sharp = require(`./safe-sharp`) @@ -161,12 +160,12 @@ export const DuotoneGradientType = new GraphQLInputObjectType({ export const PotraceTurnPolicyType = new GraphQLEnumType({ name: `PotraceTurnPolicy`, values: { - TURNPOLICY_BLACK: { value: Potrace.TURNPOLICY_BLACK }, - TURNPOLICY_WHITE: { value: Potrace.TURNPOLICY_WHITE }, - TURNPOLICY_LEFT: { value: Potrace.TURNPOLICY_LEFT }, - TURNPOLICY_RIGHT: { value: Potrace.TURNPOLICY_RIGHT }, - TURNPOLICY_MINORITY: { value: Potrace.TURNPOLICY_MINORITY }, - TURNPOLICY_MAJORITY: { value: Potrace.TURNPOLICY_MAJORITY }, + TURNPOLICY_BLACK: { value: `black` }, + TURNPOLICY_WHITE: { value: `white` }, + TURNPOLICY_LEFT: { value: `left` }, + TURNPOLICY_RIGHT: { value: `right` }, + TURNPOLICY_MINORITY: { value: `minority` }, + TURNPOLICY_MAJORITY: { value: `majority` }, }, }) diff --git a/packages/gatsby/cache-dir/__tests__/minimal-config.js b/packages/gatsby/cache-dir/__tests__/minimal-config.js index bb147b5b49f82..41c5c7fdf4f9c 100644 --- a/packages/gatsby/cache-dir/__tests__/minimal-config.js +++ b/packages/gatsby/cache-dir/__tests__/minimal-config.js @@ -25,6 +25,19 @@ it(`Builds cache-dir with minimal config`, done => { }) spawn.on(`close`, function () { + // warning we want to filter out: + // Browserslist: caniuse-lite is outdated. Please run: + // npx browserslist@latest --update-db + // Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating + stderr = stderr + .replace(`Browserslist: caniuse-lite is outdated. Please run:`, ``) + .replace(`npx browserslist@latest --update-db`, ``) + .replace( + `Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating`, + `` + ) + .trim() + expect(stderr).toEqual(``) expect(stdout).not.toEqual(``) done() diff --git a/yarn.lock b/yarn.lock index 8d96119c53889..34def8231cf75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2252,296 +2252,6 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jimp/bmp@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/bmp/-/bmp-0.14.0.tgz#6df246026554f276f7b354047c6fff9f5b2b5182" - integrity sha512-5RkX6tSS7K3K3xNEb2ygPuvyL9whjanhoaB/WmmXlJS6ub4DjTqrapu8j4qnIWmO4YYtFeTbDTXV6v9P1yMA5A== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - bmp-js "^0.1.0" - -"@jimp/core@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/core/-/core-0.14.0.tgz#870c9ca25b40be353ebda1d2abb48723d9010055" - integrity sha512-S62FcKdtLtj3yWsGfJRdFXSutjvHg7aQNiFogMbwq19RP4XJWqS2nOphu7ScB8KrSlyy5nPF2hkWNhLRLyD82w== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - any-base "^1.1.0" - buffer "^5.2.0" - exif-parser "^0.1.12" - file-type "^9.0.0" - load-bmfont "^1.3.1" - mkdirp "^0.5.1" - phin "^2.9.1" - pixelmatch "^4.0.2" - tinycolor2 "^1.4.1" - -"@jimp/custom@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/custom/-/custom-0.14.0.tgz#1dbbf0094df7403f4e03bc984ed92e7458842f74" - integrity sha512-kQJMeH87+kWJdVw8F9GQhtsageqqxrvzg7yyOw3Tx/s7v5RToe8RnKyMM+kVtBJtNAG+Xyv/z01uYQ2jiZ3GwA== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/core" "^0.14.0" - -"@jimp/gif@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/gif/-/gif-0.14.0.tgz#db159f57c3cfd1566bbe8b124958791998614960" - integrity sha512-DHjoOSfCaCz72+oGGEh8qH0zE6pUBaBxPxxmpYJjkNyDZP7RkbBkZJScIYeQ7BmJxmGN4/dZn+MxamoQlr+UYg== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - gifwrap "^0.9.2" - omggif "^1.0.9" - -"@jimp/jpeg@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/jpeg/-/jpeg-0.14.0.tgz#8a687a6a653bbbae38c522edef8f84bb418d9461" - integrity sha512-561neGbr+87S/YVQYnZSTyjWTHBm9F6F1obYHiyU3wVmF+1CLbxY3FQzt4YolwyQHIBv36Bo0PY2KkkU8BEeeQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - jpeg-js "^0.4.0" - -"@jimp/plugin-blit@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-blit/-/plugin-blit-0.14.0.tgz#5eb374be1201313b2113899fb842232d8fcfd345" - integrity sha512-YoYOrnVHeX3InfgbJawAU601iTZMwEBZkyqcP1V/S33Qnz9uzH1Uj1NtC6fNgWzvX6I4XbCWwtr4RrGFb5CFrw== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-blur@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-blur/-/plugin-blur-0.14.0.tgz#fe07e4932d5a2f5d8c9831e245561553224bfc60" - integrity sha512-9WhZcofLrT0hgI7t0chf7iBQZib//0gJh9WcQMUt5+Q1Bk04dWs8vTgLNj61GBqZXgHSPzE4OpCrrLDBG8zlhQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-circle@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-circle/-/plugin-circle-0.14.0.tgz#82c0e904a34e90fa672fb9c286bc892e92088ddf" - integrity sha512-o5L+wf6QA44tvTum5HeLyLSc5eVfIUd5ZDVi5iRfO4o6GT/zux9AxuTSkKwnjhsG8bn1dDmywAOQGAx7BjrQVA== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-color@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-color/-/plugin-color-0.14.0.tgz#772bd2d80a88bc66ea1331d010207870f169a74b" - integrity sha512-JJz512SAILYV0M5LzBb9sbOm/XEj2fGElMiHAxb7aLI6jx+n0agxtHpfpV/AePTLm1vzzDxx6AJxXbKv355hBQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - tinycolor2 "^1.4.1" - -"@jimp/plugin-contain@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-contain/-/plugin-contain-0.14.0.tgz#c68115420d182e696f81bbe76fb5e704909b2b6a" - integrity sha512-RX2q233lGyaxiMY6kAgnm9ScmEkNSof0hdlaJAVDS1OgXphGAYAeSIAwzESZN4x3ORaWvkFefeVH9O9/698Evg== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-cover@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-cover/-/plugin-cover-0.14.0.tgz#4755322589c5885e44e14e31b86b542e907297ce" - integrity sha512-0P/5XhzWES4uMdvbi3beUgfvhn4YuQ/ny8ijs5kkYIw6K8mHcl820HahuGpwWMx56DJLHRl1hFhJwo9CeTRJtQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-crop@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-crop/-/plugin-crop-0.14.0.tgz#4cbd856ca84ffc37230fad2534906f2f75aa3057" - integrity sha512-Ojtih+XIe6/XSGtpWtbAXBozhCdsDMmy+THUJAGu2x7ZgKrMS0JotN+vN2YC3nwDpYkM+yOJImQeptSfZb2Sug== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-displace@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-displace/-/plugin-displace-0.14.0.tgz#b0e6a57d00cb1f893f541413fe9d737d23c3b70c" - integrity sha512-c75uQUzMgrHa8vegkgUvgRL/PRvD7paFbFJvzW0Ugs8Wl+CDMGIPYQ3j7IVaQkIS+cAxv+NJ3TIRBQyBrfVEOg== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-dither@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-dither/-/plugin-dither-0.14.0.tgz#9185ec4c38e02edc9e5831f5d709f6ba891e1b93" - integrity sha512-g8SJqFLyYexXQQsoh4dc1VP87TwyOgeTElBcxSXX2LaaMZezypmxQfLTzOFzZoK8m39NuaoH21Ou1Ftsq7LzVQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-fisheye@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-fisheye/-/plugin-fisheye-0.14.0.tgz#9f26346cf2fbc660cc2008cd7fd30a83b5029e78" - integrity sha512-BFfUZ64EikCaABhCA6mR3bsltWhPpS321jpeIQfJyrILdpFsZ/OccNwCgpW1XlbldDHIoNtXTDGn3E+vCE7vDg== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-flip@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-flip/-/plugin-flip-0.14.0.tgz#7966d6aa3b5fe1aa4d2d561ff12b8ef5ccb9b071" - integrity sha512-WtL1hj6ryqHhApih+9qZQYA6Ye8a4HAmdTzLbYdTMrrrSUgIzFdiZsD0WeDHpgS/+QMsWwF+NFmTZmxNWqKfXw== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-gaussian@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-gaussian/-/plugin-gaussian-0.14.0.tgz#452bc1971a4467ad9b984aa67f4c200bf941bb65" - integrity sha512-uaLwQ0XAQoydDlF9tlfc7iD9drYPriFe+jgYnWm8fbw5cN+eOIcnneEX9XCOOzwgLPkNCxGox6Kxjn8zY6GxtQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-invert@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-invert/-/plugin-invert-0.14.0.tgz#cd31a555860e9f821394936d15af161c09c42921" - integrity sha512-UaQW9X9vx8orQXYSjT5VcITkJPwDaHwrBbxxPoDG+F/Zgv4oV9fP+udDD6qmkgI9taU+44Fy+zm/J/gGcMWrdg== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-mask@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-mask/-/plugin-mask-0.14.0.tgz#52619643ac6222f85e6b27dee33c771ca3a6a4c9" - integrity sha512-tdiGM69OBaKtSPfYSQeflzFhEpoRZ+BvKfDEoivyTjauynbjpRiwB1CaiS8En1INTDwzLXTT0Be9SpI3LkJoEA== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-normalize@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-normalize/-/plugin-normalize-0.14.0.tgz#bf39e356b6d473f582ce95633ad49c9cdb82492b" - integrity sha512-AfY8sqlsbbdVwFGcyIPy5JH/7fnBzlmuweb+Qtx2vn29okq6+HelLjw2b+VT2btgGUmWWHGEHd86oRGSoWGyEQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-print@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-print/-/plugin-print-0.14.0.tgz#1c43c2a92a7adc05b464863882cb89ce486d63e6" - integrity sha512-MwP3sH+VS5AhhSTXk7pui+tEJFsxnTKFY3TraFJb8WFbA2Vo2qsRCZseEGwpTLhENB7p/JSsLvWoSSbpmxhFAQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - load-bmfont "^1.4.0" - -"@jimp/plugin-resize@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-resize/-/plugin-resize-0.14.0.tgz#ef7fc6c2e45f8bcab62456baf8fd3bc415b02b64" - integrity sha512-qFeMOyXE/Bk6QXN0GQo89+CB2dQcXqoxUcDb2Ah8wdYlKqpi53skABkgVy5pW3EpiprDnzNDboMltdvDslNgLQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-rotate@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-rotate/-/plugin-rotate-0.14.0.tgz#3632bc159bf1c3b9ec9f459d9c05d02a11781ee7" - integrity sha512-aGaicts44bvpTcq5Dtf93/8TZFu5pMo/61lWWnYmwJJU1RqtQlxbCLEQpMyRhKDNSfPbuP8nyGmaqXlM/82J0Q== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-scale@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-scale/-/plugin-scale-0.14.0.tgz#d30f0cd1365b8e68f43fa423300ae7f124e9bf10" - integrity sha512-ZcJk0hxY5ZKZDDwflqQNHEGRblgaR+piePZm7dPwPUOSeYEH31P0AwZ1ziceR74zd8N80M0TMft+e3Td6KGBHw== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-shadow@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-shadow/-/plugin-shadow-0.14.0.tgz#471fdb9f109ff2d9e20d533d45e1e18e0b48c749" - integrity sha512-p2igcEr/iGrLiTu0YePNHyby0WYAXM14c5cECZIVnq/UTOOIQ7xIcWZJ1lRbAEPxVVXPN1UibhZAbr3HAb5BjQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugin-threshold@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugin-threshold/-/plugin-threshold-0.14.0.tgz#ebd72721c7d1d518c5bb6e494e55d97ac3351d3b" - integrity sha512-N4BlDgm/FoOMV/DQM2rSpzsgqAzkP0DXkWZoqaQrlRxQBo4zizQLzhEL00T/YCCMKnddzgEhnByaocgaaa0fKw== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - -"@jimp/plugins@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/plugins/-/plugins-0.14.0.tgz#41dba85f15ab8dadb4162100eb54e5f27b93ee2c" - integrity sha512-vDO3XT/YQlFlFLq5TqNjQkISqjBHT8VMhpWhAfJVwuXIpilxz5Glu4IDLK6jp4IjPR6Yg2WO8TmRY/HI8vLrOw== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/plugin-blit" "^0.14.0" - "@jimp/plugin-blur" "^0.14.0" - "@jimp/plugin-circle" "^0.14.0" - "@jimp/plugin-color" "^0.14.0" - "@jimp/plugin-contain" "^0.14.0" - "@jimp/plugin-cover" "^0.14.0" - "@jimp/plugin-crop" "^0.14.0" - "@jimp/plugin-displace" "^0.14.0" - "@jimp/plugin-dither" "^0.14.0" - "@jimp/plugin-fisheye" "^0.14.0" - "@jimp/plugin-flip" "^0.14.0" - "@jimp/plugin-gaussian" "^0.14.0" - "@jimp/plugin-invert" "^0.14.0" - "@jimp/plugin-mask" "^0.14.0" - "@jimp/plugin-normalize" "^0.14.0" - "@jimp/plugin-print" "^0.14.0" - "@jimp/plugin-resize" "^0.14.0" - "@jimp/plugin-rotate" "^0.14.0" - "@jimp/plugin-scale" "^0.14.0" - "@jimp/plugin-shadow" "^0.14.0" - "@jimp/plugin-threshold" "^0.14.0" - timm "^1.6.1" - -"@jimp/png@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/png/-/png-0.14.0.tgz#0f2dddb5125c0795ca7e67c771204c5437fcda4b" - integrity sha512-0RV/mEIDOrPCcNfXSPmPBqqSZYwGADNRVUTyMt47RuZh7sugbYdv/uvKmQSiqRdR0L1sfbCBMWUEa5G/8MSbdA== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/utils" "^0.14.0" - pngjs "^3.3.3" - -"@jimp/tiff@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/tiff/-/tiff-0.14.0.tgz#a5b25bbe7c43fc3b07bad4e2ab90e0e164c1967f" - integrity sha512-zBYDTlutc7j88G/7FBCn3kmQwWr0rmm1e0FKB4C3uJ5oYfT8645lftUsvosKVUEfkdmOaMAnhrf4ekaHcb5gQw== - dependencies: - "@babel/runtime" "^7.7.2" - utif "^2.0.1" - -"@jimp/types@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/types/-/types-0.14.0.tgz#ef681ff702883c5f105b5e4e30d49abf39ee9e34" - integrity sha512-hx3cXAW1KZm+b+XCrY3LXtdWy2U+hNtq0rPyJ7NuXCjU7lZR3vIkpz1DLJ3yDdS70hTi5QDXY3Cd9kd6DtloHQ== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/bmp" "^0.14.0" - "@jimp/gif" "^0.14.0" - "@jimp/jpeg" "^0.14.0" - "@jimp/png" "^0.14.0" - "@jimp/tiff" "^0.14.0" - timm "^1.6.1" - -"@jimp/utils@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@jimp/utils/-/utils-0.14.0.tgz#296254e63118554c62c31c19ac6b8c4bfe6490e5" - integrity sha512-MY5KFYUru0y74IsgM/9asDwb3ERxWxXEu3CRCZEvE7DtT86y1bR1XgtlSliMrptjz4qbivNGMQSvUBpEFJDp1A== - dependencies: - "@babel/runtime" "^7.7.2" - regenerator-runtime "^0.13.3" - "@lerna/add@3.21.0": version "3.21.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.21.0.tgz#27007bde71cc7b0a2969ab3c2f0ae41578b4577b" @@ -5492,11 +5202,6 @@ ansi-wrap@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" -any-base@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/any-base/-/any-base-1.1.0.tgz#ae101a62bc08a597b4c9ab5b7089d456630549fe" - integrity sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg== - any-promise@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -6635,11 +6340,6 @@ bluebird@^3.0.5, bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5, bluebird@^3. resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bmp-js@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/bmp-js/-/bmp-js-0.1.0.tgz#e05a63f796a6c1ff25f4771ec7adadc148c07233" - integrity sha1-4Fpj95amwf8l9Hcex62twUjAcjM= - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -6944,7 +6644,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.2.0, buffer@^5.2.1, buffer@^5.5.0: +buffer@^5.2.1, buffer@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== @@ -10951,11 +10651,6 @@ executable@^4.1.0: dependencies: pify "^2.2.0" -exif-parser@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/exif-parser/-/exif-parser-0.1.12.tgz#58a9d2d72c02c1f6f02a0ef4a9166272b7760922" - integrity sha1-WKnS1ywCwfbwKg70qRZicrd2CSI= - exit-on-epipe@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" @@ -11414,11 +11109,6 @@ file-type@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-8.1.0.tgz#244f3b7ef641bbe0cca196c7276e4b332399f68c" -file-type@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-9.0.0.tgz#a68d5ad07f486414dfb2c8866f73161946714a18" - integrity sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw== - filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" @@ -11705,12 +11395,6 @@ fontkit@^1.8.0: unicode-properties "^1.0.0" unicode-trie "^0.3.0" -for-each@^0.3.2: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - dependencies: - is-callable "^1.1.3" - for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -12164,14 +11848,6 @@ gettemporaryfilepath@^1.0.0, gettemporaryfilepath@^1.0.1: resolved "https://registry.yarnpkg.com/gettemporaryfilepath/-/gettemporaryfilepath-1.0.1.tgz#53ace15f931fb3def8abed740c0a092762910391" integrity sha512-MVCSgF1blIZuIV3KYhMKOwU1OSxPF1s+ZcyqWMSGR5Fzl6fN7EjIXDFGu9PmWAAwyGjMjmkS2ruqPaj13J3SXA== -gifwrap@^0.9.2: - version "0.9.2" - resolved "https://registry.yarnpkg.com/gifwrap/-/gifwrap-0.9.2.tgz#348e286e67d7cf57942172e1e6f05a71cee78489" - integrity sha512-fcIswrPaiCDAyO8xnWvHSZdWChjKXUanKKpAiWWJ/UTkEi/aYKn5+90e7DE820zbEaVR9CE2y4z9bzhQijZ0BA== - dependencies: - image-q "^1.1.1" - omggif "^1.0.10" - git-config-path@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/git-config-path/-/git-config-path-1.0.1.tgz#6d33f7ed63db0d0e118131503bab3aca47d54664" @@ -12421,13 +12097,6 @@ global@^4.3.0, global@^4.3.2: min-document "^2.19.0" process "^0.11.10" -global@~4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" - dependencies: - min-document "^2.19.0" - process "~0.5.1" - globals-docs@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.4.0.tgz#f2c647544eb6161c7c38452808e16e693c2dafbb" @@ -13792,11 +13461,6 @@ ignore@^5.0.0, ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== -image-q@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/image-q/-/image-q-1.1.1.tgz#fc84099664460b90ca862d9300b6bfbbbfbf8056" - integrity sha1-/IQJlmRGC5DKhi2TALa/u7+/gFY= - image-size@^0.6.1: version "0.6.3" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.6.3.tgz#e7e5c65bb534bd7cdcedd6cb5166272a85f75fb2" @@ -14234,7 +13898,7 @@ is-buffer@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.0, is-callable@^1.2.2: +is-callable@^1.1.4, is-callable@^1.2.0, is-callable@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== @@ -14369,10 +14033,6 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-function@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - is-generator-fn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" @@ -15457,17 +15117,6 @@ jest@^24.9.0: import-local "^2.0.0" jest-cli "^24.9.0" -jimp@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/jimp/-/jimp-0.14.0.tgz#fde55f69bdb918c1b01ac633d89a25853af85625" - integrity sha512-8BXU+J8+SPmwwyq9ELihpSV4dWPTiOKBWCEgtkbnxxAVMjXdf3yGmyaLSshBfXc8sP/JQ9OZj5R8nZzz2wPXgA== - dependencies: - "@babel/runtime" "^7.7.2" - "@jimp/custom" "^0.14.0" - "@jimp/plugins" "^0.14.0" - "@jimp/types" "^0.14.0" - regenerator-runtime "^0.13.3" - joi@^14.3.1: version "14.3.1" resolved "https://registry.yarnpkg.com/joi/-/joi-14.3.1.tgz#164a262ec0b855466e0c35eea2a885ae8b6c703c" @@ -15488,11 +15137,6 @@ joi@^17.2.1: "@hapi/pinpoint" "^2.0.0" "@hapi/topo" "^5.0.0" -jpeg-js@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.1.tgz#937a3ae911eb6427f151760f8123f04c8bfe6ef7" - integrity sha512-jA55yJiB5tCXEddos8JBbvW+IMrqY0y1tjjx9KNVtA+QPmu7ND5j0zkKopClpUTsaETL135uOM2XfcYG4XRjmw== - js-base64@^2.1.9: version "2.5.1" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" @@ -16260,20 +15904,6 @@ livereload-js@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.3.0.tgz#c3ab22e8aaf5bf3505d80d098cbad67726548c9a" -load-bmfont@^1.3.1, load-bmfont@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/load-bmfont/-/load-bmfont-1.4.0.tgz#75f17070b14a8c785fe7f5bee2e6fd4f98093b6b" - integrity sha512-kT63aTAlNhZARowaNYcY29Fn/QYkc52M3l6V1ifRcPewg2lvUZDAj7R6dXjOL9D0sict76op3T5+odumDSF81g== - dependencies: - buffer-equal "0.0.1" - mime "^1.3.4" - parse-bmfont-ascii "^1.0.3" - parse-bmfont-binary "^1.0.5" - parse-bmfont-xml "^1.1.4" - phin "^2.9.1" - xhr "^2.0.1" - xtend "^4.0.0" - load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -17504,7 +17134,7 @@ mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: dependencies: mime-db "1.40.0" -mime@1.6.0, mime@^1.3.4, mime@^1.4.1: +mime@1.6.0, mime@^1.4.1: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -18667,11 +18297,6 @@ octokit-pagination-methods@^1.1.0: resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== -omggif@^1.0.10, omggif@^1.0.9: - version "1.0.10" - resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19" - integrity sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw== - on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -19119,7 +18744,7 @@ pako@^0.2.5: version "0.2.9" resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" -pako@^1.0.5, pako@^1.0.7, pako@~1.0.5: +pako@^1.0.7, pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== @@ -19154,21 +18779,6 @@ parse-asn1@^5.0.0: evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" -parse-bmfont-ascii@^1.0.3: - version "1.0.6" - resolved "https://registry.yarnpkg.com/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz#11ac3c3ff58f7c2020ab22769079108d4dfa0285" - -parse-bmfont-binary@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz#d038b476d3e9dd9db1e11a0b0e53a22792b69006" - -parse-bmfont-xml@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz#015319797e3e12f9e739c4d513872cd2fa35f389" - dependencies: - xml-parse-from-string "^1.0.0" - xml2js "^0.4.5" - parse-diff@^0.7.0: version "0.7.1" resolved "https://registry.yarnpkg.com/parse-diff/-/parse-diff-0.7.1.tgz#9b7a2451c3725baf2c87c831ba192d40ee2237d4" @@ -19241,13 +18851,6 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-headers@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536" - dependencies: - for-each "^0.3.2" - trim "0.0.1" - parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -19540,10 +19143,6 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -phin@^2.9.1: - version "2.9.2" - resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.2.tgz#0a82d5b6dd75552b665f371f8060689c1af7336e" - physical-cpu-count@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/physical-cpu-count/-/physical-cpu-count-2.0.0.tgz#18de2f97e4bf7a9551ad7511942b5496f7aba660" @@ -19596,13 +19195,6 @@ pirates@^4.0.0, pirates@^4.0.1: dependencies: node-modules-regexp "^1.0.0" -pixelmatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/pixelmatch/-/pixelmatch-4.0.2.tgz#8f47dcec5011b477b67db03c243bc1f3085e8854" - integrity sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ= - dependencies: - pngjs "^3.0.0" - pkg-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" @@ -19667,11 +19259,6 @@ pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" -pngjs@^3.0.0, pngjs@^3.3.3: - version "3.4.0" - resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" - integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== - pngquant-bin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/pngquant-bin/-/pngquant-bin-6.0.0.tgz#aff0d7e61095feb96ced379ad8c7294ad3dd1712" @@ -20131,13 +19718,6 @@ postcss@^8.1.6, postcss@^8.2.2, postcss@^8.2.4: nanoid "^3.1.20" source-map "^0.6.1" -potrace@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/potrace/-/potrace-2.1.8.tgz#50f6fba92e1e39ddef6f979b0a0f841809e0acf2" - integrity sha512-V9hI7UMJyEhNZjM8CbZaP/804ZRLgzWkCS9OOYnEZkszzj3zKR/erRdj0uFMcN3pp6x4B+AIZebmkQgGRinG/g== - dependencies: - jimp "^0.14.0" - prebuild-install@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.0.0.tgz#669022bcde57c710a869e39c5ca6bf9cd207f316" @@ -20321,10 +19901,6 @@ process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" -process@~0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - progress@^2.0.0, progress@^2.0.1, progress@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -21296,7 +20872,7 @@ regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" -regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: +regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== @@ -23085,7 +22661,7 @@ sass-loader@^10.1.0: schema-utils "^3.0.0" semver "^7.3.2" -sax@>=0.6.0, sax@^1.2.4, sax@~1.2.1, sax@~1.2.4: +sax@^1.2.4, sax@~1.2.1, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -25021,11 +24597,6 @@ timers-ext@^0.1.7: es5-ext "~0.10.46" next-tick "1" -timm@^1.6.1: - version "1.6.2" - resolved "https://registry.yarnpkg.com/timm/-/timm-1.6.2.tgz#dfd8c6719f7ba1fcfc6295a32670a1c6d166c0bd" - integrity sha512-IH3DYDL1wMUwmIlVmMrmesw5lZD6N+ZOAFWEyLrtpoL9Bcrs9u7M/vyOnHzDD2SMs4irLkVjqxZbHrXStS/Nmw== - timsort@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" @@ -25080,11 +24651,6 @@ tiny-warning@^1.0.0, tiny-warning@^1.0.2: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== -tinycolor2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" - integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= - title-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" @@ -26210,13 +25776,6 @@ utf-8-validate@^5.0.2: dependencies: node-gyp-build "~3.7.0" -utif@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/utif/-/utif-2.0.1.tgz#9e1582d9bbd20011a6588548ed3266298e711759" - integrity sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg== - dependencies: - pako "^1.0.5" - util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -27235,15 +26794,6 @@ xhr-mock@^2.5.1: global "^4.3.0" url "^0.11.0" -xhr@^2.0.1: - version "2.5.0" - resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" - dependencies: - global "~4.3.0" - is-function "^1.0.1" - parse-headers "^2.0.0" - xtend "^4.0.0" - xlsx@^0.16.9: version "0.16.9" resolved "https://registry.yarnpkg.com/xlsx/-/xlsx-0.16.9.tgz#dacd5bb46bda6dd3743940c9c3dc1e2171826256" @@ -27264,31 +26814,16 @@ xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" -xml-parse-from-string@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz#a9029e929d3dbcded169f3c6e28238d95a5d5a28" - xml-parser@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/xml-parser/-/xml-parser-1.2.1.tgz#c31f4c34f2975db82ad013222120592736156fcd" dependencies: debug "^2.2.0" -xml2js@^0.4.5: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - xml@1.0.1, xml@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - xmlchars@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.1.1.tgz#ef1a81c05bff629c2280007f12daca21bd6f6c93" From b46e3d76da454b3ecb398df1baa7fdfee6b1ab60 Mon Sep 17 00:00:00 2001 From: pieh Date: Wed, 7 Dec 2022 13:54:06 +0100 Subject: [PATCH 2/6] use v2 starters --- integration-tests/gatsby-cli/__tests__/new.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/gatsby-cli/__tests__/new.js b/integration-tests/gatsby-cli/__tests__/new.js index b4e10b2d1ff69..f53aefcadfb95 100644 --- a/integration-tests/gatsby-cli/__tests__/new.js +++ b/integration-tests/gatsby-cli/__tests__/new.js @@ -32,7 +32,7 @@ describe(`gatsby new`, () => { const [code, logs] = GatsbyCLI.from(cwd).invoke([ `new`, `gatsby-default`, - `gatsbyjs/gatsby-starter-default#v3`, + `gatsbyjs/gatsby-starter-default#v2`, ]) logs.should.contain( @@ -52,7 +52,7 @@ describe(`gatsby new`, () => { const [code, logs] = GatsbyCLI.from(cwd).invoke([ `new`, `gatsby-blog`, - `gatsbyjs/gatsby-starter-blog#v3`, + `gatsbyjs/gatsby-starter-blog#v2`, ]) logs.should.contain( From 46626f64683e8effd031178a5252616ce23ece75 Mon Sep 17 00:00:00 2001 From: pieh Date: Wed, 7 Dec 2022 15:14:38 +0100 Subject: [PATCH 3/6] update tests --- .../src/__tests__/__snapshots__/index.js.snap | 4 ++-- packages/gatsby/cache-dir/__tests__/minimal-config.js | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap b/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap index 671582ac7ac8a..b1f9bf1641dea 100644 --- a/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap +++ b/packages/gatsby-plugin-sharp/src/__tests__/__snapshots__/index.js.snap @@ -1612,7 +1612,7 @@ Object { "originalName": "test.png", "src": "/static/1234/7e516/test.png", "srcSet": "/static/1234/7e516/test.png 1x", - "tracedSVG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAAAsTAAALEwEAmpwYAAABP0lEQVQ4y2P4r8ZANmKgvuZ/agy/VaHojyopmv+CNf/XQCCoCEHNf1VBqv+oM5yVY1giwbBakuG2AkjknzoW/eh2/tdgOCPHYM7OwMDAwAgiGFgYGMJ5GF4og43ApRmuk58JqpMJRjIwMBizMbxTZviPaj8ihCD6rThAStkgljJATWEHc3P5wT5SxdD8B2ztERmQIiYGdAAxSpaF4T2q5TDN4HCaLgZSxMyAE1yQgwY+Fs1zxQloviSPTTMktM7JgVzIiKEH4hElFoavKogAQgltiJA3F0gdOyPC58yw8GsUwhFgUMvVGR4oMqiwogQbhOHLxfBLDcVabIlEneGxEkMMLwMvTLc4M0OdEMN3VfRIxp48/6mDnPdCieGkHCiRflRh+K+JPXljz1IQJ0AzhjrRGQPZC5As+ZeuhQGRmgHU8mT34D0STQAAAABJRU5ErkJggg==", + "tracedSVG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAAAsTAAALEwEAmpwYAAABOklEQVQ4y2P4r8ZANmKgvuZ/agy/VaHojyopmv+CNf/XQCCoCEHNf1VBqv+oM5yVY1giwbBakuG2AkjknzoW/eh2AtWdkWMwZ2cAAkYQwcDCwBDOw/BCGWwELs1wnfxMUJ1MMBIIjNkY3gH1o9qPCCGIfisOkFI2iKUMUFPYwdxcfrCPVDE0/wFbe0QGpIiJAR1AjJJlYXiPajlMMzicpouBFDEz4AQX5KCBj0XzXHECmi/JY9MMCa1zciAXMmLogXhEiYXhqwoigFBCGyLkzQVSBwwhuM+ZYeHXKIQjwKCWqzM8UGRQYUUJNgjDl4vhlxqKtdgSiTrDYyWGGF4GXphucWaGOiGG76rokYw9eQJTItB5L5QYTsqBEulHoD81sSdv7FkK4gRoxlAnOmMgewGSJf/StTAgEgEA1PJk9+Vu8VgAAAAASUVORK5CYII=", "width": 100, } `; @@ -1632,6 +1632,6 @@ Object { /static/1234/a1812/test.png 50w, /static/1234/7e516/test.png 100w", "srcSetType": "image/png", - "tracedSVG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAAAsTAAALEwEAmpwYAAABP0lEQVQ4y2P4r8ZANmKgvuZ/agy/VaHojyopmv+CNf/XQCCoCEHNf1VBqv+oM5yVY1giwbBakuG2AkjknzoW/eh2/tdgOCPHYM7OwMDAwAgiGFgYGMJ5GF4og43ApRmuk58JqpMJRjIwMBizMbxTZviPaj8ihCD6rThAStkgljJATWEHc3P5wT5SxdD8B2ztERmQIiYGdAAxSpaF4T2q5TDN4HCaLgZSxMyAE1yQgwY+Fs1zxQloviSPTTMktM7JgVzIiKEH4hElFoavKogAQgltiJA3F0gdOyPC58yw8GsUwhFgUMvVGR4oMqiwogQbhOHLxfBLDcVabIlEneGxEkMMLwMvTLc4M0OdEMN3VfRIxp48/6mDnPdCieGkHCiRflRh+K+JPXljz1IQJ0AzhjrRGQPZC5As+ZeuhQGRmgHU8mT34D0STQAAAABJRU5ErkJggg==", + "tracedSVG": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAACXBIWXMAAAsTAAALEwEAmpwYAAABOklEQVQ4y2P4r8ZANmKgvuZ/agy/VaHojyopmv+CNf/XQCCoCEHNf1VBqv+oM5yVY1giwbBakuG2AkjknzoW/eh2AtWdkWMwZ2cAAkYQwcDCwBDOw/BCGWwELs1wnfxMUJ1MMBIIjNkY3gH1o9qPCCGIfisOkFI2iKUMUFPYwdxcfrCPVDE0/wFbe0QGpIiJAR1AjJJlYXiPajlMMzicpouBFDEz4AQX5KCBj0XzXHECmi/JY9MMCa1zciAXMmLogXhEiYXhqwoigFBCGyLkzQVSBwwhuM+ZYeHXKIQjwKCWqzM8UGRQYUUJNgjDl4vhlxqKtdgSiTrDYyWGGF4GXphucWaGOiGG76rokYw9eQJTItB5L5QYTsqBEulHoD81sSdv7FkK4gRoxlAnOmMgewGSJf/StTAgEgEA1PJk9+Vu8VgAAAAASUVORK5CYII=", } `; diff --git a/packages/gatsby/cache-dir/__tests__/minimal-config.js b/packages/gatsby/cache-dir/__tests__/minimal-config.js index 41c5c7fdf4f9c..1519efd920940 100644 --- a/packages/gatsby/cache-dir/__tests__/minimal-config.js +++ b/packages/gatsby/cache-dir/__tests__/minimal-config.js @@ -36,6 +36,11 @@ it(`Builds cache-dir with minimal config`, done => { `Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating`, `` ) + .replace(`Why you should do it regularly:`, ``) + .replace( + `https://github.com/browserslist/browserslist#browsers-data-updating`, + `` + ) .trim() expect(stderr).toEqual(``) From cf05041e21b3de725b55b79fdf52164150a6b9c4 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 8 Dec 2022 10:20:14 +0100 Subject: [PATCH 4/6] test ignore-engines settings --- e2e-tests/development-runtime/.yarnrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 e2e-tests/development-runtime/.yarnrc diff --git a/e2e-tests/development-runtime/.yarnrc b/e2e-tests/development-runtime/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/development-runtime/.yarnrc @@ -0,0 +1 @@ +ignore-engines true From 13a6bb55a95e33bd1f30bfa4e567fceac765dac6 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 8 Dec 2022 11:21:19 +0100 Subject: [PATCH 5/6] ignore engines in e2e / integration tests --- e2e-tests/gatsby-image/.yarnrc | 1 + e2e-tests/gatsby-static-image/.yarnrc | 1 + e2e-tests/mdx-less-babel/.yarnrc | 1 + e2e-tests/mdx/.yarnrc | 1 + e2e-tests/path-prefix/.yarnrc | 1 + e2e-tests/production-runtime/.yarnrc | 1 + e2e-tests/themes/.yarnrc | 1 + e2e-tests/visual-regression/.yarnrc | 1 + integration-tests/artifacts/.yarnrc | 1 + integration-tests/cache-resilience/.yarnrc | 1 + integration-tests/gatsby-pipeline/.yarnrc | 1 + integration-tests/images/.yarnrc | 1 + integration-tests/long-term-caching/.yarnrc | 1 + integration-tests/ssr/.yarnrc | 1 + integration-tests/structured-logging/.yarnrc | 1 + 15 files changed, 15 insertions(+) create mode 100644 e2e-tests/gatsby-image/.yarnrc create mode 100644 e2e-tests/gatsby-static-image/.yarnrc create mode 100644 e2e-tests/mdx-less-babel/.yarnrc create mode 100644 e2e-tests/mdx/.yarnrc create mode 100644 e2e-tests/path-prefix/.yarnrc create mode 100644 e2e-tests/production-runtime/.yarnrc create mode 100644 e2e-tests/themes/.yarnrc create mode 100644 e2e-tests/visual-regression/.yarnrc create mode 100644 integration-tests/artifacts/.yarnrc create mode 100644 integration-tests/cache-resilience/.yarnrc create mode 100644 integration-tests/gatsby-pipeline/.yarnrc create mode 100644 integration-tests/images/.yarnrc create mode 100644 integration-tests/long-term-caching/.yarnrc create mode 100644 integration-tests/ssr/.yarnrc create mode 100644 integration-tests/structured-logging/.yarnrc diff --git a/e2e-tests/gatsby-image/.yarnrc b/e2e-tests/gatsby-image/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/gatsby-image/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/gatsby-static-image/.yarnrc b/e2e-tests/gatsby-static-image/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/gatsby-static-image/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/mdx-less-babel/.yarnrc b/e2e-tests/mdx-less-babel/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/mdx-less-babel/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/mdx/.yarnrc b/e2e-tests/mdx/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/mdx/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/path-prefix/.yarnrc b/e2e-tests/path-prefix/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/path-prefix/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/production-runtime/.yarnrc b/e2e-tests/production-runtime/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/production-runtime/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/themes/.yarnrc b/e2e-tests/themes/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/themes/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/e2e-tests/visual-regression/.yarnrc b/e2e-tests/visual-regression/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/e2e-tests/visual-regression/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/artifacts/.yarnrc b/integration-tests/artifacts/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/artifacts/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/cache-resilience/.yarnrc b/integration-tests/cache-resilience/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/cache-resilience/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/gatsby-pipeline/.yarnrc b/integration-tests/gatsby-pipeline/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/gatsby-pipeline/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/images/.yarnrc b/integration-tests/images/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/images/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/long-term-caching/.yarnrc b/integration-tests/long-term-caching/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/long-term-caching/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/ssr/.yarnrc b/integration-tests/ssr/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/ssr/.yarnrc @@ -0,0 +1 @@ +ignore-engines true diff --git a/integration-tests/structured-logging/.yarnrc b/integration-tests/structured-logging/.yarnrc new file mode 100644 index 0000000000000..123ac74a0a3de --- /dev/null +++ b/integration-tests/structured-logging/.yarnrc @@ -0,0 +1 @@ +ignore-engines true From 61defbf46b5d0c29ef59baee01a75eb9f83dbdc5 Mon Sep 17 00:00:00 2001 From: pieh Date: Thu, 8 Dec 2022 13:59:06 +0100 Subject: [PATCH 6/6] update assertion --- e2e-tests/gatsby-image/cypress/integration/traced.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/e2e-tests/gatsby-image/cypress/integration/traced.js b/e2e-tests/gatsby-image/cypress/integration/traced.js index 821bca35b912b..0ea6a58e66c25 100644 --- a/e2e-tests/gatsby-image/cypress/integration/traced.js +++ b/e2e-tests/gatsby-image/cypress/integration/traced.js @@ -5,14 +5,10 @@ describe(`fixed`, () => { cy.visit(`/traced`).waitForRouteChange() }) - it(`renders a traced svg`, () => { + it(`renders a traced svg (fallsback to base64)`, () => { cy.getTestElement(tracedTestId) .find(`.gatsby-image-wrapper > img`) .should(`have.attr`, `src`) - .and(src => { - ;[`data:image/svg+xml`, `fill='white'`].forEach(part => - expect(src).to.include(part) - ) - }) + .and(`contains`, `base64`) }) })