astro 5.12.2 → 5.12.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.
@@ -57,14 +57,12 @@ async function getImage(options, imageConfig) {
57
57
  };
58
58
  let originalWidth;
59
59
  let originalHeight;
60
- let originalFormat;
61
60
  if (options.inferSize && isRemoteImage(resolvedOptions.src) && isRemotePath(resolvedOptions.src)) {
62
61
  const result = await inferRemoteSize(resolvedOptions.src);
63
62
  resolvedOptions.width ??= result.width;
64
63
  resolvedOptions.height ??= result.height;
65
64
  originalWidth = result.width;
66
65
  originalHeight = result.height;
67
- originalFormat = result.format;
68
66
  delete resolvedOptions.inferSize;
69
67
  }
70
68
  const originalFilePath = isESMImportedImage(resolvedOptions.src) ? resolvedOptions.src.fsPath : void 0;
@@ -75,7 +73,6 @@ async function getImage(options, imageConfig) {
75
73
  if (isESMImportedImage(clonedSrc)) {
76
74
  originalWidth = clonedSrc.width;
77
75
  originalHeight = clonedSrc.height;
78
- originalFormat = clonedSrc.format;
79
76
  }
80
77
  if (originalWidth && originalHeight) {
81
78
  const aspectRatio = originalWidth / originalHeight;
@@ -121,12 +118,12 @@ async function getImage(options, imageConfig) {
121
118
  const validatedOptions = service.validateOptions ? await service.validateOptions(resolvedOptions, imageConfig) : resolvedOptions;
122
119
  const srcSetTransforms = service.getSrcSet ? await service.getSrcSet(validatedOptions, imageConfig) : [];
123
120
  let imageURL = await service.getURL(validatedOptions, imageConfig);
124
- const matchesOriginal = (transform) => transform.width === originalWidth && transform.height === originalHeight && transform.format === originalFormat;
121
+ const matchesValidatedTransform = (transform) => transform.width === validatedOptions.width && transform.height === validatedOptions.height && transform.format === validatedOptions.format;
125
122
  let srcSets = await Promise.all(
126
123
  srcSetTransforms.map(async (srcSet) => {
127
124
  return {
128
125
  transform: srcSet.transform,
129
- url: matchesOriginal(srcSet.transform) ? imageURL : await service.getURL(srcSet.transform, imageConfig),
126
+ url: matchesValidatedTransform(srcSet.transform) ? imageURL : await service.getURL(srcSet.transform, imageConfig),
130
127
  descriptor: srcSet.descriptor,
131
128
  attributes: srcSet.attributes
132
129
  };
@@ -142,7 +139,7 @@ async function getImage(options, imageConfig) {
142
139
  srcSets = srcSetTransforms.map((srcSet) => {
143
140
  return {
144
141
  transform: srcSet.transform,
145
- url: matchesOriginal(srcSet.transform) ? imageURL : globalThis.astroAsset.addStaticImage(srcSet.transform, propsToHash, originalFilePath),
142
+ url: matchesValidatedTransform(srcSet.transform) ? imageURL : globalThis.astroAsset.addStaticImage(srcSet.transform, propsToHash, originalFilePath),
146
143
  descriptor: srcSet.descriptor,
147
144
  attributes: srcSet.attributes
148
145
  };
@@ -164,7 +164,7 @@ ${contentConfig.error.message}`);
164
164
  logger.info("Content config changed");
165
165
  shouldClear = true;
166
166
  }
167
- if (previousAstroVersion && previousAstroVersion !== "5.12.2") {
167
+ if (previousAstroVersion && previousAstroVersion !== "5.12.3") {
168
168
  logger.info("Astro version changed");
169
169
  shouldClear = true;
170
170
  }
@@ -172,8 +172,8 @@ ${contentConfig.error.message}`);
172
172
  logger.info("Clearing content store");
173
173
  this.#store.clearAll();
174
174
  }
175
- if ("5.12.2") {
176
- await this.#store.metaStore().set("astro-version", "5.12.2");
175
+ if ("5.12.3") {
176
+ await this.#store.metaStore().set("astro-version", "5.12.3");
177
177
  }
178
178
  if (currentConfigDigest) {
179
179
  await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "5.12.2";
1
+ const ASTRO_VERSION = "5.12.3";
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.12.2";
25
+ const currentVersion = "5.12.3";
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.12.2";
40
+ const version = "5.12.3";
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.12.2"}`
277
+ `v${"5.12.3"}`
278
278
  )} ${headline}`
279
279
  );
280
280
  }
@@ -13,6 +13,7 @@ function astro({ settings, logger }) {
13
13
  let astroFileToCompileMetadata = /* @__PURE__ */ new Map();
14
14
  const srcRootWeb = config.srcDir.pathname.slice(config.root.pathname.length - 1);
15
15
  const isBrowserPath = (path) => path.startsWith(srcRootWeb) && srcRootWeb !== "/";
16
+ const notAstroComponent = (component) => !component.resolvedPath.endsWith(".astro");
16
17
  const prePlugin = {
17
18
  name: "astro:build",
18
19
  enforce: "pre",
@@ -170,8 +171,10 @@ File: ${id}`
170
171
  const filename = normalizePath(parsedId.filename);
171
172
  const transformResult = await compile(source, filename);
172
173
  const astroMetadata = {
173
- clientOnlyComponents: transformResult.clientOnlyComponents,
174
- hydratedComponents: transformResult.hydratedComponents,
174
+ // Remove Astro components that have been mistakenly given client directives
175
+ // We'll warn the user about this later, but for now we'll prevent them from breaking the build
176
+ clientOnlyComponents: transformResult.clientOnlyComponents.filter(notAstroComponent),
177
+ hydratedComponents: transformResult.hydratedComponents.filter(notAstroComponent),
175
178
  serverComponents: transformResult.serverComponents,
176
179
  scripts: transformResult.scripts,
177
180
  containsHead: transformResult.containsHead,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "5.12.2",
3
+ "version": "5.12.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",
@@ -158,9 +158,9 @@
158
158
  "zod": "^3.24.2",
159
159
  "zod-to-json-schema": "^3.24.5",
160
160
  "zod-to-ts": "^1.2.0",
161
- "@astrojs/internal-helpers": "0.6.1",
161
+ "@astrojs/markdown-remark": "6.3.3",
162
162
  "@astrojs/telemetry": "3.3.0",
163
- "@astrojs/markdown-remark": "6.3.3"
163
+ "@astrojs/internal-helpers": "0.6.1"
164
164
  },
165
165
  "optionalDependencies": {
166
166
  "sharp": "^0.33.3"