@gallop.software/studio 2.3.74 → 2.3.76
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/dist/client/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
12
12
|
}
|
|
13
13
|
</style>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-Cf8-zcDF.js"></script>
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
package/dist/server/index.js
CHANGED
|
@@ -3903,6 +3903,7 @@ async function handleGenerateFavicon(request) {
|
|
|
3903
3903
|
// src/handlers/featured-image.ts
|
|
3904
3904
|
import puppeteer from "puppeteer";
|
|
3905
3905
|
import fs10 from "fs/promises";
|
|
3906
|
+
import sharp6 from "sharp";
|
|
3906
3907
|
function parseEnvFile(content) {
|
|
3907
3908
|
const result = {};
|
|
3908
3909
|
for (const line of content.split("\n")) {
|
|
@@ -3952,7 +3953,7 @@ async function handleGenerateFeaturedImage(request) {
|
|
|
3952
3953
|
const relativePath = `public/${projectName}.jpg`;
|
|
3953
3954
|
sendEvent({
|
|
3954
3955
|
type: "start",
|
|
3955
|
-
total:
|
|
3956
|
+
total: 4,
|
|
3956
3957
|
projectName,
|
|
3957
3958
|
url: homepageUrl,
|
|
3958
3959
|
output: relativePath
|
|
@@ -3960,8 +3961,8 @@ async function handleGenerateFeaturedImage(request) {
|
|
|
3960
3961
|
sendEvent({
|
|
3961
3962
|
type: "progress",
|
|
3962
3963
|
current: 1,
|
|
3963
|
-
total:
|
|
3964
|
-
percent:
|
|
3964
|
+
total: 4,
|
|
3965
|
+
percent: 25,
|
|
3965
3966
|
message: "Launching browser..."
|
|
3966
3967
|
});
|
|
3967
3968
|
const browser = await puppeteer.launch({
|
|
@@ -3972,8 +3973,8 @@ async function handleGenerateFeaturedImage(request) {
|
|
|
3972
3973
|
sendEvent({
|
|
3973
3974
|
type: "progress",
|
|
3974
3975
|
current: 2,
|
|
3975
|
-
total:
|
|
3976
|
-
percent:
|
|
3976
|
+
total: 4,
|
|
3977
|
+
percent: 50,
|
|
3977
3978
|
message: `Navigating to ${homepageUrl}...`
|
|
3978
3979
|
});
|
|
3979
3980
|
const page = await browser.newPage();
|
|
@@ -3991,8 +3992,8 @@ async function handleGenerateFeaturedImage(request) {
|
|
|
3991
3992
|
sendEvent({
|
|
3992
3993
|
type: "progress",
|
|
3993
3994
|
current: 3,
|
|
3994
|
-
total:
|
|
3995
|
-
percent:
|
|
3995
|
+
total: 4,
|
|
3996
|
+
percent: 75,
|
|
3996
3997
|
message: "Taking screenshot..."
|
|
3997
3998
|
});
|
|
3998
3999
|
await page.screenshot({
|
|
@@ -4000,6 +4001,24 @@ async function handleGenerateFeaturedImage(request) {
|
|
|
4000
4001
|
type: "jpeg",
|
|
4001
4002
|
quality: 90
|
|
4002
4003
|
});
|
|
4004
|
+
sendEvent({
|
|
4005
|
+
type: "progress",
|
|
4006
|
+
current: 4,
|
|
4007
|
+
total: 4,
|
|
4008
|
+
percent: 95,
|
|
4009
|
+
message: "Updating metadata..."
|
|
4010
|
+
});
|
|
4011
|
+
const imageBuffer = await fs10.readFile(outputPath);
|
|
4012
|
+
const metadata = await sharp6(imageBuffer).metadata();
|
|
4013
|
+
const width = metadata.width || 0;
|
|
4014
|
+
const height = metadata.height || 0;
|
|
4015
|
+
const meta = await loadMeta();
|
|
4016
|
+
const metaKey = `/${projectName}.jpg`;
|
|
4017
|
+
setMetaEntry(meta, metaKey, {
|
|
4018
|
+
o: { w: width, h: height },
|
|
4019
|
+
f: { w: width, h: height }
|
|
4020
|
+
});
|
|
4021
|
+
await saveMeta(meta);
|
|
4003
4022
|
sendEvent({
|
|
4004
4023
|
type: "complete",
|
|
4005
4024
|
processed: 1,
|
|
@@ -4080,14 +4099,9 @@ async function handleCheckFeaturedImage() {
|
|
|
4080
4099
|
} catch {
|
|
4081
4100
|
}
|
|
4082
4101
|
const expectedFilename = `${projectName}.jpg`;
|
|
4083
|
-
const
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
await fs10.access(expectedPath);
|
|
4087
|
-
exists = true;
|
|
4088
|
-
} catch {
|
|
4089
|
-
exists = false;
|
|
4090
|
-
}
|
|
4102
|
+
const metaKey = `/${projectName}.jpg`;
|
|
4103
|
+
const meta = await loadMeta();
|
|
4104
|
+
const exists = metaKey in meta && !Array.isArray(meta[metaKey]);
|
|
4091
4105
|
return jsonResponse({
|
|
4092
4106
|
filename: expectedFilename,
|
|
4093
4107
|
exists,
|