chore(deps): bump simple-icons from 6.23.0 to 7.0.0 (#8039)

* chore(deps): bump simple-icons from 6.23.0 to 7.0.0

Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 6.23.0 to 7.0.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](https://github.com/simple-icons/simple-icons/compare/6.23.0...7.0.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: update icon loading to handle SI v7

* refactor: use SI slugs directly

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Caleb Cartwright <caleb.cartwright@outlook.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2022-06-22 22:12:17 +00:00
committed by GitHub
parent e7aecb1a3b
commit c87a215d0e
3 changed files with 20 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
import originalSimpleIcons from 'simple-icons' import * as originalSimpleIcons from 'simple-icons/icons'
import { svg2base64 } from './svg-helpers.js' import { svg2base64 } from './svg-helpers.js'
function loadSimpleIcons() { function loadSimpleIcons() {
@@ -14,10 +14,10 @@ function loadSimpleIcons() {
// https://github.com/badges/shields/issues/4273 // https://github.com/badges/shields/issues/4273
Object.keys(originalSimpleIcons).forEach(key => { Object.keys(originalSimpleIcons).forEach(key => {
const icon = originalSimpleIcons[key] const icon = originalSimpleIcons[key]
const title = icon.title.toLowerCase() const { title, slug, hex } = icon
const legacyTitle = title.replace(/ /g, '-')
icon.base64 = { icon.base64 = {
default: svg2base64(icon.svg.replace('<svg', `<svg fill="#${icon.hex}"`)), default: svg2base64(icon.svg.replace('<svg', `<svg fill="#${hex}"`)),
light: svg2base64(icon.svg.replace('<svg', `<svg fill="whitesmoke"`)), light: svg2base64(icon.svg.replace('<svg', `<svg fill="whitesmoke"`)),
dark: svg2base64(icon.svg.replace('<svg', `<svg fill="#333"`)), dark: svg2base64(icon.svg.replace('<svg', `<svg fill="#333"`)),
} }
@@ -26,14 +26,17 @@ function loadSimpleIcons() {
// (e.g. 'Hive'). If a by-title reference we generate for // (e.g. 'Hive'). If a by-title reference we generate for
// backwards compatibility collides with a proper slug from Simple Icons // backwards compatibility collides with a proper slug from Simple Icons
// then do nothing, so that the proper slug will always map to the correct icon. // then do nothing, so that the proper slug will always map to the correct icon.
if (!(title in originalSimpleIcons)) { // Starting in v7, the exported object with the full icon set has updated the keys
simpleIcons[title] = icon // to include a lowercase `si` prefix, and utilizes proper case naming conventions.
if (!(`si${title}` in originalSimpleIcons)) {
simpleIcons[title.toLowerCase()] = icon
} }
if (!(legacyTitle in originalSimpleIcons)) { const legacyTitle = title.replace(/ /g, '-')
simpleIcons[legacyTitle] = icon if (!(`si${legacyTitle}` in originalSimpleIcons)) {
simpleIcons[legacyTitle.toLowerCase()] = icon
} }
simpleIcons[key] = icon simpleIcons[slug] = icon
}) })
return simpleIcons return simpleIcons
} }

14
package-lock.json generated
View File

@@ -49,7 +49,7 @@
"qs": "^6.10.5", "qs": "^6.10.5",
"query-string": "^7.1.1", "query-string": "^7.1.1",
"semver": "~7.3.7", "semver": "~7.3.7",
"simple-icons": "6.23.0", "simple-icons": "7.0.0",
"webextension-store-meta": "^1.0.5", "webextension-store-meta": "^1.0.5",
"xmldom": "~0.6.0", "xmldom": "~0.6.0",
"xpath": "~0.0.32" "xpath": "~0.0.32"
@@ -25916,9 +25916,9 @@
} }
}, },
"node_modules/simple-icons": { "node_modules/simple-icons": {
"version": "6.23.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-6.23.0.tgz", "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-7.0.0.tgz",
"integrity": "sha512-9ql+6OdW5Dnfx1/z5z8MYO2y+OM4Oj4XBvQY5Nlye4eW+Nf5igHzHIKKtTmFkvCmR0lrddZpe1F/89chgoUXhg==", "integrity": "sha512-5jwnZ04C2PmdKrLe6HSZLmsmP77WvZtNau0hGgSqEi2pplcP3yiiE4/f0Emgix8tItWKsYkS1TQI75yZhr8Xjw==",
"engines": { "engines": {
"node": ">=0.12.18" "node": ">=0.12.18"
}, },
@@ -50405,9 +50405,9 @@
"dev": true "dev": true
}, },
"simple-icons": { "simple-icons": {
"version": "6.23.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-6.23.0.tgz", "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-7.0.0.tgz",
"integrity": "sha512-9ql+6OdW5Dnfx1/z5z8MYO2y+OM4Oj4XBvQY5Nlye4eW+Nf5igHzHIKKtTmFkvCmR0lrddZpe1F/89chgoUXhg==" "integrity": "sha512-5jwnZ04C2PmdKrLe6HSZLmsmP77WvZtNau0hGgSqEi2pplcP3yiiE4/f0Emgix8tItWKsYkS1TQI75yZhr8Xjw=="
}, },
"simple-swizzle": { "simple-swizzle": {
"version": "0.2.2", "version": "0.2.2",

View File

@@ -61,7 +61,7 @@
"qs": "^6.10.5", "qs": "^6.10.5",
"query-string": "^7.1.1", "query-string": "^7.1.1",
"semver": "~7.3.7", "semver": "~7.3.7",
"simple-icons": "6.23.0", "simple-icons": "7.0.0",
"webextension-store-meta": "^1.0.5", "webextension-store-meta": "^1.0.5",
"xmldom": "~0.6.0", "xmldom": "~0.6.0",
"xpath": "~0.0.32" "xpath": "~0.0.32"