From 9959899b5efbb8574e3933240c4fef06c00dab6d Mon Sep 17 00:00:00 2001 From: Princesseuh Date: Mon, 24 Jul 2023 20:48:40 +0200 Subject: [PATCH] config: use moduleResolution node16 --- .vscode/settings.json | 3 ++ packages/astro-rss/src/util.ts | 2 +- packages/astro/client-base.d.ts | 8 ++-- packages/astro/package.json | 2 +- packages/astro/src/@types/astro.ts | 22 +++++------ .../assets/services/vendor/squoosh/codecs.ts | 6 +-- .../src/assets/vendor/image-size/types/bmp.ts | 2 +- .../src/assets/vendor/image-size/types/cur.ts | 2 +- .../src/assets/vendor/image-size/types/dds.ts | 2 +- .../src/assets/vendor/image-size/types/gif.ts | 2 +- .../assets/vendor/image-size/types/icns.ts | 2 +- .../src/assets/vendor/image-size/types/ico.ts | 2 +- .../src/assets/vendor/image-size/types/j2c.ts | 2 +- .../src/assets/vendor/image-size/types/jp2.ts | 2 +- .../src/assets/vendor/image-size/types/jpg.ts | 2 +- .../src/assets/vendor/image-size/types/ktx.ts | 2 +- .../src/assets/vendor/image-size/types/png.ts | 2 +- .../src/assets/vendor/image-size/types/pnm.ts | 2 +- .../src/assets/vendor/image-size/types/psd.ts | 2 +- .../src/assets/vendor/image-size/types/svg.ts | 2 +- .../assets/vendor/image-size/types/tiff.ts | 2 +- .../assets/vendor/image-size/types/webp.ts | 2 +- .../astro/src/assets/vite-plugin-assets.ts | 2 +- packages/astro/src/cli/add/babel.ts | 6 +-- packages/astro/src/cli/check/index.ts | 4 +- packages/astro/src/config/index.ts | 4 +- .../src/config/vite-plugin-content-listen.ts | 2 +- .../src/content/vite-plugin-content-assets.ts | 2 +- packages/astro/src/core/app/common.ts | 2 +- packages/astro/src/core/app/index.ts | 8 ++-- packages/astro/src/core/app/node.ts | 4 +- packages/astro/src/core/app/types.ts | 4 +- packages/astro/src/core/build/common.ts | 2 +- .../astro/src/core/build/css-asset-name.ts | 2 +- packages/astro/src/core/build/generate.ts | 4 +- packages/astro/src/core/build/index.ts | 2 +- packages/astro/src/core/build/internal.ts | 6 +-- packages/astro/src/core/build/page-data.ts | 6 +-- packages/astro/src/core/build/plugin.ts | 4 +- .../astro/src/core/build/plugins/index.ts | 2 +- .../src/core/build/plugins/plugin-analyzer.ts | 2 +- .../src/core/build/plugins/plugin-css.ts | 8 ++-- .../build/plugins/plugin-hoisted-scripts.ts | 6 +-- .../core/build/plugins/plugin-internals.ts | 2 +- .../core/build/plugins/plugin-middleware.ts | 6 +-- .../src/core/build/plugins/plugin-pages.ts | 4 +- .../core/build/plugins/plugin-prerender.ts | 2 +- .../core/build/plugins/plugin-renderers.ts | 4 +- .../src/core/build/plugins/plugin-ssr.ts | 10 ++--- packages/astro/src/core/build/static-build.ts | 4 +- packages/astro/src/core/build/types.ts | 9 +++-- packages/astro/src/core/compile/cache.ts | 2 +- packages/astro/src/core/compile/compile.ts | 2 +- packages/astro/src/core/compile/index.ts | 4 +- packages/astro/src/core/config/config.ts | 2 +- packages/astro/src/core/config/index.ts | 2 +- packages/astro/src/core/config/schema.ts | 2 +- packages/astro/src/core/config/settings.ts | 2 +- packages/astro/src/core/cookies/response.ts | 2 +- packages/astro/src/core/create-vite.ts | 6 +-- packages/astro/src/core/dev/container.ts | 2 +- packages/astro/src/core/dev/dev.ts | 2 +- packages/astro/src/core/dev/restart.ts | 4 +- packages/astro/src/core/endpoint/dev/index.ts | 2 +- packages/astro/src/core/endpoint/index.ts | 4 +- packages/astro/src/core/errors/index.ts | 2 +- packages/astro/src/core/errors/overlay.ts | 2 +- .../src/core/middleware/callMiddleware.ts | 4 +- packages/astro/src/core/middleware/index.ts | 2 +- .../src/core/middleware/loadMiddleware.ts | 4 +- .../astro/src/core/middleware/sequence.ts | 2 +- .../astro/src/core/module-loader/loader.ts | 2 +- packages/astro/src/core/module-loader/vite.ts | 2 +- packages/astro/src/core/preview/index.ts | 4 +- .../src/core/preview/static-preview-server.ts | 4 +- .../astro/src/core/redirects/component.ts | 4 +- packages/astro/src/core/redirects/helpers.ts | 7 +++- packages/astro/src/core/render/context.ts | 4 +- packages/astro/src/core/render/core.ts | 2 +- packages/astro/src/core/render/environment.ts | 4 +- packages/astro/src/core/render/index.ts | 6 +-- packages/astro/src/core/render/paginate.ts | 2 +- .../astro/src/core/render/params-and-props.ts | 2 +- packages/astro/src/core/render/renderer.ts | 2 +- packages/astro/src/core/render/result.ts | 2 +- packages/astro/src/core/render/route-cache.ts | 2 +- packages/astro/src/core/render/ssr-element.ts | 4 +- packages/astro/src/core/request.ts | 2 +- .../astro/src/core/routing/manifest/create.ts | 4 +- .../src/core/routing/manifest/generator.ts | 2 +- .../core/routing/manifest/serialization.ts | 2 +- packages/astro/src/core/routing/match.ts | 2 +- packages/astro/src/core/routing/params.ts | 2 +- packages/astro/src/core/routing/validation.ts | 4 +- packages/astro/src/core/sync/index.ts | 2 +- packages/astro/src/core/util.ts | 4 +- packages/astro/src/events/session.ts | 2 +- packages/astro/src/integrations/index.ts | 4 +- packages/astro/src/jsx/babel.ts | 2 +- packages/astro/src/prerender/metadata.ts | 2 +- packages/astro/src/prerender/routing.ts | 4 +- packages/astro/src/prerender/utils.ts | 2 +- packages/astro/src/runtime/client/idle.ts | 2 +- packages/astro/src/runtime/client/load.ts | 2 +- packages/astro/src/runtime/client/media.ts | 2 +- packages/astro/src/runtime/client/only.ts | 2 +- packages/astro/src/runtime/client/visible.ts | 2 +- .../src/runtime/server/astro-component.ts | 2 +- .../astro/src/runtime/server/astro-global.ts | 2 +- packages/astro/src/runtime/server/endpoint.ts | 2 +- .../astro/src/runtime/server/hydration.ts | 2 +- packages/astro/src/runtime/server/jsx.ts | 2 +- .../runtime/server/render/astro/factory.ts | 6 +-- .../server/render/astro/head-and-content.ts | 2 +- .../src/runtime/server/render/astro/index.ts | 4 +- .../runtime/server/render/astro/instance.ts | 2 +- .../server/render/astro/render-template.ts | 2 +- .../src/runtime/server/render/astro/render.ts | 2 +- .../astro/src/runtime/server/render/common.ts | 2 +- .../src/runtime/server/render/component.ts | 6 ++- .../astro/src/runtime/server/render/dom.ts | 2 +- .../astro/src/runtime/server/render/head.ts | 4 +- .../astro/src/runtime/server/render/index.ts | 4 +- .../astro/src/runtime/server/render/page.ts | 6 +-- .../astro/src/runtime/server/render/tags.ts | 4 +- .../astro/src/runtime/server/render/util.ts | 2 +- packages/astro/src/runtime/server/scripts.ts | 2 +- .../astro/src/runtime/server/serialize.ts | 2 +- .../astro/src/runtime/server/transition.ts | 2 +- packages/astro/src/transitions/index.ts | 2 +- .../transitions/vite-plugin-transitions.ts | 6 +-- .../src/vite-plugin-astro-server/base.ts | 2 +- .../vite-plugin-astro-server/controller.ts | 4 +- .../astro/src/vite-plugin-astro-server/css.ts | 2 +- .../vite-plugin-astro-server/environment.ts | 4 +- .../src/vite-plugin-astro-server/index.ts | 2 +- .../src/vite-plugin-astro-server/metadata.ts | 4 +- .../src/vite-plugin-astro-server/plugin.ts | 2 +- .../src/vite-plugin-astro-server/request.ts | 6 +-- .../src/vite-plugin-astro-server/resolve.ts | 2 +- .../src/vite-plugin-astro-server/response.ts | 2 +- .../src/vite-plugin-astro-server/route.ts | 2 +- .../src/vite-plugin-astro-server/scripts.ts | 6 +-- .../src/vite-plugin-astro-server/vite.ts | 2 +- .../astro/src/vite-plugin-astro/compile.ts | 2 +- packages/astro/src/vite-plugin-astro/hmr.ts | 2 +- packages/astro/src/vite-plugin-astro/index.ts | 4 +- .../astro/src/vite-plugin-astro/metadata.ts | 4 +- packages/astro/src/vite-plugin-astro/types.ts | 2 +- .../src/vite-plugin-config-alias/index.ts | 2 +- packages/astro/src/vite-plugin-env/index.ts | 2 +- packages/astro/src/vite-plugin-head/index.ts | 4 +- .../src/vite-plugin-html/transform/escape.ts | 2 +- .../src/vite-plugin-jsx/import-source.ts | 2 +- packages/astro/src/vite-plugin-jsx/index.ts | 4 +- .../astro/src/vite-plugin-markdown/index.ts | 2 +- packages/astro/src/vite-plugin-utils/index.ts | 2 +- packages/astro/test/test-adapter.js | 2 +- packages/astro/test/test-utils.js | 2 +- packages/astro/types.d.ts | 4 +- .../create-astro/src/actions/dependencies.ts | 2 +- packages/create-astro/src/actions/git.ts | 2 +- packages/create-astro/src/actions/intro.ts | 2 +- .../create-astro/src/actions/next-steps.ts | 2 +- .../create-astro/src/actions/project-name.ts | 4 +- packages/create-astro/src/actions/template.ts | 2 +- .../create-astro/src/actions/typescript.ts | 2 +- packages/integrations/image/package.json | 2 +- .../integrations/image/src/utils/metadata.ts | 2 +- .../image/src/vendor/squoosh/codecs.ts | 6 +-- .../netlify/test/functions/test-utils.js | 2 +- .../netlify/test/static/test-utils.js | 2 +- packages/integrations/node/src/index.ts | 2 +- .../integrations/node/src/nodeMiddleware.ts | 6 +-- packages/integrations/node/src/preview.ts | 2 +- packages/integrations/node/src/server.ts | 2 +- packages/integrations/node/src/standalone.ts | 2 +- packages/integrations/preact/package.json | 2 +- packages/integrations/preact/src/client.ts | 2 +- packages/integrations/preact/src/context.ts | 2 +- packages/integrations/preact/src/server.ts | 4 +- packages/integrations/preact/src/signals.ts | 4 +- packages/integrations/solid/src/context.ts | 2 +- packages/integrations/solid/src/server.ts | 2 +- packages/integrations/svelte/tsconfig.json | 3 +- packages/integrations/tailwind/src/index.ts | 2 +- .../vercel/src/image/build-service.ts | 2 +- .../vercel/src/image/dev-service.ts | 2 +- .../vercel/src/serverless/entrypoint.ts | 4 +- packages/integrations/vue/src/index.ts | 4 +- packages/integrations/vue/tsconfig.json | 3 +- packages/markdown/remark/src/index.ts | 2 +- .../remark/src/remark-collect-images.ts | 2 +- packages/underscore-redirects/src/print.ts | 2 +- packages/webapi/package.json | 2 +- pnpm-lock.yaml | 37 ++++++++++--------- tsconfig.base.json | 3 +- 197 files changed, 326 insertions(+), 313 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..cccb50928 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.preferences.importModuleSpecifierEnding": "js" +} diff --git a/packages/astro-rss/src/util.ts b/packages/astro-rss/src/util.ts index e40301a4c..bc1589780 100644 --- a/packages/astro-rss/src/util.ts +++ b/packages/astro-rss/src/util.ts @@ -1,5 +1,5 @@ import type { z } from 'astro/zod'; -import type { RSSOptions } from './index'; +import type { RSSOptions } from './index.js'; /** Normalize URL to its canonical form */ export function createCanonicalURL( diff --git a/packages/astro/client-base.d.ts b/packages/astro/client-base.d.ts index c0203e0ef..dcec135a5 100644 --- a/packages/astro/client-base.d.ts +++ b/packages/astro/client-base.d.ts @@ -57,7 +57,7 @@ declare module 'astro:assets' { type WithRequired = T & { [P in K]-?: T[P] }; type Simplify = { [KeyType in keyof T]: T[KeyType] }; type ImgAttributes = WithRequired< - Omit, 'src' | 'width' | 'height'>, + Omit, 'src' | 'width' | 'height'>, 'alt' >; @@ -79,7 +79,7 @@ declare module 'astro:transitions' { export const ViewTransitions: ViewTransitionsModule['default']; } -type MD = import('./dist/@types/astro').MarkdownInstance>; +type MD = import('./dist/@types/astro.js').MarkdownInstance>; interface ExportedMarkdownModuleEntities { frontmatter: MD['frontmatter']; file: MD['file']; @@ -184,7 +184,7 @@ declare module '*.mdown' { } declare module '*.mdx' { - type MDX = import('./dist/@types/astro').MDXInstance>; + type MDX = import('./dist/@types/astro.js').MDXInstance>; export const frontmatter: MDX['frontmatter']; export const file: MDX['file']; @@ -197,7 +197,7 @@ declare module '*.mdx' { } declare module 'astro:ssr-manifest' { - export const manifest: import('./dist/@types/astro').SSRManifest; + export const manifest: import('./dist/@types/astro.js').SSRManifest; } // Everything below are Vite's types (apart from image types, which are in `client.d.ts`) diff --git a/packages/astro/package.json b/packages/astro/package.json index 2d6162f32..7517ddd0c 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -150,7 +150,7 @@ "html-escaper": "^3.0.3", "js-yaml": "^4.1.0", "kleur": "^4.1.4", - "magic-string": "^0.27.0", + "magic-string": "^0.30.1", "mime": "^3.0.0", "network-information-types": "^0.1.1", "ora": "^6.3.1", diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index fb34954ac..0c21a63ca 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -14,13 +14,13 @@ import type * as rollup from 'rollup'; import type { TsConfigJson } from 'tsconfig-resolver'; import type * as vite from 'vite'; import type { z } from 'zod'; -import type { SerializedSSRManifest } from '../core/app/types'; -import type { PageBuildData } from '../core/build/types'; -import type { AstroConfigSchema } from '../core/config'; -import type { AstroTimer } from '../core/config/timer'; -import type { AstroCookies } from '../core/cookies'; -import type { LogOptions } from '../core/logger/core'; -import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server'; +import type { SerializedSSRManifest } from '../core/app/types.js'; +import type { PageBuildData } from '../core/build/types.js'; +import type { AstroConfigSchema } from '../core/config/index.js'; +import type { AstroTimer } from '../core/config/timer.js'; +import type { AstroCookies } from '../core/cookies/index.js'; +import type { LogOptions } from '../core/logger/core.js'; +import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server/index.js'; import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'; export type { MarkdownHeading, @@ -34,7 +34,7 @@ export type { ExternalImageService, ImageService, LocalImageService, -} from '../assets/services/service'; +} from '../assets/services/service.js'; export type { GetImageResult, ImageInputFormat, @@ -43,9 +43,9 @@ export type { ImageQuality, ImageQualityPreset, ImageTransform, -} from '../assets/types'; -export type { SSRManifest } from '../core/app/types'; -export type { AstroCookies } from '../core/cookies'; +} from '../assets/types.js'; +export type { SSRManifest } from '../core/app/types.js'; +export type { AstroCookies } from '../core/cookies/index.js'; export interface AstroBuiltinProps { 'client:load'?: boolean; diff --git a/packages/astro/src/assets/services/vendor/squoosh/codecs.ts b/packages/astro/src/assets/services/vendor/squoosh/codecs.ts index 55b56d596..80aae7520 100644 --- a/packages/astro/src/assets/services/vendor/squoosh/codecs.ts +++ b/packages/astro/src/assets/services/vendor/squoosh/codecs.ts @@ -33,7 +33,7 @@ export interface RotateOptions { } // MozJPEG -import type { MozJPEGModule as MozJPEGEncodeModule } from './mozjpeg/mozjpeg_enc' +import type { MozJPEGModule as MozJPEGEncodeModule } from './mozjpeg/mozjpeg_enc.js' import mozDec from './mozjpeg/mozjpeg_node_dec.js' import mozDecWasm from './mozjpeg/mozjpeg_node_dec.wasm.js' @@ -41,7 +41,7 @@ import mozEnc from './mozjpeg/mozjpeg_node_enc.js' import mozEncWasm from './mozjpeg/mozjpeg_node_enc.wasm.js' // WebP -import type { WebPModule as WebPEncodeModule } from './webp/webp_enc' +import type { WebPModule as WebPEncodeModule } from './webp/webp_enc.js' import webpDec from './webp/webp_node_dec.js' import webpDecWasm from './webp/webp_node_dec.wasm.js' @@ -49,7 +49,7 @@ import webpEnc from './webp/webp_node_enc.js' import webpEncWasm from './webp/webp_node_enc.wasm.js' // AVIF -import type { AVIFModule as AVIFEncodeModule } from './avif/avif_enc' +import type { AVIFModule as AVIFEncodeModule } from './avif/avif_enc.js' import avifDec from './avif/avif_node_dec.js' import avifDecWasm from './avif/avif_node_dec.wasm.js' diff --git a/packages/astro/src/assets/vendor/image-size/types/bmp.ts b/packages/astro/src/assets/vendor/image-size/types/bmp.ts index 2f55ccdd1..e411bb561 100644 --- a/packages/astro/src/assets/vendor/image-size/types/bmp.ts +++ b/packages/astro/src/assets/vendor/image-size/types/bmp.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' export const BMP: IImage = { validate(buffer) { diff --git a/packages/astro/src/assets/vendor/image-size/types/cur.ts b/packages/astro/src/assets/vendor/image-size/types/cur.ts index 42766baec..4f612dcbb 100644 --- a/packages/astro/src/assets/vendor/image-size/types/cur.ts +++ b/packages/astro/src/assets/vendor/image-size/types/cur.ts @@ -1,5 +1,5 @@ import { ICO } from './ico.js' -import type { IImage } from './interface' +import type { IImage } from './interface.js' const TYPE_CURSOR = 2 export const CUR: IImage = { diff --git a/packages/astro/src/assets/vendor/image-size/types/dds.ts b/packages/astro/src/assets/vendor/image-size/types/dds.ts index e9ceb63ba..a9f33e046 100644 --- a/packages/astro/src/assets/vendor/image-size/types/dds.ts +++ b/packages/astro/src/assets/vendor/image-size/types/dds.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' export const DDS: IImage = { validate(buffer) { diff --git a/packages/astro/src/assets/vendor/image-size/types/gif.ts b/packages/astro/src/assets/vendor/image-size/types/gif.ts index b18b305f1..b49fc27c6 100644 --- a/packages/astro/src/assets/vendor/image-size/types/gif.ts +++ b/packages/astro/src/assets/vendor/image-size/types/gif.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' const gifRegexp = /^GIF8[79]a/ export const GIF: IImage = { diff --git a/packages/astro/src/assets/vendor/image-size/types/icns.ts b/packages/astro/src/assets/vendor/image-size/types/icns.ts index 5beccb02c..59e5a8425 100644 --- a/packages/astro/src/assets/vendor/image-size/types/icns.ts +++ b/packages/astro/src/assets/vendor/image-size/types/icns.ts @@ -1,4 +1,4 @@ -import type { IImage, ISize } from './interface' +import type { IImage, ISize } from './interface.js' /** * ICNS Header diff --git a/packages/astro/src/assets/vendor/image-size/types/ico.ts b/packages/astro/src/assets/vendor/image-size/types/ico.ts index 09310176f..17cc778bb 100644 --- a/packages/astro/src/assets/vendor/image-size/types/ico.ts +++ b/packages/astro/src/assets/vendor/image-size/types/ico.ts @@ -1,4 +1,4 @@ -import type { IImage, ISize, ISizeCalculationResult } from './interface' +import type { IImage, ISize, ISizeCalculationResult } from './interface.js' const TYPE_ICON = 1 diff --git a/packages/astro/src/assets/vendor/image-size/types/j2c.ts b/packages/astro/src/assets/vendor/image-size/types/j2c.ts index 301c38cb6..26c582714 100644 --- a/packages/astro/src/assets/vendor/image-size/types/j2c.ts +++ b/packages/astro/src/assets/vendor/image-size/types/j2c.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' export const J2C: IImage = { validate(buffer) { diff --git a/packages/astro/src/assets/vendor/image-size/types/jp2.ts b/packages/astro/src/assets/vendor/image-size/types/jp2.ts index 127a96d60..0b8d01625 100644 --- a/packages/astro/src/assets/vendor/image-size/types/jp2.ts +++ b/packages/astro/src/assets/vendor/image-size/types/jp2.ts @@ -1,4 +1,4 @@ -import type { IImage, ISize } from './interface' +import type { IImage, ISize } from './interface.js' const BoxTypes = { ftyp: '66747970', diff --git a/packages/astro/src/assets/vendor/image-size/types/jpg.ts b/packages/astro/src/assets/vendor/image-size/types/jpg.ts index 68c32b7be..c06302e48 100644 --- a/packages/astro/src/assets/vendor/image-size/types/jpg.ts +++ b/packages/astro/src/assets/vendor/image-size/types/jpg.ts @@ -4,7 +4,7 @@ // if this range we can't detect the file size correctly. import { readUInt } from '../readUInt.js' -import type { IImage, ISize } from './interface' +import type { IImage, ISize } from './interface.js' const EXIF_MARKER = '45786966' const APP1_DATA_SIZE_BYTES = 2 diff --git a/packages/astro/src/assets/vendor/image-size/types/ktx.ts b/packages/astro/src/assets/vendor/image-size/types/ktx.ts index 9e43fdeaa..080bc261f 100644 --- a/packages/astro/src/assets/vendor/image-size/types/ktx.ts +++ b/packages/astro/src/assets/vendor/image-size/types/ktx.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' const SIGNATURE = 'KTX 11' diff --git a/packages/astro/src/assets/vendor/image-size/types/png.ts b/packages/astro/src/assets/vendor/image-size/types/png.ts index a31411380..7c70025da 100644 --- a/packages/astro/src/assets/vendor/image-size/types/png.ts +++ b/packages/astro/src/assets/vendor/image-size/types/png.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' const pngSignature = 'PNG\r\n\x1a\n' const pngImageHeaderChunkName = 'IHDR' diff --git a/packages/astro/src/assets/vendor/image-size/types/pnm.ts b/packages/astro/src/assets/vendor/image-size/types/pnm.ts index fa30a53d5..8f1765aa7 100644 --- a/packages/astro/src/assets/vendor/image-size/types/pnm.ts +++ b/packages/astro/src/assets/vendor/image-size/types/pnm.ts @@ -1,4 +1,4 @@ -import type { IImage, ISize } from './interface' +import type { IImage, ISize } from './interface.js' const PNMTypes: { [signature: string]: string } = { P1: 'pbm/ascii', diff --git a/packages/astro/src/assets/vendor/image-size/types/psd.ts b/packages/astro/src/assets/vendor/image-size/types/psd.ts index 7521f5e9f..c88855fe7 100644 --- a/packages/astro/src/assets/vendor/image-size/types/psd.ts +++ b/packages/astro/src/assets/vendor/image-size/types/psd.ts @@ -1,4 +1,4 @@ -import type { IImage } from './interface' +import type { IImage } from './interface.js' export const PSD: IImage = { validate(buffer) { diff --git a/packages/astro/src/assets/vendor/image-size/types/svg.ts b/packages/astro/src/assets/vendor/image-size/types/svg.ts index 945be962d..50c485683 100644 --- a/packages/astro/src/assets/vendor/image-size/types/svg.ts +++ b/packages/astro/src/assets/vendor/image-size/types/svg.ts @@ -1,4 +1,4 @@ -import type { IImage, ISize } from './interface' +import type { IImage, ISize } from './interface.js' interface IAttributes { width: number | null diff --git a/packages/astro/src/assets/vendor/image-size/types/tiff.ts b/packages/astro/src/assets/vendor/image-size/types/tiff.ts index ae228c1b8..c5f76f80e 100644 --- a/packages/astro/src/assets/vendor/image-size/types/tiff.ts +++ b/packages/astro/src/assets/vendor/image-size/types/tiff.ts @@ -2,7 +2,7 @@ // TO-DO: support big-endian as well import * as fs from 'node:fs' import { readUInt } from '../readUInt.js' -import type { IImage } from './interface' +import type { IImage } from './interface.js' // Read IFD (image-file-directory) into a buffer function readIFD(buffer: Buffer, filepath: string, isBigEndian: boolean) { diff --git a/packages/astro/src/assets/vendor/image-size/types/webp.ts b/packages/astro/src/assets/vendor/image-size/types/webp.ts index aaafbf12d..6592d87fb 100644 --- a/packages/astro/src/assets/vendor/image-size/types/webp.ts +++ b/packages/astro/src/assets/vendor/image-size/types/webp.ts @@ -1,5 +1,5 @@ // based on https://developers.google.com/speed/webp/docs/riff_container -import type { IImage, ISize } from './interface' +import type { IImage, ISize } from './interface.js' function calculateExtended(buffer: Buffer): ISize { return { diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index 6a29d02f0..59e695657 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -3,7 +3,7 @@ import MagicString from 'magic-string'; import { fileURLToPath } from 'node:url'; import type * as vite from 'vite'; import { normalizePath } from 'vite'; -import type { AstroPluginOptions, ImageTransform } from '../@types/astro'; +import type { AstroPluginOptions, ImageTransform } from '../@types/astro.js'; import { error } from '../core/logger/core.js'; import { appendForwardSlash, diff --git a/packages/astro/src/cli/add/babel.ts b/packages/astro/src/cli/add/babel.ts index 7da8eed6c..facaabd54 100644 --- a/packages/astro/src/cli/add/babel.ts +++ b/packages/astro/src/cli/add/babel.ts @@ -3,13 +3,11 @@ import parser from '@babel/parser'; import traverse from '@babel/traverse'; import * as t from '@babel/types'; -// @ts-expect-error @babel/traverse isn't ESM and needs this trick -export const visit = traverse.default as typeof traverse; +export const visit = traverse.default; export { t }; export async function generate(ast: t.File) { - // @ts-expect-error @babel/generator isn't ESM and needs this trick - const astToText = generator.default as typeof generator; + const astToText = generator.default; const { code } = astToText(ast); return code; } diff --git a/packages/astro/src/cli/check/index.ts b/packages/astro/src/cli/check/index.ts index 09d45ee56..dd017010c 100644 --- a/packages/astro/src/cli/check/index.ts +++ b/packages/astro/src/cli/check/index.ts @@ -12,11 +12,11 @@ import { join } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import ora from 'ora'; import type { Arguments as Flags } from 'yargs-parser'; -import type { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro.js'; import type { LogOptions } from '../../core/logger/core.js'; import { debug, info } from '../../core/logger/core.js'; import { printHelp } from '../../core/messages.js'; -import type { ProcessExit, SyncOptions } from '../../core/sync'; +import type { ProcessExit, SyncOptions } from '../../core/sync/index.js'; import { loadSettings } from '../load-settings.js'; import { printDiagnostic } from './print.js'; diff --git a/packages/astro/src/config/index.ts b/packages/astro/src/config/index.ts index 2536df8e7..b2f88a641 100644 --- a/packages/astro/src/config/index.ts +++ b/packages/astro/src/config/index.ts @@ -1,6 +1,6 @@ import type { UserConfig } from 'vite'; -import type { AstroUserConfig } from '../@types/astro'; -import type { LogOptions } from '../core/logger/core'; +import type { AstroUserConfig } from '../@types/astro.js'; +import type { LogOptions } from '../core/logger/core.js'; export function defineConfig(config: AstroUserConfig) { return config; diff --git a/packages/astro/src/config/vite-plugin-content-listen.ts b/packages/astro/src/config/vite-plugin-content-listen.ts index ecd9ea68b..5775965d8 100644 --- a/packages/astro/src/config/vite-plugin-content-listen.ts +++ b/packages/astro/src/config/vite-plugin-content-listen.ts @@ -1,6 +1,6 @@ import type fsMod from 'node:fs'; import type { Plugin, ViteDevServer } from 'vite'; -import type { AstroSettings } from '../@types/astro'; +import type { AstroSettings } from '../@types/astro.js'; import { attachContentServerListeners } from '../content/server-listeners.js'; import type { LogOptions } from '../core/logger/core.js'; diff --git a/packages/astro/src/content/vite-plugin-content-assets.ts b/packages/astro/src/content/vite-plugin-content-assets.ts index 38e1bdc44..5d82a684f 100644 --- a/packages/astro/src/content/vite-plugin-content-assets.ts +++ b/packages/astro/src/content/vite-plugin-content-assets.ts @@ -5,7 +5,7 @@ import type { AstroSettings } from '../@types/astro.js'; import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js'; import { getPageDataByViteID, type BuildInternals } from '../core/build/internal.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js'; -import type { StaticBuildOptions } from '../core/build/types'; +import type { StaticBuildOptions } from '../core/build/types.js'; import type { ModuleLoader } from '../core/module-loader/loader.js'; import { createViteLoader } from '../core/module-loader/vite.js'; import { joinPaths, prependForwardSlash } from '../core/path.js'; diff --git a/packages/astro/src/core/app/common.ts b/packages/astro/src/core/app/common.ts index 58898b2fe..5426d7721 100644 --- a/packages/astro/src/core/app/common.ts +++ b/packages/astro/src/core/app/common.ts @@ -1,5 +1,5 @@ import { deserializeRouteData } from '../routing/manifest/serialization.js'; -import type { RouteInfo, SerializedSSRManifest, SSRManifest } from './types'; +import type { RouteInfo, SerializedSSRManifest, SSRManifest } from './types.js'; export function deserializeManifest(serializedManifest: SerializedSSRManifest): SSRManifest { const routes: RouteInfo[] = []; diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index 03b73f53a..755b38574 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -5,14 +5,14 @@ import type { RouteData, SSRElement, SSRManifest, -} from '../../@types/astro'; -import type { SinglePageBuiltModule } from '../build/types'; +} from '../../@types/astro.js'; +import type { SinglePageBuiltModule } from '../build/types.js'; import { attachToResponse, getSetCookiesFromResponse } from '../cookies/index.js'; import { consoleLogDestination } from '../logger/console.js'; import { error, type LogOptions } from '../logger/core.js'; import { prependForwardSlash, removeTrailingForwardSlash } from '../path.js'; import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; -import { isResponse } from '../render/core'; +import { isResponse } from '../render/core.js'; import { createEnvironment, createRenderContext, @@ -27,7 +27,7 @@ import { createStylesheetElementSet, } from '../render/ssr-element.js'; import { matchRoute } from '../routing/match.js'; -import type { RouteInfo } from './types'; +import type { RouteInfo } from './types.js'; export { deserializeManifest } from './common.js'; const clientLocalsSymbol = Symbol.for('astro.locals'); diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts index 2cfc686a2..c67d6e24d 100644 --- a/packages/astro/src/core/app/node.ts +++ b/packages/astro/src/core/app/node.ts @@ -1,5 +1,5 @@ -import type { RouteData } from '../../@types/astro'; -import type { SerializedSSRManifest, SSRManifest } from './types'; +import type { RouteData } from '../../@types/astro.js'; +import type { SerializedSSRManifest, SSRManifest } from './types.js'; import * as fs from 'node:fs'; import { IncomingMessage } from 'node:http'; diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts index 67d16d457..35d7fb92b 100644 --- a/packages/astro/src/core/app/types.ts +++ b/packages/astro/src/core/app/types.ts @@ -5,8 +5,8 @@ import type { SSRComponentMetadata, SSRLoadedRenderer, SSRResult, -} from '../../@types/astro'; -import type { SinglePageBuiltModule } from '../build/types'; +} from '../../@types/astro.js'; +import type { SinglePageBuiltModule } from '../build/types.js'; export type ComponentPath = string; diff --git a/packages/astro/src/core/build/common.ts b/packages/astro/src/core/build/common.ts index a4ba0b4ca..5b3811f1d 100644 --- a/packages/astro/src/core/build/common.ts +++ b/packages/astro/src/core/build/common.ts @@ -1,6 +1,6 @@ import npath from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -import type { AstroConfig, RouteType } from '../../@types/astro'; +import type { AstroConfig, RouteType } from '../../@types/astro.js'; import { appendForwardSlash } from '../../core/path.js'; const STATUS_CODE_PAGES = new Set(['/404', '/500']); diff --git a/packages/astro/src/core/build/css-asset-name.ts b/packages/astro/src/core/build/css-asset-name.ts index ace31c3ab..6e9e2a1c2 100644 --- a/packages/astro/src/core/build/css-asset-name.ts +++ b/packages/astro/src/core/build/css-asset-name.ts @@ -2,7 +2,7 @@ import type { GetModuleInfo } from 'rollup'; import crypto from 'node:crypto'; import npath from 'node:path'; -import type { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro.js'; import { viteID } from '../util.js'; import { getTopLevelPages } from './graph.js'; diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 1f8d170a0..d6f02e734 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -15,7 +15,7 @@ import type { SSRError, SSRLoadedRenderer, SSRManifest, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { generateImage as generateImageInternal, getStaticImageList, @@ -61,7 +61,7 @@ import type { SinglePageBuiltModule, StaticBuildOptions, StylesheetAsset, -} from './types'; +} from './types.js'; import { getTimeStat } from './util.js'; function createEntryURL(filePath: string, outFolder: URL) { diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 8935c956e..b325af1dd 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -3,7 +3,7 @@ import fs from 'node:fs'; import { performance } from 'node:perf_hooks'; import type * as vite from 'vite'; import type yargs from 'yargs-parser'; -import type { AstroConfig, AstroSettings, ManifestData, RuntimeMode } from '../../@types/astro'; +import type { AstroConfig, AstroSettings, ManifestData, RuntimeMode } from '../../@types/astro.js'; import { runHookBuildDone, runHookBuildStart, diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index 5dff6f3dd..12331cb04 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -1,6 +1,6 @@ import type { Rollup } from 'vite'; -import type { RouteData, SSRResult } from '../../@types/astro'; -import type { PageOptions } from '../../vite-plugin-astro/types'; +import type { RouteData, SSRResult } from '../../@types/astro.js'; +import type { PageOptions } from '../../vite-plugin-astro/types.js'; import { prependForwardSlash, removeFileExtension } from '../path.js'; import { viteID } from '../util.js'; import { @@ -9,7 +9,7 @@ import { } from './plugins/plugin-pages.js'; import { RESOLVED_SPLIT_MODULE_ID } from './plugins/plugin-ssr.js'; import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js'; -import type { PageBuildData, StylesheetAsset, ViteID } from './types'; +import type { PageBuildData, StylesheetAsset, ViteID } from './types.js'; export interface BuildInternals { /** diff --git a/packages/astro/src/core/build/page-data.ts b/packages/astro/src/core/build/page-data.ts index 0a53745c5..6c4713722 100644 --- a/packages/astro/src/core/build/page-data.ts +++ b/packages/astro/src/core/build/page-data.ts @@ -1,7 +1,7 @@ -import type { AstroSettings, ManifestData } from '../../@types/astro'; -import type { LogOptions } from '../logger/core'; +import type { AstroSettings, ManifestData } from '../../@types/astro.js'; +import type { LogOptions } from '../logger/core.js'; import { info } from '../logger/core.js'; -import type { AllPagesData } from './types'; +import type { AllPagesData } from './types.js'; import * as colors from 'kleur/colors'; import { debug } from '../logger/core.js'; diff --git a/packages/astro/src/core/build/plugin.ts b/packages/astro/src/core/build/plugin.ts index e7b1fbc4a..c5da47457 100644 --- a/packages/astro/src/core/build/plugin.ts +++ b/packages/astro/src/core/build/plugin.ts @@ -1,6 +1,6 @@ import type { Plugin as VitePlugin } from 'vite'; -import type { BuildInternals } from './internal'; -import type { StaticBuildOptions, ViteBuildReturn } from './types'; +import type { BuildInternals } from './internal.js'; +import type { StaticBuildOptions, ViteBuildReturn } from './types.js'; type RollupOutputArray = Extract>; type OutputChunkorAsset = RollupOutputArray[number]['output'][number]; diff --git a/packages/astro/src/core/build/plugins/index.ts b/packages/astro/src/core/build/plugins/index.ts index 3a44824d6..a25d475f0 100644 --- a/packages/astro/src/core/build/plugins/index.ts +++ b/packages/astro/src/core/build/plugins/index.ts @@ -1,6 +1,6 @@ import { astroConfigBuildPlugin } from '../../../content/vite-plugin-content-assets.js'; import { astroHeadBuildPlugin } from '../../../vite-plugin-head/index.js'; -import type { AstroBuildPluginContainer } from '../plugin'; +import type { AstroBuildPluginContainer } from '../plugin.js'; import { pluginAliasResolve } from './plugin-alias-resolve.js'; import { pluginAnalyzer } from './plugin-analyzer.js'; import { pluginComponentEntry } from './plugin-component-entry.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-analyzer.ts b/packages/astro/src/core/build/plugins/plugin-analyzer.ts index b62de1a2b..9a95ee797 100644 --- a/packages/astro/src/core/build/plugins/plugin-analyzer.ts +++ b/packages/astro/src/core/build/plugins/plugin-analyzer.ts @@ -1,7 +1,7 @@ import type { Node as ESTreeNode } from 'estree-walker'; import type { ModuleInfo, PluginContext } from 'rollup'; import type { Plugin as VitePlugin } from 'vite'; -import type { PluginMetadata as AstroPluginMetadata } from '../../../vite-plugin-astro/types'; +import type { PluginMetadata as AstroPluginMetadata } from '../../../vite-plugin-astro/types.js'; import type { BuildInternals } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-css.ts b/packages/astro/src/core/build/plugins/plugin-css.ts index 87b52cbdb..14dced897 100644 --- a/packages/astro/src/core/build/plugins/plugin-css.ts +++ b/packages/astro/src/core/build/plugins/plugin-css.ts @@ -3,9 +3,9 @@ import * as npath from 'node:path'; import type { GetModuleInfo } from 'rollup'; import { type ResolvedConfig, type Plugin as VitePlugin } from 'vite'; import { isBuildableCSSRequest } from '../../../vite-plugin-astro-server/util.js'; -import type { BuildInternals } from '../internal'; -import type { AstroBuildPlugin } from '../plugin'; -import type { PageBuildData, StaticBuildOptions, StylesheetAsset } from '../types'; +import type { BuildInternals } from '../internal.js'; +import type { AstroBuildPlugin } from '../plugin.js'; +import type { OutputChunk, PageBuildData, StaticBuildOptions, StylesheetAsset } from '../types.js'; import { PROPAGATED_ASSET_FLAG } from '../../../content/consts.js'; import * as assetName from '../css-asset-name.js'; @@ -110,7 +110,7 @@ function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] { for (const [, chunk] of Object.entries(bundle)) { if (chunk.type !== 'chunk') continue; if ('viteMetadata' in chunk === false) continue; - const meta = chunk.viteMetadata as ViteMetadata; + const meta = (chunk as OutputChunk & { viteMetadata: ViteMetadata }).viteMetadata; // Skip if the chunk has no CSS, we want to handle CSS chunks only if (meta.importedCss.size < 1) continue; diff --git a/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts b/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts index d31e42807..5c6b40992 100644 --- a/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts +++ b/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts @@ -1,10 +1,10 @@ import type { Plugin as VitePlugin } from 'vite'; -import type { AstroSettings } from '../../../@types/astro'; +import type { AstroSettings } from '../../../@types/astro.js'; import { viteID } from '../../util.js'; import type { BuildInternals } from '../internal.js'; import { getPageDataByViteID } from '../internal.js'; -import type { AstroBuildPlugin } from '../plugin'; -import type { OutputChunk, StaticBuildOptions } from '../types'; +import type { AstroBuildPlugin } from '../plugin.js'; +import type { OutputChunk, StaticBuildOptions } from '../types.js'; function virtualHoistedEntry(id: string) { return id.startsWith('/astro/hoisted.js?q='); diff --git a/packages/astro/src/core/build/plugins/plugin-internals.ts b/packages/astro/src/core/build/plugins/plugin-internals.ts index a92b5ac26..3ee7d21a2 100644 --- a/packages/astro/src/core/build/plugins/plugin-internals.ts +++ b/packages/astro/src/core/build/plugins/plugin-internals.ts @@ -1,6 +1,6 @@ import type { UserConfig, Plugin as VitePlugin } from 'vite'; import type { BuildInternals } from '../internal.js'; -import type { AstroBuildPlugin } from '../plugin'; +import type { AstroBuildPlugin } from '../plugin.js'; import { normalizeEntryId } from './plugin-component-entry.js'; export function vitePluginInternals(input: Set, internals: BuildInternals): VitePlugin { diff --git a/packages/astro/src/core/build/plugins/plugin-middleware.ts b/packages/astro/src/core/build/plugins/plugin-middleware.ts index 8afca2fbc..e741c753c 100644 --- a/packages/astro/src/core/build/plugins/plugin-middleware.ts +++ b/packages/astro/src/core/build/plugins/plugin-middleware.ts @@ -1,9 +1,9 @@ import type { Plugin as VitePlugin } from 'vite'; import { MIDDLEWARE_PATH_SEGMENT_NAME } from '../../constants.js'; import { addRollupInput } from '../add-rollup-input.js'; -import type { BuildInternals } from '../internal'; -import type { AstroBuildPlugin } from '../plugin'; -import type { StaticBuildOptions } from '../types'; +import type { BuildInternals } from '../internal.js'; +import type { AstroBuildPlugin } from '../plugin.js'; +import type { StaticBuildOptions } from '../types.js'; export const MIDDLEWARE_MODULE_ID = '@astro-middleware'; diff --git a/packages/astro/src/core/build/plugins/plugin-pages.ts b/packages/astro/src/core/build/plugins/plugin-pages.ts index 2ee438a6a..ff2f418f4 100644 --- a/packages/astro/src/core/build/plugins/plugin-pages.ts +++ b/packages/astro/src/core/build/plugins/plugin-pages.ts @@ -3,8 +3,8 @@ import type { Plugin as VitePlugin } from 'vite'; import { routeIsRedirect } from '../../redirects/index.js'; import { addRollupInput } from '../add-rollup-input.js'; import { type BuildInternals } from '../internal.js'; -import type { AstroBuildPlugin } from '../plugin'; -import type { StaticBuildOptions } from '../types'; +import type { AstroBuildPlugin } from '../plugin.js'; +import type { StaticBuildOptions } from '../types.js'; import { MIDDLEWARE_MODULE_ID } from './plugin-middleware.js'; import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; import { ASTRO_PAGE_EXTENSION_POST_PATTERN, getPathFromVirtualModulePageName } from './util.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-prerender.ts b/packages/astro/src/core/build/plugins/plugin-prerender.ts index a0d6a9c7b..8f499e01e 100644 --- a/packages/astro/src/core/build/plugins/plugin-prerender.ts +++ b/packages/astro/src/core/build/plugins/plugin-prerender.ts @@ -3,7 +3,7 @@ import type { Plugin as VitePlugin } from 'vite'; import { getPrerenderMetadata } from '../../../prerender/metadata.js'; import type { BuildInternals } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; -import type { StaticBuildOptions } from '../types'; +import type { StaticBuildOptions } from '../types.js'; import { extendManualChunks } from './util.js'; function vitePluginPrerender(opts: StaticBuildOptions, internals: BuildInternals): VitePlugin { diff --git a/packages/astro/src/core/build/plugins/plugin-renderers.ts b/packages/astro/src/core/build/plugins/plugin-renderers.ts index 912df4241..9eca6a04f 100644 --- a/packages/astro/src/core/build/plugins/plugin-renderers.ts +++ b/packages/astro/src/core/build/plugins/plugin-renderers.ts @@ -1,7 +1,7 @@ import type { Plugin as VitePlugin } from 'vite'; import { addRollupInput } from '../add-rollup-input.js'; -import type { AstroBuildPlugin } from '../plugin'; -import type { StaticBuildOptions } from '../types'; +import type { AstroBuildPlugin } from '../plugin.js'; +import type { StaticBuildOptions } from '../types.js'; export const RENDERERS_MODULE_ID = '@astro-renderers'; export const RESOLVED_RENDERERS_MODULE_ID = `\0${RENDERERS_MODULE_ID}`; diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts index 514fe2409..440a052af 100644 --- a/packages/astro/src/core/build/plugins/plugin-ssr.ts +++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts @@ -2,19 +2,19 @@ import glob from 'fast-glob'; import { join } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import type { Plugin as VitePlugin } from 'vite'; -import type { AstroAdapter, AstroConfig } from '../../../@types/astro'; +import type { AstroAdapter, AstroConfig } from '../../../@types/astro.js'; import { runHookBuildSsr } from '../../../integrations/index.js'; import { isServerLikeOutput } from '../../../prerender/utils.js'; import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js'; -import type { SerializedRouteInfo, SerializedSSRManifest } from '../../app/types'; +import type { SerializedRouteInfo, SerializedSSRManifest } from '../../app/types.js'; import { joinPaths, prependForwardSlash } from '../../path.js'; import { routeIsRedirect } from '../../redirects/index.js'; import { serializeRouteData } from '../../routing/index.js'; import { addRollupInput } from '../add-rollup-input.js'; import { getOutFile, getOutFolder } from '../common.js'; import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js'; -import type { AstroBuildPlugin } from '../plugin'; -import type { OutputChunk, StaticBuildOptions } from '../types'; +import type { AstroBuildPlugin } from '../plugin.js'; +import type { OutputChunk, StaticBuildOptions } from '../types.js'; import { ASTRO_PAGE_MODULE_ID } from './plugin-pages.js'; import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; import { getPathFromVirtualModulePageName, getVirtualModulePageNameFromPath } from './util.js'; @@ -283,7 +283,7 @@ function generateSSRCode(config: AstroConfig, adapter: AstroAdapter) { } contents.push(`import * as adapter from '${adapter.serverEntrypoint}'; -import { renderers } from '${RENDERERS_MODULE_ID}'; +import { renderers } from '${RENDERERS_MODULE_ID}'; import { deserializeManifest as _deserializeManifest } from 'astro/app'; import { _privateSetManifestDontUseThis } from 'astro:ssr-manifest'; const _manifest = Object.assign(_deserializeManifest('${manifestReplace}'), { diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 8e3cf8fa8..5359d1a95 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -6,7 +6,7 @@ import fs from 'node:fs'; import path, { extname } from 'node:path'; import { fileURLToPath } from 'node:url'; import * as vite from 'vite'; -import type { RouteData } from '../../@types/astro'; +import type { RouteData } from '../../@types/astro.js'; import { createBuildInternals, eachPageData, @@ -30,7 +30,7 @@ import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js'; import { RESOLVED_RENDERERS_MODULE_ID } from './plugins/plugin-renderers.js'; import { RESOLVED_SPLIT_MODULE_ID, SSR_VIRTUAL_MODULE_ID } from './plugins/plugin-ssr.js'; import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js'; -import type { PageBuildData, StaticBuildOptions } from './types'; +import type { PageBuildData, StaticBuildOptions } from './types.js'; import { getTimeStat } from './util.js'; export async function viteBuild(opts: StaticBuildOptions) { diff --git a/packages/astro/src/core/build/types.ts b/packages/astro/src/core/build/types.ts index 472dc4b34..d16de0814 100644 --- a/packages/astro/src/core/build/types.ts +++ b/packages/astro/src/core/build/types.ts @@ -1,4 +1,5 @@ -import type { InlineConfig, default as vite } from 'vite'; +import type * as vite from 'vite'; +import type { InlineConfig } from 'vite'; import type { AstroConfig, AstroSettings, @@ -8,9 +9,9 @@ import type { RouteData, RuntimeMode, SSRLoadedRenderer, -} from '../../@types/astro'; -import type { LogOptions } from '../logger/core'; -import type { RouteCache } from '../render/route-cache'; +} from '../../@types/astro.js'; +import type { LogOptions } from '../logger/core.js'; +import type { RouteCache } from '../render/route-cache.js'; export type ComponentPath = string; export type ViteID = string; diff --git a/packages/astro/src/core/compile/cache.ts b/packages/astro/src/core/compile/cache.ts index 673eabd0b..cdd9ddd55 100644 --- a/packages/astro/src/core/compile/cache.ts +++ b/packages/astro/src/core/compile/cache.ts @@ -1,4 +1,4 @@ -import type { AstroConfig } from '../../@types/astro'; +import type { AstroConfig } from '../../@types/astro.js'; import { compile, type CompileProps, type CompileResult } from './compile.js'; type CompilationCache = Map; diff --git a/packages/astro/src/core/compile/compile.ts b/packages/astro/src/core/compile/compile.ts index c1df9e5f3..cd523419e 100644 --- a/packages/astro/src/core/compile/compile.ts +++ b/packages/astro/src/core/compile/compile.ts @@ -1,6 +1,6 @@ import type { TransformResult } from '@astrojs/compiler'; import type { ResolvedConfig } from 'vite'; -import type { AstroConfig } from '../../@types/astro'; +import type { AstroConfig } from '../../@types/astro.js'; import { transform } from '@astrojs/compiler'; import { fileURLToPath } from 'node:url'; diff --git a/packages/astro/src/core/compile/index.ts b/packages/astro/src/core/compile/index.ts index 6851c7c5e..4a2094de7 100644 --- a/packages/astro/src/core/compile/index.ts +++ b/packages/astro/src/core/compile/index.ts @@ -4,5 +4,5 @@ export { invalidateCompilation, isCached, } from './cache.js'; -export type { CompileProps, CompileResult } from './compile'; -export type { TransformStyle } from './types'; +export type { CompileProps, CompileResult } from './compile.js'; +export type { TransformStyle } from './types.js'; diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts index 1be371523..6e17446fa 100644 --- a/packages/astro/src/core/config/config.ts +++ b/packages/astro/src/core/config/config.ts @@ -1,5 +1,5 @@ import type { Arguments as Flags } from 'yargs-parser'; -import type { AstroConfig, AstroUserConfig, CLIFlags } from '../../@types/astro'; +import type { AstroConfig, AstroUserConfig, CLIFlags } from '../../@types/astro.js'; import * as colors from 'kleur/colors'; import fs from 'node:fs'; diff --git a/packages/astro/src/core/config/index.ts b/packages/astro/src/core/config/index.ts index b7b616951..55f83f4f0 100644 --- a/packages/astro/src/core/config/index.ts +++ b/packages/astro/src/core/config/index.ts @@ -7,6 +7,6 @@ export { validateConfig, } from './config.js'; export { mergeConfig } from './merge.js'; -export type { AstroConfigSchema } from './schema'; +export type { AstroConfigSchema } from './schema.js'; export { createDefaultDevSettings, createSettings } from './settings.js'; export { loadTSConfig, updateTSConfigForFramework } from './tsconfig.js'; diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 34c1e5549..6d56666ea 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -1,7 +1,7 @@ import type { RehypePlugin, RemarkPlugin, RemarkRehype } from '@astrojs/markdown-remark'; import { markdownConfigDefaults } from '@astrojs/markdown-remark'; import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki'; -import type { AstroUserConfig, ViteUserConfig } from '../../@types/astro'; +import type { AstroUserConfig, ViteUserConfig } from '../../@types/astro.js'; import type { OutgoingHttpHeaders } from 'node:http'; import path from 'node:path'; diff --git a/packages/astro/src/core/config/settings.ts b/packages/astro/src/core/config/settings.ts index 222e6461b..7a6fa0088 100644 --- a/packages/astro/src/core/config/settings.ts +++ b/packages/astro/src/core/config/settings.ts @@ -1,7 +1,7 @@ import yaml from 'js-yaml'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -import type { AstroConfig, AstroSettings, AstroUserConfig } from '../../@types/astro'; +import type { AstroConfig, AstroSettings, AstroUserConfig } from '../../@types/astro.js'; import { getContentPaths } from '../../content/index.js'; import jsxRenderer from '../../jsx/renderer.js'; import { isServerLikeOutput } from '../../prerender/utils.js'; diff --git a/packages/astro/src/core/cookies/response.ts b/packages/astro/src/core/cookies/response.ts index 18d72ab1c..1fe405f61 100644 --- a/packages/astro/src/core/cookies/response.ts +++ b/packages/astro/src/core/cookies/response.ts @@ -1,4 +1,4 @@ -import type { AstroCookies } from './cookies'; +import type { AstroCookies } from './cookies.js'; const astroCookiesSymbol = Symbol.for('astro.cookies'); diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index c0b989b77..b7a354088 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -1,5 +1,5 @@ -import type { AstroSettings } from '../@types/astro'; -import type { LogOptions } from './logger/core'; +import type { AstroSettings } from '../@types/astro.js'; +import type { LogOptions } from './logger/core.js'; import nodeFs from 'node:fs'; import { fileURLToPath } from 'node:url'; @@ -168,7 +168,7 @@ export async function createVite( { // Typings are imported from 'astro' (e.g. import { Type } from 'astro') find: /^astro$/, - replacement: fileURLToPath(new URL('../@types/astro', import.meta.url)), + replacement: fileURLToPath(new URL('../@types/astro.js', import.meta.url)), }, ], conditions: ['astro'], diff --git a/packages/astro/src/core/dev/container.ts b/packages/astro/src/core/dev/container.ts index 8f922c6dd..185bb9e50 100644 --- a/packages/astro/src/core/dev/container.ts +++ b/packages/astro/src/core/dev/container.ts @@ -1,6 +1,6 @@ import type * as http from 'node:http'; import type { AddressInfo } from 'node:net'; -import type { AstroSettings, AstroUserConfig } from '../../@types/astro'; +import type { AstroSettings, AstroUserConfig } from '../../@types/astro.js'; import nodeFs from 'node:fs'; import * as vite from 'vite'; diff --git a/packages/astro/src/core/dev/dev.ts b/packages/astro/src/core/dev/dev.ts index f6fd35685..f78cd3a1f 100644 --- a/packages/astro/src/core/dev/dev.ts +++ b/packages/astro/src/core/dev/dev.ts @@ -4,7 +4,7 @@ import type { AddressInfo } from 'node:net'; import { performance } from 'perf_hooks'; import type * as vite from 'vite'; import type yargs from 'yargs-parser'; -import type { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro.js'; import { attachContentServerListeners } from '../../content/index.js'; import { telemetry } from '../../events/index.js'; import { info, warn, type LogOptions } from '../logger/core.js'; diff --git a/packages/astro/src/core/dev/restart.ts b/packages/astro/src/core/dev/restart.ts index 887470fb8..24a8d4fe2 100644 --- a/packages/astro/src/core/dev/restart.ts +++ b/packages/astro/src/core/dev/restart.ts @@ -1,9 +1,9 @@ import * as vite from 'vite'; -import type { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro.js'; import { createSettings, openConfig } from '../config/index.js'; import { createSafeError } from '../errors/index.js'; import { info } from '../logger/core.js'; -import type { Container, CreateContainerParams } from './container'; +import type { Container, CreateContainerParams } from './container.js'; import { createContainer, isStarted, startContainer } from './container.js'; async function createRestartedContainer( diff --git a/packages/astro/src/core/endpoint/dev/index.ts b/packages/astro/src/core/endpoint/dev/index.ts index 79e5c1fd5..96fe5f3d7 100644 --- a/packages/astro/src/core/endpoint/dev/index.ts +++ b/packages/astro/src/core/endpoint/dev/index.ts @@ -1,4 +1,4 @@ -import type { EndpointHandler } from '../../../@types/astro'; +import type { EndpointHandler } from '../../../@types/astro.js'; import { createRenderContext, type SSROptions } from '../../render/index.js'; import { callEndpoint } from '../index.js'; diff --git a/packages/astro/src/core/endpoint/index.ts b/packages/astro/src/core/endpoint/index.ts index 392ffa291..62df15c07 100644 --- a/packages/astro/src/core/endpoint/index.ts +++ b/packages/astro/src/core/endpoint/index.ts @@ -5,8 +5,8 @@ import type { MiddlewareEndpointHandler, MiddlewareHandler, Params, -} from '../../@types/astro'; -import type { Environment, RenderContext } from '../render/index'; +} from '../../@types/astro.js'; +import type { Environment, RenderContext } from '../render/index.js'; import { renderEndpoint } from '../../runtime/server/index.js'; import { ASTRO_VERSION } from '../constants.js'; diff --git a/packages/astro/src/core/errors/index.ts b/packages/astro/src/core/errors/index.ts index 2b85574e9..eaa010cf0 100644 --- a/packages/astro/src/core/errors/index.ts +++ b/packages/astro/src/core/errors/index.ts @@ -1,4 +1,3 @@ -export type { ErrorLocation, ErrorWithMetadata } from './errors'; export { AstroErrorData } from './errors-data.js'; export { AggregateError, @@ -8,5 +7,6 @@ export { MarkdownError, isAstroError, } from './errors.js'; +export type { ErrorLocation, ErrorWithMetadata } from './errors.js'; export { codeFrame } from './printer.js'; export { createSafeError, positionAt } from './utils.js'; diff --git a/packages/astro/src/core/errors/overlay.ts b/packages/astro/src/core/errors/overlay.ts index 5a24f898a..ff56f2b5e 100644 --- a/packages/astro/src/core/errors/overlay.ts +++ b/packages/astro/src/core/errors/overlay.ts @@ -1,4 +1,4 @@ -import type { AstroErrorPayload } from './dev/vite'; +import type { AstroErrorPayload } from './dev/vite.js'; const style = /* css */ ` * { diff --git a/packages/astro/src/core/middleware/callMiddleware.ts b/packages/astro/src/core/middleware/callMiddleware.ts index afa0156c9..94ca176dc 100644 --- a/packages/astro/src/core/middleware/callMiddleware.ts +++ b/packages/astro/src/core/middleware/callMiddleware.ts @@ -4,10 +4,10 @@ import type { EndpointOutput, MiddlewareHandler, MiddlewareNext, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; import { warn } from '../logger/core.js'; -import type { Environment } from '../render'; +import type { Environment } from '../render/index.js'; /** * Utility function that is in charge of calling the middleware. diff --git a/packages/astro/src/core/middleware/index.ts b/packages/astro/src/core/middleware/index.ts index 90c5bdb5e..1b87bf1e1 100644 --- a/packages/astro/src/core/middleware/index.ts +++ b/packages/astro/src/core/middleware/index.ts @@ -1,4 +1,4 @@ -import type { MiddlewareResponseHandler, Params } from '../../@types/astro'; +import type { MiddlewareResponseHandler, Params } from '../../@types/astro.js'; import { createAPIContext } from '../endpoint/index.js'; import { sequence } from './sequence.js'; diff --git a/packages/astro/src/core/middleware/loadMiddleware.ts b/packages/astro/src/core/middleware/loadMiddleware.ts index 5c64565af..9a7f3e4bc 100644 --- a/packages/astro/src/core/middleware/loadMiddleware.ts +++ b/packages/astro/src/core/middleware/loadMiddleware.ts @@ -1,6 +1,6 @@ -import type { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro.js'; import { MIDDLEWARE_PATH_SEGMENT_NAME } from '../constants.js'; -import type { ModuleLoader } from '../module-loader'; +import type { ModuleLoader } from '../module-loader/index.js'; /** * It accepts a module loader and the astro settings, and it attempts to load the middlewares defined in the configuration. diff --git a/packages/astro/src/core/middleware/sequence.ts b/packages/astro/src/core/middleware/sequence.ts index 0358f3719..29b1d1623 100644 --- a/packages/astro/src/core/middleware/sequence.ts +++ b/packages/astro/src/core/middleware/sequence.ts @@ -1,4 +1,4 @@ -import type { APIContext, MiddlewareResponseHandler } from '../../@types/astro'; +import type { APIContext, MiddlewareResponseHandler } from '../../@types/astro.js'; import { defineMiddleware } from './index.js'; // From SvelteKit: https://github.com/sveltejs/kit/blob/master/packages/kit/src/exports/hooks/sequence.js diff --git a/packages/astro/src/core/module-loader/loader.ts b/packages/astro/src/core/module-loader/loader.ts index c686cef03..4d9872717 100644 --- a/packages/astro/src/core/module-loader/loader.ts +++ b/packages/astro/src/core/module-loader/loader.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'node:events'; import type * as fs from 'node:fs'; -import type { TypedEventEmitter } from '../../@types/typed-emitter'; +import type { TypedEventEmitter } from '../../@types/typed-emitter.js'; // This is a generic interface for a module loader. In the astro cli this is // fulfilled by Vite, see vite.ts diff --git a/packages/astro/src/core/module-loader/vite.ts b/packages/astro/src/core/module-loader/vite.ts index 88ad03cf7..f58b2e720 100644 --- a/packages/astro/src/core/module-loader/vite.ts +++ b/packages/astro/src/core/module-loader/vite.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'node:events'; import type * as vite from 'vite'; -import type { ModuleLoader, ModuleLoaderEventEmitter } from './loader'; +import type { ModuleLoader, ModuleLoaderEventEmitter } from './loader.js'; export function createViteLoader(viteServer: vite.ViteDevServer): ModuleLoader { const events = new EventEmitter() as ModuleLoaderEventEmitter; diff --git a/packages/astro/src/core/preview/index.ts b/packages/astro/src/core/preview/index.ts index d47e54499..d12fc6f46 100644 --- a/packages/astro/src/core/preview/index.ts +++ b/packages/astro/src/core/preview/index.ts @@ -2,9 +2,9 @@ import { cyan } from 'kleur/colors'; import { createRequire } from 'module'; import { pathToFileURL } from 'node:url'; import type { Arguments } from 'yargs-parser'; -import type { AstroSettings, PreviewModule, PreviewServer } from '../../@types/astro'; +import type { AstroSettings, PreviewModule, PreviewServer } from '../../@types/astro.js'; import { runHookConfigDone, runHookConfigSetup } from '../../integrations/index.js'; -import type { LogOptions } from '../logger/core'; +import type { LogOptions } from '../logger/core.js'; import { printHelp } from '../messages.js'; import createStaticPreviewServer from './static-preview-server.js'; import { getResolvedHostForHttpServer } from './util.js'; diff --git a/packages/astro/src/core/preview/static-preview-server.ts b/packages/astro/src/core/preview/static-preview-server.ts index 1fdc90c2a..7d1b0514e 100644 --- a/packages/astro/src/core/preview/static-preview-server.ts +++ b/packages/astro/src/core/preview/static-preview-server.ts @@ -3,8 +3,8 @@ import { fileURLToPath } from 'node:url'; import { performance } from 'perf_hooks'; import enableDestroy from 'server-destroy'; import { preview, type PreviewServer as VitePreviewServer } from 'vite'; -import type { AstroSettings } from '../../@types/astro'; -import type { LogOptions } from '../logger/core'; +import type { AstroSettings } from '../../@types/astro.js'; +import type { LogOptions } from '../logger/core.js'; import { error, info } from '../logger/core.js'; import * as msg from '../messages.js'; import { getResolvedHostForHttpServer } from './util.js'; diff --git a/packages/astro/src/core/redirects/component.ts b/packages/astro/src/core/redirects/component.ts index d10cae4fe..74f088ee0 100644 --- a/packages/astro/src/core/redirects/component.ts +++ b/packages/astro/src/core/redirects/component.ts @@ -1,5 +1,5 @@ -import type { ComponentInstance } from '../../@types/astro'; -import type { SinglePageBuiltModule } from '../build/types'; +import type { ComponentInstance } from '../../@types/astro.js'; +import type { SinglePageBuiltModule } from '../build/types.js'; // A stub of a component instance for a given route export const RedirectComponentInstance: ComponentInstance = { diff --git a/packages/astro/src/core/redirects/helpers.ts b/packages/astro/src/core/redirects/helpers.ts index a8d5f9938..7574f2714 100644 --- a/packages/astro/src/core/redirects/helpers.ts +++ b/packages/astro/src/core/redirects/helpers.ts @@ -1,4 +1,9 @@ -import type { Params, RedirectRouteData, RouteData, ValidRedirectStatus } from '../../@types/astro'; +import type { + Params, + RedirectRouteData, + RouteData, + ValidRedirectStatus, +} from '../../@types/astro.js'; export function routeIsRedirect(route: RouteData | undefined): route is RedirectRouteData { return route?.type === 'redirect'; diff --git a/packages/astro/src/core/render/context.ts b/packages/astro/src/core/render/context.ts index 5b26eda18..04c256735 100644 --- a/packages/astro/src/core/render/context.ts +++ b/packages/astro/src/core/render/context.ts @@ -5,9 +5,9 @@ import type { RouteData, SSRElement, SSRResult, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; -import type { Environment } from './environment'; +import type { Environment } from './environment.js'; import { getParamsAndProps } from './params-and-props.js'; const clientLocalsSymbol = Symbol.for('astro.locals'); diff --git a/packages/astro/src/core/render/core.ts b/packages/astro/src/core/render/core.ts index d6228fbbe..fccfc0e53 100644 --- a/packages/astro/src/core/render/core.ts +++ b/packages/astro/src/core/render/core.ts @@ -5,7 +5,7 @@ import type { MiddlewareHandler, MiddlewareResponseHandler, RouteType, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { renderPage as runtimeRenderPage } from '../../runtime/server/index.js'; import { attachToResponse } from '../cookies/index.js'; import { callEndpoint, createAPIContext, type EndpointCallResult } from '../endpoint/index.js'; diff --git a/packages/astro/src/core/render/environment.ts b/packages/astro/src/core/render/environment.ts index de7cbe6a8..4ea4e42ec 100644 --- a/packages/astro/src/core/render/environment.ts +++ b/packages/astro/src/core/render/environment.ts @@ -1,7 +1,7 @@ import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark'; -import type { AstroSettings, RuntimeMode, SSRLoadedRenderer } from '../../@types/astro'; +import type { AstroSettings, RuntimeMode, SSRLoadedRenderer } from '../../@types/astro.js'; import type { LogOptions } from '../logger/core.js'; -import type { ModuleLoader } from '../module-loader'; +import type { ModuleLoader } from '../module-loader/index.js'; import type { RouteCache } from './route-cache.js'; /** diff --git a/packages/astro/src/core/render/index.ts b/packages/astro/src/core/render/index.ts index a82c5699e..2dec302b0 100644 --- a/packages/astro/src/core/render/index.ts +++ b/packages/astro/src/core/render/index.ts @@ -1,11 +1,11 @@ -import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro'; -import type { DevelopmentEnvironment } from './environment'; +import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro.js'; +import type { DevelopmentEnvironment } from './environment.js'; export { createRenderContext } from './context.js'; export type { RenderContext } from './context.js'; export { tryRenderRoute } from './core.js'; -export type { Environment } from './environment'; export { createEnvironment } from './environment.js'; +export type { Environment } from './environment.js'; export { getParamsAndProps } from './params-and-props.js'; export { loadRenderer, loadRenderers } from './renderer.js'; export type { DevelopmentEnvironment }; diff --git a/packages/astro/src/core/render/paginate.ts b/packages/astro/src/core/render/paginate.ts index dffabe178..1df204986 100644 --- a/packages/astro/src/core/render/paginate.ts +++ b/packages/astro/src/core/render/paginate.ts @@ -5,7 +5,7 @@ import type { Params, Props, RouteData, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; export function generatePaginateFunction(routeMatch: RouteData): PaginateFunction { diff --git a/packages/astro/src/core/render/params-and-props.ts b/packages/astro/src/core/render/params-and-props.ts index a5e4fa222..28358d831 100644 --- a/packages/astro/src/core/render/params-and-props.ts +++ b/packages/astro/src/core/render/params-and-props.ts @@ -1,4 +1,4 @@ -import type { ComponentInstance, Params, Props, RouteData } from '../../@types/astro'; +import type { ComponentInstance, Params, Props, RouteData } from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; import type { LogOptions } from '../logger/core.js'; import { getParams } from '../routing/params.js'; diff --git a/packages/astro/src/core/render/renderer.ts b/packages/astro/src/core/render/renderer.ts index 8e5e97202..acfae7742 100644 --- a/packages/astro/src/core/render/renderer.ts +++ b/packages/astro/src/core/render/renderer.ts @@ -1,4 +1,4 @@ -import type { AstroRenderer, AstroSettings, SSRLoadedRenderer } from '../../@types/astro'; +import type { AstroRenderer, AstroSettings, SSRLoadedRenderer } from '../../@types/astro.js'; import type { ModuleLoader } from '../module-loader/index.js'; export async function loadRenderers( diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts index d86cce348..2c3a7bcb0 100644 --- a/packages/astro/src/core/render/result.ts +++ b/packages/astro/src/core/render/result.ts @@ -6,7 +6,7 @@ import type { SSRElement, SSRLoadedRenderer, SSRResult, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { isHTMLString } from '../../runtime/server/escape.js'; import { renderSlotToString, diff --git a/packages/astro/src/core/render/route-cache.ts b/packages/astro/src/core/render/route-cache.ts index 7ad247ef8..6c6308b90 100644 --- a/packages/astro/src/core/render/route-cache.ts +++ b/packages/astro/src/core/render/route-cache.ts @@ -6,7 +6,7 @@ import type { Params, RouteData, RuntimeMode, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; import { debug, warn, type LogOptions } from '../logger/core.js'; diff --git a/packages/astro/src/core/render/ssr-element.ts b/packages/astro/src/core/render/ssr-element.ts index 2d9bf9ae8..1d03e2622 100644 --- a/packages/astro/src/core/render/ssr-element.ts +++ b/packages/astro/src/core/render/ssr-element.ts @@ -1,6 +1,6 @@ -import type { SSRElement } from '../../@types/astro'; +import type { SSRElement } from '../../@types/astro.js'; import { joinPaths, prependForwardSlash, slash } from '../../core/path.js'; -import type { StylesheetAsset } from '../app/types'; +import type { StylesheetAsset } from '../app/types.js'; export function createAssetLink(href: string, base?: string, assetsPrefix?: string): string { if (assetsPrefix) { diff --git a/packages/astro/src/core/request.ts b/packages/astro/src/core/request.ts index 36222c7b6..d66d122ec 100644 --- a/packages/astro/src/core/request.ts +++ b/packages/astro/src/core/request.ts @@ -1,5 +1,5 @@ import type { IncomingHttpHeaders } from 'node:http'; -import type { LogOptions } from './logger/core'; +import type { LogOptions } from './logger/core.js'; import { warn } from './logger/core.js'; type HeaderType = Headers | Record | IncomingHttpHeaders; diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index e669f293b..80fc2d98b 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -5,8 +5,8 @@ import type { ManifestData, RouteData, RoutePart, -} from '../../../@types/astro'; -import type { LogOptions } from '../../logger/core'; +} from '../../../@types/astro.js'; +import type { LogOptions } from '../../logger/core.js'; import { createRequire } from 'module'; import nodeFs from 'node:fs'; diff --git a/packages/astro/src/core/routing/manifest/generator.ts b/packages/astro/src/core/routing/manifest/generator.ts index 4945ea9f1..60614f2e5 100644 --- a/packages/astro/src/core/routing/manifest/generator.ts +++ b/packages/astro/src/core/routing/manifest/generator.ts @@ -1,4 +1,4 @@ -import type { AstroConfig, RoutePart } from '../../../@types/astro'; +import type { AstroConfig, RoutePart } from '../../../@types/astro.js'; import { compile } from 'path-to-regexp'; diff --git a/packages/astro/src/core/routing/manifest/serialization.ts b/packages/astro/src/core/routing/manifest/serialization.ts index f27477eca..769af183b 100644 --- a/packages/astro/src/core/routing/manifest/serialization.ts +++ b/packages/astro/src/core/routing/manifest/serialization.ts @@ -1,4 +1,4 @@ -import type { AstroConfig, RouteData, SerializedRouteData } from '../../../@types/astro'; +import type { AstroConfig, RouteData, SerializedRouteData } from '../../../@types/astro.js'; import { getRouteGenerator } from './generator.js'; diff --git a/packages/astro/src/core/routing/match.ts b/packages/astro/src/core/routing/match.ts index 84b65fd6f..9b91e1e9a 100644 --- a/packages/astro/src/core/routing/match.ts +++ b/packages/astro/src/core/routing/match.ts @@ -1,4 +1,4 @@ -import type { ManifestData, RouteData } from '../../@types/astro'; +import type { ManifestData, RouteData } from '../../@types/astro.js'; /** Find matching route from pathname */ export function matchRoute(pathname: string, manifest: ManifestData): RouteData | undefined { diff --git a/packages/astro/src/core/routing/params.ts b/packages/astro/src/core/routing/params.ts index fc05c9696..9e03feeeb 100644 --- a/packages/astro/src/core/routing/params.ts +++ b/packages/astro/src/core/routing/params.ts @@ -1,4 +1,4 @@ -import type { GetStaticPathsItem, Params, RouteData } from '../../@types/astro'; +import type { GetStaticPathsItem, Params, RouteData } from '../../@types/astro.js'; import { validateGetStaticPathsParameter } from './validation.js'; /** diff --git a/packages/astro/src/core/routing/validation.ts b/packages/astro/src/core/routing/validation.ts index 9a562c044..495845586 100644 --- a/packages/astro/src/core/routing/validation.ts +++ b/packages/astro/src/core/routing/validation.ts @@ -1,6 +1,6 @@ -import type { ComponentInstance, GetStaticPathsResult, RouteData } from '../../@types/astro'; +import type { ComponentInstance, GetStaticPathsResult, RouteData } from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; -import type { LogOptions } from '../logger/core'; +import type { LogOptions } from '../logger/core.js'; import { warn } from '../logger/core.js'; const VALID_PARAM_TYPES = ['string', 'number', 'undefined']; diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 95377eeb8..dab71c901 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -3,7 +3,7 @@ import type fsMod from 'node:fs'; import { performance } from 'node:perf_hooks'; import { createServer, type HMRPayload } from 'vite'; import type { Arguments } from 'yargs-parser'; -import type { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro.js'; import { createContentTypesGenerator } from '../../content/index.js'; import { globalContentConfigObserver } from '../../content/utils.js'; import { runHookConfigSetup } from '../../integrations/index.js'; diff --git a/packages/astro/src/core/util.ts b/packages/astro/src/core/util.ts index e27348dcb..b51c59443 100644 --- a/packages/astro/src/core/util.ts +++ b/packages/astro/src/core/util.ts @@ -2,10 +2,10 @@ import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { normalizePath } from 'vite'; -import type { AstroConfig, AstroSettings, RouteType } from '../@types/astro'; +import type { AstroConfig, AstroSettings, RouteType } from '../@types/astro.js'; import { isServerLikeOutput } from '../prerender/utils.js'; import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './constants.js'; -import type { ModuleLoader } from './module-loader'; +import type { ModuleLoader } from './module-loader/index.js'; import { prependForwardSlash, removeTrailingForwardSlash, slash } from './path.js'; /** Returns true if argument is an object of any prototype/class (but not null). */ diff --git a/packages/astro/src/events/session.ts b/packages/astro/src/events/session.ts index 706779d4b..b37530342 100644 --- a/packages/astro/src/events/session.ts +++ b/packages/astro/src/events/session.ts @@ -1,4 +1,4 @@ -import type { AstroUserConfig } from '../@types/astro'; +import type { AstroUserConfig } from '../@types/astro.js'; const EVENT_SESSION = 'ASTRO_CLI_SESSION_STARTED'; diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index cf50df0e1..b838e7a82 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -12,8 +12,8 @@ import type { HookParameters, RouteData, } from '../@types/astro.js'; -import type { SerializedSSRManifest } from '../core/app/types'; -import type { PageBuildData } from '../core/build/types'; +import type { SerializedSSRManifest } from '../core/app/types.js'; +import type { PageBuildData } from '../core/build/types.js'; import { buildClientDirectiveEntrypoint } from '../core/client-directive/index.js'; import { mergeConfig } from '../core/config/index.js'; import { info, type LogOptions } from '../core/logger/core.js'; diff --git a/packages/astro/src/jsx/babel.ts b/packages/astro/src/jsx/babel.ts index 1ccd05fbc..e44af7267 100644 --- a/packages/astro/src/jsx/babel.ts +++ b/packages/astro/src/jsx/babel.ts @@ -3,7 +3,7 @@ import * as t from '@babel/types'; import { AstroErrorData } from '../core/errors/errors-data.js'; import { AstroError } from '../core/errors/errors.js'; import { resolvePath } from '../core/util.js'; -import type { PluginMetadata } from '../vite-plugin-astro/types'; +import type { PluginMetadata } from '../vite-plugin-astro/types.js'; const ClientOnlyPlaceholder = 'astro-client-only'; diff --git a/packages/astro/src/prerender/metadata.ts b/packages/astro/src/prerender/metadata.ts index 15527af37..a501cc46f 100644 --- a/packages/astro/src/prerender/metadata.ts +++ b/packages/astro/src/prerender/metadata.ts @@ -1,4 +1,4 @@ -import type { ModuleInfo, ModuleLoader } from '../core/module-loader'; +import type { ModuleInfo, ModuleLoader } from '../core/module-loader/index.js'; import { viteID } from '../core/util.js'; type GetPrerenderStatusParams = { diff --git a/packages/astro/src/prerender/routing.ts b/packages/astro/src/prerender/routing.ts index a3b3c0d54..a42f5cacd 100644 --- a/packages/astro/src/prerender/routing.ts +++ b/packages/astro/src/prerender/routing.ts @@ -1,6 +1,6 @@ -import type { AstroSettings, ComponentInstance, RouteData } from '../@types/astro'; +import type { AstroSettings, ComponentInstance, RouteData } from '../@types/astro.js'; import { RedirectComponentInstance, routeIsRedirect } from '../core/redirects/index.js'; -import type { DevelopmentEnvironment } from '../core/render'; +import type { DevelopmentEnvironment } from '../core/render/index.js'; import { preload } from '../vite-plugin-astro-server/index.js'; import { getPrerenderStatus } from './metadata.js'; diff --git a/packages/astro/src/prerender/utils.ts b/packages/astro/src/prerender/utils.ts index bd6e367ad..39a97de39 100644 --- a/packages/astro/src/prerender/utils.ts +++ b/packages/astro/src/prerender/utils.ts @@ -1,4 +1,4 @@ -import type { AstroConfig } from '../@types/astro'; +import type { AstroConfig } from '../@types/astro.js'; export function isServerLikeOutput(config: AstroConfig) { return config.output === 'server' || config.output === 'hybrid'; diff --git a/packages/astro/src/runtime/client/idle.ts b/packages/astro/src/runtime/client/idle.ts index 48aa9dc1f..990d5da6e 100644 --- a/packages/astro/src/runtime/client/idle.ts +++ b/packages/astro/src/runtime/client/idle.ts @@ -1,4 +1,4 @@ -import type { ClientDirective } from '../../@types/astro'; +import type { ClientDirective } from '../../@types/astro.js'; const idleDirective: ClientDirective = (load) => { const cb = async () => { diff --git a/packages/astro/src/runtime/client/load.ts b/packages/astro/src/runtime/client/load.ts index 15a2f1dcb..b603eecb3 100644 --- a/packages/astro/src/runtime/client/load.ts +++ b/packages/astro/src/runtime/client/load.ts @@ -1,4 +1,4 @@ -import type { ClientDirective } from '../../@types/astro'; +import type { ClientDirective } from '../../@types/astro.js'; const loadDirective: ClientDirective = async (load) => { const hydrate = await load(); diff --git a/packages/astro/src/runtime/client/media.ts b/packages/astro/src/runtime/client/media.ts index 3d92d3713..f894af311 100644 --- a/packages/astro/src/runtime/client/media.ts +++ b/packages/astro/src/runtime/client/media.ts @@ -1,4 +1,4 @@ -import type { ClientDirective } from '../../@types/astro'; +import type { ClientDirective } from '../../@types/astro.js'; /** * Hydrate this component when a matching media query is found diff --git a/packages/astro/src/runtime/client/only.ts b/packages/astro/src/runtime/client/only.ts index f67ae3ace..8e072b7a3 100644 --- a/packages/astro/src/runtime/client/only.ts +++ b/packages/astro/src/runtime/client/only.ts @@ -1,4 +1,4 @@ -import type { ClientDirective } from '../../@types/astro'; +import type { ClientDirective } from '../../@types/astro.js'; /** * Hydrate this component only on the client diff --git a/packages/astro/src/runtime/client/visible.ts b/packages/astro/src/runtime/client/visible.ts index cc4f77771..de36b2909 100644 --- a/packages/astro/src/runtime/client/visible.ts +++ b/packages/astro/src/runtime/client/visible.ts @@ -1,4 +1,4 @@ -import type { ClientDirective } from '../../@types/astro'; +import type { ClientDirective } from '../../@types/astro.js'; /** * Hydrate this component when one of it's children becomes visible diff --git a/packages/astro/src/runtime/server/astro-component.ts b/packages/astro/src/runtime/server/astro-component.ts index 57f2d3c3b..9acc099a9 100644 --- a/packages/astro/src/runtime/server/astro-component.ts +++ b/packages/astro/src/runtime/server/astro-component.ts @@ -1,4 +1,4 @@ -import type { PropagationHint } from '../../@types/astro'; +import type { PropagationHint } from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import type { AstroComponentFactory } from './render/index.js'; diff --git a/packages/astro/src/runtime/server/astro-global.ts b/packages/astro/src/runtime/server/astro-global.ts index 82855c669..c15cd8a4a 100644 --- a/packages/astro/src/runtime/server/astro-global.ts +++ b/packages/astro/src/runtime/server/astro-global.ts @@ -1,4 +1,4 @@ -import type { AstroGlobalPartial } from '../../@types/astro'; +import type { AstroGlobalPartial } from '../../@types/astro.js'; import { ASTRO_VERSION } from '../../core/constants.js'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; diff --git a/packages/astro/src/runtime/server/endpoint.ts b/packages/astro/src/runtime/server/endpoint.ts index c56ab7646..2dd295375 100644 --- a/packages/astro/src/runtime/server/endpoint.ts +++ b/packages/astro/src/runtime/server/endpoint.ts @@ -1,4 +1,4 @@ -import type { APIContext, EndpointHandler, Params } from '../../@types/astro'; +import type { APIContext, EndpointHandler, Params } from '../../@types/astro.js'; function getHandlerFromModule(mod: EndpointHandler, method: string) { // If there was an exact match on `method`, return that function. diff --git a/packages/astro/src/runtime/server/hydration.ts b/packages/astro/src/runtime/server/hydration.ts index bb8d64912..7d88438e5 100644 --- a/packages/astro/src/runtime/server/hydration.ts +++ b/packages/astro/src/runtime/server/hydration.ts @@ -3,7 +3,7 @@ import type { SSRElement, SSRLoadedRenderer, SSRResult, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import { escapeHTML } from './escape.js'; import { serializeProps } from './serialize.js'; diff --git a/packages/astro/src/runtime/server/jsx.ts b/packages/astro/src/runtime/server/jsx.ts index 48f879b10..4dfff12bc 100644 --- a/packages/astro/src/runtime/server/jsx.ts +++ b/packages/astro/src/runtime/server/jsx.ts @@ -11,7 +11,7 @@ import { voidElementNames, } from './index.js'; import { HTMLParts } from './render/common.js'; -import type { ComponentIterable } from './render/component'; +import type { ComponentIterable } from './render/component.js'; const ClientOnlyPlaceholder = 'astro-client-only'; diff --git a/packages/astro/src/runtime/server/render/astro/factory.ts b/packages/astro/src/runtime/server/render/astro/factory.ts index 97b8e4574..68d5af739 100644 --- a/packages/astro/src/runtime/server/render/astro/factory.ts +++ b/packages/astro/src/runtime/server/render/astro/factory.ts @@ -1,6 +1,6 @@ -import type { PropagationHint, SSRResult } from '../../../../@types/astro'; -import type { HeadAndContent } from './head-and-content'; -import type { RenderTemplateResult } from './render-template'; +import type { PropagationHint, SSRResult } from '../../../../@types/astro.js'; +import type { HeadAndContent } from './head-and-content.js'; +import type { RenderTemplateResult } from './render-template.js'; export type AstroFactoryReturnValue = RenderTemplateResult | Response | HeadAndContent; diff --git a/packages/astro/src/runtime/server/render/astro/head-and-content.ts b/packages/astro/src/runtime/server/render/astro/head-and-content.ts index d895d9dd6..eb32c3148 100644 --- a/packages/astro/src/runtime/server/render/astro/head-and-content.ts +++ b/packages/astro/src/runtime/server/render/astro/head-and-content.ts @@ -1,4 +1,4 @@ -import type { RenderTemplateResult } from './render-template'; +import type { RenderTemplateResult } from './render-template.js'; const headAndContentSym = Symbol.for('astro.headAndContent'); diff --git a/packages/astro/src/runtime/server/render/astro/index.ts b/packages/astro/src/runtime/server/render/astro/index.ts index f7d9923ee..f3df4800f 100644 --- a/packages/astro/src/runtime/server/render/astro/index.ts +++ b/packages/astro/src/runtime/server/render/astro/index.ts @@ -1,8 +1,8 @@ -export type { AstroComponentFactory } from './factory'; export { isAstroComponentFactory } from './factory.js'; +export type { AstroComponentFactory } from './factory.js'; export { createHeadAndContent, isHeadAndContent } from './head-and-content.js'; -export type { AstroComponentInstance } from './instance'; export { createAstroComponentInstance, isAstroComponentInstance } from './instance.js'; +export type { AstroComponentInstance } from './instance.js'; export { isRenderTemplateResult, renderAstroTemplateResult, diff --git a/packages/astro/src/runtime/server/render/astro/instance.ts b/packages/astro/src/runtime/server/render/astro/instance.ts index 527d4a8c6..9401a2475 100644 --- a/packages/astro/src/runtime/server/render/astro/instance.ts +++ b/packages/astro/src/runtime/server/render/astro/instance.ts @@ -1,4 +1,4 @@ -import type { SSRResult } from '../../../../@types/astro'; +import type { SSRResult } from '../../../../@types/astro.js'; import type { ComponentSlots } from '../slot.js'; import type { AstroComponentFactory, AstroFactoryReturnValue } from './factory.js'; diff --git a/packages/astro/src/runtime/server/render/astro/render-template.ts b/packages/astro/src/runtime/server/render/astro/render-template.ts index b0dbabdc1..4f657b6ed 100644 --- a/packages/astro/src/runtime/server/render/astro/render-template.ts +++ b/packages/astro/src/runtime/server/render/astro/render-template.ts @@ -1,4 +1,4 @@ -import type { RenderInstruction } from '../types'; +import type { RenderInstruction } from '../types.js'; import { HTMLBytes, markHTMLString } from '../../escape.js'; import { isPromise } from '../../util.js'; diff --git a/packages/astro/src/runtime/server/render/astro/render.ts b/packages/astro/src/runtime/server/render/astro/render.ts index 81b4375be..1aa4e079f 100644 --- a/packages/astro/src/runtime/server/render/astro/render.ts +++ b/packages/astro/src/runtime/server/render/astro/render.ts @@ -1,4 +1,4 @@ -import type { RouteData, SSRResult } from '../../../../@types/astro'; +import type { RouteData, SSRResult } from '../../../../@types/astro.js'; import { AstroError, AstroErrorData } from '../../../../core/errors/index.js'; import { chunkToByteArray, chunkToString, encoder, type RenderDestination } from '../common.js'; import type { AstroComponentFactory } from './factory.js'; diff --git a/packages/astro/src/runtime/server/render/common.ts b/packages/astro/src/runtime/server/render/common.ts index 206f138cc..bab2afc13 100644 --- a/packages/astro/src/runtime/server/render/common.ts +++ b/packages/astro/src/runtime/server/render/common.ts @@ -1,4 +1,4 @@ -import type { SSRResult } from '../../../@types/astro'; +import type { SSRResult } from '../../../@types/astro.js'; import type { RenderInstruction } from './types.js'; import { HTMLBytes, markHTMLString } from '../escape.js'; diff --git a/packages/astro/src/runtime/server/render/component.ts b/packages/astro/src/runtime/server/render/component.ts index 4eacafe80..283f0e66d 100644 --- a/packages/astro/src/runtime/server/render/component.ts +++ b/packages/astro/src/runtime/server/render/component.ts @@ -1,4 +1,8 @@ -import type { AstroComponentMetadata, SSRLoadedRenderer, SSRResult } from '../../../@types/astro'; +import type { + AstroComponentMetadata, + SSRLoadedRenderer, + SSRResult, +} from '../../../@types/astro.js'; import type { RenderInstruction } from './types.js'; import { AstroError, AstroErrorData } from '../../../core/errors/index.js'; diff --git a/packages/astro/src/runtime/server/render/dom.ts b/packages/astro/src/runtime/server/render/dom.ts index 803f29995..8ef1f5886 100644 --- a/packages/astro/src/runtime/server/render/dom.ts +++ b/packages/astro/src/runtime/server/render/dom.ts @@ -1,4 +1,4 @@ -import type { SSRResult } from '../../../@types/astro'; +import type { SSRResult } from '../../../@types/astro.js'; import { markHTMLString } from '../escape.js'; import { renderSlotToString } from './slot.js'; diff --git a/packages/astro/src/runtime/server/render/head.ts b/packages/astro/src/runtime/server/render/head.ts index 7bb38f07d..8bd63c26b 100644 --- a/packages/astro/src/runtime/server/render/head.ts +++ b/packages/astro/src/runtime/server/render/head.ts @@ -1,7 +1,7 @@ -import type { SSRResult } from '../../../@types/astro'; +import type { SSRResult } from '../../../@types/astro.js'; import { markHTMLString } from '../escape.js'; -import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './types'; +import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './types.js'; import { renderElement } from './util.js'; // Filter out duplicate elements in our set diff --git a/packages/astro/src/runtime/server/render/index.ts b/packages/astro/src/runtime/server/render/index.ts index d34bdd6c7..7bb36119b 100644 --- a/packages/astro/src/runtime/server/render/index.ts +++ b/packages/astro/src/runtime/server/render/index.ts @@ -1,10 +1,10 @@ -export type { AstroComponentFactory, AstroComponentInstance } from './astro/index'; export { createHeadAndContent, renderAstroTemplateResult, renderTemplate, renderToString, } from './astro/index.js'; +export type { AstroComponentFactory, AstroComponentInstance } from './astro/index.js'; export { Fragment, Renderer, stringifyChunk } from './common.js'; export { renderComponent, renderComponentToIterable } from './component.js'; export { renderHTMLElement } from './dom.js'; @@ -12,5 +12,5 @@ export { maybeRenderHead, renderHead } from './head.js'; export { renderPage } from './page.js'; export { renderSlot, renderSlotToString, type ComponentSlots } from './slot.js'; export { renderScriptElement, renderUniqueStylesheet } from './tags.js'; -export type { RenderInstruction } from './types'; +export type { RenderInstruction } from './types.js'; export { addAttribute, defineScriptVars, voidElementNames } from './util.js'; diff --git a/packages/astro/src/runtime/server/render/page.ts b/packages/astro/src/runtime/server/render/page.ts index 025b0b9e3..9bba39512 100644 --- a/packages/astro/src/runtime/server/render/page.ts +++ b/packages/astro/src/runtime/server/render/page.ts @@ -1,6 +1,6 @@ -import type { RouteData, SSRResult } from '../../../@types/astro'; -import type { ComponentIterable } from './component'; -import type { AstroComponentFactory } from './index'; +import type { RouteData, SSRResult } from '../../../@types/astro.js'; +import type { ComponentIterable } from './component.js'; +import type { AstroComponentFactory } from './index.js'; import { AstroError } from '../../../core/errors/index.js'; import { isHTMLString } from '../escape.js'; diff --git a/packages/astro/src/runtime/server/render/tags.ts b/packages/astro/src/runtime/server/render/tags.ts index f15da6571..cf44ee1ae 100644 --- a/packages/astro/src/runtime/server/render/tags.ts +++ b/packages/astro/src/runtime/server/render/tags.ts @@ -1,5 +1,5 @@ -import type { SSRElement, SSRResult } from '../../../@types/astro'; -import type { StylesheetAsset } from '../../../core/app/types'; +import type { SSRElement, SSRResult } from '../../../@types/astro.js'; +import type { StylesheetAsset } from '../../../core/app/types.js'; import { renderElement } from './util.js'; export function renderScriptElement({ props, children }: SSRElement) { diff --git a/packages/astro/src/runtime/server/render/util.ts b/packages/astro/src/runtime/server/render/util.ts index f422f66d5..d57a22ce7 100644 --- a/packages/astro/src/runtime/server/render/util.ts +++ b/packages/astro/src/runtime/server/render/util.ts @@ -1,4 +1,4 @@ -import type { SSRElement } from '../../../@types/astro'; +import type { SSRElement } from '../../../@types/astro.js'; import { HTMLString, markHTMLString } from '../escape.js'; import { serializeListValue } from '../util.js'; diff --git a/packages/astro/src/runtime/server/scripts.ts b/packages/astro/src/runtime/server/scripts.ts index a56f6686a..47cd122f1 100644 --- a/packages/astro/src/runtime/server/scripts.ts +++ b/packages/astro/src/runtime/server/scripts.ts @@ -1,4 +1,4 @@ -import type { SSRResult } from '../../@types/astro'; +import type { SSRResult } from '../../@types/astro.js'; import islandScript from './astro-island.prebuilt.js'; const ISLAND_STYLES = ``; diff --git a/packages/astro/src/runtime/server/serialize.ts b/packages/astro/src/runtime/server/serialize.ts index 7c0d46dee..25e185e82 100644 --- a/packages/astro/src/runtime/server/serialize.ts +++ b/packages/astro/src/runtime/server/serialize.ts @@ -1,4 +1,4 @@ -import type { AstroComponentMetadata } from '../../@types/astro'; +import type { AstroComponentMetadata } from '../../@types/astro.js'; type ValueOf = T[keyof T]; diff --git a/packages/astro/src/runtime/server/transition.ts b/packages/astro/src/runtime/server/transition.ts index 253a861f9..b8b3ae41a 100644 --- a/packages/astro/src/runtime/server/transition.ts +++ b/packages/astro/src/runtime/server/transition.ts @@ -3,7 +3,7 @@ import type { TransitionAnimation, TransitionAnimationValue, TransitionDirectionalAnimations, -} from '../../@types/astro'; +} from '../../@types/astro.js'; import { fade, slide } from '../../transitions/index.js'; import { markHTMLString } from './escape.js'; diff --git a/packages/astro/src/transitions/index.ts b/packages/astro/src/transitions/index.ts index ff3aee08c..576477468 100644 --- a/packages/astro/src/transitions/index.ts +++ b/packages/astro/src/transitions/index.ts @@ -1,4 +1,4 @@ -import type { TransitionAnimationPair, TransitionDirectionalAnimations } from '../@types/astro'; +import type { TransitionAnimationPair, TransitionDirectionalAnimations } from '../@types/astro.js'; export function slide({ duration, diff --git a/packages/astro/src/transitions/vite-plugin-transitions.ts b/packages/astro/src/transitions/vite-plugin-transitions.ts index 9803be211..1a066ec8a 100644 --- a/packages/astro/src/transitions/vite-plugin-transitions.ts +++ b/packages/astro/src/transitions/vite-plugin-transitions.ts @@ -1,5 +1,5 @@ import * as vite from 'vite'; -import type { AstroConfig } from '../@types/astro'; +import type { AstroConfig } from '../@types/astro.js'; import { AstroError } from '../core/errors/index.js'; const virtualModuleId = 'astro:transitions'; @@ -19,8 +19,8 @@ export default function astroTransitions({ config }: { config: AstroConfig }): v if (!config.experimental.viewTransitions) { throw new AstroError({ title: 'Experimental View Transitions not enabled', - message: `View Transitions support is experimental. To enable update your config to include: - + message: `View Transitions support is experimental. To enable update your config to include: + export default defineConfig({ experimental: { viewTransitions: true diff --git a/packages/astro/src/vite-plugin-astro-server/base.ts b/packages/astro/src/vite-plugin-astro-server/base.ts index f9e1c3fe4..2bdbb7418 100644 --- a/packages/astro/src/vite-plugin-astro-server/base.ts +++ b/packages/astro/src/vite-plugin-astro-server/base.ts @@ -1,5 +1,5 @@ import type * as vite from 'vite'; -import type { AstroSettings } from '../@types/astro'; +import type { AstroSettings } from '../@types/astro.js'; import * as fs from 'node:fs'; import { warn, type LogOptions } from '../core/logger/core.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/controller.ts b/packages/astro/src/vite-plugin-astro-server/controller.ts index 3004e68f3..279863613 100644 --- a/packages/astro/src/vite-plugin-astro-server/controller.ts +++ b/packages/astro/src/vite-plugin-astro-server/controller.ts @@ -1,5 +1,5 @@ -import type { LoaderEvents, ModuleLoader } from '../core/module-loader/index'; -import type { ServerState } from './server-state'; +import type { LoaderEvents, ModuleLoader } from '../core/module-loader/index.js'; +import type { ServerState } from './server-state.js'; import { clearRouteError, diff --git a/packages/astro/src/vite-plugin-astro-server/css.ts b/packages/astro/src/vite-plugin-astro-server/css.ts index 093bda461..46f1235bb 100644 --- a/packages/astro/src/vite-plugin-astro-server/css.ts +++ b/packages/astro/src/vite-plugin-astro-server/css.ts @@ -1,5 +1,5 @@ import type { RuntimeMode } from '../@types/astro.js'; -import type { ModuleLoader } from '../core/module-loader'; +import type { ModuleLoader } from '../core/module-loader/index.js'; import { viteID } from '../core/util.js'; import { isBuildableCSSRequest } from './util.js'; import { crawlGraph } from './vite.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/environment.ts b/packages/astro/src/vite-plugin-astro-server/environment.ts index bcf783bf2..b8b51359e 100644 --- a/packages/astro/src/vite-plugin-astro-server/environment.ts +++ b/packages/astro/src/vite-plugin-astro-server/environment.ts @@ -1,7 +1,7 @@ import type { AstroSettings, RuntimeMode, SSRManifest } from '../@types/astro.js'; import type { LogOptions } from '../core/logger/core.js'; -import type { ModuleLoader } from '../core/module-loader'; -import type { DevelopmentEnvironment } from '../core/render'; +import type { ModuleLoader } from '../core/module-loader/index.js'; +import type { DevelopmentEnvironment } from '../core/render/index.js'; import { createEnvironment } from '../core/render/index.js'; import { RouteCache } from '../core/render/route-cache.js'; import { isServerLikeOutput } from '../prerender/utils.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/index.ts b/packages/astro/src/vite-plugin-astro-server/index.ts index 17302ba41..76fd9a77f 100644 --- a/packages/astro/src/vite-plugin-astro-server/index.ts +++ b/packages/astro/src/vite-plugin-astro-server/index.ts @@ -1,7 +1,7 @@ import type { ComponentInstance } from '../@types/astro.js'; import { enhanceViteSSRError } from '../core/errors/dev/index.js'; import { AggregateError, CSSError, MarkdownError } from '../core/errors/index.js'; -import type { DevelopmentEnvironment } from '../core/render/environment'; +import type { DevelopmentEnvironment } from '../core/render/environment.js'; import { loadRenderers } from '../core/render/index.js'; import { viteID } from '../core/util.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/metadata.ts b/packages/astro/src/vite-plugin-astro-server/metadata.ts index 81e972dba..09e2373cf 100644 --- a/packages/astro/src/vite-plugin-astro-server/metadata.ts +++ b/packages/astro/src/vite-plugin-astro-server/metadata.ts @@ -1,5 +1,5 @@ -import type { SSRComponentMetadata, SSRResult } from '../@types/astro'; -import type { ModuleInfo, ModuleLoader } from '../core/module-loader'; +import type { SSRComponentMetadata, SSRResult } from '../@types/astro.js'; +import type { ModuleInfo, ModuleLoader } from '../core/module-loader/index.js'; import { viteID } from '../core/util.js'; import { getAstroMetadata } from '../vite-plugin-astro/index.js'; import { crawlGraph } from './vite.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts index 681aac341..ffd3fc1fd 100644 --- a/packages/astro/src/vite-plugin-astro-server/plugin.ts +++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts @@ -1,6 +1,6 @@ import type fs from 'node:fs'; import type * as vite from 'vite'; -import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro'; +import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro.js'; import { patchOverlay } from '../core/errors/overlay.js'; import type { LogOptions } from '../core/logger/core.js'; import { createViteLoader } from '../core/module-loader/index.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/request.ts b/packages/astro/src/vite-plugin-astro-server/request.ts index 2e6360e35..e70eacdb0 100644 --- a/packages/astro/src/vite-plugin-astro-server/request.ts +++ b/packages/astro/src/vite-plugin-astro-server/request.ts @@ -1,7 +1,7 @@ import type http from 'node:http'; -import type { ManifestData, SSRManifest } from '../@types/astro'; -import type { DevelopmentEnvironment } from '../core/render/index'; -import type { DevServerController } from './controller'; +import type { ManifestData, SSRManifest } from '../@types/astro.js'; +import type { DevelopmentEnvironment } from '../core/render/index.js'; +import type { DevServerController } from './controller.js'; import { collectErrorMetadata } from '../core/errors/dev/index.js'; import { createSafeError } from '../core/errors/index.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/resolve.ts b/packages/astro/src/vite-plugin-astro-server/resolve.ts index f67d83576..cbeda56b0 100644 --- a/packages/astro/src/vite-plugin-astro-server/resolve.ts +++ b/packages/astro/src/vite-plugin-astro-server/resolve.ts @@ -1,4 +1,4 @@ -import type { ModuleLoader } from '../core/module-loader'; +import type { ModuleLoader } from '../core/module-loader/index.js'; import { resolveIdToUrl } from '../core/util.js'; export function createResolve(loader: ModuleLoader, root: URL) { diff --git a/packages/astro/src/vite-plugin-astro-server/response.ts b/packages/astro/src/vite-plugin-astro-server/response.ts index 9e74a754f..b1c948095 100644 --- a/packages/astro/src/vite-plugin-astro-server/response.ts +++ b/packages/astro/src/vite-plugin-astro-server/response.ts @@ -1,6 +1,6 @@ import type http from 'node:http'; import type { ErrorWithMetadata } from '../core/errors/index.js'; -import type { ModuleLoader } from '../core/module-loader/index'; +import type { ModuleLoader } from '../core/module-loader/index.js'; import { Readable } from 'stream'; import { getSetCookiesFromResponse } from '../core/cookies/index.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index 119785a12..d7be5125f 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -7,7 +7,7 @@ import type { RouteData, SSRElement, SSRManifest, -} from '../@types/astro'; +} from '../@types/astro.js'; import { attachToResponse } from '../core/cookies/index.js'; import { AstroErrorData, isAstroError } from '../core/errors/index.js'; import { warn } from '../core/logger/core.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/scripts.ts b/packages/astro/src/vite-plugin-astro-server/scripts.ts index 55fe20254..00bc4054b 100644 --- a/packages/astro/src/vite-plugin-astro-server/scripts.ts +++ b/packages/astro/src/vite-plugin-astro-server/scripts.ts @@ -1,8 +1,8 @@ -import type { SSRElement } from '../@types/astro'; -import type { ModuleInfo, ModuleLoader } from '../core/module-loader'; +import type { SSRElement } from '../@types/astro.js'; +import type { ModuleInfo, ModuleLoader } from '../core/module-loader/index.js'; import { createModuleScriptElementWithSrc } from '../core/render/ssr-element.js'; import { rootRelativePath, viteID } from '../core/util.js'; -import type { PluginMetadata as AstroPluginMetadata } from '../vite-plugin-astro/types'; +import type { PluginMetadata as AstroPluginMetadata } from '../vite-plugin-astro/types.js'; import { crawlGraph } from './vite.js'; export async function getScriptsForURL( diff --git a/packages/astro/src/vite-plugin-astro-server/vite.ts b/packages/astro/src/vite-plugin-astro-server/vite.ts index ef6ffd308..6c2bc2497 100644 --- a/packages/astro/src/vite-plugin-astro-server/vite.ts +++ b/packages/astro/src/vite-plugin-astro-server/vite.ts @@ -1,6 +1,6 @@ import npath from 'node:path'; import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../core/constants.js'; -import type { ModuleLoader, ModuleNode } from '../core/module-loader/index'; +import type { ModuleLoader, ModuleNode } from '../core/module-loader/index.js'; import { unwrapId } from '../core/util.js'; import { isCSSRequest } from './util.js'; diff --git a/packages/astro/src/vite-plugin-astro/compile.ts b/packages/astro/src/vite-plugin-astro/compile.ts index b8704c81b..413dfac3b 100644 --- a/packages/astro/src/vite-plugin-astro/compile.ts +++ b/packages/astro/src/vite-plugin-astro/compile.ts @@ -1,5 +1,5 @@ import { transformWithEsbuild, type ESBuildTransformResult } from 'vite'; -import type { AstroConfig } from '../@types/astro'; +import type { AstroConfig } from '../@types/astro.js'; import { cachedCompilation, type CompileProps, type CompileResult } from '../core/compile/index.js'; import type { LogOptions } from '../core/logger/core.js'; import { getFileInfo } from '../vite-plugin-utils/index.js'; diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts index f123dba3a..9d707168c 100644 --- a/packages/astro/src/vite-plugin-astro/hmr.ts +++ b/packages/astro/src/vite-plugin-astro/hmr.ts @@ -1,6 +1,6 @@ import { fileURLToPath } from 'node:url'; import type { HmrContext, ModuleNode } from 'vite'; -import type { AstroConfig } from '../@types/astro'; +import type { AstroConfig } from '../@types/astro.js'; import { cachedCompilation, invalidateCompilation, diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index c5523d712..e5a1a495a 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -1,8 +1,8 @@ import type { SourceDescription } from 'rollup'; import type * as vite from 'vite'; -import type { AstroSettings } from '../@types/astro'; +import type { AstroSettings } from '../@types/astro.js'; import type { LogOptions } from '../core/logger/core.js'; -import type { PluginMetadata as AstroPluginMetadata } from './types'; +import type { PluginMetadata as AstroPluginMetadata } from './types.js'; import { normalizePath } from 'vite'; import { diff --git a/packages/astro/src/vite-plugin-astro/metadata.ts b/packages/astro/src/vite-plugin-astro/metadata.ts index ee66c12d0..d0a2b3644 100644 --- a/packages/astro/src/vite-plugin-astro/metadata.ts +++ b/packages/astro/src/vite-plugin-astro/metadata.ts @@ -1,5 +1,5 @@ -import type { ModuleInfo } from '../core/module-loader'; -import type { PluginMetadata } from './types'; +import type { ModuleInfo } from '../core/module-loader/index.js'; +import type { PluginMetadata } from './types.js'; export function getAstroMetadata(modInfo: ModuleInfo): PluginMetadata['astro'] | undefined { if (modInfo.meta?.astro) { diff --git a/packages/astro/src/vite-plugin-astro/types.ts b/packages/astro/src/vite-plugin-astro/types.ts index 8b74d7f33..49bbd5fea 100644 --- a/packages/astro/src/vite-plugin-astro/types.ts +++ b/packages/astro/src/vite-plugin-astro/types.ts @@ -1,5 +1,5 @@ import type { TransformResult } from '@astrojs/compiler'; -import type { PropagationHint } from '../@types/astro'; +import type { PropagationHint } from '../@types/astro.js'; export interface PageOptions { prerender?: boolean; diff --git a/packages/astro/src/vite-plugin-config-alias/index.ts b/packages/astro/src/vite-plugin-config-alias/index.ts index 3df286047..8b8535af9 100644 --- a/packages/astro/src/vite-plugin-config-alias/index.ts +++ b/packages/astro/src/vite-plugin-config-alias/index.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { normalizePath, type ResolvedConfig, type Plugin as VitePlugin } from 'vite'; -import type { AstroSettings } from '../@types/astro'; +import type { AstroSettings } from '../@types/astro.js'; type Alias = { find: RegExp; diff --git a/packages/astro/src/vite-plugin-env/index.ts b/packages/astro/src/vite-plugin-env/index.ts index 57a1ada63..1c7a6652c 100644 --- a/packages/astro/src/vite-plugin-env/index.ts +++ b/packages/astro/src/vite-plugin-env/index.ts @@ -2,7 +2,7 @@ import MagicString from 'magic-string'; import { fileURLToPath } from 'node:url'; import type * as vite from 'vite'; import { loadEnv } from 'vite'; -import type { AstroConfig, AstroSettings } from '../@types/astro'; +import type { AstroConfig, AstroSettings } from '../@types/astro.js'; interface EnvPluginOptions { settings: AstroSettings; diff --git a/packages/astro/src/vite-plugin-head/index.ts b/packages/astro/src/vite-plugin-head/index.ts index 9cfdc739f..f46697be4 100644 --- a/packages/astro/src/vite-plugin-head/index.ts +++ b/packages/astro/src/vite-plugin-head/index.ts @@ -1,8 +1,8 @@ import type { ModuleInfo } from 'rollup'; import type * as vite from 'vite'; -import type { SSRComponentMetadata, SSRResult } from '../@types/astro'; +import type { SSRComponentMetadata, SSRResult } from '../@types/astro.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js'; -import type { PluginMetadata } from '../vite-plugin-astro/types'; +import type { PluginMetadata } from '../vite-plugin-astro/types.js'; import { getTopLevelPages, walkParentInfos } from '../core/build/graph.js'; import type { BuildInternals } from '../core/build/internal.js'; diff --git a/packages/astro/src/vite-plugin-html/transform/escape.ts b/packages/astro/src/vite-plugin-html/transform/escape.ts index 1c250d43d..02825d3d7 100644 --- a/packages/astro/src/vite-plugin-html/transform/escape.ts +++ b/packages/astro/src/vite-plugin-html/transform/escape.ts @@ -1,8 +1,8 @@ import type { Root, RootContent } from 'hast'; -import type MagicString from 'magic-string'; import type { Plugin } from 'unified'; import { visit } from 'unist-util-visit'; +import type MagicString from 'magic-string'; import { escape, needsEscape, replaceAttribute } from './utils.js'; const rehypeEscape: Plugin<[{ s: MagicString }], Root> = ({ s }) => { diff --git a/packages/astro/src/vite-plugin-jsx/import-source.ts b/packages/astro/src/vite-plugin-jsx/import-source.ts index c1f9ea6dc..9b64d8d0a 100644 --- a/packages/astro/src/vite-plugin-jsx/import-source.ts +++ b/packages/astro/src/vite-plugin-jsx/import-source.ts @@ -1,5 +1,5 @@ import type { TsConfigJson } from 'tsconfig-resolver'; -import type { AstroRenderer } from '../@types/astro'; +import type { AstroRenderer } from '../@types/astro.js'; import { parseNpmName } from '../core/util.js'; export async function detectImportSource( diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts index 7aa7e7b16..a99a7dda2 100644 --- a/packages/astro/src/vite-plugin-jsx/index.ts +++ b/packages/astro/src/vite-plugin-jsx/index.ts @@ -5,9 +5,9 @@ import { type Plugin, type ResolvedConfig, } from 'vite'; -import type { AstroRenderer, AstroSettings } from '../@types/astro'; +import type { AstroRenderer, AstroSettings } from '../@types/astro.js'; import type { LogOptions } from '../core/logger/core.js'; -import type { PluginMetadata } from '../vite-plugin-astro/types'; +import type { PluginMetadata } from '../vite-plugin-astro/types.js'; import babel from '@babel/core'; import * as colors from 'kleur/colors'; diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts index 3d8202422..dfae82f48 100644 --- a/packages/astro/src/vite-plugin-markdown/index.ts +++ b/packages/astro/src/vite-plugin-markdown/index.ts @@ -9,7 +9,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import type { Plugin } from 'vite'; import { normalizePath } from 'vite'; -import type { AstroSettings } from '../@types/astro'; +import type { AstroSettings } from '../@types/astro.js'; import { AstroError, AstroErrorData, MarkdownError } from '../core/errors/index.js'; import type { LogOptions } from '../core/logger/core.js'; import { warn } from '../core/logger/core.js'; diff --git a/packages/astro/src/vite-plugin-utils/index.ts b/packages/astro/src/vite-plugin-utils/index.ts index 468360372..51f0e6cc4 100644 --- a/packages/astro/src/vite-plugin-utils/index.ts +++ b/packages/astro/src/vite-plugin-utils/index.ts @@ -1,6 +1,6 @@ import ancestor from 'common-ancestor-path'; import { fileURLToPath } from 'node:url'; -import type { AstroConfig } from '../@types/astro'; +import type { AstroConfig } from '../@types/astro.js'; import { appendExtension, appendForwardSlash, diff --git a/packages/astro/test/test-adapter.js b/packages/astro/test/test-adapter.js index 85b4d69c0..c2a6fd308 100644 --- a/packages/astro/test/test-adapter.js +++ b/packages/astro/test/test-adapter.js @@ -2,7 +2,7 @@ import { viteID } from '../dist/core/util.js'; /** * - * @returns {import('../src/@types/astro').AstroIntegration} + * @returns {import('../src/@types/astro.js').AstroIntegration} */ export default function ( { provideAddress = true, extendAdapter, setEntryPoints = undefined, setRoutes = undefined } = { diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js index 7301040c5..571bf8eac 100644 --- a/packages/astro/test/test-utils.js +++ b/packages/astro/test/test-utils.js @@ -28,7 +28,7 @@ process.env.ASTRO_TELEMETRY_DISABLED = true; /** * @typedef {import('undici').Response} Response * @typedef {import('../src/core/dev/dev').DedvServer} DevServer - * @typedef {import('../src/@types/astro').AstroConfig} AstroConfig + * @typedef {import('../src/@types/astro.js').AstroConfig} AstroConfig * @typedef {import('../src/core/preview/index').PreviewServer} PreviewServer * @typedef {import('../src/core/app/index').App} App * @typedef {import('../src/cli/check/index').AstroChecker} AstroChecker diff --git a/packages/astro/types.d.ts b/packages/astro/types.d.ts index 0939c828a..e7f319c6c 100644 --- a/packages/astro/types.d.ts +++ b/packages/astro/types.d.ts @@ -1,5 +1,5 @@ -import './astro-jsx'; -import { AstroBuiltinAttributes } from './dist/@types/astro'; +import './astro-jsx.js'; +import { AstroBuiltinAttributes } from './dist/@types/astro.js'; /** Any supported HTML or SVG element name, as defined by the HTML specification */ export type HTMLTag = keyof astroHTML.JSX.DefinedIntrinsicElements; diff --git a/packages/create-astro/src/actions/dependencies.ts b/packages/create-astro/src/actions/dependencies.ts index ed19fe485..0fd6c619c 100644 --- a/packages/create-astro/src/actions/dependencies.ts +++ b/packages/create-astro/src/actions/dependencies.ts @@ -1,7 +1,7 @@ import { color } from '@astrojs/cli-kit'; import { execa } from 'execa'; import { error, info, spinner, title } from '../messages.js'; -import type { Context } from './context'; +import type { Context } from './context.js'; export async function dependencies( ctx: Pick diff --git a/packages/create-astro/src/actions/git.ts b/packages/create-astro/src/actions/git.ts index 00c42dae5..19e27cd68 100644 --- a/packages/create-astro/src/actions/git.ts +++ b/packages/create-astro/src/actions/git.ts @@ -1,6 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; -import type { Context } from './context'; +import type { Context } from './context.js'; import { color } from '@astrojs/cli-kit'; import { execa } from 'execa'; diff --git a/packages/create-astro/src/actions/intro.ts b/packages/create-astro/src/actions/intro.ts index e4370d706..415642f50 100644 --- a/packages/create-astro/src/actions/intro.ts +++ b/packages/create-astro/src/actions/intro.ts @@ -1,4 +1,4 @@ -import type { Context } from './context'; +import type { Context } from './context.js'; import { color, label } from '@astrojs/cli-kit'; import { random } from '@astrojs/cli-kit/utils'; diff --git a/packages/create-astro/src/actions/next-steps.ts b/packages/create-astro/src/actions/next-steps.ts index 1b3a0db28..756e9d729 100644 --- a/packages/create-astro/src/actions/next-steps.ts +++ b/packages/create-astro/src/actions/next-steps.ts @@ -1,5 +1,5 @@ import path from 'node:path'; -import type { Context } from './context'; +import type { Context } from './context.js'; import { nextSteps, say } from '../messages.js'; diff --git a/packages/create-astro/src/actions/project-name.ts b/packages/create-astro/src/actions/project-name.ts index 943de91bf..f10eeb56a 100644 --- a/packages/create-astro/src/actions/project-name.ts +++ b/packages/create-astro/src/actions/project-name.ts @@ -1,4 +1,4 @@ -import type { Context } from './context'; +import type { Context } from './context.js'; import { color, generateProjectName } from '@astrojs/cli-kit'; import path from 'node:path'; @@ -32,7 +32,7 @@ export async function projectName(ctx: Pick { const file = data || (await fs.readFile(src)); - const { width, height, type, orientation } = sizeOf(file); + const { width, height, type, orientation } = (sizeOf as any)(file); const isPortrait = (orientation || 0) >= 5; if (!width || !height || !type) { diff --git a/packages/integrations/image/src/vendor/squoosh/codecs.ts b/packages/integrations/image/src/vendor/squoosh/codecs.ts index aa751387e..2cbefebe3 100644 --- a/packages/integrations/image/src/vendor/squoosh/codecs.ts +++ b/packages/integrations/image/src/vendor/squoosh/codecs.ts @@ -33,21 +33,21 @@ export interface RotateOptions { } // MozJPEG -import type { MozJPEGModule as MozJPEGEncodeModule } from './mozjpeg/mozjpeg_enc' +import type { MozJPEGModule as MozJPEGEncodeModule } from './mozjpeg/mozjpeg_enc.js' import mozDec from './mozjpeg/mozjpeg_node_dec.js' import mozDecWasm from './mozjpeg/mozjpeg_node_dec.wasm.js' import mozEnc from './mozjpeg/mozjpeg_node_enc.js' import mozEncWasm from './mozjpeg/mozjpeg_node_enc.wasm.js' // WebP -import type { WebPModule as WebPEncodeModule } from './webp/webp_enc' +import type { WebPModule as WebPEncodeModule } from './webp/webp_enc.js' import webpDec from './webp/webp_node_dec.js' import webpDecWasm from './webp/webp_node_dec.wasm.js' import webpEnc from './webp/webp_node_enc.js' import webpEncWasm from './webp/webp_node_enc.wasm.js' // AVIF -import type { AVIFModule as AVIFEncodeModule } from './avif/avif_enc' +import type { AVIFModule as AVIFEncodeModule } from './avif/avif_enc.js' import avifDec from './avif/avif_node_dec.js' import avifDecWasm from './avif/avif_node_dec.wasm.js' import avifEnc from './avif/avif_node_enc.js' diff --git a/packages/integrations/netlify/test/functions/test-utils.js b/packages/integrations/netlify/test/functions/test-utils.js index bed187962..f6d55ca85 100644 --- a/packages/integrations/netlify/test/functions/test-utils.js +++ b/packages/integrations/netlify/test/functions/test-utils.js @@ -5,7 +5,7 @@ export * from '../../../../astro/test/test-utils.js'; /** * - * @returns {import('../../../../astro/dist/types/@types/astro').AstroIntegration} + * @returns {import('../../../../astro/dist/types/@types/astro.js').AstroIntegration} */ export function testIntegration({ setEntryPoints } = {}) { return { diff --git a/packages/integrations/netlify/test/static/test-utils.js b/packages/integrations/netlify/test/static/test-utils.js index f57abab1d..1cec07747 100644 --- a/packages/integrations/netlify/test/static/test-utils.js +++ b/packages/integrations/netlify/test/static/test-utils.js @@ -5,7 +5,7 @@ export * from '../../../../astro/test/test-utils.js'; /** * - * @returns {import('../../../../astro/dist/types/@types/astro').AstroIntegration} + * @returns {import('../../../../astro/dist/types/@types/astro.js').AstroIntegration} */ export function testIntegration() { return { diff --git a/packages/integrations/node/src/index.ts b/packages/integrations/node/src/index.ts index 17a8f4502..c6b9ad6e2 100644 --- a/packages/integrations/node/src/index.ts +++ b/packages/integrations/node/src/index.ts @@ -1,5 +1,5 @@ import type { AstroAdapter, AstroIntegration } from 'astro'; -import type { Options, UserOptions } from './types'; +import type { Options, UserOptions } from './types.js'; export function getAdapter(options: Options): AstroAdapter { return { diff --git a/packages/integrations/node/src/nodeMiddleware.ts b/packages/integrations/node/src/nodeMiddleware.ts index 4963afc9f..13d1bbc0f 100644 --- a/packages/integrations/node/src/nodeMiddleware.ts +++ b/packages/integrations/node/src/nodeMiddleware.ts @@ -1,9 +1,9 @@ import type { NodeApp } from 'astro/app/node'; import type { IncomingMessage, ServerResponse } from 'node:http'; import type { Readable } from 'stream'; -import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders'; -import { responseIterator } from './response-iterator'; -import type { Options } from './types'; +import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders.js'; +import { responseIterator } from './response-iterator.js'; +import type { Options } from './types.js'; export default function (app: NodeApp, mode: Options['mode']) { return async function ( diff --git a/packages/integrations/node/src/preview.ts b/packages/integrations/node/src/preview.ts index 92f9b86ba..022e71633 100644 --- a/packages/integrations/node/src/preview.ts +++ b/packages/integrations/node/src/preview.ts @@ -2,7 +2,7 @@ import type { CreatePreviewServer } from 'astro'; import type http from 'node:http'; import { fileURLToPath } from 'node:url'; import { createServer } from './http-server.js'; -import type { createExports } from './server'; +import type { createExports } from './server.js'; const preview: CreatePreviewServer = async function ({ client, diff --git a/packages/integrations/node/src/server.ts b/packages/integrations/node/src/server.ts index 98f5cd14b..66efb0ce3 100644 --- a/packages/integrations/node/src/server.ts +++ b/packages/integrations/node/src/server.ts @@ -3,7 +3,7 @@ import type { SSRManifest } from 'astro'; import { NodeApp } from 'astro/app/node'; import middleware from './nodeMiddleware.js'; import startServer from './standalone.js'; -import type { Options } from './types'; +import type { Options } from './types.js'; polyfill(globalThis, { exclude: 'window document', diff --git a/packages/integrations/node/src/standalone.ts b/packages/integrations/node/src/standalone.ts index 68b2cebcd..090c23fb7 100644 --- a/packages/integrations/node/src/standalone.ts +++ b/packages/integrations/node/src/standalone.ts @@ -4,7 +4,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { createServer } from './http-server.js'; import middleware from './nodeMiddleware.js'; -import type { Options } from './types'; +import type { Options } from './types.js'; function resolvePaths(options: Options) { const clientURLRaw = new URL(options.client); diff --git a/packages/integrations/preact/package.json b/packages/integrations/preact/package.json index 391fdb547..e7c17e240 100644 --- a/packages/integrations/preact/package.json +++ b/packages/integrations/preact/package.json @@ -39,7 +39,7 @@ "@babel/plugin-transform-react-jsx": "^7.22.5", "@preact/signals": "^1.1.3", "babel-plugin-module-resolver": "^5.0.0", - "preact-render-to-string": "^5.2.6" + "preact-render-to-string": "^6.2.0" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/preact/src/client.ts b/packages/integrations/preact/src/client.ts index f90614398..60ccb85a2 100644 --- a/packages/integrations/preact/src/client.ts +++ b/packages/integrations/preact/src/client.ts @@ -1,6 +1,6 @@ import { h, render, type JSX } from 'preact'; import StaticHtml from './static-html.js'; -import type { SignalLike } from './types'; +import type { SignalLike } from './types.js'; const sharedSignalMap = new Map(); diff --git a/packages/integrations/preact/src/context.ts b/packages/integrations/preact/src/context.ts index c711017c4..4d2398d28 100644 --- a/packages/integrations/preact/src/context.ts +++ b/packages/integrations/preact/src/context.ts @@ -1,4 +1,4 @@ -import type { PropNameToSignalMap, RendererContext, SignalLike } from './types'; +import type { PropNameToSignalMap, RendererContext, SignalLike } from './types.js'; export type Context = { id: string; diff --git a/packages/integrations/preact/src/server.ts b/packages/integrations/preact/src/server.ts index 6a2ceb612..ea43fbb31 100644 --- a/packages/integrations/preact/src/server.ts +++ b/packages/integrations/preact/src/server.ts @@ -1,10 +1,10 @@ import type { AstroComponentMetadata } from 'astro'; import { Component as BaseComponent, h } from 'preact'; -import render from 'preact-render-to-string'; +import { render } from 'preact-render-to-string'; import { getContext } from './context.js'; import { restoreSignalsOnProps, serializeSignals } from './signals.js'; import StaticHtml from './static-html.js'; -import type { AstroPreactAttrs, RendererContext } from './types'; +import type { AstroPreactAttrs, RendererContext } from './types.js'; const slotName = (str: string) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); diff --git a/packages/integrations/preact/src/signals.ts b/packages/integrations/preact/src/signals.ts index 3fa1529f4..ef3a4b70a 100644 --- a/packages/integrations/preact/src/signals.ts +++ b/packages/integrations/preact/src/signals.ts @@ -1,6 +1,6 @@ -import type { Context } from './context'; +import type { Context } from './context.js'; import { incrementId } from './context.js'; -import type { AstroPreactAttrs, PropNameToSignalMap, SignalLike } from './types'; +import type { AstroPreactAttrs, PropNameToSignalMap, SignalLike } from './types.js'; function isSignal(x: any): x is SignalLike { return x != null && typeof x === 'object' && typeof x.peek === 'function' && 'value' in x; diff --git a/packages/integrations/solid/src/context.ts b/packages/integrations/solid/src/context.ts index 4846ee212..e18ead749 100644 --- a/packages/integrations/solid/src/context.ts +++ b/packages/integrations/solid/src/context.ts @@ -1,4 +1,4 @@ -import type { RendererContext } from './types'; +import type { RendererContext } from './types.js'; type Context = { id: string; diff --git a/packages/integrations/solid/src/server.ts b/packages/integrations/solid/src/server.ts index df2c2fce2..6e371da51 100644 --- a/packages/integrations/solid/src/server.ts +++ b/packages/integrations/solid/src/server.ts @@ -1,6 +1,6 @@ import { createComponent, renderToString, ssr } from 'solid-js/web'; import { getContext, incrementId } from './context.js'; -import type { RendererContext } from './types'; +import type { RendererContext } from './types.js'; const slotName = (str: string) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); diff --git a/packages/integrations/svelte/tsconfig.json b/packages/integrations/svelte/tsconfig.json index af1b43564..2dbbb7c71 100644 --- a/packages/integrations/svelte/tsconfig.json +++ b/packages/integrations/svelte/tsconfig.json @@ -5,6 +5,7 @@ "allowJs": true, "module": "ES2022", "outDir": "./dist", - "target": "ES2022" + "target": "ES2022", + "verbatimModuleSyntax": false } } diff --git a/packages/integrations/tailwind/src/index.ts b/packages/integrations/tailwind/src/index.ts index df0f01723..cfe69acd2 100644 --- a/packages/integrations/tailwind/src/index.ts +++ b/packages/integrations/tailwind/src/index.ts @@ -33,7 +33,7 @@ async function getViteConfiguration( const postcssOptions = postcssConfigResult?.options ?? {}; const postcssPlugins = postcssConfigResult?.plugins?.slice() ?? []; - postcssPlugins.push(tailwindPlugin(tailwindConfigPath) as ResultPlugin); + postcssPlugins.push((tailwindPlugin as any)(tailwindConfigPath) as ResultPlugin); postcssPlugins.push(autoprefixerPlugin()); return { diff --git a/packages/integrations/vercel/src/image/build-service.ts b/packages/integrations/vercel/src/image/build-service.ts index 973ceb22a..d2c257fbf 100644 --- a/packages/integrations/vercel/src/image/build-service.ts +++ b/packages/integrations/vercel/src/image/build-service.ts @@ -1,5 +1,5 @@ import type { ExternalImageService } from 'astro'; -import { isESMImportedImage, sharedValidateOptions } from './shared'; +import { isESMImportedImage, sharedValidateOptions } from './shared.js'; const service: ExternalImageService = { validateOptions: (options, serviceOptions) => diff --git a/packages/integrations/vercel/src/image/dev-service.ts b/packages/integrations/vercel/src/image/dev-service.ts index d812efb93..83f9d4d6a 100644 --- a/packages/integrations/vercel/src/image/dev-service.ts +++ b/packages/integrations/vercel/src/image/dev-service.ts @@ -1,6 +1,6 @@ import type { LocalImageService } from 'astro'; import squooshService from 'astro/assets/services/squoosh'; -import { sharedValidateOptions } from './shared'; +import { sharedValidateOptions } from './shared.js'; const service: LocalImageService = { validateOptions: (options, serviceOptions) => diff --git a/packages/integrations/vercel/src/serverless/entrypoint.ts b/packages/integrations/vercel/src/serverless/entrypoint.ts index 48c9b71d9..86bf40269 100644 --- a/packages/integrations/vercel/src/serverless/entrypoint.ts +++ b/packages/integrations/vercel/src/serverless/entrypoint.ts @@ -3,8 +3,8 @@ import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import type { IncomingMessage, ServerResponse } from 'node:http'; -import { ASTRO_LOCALS_HEADER } from './adapter'; -import { getRequest, setResponse } from './request-transform'; +import { ASTRO_LOCALS_HEADER } from './adapter.js'; +import { getRequest, setResponse } from './request-transform.js'; polyfill(globalThis, { exclude: 'window document', diff --git a/packages/integrations/vue/src/index.ts b/packages/integrations/vue/src/index.ts index 2c234952b..ade6214c9 100644 --- a/packages/integrations/vue/src/index.ts +++ b/packages/integrations/vue/src/index.ts @@ -59,7 +59,7 @@ async function getViteConfiguration(options?: Options): Promise { include: ['@astrojs/vue/client.js', 'vue'], exclude: ['@astrojs/vue/server.js', 'virtual:@astrojs/vue/app'], }, - plugins: [vue(options), virtualAppEntrypoint(options)], + plugins: [(vue as any)(options), virtualAppEntrypoint(options)], ssr: { external: ['@vue/server-renderer'], noExternal: ['vuetify', 'vueperslides', 'primevue'], @@ -69,7 +69,7 @@ async function getViteConfiguration(options?: Options): Promise { if (options?.jsx) { const vueJsx = (await import('@vitejs/plugin-vue-jsx')).default; const jsxOptions = typeof options.jsx === 'object' ? options.jsx : undefined; - config.plugins?.push(vueJsx(jsxOptions)); + config.plugins?.push((vueJsx as any)(jsxOptions)); } return config; diff --git a/packages/integrations/vue/tsconfig.json b/packages/integrations/vue/tsconfig.json index af1b43564..2dbbb7c71 100644 --- a/packages/integrations/vue/tsconfig.json +++ b/packages/integrations/vue/tsconfig.json @@ -5,6 +5,7 @@ "allowJs": true, "module": "ES2022", "outDir": "./dist", - "target": "ES2022" + "target": "ES2022", + "verbatimModuleSyntax": false } } diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index aa02f8ea9..7264877d7 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -3,7 +3,7 @@ import type { MarkdownRenderingOptions, MarkdownRenderingResult, MarkdownVFile, -} from './types'; +} from './types.js'; import { toRemarkInitializeAstroData } from './frontmatter-injection.js'; import { loadPlugins } from './load-plugins.js'; diff --git a/packages/markdown/remark/src/remark-collect-images.ts b/packages/markdown/remark/src/remark-collect-images.ts index a9f524f7a..ecaa82d1d 100644 --- a/packages/markdown/remark/src/remark-collect-images.ts +++ b/packages/markdown/remark/src/remark-collect-images.ts @@ -1,6 +1,6 @@ import type { Image } from 'mdast'; import { visit } from 'unist-util-visit'; -import type { MarkdownVFile } from './types'; +import type { MarkdownVFile } from './types.js'; export function remarkCollectImages() { return function (tree: any, vfile: MarkdownVFile) { diff --git a/packages/underscore-redirects/src/print.ts b/packages/underscore-redirects/src/print.ts index 5d7bd2387..2a9bec257 100644 --- a/packages/underscore-redirects/src/print.ts +++ b/packages/underscore-redirects/src/print.ts @@ -1,4 +1,4 @@ -import type { RedirectDefinition } from './redirects'; +import type { RedirectDefinition } from './redirects.js'; /** * Pretty print a list of definitions into the output format. Keeps diff --git a/packages/webapi/package.json b/packages/webapi/package.json index fcc3ec79d..aac8caa30 100644 --- a/packages/webapi/package.json +++ b/packages/webapi/package.json @@ -63,7 +63,7 @@ "@ungap/structured-clone": "^0.3.4", "chai": "^4.3.7", "event-target-shim": "^6.0.2", - "magic-string": "^0.27.0", + "magic-string": "^0.30.1", "mocha": "^9.2.2", "rollup": "^2.79.1", "tslib": "^2.5.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26b6d7a2d..75152fbd8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -591,8 +591,8 @@ importers: specifier: ^4.1.4 version: 4.1.5 magic-string: - specifier: ^0.27.0 - version: 0.27.0 + specifier: ^0.30.1 + version: 0.30.1 mime: specifier: ^3.0.0 version: 3.0.0 @@ -3788,8 +3788,8 @@ importers: specifier: ^4.1.5 version: 4.1.5 magic-string: - specifier: ^0.27.0 - version: 0.27.0 + specifier: ^0.30.1 + version: 0.30.1 mime: specifier: ^3.0.0 version: 3.0.0 @@ -4681,8 +4681,8 @@ importers: specifier: ^5.0.0 version: 5.0.0 preact-render-to-string: - specifier: ^5.2.6 - version: 5.2.6(preact@10.15.1) + specifier: ^6.2.0 + version: 6.2.0(preact@10.15.1) devDependencies: astro: specifier: workspace:* @@ -5414,8 +5414,8 @@ importers: specifier: ^6.0.2 version: 6.0.2 magic-string: - specifier: ^0.27.0 - version: 0.27.0 + specifier: ^0.30.1 + version: 0.30.1 mocha: specifier: ^9.2.2 version: 9.2.2 @@ -8756,7 +8756,7 @@ packages: debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 - magic-string: 0.30.0 + magic-string: 0.30.1 svelte: 3.59.1 svelte-hmr: 0.15.2(svelte@3.59.1) vite: 4.4.6(@types/node@18.16.18)(sass@1.63.4) @@ -9428,7 +9428,7 @@ packages: /@vitest/snapshot@0.31.4: resolution: {integrity: sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==} dependencies: - magic-string: 0.30.0 + magic-string: 0.30.1 pathe: 1.1.0 pretty-format: 27.5.1 dev: false @@ -9510,7 +9510,7 @@ packages: '@vue/reactivity-transform': 3.3.4 '@vue/shared': 3.3.4 estree-walker: 2.0.2 - magic-string: 0.30.0 + magic-string: 0.30.1 postcss: 8.4.24 source-map-js: 1.0.2 @@ -9527,7 +9527,7 @@ packages: '@vue/compiler-core': 3.3.4 '@vue/shared': 3.3.4 estree-walker: 2.0.2 - magic-string: 0.30.0 + magic-string: 0.30.1 /@vue/reactivity@3.1.5: resolution: {integrity: sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==} @@ -13648,9 +13648,10 @@ packages: engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + dev: false - /magic-string@0.30.0: - resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} + /magic-string@0.30.1: + resolution: {integrity: sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -15608,8 +15609,8 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /preact-render-to-string@5.2.6(preact@10.15.1): - resolution: {integrity: sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==} + /preact-render-to-string@6.2.0(preact@10.15.1): + resolution: {integrity: sha512-51HDkgWGssQvWhAXE6xWGSFgqXx+qzQPKatLBVm5Uxl2Bq8RHz+CcNMTWz3kjGNM8PL+9GZZfTLGHyR1wu6ZuA==} peerDependencies: preact: '>=10' dependencies: @@ -18019,7 +18020,7 @@ packages: concordance: 5.0.4 debug: 4.3.4 local-pkg: 0.4.3 - magic-string: 0.30.0 + magic-string: 0.30.1 pathe: 1.1.0 picocolors: 1.0.0 std-env: 3.3.3 @@ -18721,7 +18722,7 @@ packages: html-escaper: 3.0.3 js-yaml: 4.1.0 kleur: 4.1.5 - magic-string: 0.27.0 + magic-string: 0.30.1 mime: 3.0.0 network-information-types: 0.1.1(typescript@5.1.6) ora: 6.3.1 diff --git a/tsconfig.base.json b/tsconfig.base.json index 337005ad4..e06aaa60a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -3,8 +3,7 @@ "declaration": true, "emitDeclarationOnly": true, "strict": true, - // All packages are built with ESBuild, so we can use `moduleResolution: 'bundler'` - "moduleResolution": "Bundler", + "moduleResolution": "Node16", "esModuleInterop": true, "skipLibCheck": true, "verbatimModuleSyntax": true