astro 4.9.1 → 4.9.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.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  import { type LocalImageProps, type RemoteImageProps, getImage } from 'astro:assets';
3
+ import * as mime from 'mrmime';
3
4
  import type { GetImageResult, ImageOutputFormat } from '../dist/@types/astro';
4
5
  import { isESMImportedImage, resolveSrc } from '../dist/assets/utils/imageKind';
5
6
  import { AstroError, AstroErrorData } from '../dist/core/errors/index.js';
@@ -99,7 +100,7 @@ if (import.meta.env.DEV) {
99
100
  return (
100
101
  <source
101
102
  srcset={srcsetAttribute}
102
- type={'image/' + image.options.format}
103
+ type={mime.lookup(image.options.format ?? image.src) ?? `image/${image.options.format}`}
103
104
  {...sourceAdditionalAttributes}
104
105
  />
105
106
  );
@@ -9,7 +9,7 @@ function getProxyCode(options, isSSR) {
9
9
  if (name === 'fsPath') {
10
10
  return ${stringifiedFSPath};
11
11
  }
12
- ${!isSSR ? `if (target[name] !== undefined) globalThis.astroAsset.referencedImages.add(${stringifiedFSPath});` : ""}
12
+ ${!isSSR ? `if (target[name] !== undefined && globalThis.astroAsset) globalThis.astroAsset?.referencedImages.add(${stringifiedFSPath});` : ""}
13
13
  return target[name];
14
14
  }
15
15
  })
@@ -11,7 +11,7 @@ export declare const visit: {
11
11
  node: (node: traverse.Node, opts: traverse.TraverseOptions<traverse.Node>, scope?: traverse.Scope | undefined, state?: any, path?: traverse.NodePath<traverse.Node> | undefined, skipKeys?: Record<string, boolean> | undefined) => void;
12
12
  clearNode: (node: traverse.Node, opts?: traverse.RemovePropertiesOptions | undefined) => void;
13
13
  removeProperties: (tree: traverse.Node, opts?: traverse.RemovePropertiesOptions | undefined) => traverse.Node;
14
- hasType: (tree: traverse.Node, type: "CatchClause" | "ClassBody" | "Identifier" | "Program" | "SpreadElement" | "Super" | "SwitchCase" | "TemplateElement" | "VariableDeclarator" | "JSXIdentifier" | "JSXNamespacedName" | "JSXMemberExpression" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXSpreadAttribute" | "JSXAttribute" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXFragment" | "JSXText" | "ArrayExpression" | "ArrowFunctionExpression" | "AssignmentExpression" | "AwaitExpression" | "BinaryExpression" | "CallExpression" | "ClassExpression" | "ConditionalExpression" | "FunctionExpression" | "ImportExpression" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "NewExpression" | "ObjectExpression" | "SequenceExpression" | "TaggedTemplateExpression" | "TemplateLiteral" | "ThisExpression" | "UnaryExpression" | "UpdateExpression" | "YieldExpression" | "ClassDeclaration" | "FunctionDeclaration" | "ImportDeclaration" | "ExportNamedDeclaration" | "ExportDefaultDeclaration" | "ExportAllDeclaration" | "ImportSpecifier" | "ImportDefaultSpecifier" | "ImportNamespaceSpecifier" | "ExportSpecifier" | "ObjectPattern" | "ArrayPattern" | "RestElement" | "AssignmentPattern" | "ExpressionStatement" | "BlockStatement" | "StaticBlock" | "EmptyStatement" | "DebuggerStatement" | "WithStatement" | "ReturnStatement" | "LabeledStatement" | "BreakStatement" | "ContinueStatement" | "IfStatement" | "SwitchStatement" | "ThrowStatement" | "TryStatement" | "WhileStatement" | "DoWhileStatement" | "ForStatement" | "ForInStatement" | "ForOfStatement" | "VariableDeclaration" | "File" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayTypeAnnotation" | "BigIntLiteral" | "BindExpression" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "ClassAccessorProperty" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportDefaultSpecifier" | "ExportNamespaceSpecifier" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "Import" | "ImportAttribute" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXSpreadChild" | "MixedTypeAnnotation" | "ModuleExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "ObjectMethod" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "RestProperty" | "SpreadProperty" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "ThisTypeAnnotation" | "TopicReference" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnionTypeAnnotation" | "V8IntrinsicIdentifier" | "Variance" | "VoidTypeAnnotation", denylistTypes?: string[] | undefined) => boolean;
14
+ hasType: (tree: traverse.Node, type: "CatchClause" | "ClassBody" | "Identifier" | "Program" | "SpreadElement" | "Super" | "SwitchCase" | "TemplateElement" | "VariableDeclarator" | "JSXIdentifier" | "JSXNamespacedName" | "JSXMemberExpression" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXSpreadAttribute" | "JSXAttribute" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXFragment" | "JSXText" | "ArrayExpression" | "ArrowFunctionExpression" | "AssignmentExpression" | "AwaitExpression" | "BinaryExpression" | "CallExpression" | "ClassExpression" | "ConditionalExpression" | "FunctionExpression" | "ImportExpression" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "NewExpression" | "ObjectExpression" | "SequenceExpression" | "TaggedTemplateExpression" | "TemplateLiteral" | "ThisExpression" | "UnaryExpression" | "UpdateExpression" | "YieldExpression" | "ClassDeclaration" | "FunctionDeclaration" | "ImportDeclaration" | "ExportNamedDeclaration" | "ExportDefaultDeclaration" | "ExportAllDeclaration" | "ImportSpecifier" | "ImportDefaultSpecifier" | "ImportNamespaceSpecifier" | "ExportSpecifier" | "ObjectPattern" | "ArrayPattern" | "RestElement" | "AssignmentPattern" | "ExpressionStatement" | "BlockStatement" | "StaticBlock" | "EmptyStatement" | "DebuggerStatement" | "WithStatement" | "ReturnStatement" | "LabeledStatement" | "BreakStatement" | "ContinueStatement" | "IfStatement" | "SwitchStatement" | "ThrowStatement" | "TryStatement" | "WhileStatement" | "DoWhileStatement" | "ForStatement" | "ForInStatement" | "ForOfStatement" | "VariableDeclaration" | "File" | "RestProperty" | "SpreadProperty" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayTypeAnnotation" | "BigIntLiteral" | "BindExpression" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "ClassAccessorProperty" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportDefaultSpecifier" | "ExportNamespaceSpecifier" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "Import" | "ImportAttribute" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXSpreadChild" | "MixedTypeAnnotation" | "ModuleExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "ObjectMethod" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "ThisTypeAnnotation" | "TopicReference" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnionTypeAnnotation" | "V8IntrinsicIdentifier" | "Variance" | "VoidTypeAnnotation", denylistTypes?: string[] | undefined) => boolean;
15
15
  cache: typeof traverse.cache;
16
16
  };
17
17
  export { t };
@@ -6,7 +6,7 @@ type GetPackageOptions = {
6
6
  };
7
7
  export declare function getPackage<T>(packageName: string, logger: Logger, options: GetPackageOptions, otherDeps?: string[]): Promise<T | undefined>;
8
8
  /**
9
- * Get the command to execute and download a package (e.g. `npx`, `yarn dlx`, `pnpx`, etc.)
9
+ * Get the command to execute and download a package (e.g. `npx`, `yarn dlx`, `pnpm dlx`, etc.)
10
10
  * @param packageManager - Optional package manager to use. If not provided, Astro will attempt to detect the preferred package manager.
11
11
  * @returns The command to execute and download a package
12
12
  */
@@ -86,7 +86,7 @@ async function getExecCommand(packageManager) {
86
86
  case "yarn":
87
87
  return "yarn dlx";
88
88
  case "pnpm":
89
- return "pnpx";
89
+ return "pnpm dlx";
90
90
  case "bun":
91
91
  return "bunx";
92
92
  default:
@@ -1,4 +1,4 @@
1
- import type { AstroRenderer, AstroUserConfig, RouteType } from '../@types/astro.js';
1
+ import type { AstroRenderer, AstroUserConfig, Props, RouteType } from '../@types/astro.js';
2
2
  import type { AstroComponentFactory } from '../runtime/server/index.js';
3
3
  /**
4
4
  * Options to be passed when rendering a route
@@ -50,6 +50,14 @@ export type ContainerRenderOptions = {
50
50
  * ```
51
51
  */
52
52
  routeType?: RouteType;
53
+ /**
54
+ * Allows to pass `Astro.props` to an Astro component:
55
+ *
56
+ * ```js
57
+ * container.renderToString(Endpoint, { props: { "lorem": "ipsum" } });
58
+ * ```
59
+ */
60
+ props?: Props;
53
61
  };
54
62
  export type AstroContainerUserConfig = Omit<AstroUserConfig, 'integrations' | 'adapter'>;
55
63
  /**
@@ -185,6 +185,9 @@ class experimental_AstroContainer {
185
185
  if (options.params) {
186
186
  renderContext.params = options.params;
187
187
  }
188
+ if (options.props) {
189
+ renderContext.props = options.props;
190
+ }
188
191
  return renderContext.render(componentInstance, slots);
189
192
  }
190
193
  #createRoute(url, params, type) {
@@ -192,7 +192,8 @@ export default {}`
192
192
  const clientComponents = /* @__PURE__ */ new Set([
193
193
  ...oldManifest.clientEntries,
194
194
  ...internals.discoveredHydratedComponents.keys(),
195
- ...internals.discoveredClientOnlyComponents.keys()
195
+ ...internals.discoveredClientOnlyComponents.keys(),
196
+ ...internals.discoveredScripts
196
197
  ]);
197
198
  const serverComponents = /* @__PURE__ */ new Set([
198
199
  ...oldManifest.serverEntries,
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "4.9.1";
1
+ const ASTRO_VERSION = "4.9.3";
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.9.1";
22
+ const currentVersion = "4.9.3";
23
23
  const isPrerelease = currentVersion.includes("-");
24
24
  if (!isPrerelease) {
25
25
  try {
@@ -37,7 +37,7 @@ function serverStart({
37
37
  host,
38
38
  base
39
39
  }) {
40
- const version = "4.9.1";
40
+ const version = "4.9.3";
41
41
  const localPrefix = `${dim("\u2503")} Local `;
42
42
  const networkPrefix = `${dim("\u2503")} Network `;
43
43
  const emptyPrefix = " ".repeat(11);
@@ -269,7 +269,7 @@ function printHelp({
269
269
  message.push(
270
270
  linebreak(),
271
271
  ` ${bgGreen(black(` ${commandName} `))} ${green(
272
- `v${"4.9.1"}`
272
+ `v${"4.9.3"}`
273
273
  )} ${headline}`
274
274
  );
275
275
  }
@@ -1,4 +1,4 @@
1
- import type { APIContext, AstroGlobal, AstroGlobalPartial, ComponentInstance, MiddlewareHandler, RouteData, SSRResult } from '../@types/astro.js';
1
+ import type { APIContext, AstroGlobal, AstroGlobalPartial, ComponentInstance, MiddlewareHandler, Props, RouteData, SSRResult } from '../@types/astro.js';
2
2
  import type { ActionAPIContext } from '../actions/runtime/store.js';
3
3
  import { AstroCookies } from './cookies/index.js';
4
4
  import { type Pipeline } from './render/index.js';
@@ -18,6 +18,7 @@ export declare class RenderContext {
18
18
  protected cookies: AstroCookies;
19
19
  params: import("../@types/astro.js").Params;
20
20
  protected url: URL;
21
+ props: Props;
21
22
  private constructor();
22
23
  /**
23
24
  * A flag that tells the render content if the rewriting was triggered
@@ -21,7 +21,7 @@ import { sequence } from "./middleware/index.js";
21
21
  import { renderRedirect } from "./redirects/render.js";
22
22
  import { Slots, getParams, getProps } from "./render/index.js";
23
23
  class RenderContext {
24
- constructor(pipeline, locals, middleware, pathname, request, routeData, status, cookies = new AstroCookies(request), params = getParams(routeData, pathname), url = new URL(request.url)) {
24
+ constructor(pipeline, locals, middleware, pathname, request, routeData, status, cookies = new AstroCookies(request), params = getParams(routeData, pathname), url = new URL(request.url), props = {}) {
25
25
  this.pipeline = pipeline;
26
26
  this.locals = locals;
27
27
  this.middleware = middleware;
@@ -32,6 +32,7 @@ class RenderContext {
32
32
  this.cookies = cookies;
33
33
  this.params = params;
34
34
  this.url = url;
35
+ this.props = props;
35
36
  }
36
37
  /**
37
38
  * A flag that tells the render content if the rewriting was triggered
@@ -74,7 +75,7 @@ class RenderContext {
74
75
  async render(componentInstance, slots = {}) {
75
76
  const { cookies, middleware, pathname, pipeline } = this;
76
77
  const { logger, routeCache, serverLike, streaming } = pipeline;
77
- const props = await getProps({
78
+ const props = Object.keys(this.props).length > 0 ? this.props : await getProps({
78
79
  mod: componentInstance,
79
80
  routeData: this.routeData,
80
81
  routeCache,
@@ -90,6 +90,20 @@ async function callComponentAsTemplateResultOrResponse(result, componentFactory,
90
90
  const factoryResult = await componentFactory(result, props, children);
91
91
  if (factoryResult instanceof Response) {
92
92
  return factoryResult;
93
+ } else if (isHeadAndContent(factoryResult)) {
94
+ if (!isRenderTemplateResult(factoryResult.content)) {
95
+ throw new AstroError({
96
+ ...AstroErrorData.OnlyResponseCanBeReturned,
97
+ message: AstroErrorData.OnlyResponseCanBeReturned.message(
98
+ route?.route,
99
+ typeof factoryResult
100
+ ),
101
+ location: {
102
+ file: route?.component
103
+ }
104
+ });
105
+ }
106
+ return factoryResult.content;
93
107
  } else if (!isRenderTemplateResult(factoryResult)) {
94
108
  throw new AstroError({
95
109
  ...AstroErrorData.OnlyResponseCanBeReturned,
@@ -99,7 +113,7 @@ async function callComponentAsTemplateResultOrResponse(result, componentFactory,
99
113
  }
100
114
  });
101
115
  }
102
- return isHeadAndContent(factoryResult) ? factoryResult.content : factoryResult;
116
+ return factoryResult;
103
117
  }
104
118
  async function bufferHeadContent(result) {
105
119
  const iterator = result._metadata.propagators.values();
@@ -1,5 +1,5 @@
1
1
  function isPromise(value) {
2
- return !!value && typeof value === "object" && typeof value.then === "function";
2
+ return !!value && typeof value === "object" && "then" in value && typeof value.then === "function";
3
3
  }
4
4
  async function* streamAsyncIterator(stream) {
5
5
  const reader = stream.getReader();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "4.9.1",
3
+ "version": "4.9.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",
@@ -110,12 +110,12 @@
110
110
  ],
111
111
  "dependencies": {
112
112
  "@astrojs/compiler": "^2.8.0",
113
- "@babel/core": "^7.24.5",
114
- "@babel/generator": "^7.24.5",
115
- "@babel/parser": "^7.24.5",
116
- "@babel/plugin-transform-react-jsx": "^7.23.4",
117
- "@babel/traverse": "^7.24.5",
118
- "@babel/types": "^7.24.5",
113
+ "@babel/core": "^7.24.6",
114
+ "@babel/generator": "^7.24.6",
115
+ "@babel/parser": "^7.24.6",
116
+ "@babel/plugin-transform-react-jsx": "^7.24.6",
117
+ "@babel/traverse": "^7.24.6",
118
+ "@babel/types": "^7.24.6",
119
119
  "@types/babel__core": "^7.20.5",
120
120
  "@types/cookie": "^0.6.0",
121
121
  "acorn": "^8.11.3",
@@ -134,8 +134,8 @@
134
134
  "diff": "^5.2.0",
135
135
  "dlv": "^1.1.3",
136
136
  "dset": "^3.1.3",
137
- "es-module-lexer": "^1.5.2",
138
- "esbuild": "^0.21.2",
137
+ "es-module-lexer": "^1.5.3",
138
+ "esbuild": "^0.21.4",
139
139
  "estree-walker": "^3.0.3",
140
140
  "execa": "^8.0.1",
141
141
  "fast-glob": "^3.3.2",
@@ -157,31 +157,31 @@
157
157
  "rehype": "^13.0.1",
158
158
  "resolve": "^1.22.8",
159
159
  "semver": "^7.6.2",
160
- "shiki": "^1.5.1",
160
+ "shiki": "^1.6.1",
161
161
  "string-width": "^7.1.0",
162
162
  "strip-ansi": "^7.1.0",
163
- "tsconfck": "^3.0.3",
163
+ "tsconfck": "^3.1.0",
164
164
  "unist-util-visit": "^5.0.0",
165
165
  "vfile": "^6.0.1",
166
- "vite": "^5.2.11",
166
+ "vite": "^5.2.12",
167
167
  "vitefu": "^0.2.5",
168
- "which-pm": "^2.1.1",
168
+ "which-pm": "^2.2.0",
169
169
  "yargs-parser": "^21.1.1",
170
170
  "zod": "^3.23.8",
171
171
  "zod-to-json-schema": "^3.23.0",
172
172
  "@astrojs/internal-helpers": "0.4.0",
173
- "@astrojs/markdown-remark": "5.1.0",
174
- "@astrojs/telemetry": "3.1.0"
173
+ "@astrojs/telemetry": "3.1.0",
174
+ "@astrojs/markdown-remark": "5.1.0"
175
175
  },
176
176
  "optionalDependencies": {
177
177
  "sharp": "^0.33.3"
178
178
  },
179
179
  "devDependencies": {
180
- "@astrojs/check": "^0.6.0",
181
- "@playwright/test": "^1.44.0",
180
+ "@astrojs/check": "^0.7.0",
181
+ "@playwright/test": "^1.44.1",
182
182
  "@types/aria-query": "^5.0.4",
183
183
  "@types/babel__generator": "^7.6.8",
184
- "@types/babel__traverse": "^7.20.5",
184
+ "@types/babel__traverse": "^7.20.6",
185
185
  "@types/common-ancestor-path": "^1.0.2",
186
186
  "@types/connect": "^3.4.38",
187
187
  "@types/cssesc": "^3.0.2",
@@ -211,8 +211,8 @@
211
211
  "rehype-slug": "^6.0.0",
212
212
  "rehype-toc": "^3.0.2",
213
213
  "remark-code-titles": "^0.1.2",
214
- "rollup": "^4.17.2",
215
- "sass": "^1.77.1",
214
+ "rollup": "^4.18.0",
215
+ "sass": "^1.77.3",
216
216
  "srcset-parse": "^1.1.0",
217
217
  "unified": "^11.0.4",
218
218
  "astro-scripts": "0.0.14"