Skip to content

Commit

Permalink
v1.5.1: Updates dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
birdofpreyru committed Nov 5, 2022
1 parent b8dbede commit 2b8e740
Show file tree
Hide file tree
Showing 8 changed files with 752 additions and 759 deletions.
Binary file added .README/sponsor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: birdofpreyru
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.0
18.12.1
4 changes: 2 additions & 2 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
# MIT License

Copyright (c) 2019 - 2020 Dr. Sergey Pogodin aka birdofpreyru
Copyright &copy; 2019 - 2022 Dr. Sergey Pogodin <[email protected]> (https://dr.pogodin.studio)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Latest NPM Release](https://img.shields.io/npm/v/@dr.pogodin/babel-preset-svgr.svg)](https://www.npmjs.com/package/@dr.pogodin/babel-preset-svgr)
[![NPM monthly downloads](https://img.shields.io/npm/dm/@dr.pogodin/babel-preset-svgr)](https://www.npmjs.com/package/@dr.pogodin/babel-preset-svgr)
[![Donate](https://img.shields.io/badge/PayPal-Gratuity_Is_Greately_Appreciated-brightgreen?logo=paypal)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WTB2P9S2WVB8N)
[![GitHub Repo stars](https://img.shields.io/github/stars/birdofpreyru/babel-preset-svgr?style=social)](https://github.com/birdofpreyru/babel-preset-svgr)

[SVGR](https://github.com/smooth-code/svgr) is the most popular library for
Expand All @@ -16,11 +15,12 @@ SVGR and Babel. It works with any Babel setup (Babel CLI, `@babel/node`,
`@babel/register`, Webpack `babel-loader`). If you use Hot Module Reloading
in React, SVGs handled by this preset are correctly reloaded when changed.

[![Sponsor](.README/sponsor.png)](https://github.com/sponsors/birdofpreyru)

### Content
- [Setup](#setup)
- [Under the Hood](#under-the-hood)
- [Compatibility with Create React App](#compatibility-with-create-react-app)
- [Gratuity Is Greately Appreciated](#gratuity-is-greately-appreciated)

### Setup

Expand Down Expand Up @@ -173,16 +173,3 @@ module.exports = {
Of course, `__dirname` and functions can be used only inside JS variation of
Babel config, thus the example above displays `.babelrc.js` file, which can be
used instead of `.babelrc` starting from Babel@7.

### Gratuity Is Greately Appreciated

Should this preset be helpful to you, consider to make a donation to
the developer. Your support is greately appreciated and will help me to
work on my other open source projects:

- [React Global State](https://www.npmjs.com/package/@dr.pogodin/react-global-state)
- [React Themes](https://www.npmjs.com/package/@dr.pogodin/react-themes)
- [React Utils](https://www.npmjs.com/package/@dr.pogodin/react-utils)
- [React Starter](https://github.com/birdofpreyru/react-starter)

[![Donate](https://www.paypalobjects.com/en_US/ES/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WTB2P9S2WVB8N)
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ module.exports = function plugin(api, ops) {
];
}

{
// SVGR 6.5.0 (adopted in the v1.5.0 of this preset) added role="img"
// attribute to generated SVGs, which was considered a breaking change.
// However, SVGR 6.5.1 reverted that, and removed role attrbute from
// generated SVGs, unless opted-in explicitly via svgProps.role option.
// To avoid unnecessary revert of a breaking change, we just default
// svgProps.role option to "img", thus keeping adding role="img" by default.
const p = svgrOptions.svgProps;
if (!p) svgrOptions.svgProps = { role: 'img' };
else if (p.role === undefined) p.role = 'img';
}

return {
plugins: [{
parserOverride(codeOrSvg, opts) {
Expand Down
Loading

0 comments on commit 2b8e740

Please sign in to comment.