Skip to content

Commit

Permalink
v1.3.0: Updated to use SVGR v5.5.0
Browse files Browse the repository at this point in the history
Also updates development dependencies.

The change is marked as minor version update because SVGR now keeps
XMLNS attributes in the processed SVGs. It hardly will have any
practical side-effects, but may require updates in your tests, etc.
  • Loading branch information
birdofpreyru committed Nov 16, 2020
1 parent 4d18731 commit aabafd1
Show file tree
Hide file tree
Showing 22 changed files with 1,571 additions and 2,655 deletions.
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__tests__
.*
jest.config.js
dr.pogodin-babel-preset-svgr-*.tgz
jest.config.js
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.18.3
14.15.1
4 changes: 3 additions & 1 deletion __tests__/mimic-create-react-app/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"presets": [
"@babel/env",
"@babel/react",
["@babel/react", {
"runtime": "automatic"
}],
["../../index", {
"mimicCreateReactApp": true
}]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SVG import works as expected 1`] = `"<svg width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
exports[`SVG import works as expected 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
1 change: 0 additions & 1 deletion __tests__/mimic-create-react-app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Tests the preset used without any options.
*/

import React from 'react';
import ReactDOM from 'react-dom/server';

import logoPath, { ReactComponent } from './logo.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = {
presets: [
'@babel/env',
'@babel/react',
["@babel/react", {
"runtime": "automatic"
}],
['../../index', {
mimicCreateReactApp: {
pathsRelativeTo: __dirname,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SVG import works as expected 1`] = `"<svg width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
exports[`SVG import works as expected 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Tests the preset used without any options.
*/

import React from 'react';
import ReactDOM from 'react-dom/server';

import logoPath, { ReactComponent } from './logo.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = {
presets: [
'@babel/env',
'@babel/react',
["@babel/react", {
"runtime": "automatic"
}],
['../../index', {
mimicCreateReactApp: {
pathsRelativeTo: __dirname,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SVG import works as expected 1`] = `"<svg width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
exports[`SVG import works as expected 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Tests the preset used without any options.
*/

import React from 'react';
import ReactDOM from 'react-dom/server';

import logoPath, { ReactComponent } from './logo.svg';
Expand Down
4 changes: 3 additions & 1 deletion __tests__/mimic-create-react-app_paths-transform/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = {
presets: [
'@babel/env',
'@babel/react',
["@babel/react", {
"runtime": "automatic"
}],
['../../index', {
mimicCreateReactApp: {
pathsRelativeTo: __dirname,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SVG import works as expected 1`] = `"<svg width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
exports[`SVG import works as expected 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
1 change: 0 additions & 1 deletion __tests__/mimic-create-react-app_paths-transform/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Tests the preset used without any options.
*/

import React from 'react';
import ReactDOM from 'react-dom/server';

import logoPath, { ReactComponent } from './logo.svg';
Expand Down
4 changes: 3 additions & 1 deletion __tests__/minimal/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"presets": [
"@babel/env",
"@babel/react",
["@babel/react", {
"runtime": "automatic"
}],
"../../index"
]
}
2 changes: 1 addition & 1 deletion __tests__/minimal/__snapshots__/index.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SVG import works as expected 1`] = `"<svg width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
exports[`SVG import works as expected 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"150.517\\" height=\\"188.611\\" viewBox=\\"0 0 39.824 49.903\\" data-reactroot=\\"\\"><path fill=\\"#f5f5f5\\" d=\\"M0 0h39.824v49.903H0z\\"></path><g aria-label=\\"P\\" style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" font-weight=\\"400\\" font-size=\\"99.751\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.399\\"><path d=\\"M14.119 34.474h5.893c4.281 0 7.547-1.214 9.798-3.642 2.251-2.428 3.377-5.826 3.377-10.196 0-4.855-1.06-8.54-3.178-11.057-2.075-2.516-5.43-3.774-10.064-3.774H6.637l-.035 34.02H0V0h39.824v39.824H14.112z\\"></path><path d=\\"M17.562 29.11c2.207 0 3.906-.242 5.098-.728 1.236-.485 2.119-1.324 2.648-2.516.53-1.191.795-2.913.795-5.164 0-2.736-.199-4.745-.596-6.025-.397-1.28-1.192-2.185-2.384-2.714-1.147-.53-2.98-.795-5.495-.795h-3.509v17.943z\\"></path></g><text style=\\"line-height:120.00000477%;-inkscape-font-specification:Oswald\\" x=\\"43.138\\" y=\\"136.474\\" font-weight=\\"400\\" font-size=\\"6.063\\" font-family=\\"Oswald\\" letter-spacing=\\"0\\" word-spacing=\\"0\\" fill=\\"#313131\\" stroke-width=\\"0.265\\" transform=\\"translate(-43.52 -87.656)\\"><tspan x=\\"43.138\\" y=\\"136.474\\">Dr. Pogodin Studio</tspan></text></svg>"`;
1 change: 0 additions & 1 deletion __tests__/minimal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Tests the preset used without any options.
*/

import React from 'react';
import ReactDOM from 'react-dom/server';

import Logo from './logo.svg';
Expand Down
4 changes: 3 additions & 1 deletion __tests__/viewbox/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"presets": [
"@babel/env",
"@babel/react",
["@babel/react", {
"runtime": "automatic"
}],
"../../index"
]
}
Loading

0 comments on commit aabafd1

Please sign in to comment.