astro 5.7.9 → 5.7.11

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.
@@ -45,12 +45,12 @@ function createCapsizeFontMetricsResolver({
45
45
  const descentOverride = Math.abs(metrics.descent) / adjustedEmSquare;
46
46
  const lineGapOverride = metrics.lineGap / adjustedEmSquare;
47
47
  return cssRenderer.generateFontFace(fallbackName, {
48
+ ...properties,
48
49
  src: renderFontSrc([{ name: fallbackFontName }]),
49
50
  "size-adjust": toPercentage(sizeAdjust),
50
51
  "ascent-override": toPercentage(ascentOverride),
51
52
  "descent-override": toPercentage(descentOverride),
52
- "line-gap-override": toPercentage(lineGapOverride),
53
- ...properties
53
+ "line-gap-override": toPercentage(lineGapOverride)
54
54
  });
55
55
  }
56
56
  };
@@ -1,4 +1,5 @@
1
1
  import type { Storage } from 'unstorage';
2
+ import type { Logger } from '../../core/logger/core.js';
2
3
  import type { CssRenderer, FontMetricsResolver, FontTypeExtractor, Hasher, LocalProviderUrlResolver, RemoteFontProviderResolver, SystemFallbacksProvider, UrlProxy } from './definitions.js';
3
4
  import type { ConsumableMap, CreateUrlProxyParams, Defaults, FontFamily, FontFileDataMap } from './types.js';
4
5
  /**
@@ -19,7 +20,7 @@ import type { ConsumableMap, CreateUrlProxyParams, Defaults, FontFamily, FontFil
19
20
  *
20
21
  * Once that's done, the collected data is returned
21
22
  */
22
- export declare function orchestrate({ families, hasher, remoteFontProviderResolver, localProviderUrlResolver, storage, cssRenderer, systemFallbacksProvider, fontMetricsResolver, fontTypeExtractor, createUrlProxy, defaults, }: {
23
+ export declare function orchestrate({ families, hasher, remoteFontProviderResolver, localProviderUrlResolver, storage, cssRenderer, systemFallbacksProvider, fontMetricsResolver, fontTypeExtractor, logger, createUrlProxy, defaults, }: {
23
24
  families: Array<FontFamily>;
24
25
  hasher: Hasher;
25
26
  remoteFontProviderResolver: RemoteFontProviderResolver;
@@ -29,6 +30,7 @@ export declare function orchestrate({ families, hasher, remoteFontProviderResolv
29
30
  systemFallbacksProvider: SystemFallbacksProvider;
30
31
  fontMetricsResolver: FontMetricsResolver;
31
32
  fontTypeExtractor: FontTypeExtractor;
33
+ logger: Logger;
32
34
  createUrlProxy: (params: CreateUrlProxyParams) => UrlProxy;
33
35
  defaults: Defaults;
34
36
  }): Promise<{
@@ -1,3 +1,4 @@
1
+ import { bold } from "kleur/colors";
1
2
  import * as unifont from "unifont";
2
3
  import { LOCAL_PROVIDER_NAME } from "./constants.js";
3
4
  import { extractUnifontProviders } from "./logic/extract-unifont-providers.js";
@@ -16,6 +17,7 @@ async function orchestrate({
16
17
  systemFallbacksProvider,
17
18
  fontMetricsResolver,
18
19
  fontTypeExtractor,
20
+ logger,
19
21
  createUrlProxy,
20
22
  defaults
21
23
  }) {
@@ -81,6 +83,12 @@ async function orchestrate({
81
83
  // from families (inside extractUnifontProviders).
82
84
  [family.provider.name]
83
85
  );
86
+ if (result.fonts.length === 0) {
87
+ logger.warn(
88
+ "assets",
89
+ `No data found for font family ${bold(family.name)}. Review your configuration`
90
+ );
91
+ }
84
92
  fonts = normalizeRemoteFontFaces({ fonts: result.fonts, urlProxy });
85
93
  }
86
94
  for (const data of fonts) {
@@ -108,6 +108,7 @@ function fontsPlugin({ settings, sync, logger }) {
108
108
  systemFallbacksProvider,
109
109
  fontMetricsResolver,
110
110
  fontTypeExtractor,
111
+ logger,
111
112
  createUrlProxy: ({ local, ...params }) => {
112
113
  const dataCollector = createDataCollector(params);
113
114
  const contentResolver = local ? createLocalUrlProxyContentResolver({ errorHandler }) : createRemoteUrlProxyContentResolver();
@@ -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.9") {
156
+ if (previousAstroVersion && previousAstroVersion !== "5.7.11") {
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.9") {
165
- await this.#store.metaStore().set("astro-version", "5.7.9");
164
+ if ("5.7.11") {
165
+ await this.#store.metaStore().set("astro-version", "5.7.11");
166
166
  }
167
167
  if (currentConfigDigest) {
168
168
  await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
@@ -1,10 +1,14 @@
1
1
  import { promises as fs, existsSync } from "node:fs";
2
2
  import { fileURLToPath } from "node:url";
3
3
  import yaml from "js-yaml";
4
+ import { AstroError } from "../../core/errors/index.js";
4
5
  import { posixRelative } from "../utils.js";
5
6
  function file(fileName, options) {
6
7
  if (fileName.includes("*")) {
7
- throw new Error("Glob patterns are not supported in `file` loader. Use `glob` loader instead.");
8
+ throw new AstroError({
9
+ name: "Glob Pattern Error",
10
+ message: "Glob patterns are not supported in `file` loader. Use `glob` loader instead."
11
+ });
8
12
  }
9
13
  let parse = null;
10
14
  const ext = fileName.split(".").at(-1);
@@ -17,9 +21,10 @@ function file(fileName, options) {
17
21
  }
18
22
  if (options?.parser) parse = options.parser;
19
23
  if (parse === null) {
20
- throw new Error(
21
- `No parser found for file '${fileName}'. Try passing a parser to the \`file\` loader.`
22
- );
24
+ throw new AstroError({
25
+ name: "Parser Not Found",
26
+ message: `No parser found for file '${fileName}'. Try passing a parser to the \`file\` loader.`
27
+ });
23
28
  }
24
29
  async function syncData(filePath, { logger, parseData, store, config }) {
25
30
  let data;
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "5.7.9";
1
+ const ASTRO_VERSION = "5.7.11";
2
2
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
3
3
  const REWRITE_DIRECTIVE_HEADER_KEY = "X-Astro-Rewrite";
4
4
  const REWRITE_DIRECTIVE_HEADER_VALUE = "yes";
@@ -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.9";
25
+ const currentVersion = "5.7.11";
26
26
  const isPrerelease = currentVersion.includes("-");
27
27
  if (!isPrerelease) {
28
28
  try {
@@ -37,7 +37,7 @@ function serverStart({
37
37
  host,
38
38
  base
39
39
  }) {
40
- const version = "5.7.9";
40
+ const version = "5.7.11";
41
41
  const localPrefix = `${dim("\u2503")} Local `;
42
42
  const networkPrefix = `${dim("\u2503")} Network `;
43
43
  const emptyPrefix = " ".repeat(11);
@@ -274,7 +274,7 @@ function printHelp({
274
274
  message.push(
275
275
  linebreak(),
276
276
  ` ${bgGreen(black(` ${commandName} `))} ${green(
277
- `v${"5.7.9"}`
277
+ `v${"5.7.11"}`
278
278
  )} ${headline}`
279
279
  );
280
280
  }
@@ -155,7 +155,6 @@ class RenderContext {
155
155
  }
156
156
  this.isRewriting = true;
157
157
  this.url = new URL(this.request.url);
158
- this.cookies = new AstroCookies(this.request);
159
158
  this.params = getParams(routeData, pathname);
160
159
  this.pathname = pathname;
161
160
  this.status = 200;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "5.7.9",
3
+ "version": "5.7.11",
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",
@@ -142,11 +142,11 @@
142
142
  "tinyglobby": "^0.2.12",
143
143
  "tsconfck": "^3.1.5",
144
144
  "ultrahtml": "^1.6.0",
145
- "unifont": "~0.4.1",
145
+ "unifont": "~0.5.0",
146
146
  "unist-util-visit": "^5.0.0",
147
147
  "unstorage": "^1.15.0",
148
148
  "vfile": "^6.0.3",
149
- "vite": "^6.2.6",
149
+ "vite": "^6.3.4",
150
150
  "vitefu": "^1.0.6",
151
151
  "xxhash-wasm": "^1.1.0",
152
152
  "yargs-parser": "^21.1.1",
@@ -45,22 +45,7 @@ declare module 'astro:content' {
45
45
  has: (key: string) => boolean;
46
46
  }
47
47
 
48
- type BaseAtomicSchema = import('astro/zod').AnyZodObject;
49
-
50
- type BaseCompositeSchema =
51
- | import('astro/zod').ZodUnion<[BaseAtomicSchema, ...BaseAtomicSchema[]]>
52
- | import('astro/zod').ZodDiscriminatedUnion<string, BaseAtomicSchema[]>
53
- // If we have a union of unions, give up on trying to type-check it all. You're on your own.
54
- | import('astro/zod').ZodUnion<[import('astro/zod').ZodUnion<z.any>, ...z.any[]]>;
55
-
56
- type BaseSchemaWithoutEffects =
57
- | BaseAtomicSchema
58
- | BaseCompositeSchema
59
- | import('astro/zod').ZodIntersection<BaseAtomicSchema, BaseAtomicSchema | BaseCompositeSchema>;
60
-
61
- export type BaseSchema =
62
- | BaseSchemaWithoutEffects
63
- | import('astro/zod').ZodEffects<BaseSchemaWithoutEffects>;
48
+ export type BaseSchema = import('astro/zod').ZodType;
64
49
 
65
50
  export type SchemaContext = { image: ImageFunction };
66
51