@vertz/ui-server 0.2.53 → 0.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/bun-plugin/index.js +12 -5
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @vertz/ui-server
|
|
2
2
|
|
|
3
|
+
## 0.2.55
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @vertz/core@0.2.55
|
|
9
|
+
- @vertz/ui@0.2.55
|
|
10
|
+
|
|
11
|
+
## 0.2.54
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies []:
|
|
16
|
+
- @vertz/core@0.2.54
|
|
17
|
+
- @vertz/ui@0.2.54
|
|
18
|
+
|
|
3
19
|
## 0.2.53
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/bun-plugin/index.js
CHANGED
|
@@ -1648,7 +1648,13 @@ function filePathHash(filePath) {
|
|
|
1648
1648
|
import { createHash } from "crypto";
|
|
1649
1649
|
import { existsSync, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
1650
1650
|
import { basename, extname, resolve as resolve2 } from "path";
|
|
1651
|
-
|
|
1651
|
+
var _sharp;
|
|
1652
|
+
async function getSharp() {
|
|
1653
|
+
if (!_sharp) {
|
|
1654
|
+
_sharp = (await import("sharp")).default;
|
|
1655
|
+
}
|
|
1656
|
+
return _sharp;
|
|
1657
|
+
}
|
|
1652
1658
|
var FORMAT_MAP = {
|
|
1653
1659
|
jpeg: { ext: ".jpg", mime: "image/jpeg" },
|
|
1654
1660
|
jpg: { ext: ".jpg", mime: "image/jpeg" },
|
|
@@ -1666,7 +1672,8 @@ async function processImage(opts) {
|
|
|
1666
1672
|
const sourceBuffer = readFileSync3(sourcePath);
|
|
1667
1673
|
const hash = createHash("sha256").update(sourceBuffer).update(`${width}x${height}q${quality}f${fit}`).digest("hex").slice(0, 12);
|
|
1668
1674
|
const name = basename(sourcePath, extname(sourcePath));
|
|
1669
|
-
const
|
|
1675
|
+
const sharpModule = await getSharp();
|
|
1676
|
+
const meta = await sharpModule(sourceBuffer).metadata();
|
|
1670
1677
|
const sourceFormat = meta.format ?? "jpeg";
|
|
1671
1678
|
const defaultFormat = { ext: ".jpg", mime: "image/jpeg" };
|
|
1672
1679
|
const formatInfo = FORMAT_MAP[sourceFormat] ?? defaultFormat;
|
|
@@ -1691,9 +1698,9 @@ async function processImage(opts) {
|
|
|
1691
1698
|
mkdirSync(outputDir, { recursive: true });
|
|
1692
1699
|
const sharpFit = fit;
|
|
1693
1700
|
const [webp1xBuf, webp2xBuf, fallbackBuf] = await Promise.all([
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1701
|
+
sharpModule(sourceBuffer).resize(width, height, { fit: sharpFit }).webp({ quality }).toBuffer(),
|
|
1702
|
+
sharpModule(sourceBuffer).resize(width * 2, height * 2, { fit: sharpFit }).webp({ quality }).toBuffer(),
|
|
1703
|
+
sharpModule(sourceBuffer).resize(width * 2, height * 2, { fit: sharpFit }).toFormat(sourceFormat, { quality }).toBuffer()
|
|
1697
1704
|
]);
|
|
1698
1705
|
writeFileSync(webp1xPath, webp1xBuf);
|
|
1699
1706
|
writeFileSync(webp2xPath, webp2xBuf);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.55",
|
|
4
4
|
"description": "Vertz UI server-side rendering runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"@ampproject/remapping": "^2.3.0",
|
|
72
72
|
"@capsizecss/unpack": "^4.0.0",
|
|
73
73
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
74
|
-
"@vertz/core": "
|
|
75
|
-
"@vertz/ui": "
|
|
74
|
+
"@vertz/core": "^0.2.55",
|
|
75
|
+
"@vertz/ui": "^0.2.55",
|
|
76
76
|
"magic-string": "^0.30.0",
|
|
77
77
|
"sharp": "^0.34.5"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@happy-dom/global-registrator": "^20.8.3",
|
|
81
81
|
"@playwright/test": "^1.58.2",
|
|
82
|
-
"@vertz/codegen": "
|
|
82
|
+
"@vertz/codegen": "^0.2.55",
|
|
83
83
|
"bun-types": "^1.3.10",
|
|
84
84
|
"bunup": "^0.16.31",
|
|
85
85
|
"happy-dom": "^20.8.3",
|
|
@@ -88,4 +88,4 @@
|
|
|
88
88
|
"engines": {
|
|
89
89
|
"node": ">=22"
|
|
90
90
|
}
|
|
91
|
-
}
|
|
91
|
+
}
|