Skip to content

Commit

Permalink
Merge pull request #2923 from defencedigital/security/update-resolutions
Browse files Browse the repository at this point in the history
Resolve security alerts and update SVGR
  • Loading branch information
jpveooys authored Dec 21, 2021
2 parents c97febb + af2883a commit 425138a
Show file tree
Hide file tree
Showing 7 changed files with 1,825 additions and 2,397 deletions.
21 changes: 7 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,13 @@
"prettier": "^2.0.5"
},
"resolutions": {
"**/**/axe-core": "^3.5.3",
"**/**/browserslist": "^4.17.0",
"**/**/css-what": "^5.0.1",
"**/**/glob-parent": "^5.1.2",
"**/**/json-schema": "^0.4.0",
"**/**/jszip": "^3.7.1",
"**/**/normalize-url": "^6.0.1",
"**/**/postcss": "^8.2.15",
"**/**/postcss-scss": "^3.0.5",
"**/**/tar": "^6.1.11",
"**/**/trim": "^0.0.3",
"**/**/url-parse": "^1.5.3",
"**/**/yup": "^0.31.1",
"**/**/ansi-regex": "^5.0.1"
"**/ansi-regex": "^5.0.1",
"**/axe-core": "^3.5.3",
"**/immer": "^9.0.6",
"**/semver-regex": "^3.1.3",
"**/trim": "^0.0.3",
"**/trim-newlines": "^3.0.1",
"**/yup": "^0.31.1"
},
"prettier": {
"bracketSpacing": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"lodash": "^4.17.20",
"npm-run-all": "^4.1.5",
"source-map-loader": "^3.0.0",
"style-dictionary": "^3.0.0",
"style-dictionary": "^3.1.1",
"typescript": "^4.0.3",
"webpack": "^5.52.1",
"webpack-cli": "^4.7.2",
Expand Down
35 changes: 17 additions & 18 deletions packages/icon-library/.svgrrc.js
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}
`
},
}
8 changes: 4 additions & 4 deletions packages/icon-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"build": "run-s svgr-icons svgr-silhouettes exports build:es build:cjs types",
"build:es": "BABEL_ENV=es babel src --out-dir \"dist/es\" --extensions \".ts,.tsx\"",
"build:cjs": "BABEL_ENV=cjs webpack --mode production --config=webpack/prod.js",
"svgr-icons": "rm -rf src/icons; svgr --ext tsx -d src/icons src/assets/icons/**/; rm src/icons/index.tsx",
"svgr-silhouettes": "rm -rf src/silhouettes; svgr --ext tsx -d src/silhouettes src/assets/silhouettes/; rm src/silhouettes/index.tsx",
"svgr-icons": "rm -rf src/icons; svgr -d src/icons -- src/assets/icons/**/; rm src/icons/index.tsx",
"svgr-silhouettes": "rm -rf src/silhouettes; svgr -d src/silhouettes -- src/assets/silhouettes/; rm src/silhouettes/index.tsx",
"exports": "./generate-exports.sh",
"types": "tsc --emitDeclarationOnly --declarationMap --declaration --noEmit false --allowJs false --outDir dist/types",
"prepare": "yarn build"
Expand All @@ -39,8 +39,8 @@
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@svgr/babel-plugin-add-jsx-attribute": "^5.4.0",
"@svgr/cli": "^5.1.0",
"@svgr/babel-plugin-add-jsx-attribute": "^6.0.0",
"@svgr/cli": "^6.1.2",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^4.0.0",
"npm-run-all": "^4.1.5",
Expand Down
14 changes: 14 additions & 0 deletions packages/icon-library/svgo.config.js
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',
],
}
10 changes: 0 additions & 10 deletions yarn-audit-known-issues

This file was deleted.

Loading

0 comments on commit 425138a

Please sign in to comment.