Skip to content

Commit

Permalink
chore(deps): upgrade fontawesome (#1944)
Browse files Browse the repository at this point in the history
  • Loading branch information
chdeskur authored Dec 26, 2024
1 parent 0264c87 commit 55029dd
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 87 deletions.
23 changes: 17 additions & 6 deletions packages/fern-docs/components/src/FontAwesomeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,24 @@ function getCdnHost() {
);
}

// parse any font awesome icon into two parts: style and icon name
function parseFontAwesomeIcon(icon: string): [string, string] | undefined {
const [left, right] = icon.split(" ");
if (left && right) {
return [left.replace("fa-", ""), right.replace("fa-", "")];
const parts = icon.replaceAll("fa-", "").split(" ");
if (parts.length === 0) {
return;
}
if (left) {
return ["solid", left.replace("fa-", "")];

// if no style is specified, default to solid style
if (parts.length === 1 && parts[0] != null) {
return ["solid", parts[0]];
}

const iconName = parts.pop();
if (iconName == null) {
return;
}
return;

// if multiple styles are specified, join them with a dash
const style = parts.join("-");
return [style, iconName];
}
22 changes: 11 additions & 11 deletions packages/fern-docs/icons-cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
"test": "vitest --run --passWithNoTests --globals"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-brands-svg-icons": "^6.5.2",
"@fortawesome/pro-duotone-svg-icons": "^6.5.2",
"@fortawesome/pro-light-svg-icons": "^6.5.2",
"@fortawesome/pro-regular-svg-icons": "^6.5.2",
"@fortawesome/pro-solid-svg-icons": "^6.5.2",
"@fortawesome/pro-thin-svg-icons": "^6.5.2",
"@fortawesome/sharp-light-svg-icons": "^6.5.2",
"@fortawesome/sharp-regular-svg-icons": "^6.5.2",
"@fortawesome/sharp-solid-svg-icons": "^6.5.2",
"@fortawesome/sharp-thin-svg-icons": "^6.5.2",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-brands-svg-icons": "^6.7.2",
"@fortawesome/pro-duotone-svg-icons": "^6.7.2",
"@fortawesome/pro-light-svg-icons": "^6.7.2",
"@fortawesome/pro-regular-svg-icons": "^6.7.2",
"@fortawesome/pro-solid-svg-icons": "^6.7.2",
"@fortawesome/pro-thin-svg-icons": "^6.7.2",
"@fortawesome/sharp-light-svg-icons": "^6.7.2",
"@fortawesome/sharp-regular-svg-icons": "^6.7.2",
"@fortawesome/sharp-solid-svg-icons": "^6.7.2",
"@fortawesome/sharp-thin-svg-icons": "^6.7.2",
"react": "^18",
"react-dom": "^18"
},
Expand Down
140 changes: 70 additions & 70 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55029dd

Please sign in to comment.