Skip to content

Commit 781098b

Browse files
committed
drop unplugin-icons dependency
... in favor of manually added extra needed icons using icones.js.org (Lucide is still the default iconset in the codebase). Reason: unplugin-icons doesn't support turbopack atm.
1 parent 1afb727 commit 781098b

39 files changed

+410
-248
lines changed

packages/jsrepl/next.config.mjs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable no-console */
22
import createMDX from '@next/mdx'
33
import { readFileSync } from 'fs'
4-
import Icons from 'unplugin-icons/webpack'
54

65
envVars()
76

@@ -38,17 +37,6 @@ const nextConfig = {
3837
},
3938
]
4039
},
41-
42-
webpack(config) {
43-
config.plugins.push(
44-
Icons({
45-
compiler: 'jsx',
46-
jsx: 'react',
47-
})
48-
)
49-
50-
return config
51-
},
5240
}
5341

5442
const withMDX = createMDX({

packages/jsrepl/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
"@babel/parser": "^7.25.6",
6868
"@babel/types": "^7.26.3",
6969
"@chromatic-com/storybook": "^3.2.2",
70-
"@iconify-json/mdi": "^1.2.0",
71-
"@iconify-json/simple-icons": "^1.2.2",
7270
"@playwright/test": "^1.46.1",
7371
"@storybook/addon-essentials": "^8.4.7",
7472
"@storybook/addon-interactions": "^8.4.7",
@@ -103,7 +101,6 @@
103101
"storybook": "^8.4.7",
104102
"string-dedent": "^3.0.1",
105103
"tailwindcss": "^3.4.1",
106-
"unplugin-icons": "^0.19.3",
107104
"vitest": "^2.0.5"
108105
},
109106
"browserslist": [

packages/jsrepl/src/app/(default)/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import {
77
LucideArrowDown,
88
LucideArrowRight,
99
LucideHeart,
10+
LucideMail,
1011
LucideMessageCircleQuestion,
1112
LucidePackage,
1213
LucidePiggyBank,
1314
LucideSquareFunction,
1415
} from 'lucide-react'
15-
import IconEmail from '~icons/mdi/email-outline.jsx'
16-
import IconGithub from '~icons/mdi/github.jsx'
17-
import IconEsbuild from '~icons/simple-icons/esbuild.jsx'
18-
import IconGithubSponsors from '~icons/simple-icons/githubsponsors.jsx'
16+
import { SimpleIconsEsbuild } from '@/components/icons/simple-icons/esbuild'
17+
import { SimpleIconsGithub } from '@/components/icons/simple-icons/github'
18+
import { SimpleIconsGithubsponsors } from '@/components/icons/simple-icons/githubsponsors'
1919
import ReplStarterDialog from '@/components/repl-starter-dialog'
2020
import { Button } from '@/components/ui/button'
2121
import { SystemRepls } from '@/lib/repl-stored-state/system-repls'
@@ -128,7 +128,7 @@ export default function Home() {
128128
/>
129129

130130
<FeatureBox
131-
icon={<IconEsbuild width={24} height={24} className="text-primary" />}
131+
icon={<SimpleIconsEsbuild width={24} height={24} className="text-primary" />}
132132
title={
133133
<>
134134
Powered by <span className="gradient-text">esbuild</span>
@@ -676,13 +676,13 @@ export default function Home() {
676676
<p className="flex">
677677
<Button asChild size="icon" variant="ghost">
678678
<Link href="https://github.com/nag5000" target="_blank">
679-
<IconGithub width={24} height={24} className="opacity-80" />
679+
<SimpleIconsGithub width={21} height={21} className="opacity-80" />
680680
</Link>
681681
</Button>
682682

683683
<Button asChild size="icon" variant="ghost">
684684
<Link href="https://github.com/sponsors/nag5000" target="_blank">
685-
<IconGithubSponsors
685+
<SimpleIconsGithubsponsors
686686
width={22}
687687
height={22}
688688
className="opacity-80 hover:text-[#bf3989]"
@@ -692,7 +692,7 @@ export default function Home() {
692692

693693
<Button asChild size="icon" variant="ghost">
694694
<Link href="mailto:[email protected]" target="_blank">
695-
<IconEmail width={24} height={24} className="opacity-80" />
695+
<LucideMail width={24} height={24} className="opacity-80" />
696696
</Link>
697697
</Button>
698698
</p>

packages/jsrepl/src/app/dashboard/page.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import { useState } from 'react'
44
import { useRouter, useSearchParams } from 'next/navigation'
55
import { LucideLibrary, LucidePlus } from 'lucide-react'
6-
import IconLanguageCss from '~icons/mdi/language-css3.jsx'
7-
import IconLanguageHtml from '~icons/mdi/language-html5.jsx'
8-
import IconLanguageJavascript from '~icons/mdi/language-javascript.jsx'
9-
import IconLanguageTypescript from '~icons/mdi/language-typescript.jsx'
10-
import IconReact from '~icons/mdi/react.jsx'
11-
import IconTailwind from '~icons/mdi/tailwind.jsx'
12-
import IconGithub from '~icons/simple-icons/github.jsx'
6+
import { MdiLanguageCss3 } from '@/components/icons/mdi/language-css3'
7+
import { MdiLanguageHtml5 } from '@/components/icons/mdi/language-html5'
8+
import { MdiLanguageJavascript } from '@/components/icons/mdi/language-javascript'
9+
import { MdiLanguageTypescript } from '@/components/icons/mdi/language-typescript'
10+
import { MdiReact } from '@/components/icons/mdi/react'
11+
import { MdiTailwind } from '@/components/icons/mdi/tailwind'
12+
import { SimpleIconsGithub } from '@/components/icons/simple-icons/github'
1313
import ReplStarterDialog from '@/components/repl-starter-dialog'
1414
import { Button } from '@/components/ui/button'
1515
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
@@ -65,7 +65,7 @@ export default function DashboardPage() {
6565
})
6666
}
6767
>
68-
<IconGithub width={18} height={18} className="mr-2" />
68+
<SimpleIconsGithub width={18} height={18} className="mr-2" />
6969
Log in with Github
7070
</Button>
7171
to store your REPLs on the Dashboard
@@ -92,12 +92,12 @@ export default function DashboardPage() {
9292
</div>
9393
<div className="pointer-events-none absolute bottom-0 right-0 top-0 flex w-20 items-center justify-center overflow-hidden opacity-20">
9494
<div className="grid grid-cols-2 gap-x-2 *:h-10 *:w-10">
95-
<IconLanguageTypescript />
96-
<IconLanguageHtml />
97-
<IconLanguageCss />
98-
<IconReact />
99-
<IconLanguageJavascript />
100-
<IconTailwind />
95+
<MdiLanguageTypescript />
96+
<MdiLanguageHtml5 />
97+
<MdiLanguageCss3 />
98+
<MdiReact />
99+
<MdiLanguageJavascript />
100+
<MdiTailwind />
101101
</div>
102102
</div>
103103
</Button>

packages/jsrepl/src/app/repl/[[...slug]]/components/activity-bar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from 'next/link'
44
import { ReplPayload } from '@jsrepl/shared-types'
55
import { LucideFiles, LucidePlay, LucideRewind, LucideRotateCw, LucideSettings } from 'lucide-react'
66
import { LucideEye, LucideMoon, LucidePalette, LucideShare2, LucideSun } from 'lucide-react'
7-
import IconGithub from '~icons/simple-icons/github.jsx'
7+
import { SimpleIconsGithub } from '@/components/icons/simple-icons/github'
88
import Logo from '@/components/logo'
99
import ShareReplDropdownItem from '@/components/share-repl-dropdown-item'
1010
import { Button } from '@/components/ui/button'
@@ -246,7 +246,7 @@ export default function ActivityBar() {
246246

247247
<Button size="icon-lg" variant="ghost" className="text-activityBar-foreground" asChild>
248248
<Link href="https://github.com/jsrepl/jsrepl.io" target="_blank">
249-
<IconGithub width={19} height={19} />
249+
<SimpleIconsGithub width={19} height={19} />
250250
</Link>
251251
</Button>
252252

packages/jsrepl/src/app/repl/[[...slug]]/components/code-editor-header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useCallback, useEffect, useMemo, useRef } from 'react'
44
import { LucideEllipsisVertical, LucideLock, LucideX } from 'lucide-react'
5-
import IconPrettier from '~icons/simple-icons/prettier'
5+
import { SimpleIconsPrettier } from '@/components/icons/simple-icons/prettier'
66
import { Button } from '@/components/ui/button'
77
import {
88
DropdownMenu,
@@ -202,7 +202,7 @@ export default function CodeEditorHeader() {
202202
disabled={isReadOnly}
203203
onClick={onFormatClick}
204204
>
205-
<IconPrettier width={15} height={15} />
205+
<SimpleIconsPrettier width={15} height={15} />
206206
</Button>
207207
</TooltipTrigger>
208208
<TooltipContent side="bottom" sideOffset={8} align="end">
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { LucideFolder } from 'lucide-react'
2-
import IconReadme from '~icons/mdi/book-open-variant-outline.jsx'
3-
import IconCodeJson from '~icons/mdi/code-json.jsx'
4-
import IconFile from '~icons/mdi/file-outline.jsx'
5-
import IconLanguageCss from '~icons/mdi/language-css3.jsx'
6-
import IconLanguageHtml from '~icons/mdi/language-html5.jsx'
7-
import IconLanguageJavascript from '~icons/mdi/language-javascript.jsx'
8-
import IconLanguageMarkdown from '~icons/mdi/language-markdown.jsx'
9-
import IconLanguageTypescript from '~icons/mdi/language-typescript.jsx'
10-
import IconReact from '~icons/mdi/react.jsx'
11-
import IconTailwind from '~icons/mdi/tailwind.jsx'
1+
import { BeardedIconsCss } from '@/components/icons/bearded-icons/css'
2+
import { BeardedIconsFile } from '@/components/icons/bearded-icons/file'
3+
import { BeardedIconsFolder } from '@/components/icons/bearded-icons/folder'
4+
import { BeardedIconsHtml } from '@/components/icons/bearded-icons/html'
5+
import { BeardedIconsJavascript } from '@/components/icons/bearded-icons/javascript'
6+
import { BeardedIconsJson } from '@/components/icons/bearded-icons/json'
7+
import { BeardedIconsMarkdown } from '@/components/icons/bearded-icons/markdown'
8+
import { BeardedIconsReactjs } from '@/components/icons/bearded-icons/reactjs'
9+
import { BeardedIconsReactts } from '@/components/icons/bearded-icons/reactts'
10+
import { BeardedIconsReadme } from '@/components/icons/bearded-icons/readme'
11+
import { BeardedIconsTailwind } from '@/components/icons/bearded-icons/tailwind'
12+
import { BeardedIconsTypescript } from '@/components/icons/bearded-icons/typescript'
1213
import { getFileExtension } from '@/lib/fs-utils'
1314

1415
export function FileIcon({
@@ -21,37 +22,36 @@ export function FileIcon({
2122
className?: string
2223
}) {
2324
if (isFolder) {
24-
return <LucideFolder className={`${className}`} />
25+
return <BeardedIconsFolder className={className} />
2526
}
2627

2728
switch (true) {
2829
case /tailwind\.config\.(ts|js)?$/i.test(name):
29-
return <IconTailwind className={`${className} text-[#38BDF9]`} />
30+
return <BeardedIconsTailwind className={className} />
3031

3132
case /readme\.md$/i.test(name):
32-
return <IconReadme className={`${className} text-[#38BDF9]`} />
33+
return <BeardedIconsReadme className={className} />
3334
}
3435

3536
const ext = getFileExtension(name)
3637
switch (ext) {
3738
case '.tsx':
39+
return <BeardedIconsReactts className={className} />
3840
case '.jsx':
39-
return <IconReact className={`${className} text-[#0A7EA4]`} />
41+
return <BeardedIconsReactjs className={className} />
4042
case '.ts':
41-
return <IconLanguageTypescript className={`${className} text-[#3078C6]`} />
43+
return <BeardedIconsTypescript className={className} />
4244
case '.js':
43-
return (
44-
<IconLanguageJavascript className={`${className} text-[#c8a421] dark:text-[#E8D44E]`} />
45-
)
45+
return <BeardedIconsJavascript className={className} />
4646
case '.html':
47-
return <IconLanguageHtml className={`${className} text-[#DC4A25]`} />
47+
return <BeardedIconsHtml className={className} />
4848
case '.css':
49-
return <IconLanguageCss className={`${className} text-[#3078C6]`} />
49+
return <BeardedIconsCss className={className} />
5050
case '.json':
51-
return <IconCodeJson className={`${className} text-[#CC8000]`} />
51+
return <BeardedIconsJson className={className} />
5252
case '.md':
53-
return <IconLanguageMarkdown className={`${className} text-[#3078C6]`} />
53+
return <BeardedIconsMarkdown className={className} />
5454
default:
55-
return <IconFile className={`${className} text-muted-foreground`} />
55+
return <BeardedIconsFile className={className} />
5656
}
5757
}

packages/jsrepl/src/app/repl/[[...slug]]/components/files-panel-section/utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LucideFolderOpen } from 'lucide-react'
1+
import { BeardedIconsFolderOpen } from '@/components/icons/bearded-icons/folder-open'
22
import { TreeDataItem } from '@/components/ui/tree-view'
33
import * as ReplFS from '@/lib/repl-fs'
44
import { ReplInfo } from '@/types/repl.types'
@@ -82,7 +82,7 @@ export function fsEntryToTreeDataItem(
8282
icon: ({ className }: { className?: string }) => (
8383
<FileIcon name={name} isFolder={entry.kind === ReplFS.Kind.Directory} className={className} />
8484
),
85-
openIcon: entry.kind === ReplFS.Kind.Directory ? LucideFolderOpen : undefined,
85+
openIcon: entry.kind === ReplFS.Kind.Directory ? BeardedIconsFolderOpen : undefined,
8686
actions: <Actions path={path} entry={entry} />,
8787
children,
8888
}

packages/jsrepl/src/app/repl/[[...slug]]/components/status-bar/copilot-item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function CopilotItem() {
1818
<DropdownMenu modal={false}>
1919
<DropdownMenuTrigger asChild>
2020
<StatusBarButton aria-label="AI Autocomplete">
21-
<CopilotIcon size={14} className={!isEnabled ? 'opacity-50' : undefined} />
21+
<CopilotIcon width={14} height={14} className={!isEnabled ? 'opacity-50' : undefined} />
2222
</StatusBarButton>
2323
</DropdownMenuTrigger>
2424
<DropdownMenuContent>

packages/jsrepl/src/components/error.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React, { useEffect } from 'react'
44
import Link from 'next/link'
5-
import IconGithub from '~icons/simple-icons/github.jsx'
5+
import { SimpleIconsGithub } from '@/components/icons/simple-icons/github'
66
import { Button } from '@/components/ui/button'
77
import { ResponseError } from '@/lib/response-error'
88

@@ -37,7 +37,7 @@ export default function ErrorComponent({
3737
<div className="mt-12 flex flex-wrap items-center gap-4">
3838
<Button asChild size="lg">
3939
<Link href="https://github.com/jsrepl/jsrepl.io/issues" target="_blank">
40-
<IconGithub width={20} height={20} className="mr-2" />
40+
<SimpleIconsGithub width={20} height={20} className="mr-2" />
4141
Report an issue
4242
</Link>
4343
</Button>

0 commit comments

Comments
 (0)