-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2923 from defencedigital/security/update-resolutions
Resolve security alerts and update SVGR
- Loading branch information
Showing
7 changed files
with
1,825 additions
and
2,397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
module.exports = { | ||
template( | ||
{ template }, | ||
opts, | ||
{ imports, componentName, props, jsx, exports } | ||
) { | ||
const typeScriptTpl = template.smart({ plugins: ['jsx', 'typescript'] }) | ||
return typeScriptTpl.ast` | ||
import React from 'react' | ||
import { SVGUniqueID } from 'react-svg-unique-id'; | ||
import { SVGIconProps } from '../types' | ||
typescript: true, | ||
prettierConfig: { | ||
...require('./prettier.config.js'), | ||
parser: 'typescript', | ||
}, | ||
template: (variables, { tpl }) => { | ||
return tpl` | ||
import React from 'react' | ||
import { SVGUniqueID } from 'react-svg-unique-id' | ||
import { SVGIconProps } from '../types' | ||
const ${componentName} = ({ size = 16, ...props }: SVGIconProps) => ( | ||
<SVGUniqueID>{${jsx}}</SVGUniqueID> | ||
); | ||
${variables.interfaces} | ||
export default ${componentName}; | ||
` | ||
}, | ||
svgoConfig: { | ||
plugins: [{ removeViewBox: false }], | ||
const ${variables.componentName} = ({ size = 16, ...props }: SVGIconProps) => ( | ||
<SVGUniqueID>{${variables.jsx}}</SVGUniqueID> | ||
); | ||
${variables.exports} | ||
` | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
multipass: true, | ||
plugins: [ | ||
{ | ||
name: 'preset-default', | ||
params: { | ||
// Note: minifyStyles needs to be turned off to stop the @keyframes in | ||
// IconLoader (loader.svg) being destroyed. | ||
overrides: { removeViewBox: false, minifyStyles: false }, | ||
}, | ||
}, | ||
'convertStyleToAttrs', | ||
], | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.