astro 5.11.0 → 5.11.2

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.
@@ -1,9 +1,11 @@
1
1
  import { findBox, readUInt32BE, toUTF8String } from "./utils.js";
2
2
  const brandMap = {
3
3
  avif: "avif",
4
+ avis: "avif",
5
+ // avif-sequence
4
6
  mif1: "heif",
5
7
  msf1: "heif",
6
- // hief-sequence
8
+ // heif-sequence
7
9
  heic: "heic",
8
10
  heix: "heic",
9
11
  hevc: "heic",
@@ -19,7 +21,7 @@ function detectBrands(buffer, start, end) {
19
21
  brandsDetected[brand] = 1;
20
22
  }
21
23
  }
22
- if ("avif" in brandsDetected) {
24
+ if ("avif" in brandsDetected || "avis" in brandsDetected) {
23
25
  return "avif";
24
26
  } else if ("heic" in brandsDetected || "heix" in brandsDetected || "hevc" in brandsDetected || "hevx" in brandsDetected) {
25
27
  return "heic";
@@ -323,15 +323,12 @@ ${list}`
323
323
  )
324
324
  );
325
325
  if (integrations.find((integration) => integration.integrationName === "tailwind")) {
326
- const code = boxen(
327
- getDiffContent("---\n---", "---\nimport './src/styles/global.css'\n---"),
328
- {
329
- margin: 0.5,
330
- padding: 0.5,
331
- borderStyle: "round",
332
- title: "src/layouts/Layout.astro"
333
- }
334
- );
326
+ const code = boxen(getDiffContent("---\n---", "---\nimport '../styles/global.css'\n---"), {
327
+ margin: 0.5,
328
+ padding: 0.5,
329
+ borderStyle: "round",
330
+ title: "src/layouts/Layout.astro"
331
+ });
335
332
  logger.warn(
336
333
  "SKIP_FORMAT",
337
334
  msg.actionRequired(
@@ -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.11.0") {
167
+ if (previousAstroVersion && previousAstroVersion !== "5.11.2") {
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.11.0") {
176
- await this.#store.metaStore().set("astro-version", "5.11.0");
175
+ if ("5.11.2") {
176
+ await this.#store.metaStore().set("astro-version", "5.11.2");
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.11.0";
1
+ const ASTRO_VERSION = "5.11.2";
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.11.0";
25
+ const currentVersion = "5.11.2";
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.11.0";
40
+ const version = "5.11.2";
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.11.0"}`
277
+ `v${"5.11.2"}`
278
278
  )} ${headline}`
279
279
  );
280
280
  }
@@ -32,5 +32,5 @@ export declare class TransitionBeforeSwapEvent extends BeforeEvent {
32
32
  constructor(afterPreparation: BeforeEvent, viewTransition: ViewTransition);
33
33
  }
34
34
  export declare function doPreparation(from: URL, to: URL, direction: Direction | string, navigationType: NavigationTypeString, sourceElement: Element | undefined, info: any, signal: AbortSignal, formData: FormData | undefined, defaultLoader: (event: TransitionBeforePreparationEvent) => Promise<void>): Promise<TransitionBeforePreparationEvent>;
35
- export declare function doSwap(afterPreparation: BeforeEvent, viewTransition: ViewTransition): TransitionBeforeSwapEvent;
35
+ export declare function doSwap(afterPreparation: BeforeEvent, viewTransition: ViewTransition, afterDispatch?: () => Promise<void>): Promise<TransitionBeforeSwapEvent>;
36
36
  export {};
@@ -115,9 +115,12 @@ async function doPreparation(from, to, direction, navigationType, sourceElement,
115
115
  }
116
116
  return event;
117
117
  }
118
- function doSwap(afterPreparation, viewTransition) {
118
+ async function doSwap(afterPreparation, viewTransition, afterDispatch) {
119
119
  const event = new TransitionBeforeSwapEvent(afterPreparation, viewTransition);
120
120
  document.dispatchEvent(event);
121
+ if (afterDispatch) {
122
+ await afterDispatch();
123
+ }
121
124
  event.swap();
122
125
  return event;
123
126
  }
@@ -195,14 +195,20 @@ async function updateDOM(preparationEvent, options, currentTransition, historySt
195
195
  );
196
196
  return Promise.allSettled(newAnimations.map((a) => a.finished));
197
197
  }
198
- if (fallback === "animate" && !currentTransition.transitionSkipped && !preparationEvent.signal.aborted) {
199
- try {
200
- await animate("old");
201
- } catch {
198
+ const animateFallbackOld = async () => {
199
+ if (fallback === "animate" && !currentTransition.transitionSkipped && !preparationEvent.signal.aborted) {
200
+ try {
201
+ await animate("old");
202
+ } catch {
203
+ }
202
204
  }
203
- }
205
+ };
204
206
  const pageTitleForBrowserHistory = document.title;
205
- const swapEvent = doSwap(preparationEvent, currentTransition.viewTransition);
207
+ const swapEvent = await doSwap(
208
+ preparationEvent,
209
+ currentTransition.viewTransition,
210
+ animateFallbackOld
211
+ );
206
212
  moveToLocation(swapEvent.to, swapEvent.from, options, pageTitleForBrowserHistory, historyState);
207
213
  triggerEvent(TRANSITION_AFTER_SWAP);
208
214
  if (fallback === "animate") {
@@ -4,8 +4,9 @@ const getConfigAlias = (settings) => {
4
4
  const { tsConfig, tsConfigPath } = settings;
5
5
  if (!tsConfig || !tsConfigPath || !tsConfig.compilerOptions) return null;
6
6
  const { baseUrl, paths } = tsConfig.compilerOptions;
7
- if (!baseUrl) return null;
8
- const resolvedBaseUrl = path.resolve(path.dirname(tsConfigPath), baseUrl);
7
+ const effectiveBaseUrl = baseUrl ?? (paths ? "." : void 0);
8
+ if (!effectiveBaseUrl) return null;
9
+ const resolvedBaseUrl = path.resolve(path.dirname(tsConfigPath), effectiveBaseUrl);
9
10
  const aliases = [];
10
11
  if (paths) {
11
12
  for (const [alias, values] of Object.entries(paths)) {
@@ -21,10 +22,12 @@ const getConfigAlias = (settings) => {
21
22
  }
22
23
  }
23
24
  }
24
- aliases.push({
25
- find: /^(?!\.*\/|\.*$|\w:)(.+)$/,
26
- replacement: `${[...normalizePath(resolvedBaseUrl)].map((segment) => segment === "$" ? "$$" : segment).join("")}/$1`
27
- });
25
+ if (baseUrl) {
26
+ aliases.push({
27
+ find: /^(?!\.*\/|\.*$|\w:)(.+)$/,
28
+ replacement: `${[...normalizePath(resolvedBaseUrl)].map((segment) => segment === "$" ? "$$" : segment).join("")}/$1`
29
+ });
30
+ }
28
31
  return aliases;
29
32
  };
30
33
  function configAliasVitePlugin({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "5.11.0",
3
+ "version": "5.11.2",
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,8 +158,8 @@
158
158
  "zod-to-json-schema": "^3.24.5",
159
159
  "zod-to-ts": "^1.2.0",
160
160
  "@astrojs/internal-helpers": "0.6.1",
161
- "@astrojs/markdown-remark": "6.3.2",
162
- "@astrojs/telemetry": "3.3.0"
161
+ "@astrojs/telemetry": "3.3.0",
162
+ "@astrojs/markdown-remark": "6.3.2"
163
163
  },
164
164
  "optionalDependencies": {
165
165
  "sharp": "^0.33.3"