Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37dc0a6

Browse files
committed
Core: Update image-size to v2
1 parent b3e194e commit 37dc0a6

File tree

17 files changed

+422
-688
lines changed

17 files changed

+422
-688
lines changed

.changeset/early-clouds-show.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'fumadocs-core': patch
3+
---
4+
5+
Update `image-size` to v2

apps/docs/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"fumadocs-typescript": "workspace:^",
3232
"fumadocs-ui": "workspace:*",
3333
"geist": "^1.3.1",
34-
"hast-util-to-jsx-runtime": "^2.3.3",
34+
"hast-util-to-jsx-runtime": "^2.3.5",
3535
"katex": "^0.16.21",
36-
"lucide-react": "^0.475.0",
36+
"lucide-react": "^0.476.0",
3737
"next": "15.1.7",
3838
"octokit": "^4.1.2",
39-
"oxc-transform": "^0.51.0",
39+
"oxc-transform": "^0.53.0",
4040
"phenomenon": "^1.6.0",
4141
"react": "^19.0.0",
4242
"react-dom": "^19.0.0",
@@ -49,26 +49,26 @@
4949
"remark-stringify": "^11.0.0",
5050
"scroll-into-view-if-needed": "^3.1.0",
5151
"shiki": "^3.0.0",
52-
"tailwind-merge": "^3.0.1",
52+
"tailwind-merge": "^3.0.2",
5353
"zod": "^3.24.2"
5454
},
5555
"devDependencies": {
5656
"@fumadocs/cli": "workspace:*",
5757
"@next/bundle-analyzer": "15.1.7",
5858
"@next/env": "15.1.7",
5959
"@next/eslint-plugin-next": "15.1.7",
60-
"@tailwindcss/postcss": "^4.0.7",
60+
"@tailwindcss/postcss": "^4.0.9",
6161
"@types/hast": "^3.0.4",
6262
"@types/mdx": "^2.0.13",
63-
"@types/node": "22.13.4",
63+
"@types/node": "22.13.5",
6464
"@types/react": "^19.0.10",
6565
"@types/react-dom": "^19.0.4",
6666
"eslint-config-custom": "workspace:*",
6767
"fast-glob": "^3.3.3",
6868
"gray-matter": "^4.0.3",
6969
"next-validate-link": "^1.4.1",
7070
"postcss": "^8.5.3",
71-
"tailwindcss": "^4.0.7",
71+
"tailwindcss": "^4.0.9",
7272
"tailwindcss-animate": "^1.0.7",
7373
"ts-morph": "^25.0.1",
7474
"tsconfig": "workspace:*",

examples/openapi/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"zod": "^3.24.2"
2323
},
2424
"devDependencies": {
25-
"@tailwindcss/postcss": "^4.0.7",
25+
"@tailwindcss/postcss": "^4.0.9",
2626
"@types/mdx": "^2.0.13",
2727
"@types/react": "^19.0.10",
2828
"@types/react-dom": "^19.0.4",
2929
"postcss": "^8.5.3",
3030
"rimraf": "^6.0.1",
31-
"tailwindcss": "^4.0.7",
31+
"tailwindcss": "^4.0.9",
3232
"typescript": "^5.7.3"
3333
}
3434
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
"eslint-plugin-react": "^7.37.4",
2626
"eslint-plugin-react-hooks": "5.1.0",
2727
"eslint-plugin-tailwindcss": "^3.18.0",
28-
"prettier": "^3.5.1",
28+
"prettier": "^3.5.2",
2929
"rimraf": "^6.0.1",
30-
"tsup": "8.3.6",
31-
"turbo": "2.4.2",
30+
"tsup": "8.4.0",
31+
"turbo": "2.4.4",
3232
"typescript": "^5.7.3",
3333
"typescript-eslint": "^8.24.1",
34-
"vitest": "^3.0.6"
34+
"vitest": "^3.0.7"
3535
},
3636
"packageManager": "[email protected]",
3737
"engines": {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"devDependencies": {
4545
"@types/cross-spawn": "^6.0.6",
46-
"@types/node": "22.13.4",
46+
"@types/node": "22.13.5",
4747
"@types/react": "^19.0.10",
4848
"eslint-config-custom": "workspace:*",
4949
"fast-glob": "^3.3.3",

packages/content-collections/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"devDependencies": {
3838
"@content-collections/core": "^0.8.0",
3939
"@content-collections/mdx": "^0.2.0",
40-
"@types/node": "22.13.4",
40+
"@types/node": "22.13.5",
4141
"eslint-config-custom": "workspace:*",
4242
"fumadocs-core": "workspace:*",
4343
"tsconfig": "workspace:*",

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"@shikijs/transformers": "^3.0.0",
103103
"github-slugger": "^2.0.0",
104104
"hast-util-to-estree": "^3.1.2",
105-
"hast-util-to-jsx-runtime": "^2.3.3",
106-
"image-size": "^1.2.0",
105+
"hast-util-to-jsx-runtime": "^2.3.5",
106+
"image-size": "^2.0.0",
107107
"negotiator": "^1.0.0",
108108
"react-remove-scroll": "^2.6.3",
109109
"remark": "^15.0.0",
@@ -121,7 +121,7 @@
121121
"@types/hast": "^3.0.4",
122122
"@types/mdast": "^4.0.3",
123123
"@types/negotiator": "^0.6.3",
124-
"@types/node": "22.13.4",
124+
"@types/node": "22.13.5",
125125
"@types/react": "^19.0.10",
126126
"@types/react-dom": "^19.0.4",
127127
"algoliasearch": "4.24.0",

packages/core/src/mdx-plugins/remark-image.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import * as path from 'node:path';
22
import type { Root } from 'mdast';
33
import type { Transformer } from 'unified';
44
import { visit } from 'unist-util-visit';
5-
import sizeOf from 'image-size';
6-
import { type ISizeCalculationResult } from 'image-size/dist/types/interface';
5+
import { imageSize } from 'image-size';
76
import type { MdxjsEsm } from 'mdast-util-mdxjs-esm';
87
import { resolvePath, slash } from '@/utils/path';
8+
import type { ISizeCalculationResult } from 'image-size/types/interface';
9+
import { imageSizeFromFile } from 'image-size/fromFile';
910

1011
const VALID_BLUR_EXT = ['.jpeg', '.png', '.webp', '.avif', '.jpg'];
1112
const EXTERNAL_URL_REGEX = /^https?:\/\//;
@@ -211,10 +212,10 @@ async function getImageSize(
211212
base.pathname = resolvePath(base.pathname, src);
212213
url = base.toString();
213214
} else {
214-
return sizeOf(isRelative ? path.join(dir, src) : src);
215+
return imageSizeFromFile(isRelative ? path.join(dir, src) : src);
215216
}
216217

217218
const buffer = await fetch(url).then((res) => res.arrayBuffer());
218219

219-
return sizeOf(new Uint8Array(buffer));
220+
return imageSize(new Uint8Array(buffer));
220221
}

packages/create-app-versions/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"@content-collections/core": "^0.8.0",
99
"@content-collections/mdx": "^0.2.0",
1010
"@content-collections/next": "^0.2.4",
11-
"@tailwindcss/postcss": "^4.0.7",
11+
"@tailwindcss/postcss": "^4.0.9",
1212
"@types/mdx": "^2.0.13",
13-
"@types/node": "22.13.4",
13+
"@types/node": "22.13.5",
1414
"@types/react": "^19.0.10",
1515
"@types/react-dom": "^19.0.4",
1616
"next": "15.1.7",
1717
"postcss": "^8.5.3",
1818
"react": "^19.0.0",
1919
"react-dom": "^19.0.0",
20-
"tailwindcss": "^4.0.7",
20+
"tailwindcss": "^4.0.9",
2121
"typescript": "^5.7.3"
2222
}
2323
}

packages/create-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"devDependencies": {
3535
"@types/cross-spawn": "^6.0.6",
36-
"@types/node": "22.13.4",
36+
"@types/node": "22.13.5",
3737
"eslint-config-custom": "workspace:*",
3838
"fast-glob": "^3.3.3",
3939
"tsconfig": "workspace:*"

0 commit comments

Comments
 (0)