astro 4.3.1 → 4.3.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,4 +1,4 @@
1
- const ASTRO_VERSION = "4.3.1";
1
+ const ASTRO_VERSION = "4.3.2";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -23,7 +23,7 @@ async function dev(inlineConfig) {
23
23
  base: restart.container.settings.config.base
24
24
  })
25
25
  );
26
- const currentVersion = "4.3.1";
26
+ const currentVersion = "4.3.2";
27
27
  if (currentVersion.includes("-")) {
28
28
  logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
29
29
  }
@@ -36,7 +36,7 @@ function serverStart({
36
36
  host,
37
37
  base
38
38
  }) {
39
- const version = "4.3.1";
39
+ const version = "4.3.2";
40
40
  const localPrefix = `${dim("\u2503")} Local `;
41
41
  const networkPrefix = `${dim("\u2503")} Network `;
42
42
  const emptyPrefix = " ".repeat(11);
@@ -261,7 +261,7 @@ function printHelp({
261
261
  message.push(
262
262
  linebreak(),
263
263
  ` ${bgGreen(black(` ${commandName} `))} ${green(
264
- `v${"4.3.1"}`
264
+ `v${"4.3.2"}`
265
265
  )} ${headline}`
266
266
  );
267
267
  }
@@ -6,6 +6,17 @@ import { stripBase } from "./util.js";
6
6
  const HAS_FILE_EXTENSION_REGEXP = /^.*\.[^\\]+$/;
7
7
  function vitePluginAstroPreview(settings) {
8
8
  const { base, outDir, trailingSlash } = settings.config;
9
+ function handle404(req, res) {
10
+ const errorPagePath = fileURLToPath(outDir + "/404.html");
11
+ if (fs.existsSync(errorPagePath)) {
12
+ res.statusCode = 404;
13
+ res.setHeader("Content-Type", "text/html;charset=utf-8");
14
+ res.end(fs.readFileSync(errorPagePath));
15
+ } else {
16
+ res.statusCode = 404;
17
+ res.end(notFoundTemplate(req.url, "Not Found"));
18
+ }
19
+ }
9
20
  return {
10
21
  name: "astro:preview",
11
22
  apply: "serve",
@@ -31,6 +42,11 @@ function vitePluginAstroPreview(settings) {
31
42
  return;
32
43
  }
33
44
  }
45
+ for (const middleware of server.middlewares.stack) {
46
+ if (middleware.handle.name === "vite404Middleware") {
47
+ middleware.handle = handle404;
48
+ }
49
+ }
34
50
  next();
35
51
  });
36
52
  return () => {
@@ -52,21 +68,6 @@ function vitePluginAstroPreview(settings) {
52
68
  }
53
69
  next();
54
70
  });
55
- for (const middleware of server.middlewares.stack) {
56
- if (middleware.handle.name === "vite404Middleware") {
57
- middleware.handle = (req, res) => {
58
- const errorPagePath = fileURLToPath(outDir + "/404.html");
59
- if (fs.existsSync(errorPagePath)) {
60
- res.statusCode = 404;
61
- res.setHeader("Content-Type", "text/html;charset=utf-8");
62
- res.end(fs.readFileSync(errorPagePath));
63
- } else {
64
- res.statusCode = 404;
65
- res.end(notFoundTemplate(req.url, "Not Found"));
66
- }
67
- };
68
- }
69
- }
70
71
  };
71
72
  }
72
73
  };
@@ -38,7 +38,7 @@ function validateSupportedFeatures(adapterName, featureMap, config, adapterFeatu
38
38
  () => config?.output === "server"
39
39
  );
40
40
  validationResult.assets = validateAssetsFeature(assets, adapterName, config, logger);
41
- if (i18nDomains) {
41
+ if (i18nDomains && config?.experimental?.i18nDomains === true && !config.i18n?.domains) {
42
42
  validationResult.i18nDomains = validateSupportKind(
43
43
  i18nDomains,
44
44
  adapterName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "4.3.1",
3
+ "version": "4.3.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",