From 85d1d60cb5ec0bca4a6f70b2498eeae35b9a576f Mon Sep 17 00:00:00 2001 From: Princesseuh Date: Thu, 5 Oct 2023 21:09:26 +0200 Subject: [PATCH] fix: build --- .../src/runtime/client/dev-overlay/plugins/astro.ts | 10 ++++++---- .../src/runtime/client/dev-overlay/plugins/xray.ts | 2 +- packages/astro/src/vite-plugin-astro-server/route.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts index 552b6bb8d..00d4fe540 100644 --- a/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts +++ b/packages/astro/src/runtime/client/dev-overlay/plugins/astro.ts @@ -4,9 +4,11 @@ export default { id: 'astro', name: 'Astro', icon: '', - toggleStatus(status) { - if (status == true) { - window.open('https://astro.build'); - } + init(canvas, eventTarget) { + eventTarget.addEventListener('plugin-toggle', (e) => { + if ((e as CustomEvent).detail.state === true) { + window.open('https://astro.build', '_blank'); + } + }); }, } satisfies DevOverlayItem; diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts index a99206b94..4e7ab6b33 100644 --- a/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts +++ b/packages/astro/src/runtime/client/dev-overlay/plugins/xray.ts @@ -44,7 +44,7 @@ export default { tooltip.sections.push({ title: 'Props', content: `${Object.entries(islandProps) - .map((prop) => `${prop[0]}="${getPropValue(prop[1] as any)}"`) + .map((prop) => `${prop[0]}=${getPropValue(prop[1] as any)}`) .join(', ')}`, }); } diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index 7f6ac2b0e..61b34347b 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -12,7 +12,7 @@ import { loadMiddleware } from '../core/middleware/loadMiddleware.js'; import { createRenderContext, getParamsAndProps, type SSROptions } from '../core/render/index.js'; import { createRequest } from '../core/request.js'; import { matchAllRoutes } from '../core/routing/index.js'; -import { isPage } from '../core/util.js'; +import { isPage, resolveIdToUrl } from '../core/util.js'; import { getSortedPreloadedMatches } from '../prerender/routing.js'; import { isServerLikeOutput } from '../prerender/utils.js'; import { PAGE_SCRIPT_ID } from '../vite-plugin-scripts/index.js';