Skip to content

Commit 628d5e2

Browse files
committed
chore: trim unused deps across 9 more packages
- code-block: move @blocknote/core and @shikijs/types to devDeps (type-only imports) - mantine: bundle react-icons into build output - shadcn: remove unused autoprefixer - xl-ai: remove unused @blocknote/mantine, @tiptap/core, react-dom; bundle react-icons - server-util: remove unused @tiptap/core; move yjs/y-prosemirror/y-protocols to devDeps - xl-email-exporter: remove unused @blocknote/react, buffer, react, react-dom; move react-email to devDeps - xl-multi-column: remove unused prosemirror-tables, prosemirror-transform; bundle react-icons - xl-odt-exporter: remove unused buffer - xl-pdf-exporter: remove unused @blocknote/react, buffer, docx - Fix IconType to use function signature matching react-icons' original type
1 parent aabbd3a commit 628d5e2

14 files changed

Lines changed: 86 additions & 106 deletions

File tree

packages/code-block/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
"test-watch": "vitest watch"
5050
},
5151
"dependencies": {
52-
"@blocknote/core": "0.51.3",
5352
"@shikijs/core": "^4",
5453
"@shikijs/engine-javascript": "^4",
5554
"@shikijs/langs-precompiled": "^4",
56-
"@shikijs/themes": "^4",
57-
"@shikijs/types": "^4"
55+
"@shikijs/themes": "^4"
5856
},
5957
"devDependencies": {
58+
"@blocknote/core": "0.51.3",
59+
"@shikijs/types": "^4",
6060
"eslint": "^8.57.1",
6161
"rollup-plugin-webpack-stats": "^0.2.6",
6262
"typescript": "^5.9.3",

packages/mantine/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
},
6363
"dependencies": {
6464
"@blocknote/core": "0.51.3",
65-
"@blocknote/react": "0.51.3",
66-
"react-icons": "^5.5.0"
65+
"@blocknote/react": "0.51.3"
6766
},
6867
"devDependencies": {
68+
"react-icons": "^5.5.0",
6969
"@types/react": "^19.2.3",
7070
"@types/react-dom": "^19.2.3",
7171
"@vitejs/plugin-react": "^6.0.1",

packages/mantine/vite.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ export default defineConfig((conf) => ({
4545
// make sure to externalize deps that shouldn't be bundled
4646
// into your library
4747
external: (source) => {
48+
// Bundle react-icons into the output (tree-shaken) so consumers
49+
// don't need to install it as a peer/runtime dependency.
50+
const bundledDeps = ["react-icons"];
51+
if (
52+
bundledDeps.some(
53+
(dep) => source === dep || source.startsWith(dep + "/")
54+
)
55+
) {
56+
return false;
57+
}
4858
if (
4959
Object.keys({
5060
...pkg.dependencies,

packages/react/src/icons.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Defined locally so consumers don't need react-icons installed for
44
* type-checking.
55
*/
6-
export type IconType = React.ComponentType<
7-
React.SVGAttributes<SVGElement> & {
6+
export type IconType = (
7+
props: React.SVGAttributes<SVGElement> & {
88
size?: string | number;
99
color?: string;
1010
title?: string;
1111
}
12-
>;
12+
) => React.ReactNode;

packages/server-util/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,14 @@
5858
"dependencies": {
5959
"@blocknote/core": "0.51.3",
6060
"@blocknote/react": "0.51.3",
61-
"@tiptap/core": "^3.13.0",
6261
"@tiptap/pm": "^3.13.0",
63-
"jsdom": "^25.0.1",
64-
"y-prosemirror": "^1.3.7",
65-
"y-protocols": "^1.0.6",
66-
"yjs": "^13.6.27"
62+
"jsdom": "^25.0.1"
6763
},
6864
"devDependencies": {
6965
"@types/jsdom": "^21.1.7",
66+
"y-prosemirror": "^1.3.7",
67+
"y-protocols": "^1.0.6",
68+
"yjs": "^13.6.27",
7069
"@types/react": "^19.2.3",
7170
"@types/react-dom": "^19.2.3",
7271
"eslint": "^8.57.1",

packages/shadcn/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"@radix-ui/react-tabs": "^1.1.13",
6868
"@radix-ui/react-toggle": "^1.1.10",
6969
"@radix-ui/react-tooltip": "^1.2.8",
70-
"autoprefixer": "^10.4.21",
7170
"class-variance-authority": "^0.7.1",
7271
"clsx": "^2.1.1",
7372
"lucide-react": "^0.525.0",

packages/xl-ai/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,9 @@
7373
"@ai-sdk/provider-utils": "^4.0.2",
7474
"@ai-sdk/react": "^3.0.5",
7575
"@blocknote/core": "0.51.3",
76-
"@blocknote/mantine": "0.51.3",
7776
"@blocknote/react": "0.51.3",
7877
"@floating-ui/react": "^0.27.18",
7978
"@handlewithcare/prosemirror-suggest-changes": "^0.1.8",
80-
"@tiptap/core": "^3.13.0",
8179
"ai": "^6.0.5",
8280
"lodash.isequal": "^4.5.0",
8381
"lodash.merge": "^4.6.2",
@@ -87,12 +85,10 @@
8785
"prosemirror-tables": "^1.8.3",
8886
"prosemirror-transform": "^1.11.0",
8987
"prosemirror-view": "^1.41.4",
90-
"react": "^19.2.5",
91-
"react-dom": "^19.2.5",
92-
"react-icons": "^5.5.0",
9388
"y-prosemirror": "^1.3.7"
9489
},
9590
"devDependencies": {
91+
"react-icons": "^5.5.0",
9692
"@ai-sdk/anthropic": "^3.0.2",
9793
"@ai-sdk/google": "^3.0.2",
9894
"@ai-sdk/groq": "^3.0.2",

packages/xl-ai/vite.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ export default defineConfig((conf) => ({
5151
// make sure to externalize deps that shouldn't be bundled
5252
// into your library
5353
external: (source) => {
54+
// Bundle react-icons into the output (tree-shaken) so consumers
55+
// don't need to install it as a peer/runtime dependency.
56+
const bundledDeps = ["react-icons"];
57+
if (
58+
bundledDeps.some(
59+
(dep) => source === dep || source.startsWith(dep + "/")
60+
)
61+
) {
62+
return false;
63+
}
5464
if (
5565
Object.keys({
5666
...pkg.dependencies,

packages/xl-email-exporter/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,15 @@
5555
},
5656
"dependencies": {
5757
"@blocknote/core": "0.51.3",
58-
"@blocknote/react": "0.51.3",
5958
"@react-email/components": "^1.0.5",
6059
"@react-email/render": "^2.0.4",
61-
"buffer": "^6.0.3",
62-
"react": "^19.2.5",
63-
"react-dom": "^19.2.5",
64-
"react-email": "^5.2.5",
6560
"web-streams-polyfill": "^4.2.0"
6661
},
6762
"devDependencies": {
6863
"@types/jsdom": "^21.1.7",
64+
"react": "^19.2.5",
65+
"react-dom": "^19.2.5",
66+
"react-email": "^5.2.5",
6967
"@types/react": "^19.2.3",
7068
"@types/react-dom": "^19.2.3",
7169
"eslint": "^8.57.1",

packages/xl-multi-column/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@
5656
"@tiptap/core": "^3.13.0",
5757
"prosemirror-model": "^1.25.4",
5858
"prosemirror-state": "^1.4.4",
59-
"prosemirror-tables": "^1.8.3",
60-
"prosemirror-transform": "^1.11.0",
61-
"prosemirror-view": "^1.41.4",
62-
"react-icons": "^5.5.0"
59+
"prosemirror-view": "^1.41.4"
6360
},
6461
"devDependencies": {
62+
"react-icons": "^5.5.0",
6563
"@types/react": "^19.2.3",
6664
"@types/react-dom": "^19.2.3",
6765
"eslint": "^8.57.1",

0 commit comments

Comments
 (0)