astro 2.0.10 → 2.0.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.
@@ -5,7 +5,6 @@ import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  import { normalizePath } from "vite";
6
6
  import { z } from "zod";
7
7
  import { AstroError, AstroErrorData } from "../core/errors/index.js";
8
- import { appendForwardSlash } from "../core/path.js";
9
8
  import { contentFileExts, CONTENT_TYPES_FILE } from "./consts.js";
10
9
  const collectionConfigParser = z.object({
11
10
  schema: z.any().optional()
@@ -104,10 +103,9 @@ function getEntryInfo({
104
103
  return res;
105
104
  }
106
105
  function getEntryType(entryPath, paths) {
107
- const { dir: rawDir, ext, base } = path.parse(entryPath);
108
- const dir = appendForwardSlash(pathToFileURL(rawDir).href);
109
- const fileUrl = new URL(base, dir);
110
- if (hasUnderscoreInPath(fileUrl) || isOnIgnoreList(fileUrl)) {
106
+ const { ext, base } = path.parse(entryPath);
107
+ const fileUrl = pathToFileURL(entryPath);
108
+ if (hasUnderscoreInPath(fileUrl) || isOnIgnoreList(base)) {
111
109
  return "ignored";
112
110
  } else if (contentFileExts.includes(ext)) {
113
111
  return "content";
@@ -117,9 +115,8 @@ function getEntryType(entryPath, paths) {
117
115
  return "unsupported";
118
116
  }
119
117
  }
120
- function isOnIgnoreList(fileUrl) {
121
- const { base } = path.parse(fileURLToPath(fileUrl));
122
- return [".DS_Store"].includes(base);
118
+ function isOnIgnoreList(fileName) {
119
+ return [".DS_Store"].includes(fileName);
123
120
  }
124
121
  function hasUnderscoreInPath(fileUrl) {
125
122
  const parts = fileUrl.pathname.split("/");
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "2.0.10";
1
+ const ASTRO_VERSION = "2.0.11";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -5,7 +5,7 @@ import * as msg from "../messages.js";
5
5
  import { startContainer } from "./container.js";
6
6
  import { createContainerWithAutomaticRestart } from "./restart.js";
7
7
  async function dev(settings, options) {
8
- var _a, _b;
8
+ var _a, _b, _c;
9
9
  const devStart = performance.now();
10
10
  await options.telemetry.record([]);
11
11
  const restart = await createContainerWithAutomaticRestart({
@@ -14,6 +14,7 @@ async function dev(settings, options) {
14
14
  beforeRestart: () => console.clear(),
15
15
  params: {
16
16
  settings,
17
+ root: (_a = options.flags) == null ? void 0 : _a.root,
17
18
  logging: options.logging,
18
19
  isRestart: options.isRestart
19
20
  }
@@ -30,11 +31,11 @@ async function dev(settings, options) {
30
31
  isRestart: options.isRestart
31
32
  })
32
33
  );
33
- const currentVersion = "2.0.10";
34
+ const currentVersion = "2.0.11";
34
35
  if (currentVersion.includes("-")) {
35
36
  warn(options.logging, null, msg.prerelease({ currentVersion }));
36
37
  }
37
- if (((_b = (_a = restart.container.viteConfig.server) == null ? void 0 : _a.fs) == null ? void 0 : _b.strict) === false) {
38
+ if (((_c = (_b = restart.container.viteConfig.server) == null ? void 0 : _b.fs) == null ? void 0 : _c.strict) === false) {
38
39
  warn(options.logging, null, msg.fsStrictWarning());
39
40
  }
40
41
  await attachContentServerListeners(restart.container);
@@ -47,7 +47,7 @@ function serverStart({
47
47
  base,
48
48
  isRestart = false
49
49
  }) {
50
- const version = "2.0.10";
50
+ const version = "2.0.11";
51
51
  const localPrefix = `${dim("\u2503")} Local `;
52
52
  const networkPrefix = `${dim("\u2503")} Network `;
53
53
  const emptyPrefix = " ".repeat(11);
@@ -233,7 +233,7 @@ function printHelp({
233
233
  message.push(
234
234
  linebreak(),
235
235
  ` ${bgGreen(black(` ${commandName} `))} ${green(
236
- `v${"2.0.10"}`
236
+ `v${"2.0.11"}`
237
237
  )} ${headline}`
238
238
  );
239
239
  }
@@ -50,12 +50,19 @@ function stringifyChunk(result, chunk) {
50
50
  }
51
51
  break;
52
52
  }
53
- case ScopeFlags.Slot: {
53
+ case ScopeFlags.Slot:
54
+ case ScopeFlags.Slot | ScopeFlags.HeadBuffer: {
54
55
  if (hasScopeFlag(result, ScopeFlags.RenderSlot)) {
55
56
  return "";
56
57
  }
57
58
  break;
58
59
  }
60
+ case ScopeFlags.HeadBuffer: {
61
+ if (hasScopeFlag(result, ScopeFlags.JSX | ScopeFlags.HeadBuffer)) {
62
+ return "";
63
+ }
64
+ break;
65
+ }
59
66
  case ScopeFlags.RenderSlot | ScopeFlags.Astro:
60
67
  case ScopeFlags.RenderSlot | ScopeFlags.Astro | ScopeFlags.JSX:
61
68
  case ScopeFlags.RenderSlot | ScopeFlags.Astro | ScopeFlags.JSX | ScopeFlags.HeadBuffer: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "2.0.10",
3
+ "version": "2.0.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",