Skip to content

Commit 1a6ec6c

Browse files
committed
💄 refactor: prettier formatting across the app
1 parent ba6e5f3 commit 1a6ec6c

26 files changed

Lines changed: 185 additions & 143 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cl
1212
polar: # Replace with a single Polar username
1313
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
1414
thanks_dev: # Replace with a single thanks.dev username
15-
custom: ['https://paypal.me/sandeshkatwal']
15+
custom: ["https://paypal.me/sandeshkatwal"]

index.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Developer-Icons Playground</title>
8+
</head>
39

4-
<head>
5-
<meta charset="UTF-8" />
6-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>Developer-Icons Playground</title>
9-
</head>
10-
11-
<body>
12-
<div id="root"></div>
13-
<script type="module" src="/playground/main.tsx"></script>
14-
</body>
15-
16-
</html>
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/playground/main.tsx"></script>
13+
</body>
14+
</html>

lib/createDeveloperIcon.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import svgoConfig from "../svgo.config.mjs";
66
export const createDeveloperIcon = (
77
iconName: string,
88
iconContent: string,
9-
path: string
9+
path: string,
1010
) => {
1111
const optimizedSvg = optimize(iconContent, {
1212
path,
@@ -32,11 +32,11 @@ export const createDeveloperIcon = (
3232
return `${key}=${JSON.stringify(value)}`;
3333
}
3434
},
35-
})
35+
}),
3636
);
3737

3838
return `import { createElement } from 'react';\nimport {Icon, DeveloperIconProps} from '../icon';\nexport const ${iconName} = (props: DeveloperIconProps) => createElement(Icon, {...${JSON.stringify(
39-
sanitizedSvgObject.attributes
39+
sanitizedSvgObject.attributes,
4040
)}, ...props, children: [${children}]
4141
})`;
4242
};
@@ -49,15 +49,20 @@ const sanitizeStyles = (svgObject: INode) => {
4949
.trim();
5050

5151
if (styleString) {
52-
const styleObject = styleString.split(";").reduce((acc, style) => {
53-
const [key, value] = style.split(":").map((s) => s.trim());
54-
if (key && value) {
55-
// Convert kebab-case to camelCase
56-
const camelKey = key.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
57-
acc[camelKey] = value;
58-
}
59-
return acc;
60-
}, {} as Record<string, string>);
52+
const styleObject = styleString.split(";").reduce(
53+
(acc, style) => {
54+
const [key, value] = style.split(":").map((s) => s.trim());
55+
if (key && value) {
56+
// Convert kebab-case to camelCase
57+
const camelKey = key.replace(/-([a-z])/g, (g) =>
58+
g[1].toUpperCase(),
59+
);
60+
acc[camelKey] = value;
61+
}
62+
return acc;
63+
},
64+
{} as Record<string, string>,
65+
);
6166

6267
//@ts-expect-error string style is converted into object style
6368
modifiedSvgObject.attributes.style = styleObject;

lib/iconsData.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,13 @@ export const iconsData: IconDataType[] = [
13951395
name: "Microsoft SQL Server 2",
13961396
path: "icons/microsoft-sql-server-2.svg",
13971397
categories: ["Database", "Backend"],
1398-
keywords: ["microsoft-sql-server", "database", "sql", "microsoft", "enterprise"],
1398+
keywords: [
1399+
"microsoft-sql-server",
1400+
"database",
1401+
"sql",
1402+
"microsoft",
1403+
"enterprise",
1404+
],
13991405
url: "https://www.microsoft.com/en-us/sql-server",
14001406
},
14011407
{

lib/scripts/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ iconsData.forEach((icon) => {
2020
const component = createDeveloperIcon(
2121
iconName,
2222
iconContent,
23-
path.join(svgDir, icon.path)
23+
path.join(svgDir, icon.path),
2424
);
2525
fs.writeFileSync(
2626
path.join(__dirname, "../icons", `${iconName}.tsx`),
27-
component
27+
component,
2828
);
2929

3030
exportStatement += `export * from './${iconName}.tsx';`;

lib/scripts/sortData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const __filename = fileURLToPath(import.meta.url);
77
const __dirname = path.dirname(__filename);
88

99
const sortedData = iconsData.sort((a, b) =>
10-
a.name.toLowerCase().localeCompare(b.name.toLowerCase())
10+
a.name.toLowerCase().localeCompare(b.name.toLowerCase()),
1111
);
1212
fs.writeFileSync(
1313
path.join(__dirname, "../sortedData.json"),
14-
JSON.stringify(sortedData)
14+
JSON.stringify(sortedData),
1515
);

playground/App.tsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
1-
import { Bluesky, PnpmLight, PnpmDark, PnpmDarkWordmark, PnpmLightWordmark } from "../dist/main";
1+
import {
2+
Bluesky,
3+
PnpmLight,
4+
PnpmDark,
5+
PnpmDarkWordmark,
6+
PnpmLightWordmark,
7+
} from "../dist/main";
28
import "./App.css";
39

410
function App() {
511
return (
612
<>
7-
<div style={{ display: "flex", alignItems: "center", gap: 30, backgroundColor: '#FFFFFF', padding: '10px' }}>
13+
<div
14+
style={{
15+
display: "flex",
16+
alignItems: "center",
17+
gap: 30,
18+
backgroundColor: "#FFFFFF",
19+
padding: "10px",
20+
}}
21+
>
822
<PnpmDark size={150} />
923
<PnpmDarkWordmark size={150} />
1024
<Bluesky size={150} />
1125
</div>
12-
<div style={{ display: "flex", alignItems: "center", gap: 30, backgroundColor: '#0A0A0A', padding: '10px' }}>
26+
<div
27+
style={{
28+
display: "flex",
29+
alignItems: "center",
30+
gap: 30,
31+
backgroundColor: "#0A0A0A",
32+
padding: "10px",
33+
}}
34+
>
1335
<PnpmLight size={150} />
1436
<PnpmLightWordmark size={150} />
1537
</div>

playground/main.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom/client'
3-
import App from './App.tsx'
4-
import './index.css'
1+
import React from "react";
2+
import ReactDOM from "react-dom/client";
3+
import App from "./App.tsx";
4+
import "./index.css";
55

6-
ReactDOM.createRoot(document.getElementById('root')!).render(
6+
ReactDOM.createRoot(document.getElementById("root")!).render(
77
<React.StrictMode>
88
<App />
99
</React.StrictMode>,
10-
)
10+
);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-site-verification: googlea2f4221be7d8956b.html
1+
google-site-verification: googlea2f4221be7d8956b.html

showcase/astro.config.mjs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,29 @@ import react from "@astrojs/react";
33
import tailwind from "@astrojs/tailwind";
44
import partytown from "@astrojs/partytown";
55
import sitemap from "@astrojs/sitemap";
6-
import rootPkg from '../package.json'
6+
import rootPkg from "../package.json";
77

88
// https://astro.build/config
99
export default defineConfig({
1010
site: "https://xandemon.github.io",
1111
base: "/developer-icons",
12-
vite:{
13-
define:{
14-
'__LIB_VERSION__': JSON.stringify(rootPkg.version)
15-
}
12+
vite: {
13+
define: {
14+
__LIB_VERSION__: JSON.stringify(rootPkg.version),
15+
},
1616
},
1717
trailingSlash: "never",
1818
publicDir: "./assets",
19-
integrations: [react(), tailwind({
20-
applyBaseStyles: false,
21-
}), partytown({
22-
config: {
23-
forward: ['dataLayer.push']
24-
}
25-
}), sitemap()],
26-
});
19+
integrations: [
20+
react(),
21+
tailwind({
22+
applyBaseStyles: false,
23+
}),
24+
partytown({
25+
config: {
26+
forward: ["dataLayer.push"],
27+
},
28+
}),
29+
sitemap(),
30+
],
31+
});

0 commit comments

Comments
 (0)