astro 4.8.0 → 4.8.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.
@@ -27,6 +27,21 @@ if (props.alt === undefined || props.alt === null) {
27
27
  throw new AstroError(AstroErrorData.ImageMissingAlt);
28
28
  }
29
29
 
30
+ // Picture attribute inherit scoped styles from class and attributes
31
+ const scopedStyleClass = props.class?.match(/\bastro-\w{8}\b/)?.[0];
32
+ if (scopedStyleClass) {
33
+ if (pictureAttributes.class) {
34
+ pictureAttributes.class = `${pictureAttributes.class} ${scopedStyleClass}`;
35
+ } else {
36
+ pictureAttributes.class = scopedStyleClass;
37
+ }
38
+ }
39
+ for (const key in props) {
40
+ if (key.startsWith('data-astro-cid')) {
41
+ pictureAttributes[key] = props[key];
42
+ }
43
+ }
44
+
30
45
  const originalSrc = await resolveSrc(props.src);
31
46
  const optimizedImages: GetImageResult[] = await Promise.all(
32
47
  formats.map(
@@ -1968,7 +1968,7 @@ export interface AstroUserConfig {
1968
1968
  *
1969
1969
  * For a complete overview, and to give feedback on this experimental API, see the [Rerouting RFC](https://github.com/withastro/roadmap/blob/feat/reroute/proposals/0047-rerouting.md).
1970
1970
  */
1971
- rewriting: boolean;
1971
+ rewriting?: boolean;
1972
1972
  };
1973
1973
  }
1974
1974
  /**
@@ -1,4 +1,5 @@
1
1
  import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import { viteID } from "../core/util.js";
2
3
  import { ACTIONS_TYPES_FILE, RESOLVED_VIRTUAL_MODULE_ID, VIRTUAL_MODULE_ID } from "./consts.js";
3
4
  function astroActions() {
4
5
  return {
@@ -6,7 +7,7 @@ function astroActions() {
6
7
  hooks: {
7
8
  async "astro:config:setup"(params) {
8
9
  const stringifiedActionsImport = JSON.stringify(
9
- new URL("actions", params.config.srcDir).pathname
10
+ viteID(new URL("./actions", params.config.srcDir))
10
11
  );
11
12
  params.updateConfig({
12
13
  vite: {
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "4.8.0";
1
+ const ASTRO_VERSION = "4.8.2";
2
2
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
3
3
  const ROUTE_TYPE_HEADER = "X-Astro-Route-Type";
4
4
  const DEFAULT_404_COMPONENT = "astro-default-404";
@@ -19,7 +19,7 @@ async function dev(inlineConfig) {
19
19
  await telemetry.record([]);
20
20
  const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
21
21
  const logger = restart.container.logger;
22
- const currentVersion = "4.8.0";
22
+ const currentVersion = "4.8.2";
23
23
  const isPrerelease = currentVersion.includes("-");
24
24
  if (!isPrerelease) {
25
25
  try {
@@ -36,7 +36,7 @@ async function dev(inlineConfig) {
36
36
  }
37
37
  logger.warn(
38
38
  "SKIP_FORMAT",
39
- msg.newVersionAvailable({
39
+ await msg.newVersionAvailable({
40
40
  latestVersion: version
41
41
  })
42
42
  );
@@ -25,7 +25,7 @@ export declare function serverShortcuts({ key, label }: {
25
25
  }): string;
26
26
  export declare function newVersionAvailable({ latestVersion }: {
27
27
  latestVersion: string;
28
- }): string;
28
+ }): Promise<string>;
29
29
  export declare function telemetryNotice(): string;
30
30
  export declare function telemetryEnabled(): string;
31
31
  export declare function preferenceEnabled(name: string): string;
@@ -37,7 +37,7 @@ function serverStart({
37
37
  host,
38
38
  base
39
39
  }) {
40
- const version = "4.8.0";
40
+ const version = "4.8.2";
41
41
  const localPrefix = `${dim("\u2503")} Local `;
42
42
  const networkPrefix = `${dim("\u2503")} Network `;
43
43
  const emptyPrefix = " ".repeat(11);
@@ -70,10 +70,10 @@ function serverStart({
70
70
  function serverShortcuts({ key, label }) {
71
71
  return [dim(" Press"), key, dim("to"), label].join(" ");
72
72
  }
73
- function newVersionAvailable({ latestVersion }) {
73
+ async function newVersionAvailable({ latestVersion }) {
74
74
  const badge = bgYellow(black(` update `));
75
75
  const headline = yellow(`\u25B6 New version of Astro available: ${latestVersion}`);
76
- const execCommand = getExecCommand();
76
+ const execCommand = await getExecCommand();
77
77
  const details = ` Run ${cyan(`${execCommand} @astrojs/upgrade`)} to update`;
78
78
  return ["", `${badge} ${headline}`, details, ""].join("\n");
79
79
  }
@@ -269,7 +269,7 @@ function printHelp({
269
269
  message.push(
270
270
  linebreak(),
271
271
  ` ${bgGreen(black(` ${commandName} `))} ${green(
272
- `v${"4.8.0"}`
272
+ `v${"4.8.2"}`
273
273
  )} ${headline}`
274
274
  );
275
275
  }
@@ -48,7 +48,7 @@ async function matchRoute(pathname, manifestData, pipeline) {
48
48
  throw e;
49
49
  }
50
50
  }
51
- const altPathname = pathname.replace(/(?:index)?\.html$/, "");
51
+ const altPathname = pathname.replace(/\/index\.html$/, "/").replace(/\.html$/, "");
52
52
  if (altPathname !== pathname) {
53
53
  return await matchRoute(altPathname, manifestData, pipeline);
54
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "4.8.0",
3
+ "version": "4.8.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",