astro 5.7.2 → 5.7.3
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/assets/fonts/constants.d.ts +1 -0
- package/dist/assets/fonts/constants.js +8 -0
- package/dist/assets/fonts/providers/local.js +2 -1
- package/dist/assets/fonts/utils.js +9 -10
- package/dist/content/content-layer.js +3 -3
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/package.json +3 -3
|
@@ -11,6 +11,7 @@ export declare const RESOLVED_VIRTUAL_MODULE_ID: string;
|
|
|
11
11
|
export declare const URL_PREFIX = "/_astro/fonts/";
|
|
12
12
|
export declare const CACHE_DIR = "./fonts/";
|
|
13
13
|
export declare const FONT_TYPES: readonly ["woff2", "woff", "otf", "ttf", "eot"];
|
|
14
|
+
export declare const FONT_FORMAT_MAP: Record<(typeof FONT_TYPES)[number], string>;
|
|
14
15
|
export declare const SYSTEM_METRICS: {
|
|
15
16
|
'Times New Roman': {
|
|
16
17
|
ascent: number;
|
|
@@ -12,6 +12,13 @@ const RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
|
|
|
12
12
|
const URL_PREFIX = "/_astro/fonts/";
|
|
13
13
|
const CACHE_DIR = "./fonts/";
|
|
14
14
|
const FONT_TYPES = ["woff2", "woff", "otf", "ttf", "eot"];
|
|
15
|
+
const FONT_FORMAT_MAP = {
|
|
16
|
+
woff2: "woff2",
|
|
17
|
+
woff: "woff",
|
|
18
|
+
otf: "opentype",
|
|
19
|
+
ttf: "truetype",
|
|
20
|
+
eot: "embedded-opentype"
|
|
21
|
+
};
|
|
15
22
|
const SYSTEM_METRICS = {
|
|
16
23
|
"Times New Roman": {
|
|
17
24
|
ascent: 1825,
|
|
@@ -84,6 +91,7 @@ export {
|
|
|
84
91
|
DEFAULTS,
|
|
85
92
|
DEFAULT_FALLBACKS,
|
|
86
93
|
FONTS_TYPES_FILE,
|
|
94
|
+
FONT_FORMAT_MAP,
|
|
87
95
|
FONT_TYPES,
|
|
88
96
|
LOCAL_PROVIDER_NAME,
|
|
89
97
|
RESOLVED_VIRTUAL_MODULE_ID,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FONT_FORMAT_MAP } from "../constants.js";
|
|
1
2
|
import { extractFontType } from "../utils.js";
|
|
2
3
|
function resolveLocalFont({ family, proxyURL }) {
|
|
3
4
|
const fonts = [];
|
|
@@ -9,7 +10,7 @@ function resolveLocalFont({ family, proxyURL }) {
|
|
|
9
10
|
return {
|
|
10
11
|
originalURL,
|
|
11
12
|
url: proxyURL(originalURL),
|
|
12
|
-
format: extractFontType(originalURL),
|
|
13
|
+
format: FONT_FORMAT_MAP[extractFontType(originalURL)],
|
|
13
14
|
tech
|
|
14
15
|
};
|
|
15
16
|
})
|
|
@@ -30,11 +30,11 @@ function renderFontSrc(sources) {
|
|
|
30
30
|
return sources.map((src) => {
|
|
31
31
|
if ("url" in src) {
|
|
32
32
|
let rendered = `url("${src.url}")`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
33
|
+
if (src.format) {
|
|
34
|
+
rendered += ` format("${src.format}")`;
|
|
35
|
+
}
|
|
36
|
+
if (src.tech) {
|
|
37
|
+
rendered += ` tech(${src.tech})`;
|
|
38
38
|
}
|
|
39
39
|
return rendered;
|
|
40
40
|
}
|
|
@@ -200,13 +200,12 @@ function familiesToUnifontProviders({
|
|
|
200
200
|
})
|
|
201
201
|
)
|
|
202
202
|
);
|
|
203
|
-
if (hashes.has(hash)) {
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
203
|
unifontProvider._name += `-${hash}`;
|
|
207
204
|
provider.name = unifontProvider._name;
|
|
208
|
-
hashes.
|
|
209
|
-
|
|
205
|
+
if (!hashes.has(hash)) {
|
|
206
|
+
hashes.add(hash);
|
|
207
|
+
providers.push(unifontProvider);
|
|
208
|
+
}
|
|
210
209
|
}
|
|
211
210
|
return { families, providers };
|
|
212
211
|
}
|
|
@@ -153,7 +153,7 @@ ${contentConfig.error.message}`);
|
|
|
153
153
|
logger.info("Content config changed");
|
|
154
154
|
shouldClear = true;
|
|
155
155
|
}
|
|
156
|
-
if (previousAstroVersion && previousAstroVersion !== "5.7.
|
|
156
|
+
if (previousAstroVersion && previousAstroVersion !== "5.7.3") {
|
|
157
157
|
logger.info("Astro version changed");
|
|
158
158
|
shouldClear = true;
|
|
159
159
|
}
|
|
@@ -161,8 +161,8 @@ ${contentConfig.error.message}`);
|
|
|
161
161
|
logger.info("Clearing content store");
|
|
162
162
|
this.#store.clearAll();
|
|
163
163
|
}
|
|
164
|
-
if ("5.7.
|
|
165
|
-
await this.#store.metaStore().set("astro-version", "5.7.
|
|
164
|
+
if ("5.7.3") {
|
|
165
|
+
await this.#store.metaStore().set("astro-version", "5.7.3");
|
|
166
166
|
}
|
|
167
167
|
if (currentConfigDigest) {
|
|
168
168
|
await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "5.7.
|
|
25
|
+
const currentVersion = "5.7.3";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "5.7.
|
|
41
|
+
const version = "5.7.3";
|
|
42
42
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
43
43
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
44
44
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -282,7 +282,7 @@ function printHelp({
|
|
|
282
282
|
message.push(
|
|
283
283
|
linebreak(),
|
|
284
284
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
285
|
-
`v${"5.7.
|
|
285
|
+
`v${"5.7.3"}`
|
|
286
286
|
)} ${headline}`
|
|
287
287
|
);
|
|
288
288
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.3",
|
|
4
4
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "withastro",
|
|
@@ -161,8 +161,8 @@
|
|
|
161
161
|
"zod-to-json-schema": "^3.24.5",
|
|
162
162
|
"zod-to-ts": "^1.2.0",
|
|
163
163
|
"@astrojs/internal-helpers": "0.6.1",
|
|
164
|
-
"@astrojs/
|
|
165
|
-
"@astrojs/
|
|
164
|
+
"@astrojs/markdown-remark": "6.3.1",
|
|
165
|
+
"@astrojs/telemetry": "3.2.0"
|
|
166
166
|
},
|
|
167
167
|
"optionalDependencies": {
|
|
168
168
|
"sharp": "^0.33.3"
|