diff --git a/.changeset/afraid-dots-whisper.md b/.changeset/afraid-dots-whisper.md new file mode 100644 index 000000000..a38150269 --- /dev/null +++ b/.changeset/afraid-dots-whisper.md @@ -0,0 +1,30 @@ +--- +'@astrojs/cloudflare': major +'@astrojs/partytown': major +'@astrojs/tailwind': major +'@astrojs/netlify': major +'@astrojs/sitemap': major +'@astrojs/preact': major +'@astrojs/svelte': major +'@astrojs/vercel': major +'@astrojs/react': major +'@astrojs/solid-js': major +'@astrojs/deno': major +'@astrojs/node': major +'@astrojs/lit': major +'@astrojs/vue': major +'create-astro': major +'@astrojs/prism': major +'@astrojs/rss': major +'@astrojs/telemetry': major +'astro': major +'@astrojs/turbolinks': minor +'@astrojs/alpinejs': minor +'@astrojs/prefetch': minor +'@astrojs/markdoc': minor +'@astrojs/underscore-redirects': minor +'@astrojs/mdx': minor +'@astrojs/internal-helpers': minor +--- + +Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. diff --git a/.changeset/big-tips-whisper.md b/.changeset/big-tips-whisper.md new file mode 100644 index 000000000..ad532760f --- /dev/null +++ b/.changeset/big-tips-whisper.md @@ -0,0 +1,5 @@ +--- +'@astrojs/internal-helpers': patch +--- + +Trigger re-release to fix `collapseDuplicateSlashes` export diff --git a/.changeset/chilled-ducks-grin.md b/.changeset/chilled-ducks-grin.md new file mode 100644 index 000000000..b63b1f29c --- /dev/null +++ b/.changeset/chilled-ducks-grin.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removed automatic flattening of `getStaticPaths` result. `.flatMap` and `.flat` should now be used to ensure that you're returning a flat array. diff --git a/.changeset/clever-bats-breathe.md b/.changeset/clever-bats-breathe.md new file mode 100644 index 000000000..2c1a6dc39 --- /dev/null +++ b/.changeset/clever-bats-breathe.md @@ -0,0 +1,13 @@ +--- +'astro': major +--- + +This import alias is no longer included by default with astro:assets. If you were using this alias with experimental assets, you must convert them to relative file paths, or create your own [import aliases](https://docs.astro.build/en/guides/aliases/). + +```diff +--- +// src/pages/posts/post-1.astro +- import rocket from '~/assets/rocket.png' ++ import rocket from '../../assets/rocket.png'; +--- +``` diff --git a/.changeset/cool-feet-rest.md b/.changeset/cool-feet-rest.md new file mode 100644 index 000000000..c2e724d80 --- /dev/null +++ b/.changeset/cool-feet-rest.md @@ -0,0 +1,7 @@ +--- +'@astrojs/solid-js': major +--- + +New `include` and `exclude` config options + +The Solid integration now has new `include` and `exclude` config options. Use these if you want to use Solid alongside another JSX framework; include specifies files to be compiled for Solid and `exclude` does the opposite. diff --git a/.changeset/dirty-lies-cover.md b/.changeset/dirty-lies-cover.md new file mode 100644 index 000000000..ae74e348e --- /dev/null +++ b/.changeset/dirty-lies-cover.md @@ -0,0 +1,32 @@ +--- +'@astrojs/cloudflare': minor +'@astrojs/netlify': minor +'@astrojs/vercel': minor +'@astrojs/deno': minor +'@astrojs/node': minor +'astro': minor +--- + +Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter +can tell Astro if it can support it. + +```ts +import {AstroIntegration} from "./astro"; + +function myIntegration(): AstroIntegration { + return { + name: 'astro-awesome-list', + // new feature map + supportedAstroFeatures: { + hybridOutput: 'experimental', + staticOutput: 'stable', + serverOutput: 'stable', + assets: { + supportKind: 'stable', + isSharpCompatible: false, + isSquooshCompatible: false, + }, + } + } +} +``` diff --git a/.changeset/fair-emus-divide.md b/.changeset/fair-emus-divide.md new file mode 100644 index 000000000..529760241 --- /dev/null +++ b/.changeset/fair-emus-divide.md @@ -0,0 +1,39 @@ +--- +'astro': major +'@astrojs/netlify': minor +--- + +The `build.split` and `build.excludeMiddleware` configuration options are deprecated and have been replaced by options in the adapter config. + +If your config includes the `build.excludeMiddleware` option, replace it with `edgeMiddleware` in your adapter options: + +```diff +import { defineConfig } from "astro/config"; +import netlify from "@astrojs/netlify/functions"; + +export default defineConfig({ + build: { +- excludeMiddleware: true + }, + adapter: netlify({ ++ edgeMiddleware: true + }), +}); +``` + +If your config includes the `build.split` option, replace it with `functionPerRoute` in your adapter options: + +```diff +import { defineConfig } from "astro/config"; +import netlify from "@astrojs/netlify/functions"; + +export default defineConfig({ + build: { +- split: true + }, + adapter: netlify({ ++ functionPerRoute: true + }), +}); +``` + diff --git a/.changeset/famous-queens-itch.md b/.changeset/famous-queens-itch.md new file mode 100644 index 000000000..e3538cdd6 --- /dev/null +++ b/.changeset/famous-queens-itch.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Re-orders the MDX plugin to run before Astro's JSX plugin diff --git a/.changeset/four-houses-compete.md b/.changeset/four-houses-compete.md new file mode 100644 index 000000000..641bb1035 --- /dev/null +++ b/.changeset/four-houses-compete.md @@ -0,0 +1,18 @@ +--- +'astro': major +--- + +Sharp is now the default image service used for `astro:assets`. If you would prefer to still use Squoosh, you can update your config with the following: + +```ts +import { defineConfig, squooshImageService } from "astro/config"; + +// https://astro.build/config +export default defineConfig({ + image: { + service: squooshImageService(), + } +}) +``` + +However, not only do we recommend using Sharp as it is faster and more reliable, it is also highly likely that the Squoosh service will be removed in a future release. diff --git a/.changeset/gentle-deers-yawn.md b/.changeset/gentle-deers-yawn.md new file mode 100644 index 000000000..30e577c69 --- /dev/null +++ b/.changeset/gentle-deers-yawn.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Call `astro sync` once before calling `astro check` diff --git a/.changeset/gentle-meals-crash.md b/.changeset/gentle-meals-crash.md new file mode 100644 index 000000000..5314442ea --- /dev/null +++ b/.changeset/gentle-meals-crash.md @@ -0,0 +1,9 @@ +--- +'astro': major +--- + +Remove support for `Astro.__renderMarkdown` which is used by `@astrojs/markdown-component`. + +The `` component was deprecated in Astro v1 and is completely removed in v3. This integration must now be removed from your project. + +As an alternative, you can use community packages that provide a similar component like https://github.com/natemoo-re/astro-remote instead. diff --git a/.changeset/giant-plants-sip.md b/.changeset/giant-plants-sip.md new file mode 100644 index 000000000..884021b8e --- /dev/null +++ b/.changeset/giant-plants-sip.md @@ -0,0 +1,29 @@ +--- +'astro': major +--- + +Remove backwards-compatible kebab-case transform for camelCase CSS variable names passed to the `style` attribute. If you were relying on the kebab-case transform in your styles, make sure to use the camelCase version to prevent missing styles. For example: + +```astro +--- +const myValue = "red" +--- + + +
+ + +
+ + +
+``` + +```diff + +``` \ No newline at end of file diff --git a/.changeset/heavy-walls-arrive.md b/.changeset/heavy-walls-arrive.md new file mode 100644 index 000000000..68f64dacb --- /dev/null +++ b/.changeset/heavy-walls-arrive.md @@ -0,0 +1,8 @@ +--- +'@astrojs/cloudflare': major +'@astrojs/netlify': major +'@astrojs/vercel': major +'astro': major +--- + +When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits of `astro:assets` such as enforcing `alt`, no CLS etc to users diff --git a/.changeset/large-countries-share.md b/.changeset/large-countries-share.md new file mode 100644 index 000000000..b3101d2f2 --- /dev/null +++ b/.changeset/large-countries-share.md @@ -0,0 +1,7 @@ +--- +'@astrojs/preact': major +--- + +New `include` and `exclude` config options + +The Preact integration now has new `include` and `exclude` config options. Use these if you want to use Preact alongside another JSX framework; include specifies files to be compiled for Preact and `exclude` does the opposite. diff --git a/.changeset/loud-candles-admire.md b/.changeset/loud-candles-admire.md new file mode 100644 index 000000000..3fe1f12e7 --- /dev/null +++ b/.changeset/loud-candles-admire.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Handle `components` exports handling itself diff --git a/.changeset/mighty-dancers-lay.md b/.changeset/mighty-dancers-lay.md new file mode 100644 index 000000000..873c4edd1 --- /dev/null +++ b/.changeset/mighty-dancers-lay.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removed support for old syntax of the API routes. diff --git a/.changeset/neat-mugs-end.md b/.changeset/neat-mugs-end.md new file mode 100644 index 000000000..dd65708a7 --- /dev/null +++ b/.changeset/neat-mugs-end.md @@ -0,0 +1,8 @@ +--- +'astro': minor +--- + + +`astro:`namespace aliases for middleware and components + +This adds aliases of `astro:middleware` and `astro:components` for the middleware and components modules. This is to make our documentation consistent between are various modules, where some are virtual modules and others are not. Going forward new built-in modules will use this namespace. diff --git a/.changeset/neat-owls-run.md b/.changeset/neat-owls-run.md new file mode 100644 index 000000000..501b5319f --- /dev/null +++ b/.changeset/neat-owls-run.md @@ -0,0 +1,25 @@ +--- +'astro': major +--- + +Remove exports for `astro/internal/*` and `astro/runtime/server/*` in favour of `astro/runtime/*`. Add new `astro/compiler-runtime` export for compiler-specific runtime code. + +These are exports for Astro's internal API and should not affect your project, but if you do use these entrypoints, you can migrate like below: + +```diff +- import 'astro/internal/index.js'; ++ import 'astro/runtime/server/index.js'; + +- import 'astro/server/index.js'; ++ import 'astro/runtime/server/index.js'; +``` + +```diff +import { transform } from '@astrojs/compiler'; + +const result = await transform(source, { +- internalURL: 'astro/runtime/server/index.js', ++ internalURL: 'astro/compiler-runtime', + // ... +}); +``` diff --git a/.changeset/neat-suns-search.md b/.changeset/neat-suns-search.md new file mode 100644 index 000000000..da743c9c7 --- /dev/null +++ b/.changeset/neat-suns-search.md @@ -0,0 +1,17 @@ +--- +'astro': major +--- + +Implements a new scope style strategy called `"attribute"`. When enabled, styles are applied using `data-*` attributes. + +The **default** value of `scopedStyleStrategy` is `"attribute"`. + +If you want to use the previous behaviour, you have to use the `"where"` option: + +```diff +import { defineConfig } from 'astro/config'; + +export default defineConfig({ ++ scopedStyleStrategy: 'where', +}); +``` diff --git a/.changeset/odd-books-live.md b/.changeset/odd-books-live.md new file mode 100644 index 000000000..40f0d7c17 --- /dev/null +++ b/.changeset/odd-books-live.md @@ -0,0 +1,23 @@ +--- +'astro': minor +--- + +Integrations can now log messages using Astro’s built-in logger. + +The logger is available to all hooks as an additional parameter: + +```ts +import {AstroIntegration} from "./astro"; + +// integration.js +export function myIntegration(): AstroIntegration { + return { + name: "my-integration", + hooks: { + "astro:config:done": ({ logger }) => { + logger.info("Configure integration..."); + } + } + } +} +``` diff --git a/.changeset/perfect-horses-tell.md b/.changeset/perfect-horses-tell.md new file mode 100644 index 000000000..7723c665f --- /dev/null +++ b/.changeset/perfect-horses-tell.md @@ -0,0 +1,27 @@ +--- +'astro': major +--- + +Astro's JSX handling has been refactored with better support for each framework. + +Previously, Astro automatically scanned your components to determine which framework-specific transformations should be used. In practice, supporting advanced features like Fast Refresh with this approach proved difficult. + +Now, Astro determines which framework to use with `include` and `exclude` config options where you can specify files and folders on a per-framework basis. When using multiple JSX frameworks in the same project, users should manually control which files belong to each framework using the `include` and `exclude` options. + +```js +export default defineConfig({ + // The `include` config is only needed in projects that use multiple JSX frameworks; + // if only using one no extra config is needed. + integrations: [ + preact({ + include: ['**/preact/*'] + }), + react({ + include: ['**/react/*'] + }), + solid({ + include: ['**/solid/*'], + }), + ] +}); +``` diff --git a/.changeset/plenty-keys-add.md b/.changeset/plenty-keys-add.md new file mode 100644 index 000000000..73a78ba3b --- /dev/null +++ b/.changeset/plenty-keys-add.md @@ -0,0 +1,23 @@ +--- +'@astrojs/vercel': major +--- + +Remove the Vercel Edge adapter + + `@astrojs/vercel/serverless` now supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change: + + ```diff + // astro.config.mjs +import { defineConfig } from 'astro/config'; +- import vercel from '@astrojs/vercel/edge'; ++ import vercel from '@astrojs/vercel/serverless'; + +export default defineConfig({ + output: 'server', + adapter: vercel({ ++ edgeMiddleware: true + }), +}); +``` + +This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serveless + Edge Middleware, we are removing the Edge adapter. diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 000000000..d0d69690d --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,73 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "astro": "2.9.6", + "@astrojs/prism": "2.1.2", + "@astrojs/rss": "2.4.3", + "create-astro": "3.1.10", + "@astrojs/alpinejs": "0.2.2", + "@astrojs/cloudflare": "6.6.2", + "@astrojs/deno": "4.3.0", + "@astrojs/lit": "2.1.0", + "@astrojs/markdoc": "0.4.4", + "@astrojs/mdx": "0.19.7", + "@astrojs/netlify": "2.5.1", + "@astrojs/node": "5.3.0", + "@astrojs/partytown": "1.2.3", + "@astrojs/preact": "2.2.1", + "@astrojs/prefetch": "0.3.0", + "@astrojs/react": "2.2.1", + "@astrojs/sitemap": "2.0.1", + "@astrojs/solid-js": "2.2.0", + "@astrojs/svelte": "3.1.0", + "@astrojs/tailwind": "4.0.0", + "@astrojs/turbolinks": "0.2.2", + "@astrojs/vercel": "3.7.4", + "@astrojs/vue": "2.2.1", + "@astrojs/internal-helpers": "0.1.1", + "@astrojs/markdown-remark": "2.2.1", + "@astrojs/telemetry": "2.1.1", + "@astrojs/underscore-redirects": "0.2.0" + }, + "changesets": [ + "afraid-dots-whisper", + "big-tips-whisper", + "breezy-frogs-learn", + "chilled-ducks-grin", + "cool-feet-rest", + "dirty-lies-cover", + "fair-emus-divide", + "famous-queens-itch", + "four-houses-compete", + "gentle-deers-yawn", + "gentle-meals-crash", + "giant-plants-sip", + "heavy-walls-arrive", + "large-countries-share", + "loud-candles-admire", + "mighty-dancers-lay", + "neat-suns-search", + "odd-books-live", + "perfect-horses-tell", + "plenty-keys-add", + "purple-buses-prove", + "rude-ears-play", + "six-grapes-look", + "slimy-carrots-sell", + "spicy-eels-rush", + "tame-files-glow", + "three-adults-exist", + "three-onions-repeat", + "tricky-candles-suffer", + "twelve-coats-rush", + "twenty-cheetahs-deny", + "unlucky-hotels-try", + "unlucky-ravens-type", + "unlucky-sheep-build", + "violet-peaches-invent", + "wild-bobcats-carry", + "wild-jobs-tan", + "young-roses-teach" + ] +} diff --git a/.changeset/purple-buses-prove.md b/.changeset/purple-buses-prove.md new file mode 100644 index 000000000..c1e4876c9 --- /dev/null +++ b/.changeset/purple-buses-prove.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Remove StreamingCompatibleResponse polyfill diff --git a/.changeset/quick-boats-bow.md b/.changeset/quick-boats-bow.md new file mode 100644 index 000000000..1ab83ed5a --- /dev/null +++ b/.changeset/quick-boats-bow.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removed duplicate `astro/dist/jsx` export. Please use the `astro/jsx` export instead diff --git a/.changeset/rude-ears-play.md b/.changeset/rude-ears-play.md new file mode 100644 index 000000000..660cfcb34 --- /dev/null +++ b/.changeset/rude-ears-play.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Remove MDX plugin re-ordering hack diff --git a/.changeset/six-grapes-look.md b/.changeset/six-grapes-look.md new file mode 100644 index 000000000..edf10e01a --- /dev/null +++ b/.changeset/six-grapes-look.md @@ -0,0 +1,15 @@ +--- +'astro': major +--- + +The value of `import.meta.env.BASE_URL`, which is derived from the `base` option, will no longer have a trailing slash added by default or when `trailingSlash: "ignore"` is set. The existing behavior of `base` in combination with `trailingSlash: "always"` or `trailingSlash: "never"` is unchanged. + +If your `base` already has a trailing slash, no change is needed. + +If your `base` does not have a trailing slash, add one to preserve the previous behaviour: + +```diff +// astro.config.mjs +- base: 'my-base', ++ base: 'my-base/', +``` diff --git a/.changeset/slimy-carrots-sell.md b/.changeset/slimy-carrots-sell.md new file mode 100644 index 000000000..c1c9e694f --- /dev/null +++ b/.changeset/slimy-carrots-sell.md @@ -0,0 +1,9 @@ +--- +'@astrojs/react': major +--- + +Support for React Refresh + +The React integration now fully supports React Refresh and is backed by `@vitejs/plugin-react`. + +Also included in this change are new `include` and `exclude` config options. Use these if you want to use React alongside another JSX framework; include specifies files to be compiled for React and `exclude` does the opposite. diff --git a/.changeset/spicy-eels-rush.md b/.changeset/spicy-eels-rush.md new file mode 100644 index 000000000..672de5c7d --- /dev/null +++ b/.changeset/spicy-eels-rush.md @@ -0,0 +1,8 @@ +--- +'astro': major +'@astrojs/netlify': major +'@astrojs/vercel': major +'@astrojs/node': major +--- + +Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm. diff --git a/.changeset/strong-papayas-chew.md b/.changeset/strong-papayas-chew.md new file mode 100644 index 000000000..f9d7bf4c2 --- /dev/null +++ b/.changeset/strong-papayas-chew.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Sync Astro Asset support across both modes diff --git a/.changeset/tame-files-glow.md b/.changeset/tame-files-glow.md new file mode 100644 index 000000000..32d95b5da --- /dev/null +++ b/.changeset/tame-files-glow.md @@ -0,0 +1,23 @@ +--- +'@astrojs/netlify': major +--- + +Remove the Netlify Edge adapter + + `@astrojs/netlify/functions` now supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change: + + ```diff + // astro.config.mjs +import { defineConfig } from 'astro/config'; +- import netlify from '@astrojs/netlify/edge'; ++ import netlify from '@astrojs/netlify/functions'; + +export default defineConfig({ + output: 'server', + adapter: netlify({ ++ edgeMiddleware: true + }), +}); +``` + +This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serveless + Edge Middleware, we are removing the Edge adapter. diff --git a/.changeset/tasty-camels-speak.md b/.changeset/tasty-camels-speak.md new file mode 100644 index 000000000..374163d9b --- /dev/null +++ b/.changeset/tasty-camels-speak.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Update Astro types to reflect that compress defaults to true diff --git a/.changeset/three-adults-exist.md b/.changeset/three-adults-exist.md new file mode 100644 index 000000000..f73b3624d --- /dev/null +++ b/.changeset/three-adults-exist.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Update `tsconfig.json` presets with `moduleResolution: 'bundler'` and other new options from TypeScript 5.0. Astro now assumes that you use TypeScript 5.0 (March 2023), or that your editor includes it, ex: VS Code 1.77 diff --git a/.changeset/three-onions-repeat.md b/.changeset/three-onions-repeat.md new file mode 100644 index 000000000..1781defcc --- /dev/null +++ b/.changeset/three-onions-repeat.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +The `astro check` command now requires an external package `@astrojs/check` and an install of `typescript` in your project. This was done in order to make the main `astro` package smaller and give more flexibility to users in regard to the version of TypeScript they use. diff --git a/.changeset/tricky-candles-suffer.md b/.changeset/tricky-candles-suffer.md new file mode 100644 index 000000000..3786399a6 --- /dev/null +++ b/.changeset/tricky-candles-suffer.md @@ -0,0 +1,39 @@ +--- +'astro': major +'@astrojs/vercel': minor +--- + +The `build.split` and `build.excludeMiddleware` configuration options are deprecated and have been replaced by options in the adapter config. + +If your config includes the `build.excludeMiddleware` option, replace it with `edgeMiddleware` in your adapter options: + +```diff +import { defineConfig } from "astro/config"; +import vercel from "@astrojs/vercel/serverless"; + +export default defineConfig({ + build: { +- excludeMiddleware: true + }, + adapter: vercel({ ++ edgeMiddleware: true + }), +}); +``` + +If your config includes the `build.split` option, replace it with `functionPerRoute` in your adapter options: + +```diff +import { defineConfig } from "astro/config"; +import vercel from "@astrojs/vercel/serverless"; + +export default defineConfig({ + build: { +- split: true + }, + adapter: vercel({ ++ functionPerRoute: true + }), +}); +``` + diff --git a/.changeset/twelve-coats-rush.md b/.changeset/twelve-coats-rush.md new file mode 100644 index 000000000..29dd0f689 --- /dev/null +++ b/.changeset/twelve-coats-rush.md @@ -0,0 +1,35 @@ +--- +'astro': major +--- + +Lowercase names for endpoint functions are now deprecated. + +Rename functions to their uppercase equivalent: + +```diff +- export function get() { ++ export function GET() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); +} + +- export function post() { ++ export function POST() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); +} + +- export function put() { ++ export function PUT() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); +} + +- export function all() { ++ export function ALL() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); +} + +// you can use the whole word "DELETE" +- export function del() { ++ export function DELETE() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); +} +``` diff --git a/.changeset/twenty-cheetahs-deny.md b/.changeset/twenty-cheetahs-deny.md new file mode 100644 index 000000000..38a7298bf --- /dev/null +++ b/.changeset/twenty-cheetahs-deny.md @@ -0,0 +1,17 @@ +--- +'astro': major +--- + +Astro.cookies.get(key) returns undefined if cookie doesn't exist + +With this change, Astro.cookies.get(key) no longer always returns a `AstroCookie` object. Instead it now returns `undefined` if the cookie does not exist. + +You should update your code if you assume that all calls to `get()` return a value. When using with `has()` you still need to assert the value, like so: + +```astro +--- +if(Astro.cookies.has(id)) { + const id = Astro.cookies.get(id)!; +} +--- +``` diff --git a/.changeset/unlucky-hotels-try.md b/.changeset/unlucky-hotels-try.md new file mode 100644 index 000000000..359a239e2 --- /dev/null +++ b/.changeset/unlucky-hotels-try.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': minor +--- + +Add `astro` as peer dependency diff --git a/.changeset/unlucky-ravens-type.md b/.changeset/unlucky-ravens-type.md new file mode 100644 index 000000000..88b0aa748 --- /dev/null +++ b/.changeset/unlucky-ravens-type.md @@ -0,0 +1,14 @@ +--- +'astro': major +--- + +The property `compressHTML` is now `true` by default. Setting this value to `true` is no longer required. + +If you do not want to minify your HTML output, you must set this value to `false` in `astro.config.mjs`. + +```diff +import {defineConfig} from "astro/config"; +export default defineConfig({ ++ compressHTML: false +}) +``` diff --git a/.changeset/unlucky-sheep-build.md b/.changeset/unlucky-sheep-build.md new file mode 100644 index 000000000..6a69876de --- /dev/null +++ b/.changeset/unlucky-sheep-build.md @@ -0,0 +1,7 @@ +--- +'astro': major +--- + +Astro's default port when running the dev or preview server is now `4321`. + +This will reduce conflicts with ports used by other tools. diff --git a/.changeset/violet-peaches-invent.md b/.changeset/violet-peaches-invent.md new file mode 100644 index 000000000..f5d3e19d6 --- /dev/null +++ b/.changeset/violet-peaches-invent.md @@ -0,0 +1,5 @@ +--- +'@astrojs/telemetry': patch +--- + +Remove undici dependency diff --git a/.changeset/warm-weeks-yell.md b/.changeset/warm-weeks-yell.md new file mode 100644 index 000000000..9c0ca21da --- /dev/null +++ b/.changeset/warm-weeks-yell.md @@ -0,0 +1,13 @@ +--- +"astro": major +--- + +`astro:assets` is now enabled by default. If you were previously using the `experimental.assets` flag, please remove it from your config. Also note that the previous `@astrojs/image` integration is incompatible, and must be removed. + +This also brings two important changes to using images in Astro: + +- New ESM shape: importing an image will now return an object with different properties describing the image such as its path, format and dimensions. This is a breaking change and may require you to update your existing images. +- In Markdown, MDX, and Markdoc, the `![]()` syntax will now resolve relative images located anywhere in your project in addition to remote images and images stored in the `public/` folder. This notably unlocks storing images next to your content. + +Please see our existing [Assets page in Docs](https://docs.astro.build/en/guides/assets/) for more information about using `astro:assets`. + diff --git a/.changeset/wild-bobcats-carry.md b/.changeset/wild-bobcats-carry.md new file mode 100644 index 000000000..ef66ca952 --- /dev/null +++ b/.changeset/wild-bobcats-carry.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Add a new `astro/errors` module. Developers can import `AstroUserError`, and provide a `message` and an optional `hint` diff --git a/.changeset/young-roses-teach.md b/.changeset/young-roses-teach.md new file mode 100644 index 000000000..ff9c08e56 --- /dev/null +++ b/.changeset/young-roses-teach.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Remove MDX special `components` export handling diff --git a/.devcontainer/basics/devcontainer.json b/.devcontainer/basics/devcontainer.json index 0a57f37ce..bb1707ff0 100644 --- a/.devcontainer/basics/devcontainer.json +++ b/.devcontainer/basics/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/basics", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/blog/devcontainer.json b/.devcontainer/blog/devcontainer.json index 165683a7d..d587fead5 100644 --- a/.devcontainer/blog/devcontainer.json +++ b/.devcontainer/blog/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/blog", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/deno/devcontainer.json b/.devcontainer/deno/devcontainer.json index 2df23782f..05b733527 100644 --- a/.devcontainer/deno/devcontainer.json +++ b/.devcontainer/deno/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/deno", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/docs/devcontainer.json b/.devcontainer/docs/devcontainer.json index 281fd614e..a26ff9d8c 100644 --- a/.devcontainer/docs/devcontainer.json +++ b/.devcontainer/docs/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/docs", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-alpine/devcontainer.json b/.devcontainer/framework-alpine/devcontainer.json index f96022532..1b8f26503 100644 --- a/.devcontainer/framework-alpine/devcontainer.json +++ b/.devcontainer/framework-alpine/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-alpine", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-lit/devcontainer.json b/.devcontainer/framework-lit/devcontainer.json index bdceda2d3..4eb1d5979 100644 --- a/.devcontainer/framework-lit/devcontainer.json +++ b/.devcontainer/framework-lit/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-lit", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-multiple/devcontainer.json b/.devcontainer/framework-multiple/devcontainer.json index cdaa417a3..660df3e32 100644 --- a/.devcontainer/framework-multiple/devcontainer.json +++ b/.devcontainer/framework-multiple/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-multiple", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-preact/devcontainer.json b/.devcontainer/framework-preact/devcontainer.json index e0ce8771c..5c71cb6f2 100644 --- a/.devcontainer/framework-preact/devcontainer.json +++ b/.devcontainer/framework-preact/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-preact", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-react/devcontainer.json b/.devcontainer/framework-react/devcontainer.json index 07404950f..f130c26ff 100644 --- a/.devcontainer/framework-react/devcontainer.json +++ b/.devcontainer/framework-react/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-react", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-solid/devcontainer.json b/.devcontainer/framework-solid/devcontainer.json index f3cf86d80..4a3e65ec8 100644 --- a/.devcontainer/framework-solid/devcontainer.json +++ b/.devcontainer/framework-solid/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-solid", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-svelte/devcontainer.json b/.devcontainer/framework-svelte/devcontainer.json index 7ea52458d..d8db14287 100644 --- a/.devcontainer/framework-svelte/devcontainer.json +++ b/.devcontainer/framework-svelte/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-svelte", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/framework-vue/devcontainer.json b/.devcontainer/framework-vue/devcontainer.json index 9caae267a..db9a62878 100644 --- a/.devcontainer/framework-vue/devcontainer.json +++ b/.devcontainer/framework-vue/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/framework-vue", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/hackernews/devcontainer.json b/.devcontainer/hackernews/devcontainer.json index 384c9035a..dc113624d 100644 --- a/.devcontainer/hackernews/devcontainer.json +++ b/.devcontainer/hackernews/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/hackernews", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/minimal/devcontainer.json b/.devcontainer/minimal/devcontainer.json index 877030ef8..1756ffd8b 100644 --- a/.devcontainer/minimal/devcontainer.json +++ b/.devcontainer/minimal/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/minimal", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/non-html-pages/devcontainer.json b/.devcontainer/non-html-pages/devcontainer.json index f5d979d87..b47fae4e9 100644 --- a/.devcontainer/non-html-pages/devcontainer.json +++ b/.devcontainer/non-html-pages/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/non-html-pages", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/portfolio/devcontainer.json b/.devcontainer/portfolio/devcontainer.json index c082b8306..39e283d83 100644 --- a/.devcontainer/portfolio/devcontainer.json +++ b/.devcontainer/portfolio/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/portfolio", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/ssr/devcontainer.json b/.devcontainer/ssr/devcontainer.json index acca0937c..2ace9a1dd 100644 --- a/.devcontainer/ssr/devcontainer.json +++ b/.devcontainer/ssr/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/ssr", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-markdown-plugins/devcontainer.json b/.devcontainer/with-markdown-plugins/devcontainer.json index bb7d7c28e..21894a77c 100644 --- a/.devcontainer/with-markdown-plugins/devcontainer.json +++ b/.devcontainer/with-markdown-plugins/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-markdown-shiki/devcontainer.json b/.devcontainer/with-markdown-shiki/devcontainer.json index 0b1d04188..a3f51750a 100644 --- a/.devcontainer/with-markdown-shiki/devcontainer.json +++ b/.devcontainer/with-markdown-shiki/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-mdx/devcontainer.json b/.devcontainer/with-mdx/devcontainer.json index add8d32da..13ff67464 100644 --- a/.devcontainer/with-mdx/devcontainer.json +++ b/.devcontainer/with-mdx/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-mdx", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-nanostores/devcontainer.json b/.devcontainer/with-nanostores/devcontainer.json index 5968f8a3d..656776b2a 100644 --- a/.devcontainer/with-nanostores/devcontainer.json +++ b/.devcontainer/with-nanostores/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-nanostores", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-tailwindcss/devcontainer.json b/.devcontainer/with-tailwindcss/devcontainer.json index 73f2c7dfe..6e7298a6f 100644 --- a/.devcontainer/with-tailwindcss/devcontainer.json +++ b/.devcontainer/with-tailwindcss/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-vite-plugin-pwa/devcontainer.json b/.devcontainer/with-vite-plugin-pwa/devcontainer.json index 54d9a5c6a..d716cded0 100644 --- a/.devcontainer/with-vite-plugin-pwa/devcontainer.json +++ b/.devcontainer/with-vite-plugin-pwa/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.devcontainer/with-vitest/devcontainer.json b/.devcontainer/with-vitest/devcontainer.json index 079fa868e..793108939 100644 --- a/.devcontainer/with-vitest/devcontainer.json +++ b/.devcontainer/with-vitest/devcontainer.json @@ -7,13 +7,13 @@ "workspaceFolder": "/workspaces/astro/examples/with-vitest", "portsAttributes": { - "3000": { + "4321": { "label": "Application", "onAutoForward": "openPreview" } }, - "forwardPorts": [3000], + "forwardPorts": [4321], "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", diff --git a/.eslintignore b/.eslintignore index f5104aedd..2b3b59035 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,7 +2,6 @@ packages/**/*.min.js packages/**/dist/**/* packages/**/fixtures/**/* -packages/webapi/**/* packages/astro/vendor/vite/**/* examples/**/* scripts/**/* diff --git a/.github/ISSUE_TEMPLATE/---01-bug-report.yml b/.github/ISSUE_TEMPLATE/---01-bug-report.yml index a9786522b..15bc784f4 100644 --- a/.github/ISSUE_TEMPLATE/---01-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/---01-bug-report.yml @@ -10,7 +10,7 @@ body: Thank you for taking the time to file a bug report! Please fill out this form as completely as possible. ✅ I am using the **latest version of Astro** and all plugins. - ✅ I am using a version of Node that supports ESM (`v14.18.0+`, or `v16.12.0+`) + ✅ I am using a version of Node that Astro supports (`>=18.14.1`) - type: input id: astro-version attributes: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9150b5f1e..268c577ce 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -34,7 +34,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: "pnpm" - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 329835b80..01c573e10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: strategy: matrix: OS: [ubuntu-latest, windows-latest] - NODE_VERSION: [16] + NODE_VERSION: [18] fail-fast: true steps: # Disable crlf so all OS can share the same Turbo cache @@ -85,7 +85,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: "pnpm" - name: Install dependencies @@ -108,12 +108,12 @@ jobs: strategy: matrix: OS: [ubuntu-latest] - NODE_VERSION: [16, 18] + NODE_VERSION: [18, 20] include: - os: macos-latest - NODE_VERSION: 16 + NODE_VERSION: 18 - os: windows-latest - NODE_VERSION: 16 + NODE_VERSION: 18 fail-fast: false env: NODE_VERSION: ${{ matrix.NODE_VERSION }} @@ -155,7 +155,7 @@ jobs: strategy: matrix: OS: [ubuntu-latest, windows-latest] - NODE_VERSION: [16] + NODE_VERSION: [18] fail-fast: false env: NODE_VERSION: ${{ matrix.NODE_VERSION }} @@ -192,7 +192,7 @@ jobs: strategy: matrix: OS: [ubuntu-latest, windows-latest] - NODE_VERSION: [16] + NODE_VERSION: [18] env: NODE_VERSION: ${{ matrix.NODE_VERSION }} steps: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e58b68975..961f4d997 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: "pnpm" - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0d30a020..f952f6c6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: "pnpm" - name: Install dependencies diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index 056bf4e0a..a22ec467b 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -37,7 +37,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: "pnpm" - name: Install dependencies diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index 5504978c6..29f8c7f11 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -58,7 +58,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 registry-url: "https://registry.npmjs.org" cache: "pnpm" diff --git a/.gitpod.yml b/.gitpod.yml index 83205f4df..28e02e923 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -18,7 +18,7 @@ vscode: - esbenp.prettier-vscode - dbaeumer.vscode-eslint ports: - - port: 3000 + - port: 4321 onOpen: open-preview github: prebuilds: diff --git a/.nvmrc b/.nvmrc index e65243f2e..617bcf916 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.19.0 +18.14.1 diff --git a/.prettierignore b/.prettierignore index 1f3396338..f53f92086 100644 --- a/.prettierignore +++ b/.prettierignore @@ -22,5 +22,4 @@ benchmark/results/ .changeset # Files -packages/webapi/mod.d.ts pnpm-lock.yaml diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 0909ba219..39911db2c 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -6,7 +6,7 @@ module.exports = { tabWidth: 2, trailingComma: 'es5', useTabs: true, - plugins: ['./node_modules/prettier-plugin-astro'], + plugins: ['prettier-plugin-astro'], overrides: [ { files: ['.*', '*.json', '*.md', '*.toml', '*.yml'], diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25baacecb..c433a6833 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ We welcome contributions of any size and skill level. As an open source project, ### Prerequisites ```shell -node: "^>=16.12.0" +node: "^>=18.14.1" pnpm: "^8.6.2" # otherwise, your build will fail ``` diff --git a/README.md b/README.md index e94e1d072..2cc46177a 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ Join us on [Discord](https://astro.build/chat) to meet other maintainers. We'll | [@astrojs/tailwind](packages/integrations/tailwind) | [![astro version](https://img.shields.io/npm/v/@astrojs/tailwind.svg?label=%20)](packages/integrations/tailwind/CHANGELOG.md) | | [@astrojs/turbolinks](packages/integrations/turbolinks) | [![astro version](https://img.shields.io/npm/v/@astrojs/turbolinks.svg?label=%20)](packages/integrations/turbolinks/CHANGELOG.md) | | [@astrojs/alpinejs](packages/integrations/alpinejs) | [![astro version](https://img.shields.io/npm/v/@astrojs/alpinejs.svg?label=%20)](packages/integrations/alpinejs/CHANGELOG.md) | -| [@astrojs/image](packages/integrations/image) | [![astro version](https://img.shields.io/npm/v/@astrojs/image.svg?label=%20)](packages/integrations/image/CHANGELOG.md) | | [@astrojs/mdx](packages/integrations/mdx) | [![astro version](https://img.shields.io/npm/v/@astrojs/mdx.svg?label=%20)](packages/integrations/mdx/CHANGELOG.md) | | [@astrojs/prefetch](packages/integrations/prefetch) | [![astro version](https://img.shields.io/npm/v/@astrojs/prefetch.svg?label=%20)](packages/integrations/prefetch/CHANGELOG.md) | diff --git a/benchmark/packages/timer/package.json b/benchmark/packages/timer/package.json index abcfe1d3e..ddb63a270 100644 --- a/benchmark/packages/timer/package.json +++ b/benchmark/packages/timer/package.json @@ -23,7 +23,6 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "@astrojs/webapi": "workspace:*", "server-destroy": "^1.0.1" }, "peerDependencies": { diff --git a/benchmark/packages/timer/src/server.ts b/benchmark/packages/timer/src/server.ts index 28a406841..d33e65c00 100644 --- a/benchmark/packages/timer/src/server.ts +++ b/benchmark/packages/timer/src/server.ts @@ -1,11 +1,8 @@ -import { polyfill } from '@astrojs/webapi'; import type { SSRManifest } from 'astro'; -import { NodeApp } from 'astro/app/node'; +import { NodeApp, applyPolyfills } from 'astro/app/node'; import type { IncomingMessage, ServerResponse } from 'node:http'; -polyfill(globalThis, { - exclude: 'window document', -}); +applyPolyfills(); export function createExports(manifest: SSRManifest) { const app = new NodeApp(manifest); diff --git a/benchmark/packages/timer/tsconfig.json b/benchmark/packages/timer/tsconfig.json index 44baf375c..af1b43564 100644 --- a/benchmark/packages/timer/tsconfig.json +++ b/benchmark/packages/timer/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2022" } } diff --git a/examples/basics/README.md b/examples/basics/README.md index 839455718..5369073b9 100644 --- a/examples/basics/README.md +++ b/examples/basics/README.md @@ -43,7 +43,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/basics/package.json b/examples/basics/package.json index b6513759e..dd81a20af 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" } } diff --git a/examples/basics/sandbox.config.json b/examples/basics/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/basics/sandbox.config.json +++ b/examples/basics/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/blog/README.md b/examples/blog/README.md index 11bc070ef..67d0cfc2e 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -53,7 +53,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/blog/package.json b/examples/blog/package.json index a3669469f..5e633254c 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^0.19.7", - "@astrojs/rss": "^2.4.4", - "@astrojs/sitemap": "^2.0.2", - "astro": "^2.10.9" + "@astrojs/mdx": "^1.0.0-beta.0", + "@astrojs/rss": "^3.0.0-beta.0", + "@astrojs/sitemap": "^3.0.0-beta.0", + "astro": "^3.0.0-beta.2" } } diff --git a/examples/blog/sandbox.config.json b/examples/blog/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/blog/sandbox.config.json +++ b/examples/blog/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/blog/src/content/blog/markdown-style-guide.md b/examples/blog/src/content/blog/markdown-style-guide.md index 5775c88c0..877ec2f4a 100644 --- a/examples/blog/src/content/blog/markdown-style-guide.md +++ b/examples/blog/src/content/blog/markdown-style-guide.md @@ -99,7 +99,7 @@ we can use 3 backticks ``` in new line and write snippet and close with 3 backti ````markdown ```html - + @@ -115,7 +115,7 @@ we can use 3 backticks ``` in new line and write snippet and close with 3 backti Output ```html - + diff --git a/examples/blog/src/pages/blog/[...slug].astro b/examples/blog/src/pages/blog/[...slug].astro index 12436c2b2..07dbce26b 100644 --- a/examples/blog/src/pages/blog/[...slug].astro +++ b/examples/blog/src/pages/blog/[...slug].astro @@ -1,5 +1,5 @@ --- -import { CollectionEntry, getCollection } from 'astro:content'; +import { type CollectionEntry, getCollection } from 'astro:content'; import BlogPost from '../../layouts/BlogPost.astro'; export async function getStaticPaths() { diff --git a/examples/component/package.json b/examples/component/package.json index ee1151ea1..f2b226262 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/deno/README.md b/examples/deno/README.md index 98f7ee020..af49ebcb7 100644 --- a/examples/deno/README.md +++ b/examples/deno/README.md @@ -42,7 +42,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | | (preview uses Deno CLI) | diff --git a/examples/deno/package.json b/examples/deno/package.json index 410082241..7fe421d50 100644 --- a/examples/deno/package.json +++ b/examples/deno/package.json @@ -10,9 +10,9 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" }, "devDependencies": { - "@astrojs/deno": "^4.3.0" + "@astrojs/deno": "^5.0.0-beta.0" } } diff --git a/examples/deno/sandbox.config.json b/examples/deno/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/deno/sandbox.config.json +++ b/examples/deno/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index 75113f4e3..2c1bd53f8 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/alpinejs": "^0.2.2", + "@astrojs/alpinejs": "^0.3.0-beta.0", "@types/alpinejs": "^3.7.1", "alpinejs": "^3.12.2", - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" } } diff --git a/examples/framework-alpine/sandbox.config.json b/examples/framework-alpine/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-alpine/sandbox.config.json +++ b/examples/framework-alpine/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index d18731fa5..f8091eb74 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/lit": "^2.1.1", + "@astrojs/lit": "^3.0.0-beta.0", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "lit": "^2.7.5" } } diff --git a/examples/framework-lit/sandbox.config.json b/examples/framework-lit/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-lit/sandbox.config.json +++ b/examples/framework-lit/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-multiple/astro.config.mjs b/examples/framework-multiple/astro.config.mjs index 4b50887cd..36f75aec2 100644 --- a/examples/framework-multiple/astro.config.mjs +++ b/examples/framework-multiple/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + react({ include: ['**/react/*'] }), + svelte(), + vue(), + ], }); diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 9405a65b8..9af1d6cad 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -11,12 +11,12 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^2.2.2", - "@astrojs/react": "^2.2.2", - "@astrojs/solid-js": "^2.2.0", - "@astrojs/svelte": "^3.1.0", - "@astrojs/vue": "^2.2.1", - "astro": "^2.10.9", + "@astrojs/preact": "^3.0.0-beta.1", + "@astrojs/react": "^3.0.0-beta.2", + "@astrojs/solid-js": "^3.0.0-beta.1", + "@astrojs/svelte": "^4.0.0-beta.0", + "@astrojs/vue": "^3.0.0-beta.0", + "astro": "^3.0.0-beta.2", "preact": "^10.15.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-multiple/sandbox.config.json b/examples/framework-multiple/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-multiple/sandbox.config.json +++ b/examples/framework-multiple/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-multiple/src/components/PreactCounter.tsx b/examples/framework-multiple/src/components/preact/PreactCounter.tsx similarity index 100% rename from examples/framework-multiple/src/components/PreactCounter.tsx rename to examples/framework-multiple/src/components/preact/PreactCounter.tsx diff --git a/examples/framework-multiple/src/components/ReactCounter.tsx b/examples/framework-multiple/src/components/react/ReactCounter.tsx similarity index 100% rename from examples/framework-multiple/src/components/ReactCounter.tsx rename to examples/framework-multiple/src/components/react/ReactCounter.tsx diff --git a/examples/framework-multiple/src/components/SolidCounter.tsx b/examples/framework-multiple/src/components/solid/SolidCounter.tsx similarity index 100% rename from examples/framework-multiple/src/components/SolidCounter.tsx rename to examples/framework-multiple/src/components/solid/SolidCounter.tsx diff --git a/examples/framework-multiple/src/components/SvelteCounter.svelte b/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from examples/framework-multiple/src/components/SvelteCounter.svelte rename to examples/framework-multiple/src/components/svelte/SvelteCounter.svelte diff --git a/examples/framework-multiple/src/components/VueCounter.vue b/examples/framework-multiple/src/components/vue/VueCounter.vue similarity index 100% rename from examples/framework-multiple/src/components/VueCounter.vue rename to examples/framework-multiple/src/components/vue/VueCounter.vue diff --git a/examples/framework-multiple/src/pages/index.astro b/examples/framework-multiple/src/pages/index.astro index 94630aa1e..ccf5aaa71 100644 --- a/examples/framework-multiple/src/pages/index.astro +++ b/examples/framework-multiple/src/pages/index.astro @@ -4,12 +4,12 @@ import '../styles/global.css'; // Component Imports // For JSX components, all the common ways of exporting (under a namespace, specific export, default export etc) are supported! -import * as react from '../components/ReactCounter'; -import { PreactCounter } from '../components/PreactCounter'; -import SolidCounter from '../components/SolidCounter'; +import * as react from '../components/react/ReactCounter'; +import { PreactCounter } from '../components/preact/PreactCounter'; +import SolidCounter from '../components/solid/SolidCounter'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index 503a2b22b..1c38428c3 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^2.2.2", + "@astrojs/preact": "^3.0.0-beta.1", "@preact/signals": "^1.1.3", - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "preact": "^10.15.1" } } diff --git a/examples/framework-preact/sandbox.config.json b/examples/framework-preact/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-preact/sandbox.config.json +++ b/examples/framework-preact/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 0110bb53b..3b4bd62e0 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^2.2.2", + "@astrojs/react": "^3.0.0-beta.2", "@types/react": "^18.2.13", "@types/react-dom": "^18.2.6", - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-react/sandbox.config.json b/examples/framework-react/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-react/sandbox.config.json +++ b/examples/framework-react/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 302fa3abc..ea4973fe6 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/solid-js": "^2.2.0", - "astro": "^2.10.9", + "@astrojs/solid-js": "^3.0.0-beta.1", + "astro": "^3.0.0-beta.2", "solid-js": "^1.7.6" } } diff --git a/examples/framework-solid/sandbox.config.json b/examples/framework-solid/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-solid/sandbox.config.json +++ b/examples/framework-solid/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 5f52209a2..4eb4b38e6 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/svelte": "^3.1.0", - "astro": "^2.10.9", + "@astrojs/svelte": "^4.0.0-beta.0", + "astro": "^3.0.0-beta.2", "svelte": "^3.59.1" } } diff --git a/examples/framework-svelte/sandbox.config.json b/examples/framework-svelte/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-svelte/sandbox.config.json +++ b/examples/framework-svelte/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index f06c2140a..2e9d5efcc 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/vue": "^2.2.1", - "astro": "^2.10.9", + "@astrojs/vue": "^3.0.0-beta.0", + "astro": "^3.0.0-beta.2", "vue": "^3.3.4" } } diff --git a/examples/framework-vue/sandbox.config.json b/examples/framework-vue/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/framework-vue/sandbox.config.json +++ b/examples/framework-vue/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/hackernews/README.md b/examples/hackernews/README.md index 937ad23ea..042a7807b 100644 --- a/examples/hackernews/README.md +++ b/examples/hackernews/README.md @@ -48,7 +48,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index d68e7e3e3..259aa9a4e 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/node": "^5.3.4", - "astro": "^2.10.9" + "@astrojs/node": "^6.0.0-beta.0", + "astro": "^3.0.0-beta.2" } } diff --git a/examples/hackernews/sandbox.config.json b/examples/hackernews/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/hackernews/sandbox.config.json +++ b/examples/hackernews/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/integration/package.json b/examples/integration/package.json index 05c0a6c4c..864349b97 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 30a61849a..296c4d571 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -12,8 +12,8 @@ "server": "node dist/server/entry.mjs" }, "dependencies": { - "@astrojs/node": "^5.3.4", - "astro": "^2.10.9", + "@astrojs/node": "^6.0.0-beta.0", + "astro": "^3.0.0-beta.2", "html-minifier": "^4.0.0" } } diff --git a/examples/middleware/src/middleware.ts b/examples/middleware/src/middleware.ts index 9871e9d01..eb7644535 100644 --- a/examples/middleware/src/middleware.ts +++ b/examples/middleware/src/middleware.ts @@ -1,4 +1,4 @@ -import { defineMiddleware, sequence } from 'astro/middleware'; +import { defineMiddleware, sequence } from 'astro:middleware'; import htmlMinifier from 'html-minifier'; const limit = 50; diff --git a/examples/minimal/README.md b/examples/minimal/README.md index 3c261d317..20bad6615 100644 --- a/examples/minimal/README.md +++ b/examples/minimal/README.md @@ -36,7 +36,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/minimal/package.json b/examples/minimal/package.json index e8e04fd77..128577213 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" } } diff --git a/examples/minimal/sandbox.config.json b/examples/minimal/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/minimal/sandbox.config.json +++ b/examples/minimal/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/non-html-pages/README.md b/examples/non-html-pages/README.md index d1caeed41..ecdee84b1 100644 --- a/examples/non-html-pages/README.md +++ b/examples/non-html-pages/README.md @@ -41,7 +41,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index e72d52d6f..aeb517c4c 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" } } diff --git a/examples/non-html-pages/sandbox.config.json b/examples/non-html-pages/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/non-html-pages/sandbox.config.json +++ b/examples/non-html-pages/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/portfolio/README.md b/examples/portfolio/README.md index 7ca90501a..3c8ee3aa4 100644 --- a/examples/portfolio/README.md +++ b/examples/portfolio/README.md @@ -19,7 +19,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index d87ef12b4..e6e240709 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" } } diff --git a/examples/portfolio/sandbox.config.json b/examples/portfolio/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/portfolio/sandbox.config.json +++ b/examples/portfolio/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/portfolio/src/pages/work/[...slug].astro b/examples/portfolio/src/pages/work/[...slug].astro index 795ebffe5..84ed133a4 100644 --- a/examples/portfolio/src/pages/work/[...slug].astro +++ b/examples/portfolio/src/pages/work/[...slug].astro @@ -1,5 +1,5 @@ --- -import { CollectionEntry, getCollection } from 'astro:content'; +import { type CollectionEntry, getCollection } from 'astro:content'; import BaseLayout from '../../layouts/BaseLayout.astro'; diff --git a/examples/ssr/package.json b/examples/ssr/package.json index d25c37e23..29122e2bb 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -12,9 +12,9 @@ "server": "node dist/server/entry.mjs" }, "dependencies": { - "@astrojs/node": "^5.3.4", - "@astrojs/svelte": "^3.1.0", - "astro": "^2.10.9", + "@astrojs/node": "^6.0.0-beta.0", + "@astrojs/svelte": "^4.0.0-beta.0", + "astro": "^3.0.0-beta.2", "svelte": "^3.59.1" } } diff --git a/examples/ssr/src/pages/cart.astro b/examples/ssr/src/pages/cart.astro index ebc2f1472..40e5cf126 100644 --- a/examples/ssr/src/pages/cart.astro +++ b/examples/ssr/src/pages/cart.astro @@ -3,7 +3,7 @@ import Header from '../components/Header.astro'; import Container from '../components/Container.astro'; import { getCart } from '../api'; -if (!Astro.cookies.get('user-id').value) { +if (!Astro.cookies.get('user-id')) { return Astro.redirect('/'); } diff --git a/examples/with-markdoc/README.md b/examples/with-markdoc/README.md index 4f44648da..1a1acc1a5 100644 --- a/examples/with-markdoc/README.md +++ b/examples/with-markdoc/README.md @@ -45,7 +45,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index e60ddd132..cf7fb6a0c 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/markdoc": "^0.4.4", - "astro": "^2.10.9" + "@astrojs/markdoc": "^1.0.0-beta.1", + "astro": "^3.0.0-beta.2" } } diff --git a/examples/with-markdoc/sandbox.config.json b/examples/with-markdoc/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-markdoc/sandbox.config.json +++ b/examples/with-markdoc/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index ad5fd3fe8..94d55fbe9 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/markdown-remark": "^2.2.1", - "astro": "^2.10.9", + "@astrojs/markdown-remark": "^3.0.0-beta.0", + "astro": "^3.0.0-beta.2", "hast-util-select": "^5.0.5", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.1.0", diff --git a/examples/with-markdown-plugins/sandbox.config.json b/examples/with-markdown-plugins/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-markdown-plugins/sandbox.config.json +++ b/examples/with-markdown-plugins/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 3487ecbe4..4a0ee2570 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9" + "astro": "^3.0.0-beta.2" } } diff --git a/examples/with-markdown-shiki/sandbox.config.json b/examples/with-markdown-shiki/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-markdown-shiki/sandbox.config.json +++ b/examples/with-markdown-shiki/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 5472ac38e..efd525b5a 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^0.19.7", - "@astrojs/preact": "^2.2.2", - "astro": "^2.10.9", + "@astrojs/mdx": "^1.0.0-beta.0", + "@astrojs/preact": "^3.0.0-beta.1", + "astro": "^3.0.0-beta.2", "preact": "^10.15.1" } } diff --git a/examples/with-mdx/sandbox.config.json b/examples/with-mdx/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-mdx/sandbox.config.json +++ b/examples/with-mdx/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index aa1d589d3..61c3e84b8 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^2.2.2", + "@astrojs/preact": "^3.0.0-beta.1", "@nanostores/preact": "^0.4.1", - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "nanostores": "^0.8.1", "preact": "^10.15.1" } diff --git a/examples/with-nanostores/sandbox.config.json b/examples/with-nanostores/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-nanostores/sandbox.config.json +++ b/examples/with-nanostores/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index e0195c8b7..64a7ce5b7 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -11,9 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/tailwind": "^4.0.0", + "@astrojs/mdx": "^1.0.0-beta.0", + "@astrojs/tailwind": "^5.0.0-beta.0", "@types/canvas-confetti": "^1.6.0", - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "autoprefixer": "^10.4.14", "canvas-confetti": "^1.6.0", "postcss": "^8.4.24", diff --git a/examples/with-tailwindcss/sandbox.config.json b/examples/with-tailwindcss/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-tailwindcss/sandbox.config.json +++ b/examples/with-tailwindcss/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-vite-plugin-pwa/README.md b/examples/with-vite-plugin-pwa/README.md index 9c29863db..555d3e7de 100644 --- a/examples/with-vite-plugin-pwa/README.md +++ b/examples/with-vite-plugin-pwa/README.md @@ -36,7 +36,7 @@ All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index cb464375d..4aa11cf87 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "vite-plugin-pwa": "0.14.7", "workbox-window": "^6.6.0" } diff --git a/examples/with-vite-plugin-pwa/sandbox.config.json b/examples/with-vite-plugin-pwa/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-vite-plugin-pwa/sandbox.config.json +++ b/examples/with-vite-plugin-pwa/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 8e3a2443b..f97aaa86c 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^2.10.9", + "astro": "^3.0.0-beta.2", "vitest": "^0.31.4" } } diff --git a/examples/with-vitest/sandbox.config.json b/examples/with-vitest/sandbox.config.json index 9178af77d..8e476b8cc 100644 --- a/examples/with-vitest/sandbox.config.json +++ b/examples/with-vitest/sandbox.config.json @@ -4,7 +4,7 @@ "view": "browser", "template": "node", "container": { - "port": 3000, + "port": 4321, "startScript": "start", "node": "14" } diff --git a/package.json b/package.json index 5ee1460e4..0c75669ae 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"", "format": "pnpm run format:code", "format:ci": "pnpm run format:imports && pnpm run format:code", - "format:code": "prettier -w . --cache --plugin-search-dir=.", + "format:code": "prettier -w . --cache", "format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json", "test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", "test:match": "cd packages/astro && pnpm run test:match", @@ -39,7 +39,7 @@ "packages/*" ], "engines": { - "node": ">=16.12.0", + "node": ">=18.14.1", "pnpm": ">=8.6.2" }, "packageManager": "pnpm@8.6.2", @@ -73,26 +73,26 @@ } }, "dependencies": { - "@astrojs/webapi": "workspace:*", "astro-benchmark": "workspace:*" }, "devDependencies": { + "@astrojs/check": "^0.1.0", "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.1", "@types/node": "^18.16.18", "@typescript-eslint/eslint-plugin": "6.0.0", "@typescript-eslint/parser": "6.0.0", - "esbuild": "^0.17.19", + "esbuild": "^0.18.16", "eslint": "^8.43.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-no-only-tests": "^2.6.0", "eslint-plugin-prettier": "^4.2.1", "only-allow": "^1.1.1", "organize-imports-cli": "^0.10.0", - "prettier": "^2.8.8", - "prettier-plugin-astro": "^0.10.0", + "prettier": "^3.0.1", + "prettier-plugin-astro": "^0.11.0", "tiny-glob": "^0.2.9", "turbo": "^1.10.3", - "typescript": "~5.0.2" + "typescript": "~5.1.6" } } diff --git a/packages/astro-prism/CHANGELOG.md b/packages/astro-prism/CHANGELOG.md index dae8671f9..f9cd9b2cc 100644 --- a/packages/astro-prism/CHANGELOG.md +++ b/packages/astro-prism/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/prism +## 3.0.0-beta.0 + +### Major Changes + +- [`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. + ## 2.1.2 ### Patch Changes diff --git a/packages/astro-prism/package.json b/packages/astro-prism/package.json index 4ad55bf7f..838447090 100644 --- a/packages/astro-prism/package.json +++ b/packages/astro-prism/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/prism", - "version": "2.1.2", + "version": "3.0.0-beta.0", "description": "Add Prism syntax highlighting support to your Astro site", "author": "withastro", "type": "module", @@ -14,7 +14,7 @@ "homepage": "https://docs.astro.build/en/reference/api-reference/#prism-", "main": "dist/index.js", "scripts": { - "build": "astro-scripts build \"src/**/*.ts\" && tsc", + "build": "astro-scripts build \"src/**/*.ts\" && tsc -p ./tsconfig.json", "build:ci": "astro-scripts build \"src/**/*.ts\"", "dev": "astro-scripts dev \"src/**/*.ts\"" }, @@ -39,6 +39,6 @@ "astro-scripts": "workspace:*" }, "engines": { - "node": ">=16.12.0" + "node": ">=18.14.1" } } diff --git a/packages/astro-prism/tsconfig.json b/packages/astro-prism/tsconfig.json index 569016e9d..fd652e629 100644 --- a/packages/astro-prism/tsconfig.json +++ b/packages/astro-prism/tsconfig.json @@ -3,7 +3,7 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "target": "ES2021", + "target": "ES2022", "module": "ES2022", "outDir": "./dist" } diff --git a/packages/astro-rss/CHANGELOG.md b/packages/astro-rss/CHANGELOG.md index 1f06b449e..a3c99b642 100644 --- a/packages/astro-rss/CHANGELOG.md +++ b/packages/astro-rss/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/rss +## 3.0.0-beta.0 + +### Major Changes + +- [`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. + ## 2.4.4 ### Patch Changes diff --git a/packages/astro-rss/package.json b/packages/astro-rss/package.json index f3b7c9c12..2491f6a66 100644 --- a/packages/astro-rss/package.json +++ b/packages/astro-rss/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/rss", "description": "Add RSS feeds to your Astro projects", - "version": "2.4.4", + "version": "3.0.0-beta.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/astro-rss/tsconfig.json b/packages/astro-rss/tsconfig.json index f9da2a5bd..d8efd2fec 100644 --- a/packages/astro-rss/tsconfig.json +++ b/packages/astro-rss/tsconfig.json @@ -5,7 +5,7 @@ "allowJs": true, "module": "ES2022", "outDir": "./dist", - "target": "ES2021", + "target": "ES2022", "strictNullChecks": true } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index e3865fe33..e026a0eed 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,332 @@ # astro +## 3.0.0-beta.2 + +### Patch Changes + +- Updated dependencies [[`2aa6d8ace`](https://github.com/withastro/astro/commit/2aa6d8ace398a41c2dec5473521d758816b08191)]: + - @astrojs/internal-helpers@0.2.0-beta.1 + +## 3.0.0-beta.1 + +### Major Changes + +- [#7952](https://github.com/withastro/astro/pull/7952) [`3c3100851`](https://github.com/withastro/astro/commit/3c31008519ce68b5b1b1cb23b71fbe0a2d506882) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Remove support for `Astro.__renderMarkdown` which is used by `@astrojs/markdown-component`. + + The `` component was deprecated in Astro v1 and is completely removed in v3. This integration must now be removed from your project. + + As an alternative, you can use community packages that provide a similar component like https://github.com/natemoo-re/astro-remote instead. + +- [#8019](https://github.com/withastro/astro/pull/8019) [`34cb20021`](https://github.com/withastro/astro/commit/34cb2002161ba88df6bcb72fecfd12ed867c134b) Thanks [@bluwy](https://github.com/bluwy)! - Remove backwards-compatible kebab-case transform for camelCase CSS variable names passed to the `style` attribute. If you were relying on the kebab-case transform in your styles, make sure to use the camelCase version to prevent missing styles. For example: + + ```astro + --- + const myValue = 'red'; + --- + + +
+ + +
+ + +
+ ``` + + ```diff + + ``` + +- [#7893](https://github.com/withastro/astro/pull/7893) [`7bd1b86f8`](https://github.com/withastro/astro/commit/7bd1b86f85c06fdde0a1ed9146d01bac69990671) Thanks [@ematipico](https://github.com/ematipico)! - Implements a new scope style strategy called `"attribute"`. When enabled, styles are applied using `data-*` attributes. + + The **default** value of `scopedStyleStrategy` is `"attribute"`. + + If you want to use the previous behaviour, you have to use the `"where"` option: + + ```diff + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + + scopedStyleStrategy: 'where', + }); + ``` + +- [#7924](https://github.com/withastro/astro/pull/7924) [`519a1c4e8`](https://github.com/withastro/astro/commit/519a1c4e8407c7abcb8d879b67a9f4b960652cae) Thanks [@matthewp](https://github.com/matthewp)! - Astro's JSX handling has been refactored with better support for each framework. + + Previously, Astro automatically scanned your components to determine which framework-specific transformations should be used. In practice, supporting advanced features like Fast Refresh with this approach proved difficult. + + Now, Astro determines which framework to use with `include` and `exclude` config options where you can specify files and folders on a per-framework basis. When using multiple JSX frameworks in the same project, users should manually control which files belong to each framework using the `include` and `exclude` options. + + ```js + export default defineConfig({ + // The `include` config is only needed in projects that use multiple JSX frameworks; + // if only using one no extra config is needed. + integrations: [ + preact({ + include: ['**/preact/*'], + }), + react({ + include: ['**/react/*'], + }), + solid({ + include: ['**/solid/*'], + }), + ], + }); + ``` + +- [#7878](https://github.com/withastro/astro/pull/7878) [`0f637c71e`](https://github.com/withastro/astro/commit/0f637c71e511cb4c51712128d217a26c8eee4d40) Thanks [@bluwy](https://github.com/bluwy)! - The value of `import.meta.env.BASE_URL`, which is derived from the `base` option, will no longer have a trailing slash added by default or when `trailingSlash: "ignore"` is set. The existing behavior of `base` in combination with `trailingSlash: "always"` or `trailingSlash: "never"` is unchanged. + + If your `base` already has a trailing slash, no change is needed. + + If your `base` does not have a trailing slash, add one to preserve the previous behaviour: + + ```diff + // astro.config.mjs + - base: 'my-base', + + base: 'my-base/', + ``` + +### Minor Changes + +- [#8012](https://github.com/withastro/astro/pull/8012) [`866ed4098`](https://github.com/withastro/astro/commit/866ed4098edffb052239cdb26e076cf8db61b1d9) Thanks [@ematipico](https://github.com/ematipico)! - Add a new `astro/errors` module. Developers can import `AstroUserError`, and provide a `message` and an optional `hint` + +### Patch Changes + +- [#7998](https://github.com/withastro/astro/pull/7998) [`65c354969`](https://github.com/withastro/astro/commit/65c354969e6fe0ef6d622e8f4c545e2f717ce8c6) Thanks [@bluwy](https://github.com/bluwy)! - Call `astro sync` once before calling `astro check` + +- [#7952](https://github.com/withastro/astro/pull/7952) [`70f34f5a3`](https://github.com/withastro/astro/commit/70f34f5a355f42526ee9e5355f3de8e510002ea2) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Remove StreamingCompatibleResponse polyfill + +- [#8011](https://github.com/withastro/astro/pull/8011) [`5b1e39ef6`](https://github.com/withastro/astro/commit/5b1e39ef6ec6dcebea96584f95d9530bd9aa715d) Thanks [@bluwy](https://github.com/bluwy)! - Move hoisted script analysis optimization behind the `experimental.optimizeHoistedScript` option + +- Updated dependencies [[`b675acb2a`](https://github.com/withastro/astro/commit/b675acb2aa820448e9c0d363339a37fbac873215)]: + - @astrojs/telemetry@3.0.0-beta.1 + +## 3.0.0-beta.0 + +### Major Changes + +- [`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. + +- [`76ddef19c`](https://github.com/withastro/astro/commit/76ddef19ccab6e5f7d3a5740cd41acf10e334b38) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Removed automatic flattening of `getStaticPaths` result. `.flatMap` and `.flat` should now be used to ensure that you're returning a flat array. + +- [`3fdf509b2`](https://github.com/withastro/astro/commit/3fdf509b2731a9b2f972d89291e57cf78d62c769) Thanks [@ematipico](https://github.com/ematipico)! - The `build.split` and `build.excludeMiddleware` configuration options are deprecated and have been replaced by options in the adapter config. + + If your config includes the `build.excludeMiddleware` option, replace it with `edgeMiddleware` in your adapter options: + + ```diff + import { defineConfig } from "astro/config"; + import netlify from "@astrojs/netlify/functions"; + + export default defineConfig({ + build: { + - excludeMiddleware: true + }, + adapter: netlify({ + + edgeMiddleware: true + }), + }); + ``` + + If your config includes the `build.split` option, replace it with `functionPerRoute` in your adapter options: + + ```diff + import { defineConfig } from "astro/config"; + import netlify from "@astrojs/netlify/functions"; + + export default defineConfig({ + build: { + - split: true + }, + adapter: netlify({ + + functionPerRoute: true + }), + }); + ``` + +- [`2f951cd40`](https://github.com/withastro/astro/commit/2f951cd403dfcc2c3ca6aae618ae3e1409516e32) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Sharp is now the default image service used for `astro:assets`. If you would prefer to still use Squoosh, you can update your config with the following: + + ```ts + import { defineConfig, squooshImageService } from 'astro/config'; + + // https://astro.build/config + export default defineConfig({ + image: { + service: squooshImageService(), + }, + }); + ``` + + However, not only do we recommend using Sharp as it is faster and more reliable, it is also highly likely that the Squoosh service will be removed in a future release. + +- [`c022a4217`](https://github.com/withastro/astro/commit/c022a4217a805d223c1494e9eda4e48bbf810388) Thanks [@Princesseuh](https://github.com/Princesseuh)! - When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits of `astro:assets` such as enforcing `alt`, no CLS etc to users + +- [`67becaa58`](https://github.com/withastro/astro/commit/67becaa580b8f787df58de66b7008b7098f1209c) Thanks [@ematipico](https://github.com/ematipico)! - Removed support for old syntax of the API routes. + +- [`dfc2d93e3`](https://github.com/withastro/astro/commit/dfc2d93e3c645995379358fabbdfa9aab99f43d8) Thanks [@bluwy](https://github.com/bluwy)! - Remove MDX plugin re-ordering hack + +- [`3dc1ca2fa`](https://github.com/withastro/astro/commit/3dc1ca2fac8d9965cc5085a5d09e72ed87b4281a) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm. + +- [`1be84dfee`](https://github.com/withastro/astro/commit/1be84dfee3ce8e6f5cc624f99aec4e980f6fde37) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Update `tsconfig.json` presets with `moduleResolution: 'bundler'` and other new options from TypeScript 5.0. Astro now assumes that you use TypeScript 5.0 (March 2023), or that your editor includes it, ex: VS Code 1.77 + +- [`35f01df79`](https://github.com/withastro/astro/commit/35f01df797d23315f2bee2fc3fd795adb0559c58) Thanks [@Princesseuh](https://github.com/Princesseuh)! - The `astro check` command now requires an external package `@astrojs/check` and an install of `typescript` in your project. This was done in order to make the main `astro` package smaller and give more flexibility to users in regard to the version of TypeScript they use. + +- [`3fdf509b2`](https://github.com/withastro/astro/commit/3fdf509b2731a9b2f972d89291e57cf78d62c769) Thanks [@ematipico](https://github.com/ematipico)! - The `build.split` and `build.excludeMiddleware` configuration options are deprecated and have been replaced by options in the adapter config. + + If your config includes the `build.excludeMiddleware` option, replace it with `edgeMiddleware` in your adapter options: + + ```diff + import { defineConfig } from "astro/config"; + import vercel from "@astrojs/vercel/serverless"; + + export default defineConfig({ + build: { + - excludeMiddleware: true + }, + adapter: vercel({ + + edgeMiddleware: true + }), + }); + ``` + + If your config includes the `build.split` option, replace it with `functionPerRoute` in your adapter options: + + ```diff + import { defineConfig } from "astro/config"; + import vercel from "@astrojs/vercel/serverless"; + + export default defineConfig({ + build: { + - split: true + }, + adapter: vercel({ + + functionPerRoute: true + }), + }); + ``` + +- [`78de801f2`](https://github.com/withastro/astro/commit/78de801f21fd4ca1653950027d953bf08614566b) Thanks [@ematipico](https://github.com/ematipico)! - Lowercase names for endpoint functions are now deprecated. + + Rename functions to their uppercase equivalent: + + ```diff + - export function get() { + + export function GET() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); + } + + - export function post() { + + export function POST() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); + } + + - export function put() { + + export function PUT() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); + } + + - export function all() { + + export function ALL() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); + } + + // you can use the whole word "DELETE" + - export function del() { + + export function DELETE() { + return new Response(JSON.stringify({ "title": "Bob's blog" })); + } + ``` + +- [`59d6e569f`](https://github.com/withastro/astro/commit/59d6e569f63e175c97e82e94aa7974febfb76f7c) Thanks [@matthewp](https://github.com/matthewp)! - Astro.cookies.get(key) returns undefined if cookie doesn't exist + + With this change, Astro.cookies.get(key) no longer always returns a `AstroCookie` object. Instead it now returns `undefined` if the cookie does not exist. + + You should update your code if you assume that all calls to `get()` return a value. When using with `has()` you still need to assert the value, like so: + + ```astro + --- + if (Astro.cookies.has(id)) { + const id = Astro.cookies.get(id)!; + } + --- + ``` + +- [`7723c4cc9`](https://github.com/withastro/astro/commit/7723c4cc93298c2e6530e55da7afda048f22cf81) Thanks [@ematipico](https://github.com/ematipico)! - The property `compressHTML` is now `true` by default. Setting this value to `true` is no longer required. + + If you do not want to minify your HTML output, you must set this value to `false` in `astro.config.mjs`. + + ```diff + import {defineConfig} from "astro/config"; + export default defineConfig({ + + compressHTML: false + }) + ``` + +- [`fb5cd6b56`](https://github.com/withastro/astro/commit/fb5cd6b56dc27a71366ed5e1ab8bfe9b8f96bac5) Thanks [@ematipico](https://github.com/ematipico)! - Astro's default port when running the dev or preview server is now `4321`. + + This will reduce conflicts with ports used by other tools. + +- [`631b9c410`](https://github.com/withastro/astro/commit/631b9c410d5d66fa384674027ba95d69ebb5063f) Thanks [@bluwy](https://github.com/bluwy)! - Remove MDX special `components` export handling + +### Minor Changes + +- [`9b4f70a62`](https://github.com/withastro/astro/commit/9b4f70a629f55e461759ba46f68af7097a2e9215) Thanks [@ematipico](https://github.com/ematipico)! - Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter + can tell Astro if it can support it. + + ```ts + import { AstroIntegration } from './astro'; + + function myIntegration(): AstroIntegration { + return { + name: 'astro-awesome-list', + // new feature map + supportedAstroFeatures: { + hybridOutput: 'experimental', + staticOutput: 'stable', + serverOutput: 'stable', + assets: { + supportKind: 'stable', + isSharpCompatible: false, + isSquooshCompatible: false, + }, + }, + }; + } + ``` + +- [`bc37331d8`](https://github.com/withastro/astro/commit/bc37331d8154e3e95a8df9131e4e014e78a7a9e7) Thanks [@ematipico](https://github.com/ematipico)! - Integrations can now log messages using Astro’s built-in logger. + + The logger is available to all hooks as an additional parameter: + + ```ts + import { AstroIntegration } from './astro'; + + // integration.js + export function myIntegration(): AstroIntegration { + return { + name: 'my-integration', + hooks: { + 'astro:config:done': ({ logger }) => { + logger.info('Configure integration...'); + }, + }, + }; + } + ``` + +### Patch Changes + +- Updated dependencies [[`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81)]: + - @astrojs/telemetry@3.0.0-beta.0 + - @astrojs/internal-helpers@0.2.0-beta.0 + - @astrojs/markdown-remark@3.0.0-beta.0 + ## 2.10.9 ### Patch Changes diff --git a/packages/astro/astro-jsx.d.ts b/packages/astro/astro-jsx.d.ts index a04d755ec..b82de9388 100644 --- a/packages/astro/astro-jsx.d.ts +++ b/packages/astro/astro-jsx.d.ts @@ -9,6 +9,8 @@ * Adapted from React’s TypeScript definition from DefinitelyTyped. * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts */ +// BUG! Prettier 3.0 removes `declare`: https://github.com/prettier/prettier/issues/15207 +// prettier-ignore declare namespace astroHTML.JSX { export type Child = Node | Node[] | string | number | boolean | null | undefined | unknown; export type Children = Child | Child[]; diff --git a/packages/astro/astro.js b/packages/astro/astro.js index 37ea869bc..631a7b9c8 100755 --- a/packages/astro/astro.js +++ b/packages/astro/astro.js @@ -13,8 +13,8 @@ const CI_INSTRUCTIONS = { }; // Hardcode supported Node.js version so we don't have to read differently in CJS & ESM. -const engines = '>=16.12.0'; -const skipSemverCheckIfAbove = 16; +const engines = '>=18.14.1'; +const skipSemverCheckIfAbove = 19; /** `astro *` */ async function main() { diff --git a/packages/astro/client-base.d.ts b/packages/astro/client-base.d.ts deleted file mode 100644 index 3b0ee4901..000000000 --- a/packages/astro/client-base.d.ts +++ /dev/null @@ -1,427 +0,0 @@ -/// - -// eslint-disable-next-line @typescript-eslint/no-namespace -declare namespace App { - // eslint-disable-next-line @typescript-eslint/no-empty-interface - export interface Locals {} -} - -interface ImportMetaEnv { - /** - * The prefix for Astro-generated asset links if the build.assetsPrefix config option is set. This can be used to create asset links not handled by Astro. - */ - readonly ASSETS_PREFIX: string; - /** - * This is set to the site option specified in your project’s Astro config file. - */ - readonly SITE: string; -} - -interface ImportMeta { - /** - * Astro and Vite expose environment variables through `import.meta.env`. For a complete list of the environment variables available, see the two references below. - * - * - [Astro reference](https://docs.astro.build/en/guides/environment-variables/#default-environment-variables) - * - [Vite reference](https://vitejs.dev/guide/env-and-mode.html#env-variables) - */ - readonly env: ImportMetaEnv; -} - -declare module 'astro:assets' { - // Exporting things one by one is a bit cumbersome, not sure if there's a better way - erika, 2023-02-03 - type AstroAssets = { - // getImage's type here is different from the internal function since the Vite module implicitly pass the service config - /** - * Get an optimized image and the necessary attributes to render it. - * - * **Example** - * ```astro - * --- - * import { getImage } from 'astro:assets'; - * import originalImage from '../assets/image.png'; - * - * const optimizedImage = await getImage({src: originalImage, width: 1280 }); - * --- - * - * ``` - * - * This is functionally equivalent to using the `` component, as the component calls this function internally. - */ - getImage: ( - options: - | import('./dist/assets/types.js').ImageTransform - | import('./dist/assets/types.js').UnresolvedImageTransform - ) => Promise; - getConfiguredImageService: typeof import('./dist/assets/index.js').getConfiguredImageService; - Image: typeof import('./components/Image.astro').default; - }; - - type WithRequired = T & { [P in K]-?: T[P] }; - type Simplify = { [KeyType in keyof T]: T[KeyType] }; - type ImgAttributes = WithRequired< - Omit, 'src' | 'width' | 'height'>, - 'alt' - >; - - export type LocalImageProps = Simplify< - import('./dist/assets/types.js').LocalImageProps - >; - export type RemoteImageProps = Simplify< - import('./dist/assets/types.js').RemoteImageProps - >; - export const { getImage, getConfiguredImageService, Image }: AstroAssets; -} - -declare module 'astro:transitions' { - type TransitionModule = typeof import('./dist/transitions/index.js'); - export const slide: TransitionModule['slide']; - export const fade: TransitionModule['fade']; - - type ViewTransitionsModule = typeof import('./components/ViewTransitions.astro'); - export const ViewTransitions: ViewTransitionsModule['default']; -} - -type MD = import('./dist/@types/astro').MarkdownInstance>; -interface ExportedMarkdownModuleEntities { - frontmatter: MD['frontmatter']; - file: MD['file']; - url: MD['url']; - getHeadings: MD['getHeadings']; - /** @deprecated Renamed to `getHeadings()` */ - getHeaders: () => void; - Content: MD['Content']; - rawContent: MD['rawContent']; - compiledContent: MD['compiledContent']; - load: MD['default']; -} - -declare module '*.md' { - const { load }: ExportedMarkdownModuleEntities; - export const { - frontmatter, - file, - url, - getHeadings, - getHeaders, - Content, - rawContent, - compiledContent, - }: ExportedMarkdownModuleEntities; - export default load; -} - -declare module '*.markdown' { - const { load }: ExportedMarkdownModuleEntities; - export const { - frontmatter, - file, - url, - getHeadings, - getHeaders, - Content, - rawContent, - compiledContent, - }: ExportedMarkdownModuleEntities; - export default load; -} - -declare module '*.mkdn' { - const { load }: ExportedMarkdownModuleEntities; - export const { - frontmatter, - file, - url, - getHeadings, - getHeaders, - Content, - rawContent, - compiledContent, - }: ExportedMarkdownModuleEntities; - export default load; -} - -declare module '*.mkd' { - const { load }: ExportedMarkdownModuleEntities; - export const { - frontmatter, - file, - url, - getHeadings, - getHeaders, - Content, - rawContent, - compiledContent, - }: ExportedMarkdownModuleEntities; - export default load; -} - -declare module '*.mdwn' { - const { load }: ExportedMarkdownModuleEntities; - export const { - frontmatter, - file, - url, - getHeadings, - getHeaders, - Content, - rawContent, - compiledContent, - }: ExportedMarkdownModuleEntities; - export default load; -} - -declare module '*.mdown' { - const { load }: ExportedMarkdownModuleEntities; - export const { - frontmatter, - file, - url, - getHeadings, - getHeaders, - Content, - rawContent, - compiledContent, - }: ExportedMarkdownModuleEntities; - export default load; -} - -declare module '*.mdx' { - type MDX = import('./dist/@types/astro').MDXInstance>; - - export const frontmatter: MDX['frontmatter']; - export const file: MDX['file']; - export const url: MDX['url']; - export const getHeadings: MDX['getHeadings']; - export const Content: MDX['Content']; - - const load: MDX['default']; - export default load; -} - -declare module 'astro:ssr-manifest' { - export const manifest: import('./dist/@types/astro').SSRManifest; -} - -// Everything below are Vite's types (apart from image types, which are in `client.d.ts`) - -// CSS modules -type CSSModuleClasses = { readonly [key: string]: string }; - -declare module '*.module.css' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.scss' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.sass' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.less' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.styl' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.stylus' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.pcss' { - const classes: CSSModuleClasses; - export default classes; -} -declare module '*.module.sss' { - const classes: CSSModuleClasses; - export default classes; -} - -// CSS -declare module '*.css' { - const css: string; - export default css; -} -declare module '*.scss' { - const css: string; - export default css; -} -declare module '*.sass' { - const css: string; - export default css; -} -declare module '*.less' { - const css: string; - export default css; -} -declare module '*.styl' { - const css: string; - export default css; -} -declare module '*.stylus' { - const css: string; - export default css; -} -declare module '*.pcss' { - const css: string; - export default css; -} -declare module '*.sss' { - const css: string; - export default css; -} - -// Built-in asset types -// see `src/node/constants.ts` - -// images -declare module '*.jfif' { - const src: string; - export default src; -} -declare module '*.pjpeg' { - const src: string; - export default src; -} -declare module '*.pjp' { - const src: string; - export default src; -} -declare module '*.ico' { - const src: string; - export default src; -} - -// media -declare module '*.mp4' { - const src: string; - export default src; -} -declare module '*.webm' { - const src: string; - export default src; -} -declare module '*.ogg' { - const src: string; - export default src; -} -declare module '*.mp3' { - const src: string; - export default src; -} -declare module '*.wav' { - const src: string; - export default src; -} -declare module '*.flac' { - const src: string; - export default src; -} -declare module '*.aac' { - const src: string; - export default src; -} - -declare module '*.opus' { - const src: string; - export default src; -} - -// fonts -declare module '*.woff' { - const src: string; - export default src; -} -declare module '*.woff2' { - const src: string; - export default src; -} -declare module '*.eot' { - const src: string; - export default src; -} -declare module '*.ttf' { - const src: string; - export default src; -} -declare module '*.otf' { - const src: string; - export default src; -} - -// other -declare module '*.webmanifest' { - const src: string; - export default src; -} -declare module '*.pdf' { - const src: string; - export default src; -} -declare module '*.txt' { - const src: string; - export default src; -} - -// wasm?init -declare module '*.wasm?init' { - const initWasm: (options: WebAssembly.Imports) => Promise; - export default initWasm; -} - -// web worker -declare module '*?worker' { - const workerConstructor: { - new (): Worker; - }; - export default workerConstructor; -} - -declare module '*?worker&inline' { - const workerConstructor: { - new (): Worker; - }; - export default workerConstructor; -} - -declare module '*?worker&url' { - const src: string; - export default src; -} - -declare module '*?sharedworker' { - const sharedWorkerConstructor: { - new (): SharedWorker; - }; - export default sharedWorkerConstructor; -} - -declare module '*?sharedworker&inline' { - const sharedWorkerConstructor: { - new (): SharedWorker; - }; - export default sharedWorkerConstructor; -} - -declare module '*?sharedworker&url' { - const src: string; - export default src; -} - -declare module '*?raw' { - const src: string; - export default src; -} - -declare module '*?url' { - const src: string; - export default src; -} - -declare module '*?inline' { - const src: string; - export default src; -} diff --git a/packages/astro/client-image.d.ts b/packages/astro/client-image.d.ts deleted file mode 100644 index ffcc1c63c..000000000 --- a/packages/astro/client-image.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// - -// TODO: Merge this file with `client-base.d.ts` in 3.0, when the `astro:assets` feature isn't under a flag anymore. - -type InputFormat = import('./dist/assets/types.js').ImageInputFormat; - -interface ImageMetadata { - src: string; - width: number; - height: number; - format: InputFormat; -} - -declare module '*.gif' { - const metadata: ImageMetadata; - export default metadata; -} -declare module '*.jpeg' { - const metadata: ImageMetadata; - export default metadata; -} -declare module '*.jpg' { - const metadata: ImageMetadata; - export default metadata; -} -declare module '*.png' { - const metadata: ImageMetadata; - export default metadata; -} -declare module '*.tiff' { - const metadata: ImageMetadata; - export default metadata; -} -declare module '*.webp' { - const metadata: ImageMetadata; - export default metadata; -} -declare module '*.svg' { - const metadata: ImageMetadata; - export default metadata; -} diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts index 96f59d586..e6389d415 100644 --- a/packages/astro/client.d.ts +++ b/packages/astro/client.d.ts @@ -1,31 +1,473 @@ -/// +/// -// images -declare module '*.jpg' { - const src: string; - export default src; +// eslint-disable-next-line @typescript-eslint/no-namespace +declare namespace App { + // eslint-disable-next-line @typescript-eslint/no-empty-interface + export interface Locals {} +} + +interface ImportMetaEnv { + /** + * The prefix for Astro-generated asset links if the build.assetsPrefix config option is set. This can be used to create asset links not handled by Astro. + */ + readonly ASSETS_PREFIX: string; + /** + * This is set to the site option specified in your project’s Astro config file. + */ + readonly SITE: string; +} + +interface ImportMeta { + /** + * Astro and Vite expose environment variables through `import.meta.env`. For a complete list of the environment variables available, see the two references below. + * + * - [Astro reference](https://docs.astro.build/en/guides/environment-variables/#default-environment-variables) + * - [Vite reference](https://vitejs.dev/guide/env-and-mode.html#env-variables) + */ + readonly env: ImportMetaEnv; +} + +declare module 'astro:assets' { + // Exporting things one by one is a bit cumbersome, not sure if there's a better way - erika, 2023-02-03 + type AstroAssets = { + // getImage's type here is different from the internal function since the Vite module implicitly pass the service config + /** + * Get an optimized image and the necessary attributes to render it. + * + * **Example** + * ```astro + * --- + * import { getImage } from 'astro:assets'; + * import originalImage from '../assets/image.png'; + * + * const optimizedImage = await getImage({src: originalImage, width: 1280 }); + * --- + * + * ``` + * + * This is functionally equivalent to using the `` component, as the component calls this function internally. + */ + getImage: ( + options: + | import('./dist/assets/types.js').ImageTransform + | import('./dist/assets/types.js').UnresolvedImageTransform + ) => Promise; + getConfiguredImageService: typeof import('./dist/assets/index.js').getConfiguredImageService; + Image: typeof import('./components/Image.astro').default; + }; + + type WithRequired = T & { [P in K]-?: T[P] }; + type Simplify = { [KeyType in keyof T]: T[KeyType] }; + type ImgAttributes = WithRequired< + Omit, 'src' | 'width' | 'height'>, + 'alt' + >; + + export type LocalImageProps = Simplify< + import('./dist/assets/types.js').LocalImageProps + >; + export type RemoteImageProps = Simplify< + import('./dist/assets/types.js').RemoteImageProps + >; + export const { getImage, getConfiguredImageService, Image }: AstroAssets; +} + +type InputFormat = import('./dist/assets/types.js').ImageInputFormat; + +interface ImageMetadata { + src: string; + width: number; + height: number; + format: InputFormat; +} + +declare module '*.gif' { + const metadata: ImageMetadata; + export default metadata; } declare module '*.jpeg' { - const src: string; - export default src; + const metadata: ImageMetadata; + export default metadata; +} +declare module '*.jpg' { + const metadata: ImageMetadata; + export default metadata; } declare module '*.png' { - const src: string; - export default src; + const metadata: ImageMetadata; + export default metadata; } -declare module '*.gif' { - const src: string; - export default src; -} -declare module '*.svg' { - const src: string; - export default src; +declare module '*.tiff' { + const metadata: ImageMetadata; + export default metadata; } declare module '*.webp' { + const metadata: ImageMetadata; + export default metadata; +} +declare module '*.svg' { + const metadata: ImageMetadata; + export default metadata; +} + +declare module 'astro:transitions' { + type TransitionModule = typeof import('./dist/transitions/index.js'); + export const slide: TransitionModule['slide']; + export const fade: TransitionModule['fade']; + + type ViewTransitionsModule = typeof import('./components/ViewTransitions.astro'); + export const ViewTransitions: ViewTransitionsModule['default']; +} + +declare module 'astro:middleware' { + export * from 'astro/middleware/namespace'; +} + +declare module 'astro:components' { + export * from 'astro/components'; +} + +type MD = import('./dist/@types/astro').MarkdownInstance>; +interface ExportedMarkdownModuleEntities { + frontmatter: MD['frontmatter']; + file: MD['file']; + url: MD['url']; + getHeadings: MD['getHeadings']; + /** @deprecated Renamed to `getHeadings()` */ + getHeaders: () => void; + Content: MD['Content']; + rawContent: MD['rawContent']; + compiledContent: MD['compiledContent']; + load: MD['default']; +} + +declare module '*.md' { + const { load }: ExportedMarkdownModuleEntities; + export const { + frontmatter, + file, + url, + getHeadings, + getHeaders, + Content, + rawContent, + compiledContent, + }: ExportedMarkdownModuleEntities; + export default load; +} + +declare module '*.markdown' { + const { load }: ExportedMarkdownModuleEntities; + export const { + frontmatter, + file, + url, + getHeadings, + getHeaders, + Content, + rawContent, + compiledContent, + }: ExportedMarkdownModuleEntities; + export default load; +} + +declare module '*.mkdn' { + const { load }: ExportedMarkdownModuleEntities; + export const { + frontmatter, + file, + url, + getHeadings, + getHeaders, + Content, + rawContent, + compiledContent, + }: ExportedMarkdownModuleEntities; + export default load; +} + +declare module '*.mkd' { + const { load }: ExportedMarkdownModuleEntities; + export const { + frontmatter, + file, + url, + getHeadings, + getHeaders, + Content, + rawContent, + compiledContent, + }: ExportedMarkdownModuleEntities; + export default load; +} + +declare module '*.mdwn' { + const { load }: ExportedMarkdownModuleEntities; + export const { + frontmatter, + file, + url, + getHeadings, + getHeaders, + Content, + rawContent, + compiledContent, + }: ExportedMarkdownModuleEntities; + export default load; +} + +declare module '*.mdown' { + const { load }: ExportedMarkdownModuleEntities; + export const { + frontmatter, + file, + url, + getHeadings, + getHeaders, + Content, + rawContent, + compiledContent, + }: ExportedMarkdownModuleEntities; + export default load; +} + +declare module '*.mdx' { + type MDX = import('./dist/@types/astro').MDXInstance>; + + export const frontmatter: MDX['frontmatter']; + export const file: MDX['file']; + export const url: MDX['url']; + export const getHeadings: MDX['getHeadings']; + export const Content: MDX['Content']; + + const load: MDX['default']; + export default load; +} + +declare module 'astro:ssr-manifest' { + export const manifest: import('./dist/@types/astro').SSRManifest; +} + +// Everything below are Vite's types (apart from image types, which are in `client.d.ts`) + +// CSS modules +type CSSModuleClasses = { readonly [key: string]: string }; + +declare module '*.module.css' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.scss' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.sass' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.less' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.styl' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.stylus' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.pcss' { + const classes: CSSModuleClasses; + export default classes; +} +declare module '*.module.sss' { + const classes: CSSModuleClasses; + export default classes; +} + +// CSS +declare module '*.css' { + const css: string; + export default css; +} +declare module '*.scss' { + const css: string; + export default css; +} +declare module '*.sass' { + const css: string; + export default css; +} +declare module '*.less' { + const css: string; + export default css; +} +declare module '*.styl' { + const css: string; + export default css; +} +declare module '*.stylus' { + const css: string; + export default css; +} +declare module '*.pcss' { + const css: string; + export default css; +} +declare module '*.sss' { + const css: string; + export default css; +} + +// Built-in asset types +// see `src/node/constants.ts` + +// images +declare module '*.jfif' { const src: string; export default src; } -declare module '*.avif' { +declare module '*.pjpeg' { + const src: string; + export default src; +} +declare module '*.pjp' { + const src: string; + export default src; +} +declare module '*.ico' { + const src: string; + export default src; +} + +// media +declare module '*.mp4' { + const src: string; + export default src; +} +declare module '*.webm' { + const src: string; + export default src; +} +declare module '*.ogg' { + const src: string; + export default src; +} +declare module '*.mp3' { + const src: string; + export default src; +} +declare module '*.wav' { + const src: string; + export default src; +} +declare module '*.flac' { + const src: string; + export default src; +} +declare module '*.aac' { + const src: string; + export default src; +} + +declare module '*.opus' { + const src: string; + export default src; +} + +// fonts +declare module '*.woff' { + const src: string; + export default src; +} +declare module '*.woff2' { + const src: string; + export default src; +} +declare module '*.eot' { + const src: string; + export default src; +} +declare module '*.ttf' { + const src: string; + export default src; +} +declare module '*.otf' { + const src: string; + export default src; +} + +// other +declare module '*.webmanifest' { + const src: string; + export default src; +} +declare module '*.pdf' { + const src: string; + export default src; +} +declare module '*.txt' { + const src: string; + export default src; +} + +// wasm?init +declare module '*.wasm?init' { + const initWasm: (options: WebAssembly.Imports) => Promise; + export default initWasm; +} + +// web worker +declare module '*?worker' { + const workerConstructor: { + new (): Worker; + }; + export default workerConstructor; +} + +declare module '*?worker&inline' { + const workerConstructor: { + new (): Worker; + }; + export default workerConstructor; +} + +declare module '*?worker&url' { + const src: string; + export default src; +} + +declare module '*?sharedworker' { + const sharedWorkerConstructor: { + new (): SharedWorker; + }; + export default sharedWorkerConstructor; +} + +declare module '*?sharedworker&inline' { + const sharedWorkerConstructor: { + new (): SharedWorker; + }; + export default sharedWorkerConstructor; +} + +declare module '*?sharedworker&url' { + const src: string; + export default src; +} + +declare module '*?raw' { + const src: string; + export default src; +} + +declare module '*?url' { + const src: string; + export default src; +} + +declare module '*?inline' { const src: string; export default src; } diff --git a/packages/astro/content-types.template.d.ts b/packages/astro/content-types.template.d.ts index edc50fcc9..cf825c25e 100644 --- a/packages/astro/content-types.template.d.ts +++ b/packages/astro/content-types.template.d.ts @@ -46,7 +46,7 @@ declare module 'astro:content' { import('astro/zod').ZodLiteral<'tiff'>, import('astro/zod').ZodLiteral<'webp'>, import('astro/zod').ZodLiteral<'gif'>, - import('astro/zod').ZodLiteral<'svg'> + import('astro/zod').ZodLiteral<'svg'>, ] >; }>; @@ -89,7 +89,7 @@ declare module 'astro:content' { export function getEntryBySlug< C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}) + E extends ValidContentEntrySlug | (string & {}), >( collection: C, // Note that this has to accept a regular string too, for SSR @@ -114,7 +114,7 @@ declare module 'astro:content' { export function getEntry< C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}) + E extends ValidContentEntrySlug | (string & {}), >(entry: { collection: C; slug: E; @@ -123,7 +123,7 @@ declare module 'astro:content' { : Promise | undefined>; export function getEntry< C extends keyof DataEntryMap, - E extends keyof DataEntryMap[C] | (string & {}) + E extends keyof DataEntryMap[C] | (string & {}), >(entry: { collection: C; id: E; @@ -132,7 +132,7 @@ declare module 'astro:content' { : Promise | undefined>; export function getEntry< C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}) + E extends ValidContentEntrySlug | (string & {}), >( collection: C, slug: E @@ -141,7 +141,7 @@ declare module 'astro:content' { : Promise | undefined>; export function getEntry< C extends keyof DataEntryMap, - E extends keyof DataEntryMap[C] | (string & {}) + E extends keyof DataEntryMap[C] | (string & {}), >( collection: C, id: E diff --git a/packages/astro/e2e/astro-envs.test.js b/packages/astro/e2e/astro-envs.test.js index 1a4f4a1ca..50cff6e89 100644 --- a/packages/astro/e2e/astro-envs.test.js +++ b/packages/astro/e2e/astro-envs.test.js @@ -18,11 +18,11 @@ test.describe('Astro Environment BASE_URL', () => { await page.goto(astro.resolveUrl('/blog/')); const astroBaseUrl = page.locator('id=astro-base-url'); - await expect(astroBaseUrl, 'astroBaseUrl equals to /blog/').toHaveText('/blog/'); + await expect(astroBaseUrl, 'astroBaseUrl equals to /blog').toHaveText('/blog'); const clientComponentBaseUrl = page.locator('id=client-component-base-url'); await expect(clientComponentBaseUrl, 'clientComponentBaseUrl equals to /blog').toHaveText( - '/blog/' + '/blog' ); }); }); diff --git a/packages/astro/e2e/css-sourcemaps.test.js b/packages/astro/e2e/css-sourcemaps.test.js index 50b18834f..4ea3fc0e2 100644 --- a/packages/astro/e2e/css-sourcemaps.test.js +++ b/packages/astro/e2e/css-sourcemaps.test.js @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { isWindows, testFactory } from './test-utils.js'; +import { testFactory } from './test-utils.js'; const test = testFactory({ root: './fixtures/css/', @@ -16,8 +16,6 @@ test.afterAll(async () => { }); test.describe('CSS Sourcemap HMR', () => { - test.skip(isWindows, 'TODO: fix css hmr in windows'); - test('removes Astro-injected CSS once Vite-injected CSS loads', async ({ page, astro }) => { const html = await astro.fetch('/').then((res) => res.text()); diff --git a/packages/astro/e2e/css.test.js b/packages/astro/e2e/css.test.js index 7c2527499..184e5dba3 100644 --- a/packages/astro/e2e/css.test.js +++ b/packages/astro/e2e/css.test.js @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { getColor, isWindows, testFactory } from './test-utils.js'; +import { getColor, testFactory } from './test-utils.js'; const test = testFactory({ root: './fixtures/css/', @@ -16,8 +16,6 @@ test.afterAll(async () => { }); test.describe('CSS HMR', () => { - test.skip(isWindows, 'TODO: fix css hmr in windows'); - test('edit CSS from @import', async ({ page, astro }) => { await page.goto(astro.resolveUrl('/')); diff --git a/packages/astro/e2e/errors.test.js b/packages/astro/e2e/errors.test.js index e23b22c65..4cb1b02fb 100644 --- a/packages/astro/e2e/errors.test.js +++ b/packages/astro/e2e/errors.test.js @@ -75,7 +75,7 @@ test.describe('Error display', () => { const fileExists = astro.pathExists(absoluteFileUrl); expect(fileExists).toBeTruthy(); - expect(fileLocation).toMatch(/^components\/PreactRuntimeError.jsx/); + expect(fileLocation).toMatch(/^preact\/PreactRuntimeError.jsx/); }); test('shows correct line when a style preprocess has an error', async ({ page, astro }) => { @@ -105,7 +105,10 @@ test.describe('Error display', () => { // Wait for page reload page.waitForNavigation(), // Edit the component file - astro.editFile('./src/components/SvelteSyntaxError.svelte', () => `

No mismatch

`), + astro.editFile( + './src/components/svelte/SvelteSyntaxError.svelte', + () => `

No mismatch

` + ), ]); expect(await page.locator('vite-error-overlay').count()).toEqual(0); diff --git a/packages/astro/e2e/fixtures/client-only/astro.config.mjs b/packages/astro/e2e/fixtures/client-only/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/client-only/astro.config.mjs +++ b/packages/astro/e2e/fixtures/client-only/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/client-only/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/client-only/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/client-only/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/client-only/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/client-only/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/client-only/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/client-only/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/client-only/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/client-only/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/client-only/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/client-only/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/client-only/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/client-only/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/client-only/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/client-only/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/client-only/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/client-only/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/client-only/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/client-only/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/client-only/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/client-only/src/pages/index.astro b/packages/astro/e2e/fixtures/client-only/src/pages/index.astro index 708ba1582..0b4299600 100644 --- a/packages/astro/e2e/fixtures/client-only/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/client-only/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import * as react from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import * as react from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.jsx'; +import SolidCounter from '../components/solid/SolidCounter.jsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/errors/astro.config.mjs b/packages/astro/e2e/fixtures/errors/astro.config.mjs index 8f27d8fab..48e8736bd 100644 --- a/packages/astro/e2e/fixtures/errors/astro.config.mjs +++ b/packages/astro/e2e/fixtures/errors/astro.config.mjs @@ -7,5 +7,11 @@ import vue from '@astrojs/vue'; // https://astro.build/config export default defineConfig({ - integrations: [react(), preact(), solid(), svelte(), vue()], -}); \ No newline at end of file + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], +}); diff --git a/packages/astro/e2e/fixtures/errors/src/components/PreactRuntimeError.jsx b/packages/astro/e2e/fixtures/errors/src/components/preact/PreactRuntimeError.jsx similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/PreactRuntimeError.jsx rename to packages/astro/e2e/fixtures/errors/src/components/preact/PreactRuntimeError.jsx diff --git a/packages/astro/e2e/fixtures/errors/src/components/PreactSyntaxError.jsx b/packages/astro/e2e/fixtures/errors/src/components/preact/PreactSyntaxError.jsx similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/PreactSyntaxError.jsx rename to packages/astro/e2e/fixtures/errors/src/components/preact/PreactSyntaxError.jsx diff --git a/packages/astro/e2e/fixtures/errors/src/components/ReactRuntimeError.jsx b/packages/astro/e2e/fixtures/errors/src/components/react/ReactRuntimeError.jsx similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/ReactRuntimeError.jsx rename to packages/astro/e2e/fixtures/errors/src/components/react/ReactRuntimeError.jsx diff --git a/packages/astro/e2e/fixtures/errors/src/components/ReactSyntaxError.jsx b/packages/astro/e2e/fixtures/errors/src/components/react/ReactSyntaxError.jsx similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/ReactSyntaxError.jsx rename to packages/astro/e2e/fixtures/errors/src/components/react/ReactSyntaxError.jsx diff --git a/packages/astro/e2e/fixtures/errors/src/components/SolidRuntimeError.jsx b/packages/astro/e2e/fixtures/errors/src/components/solid/SolidRuntimeError.jsx similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/SolidRuntimeError.jsx rename to packages/astro/e2e/fixtures/errors/src/components/solid/SolidRuntimeError.jsx diff --git a/packages/astro/e2e/fixtures/errors/src/components/SolidSyntaxError.jsx b/packages/astro/e2e/fixtures/errors/src/components/solid/SolidSyntaxError.jsx similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/SolidSyntaxError.jsx rename to packages/astro/e2e/fixtures/errors/src/components/solid/SolidSyntaxError.jsx diff --git a/packages/astro/e2e/fixtures/errors/src/components/SvelteDirectiveError.svelte b/packages/astro/e2e/fixtures/errors/src/components/svelte/SvelteDirectiveError.svelte similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/SvelteDirectiveError.svelte rename to packages/astro/e2e/fixtures/errors/src/components/svelte/SvelteDirectiveError.svelte diff --git a/packages/astro/e2e/fixtures/errors/src/components/SvelteRuntimeError.svelte b/packages/astro/e2e/fixtures/errors/src/components/svelte/SvelteRuntimeError.svelte similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/SvelteRuntimeError.svelte rename to packages/astro/e2e/fixtures/errors/src/components/svelte/SvelteRuntimeError.svelte diff --git a/packages/astro/e2e/fixtures/errors/src/components/SvelteSyntaxError.svelte b/packages/astro/e2e/fixtures/errors/src/components/svelte/SvelteSyntaxError.svelte similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/SvelteSyntaxError.svelte rename to packages/astro/e2e/fixtures/errors/src/components/svelte/SvelteSyntaxError.svelte diff --git a/packages/astro/e2e/fixtures/errors/src/components/VueRuntimeError.vue b/packages/astro/e2e/fixtures/errors/src/components/vue/VueRuntimeError.vue similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/VueRuntimeError.vue rename to packages/astro/e2e/fixtures/errors/src/components/vue/VueRuntimeError.vue diff --git a/packages/astro/e2e/fixtures/errors/src/components/VueSyntaxError.vue b/packages/astro/e2e/fixtures/errors/src/components/vue/VueSyntaxError.vue similarity index 100% rename from packages/astro/e2e/fixtures/errors/src/components/VueSyntaxError.vue rename to packages/astro/e2e/fixtures/errors/src/components/vue/VueSyntaxError.vue diff --git a/packages/astro/e2e/fixtures/errors/src/pages/astro-client-media-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/astro-client-media-error.astro index 46bb9a2c4..94e124c9a 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/astro-client-media-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/astro-client-media-error.astro @@ -1,7 +1,7 @@ --- -import SvelteDirectiveError from '../components/SvelteDirectiveError.svelte'; +import SvelteDirectiveError from '../components/svelte/SvelteDirectiveError.svelte'; ---
-
\ No newline at end of file + diff --git a/packages/astro/e2e/fixtures/errors/src/pages/astro-hydration-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/astro-hydration-error.astro index 1852539eb..8fcd56bd4 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/astro-hydration-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/astro-hydration-error.astro @@ -1,7 +1,7 @@ --- -import SvelteDirectiveError from '../components/SvelteDirectiveError.svelte'; +import SvelteDirectiveError from '../components/svelte/SvelteDirectiveError.svelte'; ---
-
\ No newline at end of file + diff --git a/packages/astro/e2e/fixtures/errors/src/pages/preact-runtime-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/preact-runtime-error.astro index 5c0aa2526..17ad92808 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/preact-runtime-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/preact-runtime-error.astro @@ -1,5 +1,5 @@ --- -import PreactRuntimeError from '../components/PreactRuntimeError.jsx'; +import PreactRuntimeError from '../components/preact/PreactRuntimeError.jsx'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/preact-syntax-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/preact-syntax-error.astro index 6748b0366..b0f709b9d 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/preact-syntax-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/preact-syntax-error.astro @@ -1,5 +1,5 @@ --- -import PreactSyntaxError from '../components/PreactSyntaxError.jsx'; +import PreactSyntaxError from '../components/preact/PreactSyntaxError.jsx'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/react-runtime-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/react-runtime-error.astro index f1df8ec99..18490518e 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/react-runtime-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/react-runtime-error.astro @@ -1,5 +1,5 @@ --- -import ReactRuntimeError from '../components/ReactRuntimeError.jsx'; +import ReactRuntimeError from '../components/react/ReactRuntimeError.jsx'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/react-syntax-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/react-syntax-error.astro index 6e61ae31d..c11b49ae0 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/react-syntax-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/react-syntax-error.astro @@ -1,5 +1,5 @@ --- -import ReactSyntaxError from '../components/ReactSyntaxError.jsx'; +import ReactSyntaxError from '../components/react/ReactSyntaxError.jsx'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/solid-runtime-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/solid-runtime-error.astro index 51a2608bd..7d4160126 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/solid-runtime-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/solid-runtime-error.astro @@ -1,5 +1,5 @@ --- -import SolidRuntimeError from '../components/SolidRuntimeError.jsx'; +import SolidRuntimeError from '../components/solid/SolidRuntimeError.jsx'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/solid-syntax-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/solid-syntax-error.astro index 0fdbad25b..028ab9ede 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/solid-syntax-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/solid-syntax-error.astro @@ -1,5 +1,5 @@ --- -import SolidSyntaxError from '../components/SolidSyntaxError.jsx'; +import SolidSyntaxError from '../components/solid/SolidSyntaxError.jsx'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/svelte-runtime-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/svelte-runtime-error.astro index ec499f6db..662a48f0e 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/svelte-runtime-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/svelte-runtime-error.astro @@ -1,5 +1,5 @@ --- -import SvelteRuntimeError from '../components/SvelteRuntimeError.svelte'; +import SvelteRuntimeError from '../components/svelte/SvelteRuntimeError.svelte'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/svelte-syntax-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/svelte-syntax-error.astro index 26c14c15e..e275251a4 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/svelte-syntax-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/svelte-syntax-error.astro @@ -1,5 +1,5 @@ --- -import SvelteSyntaxError from '../components/SvelteSyntaxError.svelte'; +import SvelteSyntaxError from '../components/svelte/SvelteSyntaxError.svelte'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/vue-runtime-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/vue-runtime-error.astro index b63f85e63..698da561f 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/vue-runtime-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/vue-runtime-error.astro @@ -1,5 +1,5 @@ --- -import VueRuntimeError from '../components/VueRuntimeError.vue'; +import VueRuntimeError from '../components/vue/VueRuntimeError.vue'; ---
diff --git a/packages/astro/e2e/fixtures/errors/src/pages/vue-syntax-error.astro b/packages/astro/e2e/fixtures/errors/src/pages/vue-syntax-error.astro index 8db897fe1..c76ed16fe 100644 --- a/packages/astro/e2e/fixtures/errors/src/pages/vue-syntax-error.astro +++ b/packages/astro/e2e/fixtures/errors/src/pages/vue-syntax-error.astro @@ -1,5 +1,5 @@ --- -import VueSyntaxError from '../components/VueSyntaxError.vue'; +import VueSyntaxError from '../components/vue/VueSyntaxError.vue'; ---
diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/astro.config.mjs b/packages/astro/e2e/fixtures/multiple-frameworks/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/multiple-frameworks/astro.config.mjs +++ b/packages/astro/e2e/fixtures/multiple-frameworks/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/multiple-frameworks/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/multiple-frameworks/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/multiple-frameworks/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/multiple-frameworks/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/multiple-frameworks/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/multiple-frameworks/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/multiple-frameworks/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/multiple-frameworks/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/multiple-frameworks/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/multiple-frameworks/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/pages/index.astro b/packages/astro/e2e/fixtures/multiple-frameworks/src/pages/index.astro index a30688bca..747744852 100644 --- a/packages/astro/e2e/fixtures/multiple-frameworks/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/multiple-frameworks/src/pages/index.astro @@ -3,11 +3,11 @@ import '../styles/global.css'; // Component Imports import { A, B as Renamed } from '../components'; -import * as react from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import * as react from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/nested-in-preact/astro.config.mjs b/packages/astro/e2e/fixtures/nested-in-preact/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/nested-in-preact/astro.config.mjs +++ b/packages/astro/e2e/fixtures/nested-in-preact/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/nested-in-preact/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-preact/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-preact/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/nested-in-preact/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-preact/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/nested-in-preact/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/nested-in-preact/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-preact/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-preact/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-preact/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-preact/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/nested-in-preact/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/nested-in-preact/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-preact/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/nested-in-preact/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/pages/index.astro b/packages/astro/e2e/fixtures/nested-in-preact/src/pages/index.astro index 619e8cccd..7512b86f4 100644 --- a/packages/astro/e2e/fixtures/nested-in-preact/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/nested-in-preact/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import ReactCounter from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import ReactCounter from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/nested-in-react/astro.config.mjs b/packages/astro/e2e/fixtures/nested-in-react/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/nested-in-react/astro.config.mjs +++ b/packages/astro/e2e/fixtures/nested-in-react/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/nested-in-react/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-react/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-react/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/nested-in-react/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-react/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/nested-in-react/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/nested-in-react/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-react/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-react/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-react/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-react/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/nested-in-react/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/nested-in-react/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-react/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/nested-in-react/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/pages/index.astro b/packages/astro/e2e/fixtures/nested-in-react/src/pages/index.astro index 0b3b23d9d..fe18a3151 100644 --- a/packages/astro/e2e/fixtures/nested-in-react/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/nested-in-react/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import ReactCounter from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import ReactCounter from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/nested-in-solid/astro.config.mjs b/packages/astro/e2e/fixtures/nested-in-solid/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/nested-in-solid/astro.config.mjs +++ b/packages/astro/e2e/fixtures/nested-in-solid/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/nested-in-solid/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-solid/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-solid/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/nested-in-solid/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-solid/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/nested-in-solid/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/nested-in-solid/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-solid/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-solid/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-solid/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-solid/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/nested-in-solid/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/nested-in-solid/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-solid/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/nested-in-solid/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/pages/index.astro b/packages/astro/e2e/fixtures/nested-in-solid/src/pages/index.astro index 0feb5ba60..7b2c8da8d 100644 --- a/packages/astro/e2e/fixtures/nested-in-solid/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/nested-in-solid/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import { Counter as ReactCounter } from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import { Counter as ReactCounter } from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/astro.config.mjs b/packages/astro/e2e/fixtures/nested-in-svelte/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/nested-in-svelte/astro.config.mjs +++ b/packages/astro/e2e/fixtures/nested-in-svelte/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-svelte/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-svelte/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-svelte/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/nested-in-svelte/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-svelte/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-svelte/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-svelte/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/nested-in-svelte/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-svelte/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/nested-in-svelte/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/pages/index.astro b/packages/astro/e2e/fixtures/nested-in-svelte/src/pages/index.astro index 764ebfaf7..aa11de7fd 100644 --- a/packages/astro/e2e/fixtures/nested-in-svelte/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/nested-in-svelte/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import { Counter as ReactCounter } from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import { Counter as ReactCounter } from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/nested-in-vue/astro.config.mjs b/packages/astro/e2e/fixtures/nested-in-vue/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/nested-in-vue/astro.config.mjs +++ b/packages/astro/e2e/fixtures/nested-in-vue/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/nested-in-vue/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-vue/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-vue/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/nested-in-vue/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-vue/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/nested-in-vue/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/nested-in-vue/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-vue/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/nested-in-vue/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-vue/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-vue/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/nested-in-vue/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/nested-in-vue/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/nested-in-vue/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/nested-in-vue/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/pages/index.astro b/packages/astro/e2e/fixtures/nested-in-vue/src/pages/index.astro index 5e4d47d76..e89554755 100644 --- a/packages/astro/e2e/fixtures/nested-in-vue/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/nested-in-vue/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import { Counter as ReactCounter } from '../components/ReactCounter.jsx'; -import { PreactCounter } from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import { Counter as ReactCounter } from '../components/react/ReactCounter.jsx'; +import { PreactCounter } from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; // Full Astro Component Syntax: // https://docs.astro.build/core-concepts/astro-components/ diff --git a/packages/astro/e2e/fixtures/nested-recursive/astro.config.mjs b/packages/astro/e2e/fixtures/nested-recursive/astro.config.mjs index 4b50887cd..0ef8f6e2b 100644 --- a/packages/astro/e2e/fixtures/nested-recursive/astro.config.mjs +++ b/packages/astro/e2e/fixtures/nested-recursive/astro.config.mjs @@ -8,5 +8,11 @@ import solid from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ // Enable many frameworks to support all different kinds of components. - integrations: [preact(), react(), svelte(), vue(), solid()], + integrations: [ + react({ include: ['**/react/*'] }), + preact({ include: ['**/preact/*'] }), + solid({ include: ['**/solid/*'] }), + svelte(), + vue(), + ], }); diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/components/PreactCounter.tsx b/packages/astro/e2e/fixtures/nested-recursive/src/components/preact/PreactCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-recursive/src/components/PreactCounter.tsx rename to packages/astro/e2e/fixtures/nested-recursive/src/components/preact/PreactCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/components/ReactCounter.jsx b/packages/astro/e2e/fixtures/nested-recursive/src/components/react/ReactCounter.jsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-recursive/src/components/ReactCounter.jsx rename to packages/astro/e2e/fixtures/nested-recursive/src/components/react/ReactCounter.jsx diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/components/SolidCounter.tsx b/packages/astro/e2e/fixtures/nested-recursive/src/components/solid/SolidCounter.tsx similarity index 100% rename from packages/astro/e2e/fixtures/nested-recursive/src/components/SolidCounter.tsx rename to packages/astro/e2e/fixtures/nested-recursive/src/components/solid/SolidCounter.tsx diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-recursive/src/components/svelte/SvelteCounter.svelte similarity index 100% rename from packages/astro/e2e/fixtures/nested-recursive/src/components/SvelteCounter.svelte rename to packages/astro/e2e/fixtures/nested-recursive/src/components/svelte/SvelteCounter.svelte diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/components/VueCounter.vue b/packages/astro/e2e/fixtures/nested-recursive/src/components/vue/VueCounter.vue similarity index 100% rename from packages/astro/e2e/fixtures/nested-recursive/src/components/VueCounter.vue rename to packages/astro/e2e/fixtures/nested-recursive/src/components/vue/VueCounter.vue diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/pages/index.astro b/packages/astro/e2e/fixtures/nested-recursive/src/pages/index.astro index 685c7fb5e..a17337c89 100644 --- a/packages/astro/e2e/fixtures/nested-recursive/src/pages/index.astro +++ b/packages/astro/e2e/fixtures/nested-recursive/src/pages/index.astro @@ -1,9 +1,9 @@ --- -import ReactCounter from '../components/ReactCounter.jsx'; -import PreactCounter from '../components/PreactCounter.tsx'; -import SolidCounter from '../components/SolidCounter.tsx'; -import VueCounter from '../components/VueCounter.vue'; -import SvelteCounter from '../components/SvelteCounter.svelte'; +import ReactCounter from '../components/react/ReactCounter.jsx'; +import PreactCounter from '../components/preact/PreactCounter.tsx'; +import SolidCounter from '../components/solid/SolidCounter.tsx'; +import VueCounter from '../components/vue/VueCounter.vue'; +import SvelteCounter from '../components/svelte/SvelteCounter.svelte'; --- diff --git a/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs b/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs index 8a9f43bcc..78c248963 100644 --- a/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs +++ b/packages/astro/e2e/fixtures/view-transitions/astro.config.mjs @@ -9,7 +9,6 @@ export default defineConfig({ integrations: [react()], experimental: { viewTransitions: true, - assets: true, }, vite: { build: { diff --git a/packages/astro/e2e/multiple-frameworks.test.js b/packages/astro/e2e/multiple-frameworks.test.js index b9bc85576..e067b0357 100644 --- a/packages/astro/e2e/multiple-frameworks.test.js +++ b/packages/astro/e2e/multiple-frameworks.test.js @@ -154,9 +154,7 @@ test.skip('Multiple frameworks', () => { await expect(count, 'initial count updated to 5').toHaveText('5'); }); - // TODO: re-enable this test when #3559 is fixed - // https://github.com/withastro/astro/issues/3559 - test.skip('Vue component', async ({ astro, page }) => { + test('Vue component', async ({ astro, page }) => { await page.goto(astro.resolveUrl('/')); const count = page.locator('#vue-counter pre'); @@ -169,9 +167,7 @@ test.skip('Multiple frameworks', () => { await expect(count, 'initial count updated to 5').toHaveText('5'); }); - // TODO: track down a reliability issue in this test - // It seems to lost connection to the vite server in CI - test.skip('Svelte component', async ({ astro, page }) => { + test('Svelte component', async ({ astro, page }) => { await page.goto(astro.resolveUrl('/')); const count = page.locator('#svelte-counter pre'); diff --git a/packages/astro/env.d.ts b/packages/astro/env.d.ts index 079370bec..876a29c60 100644 --- a/packages/astro/env.d.ts +++ b/packages/astro/env.d.ts @@ -1,8 +1,8 @@ -/// +/// // Caution! The types here are only available inside Astro files (injected automatically by our language server) // As such, if the typings you're trying to add should be available inside ex: React components, they should instead -// be inside `client-base.d.ts` +// be inside `client.d.ts` type Astro = import('./dist/@types/astro.js').AstroGlobal; diff --git a/packages/astro/package.json b/packages/astro/package.json index c79eccc60..76e67fb92 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "2.10.9", + "version": "3.0.0-beta.2", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", @@ -23,6 +23,9 @@ ], "middleware": [ "./dist/core/middleware/index.d.ts" + ], + "middleware/namespace": [ + "./dist/core/middleware/namespace.d.ts" ] } }, @@ -34,14 +37,14 @@ "./env": "./env.d.ts", "./types": "./types.d.ts", "./client": "./client.d.ts", - "./client-base": "./client-base.d.ts", - "./client-image": "./client-image.d.ts", "./import-meta": "./import-meta.d.ts", "./astro-jsx": "./astro-jsx.d.ts", "./tsconfigs/*.json": "./tsconfigs/*", "./tsconfigs/*": "./tsconfigs/*.json", "./jsx/*": "./dist/jsx/*", "./jsx-runtime": "./dist/jsx-runtime/index.js", + "./compiler-runtime": "./dist/runtime/compiler/index.js", + "./runtime/*": "./dist/runtime/*", "./config": { "types": "./config.d.ts", "default": "./config.mjs" @@ -56,22 +59,24 @@ "./assets/image-endpoint": "./dist/assets/image-endpoint.js", "./assets/services/sharp": "./dist/assets/services/sharp.js", "./assets/services/squoosh": "./dist/assets/services/squoosh.js", + "./assets/services/noop": "./dist/assets/services/noop.js", "./content/runtime": "./dist/content/runtime.js", "./content/runtime-assets": "./dist/content/runtime-assets.js", "./debug": "./components/Debug.astro", - "./internal/*": "./dist/runtime/server/*", "./package.json": "./package.json", - "./runtime/*": "./dist/runtime/*", - "./server/*": "./dist/runtime/server/*", - "./dist/jsx/*": "./dist/jsx/*", "./zod": { "types": "./zod.d.ts", "default": "./zod.mjs" }, + "./errors": "./dist/core/errors/userError.js", "./middleware": { "types": "./dist/core/middleware/index.d.ts", "default": "./dist/core/middleware/index.js" }, + "./middleware/namespace": { + "types": "./dist/core/middleware/namespace.d.ts", + "default": "./dist/core/middleware/namespace.js" + }, "./transitions": "./dist/transitions/index.js" }, "imports": { @@ -91,8 +96,6 @@ "zod.mjs", "env.d.ts", "client.d.ts", - "client-base.d.ts", - "client-image.d.ts", "content-types.template.d.ts", "content-module.template.mjs", "import-meta.d.ts", @@ -115,12 +118,10 @@ "test:e2e:match": "playwright test -g" }, "dependencies": { - "@astrojs/compiler": "^1.8.0", - "@astrojs/internal-helpers": "^0.1.2", - "@astrojs/language-server": "^1.0.0", - "@astrojs/markdown-remark": "^2.2.1", - "@astrojs/telemetry": "^2.1.1", - "@astrojs/webapi": "^2.2.0", + "@astrojs/compiler": "^1.8.1", + "@astrojs/internal-helpers": "workspace:*", + "@astrojs/markdown-remark": "workspace:*", + "@astrojs/telemetry": "workspace:*", "@babel/core": "^7.22.5", "@babel/generator": "^7.22.5", "@babel/parser": "^7.22.5", @@ -128,8 +129,6 @@ "@babel/traverse": "^7.22.5", "@babel/types": "^7.22.5", "@types/babel__core": "^7.20.1", - "@types/dom-view-transitions": "^1.0.1", - "@types/yargs-parser": "^21.0.0", "acorn": "^8.9.0", "boxen": "^6.2.1", "chokidar": "^3.5.3", @@ -137,22 +136,22 @@ "common-ancestor-path": "^1.0.1", "cookie": "^0.5.0", "debug": "^4.3.4", + "deepmerge-ts": "^4.3.0", "devalue": "^4.3.2", "diff": "^5.1.0", "es-module-lexer": "^1.3.0", - "esbuild": "^0.17.19", - "estree-walker": "3.0.0", + "esbuild": "^0.18.16", + "estree-walker": "^3.0.3", "execa": "^6.1.0", "fast-glob": "^3.2.12", "github-slugger": "^2.0.0", "gray-matter": "^4.0.3", - "html-escaper": "^3.0.3", "http-cache-semantics": "^4.1.1", + "html-escaper": "^3.0.3", "js-yaml": "^4.1.0", "kleur": "^4.1.4", "magic-string": "^0.30.2", "mime": "^3.0.0", - "network-information-types": "^0.1.1", "ora": "^6.3.1", "p-limit": "^4.0.0", "path-to-regexp": "^6.2.1", @@ -161,11 +160,11 @@ "rehype": "^12.0.1", "semver": "^7.5.3", "server-destroy": "^1.0.1", + "sharp": "^0.32.1", "shiki": "^0.14.1", "string-width": "^5.1.2", "strip-ansi": "^7.1.0", "tsconfig-resolver": "^3.0.1", - "typescript": "*", "unist-util-visit": "^4.1.2", "vfile": "^5.3.7", "vite": "^4.4.6", @@ -175,6 +174,7 @@ "zod": "^3.20.6" }, "devDependencies": { + "@astrojs/check": "^0.1.0", "@playwright/test": "^1.29.2", "@types/babel__generator": "^7.6.4", "@types/babel__traverse": "^7.20.1", @@ -184,6 +184,7 @@ "@types/cookie": "^0.5.1", "@types/debug": "^4.1.8", "@types/diff": "^5.0.3", + "@types/dom-view-transitions": "^1.0.1", "@types/estree": "^0.0.51", "@types/hast": "^2.3.4", "@types/html-escaper": "^3.0.0", @@ -193,17 +194,17 @@ "@types/mocha": "^9.1.1", "@types/prettier": "^2.7.3", "@types/prompts": "^2.4.4", - "@types/resolve": "^1.20.2", - "@types/rimraf": "^3.0.2", "@types/send": "^0.17.1", "@types/server-destroy": "^1.0.1", "@types/unist": "^2.0.6", + "@types/yargs-parser": "^21.0.0", "astro-scripts": "workspace:*", "chai": "^4.3.7", "cheerio": "1.0.0-rc.12", "eol": "^0.9.1", "memfs": "^3.5.3", "mocha": "^9.2.2", + "network-information-types": "^0.1.1", "node-mocks-http": "^1.12.2", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.0.1", @@ -211,21 +212,11 @@ "remark-code-titles": "^0.1.2", "rollup": "^3.25.1", "sass": "^1.63.4", - "sharp": "^0.32.1", "srcset-parse": "^1.1.0", - "undici": "^5.22.1", "unified": "^10.1.2" }, - "peerDependencies": { - "sharp": ">=0.31.0" - }, - "peerDependenciesMeta": { - "sharp": { - "optional": true - } - }, "engines": { - "node": ">=16.12.0", + "node": ">=18.14.1", "npm": ">=6.14.0" } } diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index cc5ddea7f..0449b89d4 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -20,8 +20,10 @@ import type { AstroConfigType } from '../core/config'; import type { AstroTimer } from '../core/config/timer'; import type { AstroCookies } from '../core/cookies'; import type { LogOptions, LoggerLevel } from '../core/logger/core'; +import type { AstroIntegrationLogger } from '../core/logger/core'; import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server'; import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'; + export type { MarkdownHeading, MarkdownMetadata, @@ -132,7 +134,6 @@ export interface CLIFlags { config?: string; drafts?: boolean; open?: boolean; - experimentalAssets?: boolean; } /** @@ -329,7 +330,7 @@ type ServerConfig = { /** * @name server.port * @type {number} - * @default `3000` + * @default `4321` * @description * Set which port the dev server should listen on. * @@ -543,14 +544,14 @@ export interface AstroUserConfig { * @docs * @name compressHTML * @type {boolean} - * @default `false` + * @default `true` * @description - * This is an option to minify your HTML output and reduce the size of your HTML files. When enabled, Astro removes all whitespace from your HTML, including line breaks, from `.astro` components. This occurs both in development mode and in the final build. - * To enable this, set the `compressHTML` flag to `true`. + * This is an option to minify your HTML output and reduce the size of your HTML files. By default, Astro removes all whitespace from your HTML, including line breaks, from `.astro` components. This occurs both in development mode and in the final build. + * To disable HTML compression, set the `compressHTML` flag to `false`. * * ```js * { - * compressHTML: true + * compressHTML: false * } * ``` */ @@ -573,12 +574,7 @@ export interface AstroUserConfig { * * When using this option, all of your static asset imports and URLs should add the base as a prefix. You can access this value via `import.meta.env.BASE_URL`. * - * By default, the value of `import.meta.env.BASE_URL` includes a trailing slash. If you have the [`trailingSlash`](https://docs.astro.build/en/reference/configuration-reference/#trailingslash) option set to `'never'`, you will need to add it manually in your static asset imports and URLs. - * - * ```astro - * About - * - * ``` + * The value of `import.meta.env.BASE_URL` respects your `trailingSlash` config and will include a trailing slash if you explicitly include one or if `trailingSlash: "always"` is set. If `trailingSlash: "never"` is set, `BASE_URL` will not include a trailing slash, even if `base` includes one. */ base?: string; @@ -611,19 +607,21 @@ export interface AstroUserConfig { /** * @docs * @name scopedStyleStrategy - * @type {('where' | 'class')} + * @type {('where' | 'class' | 'attribute')} * @default `'where'` * @version 2.4 * @description * * Specify the strategy used for scoping styles within Astro components. Choose from: - * - `'where'` - Use `:where` selectors, causing no specifity increase. - * - `'class'` - Use class-based selectors, causing a +1 specifity increase. + * - `'where'` - Use `:where` selectors, causing no specifity increase. + * - `'class'` - Use class-based selectors, causing a +1 specifity increase. + * - `'attribute'` - Use `data-` attributes, causing no specifity increase. * * Using `'class'` is helpful when you want to ensure that element selectors within an Astro component override global style defaults (e.g. from a global stylesheet). * Using `'where'` gives you more control over specifity, but requires that you use higher-specifity selectors, layers, and other tools to control which selectors are applied. + * Using `'attribute'` is useful in case there's manipulation of the class attributes, so the styling emitted by Astro doesn't go in conflict with the user's business logic. */ - scopedStyleStrategy?: 'where' | 'class'; + scopedStyleStrategy?: 'where' | 'class' | 'attribute'; /** * @docs @@ -921,7 +919,7 @@ export interface AstroUserConfig { * ```js * { * // Example: Use the function syntax to customize based on command - * server: ({ command }) => ({ port: command === 'dev' ? 3000 : 4000 }) + * server: ({ command }) => ({ port: command === 'dev' ? 4321 : 4000 }) * } * ``` */ @@ -943,7 +941,7 @@ export interface AstroUserConfig { * @docs * @name server.port * @type {number} - * @default `3000` + * @default `4321` * @description * Set which port the server should listen on. * @@ -993,7 +991,7 @@ export interface AstroUserConfig { * @docs * @name image.service (Experimental) * @type {{entrypoint: 'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | string, config: Record}} - * @default `{entrypoint: 'astro/assets/services/squoosh', config?: {}}` + * @default `{entrypoint: 'astro/assets/services/sharp', config?: {}}` * @version 2.1.0 * @description * Set which image service is used for Astro’s experimental assets support. @@ -1300,27 +1298,6 @@ export interface AstroUserConfig { * These flags are not guaranteed to be stable. */ experimental?: { - /** - * @docs - * @name experimental.assets - * @type {boolean} - * @default `false` - * @version 2.1.0 - * @description - * Enable experimental support for optimizing and resizing images. With this enabled, a new `astro:assets` module will be exposed. - * - * To enable this feature, set `experimental.assets` to `true` in your Astro config: - * - * ```js - * { - * experimental: { - * assets: true, - * }, - * } - * ``` - */ - assets?: boolean; - /** * @docs * @name experimental.viewTransitions @@ -1505,6 +1482,17 @@ export interface DataEntryType { export type GetDataEntryInfoReturnType = { data: Record; rawData?: string }; +export interface AstroAdapterFeatures { + /** + * Creates and edge function that will communiate with the Astro middleware + */ + edgeMiddleware: boolean; + /** + * SSR only. Each route becomes its own function/file. + */ + functionPerRoute: boolean; +} + export interface AstroSettings { config: AstroConfig; adapter: AstroAdapter | undefined; @@ -1621,10 +1609,7 @@ export type GetStaticPathsResultKeyed = GetStaticPathsResult & { */ export type GetStaticPaths = ( options: GetStaticPathsOptions -) => - | Promise - | GetStaticPathsResult - | GetStaticPathsResult[]; +) => Promise | GetStaticPathsResult; /** * Infers the shape of the `params` property returned by `getStaticPaths()`. @@ -1767,12 +1752,52 @@ export type PaginateFunction = (data: any[], args?: PaginateOptions) => GetStati export type Params = Record; +export type SupportsKind = 'unsupported' | 'stable' | 'experimental' | 'deprecated'; + +export type AstroFeatureMap = { + /** + * The adapter is able serve static pages + */ + staticOutput?: SupportsKind; + /** + * The adapter is able to serve pages that are static or rendered via server + */ + hybridOutput?: SupportsKind; + /** + * The adapter is able to serve SSR pages + */ + serverOutput?: SupportsKind; + /** + * The adapter can emit static assets + */ + assets?: AstroAssetsFeature; +}; + +export interface AstroAssetsFeature { + supportKind?: SupportsKind; + /** + * Whether if this adapter deploys files in an enviroment that is compatible with the library `sharp` + */ + isSharpCompatible?: boolean; + /** + * Whether if this adapter deploys files in an enviroment that is compatible with the library `squoosh` + */ + isSquooshCompatible?: boolean; +} + export interface AstroAdapter { name: string; serverEntrypoint?: string; previewEntrypoint?: string; exports?: string[]; args?: any; + adapterFeatures?: AstroAdapterFeatures; + /** + * List of features supported by an adapter. + * + * If the adapter is not able to handle certain configurations, Astro will throw an error. + */ + supportedAstroFeatures?: AstroFeatureMap; } type Body = string; @@ -1895,7 +1920,7 @@ export interface APIContext = Record { * context.locals.greeting = "Hello!"; @@ -1960,7 +1985,7 @@ export interface SSRLoadedRenderer extends AstroRenderer { export type HookParameters< Hook extends keyof AstroIntegration['hooks'], - Fn = AstroIntegration['hooks'][Hook] + Fn = AstroIntegration['hooks'][Hook], > = Fn extends (...args: any) => any ? Parameters[0] : never; export interface AstroIntegration { @@ -1978,6 +2003,7 @@ export interface AstroIntegration { injectScript: (stage: InjectedScriptStage, content: string) => void; injectRoute: (injectRoute: InjectedRoute) => void; addClientDirective: (directive: ClientDirectiveConfig) => void; + logger: AstroIntegrationLogger; // TODO: Add support for `injectElement()` for full HTML element injection, not just scripts. // This may require some refactoring of `scripts`, `styles`, and `links` into something // more generalized. Consider the SSR use-case as well. @@ -1986,10 +2012,17 @@ export interface AstroIntegration { 'astro:config:done'?: (options: { config: AstroConfig; setAdapter: (adapter: AstroAdapter) => void; + logger: AstroIntegrationLogger; }) => void | Promise; - 'astro:server:setup'?: (options: { server: vite.ViteDevServer }) => void | Promise; - 'astro:server:start'?: (options: { address: AddressInfo }) => void | Promise; - 'astro:server:done'?: () => void | Promise; + 'astro:server:setup'?: (options: { + server: vite.ViteDevServer; + logger: AstroIntegrationLogger; + }) => void | Promise; + 'astro:server:start'?: (options: { + address: AddressInfo; + logger: AstroIntegrationLogger; + }) => void | Promise; + 'astro:server:done'?: (options: { logger: AstroIntegrationLogger }) => void | Promise; 'astro:build:ssr'?: (options: { manifest: SerializedSSRManifest; /** @@ -2001,19 +2034,25 @@ export interface AstroIntegration { * File path of the emitted middleware */ middlewareEntryPoint: URL | undefined; + logger: AstroIntegrationLogger; }) => void | Promise; - 'astro:build:start'?: () => void | Promise; + 'astro:build:start'?: (options: { logger: AstroIntegrationLogger }) => void | Promise; 'astro:build:setup'?: (options: { vite: vite.InlineConfig; pages: Map; target: 'client' | 'server'; updateConfig: (newConfig: vite.InlineConfig) => void; + logger: AstroIntegrationLogger; + }) => void | Promise; + 'astro:build:generated'?: (options: { + dir: URL; + logger: AstroIntegrationLogger; }) => void | Promise; - 'astro:build:generated'?: (options: { dir: URL }) => void | Promise; 'astro:build:done'?: (options: { pages: { pathname: string }[]; dir: URL; routes: RouteData[]; + logger: AstroIntegrationLogger; }) => void | Promise; }; } diff --git a/packages/astro/src/assets/image-endpoint.ts b/packages/astro/src/assets/image-endpoint.ts index fa62cbdd1..aa2baf0a5 100644 --- a/packages/astro/src/assets/image-endpoint.ts +++ b/packages/astro/src/assets/image-endpoint.ts @@ -1,9 +1,8 @@ import mime from 'mime/lite.js'; import type { APIRoute } from '../@types/astro.js'; -import { isRemotePath } from '../core/path.js'; -import { getConfiguredImageService, isRemoteAllowed } from './internal.js'; -import { isLocalService } from './services/service.js'; import { etag } from './utils/etag.js'; +import { isRemotePath } from '@astrojs/internal-helpers/path'; +import { getConfiguredImageService, isRemoteAllowed } from './internal.js'; // @ts-expect-error import { imageConfig } from 'astro:assets'; @@ -24,11 +23,11 @@ async function loadRemoteImage(src: URL) { /** * Endpoint used in dev and SSR to serve optimized images by the base image services */ -export const get: APIRoute = async ({ request }) => { +export const GET: APIRoute = async ({ request }) => { try { const imageService = await getConfiguredImageService(); - if (!isLocalService(imageService)) { + if (!('transform' in imageService)) { throw new Error('Configured image service is not a local service'); } diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index ffc27333f..dd5e427f6 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -11,6 +11,7 @@ import type { import { matchHostname, matchPattern } from './utils/remotePattern.js'; export function injectImageEndpoint(settings: AstroSettings) { + // TODO: Add a setting to disable the image endpoint settings.injectedRoutes.push({ pattern: '/_image', entryPoint: 'astro/assets/image-endpoint', diff --git a/packages/astro/src/assets/services/noop.ts b/packages/astro/src/assets/services/noop.ts new file mode 100644 index 000000000..d57ffeb27 --- /dev/null +++ b/packages/astro/src/assets/services/noop.ts @@ -0,0 +1,17 @@ +import { baseService, type LocalImageService } from './service.js'; + +// Empty service used for platforms that neither support Squoosh or Sharp. +const noopService: LocalImageService = { + validateOptions: baseService.validateOptions, + getURL: baseService.getURL, + parseURL: baseService.parseURL, + getHTMLAttributes: baseService.getHTMLAttributes, + async transform(inputBuffer, transformOptions) { + return { + data: inputBuffer, + format: transformOptions.format, + }; + }, +}; + +export default noopService; diff --git a/packages/astro/src/assets/services/vendor/squoosh/impl.ts b/packages/astro/src/assets/services/vendor/squoosh/impl.ts index 7bb9aeeea..273957e4b 100644 --- a/packages/astro/src/assets/services/vendor/squoosh/impl.ts +++ b/packages/astro/src/assets/services/vendor/squoosh/impl.ts @@ -33,7 +33,7 @@ export async function decodeBuffer( .join('') // TODO (future PR): support more formats if (firstChunkString.includes('GIF')) { - throw Error(`GIF images are not supported, please install the @astrojs/image/sharp plugin`) + throw Error(`GIF images are not supported, please use the Sharp image service`) } const key = Object.entries(supportedFormats).find(([, { detectors }]) => detectors.some((detector) => detector.exec(firstChunkString)) @@ -78,7 +78,7 @@ export async function encodeJpeg( opts: { quality?: number } ): Promise { image = ImageData.from(image) - + const e = supportedFormats['mozjpeg'] const m = await e.enc() await maybeDelay() diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 9c5990cb7..ae74fc692 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -90,7 +90,7 @@ export type LocalImageProps = ImageSharedProps & { * * **Example**: * ```js - * import myImage from "~/assets/my_image.png"; + * import myImage from "../assets/my_image.png"; * ``` * And then refer to the image, like so: * ```astro diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index 0f00e0ecb..f194e5288 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -1,10 +1,7 @@ -import { bold } from 'kleur/colors'; 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 { error } from '../core/logger/core.js'; import { appendForwardSlash, joinPaths, @@ -22,53 +19,16 @@ const urlRE = /(\?|&)url(?:&|$)/; export default function assets({ settings, - logging, mode, }: AstroPluginOptions & { mode: string }): vite.Plugin[] { let resolvedConfig: vite.ResolvedConfig; globalThis.astroAsset = {}; - const UNSUPPORTED_ADAPTERS = new Set([ - '@astrojs/cloudflare', - '@astrojs/deno', - '@astrojs/netlify/edge-functions', - '@astrojs/vercel/edge', - ]); - - const adapterName = settings.config.adapter?.name; - if ( - ['astro/assets/services/sharp', 'astro/assets/services/squoosh'].includes( - settings.config.image.service.entrypoint - ) && - adapterName && - UNSUPPORTED_ADAPTERS.has(adapterName) - ) { - error( - logging, - 'assets', - `The currently selected adapter \`${adapterName}\` does not run on Node, however the currently used image service depends on Node built-ins. ${bold( - 'Your project will NOT be able to build.' - )}` - ); - } - return [ // Expose the components and different utilities from `astro:assets` and handle serving images from `/_image` in dev { name: 'astro:assets', - config() { - return { - resolve: { - alias: [ - { - find: /^~\/assets\/(.+)$/, - replacement: fileURLToPath(new URL('./assets/$1', settings.config.srcDir)), - }, - ], - }, - }; - }, async resolveId(id) { if (id === VIRTUAL_SERVICE_ID) { return await this.resolve(settings.config.image.service.entrypoint); diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index 82f590c25..fcaeb07c7 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -216,12 +216,6 @@ export async function add(names: string[], { flags }: AddOptions) { await fs.writeFile(fileURLToPath(configURL), ASTRO_CONFIG_STUB, { encoding: 'utf-8' }); } - // TODO: improve error handling for invalid configs - if (configURL?.pathname.endsWith('package.json')) { - throw new Error( - `Unable to use "astro add" with package.json configuration. Try migrating to \`astro.config.mjs\` and try again.` - ); - } let ast: t.File | null = null; try { ast = await parseAstroConfig(configURL); @@ -709,6 +703,7 @@ async function tryToInstallIntegrations({ } catch (err) { spinner.fail(); debug('add', 'Error installing dependencies', err); + // eslint-disable-next-line no-console console.error('\n', (err as any).stdout, '\n'); return UpdateResult.failure; } diff --git a/packages/astro/src/cli/check/index.ts b/packages/astro/src/cli/check/index.ts index 96bee308d..428027154 100644 --- a/packages/astro/src/cli/check/index.ts +++ b/packages/astro/src/cli/check/index.ts @@ -1,396 +1,43 @@ -import { - AstroCheck, - DiagnosticSeverity, - type GetDiagnosticsResult, -} from '@astrojs/language-server'; -import type { FSWatcher } from 'chokidar'; -import glob from 'fast-glob'; -import { bold, dim, red, yellow } from 'kleur/colors'; -import { createRequire } from 'module'; -import fs from 'node:fs'; -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 { resolveConfig } from '../../core/config/config.js'; -import { createNodeLogging } from '../../core/config/logging.js'; -import { createSettings } from '../../core/config/settings.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 { syncInternal } from '../../core/sync'; -import { eventCliSession, telemetry } from '../../events/index.js'; -import { runHookConfigSetup } from '../../integrations/index.js'; -import { flagsToAstroInlineConfig } from '../flags.js'; -import { printDiagnostic } from './print.js'; +import path from 'node:path'; +import type { Arguments } from 'yargs-parser'; +import { error, info } from '../../core/logger/core.js'; +import { createLoggingFromFlags, flagsToAstroInlineConfig } from '../flags.js'; +import { getPackage } from '../install-package.js'; -type DiagnosticResult = { - errors: number; - warnings: number; - hints: number; -}; +export async function check(flags: Arguments) { + const logging = createLoggingFromFlags(flags); + const getPackageOpts = { skipAsk: flags.yes || flags.y, cwd: flags.root }; + const checkPackage = await getPackage( + '@astrojs/check', + logging, + getPackageOpts, + ['typescript'] + ); + const typescript = await getPackage('typescript', logging, getPackageOpts); -export type CheckPayload = { - /** - * Flags passed via CLI - */ - flags: Flags; -}; - -type CheckFlags = { - /** - * Whether the `check` command should watch for `.astro` and report errors - * @default {false} - */ - watch: boolean; -}; - -/** - * - * Types of response emitted by the checker - */ -export enum CheckResult { - /** - * Operation finished without errors - */ - ExitWithSuccess, - /** - * Operation finished with errors - */ - ExitWithError, - /** - * The consumer should not terminate the operation - */ - Listen, -} - -const ASTRO_GLOB_PATTERN = '**/*.astro'; - -/** - * Checks `.astro` files for possible errors. - * - * If the `--watch` flag is provided, the command runs indefinitely and provides diagnostics - * when `.astro` files are modified. - * - * Every time an astro files is modified, content collections are also generated. - * - * @param {CheckPayload} options Options passed {@link AstroChecker} - * @param {Flags} options.flags Flags coming from the CLI - */ -export async function check({ flags }: CheckPayload): Promise { - if (flags.help || flags.h) { - printHelp({ - commandName: 'astro check', - usage: '[...flags]', - tables: { - Flags: [ - ['--watch', 'Watch Astro files for changes and re-run checks.'], - ['--help (-h)', 'See all available flags.'], - ], - }, - description: `Runs diagnostics against your project and reports errors to the console.`, - }); + if (!checkPackage || !typescript) { + error( + logging, + 'check', + 'The `@astrojs/check` and `typescript` packages are required for this command to work. Please manually install them into your project and try again.' + ); return; } - // Load settings + // Run sync before check to make sure types are generated. + // NOTE: In the future, `@astrojs/check` can expose a `before lint` hook so that this works during `astro check --watch` too. + // For now, we run this once as usually `astro check --watch` is ran alongside `astro dev` which also calls `astro sync`. + const { sync } = await import('../../core/sync/index.js'); const inlineConfig = flagsToAstroInlineConfig(flags); - const logging = createNodeLogging(inlineConfig); - const { userConfig, astroConfig } = await resolveConfig(inlineConfig, 'check'); - telemetry.record(eventCliSession('check', userConfig, flags)); - const settings = createSettings(astroConfig, fileURLToPath(astroConfig.root)); - - const checkFlags = parseFlags(flags); - if (checkFlags.watch) { - info(logging, 'check', 'Checking files in watch mode'); - } else { - info(logging, 'check', 'Checking files'); + const exitCode = await sync(inlineConfig); + if (exitCode !== 0) { + process.exit(exitCode); } - const { syncInternal } = await import('../../core/sync/index.js'); - const root = settings.config.root; - const require = createRequire(import.meta.url); - const diagnosticChecker = new AstroCheck( - root.toString(), - require.resolve('typescript/lib/tsserverlibrary.js', { - paths: [root.toString()], - }) - ); + const { check: checker, parseArgsAsCheckConfig } = checkPackage; - return new AstroChecker({ - syncInternal, - settings, - fileSystem: fs, - logging, - diagnosticChecker, - isWatchMode: checkFlags.watch, - }); -} - -type CheckerConstructor = { - diagnosticChecker: AstroCheck; - - isWatchMode: boolean; - - syncInternal: typeof syncInternal; - - settings: Readonly; - - logging: Readonly; - - fileSystem: typeof fs; -}; - -/** - * Responsible to check files - classic or watch mode - and report diagnostics. - * - * When in watch mode, the class does a whole check pass, and then starts watching files. - * When a change occurs to an `.astro` file, the checker builds content collections again and lint all the `.astro` files. - */ -export class AstroChecker { - readonly #diagnosticsChecker: AstroCheck; - readonly #shouldWatch: boolean; - readonly #syncInternal: CheckerConstructor['syncInternal']; - - readonly #settings: AstroSettings; - - readonly #logging: LogOptions; - readonly #fs: typeof fs; - #watcher?: FSWatcher; - - #filesCount: number; - #updateDiagnostics: NodeJS.Timeout | undefined; - - constructor({ - diagnosticChecker, - isWatchMode, - syncInternal, - settings, - fileSystem, - logging, - }: CheckerConstructor) { - this.#diagnosticsChecker = diagnosticChecker; - this.#shouldWatch = isWatchMode; - this.#syncInternal = syncInternal; - this.#logging = logging; - this.#settings = settings; - this.#fs = fileSystem; - this.#filesCount = 0; - } - - /** - * Check all `.astro` files once and then finishes the operation. - */ - public async check(): Promise { - return await this.#checkAllFiles(true); - } - - /** - * Check all `.astro` files and then start watching for changes. - */ - public async watch(): Promise { - await this.#checkAllFiles(true); - await this.#watch(); - return CheckResult.Listen; - } - - /** - * Stops the watch. It terminates the inner server. - */ - public async stop() { - await this.#watcher?.close(); - } - - /** - * Whether the checker should run in watch mode - */ - public get isWatchMode(): boolean { - return this.#shouldWatch; - } - - async #openDocuments() { - this.#filesCount = await openAllDocuments( - this.#settings.config.root, - [], - this.#diagnosticsChecker - ); - } - - /** - * Lint all `.astro` files, and report the result in console. Operations executed, in order: - * 1. Compile content collections. - * 2. Optionally, traverse the file system for `.astro` files and saves their paths. - * 3. Get diagnostics for said files and print the result in console. - * - * @param openDocuments Whether the operation should open all `.astro` files - */ - async #checkAllFiles(openDocuments: boolean): Promise { - // Run `astro:config:setup` before syncing to initialize integrations. - // We do this manually as we're calling `syncInternal` directly. - const syncSettings = await runHookConfigSetup({ - settings: this.#settings, - logging: this.#logging, - command: 'build', - }); - const processExit = await this.#syncInternal(syncSettings, { - logging: this.#logging, - fs: this.#fs, - }); - // early exit on sync failure - if (processExit === 1) return processExit; - - let spinner = ora( - ` Getting diagnostics for Astro files in ${fileURLToPath(this.#settings.config.root)}…` - ).start(); - - if (openDocuments) { - await this.#openDocuments(); - } - - let diagnostics = await this.#diagnosticsChecker.getDiagnostics(); - - spinner.succeed(); - - let brokenDownDiagnostics = this.#breakDownDiagnostics(diagnostics); - this.#logDiagnosticsSeverity(brokenDownDiagnostics); - return brokenDownDiagnostics.errors > 0 - ? CheckResult.ExitWithError - : CheckResult.ExitWithSuccess; - } - - #checkForDiagnostics() { - clearTimeout(this.#updateDiagnostics); - // @ematipico: I am not sure of `setTimeout`. I would rather use a debounce but let's see if this works. - // Inspiration from `svelte-check`. - this.#updateDiagnostics = setTimeout(async () => await this.#checkAllFiles(false), 500); - } - - /** - * This function is responsible to attach events to the server watcher - */ - async #watch() { - const { default: chokidar } = await import('chokidar'); - this.#watcher = chokidar.watch( - join(fileURLToPath(this.#settings.config.root), ASTRO_GLOB_PATTERN), - { - ignored: ['**/node_modules/**'], - ignoreInitial: true, - } - ); - - this.#watcher.on('add', (file) => { - this.#addDocument(file); - this.#filesCount += 1; - this.#checkForDiagnostics(); - }); - this.#watcher.on('change', (file) => { - this.#addDocument(file); - this.#checkForDiagnostics(); - }); - this.#watcher.on('unlink', (file) => { - this.#diagnosticsChecker.removeDocument(file); - this.#filesCount -= 1; - this.#checkForDiagnostics(); - }); - } - - /** - * Add a document to the diagnostics checker - * @param filePath Path to the file - */ - #addDocument(filePath: string) { - const text = fs.readFileSync(filePath, 'utf-8'); - this.#diagnosticsChecker.upsertDocument({ - uri: pathToFileURL(filePath).toString(), - text, - }); - } - - /** - * Logs the result of the various diagnostics - * - * @param result Result emitted by AstroChecker.#breakDownDiagnostics - */ - #logDiagnosticsSeverity(result: Readonly) { - info( - this.#logging, - 'diagnostics', - [ - bold(`Result (${this.#filesCount} file${this.#filesCount === 1 ? '' : 's'}): `), - bold(red(`${result.errors} ${result.errors === 1 ? 'error' : 'errors'}`)), - bold(yellow(`${result.warnings} ${result.warnings === 1 ? 'warning' : 'warnings'}`)), - dim(`${result.hints} ${result.hints === 1 ? 'hint' : 'hints'}\n`), - ].join(`\n${dim('-')} `) - ); - } - - /** - * It loops through all diagnostics and break down diagnostics that are errors, warnings or hints. - */ - #breakDownDiagnostics(diagnostics: Readonly): DiagnosticResult { - let result: DiagnosticResult = { - errors: 0, - warnings: 0, - hints: 0, - }; - - diagnostics.forEach((diag) => { - diag.diagnostics.forEach((d) => { - info(this.#logging, 'diagnostics', `\n ${printDiagnostic(diag.fileUri, diag.text, d)}`); - - switch (d.severity) { - case DiagnosticSeverity.Error: { - result.errors++; - break; - } - case DiagnosticSeverity.Warning: { - result.warnings++; - break; - } - case DiagnosticSeverity.Hint: { - result.hints++; - break; - } - } - }); - }); - - return result; - } -} - -/** - * Open all Astro files in the given directory and return the number of files found. - */ -async function openAllDocuments( - workspaceUri: URL, - filePathsToIgnore: string[], - checker: AstroCheck -): Promise { - const files = await glob(ASTRO_GLOB_PATTERN, { - cwd: fileURLToPath(workspaceUri), - ignore: ['node_modules/**'].concat(filePathsToIgnore.map((ignore) => `${ignore}/**`)), - absolute: true, - }); - - for (const file of files) { - debug('check', `Adding file ${file} to the list of files to check.`); - const text = fs.readFileSync(file, 'utf-8'); - checker.upsertDocument({ - uri: pathToFileURL(file).toString(), - text, - }); - } - - return files.length; -} - -/** - * Parse flags and sets defaults - */ -function parseFlags(flags: Flags): CheckFlags { - return { - watch: flags.watch ?? false, - }; + const config = parseArgsAsCheckConfig(process.argv); + + info(logging, 'check', `Getting diagnostics for Astro files in ${path.resolve(config.root)}...`); + return await checker(config); } diff --git a/packages/astro/src/cli/check/print.ts b/packages/astro/src/cli/check/print.ts deleted file mode 100644 index bd8de2ddb..000000000 --- a/packages/astro/src/cli/check/print.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { DiagnosticSeverity, offsetAt, type Diagnostic } from '@astrojs/language-server'; -import { - bgRed, - bgWhite, - bgYellow, - black, - bold, - cyan, - gray, - red, - white, - yellow, -} from 'kleur/colors'; -import { fileURLToPath } from 'node:url'; -import stringWidth from 'string-width'; - -export function printDiagnostic(filePath: string, text: string, diag: Diagnostic): string { - let result = []; - - // Lines and characters are 0-indexed, so we need to add 1 to the offset to get the actual line and character - const realStartLine = diag.range.start.line + 1; - const realStartCharacter = diag.range.start.character + 1; - - // IDE friendly path that user can CTRL+Click to open the file at a specific line / character - const IDEFilePath = `${bold(cyan(fileURLToPath(filePath)))}:${bold(yellow(realStartLine))}:${bold( - yellow(realStartCharacter) - )}`; - result.push( - `${IDEFilePath} ${bold(getColorForSeverity(diag, getStringForSeverity(diag)))}: ${diag.message}` - ); - - // Optionally add the line before the error to add context if not empty - const previousLine = getLine(diag.range.start.line - 1, text); - if (previousLine) { - result.push(`${getPrintableLineNumber(realStartLine - 1)} ${gray(previousLine)}`); - } - - // Add the line with the error - const str = getLine(diag.range.start.line, text); - const lineNumStr = realStartLine.toString().padStart(2, '0'); - const lineNumLen = lineNumStr.length; - result.push(`${getBackgroundForSeverity(diag, lineNumStr)} ${str}`); - - // Adds tildes under the specific range where the diagnostic is - const tildes = generateString('~', diag.range.end.character - diag.range.start.character); - - // NOTE: This is not perfect, if the line include any characters that is made of multiple characters, for example - // regionals flags, but the terminal can't display it, then the number of spaces will be wrong. Not sure how to fix. - const beforeChars = stringWidth(str.substring(0, diag.range.start.character)); - const spaces = generateString(' ', beforeChars + lineNumLen - 1); - result.push(` ${spaces}${bold(getColorForSeverity(diag, tildes))}`); - - const nextLine = getLine(diag.range.start.line + 1, text); - if (nextLine) { - result.push(`${getPrintableLineNumber(realStartLine + 1)} ${gray(nextLine)}`); - } - - // Force a new line at the end - result.push(''); - - return result.join('\n'); -} - -function generateString(str: string, len: number): string { - return Array.from({ length: len }, () => str).join(''); -} - -function getStringForSeverity(diag: Diagnostic): string { - switch (diag.severity) { - case DiagnosticSeverity.Error: - return 'Error'; - case DiagnosticSeverity.Warning: - return 'Warning'; - case DiagnosticSeverity.Hint: - return 'Hint'; - default: - return 'Unknown'; - } -} - -function getColorForSeverity(diag: Diagnostic, text: string): string { - switch (diag.severity) { - case DiagnosticSeverity.Error: - return red(text); - case DiagnosticSeverity.Warning: - return yellow(text); - case DiagnosticSeverity.Hint: - return gray(text); - default: - return text; - } -} - -function getBackgroundForSeverity(diag: Diagnostic, text: string): string { - switch (diag.severity) { - case DiagnosticSeverity.Error: - return bgRed(white(text)); - case DiagnosticSeverity.Warning: - return bgYellow(white(text)); - case DiagnosticSeverity.Hint: - return bgWhite(black(text)); - default: - return text; - } -} - -function getPrintableLineNumber(line: number): string { - return bgWhite(black(line.toString().padStart(2, '0'))); -} - -function getLine(line: number, text: string): string { - return text - .substring( - offsetAt({ line, character: 0 }, text), - offsetAt({ line, character: Number.MAX_SAFE_INTEGER }, text) - ) - .replace(/\t/g, ' ') - .trimEnd(); -} diff --git a/packages/astro/src/cli/dev/index.ts b/packages/astro/src/cli/dev/index.ts index e55496c4a..5db47fb97 100644 --- a/packages/astro/src/cli/dev/index.ts +++ b/packages/astro/src/cli/dev/index.ts @@ -15,7 +15,7 @@ export async function dev({ flags }: DevOptions) { usage: '[...flags]', tables: { Flags: [ - ['--port', `Specify which port to run on. Defaults to 3000.`], + ['--port', `Specify which port to run on. Defaults to 4321.`], ['--host', `Listen on all addresses, including LAN and public addresses.`], ['--host ', `Expose on a network IP address at `], ['--open', 'Automatically open the app in the browser on server start'], diff --git a/packages/astro/src/cli/flags.ts b/packages/astro/src/cli/flags.ts index 703422d50..3d7360a29 100644 --- a/packages/astro/src/cli/flags.ts +++ b/packages/astro/src/cli/flags.ts @@ -23,9 +23,6 @@ export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig { typeof flags.host === 'string' || typeof flags.host === 'boolean' ? flags.host : undefined, open: typeof flags.open === 'boolean' ? flags.open : undefined, }, - experimental: { - assets: typeof flags.experimentalAssets === 'boolean' ? flags.experimentalAssets : undefined, - }, }; } diff --git a/packages/astro/src/cli/index.ts b/packages/astro/src/cli/index.ts index d16ea91e2..fdf43201f 100644 --- a/packages/astro/src/cli/index.ts +++ b/packages/astro/src/cli/index.ts @@ -154,18 +154,12 @@ async function runCommand(cmd: string, flags: yargs.Arguments) { } case 'check': { const { check } = await import('./check/index.js'); - // We create a server to start doing our operations - const checkServer = await check({ flags }); - if (checkServer) { - if (checkServer.isWatchMode) { - await checkServer.watch(); - return await new Promise(() => {}); // lives forever - } else { - const checkResult = await checkServer.check(); - return process.exit(checkResult); - } + const checkServer = await check(flags); + if (flags.watch) { + return await new Promise(() => {}); // lives forever + } else { + return process.exit(checkServer ? 1 : 0); } - return; } case 'sync': { const { sync } = await import('./sync/index.js'); diff --git a/packages/astro/src/cli/install-package.ts b/packages/astro/src/cli/install-package.ts new file mode 100644 index 000000000..8793d9985 --- /dev/null +++ b/packages/astro/src/cli/install-package.ts @@ -0,0 +1,124 @@ +import boxen from 'boxen'; +import { execa } from 'execa'; +import { bold, cyan, dim, magenta } from 'kleur/colors'; +import { createRequire } from 'node:module'; +import ora from 'ora'; +import prompts from 'prompts'; +import whichPm from 'which-pm'; +import { debug, info, type LogOptions } from '../core/logger/core.js'; + +type GetPackageOptions = { + skipAsk?: boolean; + cwd?: string; +}; + +export async function getPackage( + packageName: string, + logging: LogOptions, + options: GetPackageOptions, + otherDeps: string[] = [] +): Promise { + const require = createRequire(options.cwd ?? process.cwd()); + + let packageImport; + try { + require.resolve(packageName); + + // The `require.resolve` is required as to avoid Node caching the failed `import` + packageImport = await import(packageName); + } catch (e) { + info( + logging, + '', + `To continue, Astro requires the following dependency to be installed: ${bold(packageName)}.` + ); + const result = await installPackage([packageName, ...otherDeps], options, logging); + + if (result) { + packageImport = await import(packageName); + } else { + return undefined; + } + } + + return packageImport as T; +} + +function getInstallCommand(packages: string[], packageManager: string) { + switch (packageManager) { + case 'npm': + return { pm: 'npm', command: 'install', flags: [], dependencies: packages }; + case 'yarn': + return { pm: 'yarn', command: 'add', flags: [], dependencies: packages }; + case 'pnpm': + return { pm: 'pnpm', command: 'add', flags: [], dependencies: packages }; + default: + return null; + } +} + +async function installPackage( + packageNames: string[], + options: GetPackageOptions, + logging: LogOptions +): Promise { + const cwd = options.cwd ?? process.cwd(); + const packageManager = (await whichPm(cwd)).name ?? 'npm'; + const installCommand = getInstallCommand(packageNames, packageManager); + + if (!installCommand) { + return false; + } + + const coloredOutput = `${bold(installCommand.pm)} ${installCommand.command}${[ + '', + ...installCommand.flags, + ].join(' ')} ${cyan(installCommand.dependencies.join(' '))}`; + const message = `\n${boxen(coloredOutput, { + margin: 0.5, + padding: 0.5, + borderStyle: 'round', + })}\n`; + info( + logging, + null, + `\n ${magenta('Astro will run the following command:')}\n ${dim( + 'If you skip this step, you can always run it yourself later' + )}\n${message}` + ); + + let response; + if (options.skipAsk) { + response = true; + } else { + response = ( + await prompts({ + type: 'confirm', + name: 'askToContinue', + message: 'Continue?', + initial: true, + }) + ).askToContinue; + } + + if (Boolean(response)) { + const spinner = ora('Installing dependencies...').start(); + try { + await execa( + installCommand.pm, + [installCommand.command, ...installCommand.flags, ...installCommand.dependencies], + { cwd: cwd } + ); + spinner.succeed(); + + return true; + } catch (err) { + debug('add', 'Error installing dependencies', err); + spinner.fail(); + + return false; + } + } else { + return false; + } +} diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts index 238e32c5f..078197cd0 100644 --- a/packages/astro/src/content/types-generator.ts +++ b/packages/astro/src/content/types-generator.ts @@ -155,8 +155,7 @@ export async function createContentTypesGenerator({ fileURLToPath(event.entry), contentPaths, contentEntryExts, - dataEntryExts, - settings.config.experimental.assets + dataEntryExts ); if (fileType === 'ignored') { return { shouldGenerateTypes: false }; diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index d273dc105..369e187a8 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -93,8 +93,7 @@ export async function getEntryData( _internal: EntryInternal; }, collectionConfig: CollectionConfig, - pluginContext: PluginContext, - config: AstroConfig + pluginContext: PluginContext ) { let data; if (collectionConfig.type === 'data') { @@ -106,12 +105,6 @@ export async function getEntryData( let schema = collectionConfig.schema; if (typeof schema === 'function') { - if (!config.experimental.assets) { - throw new Error( - 'The function shape for schema can only be used when `experimental.assets` is enabled.' - ); - } - schema = schema({ image: createImage(pluginContext, entry._internal.filePath), }); @@ -250,9 +243,7 @@ export function getEntryType( entryPath: string, paths: Pick, contentFileExts: string[], - dataFileExts: string[], - // TODO: Unflag this when we're ready to release assets - erika, 2023-04-12 - experimentalAssets = false + dataFileExts: string[] ): 'content' | 'data' | 'config' | 'ignored' | 'unsupported' { const { ext, base } = path.parse(entryPath); const fileUrl = pathToFileURL(entryPath); @@ -260,7 +251,7 @@ export function getEntryType( if ( hasUnderscoreBelowContentDirectoryPath(fileUrl, paths.contentDir) || isOnIgnoreList(base) || - (experimentalAssets && isImageAsset(ext)) + isImageAsset(ext) ) { return 'ignored'; } else if (contentFileExts.includes(ext)) { diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts index a659dd4a0..4643e0922 100644 --- a/packages/astro/src/content/vite-plugin-content-imports.ts +++ b/packages/astro/src/content/vite-plugin-content-imports.ts @@ -131,13 +131,7 @@ export const _internal = { configureServer(viteServer) { viteServer.watcher.on('all', async (event, entry) => { if (CHOKIDAR_MODIFIED_EVENTS.includes(event)) { - const entryType = getEntryType( - entry, - contentPaths, - contentEntryExts, - dataEntryExts, - settings.config.experimental.assets - ); + const entryType = getEntryType(entry, contentPaths, contentEntryExts, dataEntryExts); if (!COLLECTION_TYPES_TO_INVALIDATE_ON.includes(entryType)) return; // The content config could depend on collection entries via `reference()`. @@ -194,7 +188,7 @@ type GetEntryModuleParams = async function getContentEntryModule( params: GetEntryModuleParams ): Promise { - const { fileId, contentDir, pluginContext, config } = params; + const { fileId, contentDir, pluginContext } = params; const { collectionConfig, entryConfig, entry, rawContents, collection } = await getEntryModuleBaseInfo(params); @@ -221,8 +215,7 @@ async function getContentEntryModule( ? await getEntryData( { id, collection, _internal, unvalidatedData }, collectionConfig, - pluginContext, - config + pluginContext ) : unvalidatedData; @@ -241,7 +234,7 @@ async function getContentEntryModule( async function getDataEntryModule( params: GetEntryModuleParams ): Promise { - const { fileId, contentDir, pluginContext, config } = params; + const { fileId, contentDir, pluginContext } = params; const { collectionConfig, entryConfig, entry, rawContents, collection } = await getEntryModuleBaseInfo(params); @@ -256,8 +249,7 @@ async function getDataEntryModule( ? await getEntryData( { id, collection, _internal, unvalidatedData }, collectionConfig, - pluginContext, - config + pluginContext ) : unvalidatedData; diff --git a/packages/astro/src/core/README.md b/packages/astro/src/core/README.md index 7f5e4f89c..74f55a0bb 100644 --- a/packages/astro/src/core/README.md +++ b/packages/astro/src/core/README.md @@ -3,3 +3,16 @@ Code that executes within the top-level Node context. Contains the main Astro logic for the `build` and `dev` commands, and also manages the Vite server and SSR. [See CONTRIBUTING.md](../../../../CONTRIBUTING.md) for a code overview. + +## Pipeline + +The pipeline is an internal concept that describes how Astro pages are eventually created and rendered to the user. + +Each pipeline has different requirements, criteria and quirks. Although, each pipeline must use the same underline functions, because +the core of the pipeline is the same. + +The core of the pipeline is rendering a generic route (page, endpoint or redirect) and returning a `Response`. +When rendering a route, a pipeline must pass a `RenderContext` and `ComponentInstance`. The way these two information are +computed doesn't concern the core of a pipeline. In fact, these types will be computed in different manner based on the type of pipeline. + +Each consumer will decide how to handle a `Response`. diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index 76958a549..86b9c9d41 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -1,13 +1,13 @@ -import mime from 'mime'; import type { EndpointHandler, ManifestData, + MiddlewareEndpointHandler, RouteData, SSRElement, SSRManifest, } from '../../@types/astro'; import type { SinglePageBuiltModule } from '../build/types'; -import { attachToResponse, getSetCookiesFromResponse } from '../cookies/index.js'; +import { getSetCookiesFromResponse } from '../cookies/index.js'; import { consoleLogDestination } from '../logger/console.js'; import { error, type LogOptions } from '../logger/core.js'; import { @@ -16,14 +16,7 @@ import { removeTrailingForwardSlash, } from '../path.js'; import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; -import { isResponse } from '../render/core.js'; -import { - createEnvironment, - createRenderContext, - tryRenderRoute, - type Environment, - type RenderContext, -} from '../render/index.js'; +import { createEnvironment, createRenderContext, type RenderContext } from '../render/index.js'; import { RouteCache } from '../render/route-cache.js'; import { createAssetLink, @@ -32,6 +25,7 @@ import { } from '../render/ssr-element.js'; import { matchRoute } from '../routing/match.js'; import type { RouteInfo } from './types'; +import { EndpointNotFoundError, SSRRoutePipeline } from './ssrPipeline.js'; export { deserializeManifest } from './common.js'; const clientLocalsSymbol = Symbol.for('astro.locals'); @@ -53,16 +47,15 @@ export class App { /** * The current environment of the application */ - #env: Environment; #manifest: SSRManifest; #manifestData: ManifestData; #routeDataToRouteInfo: Map; - #encoder = new TextEncoder(); #logging: LogOptions = { dest: consoleLogDestination, level: 'info', }; #baseWithoutTrailingSlash: string; + #pipeline: SSRRoutePipeline; constructor(manifest: SSRManifest, streaming = true) { this.#manifest = manifest; @@ -71,7 +64,7 @@ export class App { }; this.#routeDataToRouteInfo = new Map(manifest.routes.map((route) => [route.routeData, route])); this.#baseWithoutTrailingSlash = removeTrailingForwardSlash(this.#manifest.base); - this.#env = this.#createEnvironment(streaming); + this.#pipeline = new SSRRoutePipeline(this.#createEnvironment(streaming)); } set setManifest(newManifest: SSRManifest) { @@ -88,7 +81,6 @@ export class App { return createEnvironment({ adapterName: this.#manifest.adapterName, logging: this.#logging, - markdown: this.#manifest.markdown, mode: 'production', compressHTML: this.#manifest.compressHTML, renderers: this.#manifest.renderers, @@ -164,19 +156,21 @@ export class App { ); let response; try { - response = await tryRenderRoute( - routeData.type, - renderContext, - this.#env, - pageModule, - mod.onRequest - ); + // NOTE: ideally we could set the middleware function just once, but we don't have the infrastructure to that yet + if (mod.onRequest) { + this.#pipeline.setMiddlewareFunction(mod.onRequest as MiddlewareEndpointHandler); + } + response = await this.#pipeline.renderRoute(renderContext, pageModule); } catch (err: any) { - error(this.#logging, 'ssr', err.stack || err.message || String(err)); - return this.#renderError(request, { status: 500 }); + if (err instanceof EndpointNotFoundError) { + return this.#renderError(request, { status: 404, response: err.originalResponse }); + } else { + error(this.#logging, 'ssr', err.stack || err.message || String(err)); + return this.#renderError(request, { status: 500 }); + } } - if (isResponse(response, routeData.type)) { + if (SSRRoutePipeline.isResponse(response, routeData.type)) { if (STATUS_CODES.has(response.status)) { return this.#renderError(request, { response, @@ -185,35 +179,8 @@ export class App { } Reflect.set(response, responseSentSymbol, true); return response; - } else { - if (response.type === 'response') { - if (response.response.headers.get('X-Astro-Response') === 'Not-Found') { - return this.#renderError(request, { - response: response.response, - status: 404, - }); - } - return response.response; - } else { - const headers = new Headers(); - const mimeType = mime.getType(url.pathname); - if (mimeType) { - headers.set('Content-Type', `${mimeType};charset=utf-8`); - } else { - headers.set('Content-Type', 'text/plain;charset=utf-8'); - } - const bytes = - response.encoding !== 'binary' ? this.#encoder.encode(response.body) : response.body; - headers.set('Content-Length', bytes.byteLength.toString()); - - const newResponse = new Response(bytes, { - status: 200, - headers, - }); - attachToResponse(newResponse, response.cookies); - return newResponse; - } } + return response; } setCookieHeaders(response: Response) { @@ -239,7 +206,7 @@ export class App { pathname, route: routeData, status, - env: this.#env, + env: this.#pipeline.env, mod: handler as any, }); } else { @@ -273,7 +240,7 @@ export class App { route: routeData, status, mod, - env: this.#env, + env: this.#pipeline.env, }); } } @@ -310,12 +277,7 @@ export class App { status ); const page = (await mod.page()) as any; - const response = (await tryRenderRoute( - 'page', // this is hardcoded to ensure proper behavior for missing endpoints - newRenderContext, - this.#env, - page - )) as Response; + const response = await this.#pipeline.renderRoute(newRenderContext, page); return this.#mergeResponses(response, originalResponse); } catch {} } diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts index 4ae6e98a9..054064a08 100644 --- a/packages/astro/src/core/app/node.ts +++ b/packages/astro/src/core/app/node.ts @@ -6,6 +6,7 @@ import { IncomingMessage } from 'node:http'; import { TLSSocket } from 'node:tls'; import { deserializeManifest } from './common.js'; import { App, type MatchOptions } from './index.js'; +export { apply as applyPolyfills } from '../polyfill.js'; const clientAddressSymbol = Symbol.for('astro.clientAddress'); diff --git a/packages/astro/src/core/app/ssrPipeline.ts b/packages/astro/src/core/app/ssrPipeline.ts new file mode 100644 index 000000000..5f135e42d --- /dev/null +++ b/packages/astro/src/core/app/ssrPipeline.ts @@ -0,0 +1,54 @@ +import type { Environment } from '../render'; +import type { EndpointCallResult } from '../endpoint/index.js'; +import mime from 'mime'; +import { attachCookiesToResponse } from '../cookies/index.js'; +import { Pipeline } from '../pipeline.js'; + +/** + * Thrown when an endpoint contains a response with the header "X-Astro-Response" === 'Not-Found' + */ +export class EndpointNotFoundError extends Error { + originalResponse: Response; + constructor(originalResponse: Response) { + super(); + this.originalResponse = originalResponse; + } +} + +export class SSRRoutePipeline extends Pipeline { + #encoder = new TextEncoder(); + + constructor(env: Environment) { + super(env); + this.setEndpointHandler(this.#ssrEndpointHandler); + } + + // This function is responsible for handling the result coming from an endpoint. + async #ssrEndpointHandler(request: Request, response: EndpointCallResult): Promise { + if (response.type === 'response') { + if (response.response.headers.get('X-Astro-Response') === 'Not-Found') { + throw new EndpointNotFoundError(response.response); + } + return response.response; + } else { + const url = new URL(request.url); + const headers = new Headers(); + const mimeType = mime.getType(url.pathname); + if (mimeType) { + headers.set('Content-Type', `${mimeType};charset=utf-8`); + } else { + headers.set('Content-Type', 'text/plain;charset=utf-8'); + } + const bytes = + response.encoding !== 'binary' ? this.#encoder.encode(response.body) : response.body; + headers.set('Content-Length', bytes.byteLength.toString()); + + const newResponse = new Response(bytes, { + status: 200, + headers, + }); + attachCookiesToResponse(newResponse, response.cookies); + return newResponse; + } + } +} diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts index 67d16d457..8812d2c44 100644 --- a/packages/astro/src/core/app/types.ts +++ b/packages/astro/src/core/app/types.ts @@ -1,4 +1,3 @@ -import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark'; import type { RouteData, SerializedRouteData, @@ -40,7 +39,6 @@ export type SSRManifest = { base: string; compressHTML: boolean; assetsPrefix?: string; - markdown: MarkdownRenderingOptions; renderers: SSRLoadedRenderer[]; /** * Map of directive name (e.g. `load`) to the directive script code diff --git a/packages/astro/src/core/build/buildPipeline.ts b/packages/astro/src/core/build/buildPipeline.ts new file mode 100644 index 000000000..4ebf48a9a --- /dev/null +++ b/packages/astro/src/core/build/buildPipeline.ts @@ -0,0 +1,211 @@ +import { Pipeline } from '../pipeline.js'; +import type { BuildInternals } from './internal'; +import type { PageBuildData, StaticBuildOptions } from './types'; +import { ASTRO_PAGE_RESOLVED_MODULE_ID } 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 { SSRManifest } from '../app/types'; +import type { AstroConfig, AstroSettings, RouteType, SSRLoadedRenderer } from '../../@types/astro'; +import { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js'; +import type { EndpointCallResult } from '../endpoint'; +import { createEnvironment } from '../render/index.js'; +import { BEFORE_HYDRATION_SCRIPT_ID } from '../../vite-plugin-scripts/index.js'; +import { createAssetLink } from '../render/ssr-element.js'; +import type { BufferEncoding } from 'vfile'; + +/** + * This pipeline is responsible to gather the files emitted by the SSR build and generate the pages by executing these files. + */ +export class BuildPipeline extends Pipeline { + #internals: BuildInternals; + #staticBuildOptions: StaticBuildOptions; + #manifest: SSRManifest; + #currentEndpointBody?: { + body: string | Uint8Array; + encoding: BufferEncoding; + }; + + constructor( + staticBuildOptions: StaticBuildOptions, + internals: BuildInternals, + manifest: SSRManifest + ) { + const ssr = isServerLikeOutput(staticBuildOptions.settings.config); + super( + createEnvironment({ + adapterName: manifest.adapterName, + logging: staticBuildOptions.logging, + mode: staticBuildOptions.mode, + renderers: manifest.renderers, + clientDirectives: manifest.clientDirectives, + compressHTML: manifest.compressHTML, + async resolve(specifier: string) { + const hashedFilePath = manifest.entryModules[specifier]; + if (typeof hashedFilePath !== 'string') { + // If no "astro:scripts/before-hydration.js" script exists in the build, + // then we can assume that no before-hydration scripts are needed. + if (specifier === BEFORE_HYDRATION_SCRIPT_ID) { + return ''; + } + throw new Error(`Cannot find the built path for ${specifier}`); + } + return createAssetLink(hashedFilePath, manifest.base, manifest.assetsPrefix); + }, + routeCache: staticBuildOptions.routeCache, + site: manifest.site, + ssr, + streaming: true, + }) + ); + this.#internals = internals; + this.#staticBuildOptions = staticBuildOptions; + this.#manifest = manifest; + this.setEndpointHandler(this.#handleEndpointResult); + } + + getInternals(): Readonly { + return this.#internals; + } + + getSettings(): Readonly { + return this.#staticBuildOptions.settings; + } + + getStaticBuildOptions(): Readonly { + return this.#staticBuildOptions; + } + + getConfig(): AstroConfig { + return this.#staticBuildOptions.settings.config; + } + + getManifest(): SSRManifest { + return this.#manifest; + } + + /** + * The SSR build emits two important files: + * - dist/server/manifest.mjs + * - dist/renderers.mjs + * + * These two files, put together, will be used to generate the pages. + * + * ## Errors + * + * It will throw errors if the previous files can't be found in the file system. + * + * @param staticBuildOptions + */ + static async retrieveManifest( + staticBuildOptions: StaticBuildOptions, + internals: BuildInternals + ): Promise { + const config = staticBuildOptions.settings.config; + const baseDirectory = getOutputDirectory(config); + const manifestEntryUrl = new URL( + `${internals.manifestFileName}?time=${Date.now()}`, + baseDirectory + ); + const { manifest } = await import(manifestEntryUrl.toString()); + if (!manifest) { + throw new Error( + "Astro couldn't find the emitted manifest. This is an internal error, please file an issue." + ); + } + + const renderersEntryUrl = new URL(`renderers.mjs?time=${Date.now()}`, baseDirectory); + const renderers = await import(renderersEntryUrl.toString()); + if (!renderers) { + throw new Error( + "Astro couldn't find the emitted renderers. This is an internal error, please file an issue." + ); + } + return { + ...manifest, + renderers: renderers.renderers as SSRLoadedRenderer[], + }; + } + + /** + * It collects the routes to generate during the build. + * + * It returns a map of page information and their relative entry point as a string. + */ + retrieveRoutesToGenerate(): Map { + const pages = new Map(); + + for (const [entryPoint, filePath] of this.#internals.entrySpecifierToBundleMap) { + // virtual pages can be emitted with different prefixes: + // - the classic way are pages emitted with prefix ASTRO_PAGE_RESOLVED_MODULE_ID -> plugin-pages + // - pages emitted using `build.split`, in this case pages are emitted with prefix RESOLVED_SPLIT_MODULE_ID + if ( + entryPoint.includes(ASTRO_PAGE_RESOLVED_MODULE_ID) || + entryPoint.includes(RESOLVED_SPLIT_MODULE_ID) + ) { + const [, pageName] = entryPoint.split(':'); + const pageData = this.#internals.pagesByComponent.get( + `${pageName.replace(ASTRO_PAGE_EXTENSION_POST_PATTERN, '.')}` + ); + if (!pageData) { + throw new Error( + "Build failed. Astro couldn't find the emitted page from " + pageName + ' pattern' + ); + } + + pages.set(pageData, filePath); + } + } + for (const [path, pageData] of this.#internals.pagesByComponent.entries()) { + if (pageData.route.type === 'redirect') { + pages.set(pageData, path); + } + } + return pages; + } + + async #handleEndpointResult(request: Request, response: EndpointCallResult): Promise { + if (response.type === 'response') { + if (!response.response.body) { + return new Response(null); + } + const ab = await response.response.arrayBuffer(); + const body = new Uint8Array(ab); + this.#currentEndpointBody = { + body: body, + encoding: 'utf-8', + }; + return response.response; + } else { + if (response.encoding) { + this.#currentEndpointBody = { + body: response.body, + encoding: response.encoding, + }; + const headers = new Headers(); + headers.set('X-Astro-Encoding', response.encoding); + return new Response(response.body, { + headers, + }); + } else { + return new Response(response.body); + } + } + } + + async computeBodyAndEncoding( + routeType: RouteType, + response: Response + ): Promise<{ + body: string | Uint8Array; + encoding: BufferEncoding; + }> { + const encoding = response.headers.get('X-Astro-Encoding') ?? 'utf-8'; + if (this.#currentEndpointBody) { + const currentEndpointBody = this.#currentEndpointBody; + this.#currentEndpointBody = undefined; + return currentEndpointBody; + } else { + return { body: await response.text(), encoding: encoding as BufferEncoding }; + } + } +} diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 32b5ebb09..5e5ecf040 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -9,7 +9,7 @@ import type { ComponentInstance, GetStaticPathsItem, ImageTransform, - MiddlewareHandler, + MiddlewareEndpointHandler, RouteData, RouteType, SSRError, @@ -20,26 +20,21 @@ import { generateImage as generateImageInternal, getStaticImageList, } from '../../assets/build/generate.js'; -import { - eachPageDataFromEntryPoint, - eachRedirectPageData, - hasPrerenderedPages, - type BuildInternals, -} from '../../core/build/internal.js'; +import { hasPrerenderedPages, type BuildInternals } from '../../core/build/internal.js'; import { isRelativePath, + joinPaths, prependForwardSlash, removeLeadingForwardSlash, removeTrailingForwardSlash, } from '../../core/path.js'; import { runHookBuildGenerated } 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 { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js'; +import { PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; -import { debug, info } from '../logger/core.js'; +import { debug, info, Logger } from '../logger/core.js'; import { RedirectSinglePageBuiltModule, getRedirectLocationOrThrow } from '../redirects/index.js'; -import { isEndpointResult } from '../render/core.js'; -import { createEnvironment, createRenderContext, tryRenderRoute } from '../render/index.js'; +import { createRenderContext } from '../render/index.js'; import { callGetStaticPaths } from '../render/route-cache.js'; import { createAssetLink, @@ -63,6 +58,8 @@ import type { StylesheetAsset, } from './types'; import { getTimeStat } from './util.js'; +import { BuildPipeline } from './buildPipeline.js'; +import type { BufferEncoding } from 'vfile'; function createEntryURL(filePath: string, outFolder: URL) { return new URL('./' + filePath + `?time=${Date.now()}`, outFolder); @@ -124,8 +121,23 @@ export function chunkIsPage( } export async function generatePages(opts: StaticBuildOptions, internals: BuildInternals) { + const logger = new Logger(opts.logging); const timer = performance.now(); const ssr = isServerLikeOutput(opts.settings.config); + let manifest: SSRManifest; + if (ssr) { + manifest = await BuildPipeline.retrieveManifest(opts, internals); + } else { + const baseDirectory = getOutputDirectory(opts.settings.config); + const renderersEntryUrl = new URL('renderers.mjs', baseDirectory); + const renderers = await import(renderersEntryUrl.toString()); + manifest = createBuildManifest( + opts.settings, + internals, + renderers.renderers as SSRLoadedRenderer[] + ); + } + const buildPipeline = new BuildPipeline(opts, internals, manifest); const outFolder = ssr ? opts.settings.config.build.server : getOutDirWithinCwd(opts.settings.config.outDir); @@ -139,20 +151,18 @@ export async function generatePages(opts: StaticBuildOptions, internals: BuildIn const verb = ssr ? 'prerendering' : 'generating'; info(opts.logging, null, `\n${bgGreen(black(` ${verb} static routes `))}`); - const builtPaths = new Set(); - + const pagesToGenerate = buildPipeline.retrieveRoutesToGenerate(); if (ssr) { - for (const [pageData, filePath] of eachPageDataFromEntryPoint(internals)) { + for (const [pageData, filePath] of pagesToGenerate) { if (pageData.route.prerender) { const ssrEntryURLPage = createEntryURL(filePath, outFolder); const ssrEntryPage = await import(ssrEntryURLPage.toString()); if (opts.settings.config.build.split) { // forcing to use undefined, so we fail in an expected way if the module is not even there. - const manifest: SSRManifest | undefined = ssrEntryPage.manifest; - const ssrEntry = manifest?.pageModule; + const ssrEntry = ssrEntryPage?.manifest?.pageModule; if (ssrEntry) { - await generatePage(opts, internals, pageData, ssrEntry, builtPaths, manifest); + await generatePage(pageData, ssrEntry, builtPaths, buildPipeline, logger); } else { throw new Error( `Unable to find the manifest for the module ${ssrEntryURLPage.toString()}. This is unexpected and likely a bug in Astro, please report.` @@ -160,40 +170,35 @@ export async function generatePages(opts: StaticBuildOptions, internals: BuildIn } } else { const ssrEntry = ssrEntryPage as SinglePageBuiltModule; - const manifest = createBuildManifest(opts.settings, internals, ssrEntry.renderers); - await generatePage(opts, internals, pageData, ssrEntry, builtPaths, manifest); + await generatePage(pageData, ssrEntry, builtPaths, buildPipeline, logger); } } - } - for (const pageData of eachRedirectPageData(internals)) { - const entry = await getEntryForRedirectRoute(pageData.route, internals, outFolder); - const manifest = createBuildManifest(opts.settings, internals, entry.renderers); - await generatePage(opts, internals, pageData, entry, builtPaths, manifest); + if (pageData.route.type === 'redirect') { + const entry = await getEntryForRedirectRoute(pageData.route, internals, outFolder); + await generatePage(pageData, entry, builtPaths, buildPipeline, logger); + } } } else { - for (const [pageData, filePath] of eachPageDataFromEntryPoint(internals)) { - const ssrEntryURLPage = createEntryURL(filePath, outFolder); - const entry: SinglePageBuiltModule = await import(ssrEntryURLPage.toString()); - const manifest = createBuildManifest(opts.settings, internals, entry.renderers); + for (const [pageData, filePath] of pagesToGenerate) { + if (pageData.route.type === 'redirect') { + const entry = await getEntryForRedirectRoute(pageData.route, internals, outFolder); + await generatePage(pageData, entry, builtPaths, buildPipeline, logger); + } else { + const ssrEntryURLPage = createEntryURL(filePath, outFolder); + const entry: SinglePageBuiltModule = await import(ssrEntryURLPage.toString()); - await generatePage(opts, internals, pageData, entry, builtPaths, manifest); - } - for (const pageData of eachRedirectPageData(internals)) { - const entry = await getEntryForRedirectRoute(pageData.route, internals, outFolder); - const manifest = createBuildManifest(opts.settings, internals, entry.renderers); - await generatePage(opts, internals, pageData, entry, builtPaths, manifest); + await generatePage(pageData, entry, builtPaths, buildPipeline, logger); + } } } - if (opts.settings.config.experimental.assets) { - info(opts.logging, null, `\n${bgGreen(black(` generating optimized images `))}`); - for (const imageData of getStaticImageList()) { - await generateImage(opts, imageData[1].options, imageData[1].path); - } - - delete globalThis?.astroAsset?.addStaticImage; + info(opts.logging, null, `\n${bgGreen(black(` generating optimized images `))}`); + for (const imageData of getStaticImageList()) { + await generateImage(opts, imageData[1].options, imageData[1].path); } + delete globalThis?.astroAsset?.addStaticImage; + await runHookBuildGenerated({ config: opts.settings.config, logging: opts.logging, @@ -220,16 +225,15 @@ async function generateImage(opts: StaticBuildOptions, transform: ImageTransform } async function generatePage( - opts: StaticBuildOptions, - internals: BuildInternals, pageData: PageBuildData, ssrEntry: SinglePageBuiltModule, builtPaths: Set, - manifest: SSRManifest + pipeline: BuildPipeline, + logger: Logger ) { let timeStart = performance.now(); - const pageInfo = getPageDataByComponent(internals, pageData.route.component); + const pageInfo = getPageDataByComponent(pipeline.getInternals(), pageData.route.component); // may be used in the future for handling rel=modulepreload, rel=icon, rel=manifest etc. const linkIds: [] = []; @@ -241,6 +245,9 @@ async function generatePage( const pageModulePromise = ssrEntry.page; const onRequest = ssrEntry.onRequest; + if (onRequest) { + pipeline.setMiddlewareFunction(onRequest as MiddlewareEndpointHandler); + } if (!pageModulePromise) { throw new Error( @@ -248,14 +255,13 @@ async function generatePage( ); } const pageModule = await pageModulePromise(); - if (shouldSkipDraft(pageModule, opts.settings)) { - info(opts.logging, null, `${magenta('⚠️')} Skipping draft ${pageData.route.component}`); + if (shouldSkipDraft(pageModule, pipeline.getSettings())) { + logger.info(null, `${magenta('⚠️')} Skipping draft ${pageData.route.component}`); return; } const generationOptions: Readonly = { pageData, - internals, linkIds, scripts, styles, @@ -264,25 +270,29 @@ async function generatePage( const icon = pageData.route.type === 'page' ? green('▶') : magenta('λ'); if (isRelativePath(pageData.route.component)) { - info(opts.logging, null, `${icon} ${pageData.route.route}`); + logger.info(null, `${icon} ${pageData.route.route}`); } else { - info(opts.logging, null, `${icon} ${pageData.route.component}`); + logger.info(null, `${icon} ${pageData.route.component}`); } // Get paths for the route, calling getStaticPaths if needed. - const paths = await getPathsForRoute(pageData, pageModule, opts, builtPaths); + const paths = await getPathsForRoute( + pageData, + pageModule, + pipeline.getStaticBuildOptions(), + builtPaths + ); let prevTimeEnd = timeStart; for (let i = 0; i < paths.length; i++) { const path = paths[i]; - await generatePath(path, opts, generationOptions, manifest, onRequest); + await generatePath(path, generationOptions, pipeline); const timeEnd = performance.now(); const timeChange = getTimeStat(prevTimeEnd, timeEnd); const timeIncrease = `(+${timeChange})`; - const filePath = getOutputFilename(opts.settings.config, path, pageData.route.type); + const filePath = getOutputFilename(pipeline.getConfig(), path, pageData.route.type); const lineIcon = i === paths.length - 1 ? '└─' : '├─'; - info(opts.logging, null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`); - prevTimeEnd = timeEnd; + logger.info(null, ` ${cyan(lineIcon)} ${dim(filePath)} ${dim(timeIncrease)}`); } } @@ -302,7 +312,6 @@ async function getPathsForRoute( mod, route, routeCache: opts.routeCache, - isValidate: false, logging: opts.logging, ssr: isServerLikeOutput(opts.settings.config), }).catch((err) => { @@ -386,7 +395,6 @@ function getInvalidRouteSegmentError( interface GeneratePathOptions { pageData: PageBuildData; - internals: BuildInternals; linkIds: string[]; scripts: { type: 'inline' | 'external'; value: string } | null; styles: StylesheetAsset[]; @@ -440,29 +448,23 @@ function getUrlForPath( buildPathname = base; } else if (routeType === 'endpoint') { const buildPathRelative = removeLeadingForwardSlash(pathname); - buildPathname = base + buildPathRelative; + buildPathname = joinPaths(base, buildPathRelative); } else { const buildPathRelative = removeTrailingForwardSlash(removeLeadingForwardSlash(pathname)) + ending; - buildPathname = base + buildPathRelative; + buildPathname = joinPaths(base, buildPathRelative); } const url = new URL(buildPathname, origin); return url; } -async function generatePath( - pathname: string, - opts: StaticBuildOptions, - gopts: GeneratePathOptions, - manifest: SSRManifest, - onRequest?: MiddlewareHandler -) { - const { settings, logging, origin, routeCache } = opts; - const { mod, internals, scripts: hoistedScripts, styles: _styles, pageData } = gopts; +async function generatePath(pathname: string, gopts: GeneratePathOptions, pipeline: BuildPipeline) { + const manifest = pipeline.getManifest(); + const { mod, scripts: hoistedScripts, styles: _styles, pageData } = gopts; // This adds the page name to the array so it can be shown as part of stats. if (pageData.route.type === 'page') { - addPageName(pathname, opts); + addPageName(pathname, pipeline.getStaticBuildOptions()); } debug('build', `Generating: ${pathname}`); @@ -476,8 +478,8 @@ async function generatePath( ); const styles = createStylesheetElementSet(_styles, manifest.base, manifest.assetsPrefix); - if (settings.scripts.some((script) => script.stage === 'page')) { - const hashedFilePath = internals.entrySpecifierToBundleMap.get(PAGE_SCRIPT_ID); + if (pipeline.getSettings().scripts.some((script) => script.stage === 'page')) { + const hashedFilePath = pipeline.getInternals().entrySpecifierToBundleMap.get(PAGE_SCRIPT_ID); if (typeof hashedFilePath !== 'string') { throw new Error(`Cannot find the built path for ${PAGE_SCRIPT_ID}`); } @@ -489,7 +491,7 @@ async function generatePath( } // Add all injected scripts to the page. - for (const script of settings.scripts) { + for (const script of pipeline.getSettings().scripts) { if (script.stage === 'head-inline') { scripts.add({ props: {}, @@ -498,59 +500,38 @@ async function generatePath( } } - const ssr = isServerLikeOutput(settings.config); + const ssr = isServerLikeOutput(pipeline.getConfig()); const url = getUrlForPath( pathname, - opts.settings.config.base, - origin, - opts.settings.config.build.format, + pipeline.getConfig().base, + pipeline.getStaticBuildOptions().origin, + pipeline.getConfig().build.format, pageData.route.type ); - const env = createEnvironment({ - adapterName: manifest.adapterName, - logging, - markdown: manifest.markdown, - mode: opts.mode, - renderers: manifest.renderers, - clientDirectives: manifest.clientDirectives, - compressHTML: manifest.compressHTML, - async resolve(specifier: string) { - const hashedFilePath = manifest.entryModules[specifier]; - if (typeof hashedFilePath !== 'string') { - // If no "astro:scripts/before-hydration.js" script exists in the build, - // then we can assume that no before-hydration scripts are needed. - if (specifier === BEFORE_HYDRATION_SCRIPT_ID) { - return ''; - } - throw new Error(`Cannot find the built path for ${specifier}`); - } - return createAssetLink(hashedFilePath, manifest.base, manifest.assetsPrefix); - }, - routeCache, - site: manifest.site, - ssr, - streaming: true, - }); - const renderContext = await createRenderContext({ pathname, - request: createRequest({ url, headers: new Headers(), logging, ssr }), + request: createRequest({ + url, + headers: new Headers(), + logging: pipeline.getStaticBuildOptions().logging, + ssr, + }), componentMetadata: manifest.componentMetadata, scripts, styles, links, route: pageData.route, - env, + env: pipeline.getEnvironment(), mod, }); let body: string | Uint8Array; let encoding: BufferEncoding | undefined; - let response; + let response: Response; try { - response = await tryRenderRoute(pageData.route.type, renderContext, env, mod, onRequest); + response = await pipeline.renderRoute(renderContext, mod); } catch (err) { if (!AstroError.is(err) && !(err as SSRError).id && typeof err === 'object') { (err as SSRError).id = pageData.component; @@ -558,28 +539,17 @@ async function generatePath( throw err; } - if (isEndpointResult(response, pageData.route.type)) { - if (response.type === 'response') { - // If there's no body, do nothing - if (!response.response.body) return; - const ab = await response.response.arrayBuffer(); - body = new Uint8Array(ab); - } else { - body = response.body; - encoding = response.encoding; + if (response.status >= 300 && response.status < 400) { + // If redirects is set to false, don't output the HTML + if (!pipeline.getConfig().build.redirects) { + return; } - } else { - if (response.status >= 300 && response.status < 400) { - // If redirects is set to false, don't output the HTML - if (!opts.settings.config.build.redirects) { - return; - } - const location = getRedirectLocationOrThrow(response.headers); - const fromPath = new URL(renderContext.request.url).pathname; - // A short delay causes Google to interpret the redirect as temporary. - // https://developers.google.com/search/docs/crawling-indexing/301-redirects#metarefresh - const delay = response.status === 302 ? 2 : 0; - body = ` + const location = getRedirectLocationOrThrow(response.headers); + const fromPath = new URL(renderContext.request.url).pathname; + // A short delay causes Google to interpret the redirect as temporary. + // https://developers.google.com/search/docs/crawling-indexing/301-redirects#metarefresh + const delay = response.status === 302 ? 2 : 0; + body = ` Redirecting to: ${location} @@ -587,20 +557,25 @@ async function generatePath( Redirecting from ${fromPath} to ${location} `; - // A dynamic redirect, set the location so that integrations know about it. - if (pageData.route.type !== 'redirect') { - pageData.route.redirect = location; - } - } else { - // If there's no body, do nothing - if (!response.body) return; - body = await response.text(); + // A dynamic redirect, set the location so that integrations know about it. + if (pageData.route.type !== 'redirect') { + pageData.route.redirect = location; } + } else { + // If there's no body, do nothing + if (!response.body) return; + const result = await pipeline.computeBodyAndEncoding(renderContext.route.type, response); + body = result.body; + encoding = result.encoding; } - const outFolder = getOutFolder(settings.config, pathname, pageData.route.type); - const outFile = getOutFile(settings.config, outFolder, pathname, pageData.route.type); + const outFolder = getOutFolder(pipeline.getConfig(), pathname, pageData.route.type); + const outFile = getOutFile(pipeline.getConfig(), outFolder, pathname, pageData.route.type); pageData.route.distURL = outFile; + const possibleEncoding = response.headers.get('X-Astro-Encoding'); + if (possibleEncoding) { + encoding = possibleEncoding as BufferEncoding; + } await fs.promises.mkdir(outFolder, { recursive: true }); await fs.promises.writeFile(outFile, body, encoding ?? 'utf-8'); } @@ -622,7 +597,6 @@ export function createBuildManifest( entryModules: Object.fromEntries(internals.entrySpecifierToBundleMap.entries()), routes: [], adapterName: '', - markdown: settings.config.markdown, clientDirectives: settings.clientDirectives, compressHTML: settings.config.compressHTML, renderers, diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 5b1ecf404..07b9b2f7c 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -102,9 +102,7 @@ class AstroBuilder { logging, }); - // HACK: Since we only inject the endpoint if `experimental.assets` is on and it's possible for an integration to - // add that flag, we need to only check and inject the endpoint after running the config setup hook. - if (this.settings.config.experimental.assets && isServerLikeOutput(this.settings.config)) { + if (isServerLikeOutput(this.settings.config)) { this.settings = injectImageEndpoint(this.settings); } diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index 5dff6f3dd..c1123e36b 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -85,6 +85,9 @@ export interface BuildInternals { staticFiles: Set; // The SSR entry chunk. Kept in internals to share between ssr/client build steps ssrEntryChunk?: Rollup.OutputChunk; + // The SSR manifest entry chunk. + manifestEntryChunk?: Rollup.OutputChunk; + manifestFileName?: string; entryPoints: Map; ssrSplitEntryChunks: Map; componentMetadata: SSRResult['componentMetadata']; @@ -227,14 +230,6 @@ export function* eachPageData(internals: BuildInternals) { yield* internals.pagesByComponent.values(); } -export function* eachRedirectPageData(internals: BuildInternals) { - for (const pageData of eachPageData(internals)) { - if (pageData.route.type === 'redirect') { - yield pageData; - } - } -} - export function* eachPageDataFromEntryPoint( internals: BuildInternals ): Generator<[PageBuildData, string]> { diff --git a/packages/astro/src/core/build/plugins/README.md b/packages/astro/src/core/build/plugins/README.md index 145158163..ef73b9e50 100644 --- a/packages/astro/src/core/build/plugins/README.md +++ b/packages/astro/src/core/build/plugins/README.md @@ -125,10 +125,13 @@ will look like this: Of course, all these files will be deleted by Astro at the end build. -## `plugin-ssr` (WIP) +## `plugin-ssr` -This plugin is responsible to create a single `entry.mjs` file that will be used -in SSR. +This plugin is responsible to create the JS files that will be executed in SSR. + +### Classic mode + +The plugin will emit a single entry point called `entry.mjs`. This plugin **will emit code** only when building an **SSR** site. @@ -146,4 +149,24 @@ const pageMap = new Map([ ``` It will also import the [`renderers`](#plugin-renderers) virtual module -and the [`middleware`](#plugin-middleware) virtual module. +and the [`manifest`](#plugin-manifest) virtual module. + +### Split mode + +The plugin will emit various entry points. Each route will be an entry point. + +Each entry point will contain the necessary code to **render one single route**. + +Each entry point will also import the [`renderers`](#plugin-renderers) virtual module +and the [`manifest`](#plugin-manifest) virtual module. + +## `plugin-manifest` + +This plugin is responsible to create a file called `manifest.mjs`. In SSG, the file is saved +in `config.outDir`, in SSR the file is saved in `config.build.server`. + +This file is important to do two things: +- generate the pages during the SSG; +- render the pages in SSR; + +The file contains all the information needed to Astro to accomplish the operations mentioned above. diff --git a/packages/astro/src/core/build/plugins/index.ts b/packages/astro/src/core/build/plugins/index.ts index decfefd04..19c952660 100644 --- a/packages/astro/src/core/build/plugins/index.ts +++ b/packages/astro/src/core/build/plugins/index.ts @@ -12,12 +12,14 @@ import { pluginPages } from './plugin-pages.js'; import { pluginPrerender } from './plugin-prerender.js'; import { pluginRenderers } from './plugin-renderers.js'; import { pluginSSR, pluginSSRSplit } from './plugin-ssr.js'; +import { pluginManifest } from './plugin-manifest.js'; export function registerAllPlugins({ internals, options, register }: AstroBuildPluginContainer) { register(pluginComponentEntry(internals)); register(pluginAliasResolve(internals)); register(pluginAnalyzer(options, internals)); register(pluginInternals(internals)); + register(pluginManifest(options, internals)); register(pluginRenderers(options)); register(pluginMiddleware(options, internals)); register(pluginPages(options, internals)); diff --git a/packages/astro/src/core/build/plugins/plugin-manifest.ts b/packages/astro/src/core/build/plugins/plugin-manifest.ts new file mode 100644 index 000000000..2c2ceb7e1 --- /dev/null +++ b/packages/astro/src/core/build/plugins/plugin-manifest.ts @@ -0,0 +1,251 @@ +import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js'; +import type { AstroBuildPlugin } from '../plugin'; +import { type Plugin as VitePlugin } from 'vite'; +import { runHookBuildSsr } from '../../../integrations/index.js'; +import { addRollupInput } from '../add-rollup-input.js'; +import glob from 'fast-glob'; +import { fileURLToPath } from 'node:url'; +import type { OutputChunk } from 'rollup'; +import { getOutFile, getOutFolder } from '../common.js'; +import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js'; +import { joinPaths, prependForwardSlash } from '../../path.js'; +import { serializeRouteData } from '../../routing/index.js'; +import type { SerializedRouteInfo, SerializedSSRManifest } from '../../app/types'; +import type { StaticBuildOptions } from '../types'; + +const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@'; +const replaceExp = new RegExp(`['"](${manifestReplace})['"]`, 'g'); + +export const SSR_MANIFEST_VIRTUAL_MODULE_ID = '@astrojs-manifest'; +export const RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID = '\0' + SSR_MANIFEST_VIRTUAL_MODULE_ID; + +function vitePluginManifest(options: StaticBuildOptions, internals: BuildInternals): VitePlugin { + return { + name: '@astro/plugin-build-manifest', + enforce: 'post', + options(opts) { + return addRollupInput(opts, [SSR_MANIFEST_VIRTUAL_MODULE_ID]); + }, + resolveId(id) { + if (id === SSR_MANIFEST_VIRTUAL_MODULE_ID) { + return RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID; + } + }, + augmentChunkHash(chunkInfo) { + if (chunkInfo.facadeModuleId === RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID) { + return Date.now().toString(); + } + }, + async load(id) { + if (id === RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID) { + const imports = []; + const contents = []; + const exports = []; + imports.push( + `import { deserializeManifest as _deserializeManifest } from 'astro/app'`, + `import { _privateSetManifestDontUseThis } from 'astro:ssr-manifest'` + ); + + contents.push(` +const manifest = _deserializeManifest('${manifestReplace}'); +_privateSetManifestDontUseThis(manifest); +`); + + exports.push('export { manifest }'); + + return `${imports.join('\n')}${contents.join('\n')}${exports.join('\n')}`; + } + }, + + async generateBundle(_opts, bundle) { + for (const [chunkName, chunk] of Object.entries(bundle)) { + if (chunk.type === 'asset') { + continue; + } + if (chunk.modules[RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID]) { + internals.manifestEntryChunk = chunk; + delete bundle[chunkName]; + } + if (chunkName.startsWith('manifest')) { + internals.manifestFileName = chunkName; + } + } + }, + }; +} + +export function pluginManifest( + options: StaticBuildOptions, + internals: BuildInternals +): AstroBuildPlugin { + return { + build: 'ssr', + hooks: { + 'build:before': () => { + return { + vitePlugin: vitePluginManifest(options, internals), + }; + }, + + 'build:post': async ({ mutate }) => { + if (!internals.manifestEntryChunk) { + throw new Error(`Did not generate an entry chunk for SSR`); + } + + const manifest = await createManifest(options, internals); + await runHookBuildSsr({ + config: options.settings.config, + manifest, + logging: options.logging, + entryPoints: internals.entryPoints, + middlewareEntryPoint: internals.middlewareEntryPoint, + }); + // TODO: use the manifest entry chunk instead + const code = injectManifest(manifest, internals.manifestEntryChunk); + mutate(internals.manifestEntryChunk, 'server', code); + }, + }, + }; +} + +export async function createManifest( + buildOpts: StaticBuildOptions, + internals: BuildInternals +): Promise { + if (!internals.manifestEntryChunk) { + throw new Error(`Did not generate an entry chunk for SSR`); + } + + // Add assets from the client build. + const clientStatics = new Set( + await glob('**/*', { + cwd: fileURLToPath(buildOpts.settings.config.build.client), + }) + ); + for (const file of clientStatics) { + internals.staticFiles.add(file); + } + + const staticFiles = internals.staticFiles; + return buildManifest(buildOpts, internals, Array.from(staticFiles)); +} + +/** + * It injects the manifest in the given output rollup chunk. It returns the new emitted code + * @param buildOpts + * @param internals + * @param chunk + */ +export function injectManifest(manifest: SerializedSSRManifest, chunk: Readonly) { + const code = chunk.code; + + return code.replace(replaceExp, () => { + return JSON.stringify(manifest); + }); +} + +function buildManifest( + opts: StaticBuildOptions, + internals: BuildInternals, + staticFiles: string[] +): SerializedSSRManifest { + const { settings } = opts; + + const routes: SerializedRouteInfo[] = []; + const entryModules = Object.fromEntries(internals.entrySpecifierToBundleMap.entries()); + if (settings.scripts.some((script) => script.stage === 'page')) { + staticFiles.push(entryModules[PAGE_SCRIPT_ID]); + } + + const prefixAssetPath = (pth: string) => { + if (settings.config.build.assetsPrefix) { + return joinPaths(settings.config.build.assetsPrefix, pth); + } else { + return prependForwardSlash(joinPaths(settings.config.base, pth)); + } + }; + + for (const route of opts.manifest.routes) { + if (!route.prerender) continue; + if (!route.pathname) continue; + + const outFolder = getOutFolder(opts.settings.config, route.pathname, route.type); + const outFile = getOutFile(opts.settings.config, outFolder, route.pathname, route.type); + const file = outFile.toString().replace(opts.settings.config.build.client.toString(), ''); + routes.push({ + file, + links: [], + scripts: [], + styles: [], + routeData: serializeRouteData(route, settings.config.trailingSlash), + }); + staticFiles.push(file); + } + + for (const route of opts.manifest.routes) { + const pageData = internals.pagesByComponent.get(route.component); + if (route.prerender || !pageData) continue; + const scripts: SerializedRouteInfo['scripts'] = []; + if (pageData.hoistedScript) { + const hoistedValue = pageData.hoistedScript.value; + const value = hoistedValue.endsWith('.js') ? prefixAssetPath(hoistedValue) : hoistedValue; + scripts.unshift( + Object.assign({}, pageData.hoistedScript, { + value, + }) + ); + } + if (settings.scripts.some((script) => script.stage === 'page')) { + const src = entryModules[PAGE_SCRIPT_ID]; + + scripts.push({ + type: 'external', + value: prefixAssetPath(src), + }); + } + + // may be used in the future for handling rel=modulepreload, rel=icon, rel=manifest etc. + const links: [] = []; + + const styles = pageData.styles + .sort(cssOrder) + .map(({ sheet }) => sheet) + .map((s) => (s.type === 'external' ? { ...s, src: prefixAssetPath(s.src) } : s)) + .reduce(mergeInlineCss, []); + + routes.push({ + file: '', + links, + scripts: [ + ...scripts, + ...settings.scripts + .filter((script) => script.stage === 'head-inline') + .map(({ stage, content }) => ({ stage, children: content })), + ], + styles, + routeData: serializeRouteData(route, settings.config.trailingSlash), + }); + } + + // HACK! Patch this special one. + if (!(BEFORE_HYDRATION_SCRIPT_ID in entryModules)) { + // Set this to an empty string so that the runtime knows not to try and load this. + entryModules[BEFORE_HYDRATION_SCRIPT_ID] = ''; + } + + const ssrManifest: SerializedSSRManifest = { + adapterName: opts.settings.adapter?.name ?? '', + routes, + site: settings.config.site, + base: settings.config.base, + compressHTML: settings.config.compressHTML, + assetsPrefix: settings.config.build.assetsPrefix, + componentMetadata: Array.from(internals.componentMetadata), + renderers: [], + clientDirectives: Array.from(settings.clientDirectives), + entryModules, + assets: staticFiles.map(prefixAssetPath), + }; + + return ssrManifest; +} diff --git a/packages/astro/src/core/build/plugins/plugin-pages.ts b/packages/astro/src/core/build/plugins/plugin-pages.ts index 2ee438a6a..ff63acd74 100644 --- a/packages/astro/src/core/build/plugins/plugin-pages.ts +++ b/packages/astro/src/core/build/plugins/plugin-pages.ts @@ -8,6 +8,7 @@ import type { StaticBuildOptions } from '../types'; 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'; +import type { AstroSettings } from '../../../@types/astro'; export const ASTRO_PAGE_MODULE_ID = '@astro-page:'; export const ASTRO_PAGE_RESOLVED_MODULE_ID = '\0' + ASTRO_PAGE_MODULE_ID; @@ -74,7 +75,7 @@ function vitePluginPages(opts: StaticBuildOptions, internals: BuildInternals): V exports.push(`export { renderers };`); // The middleware should not be imported by the pages - if (!opts.settings.config.build.excludeMiddleware) { + if (shouldBundleMiddleware(opts.settings)) { const middlewareModule = await this.resolve(MIDDLEWARE_MODULE_ID); if (middlewareModule) { imports.push(`import { onRequest } from "${middlewareModule.id}";`); @@ -90,6 +91,17 @@ function vitePluginPages(opts: StaticBuildOptions, internals: BuildInternals): V }; } +export function shouldBundleMiddleware(settings: AstroSettings) { + // TODO: Remove in Astro 4.0 + if (settings.config.build.excludeMiddleware === true) { + return false; + } + if (settings.adapter?.adapterFeatures?.edgeMiddleware === true) { + return false; + } + return true; +} + export function pluginPages(opts: StaticBuildOptions, internals: BuildInternals): AstroBuildPlugin { return { build: 'ssr', diff --git a/packages/astro/src/core/build/plugins/plugin-prerender.ts b/packages/astro/src/core/build/plugins/plugin-prerender.ts index a0d6a9c7b..402264c6e 100644 --- a/packages/astro/src/core/build/plugins/plugin-prerender.ts +++ b/packages/astro/src/core/build/plugins/plugin-prerender.ts @@ -14,7 +14,7 @@ function vitePluginPrerender(opts: StaticBuildOptions, internals: BuildInternals extendManualChunks(outputOptions, { after(id, meta) { // Split the Astro runtime into a separate chunk for readability - if (id.includes('astro/dist')) { + if (id.includes('astro/dist/runtime')) { return 'astro'; } const pageInfo = internals.pagesByViteID.get(id); diff --git a/packages/astro/src/core/build/plugins/plugin-renderers.ts b/packages/astro/src/core/build/plugins/plugin-renderers.ts index 912df4241..f0cdf8983 100644 --- a/packages/astro/src/core/build/plugins/plugin-renderers.ts +++ b/packages/astro/src/core/build/plugins/plugin-renderers.ts @@ -38,6 +38,8 @@ export function vitePluginRenderers(opts: StaticBuildOptions): VitePlugin { exports.push(`export const renderers = [${rendererItems}];`); return `${imports.join('\n')}\n${exports.join('\n')}`; + } else { + return `export const renderers = [];`; } } }, diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts index 514fe2409..098b9dee8 100644 --- a/packages/astro/src/core/build/plugins/plugin-ssr.ts +++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts @@ -1,28 +1,21 @@ -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 { runHookBuildSsr } from '../../../integrations/index.js'; +import { isFunctionPerRouteEnabled } 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 { 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 { BuildInternals } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin'; -import type { OutputChunk, StaticBuildOptions } from '../types'; +import type { StaticBuildOptions } from '../types'; import { ASTRO_PAGE_MODULE_ID } from './plugin-pages.js'; import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; import { getPathFromVirtualModulePageName, getVirtualModulePageNameFromPath } from './util.js'; +import { SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugin-manifest.js'; export const SSR_VIRTUAL_MODULE_ID = '@astrojs-ssr-virtual-entry'; -const RESOLVED_SSR_VIRTUAL_MODULE_ID = '\0' + SSR_VIRTUAL_MODULE_ID; -const manifestReplace = '@@ASTRO_MANIFEST_REPLACE@@'; -const replaceExp = new RegExp(`['"](${manifestReplace})['"]`, 'g'); +export const RESOLVED_SSR_VIRTUAL_MODULE_ID = '\0' + SSR_VIRTUAL_MODULE_ID; function vitePluginSSR( internals: BuildInternals, @@ -85,13 +78,12 @@ function vitePluginSSR( } } - for (const [chunkName, chunk] of Object.entries(bundle)) { + for (const [, chunk] of Object.entries(bundle)) { if (chunk.type === 'asset') { continue; } if (chunk.modules[RESOLVED_SSR_VIRTUAL_MODULE_ID]) { internals.ssrEntryChunk = chunk; - delete bundle[chunkName]; } } }, @@ -103,12 +95,16 @@ export function pluginSSR( internals: BuildInternals ): AstroBuildPlugin { const ssr = isServerLikeOutput(options.settings.config); + const functionPerRouteEnabled = isFunctionPerRouteEnabled(options.settings.adapter); return { build: 'ssr', hooks: { 'build:before': () => { let vitePlugin = - ssr && !options.settings.config.build.split + ssr && + // TODO: Remove in Astro 4.0 + options.settings.config.build.split === false && + functionPerRouteEnabled === false ? vitePluginSSR(internals, options.settings.adapter!, options) : undefined; @@ -117,12 +113,12 @@ export function pluginSSR( vitePlugin, }; }, - 'build:post': async ({ mutate }) => { + 'build:post': async () => { if (!ssr) { return; } - if (options.settings.config.build.split) { + if (options.settings.config.build.split || functionPerRouteEnabled) { return; } @@ -131,17 +127,6 @@ export function pluginSSR( } // Mutate the filename internals.ssrEntryChunk.fileName = options.settings.config.build.serverEntry; - - const manifest = await createManifest(options, internals); - await runHookBuildSsr({ - config: options.settings.config, - manifest, - logging: options.logging, - entryPoints: internals.entryPoints, - middlewareEntryPoint: internals.middlewareEntryPoint, - }); - const code = injectManifest(manifest, internals.ssrEntryChunk); - mutate(internals.ssrEntryChunk, 'server', code); }, }, }; @@ -155,11 +140,12 @@ function vitePluginSSRSplit( adapter: AstroAdapter, options: StaticBuildOptions ): VitePlugin { + const functionPerRouteEnabled = isFunctionPerRouteEnabled(options.settings.adapter); return { name: '@astrojs/vite-plugin-astro-ssr-split', enforce: 'post', options(opts) { - if (options.settings.config.build.split) { + if (options.settings.config.build.split || functionPerRouteEnabled) { const inputs = new Set(); for (const path of Object.keys(options.allPages)) { @@ -204,21 +190,16 @@ function vitePluginSSRSplit( } } - for (const [chunkName, chunk] of Object.entries(bundle)) { + for (const [, chunk] of Object.entries(bundle)) { if (chunk.type === 'asset') { continue; } - let shouldDeleteBundle = false; for (const moduleKey of Object.keys(chunk.modules)) { if (moduleKey.startsWith(RESOLVED_SPLIT_MODULE_ID)) { internals.ssrSplitEntryChunks.set(moduleKey, chunk); storeEntryPoint(moduleKey, options, internals, chunk.fileName); - shouldDeleteBundle = true; } } - if (shouldDeleteBundle) { - delete bundle[chunkName]; - } } }, }; @@ -229,12 +210,14 @@ export function pluginSSRSplit( internals: BuildInternals ): AstroBuildPlugin { const ssr = isServerLikeOutput(options.settings.config); + const functionPerRouteEnabled = isFunctionPerRouteEnabled(options.settings.adapter); + return { build: 'ssr', hooks: { 'build:before': () => { let vitePlugin = - ssr && options.settings.config.build.split + ssr && (options.settings.config.build.split || functionPerRouteEnabled) ? vitePluginSSRSplit(internals, options.settings.adapter!, options) : undefined; @@ -243,31 +226,6 @@ export function pluginSSRSplit( vitePlugin, }; }, - 'build:post': async ({ mutate }) => { - if (!ssr) { - return; - } - if (!options.settings.config.build.split) { - return; - } - - if (internals.ssrSplitEntryChunks.size === 0) { - throw new Error(`Did not generate an entry chunk for SSR serverless`); - } - - const manifest = await createManifest(options, internals); - await runHookBuildSsr({ - config: options.settings.config, - manifest, - logging: options.logging, - entryPoints: internals.entryPoints, - middlewareEntryPoint: internals.middlewareEntryPoint, - }); - for (const [, chunk] of internals.ssrSplitEntryChunks) { - const code = injectManifest(manifest, chunk); - mutate(chunk, 'server', code); - } - }, }, }; } @@ -276,7 +234,7 @@ function generateSSRCode(config: AstroConfig, adapter: AstroAdapter) { const imports: string[] = []; const contents: string[] = []; let pageMap; - if (config.build.split) { + if (config.build.split || isFunctionPerRouteEnabled(adapter)) { pageMap = 'pageModule'; } else { pageMap = 'pageMap'; @@ -284,13 +242,11 @@ function generateSSRCode(config: AstroConfig, adapter: AstroAdapter) { contents.push(`import * as adapter from '${adapter.serverEntrypoint}'; 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}'), { +import { manifest as defaultManifest} from '${SSR_MANIFEST_VIRTUAL_MODULE_ID}'; +const _manifest = Object.assign(defaultManifest, { ${pageMap}, renderers, }); -_privateSetManifestDontUseThis(_manifest); const _args = ${adapter.args ? JSON.stringify(adapter.args) : 'undefined'}; ${ @@ -319,48 +275,6 @@ if(_start in adapter) { }; } -/** - * It injects the manifest in the given output rollup chunk. It returns the new emitted code - * @param buildOpts - * @param internals - * @param chunk - */ -export function injectManifest(manifest: SerializedSSRManifest, chunk: Readonly) { - const code = chunk.code; - - return code.replace(replaceExp, () => { - return JSON.stringify(manifest); - }); -} - -export async function createManifest( - buildOpts: StaticBuildOptions, - internals: BuildInternals -): Promise { - if (buildOpts.settings.config.build.split) { - if (internals.ssrSplitEntryChunks.size === 0) { - throw new Error(`Did not generate an entry chunk for SSR in serverless mode`); - } - } else { - if (!internals.ssrEntryChunk) { - throw new Error(`Did not generate an entry chunk for SSR`); - } - } - - // Add assets from the client build. - const clientStatics = new Set( - await glob('**/*', { - cwd: fileURLToPath(buildOpts.settings.config.build.client), - }) - ); - for (const file of clientStatics) { - internals.staticFiles.add(file); - } - - const staticFiles = internals.staticFiles; - return buildManifest(buildOpts, internals, Array.from(staticFiles)); -} - /** * Because we delete the bundle from rollup at the end of this function, * we can't use `writeBundle` hook to get the final file name of the entry point written on disk. @@ -382,110 +296,3 @@ function storeEntryPoint( } } } - -function buildManifest( - opts: StaticBuildOptions, - internals: BuildInternals, - staticFiles: string[] -): SerializedSSRManifest { - const { settings } = opts; - - const routes: SerializedRouteInfo[] = []; - const entryModules = Object.fromEntries(internals.entrySpecifierToBundleMap.entries()); - if (settings.scripts.some((script) => script.stage === 'page')) { - staticFiles.push(entryModules[PAGE_SCRIPT_ID]); - } - - const prefixAssetPath = (pth: string) => { - if (settings.config.build.assetsPrefix) { - return joinPaths(settings.config.build.assetsPrefix, pth); - } else { - return prependForwardSlash(joinPaths(settings.config.base, pth)); - } - }; - - for (const route of opts.manifest.routes) { - if (!route.prerender) continue; - if (!route.pathname) continue; - - const outFolder = getOutFolder(opts.settings.config, route.pathname, route.type); - const outFile = getOutFile(opts.settings.config, outFolder, route.pathname, route.type); - const file = outFile.toString().replace(opts.settings.config.build.client.toString(), ''); - routes.push({ - file, - links: [], - scripts: [], - styles: [], - routeData: serializeRouteData(route, settings.config.trailingSlash), - }); - staticFiles.push(file); - } - - for (const route of opts.manifest.routes) { - const pageData = internals.pagesByComponent.get(route.component); - if (route.prerender || !pageData) continue; - const scripts: SerializedRouteInfo['scripts'] = []; - if (pageData.hoistedScript) { - const hoistedValue = pageData.hoistedScript.value; - const value = hoistedValue.endsWith('.js') ? prefixAssetPath(hoistedValue) : hoistedValue; - scripts.unshift( - Object.assign({}, pageData.hoistedScript, { - value, - }) - ); - } - if (settings.scripts.some((script) => script.stage === 'page')) { - const src = entryModules[PAGE_SCRIPT_ID]; - - scripts.push({ - type: 'external', - value: prefixAssetPath(src), - }); - } - - // may be used in the future for handling rel=modulepreload, rel=icon, rel=manifest etc. - const links: [] = []; - - const styles = pageData.styles - .sort(cssOrder) - .map(({ sheet }) => sheet) - .map((s) => (s.type === 'external' ? { ...s, src: prefixAssetPath(s.src) } : s)) - .reduce(mergeInlineCss, []); - - routes.push({ - file: '', - links, - scripts: [ - ...scripts, - ...settings.scripts - .filter((script) => script.stage === 'head-inline') - .map(({ stage, content }) => ({ stage, children: content })), - ], - styles, - routeData: serializeRouteData(route, settings.config.trailingSlash), - }); - } - - // HACK! Patch this special one. - if (!(BEFORE_HYDRATION_SCRIPT_ID in entryModules)) { - // Set this to an empty string so that the runtime knows not to try and load this. - entryModules[BEFORE_HYDRATION_SCRIPT_ID] = ''; - } - - const ssrManifest: SerializedSSRManifest = { - adapterName: opts.settings.adapter!.name, - routes, - site: settings.config.site, - base: settings.config.base, - compressHTML: settings.config.compressHTML, - assetsPrefix: settings.config.build.assetsPrefix, - markdown: settings.config.markdown, - componentMetadata: Array.from(internals.componentMetadata), - renderers: [], - clientDirectives: Array.from(settings.clientDirectives), - entryModules, - assets: staticFiles.map(prefixAssetPath), - }; - - return ssrManifest; -} diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index fb16b433d..a1c7c3e56 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -16,7 +16,7 @@ import { emptyDir, removeEmptyDirs } from '../../core/fs/index.js'; import { appendForwardSlash, prependForwardSlash } from '../../core/path.js'; import { isModeServerWithNoAdapter } from '../../core/util.js'; import { runHookBuildSetup } from '../../integrations/index.js'; -import { isServerLikeOutput } from '../../prerender/utils.js'; +import { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js'; import { PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; import { info } from '../logger/core.js'; @@ -28,10 +28,11 @@ import { createPluginContainer, type AstroBuildPluginContainer } from './plugin. import { registerAllPlugins } from './plugins/index.js'; 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 { RESOLVED_SPLIT_MODULE_ID, RESOLVED_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 { getTimeStat } from './util.js'; +import { RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugins/plugin-manifest.js'; export async function viteBuild(opts: StaticBuildOptions) { const { allPages, settings } = opts; @@ -147,7 +148,7 @@ async function ssrBuild( ) { const { allPages, settings, viteConfig } = opts; const ssr = isServerLikeOutput(settings.config); - const out = ssr ? settings.config.build.server : getOutDirWithinCwd(settings.config.outDir); + const out = getOutputDirectory(settings.config); const routes = Object.values(allPages).map((pd) => pd.route); const { lastVitePlugins, vitePlugins } = container.runBeforeHook('ssr', input); @@ -184,10 +185,12 @@ async function ssrBuild( ); } else if (chunkInfo.facadeModuleId?.startsWith(RESOLVED_SPLIT_MODULE_ID)) { return makeSplitEntryPointFileName(chunkInfo.facadeModuleId, routes); - } else if (chunkInfo.facadeModuleId === SSR_VIRTUAL_MODULE_ID) { + } else if (chunkInfo.facadeModuleId === RESOLVED_SSR_VIRTUAL_MODULE_ID) { return opts.settings.config.build.serverEntry; } else if (chunkInfo.facadeModuleId === RESOLVED_RENDERERS_MODULE_ID) { return 'renderers.mjs'; + } else if (chunkInfo.facadeModuleId === RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID) { + return 'manifest.[hash].mjs'; } else { return '[name].mjs'; } diff --git a/packages/astro/src/core/compile/compile.ts b/packages/astro/src/core/compile/compile.ts index f266c0b16..bd069611d 100644 --- a/packages/astro/src/core/compile/compile.ts +++ b/packages/astro/src/core/compile/compile.ts @@ -41,7 +41,7 @@ export async function compile({ filename, normalizedFilename: normalizeFilename(filename, astroConfig.root), sourcemap: 'both', - internalURL: 'astro/server/index.js', + internalURL: 'astro/compiler-runtime', astroGlobalArgs: JSON.stringify(astroConfig.site), scopedStyleStrategy: astroConfig.scopedStyleStrategy, resultScopedSlot: true, diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts index 29b0bb23a..ba089c9a7 100644 --- a/packages/astro/src/core/config/config.ts +++ b/packages/astro/src/core/config/config.ts @@ -124,8 +124,6 @@ export function resolveFlags(flags: Partial): CLIFlags { host: typeof flags.host === 'string' || typeof flags.host === 'boolean' ? flags.host : undefined, drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined, - experimentalAssets: - typeof flags.experimentalAssets === 'boolean' ? flags.experimentalAssets : undefined, }; } diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 87ff7ba9f..bff55b392 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -8,7 +8,7 @@ import path from 'node:path'; import { pathToFileURL } from 'node:url'; import { BUNDLED_THEMES } from 'shiki'; import { z } from 'zod'; -import { appendForwardSlash, prependForwardSlash, trimSlashes } from '../path.js'; +import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from '../path.js'; const ASTRO_CONFIG_DEFAULTS = { root: '.', @@ -29,10 +29,10 @@ const ASTRO_CONFIG_DEFAULTS = { split: false, excludeMiddleware: false, }, - compressHTML: false, + compressHTML: true, server: { host: false, - port: 3000, + port: 4321, open: false, }, integrations: [], @@ -44,7 +44,6 @@ const ASTRO_CONFIG_DEFAULTS = { legacy: {}, redirects: {}, experimental: { - assets: false, viewTransitions: false, optimizeHoistedScript: false, }, @@ -88,9 +87,9 @@ export const AstroConfigSchema = z.object({ .optional() .default('static'), scopedStyleStrategy: z - .union([z.literal('where'), z.literal('class')]) + .union([z.literal('where'), z.literal('class'), z.literal('attribute')]) .optional() - .default('where'), + .default('attribute'), adapter: z.object({ name: z.string(), hooks: z.object({}).passthrough().default({}) }).optional(), integrations: z.preprocess( // preprocess @@ -125,7 +124,15 @@ export const AstroConfigSchema = z.object({ .optional() .default(ASTRO_CONFIG_DEFAULTS.build.inlineStylesheets), + /** + * @deprecated + * Use the adapter feature instead + */ split: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.build.split), + /** + * @deprecated + * Use the adapter feature instead + */ excludeMiddleware: z .boolean() .optional() @@ -208,9 +215,7 @@ export const AstroConfigSchema = z.object({ .default([]), }) .default({ - service: { entrypoint: 'astro/assets/services/squoosh', config: {} }, - domains: [], - remotePatterns: [], + service: { entrypoint: 'astro/assets/services/sharp', config: {} }, }), markdown: z .object({ @@ -259,7 +264,6 @@ export const AstroConfigSchema = z.object({ .default(ASTRO_CONFIG_DEFAULTS.vite), experimental: z .object({ - assets: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.assets), viewTransitions: z .boolean() .optional() @@ -391,22 +395,14 @@ export function createRelativeSchema(cmd: string, fileProtocolRoot: string) { ) { config.build.client = new URL('./dist/client/', config.outDir); } - const trimmedBase = trimSlashes(config.base); - // If there is no base but there is a base for site config, warn. - const sitePathname = config.site && new URL(config.site).pathname; - if (!trimmedBase.length && sitePathname && sitePathname !== '/') { - config.base = sitePathname; - /* eslint-disable no-console */ - console.warn(`The site configuration value includes a pathname of ${sitePathname} but there is no base configuration. - -A future version of Astro will stop using the site pathname when producing and - - - - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/TextBlock.jsx b/packages/markdown/component/test/fixtures/astro-markdown/src/components/TextBlock.jsx deleted file mode 100644 index d9ea2534f..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/TextBlock.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { h } from 'preact'; - -const TextBlock = ({ - title, - children, - noPadding = false, -}) => { - return ( -
-

{title}

-

{children}

-
- ); -}; - -export default TextBlock; diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/index.js b/packages/markdown/component/test/fixtures/astro-markdown/src/components/index.js deleted file mode 100644 index e7cc94c58..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import Counter from './Counter'; - -export default { - Counter -} diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/content/code-element.md b/packages/markdown/component/test/fixtures/astro-markdown/src/content/code-element.md deleted file mode 100644 index b091decc0..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/content/code-element.md +++ /dev/null @@ -1,3 +0,0 @@ -This should have `nospace` around it. - -This should have nospace around it. diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/imported-md/plain.md b/packages/markdown/component/test/fixtures/astro-markdown/src/imported-md/plain.md deleted file mode 100644 index d548b3356..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/imported-md/plain.md +++ /dev/null @@ -1,6 +0,0 @@ ---- ---- - -## Plain jane - -I am plain markdown! diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/layouts/content.astro deleted file mode 100644 index 925a243a9..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/layouts/content.astro +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -
- -
- - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/layouts/layout-props.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/layouts/layout-props.astro deleted file mode 100644 index a11abb8fb..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/layouts/layout-props.astro +++ /dev/null @@ -1,17 +0,0 @@ ---- - interface Props { - url: string; - file: string; - title: string; - } - - const { title, url, file } = Astro.props.content as Props; ---- - - - -
{title}
-
{url}
-
{file}
- - \ No newline at end of file diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/braces.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/braces.astro deleted file mode 100644 index d92ce6bc3..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/braces.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -const title = 'My Blog Post'; -const description = 'This is a post about some stuff.'; ---- - - - ## Interesting Topic - - `({})` - `{...props}` - `{/* JavaScript */}` - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/children.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/children.md deleted file mode 100644 index a22ee5f96..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/children.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -setup: import TextBlock from '../components/TextBlock' ---- -{/* https://github.com/withastro/astro/issues/3319 */} - - -
    -
  • A
  • -
  • B
  • -
  • C
  • -
-
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/close.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/close.astro deleted file mode 100644 index 034d9a315..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/close.astro +++ /dev/null @@ -1,12 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -const content = `Markdown *content* to render`; ---- - -
-
- -

Some other stuff

-
-

Lastly...

-
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-element.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-element.astro deleted file mode 100644 index 43ca0bfc5..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-element.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -const content = await Astro.glob('../content/*.md'); ---- - -
- {content.map(({ Content }) => )} -
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-in-md.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-in-md.md deleted file mode 100644 index 52a799ab1..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-in-md.md +++ /dev/null @@ -1,16 +0,0 @@ -# Inline code blocks - -`` tags without any problems. - -# Fenced code blocks - -```html - -
This should also work without any problems.
- -``` diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code.astro deleted file mode 100644 index 7e2b08187..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/code.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -const title = 'My Blog Post'; -const description = 'This is a post about some stuff.'; ---- - - - ## Interesting Topic - - ```js - const thing = () => {}; - ``` - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment-with-js.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment-with-js.md deleted file mode 100644 index 374463d2d..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment-with-js.md +++ /dev/null @@ -1,23 +0,0 @@ - - - - -``` - -``` - -`` - -# It still works! diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment.md deleted file mode 100644 index 39a916351..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment.md +++ /dev/null @@ -1,2 +0,0 @@ - -# It works! diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/complex.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/complex.astro deleted file mode 100644 index caef4e8bf..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/complex.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -import Layout from '../layouts/content.astro'; -import Hello from '../components/Hello.jsx'; - -const title = 'My Blog Post'; -const description = 'This is a post about some stuff.'; ---- - - - - ## Interesting Topic - - - - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/content.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/content.astro deleted file mode 100644 index a90bd8c31..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/content.astro +++ /dev/null @@ -1,6 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -const content = '# Foo'; ---- - - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/dash.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/dash.md deleted file mode 100644 index 269a774f5..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/dash.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: My Blog Post -layout: ../layouts/content.astro ---- - -## Title - -Hello world - -With this in the body --- - -## Another - -more content \ No newline at end of file diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/deep.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/deep.astro deleted file mode 100644 index 7de9ec598..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/deep.astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -import Layout from '../layouts/content.astro'; -import Hello from '../components/Hello.jsx'; -import Counter from '../components/Counter.jsx'; - -const title = 'My Blog Post'; -const description = 'This is a post about some stuff.'; ---- - -
-
- - ## A - -
- -
- - ## B - -
- -
- - ## C - -
-
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/empty-code.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/empty-code.md deleted file mode 100644 index 93cb4eedb..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/empty-code.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: My Blog Post -layout: ../layouts/content.astro ---- - -## Title - -Hello world - -With this in the body --- - -## Another - -more content - -``` - -``` - -

\ No newline at end of file
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/external.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/external.astro
deleted file mode 100644
index cf6273bce..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/external.astro
+++ /dev/null
@@ -1,19 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-
-const outer = `# Outer`;
-const inner = `## Inner`;
----
-
-
-
- - - - # Nested - - - -
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/imported-md/with-components.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/imported-md/with-components.astro deleted file mode 100644 index 97cd8f211..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/imported-md/with-components.astro +++ /dev/null @@ -1,9 +0,0 @@ ---- -import Layout from '../../layouts/content.astro' - -const posts = await Astro.glob('../../imported-md/*.md') ---- - - - {posts.map(({ Content }) => )} - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/layout-props.md b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/layout-props.md deleted file mode 100644 index 0f87c1bd0..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/layout-props.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: 'Hello world!' -layout: '../layouts/layout-props.astro' ---- \ No newline at end of file diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/nested-list.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/nested-list.astro deleted file mode 100644 index 771850bc8..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/nested-list.astro +++ /dev/null @@ -1,32 +0,0 @@ ---- -// Component imports and setup JavaScript go here! -import Markdown from '@astrojs/markdown-component'; -const content = ` -- list 1 - - list 2 -- list - - - list -1. Hello - 1. Hello` ---- - - - - - - Welcome to Astro - - - -

Welcome to Astro

-
- - - list - - nested list - - 1. Hello - 1. nested hello - -
- - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/no-elements.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/no-elements.astro deleted file mode 100644 index 5671ffaa4..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/no-elements.astro +++ /dev/null @@ -1,5 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; ---- - - diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/post.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/post.astro deleted file mode 100644 index 2745edae1..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/post.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -import Layout from '../layouts/content.astro'; -import Example from '../components/Example.jsx'; - -const title = 'My Blog Post'; -const description = 'This is a post about some stuff.'; ---- - - - ## Interesting Topic - -
Some content
- - -
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/scopedStyles-code.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/pages/scopedStyles-code.astro deleted file mode 100644 index 1ee0e357d..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/pages/scopedStyles-code.astro +++ /dev/null @@ -1,21 +0,0 @@ ---- -import Markdown from '@astrojs/markdown-component'; -import Layout from '../layouts/content.astro'; - ---- - - -
- - ## Interesting Topic - - ```js - const thing = () => {}; - ``` - -
-
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/scripts/test.js b/packages/markdown/component/test/fixtures/astro-markdown/src/scripts/test.js deleted file mode 100644 index b179ee953..000000000 --- a/packages/markdown/component/test/fixtures/astro-markdown/src/scripts/test.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello world"); diff --git a/packages/markdown/component/test/test-utils.js b/packages/markdown/component/test/test-utils.js deleted file mode 100644 index 6bb3e7c25..000000000 --- a/packages/markdown/component/test/test-utils.js +++ /dev/null @@ -1,10 +0,0 @@ -import { loadFixture as baseLoadFixture } from '../../../astro/test/test-utils.js'; - -export { fixLineEndings } from '../../../astro/test/test-utils.js'; - -export function loadFixture(config) { - if (config?.root) { - config.root = new URL(config.root, import.meta.url); - } - return baseLoadFixture(config); -} diff --git a/packages/markdown/remark/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md index c4ee870b4..b36beb0eb 100644 --- a/packages/markdown/remark/CHANGELOG.md +++ b/packages/markdown/remark/CHANGELOG.md @@ -1,5 +1,13 @@ # @astrojs/markdown-remark +## 3.0.0-beta.0 + +### Patch Changes + +- Updated dependencies [[`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81), [`76ddef19c`](https://github.com/withastro/astro/commit/76ddef19ccab6e5f7d3a5740cd41acf10e334b38), [`9b4f70a62`](https://github.com/withastro/astro/commit/9b4f70a629f55e461759ba46f68af7097a2e9215), [`3fdf509b2`](https://github.com/withastro/astro/commit/3fdf509b2731a9b2f972d89291e57cf78d62c769), [`2f951cd40`](https://github.com/withastro/astro/commit/2f951cd403dfcc2c3ca6aae618ae3e1409516e32), [`c022a4217`](https://github.com/withastro/astro/commit/c022a4217a805d223c1494e9eda4e48bbf810388), [`67becaa58`](https://github.com/withastro/astro/commit/67becaa580b8f787df58de66b7008b7098f1209c), [`bc37331d8`](https://github.com/withastro/astro/commit/bc37331d8154e3e95a8df9131e4e014e78a7a9e7), [`dfc2d93e3`](https://github.com/withastro/astro/commit/dfc2d93e3c645995379358fabbdfa9aab99f43d8), [`3dc1ca2fa`](https://github.com/withastro/astro/commit/3dc1ca2fac8d9965cc5085a5d09e72ed87b4281a), [`1be84dfee`](https://github.com/withastro/astro/commit/1be84dfee3ce8e6f5cc624f99aec4e980f6fde37), [`35f01df79`](https://github.com/withastro/astro/commit/35f01df797d23315f2bee2fc3fd795adb0559c58), [`3fdf509b2`](https://github.com/withastro/astro/commit/3fdf509b2731a9b2f972d89291e57cf78d62c769), [`78de801f2`](https://github.com/withastro/astro/commit/78de801f21fd4ca1653950027d953bf08614566b), [`59d6e569f`](https://github.com/withastro/astro/commit/59d6e569f63e175c97e82e94aa7974febfb76f7c), [`7723c4cc9`](https://github.com/withastro/astro/commit/7723c4cc93298c2e6530e55da7afda048f22cf81), [`fb5cd6b56`](https://github.com/withastro/astro/commit/fb5cd6b56dc27a71366ed5e1ab8bfe9b8f96bac5), [`631b9c410`](https://github.com/withastro/astro/commit/631b9c410d5d66fa384674027ba95d69ebb5063f)]: + - @astrojs/prism@3.0.0-beta.0 + - astro@3.0.0-beta.0 + ## 2.2.1 ### Patch Changes diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 0c4a353bb..b9d53a3ea 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/markdown-remark", - "version": "2.2.1", + "version": "3.0.0-beta.0", "type": "module", "author": "withastro", "license": "MIT", @@ -28,10 +28,10 @@ "test": "mocha --exit --timeout 20000" }, "peerDependencies": { - "astro": "workspace:^2.5.0" + "astro": "workspace:^3.0.0-beta.0" }, "dependencies": { - "@astrojs/prism": "^2.1.2", + "@astrojs/prism": "^3.0.0-beta.0", "github-slugger": "^1.5.0", "import-meta-resolve": "^2.2.2", "rehype-raw": "^6.1.1", diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index aa02f8ea9..43ab885b6 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -95,10 +95,8 @@ export async function renderMarkdown( parser.use([remarkPrism(scopedClassName)]); } - if (opts.experimentalAssets) { - // Apply later in case user plugins resolve relative image paths - parser.use([remarkCollectImages]); - } + // Apply later in case user plugins resolve relative image paths + parser.use([remarkCollectImages]); } parser.use([ @@ -116,9 +114,7 @@ export async function renderMarkdown( parser.use([[plugin, pluginOpts]]); }); - if (opts.experimentalAssets) { - parser.use(rehypeImages()); - } + parser.use(rehypeImages()); if (!isPerformanceBenchmark) { parser.use([rehypeHeadingIds]); } diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index 2f2d36de7..6d8ecf8f2 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -67,7 +67,6 @@ export interface MarkdownRenderingOptions extends AstroMarkdownOptions { }; /** Used for frontmatter injection plugins */ frontmatter?: Record; - experimentalAssets?: boolean; } export interface MarkdownHeading { diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index a4edcc553..b56b1129b 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,17 @@ # @astrojs/telemetry +## 3.0.0-beta.1 + +### Patch Changes + +- [#7952](https://github.com/withastro/astro/pull/7952) [`b675acb2a`](https://github.com/withastro/astro/commit/b675acb2aa820448e9c0d363339a37fbac873215) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Remove undici dependency + +## 3.0.0-beta.0 + +### Major Changes + +- [`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. + ## 2.1.1 ### Patch Changes diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index be9e88b13..6e54d1d37 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/telemetry", - "version": "2.1.1", + "version": "3.0.0-beta.1", "type": "module", "types": "./dist/types/index.d.ts", "author": "withastro", @@ -13,7 +13,10 @@ "bugs": "https://github.com/withastro/astro/issues", "homepage": "https://astro.build", "exports": { - ".": "./dist/index.js", + ".": { + "types": "./dist/types/index.d.ts", + "default": "./dist/index.js" + }, "./package.json": "./package.json" }, "scripts": { @@ -32,7 +35,6 @@ "dset": "^3.1.2", "is-docker": "^3.0.0", "is-wsl": "^2.2.0", - "undici": "^5.22.1", "which-pm-runs": "^1.1.0" }, "devDependencies": { @@ -45,6 +47,6 @@ "mocha": "^9.2.2" }, "engines": { - "node": ">=16.12.0" + "node": ">=18.14.1" } } diff --git a/packages/telemetry/src/config.ts b/packages/telemetry/src/config.ts index d03f9102b..f0d855597 100644 --- a/packages/telemetry/src/config.ts +++ b/packages/telemetry/src/config.ts @@ -1,4 +1,5 @@ import dget from 'dlv'; +// @ts-expect-error `dset` is mispackaged: https://publint.dev/dset@3.1.2 import { dset } from 'dset'; import fs from 'node:fs'; import os from 'node:os'; diff --git a/packages/telemetry/src/post.ts b/packages/telemetry/src/post.ts index 4ce227388..6aef03bc9 100644 --- a/packages/telemetry/src/post.ts +++ b/packages/telemetry/src/post.ts @@ -1,5 +1,3 @@ -import { fetch } from 'undici'; - const ASTRO_TELEMETRY_ENDPOINT = `https://telemetry.astro.build/api/v1/record`; export function post(body: Record): Promise { diff --git a/packages/telemetry/tsconfig.json b/packages/telemetry/tsconfig.json index b35c3d244..451badc02 100644 --- a/packages/telemetry/tsconfig.json +++ b/packages/telemetry/tsconfig.json @@ -3,7 +3,7 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "target": "ES2021", + "target": "ES2022", "module": "ES2022", "outDir": "./dist", "declarationDir": "./dist/types" diff --git a/packages/underscore-redirects/CHANGELOG.md b/packages/underscore-redirects/CHANGELOG.md index fcc2a02cc..91f575738 100644 --- a/packages/underscore-redirects/CHANGELOG.md +++ b/packages/underscore-redirects/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/underscore-redirects +## 0.3.0-beta.0 + +### Minor Changes + +- [`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. + ## 0.2.0 ### Minor Changes diff --git a/packages/underscore-redirects/package.json b/packages/underscore-redirects/package.json index b0b6ba65a..2b9ee05b0 100644 --- a/packages/underscore-redirects/package.json +++ b/packages/underscore-redirects/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/underscore-redirects", "description": "Utilities to generate _redirects files in Astro projects", - "version": "0.2.0", + "version": "0.3.0-beta.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/underscore-redirects/tsconfig.json b/packages/underscore-redirects/tsconfig.json index 569016e9d..fd652e629 100644 --- a/packages/underscore-redirects/tsconfig.json +++ b/packages/underscore-redirects/tsconfig.json @@ -3,7 +3,7 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "target": "ES2021", + "target": "ES2022", "module": "ES2022", "outDir": "./dist" } diff --git a/packages/webapi/.gitignore b/packages/webapi/.gitignore deleted file mode 100644 index 7871d6ab1..000000000 --- a/packages/webapi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -mod.js -mod.js.map diff --git a/packages/webapi/CHANGELOG.md b/packages/webapi/CHANGELOG.md deleted file mode 100644 index a90ba9b24..000000000 --- a/packages/webapi/CHANGELOG.md +++ /dev/null @@ -1,109 +0,0 @@ -# @astrojs/webapi - -## 2.2.0 - -### Minor Changes - -- [#6981](https://github.com/withastro/astro/pull/6981) [`bf63f615f`](https://github.com/withastro/astro/commit/bf63f615fc1b97d6fb84db55f7639084e3ada5af) Thanks [@andremralves](https://github.com/andremralves)! - Add polyfill for `crypto` - -## 2.1.1 - -### Patch Changes - -- [#6929](https://github.com/withastro/astro/pull/6929) [`ac57b5549`](https://github.com/withastro/astro/commit/ac57b5549f828a17bdbebdaca7ace075307a3c9d) Thanks [@bluwy](https://github.com/bluwy)! - Upgrade undici to v5.22.0 - -## 2.1.0 - -### Minor Changes - -- [#6213](https://github.com/withastro/astro/pull/6213) [`afbbc4d5b`](https://github.com/withastro/astro/commit/afbbc4d5bfafc1779bac00b41c2a1cb1c90f2808) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updated compilation settings to disable downlevelling for Node 14 - -## 2.0.3 - -### Patch Changes - -- [#6413](https://github.com/withastro/astro/pull/6413) [`0abd1d3e4`](https://github.com/withastro/astro/commit/0abd1d3e42cf7bf5efb8c41f37e011b933fb0629) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Use undici's FormData instead of a polyfill - -## 2.0.2 - -### Patch Changes - -- [#6355](https://github.com/withastro/astro/pull/6355) [`5aa6580f7`](https://github.com/withastro/astro/commit/5aa6580f775405a4443835bf7eb81f0c65e5aed6) Thanks [@ematipico](https://github.com/ematipico)! - Update `undici` to v5.20.0 - -## 2.0.1 - -### Patch Changes - -- [#6282](https://github.com/withastro/astro/pull/6282) [`bb1801013`](https://github.com/withastro/astro/commit/bb1801013708d9efdbbcebc53a564ac375bf4b26) Thanks [@matthewp](https://github.com/matthewp)! - Temporarily pin undici to fix Header regression - -## 2.0.0 - -### Major Changes - -- [#5814](https://github.com/withastro/astro/pull/5814) [`c55fbcb8e`](https://github.com/withastro/astro/commit/c55fbcb8edca1fe118a44f68c9f9436a4719d171) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Moved target to Node 16. Removed polyfills for `AbortController`, `AbortSignal`, `atob`, `btoa`, `Object.hasOwn`, `Promise.all`, `Array.at` and `String.replaceAll` - -- [#5782](https://github.com/withastro/astro/pull/5782) [`1f92d64ea`](https://github.com/withastro/astro/commit/1f92d64ea35c03fec43aff64eaf704dc5a9eb30a) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Replace `node-fetch`'s polyfill with `undici`. - - Since `undici` does not support it, this change also removes custom support for the `file:` protocol - -### Patch Changes - -- [#5930](https://github.com/withastro/astro/pull/5930) [`46ecd5de3`](https://github.com/withastro/astro/commit/46ecd5de34df619e2ee73ccea39a57acd37bc0b8) Thanks [@h3y6e](https://github.com/h3y6e)! - Update magic-string from 0.25.9 to 0.27.0 - -## 2.0.0-beta.1 - -
-See changes in 2.0.0-beta.1 - -### Patch Changes - -- [#5930](https://github.com/withastro/astro/pull/5930) [`46ecd5de3`](https://github.com/withastro/astro/commit/46ecd5de34df619e2ee73ccea39a57acd37bc0b8) Thanks [@h3y6e](https://github.com/h3y6e)! - Update magic-string from 0.25.9 to 0.27.0 - -
- -## 2.0.0-beta.0 - -
-See changes in 2.0.0-beta.0 - -### Major Changes - -- [#5814](https://github.com/withastro/astro/pull/5814) [`c55fbcb8e`](https://github.com/withastro/astro/commit/c55fbcb8edca1fe118a44f68c9f9436a4719d171) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Moved target to Node 16. Removed polyfills for `AbortController`, `AbortSignal`, `atob`, `btoa`, `Object.hasOwn`, `Promise.all`, `Array.at` and `String.replaceAll` - -- [#5782](https://github.com/withastro/astro/pull/5782) [`1f92d64ea`](https://github.com/withastro/astro/commit/1f92d64ea35c03fec43aff64eaf704dc5a9eb30a) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Replace `node-fetch`'s polyfill with `undici`. - - Since `undici` does not support it, this change also removes custom support for the `file:` protocol - -
- -## 1.1.1 - -### Patch Changes - -- [#5235](https://github.com/withastro/astro/pull/5235) [`b6a478f37`](https://github.com/withastro/astro/commit/b6a478f37648491321077750bfca7bddf3cafadd) Thanks [@ba55ie](https://github.com/ba55ie)! - Fix CustomElementRegistry for Node SSR Adapter - -## 1.1.0 - -### Minor Changes - -- [#4676](https://github.com/withastro/astro/pull/4676) [`5e4c5252b`](https://github.com/withastro/astro/commit/5e4c5252bd80cbaf6a7ee4d4503ece007664410f) Thanks [@zicklag](https://github.com/zicklag)! - Add HTTP Proxy Support to `fetch` Polyfill - -## 1.0.0 - -### Major Changes - -- [`04ad44563`](https://github.com/withastro/astro/commit/04ad445632c67bdd60c1704e1e0dcbcaa27b9308) - > Astro v1.0 is out! Read the [official announcement post](https://astro.build/blog/astro-1/). - - **No breaking changes**. This package is now officially stable and compatible with `astro@1.0.0`! - -## 0.12.0 - -### Minor Changes - -- [#3417](https://github.com/withastro/astro/pull/3417) [`4de53ecc`](https://github.com/withastro/astro/commit/4de53eccef346bed843b491b7ab93987d7d85655) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Fix: support FormData object on fetch body - -## 0.11.1 - -### Patch Changes - -- [#3095](https://github.com/withastro/astro/pull/3095) [`5acf77dd`](https://github.com/withastro/astro/commit/5acf77dd22be95e33ff838383a2c1790f484e380) Thanks [@matthewp](https://github.com/matthewp)! - Fixes rendering of "undefined" on custom element children diff --git a/packages/webapi/LICENSE b/packages/webapi/LICENSE deleted file mode 100644 index d513f83db..000000000 --- a/packages/webapi/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -MIT License Copyright (c) 2022 The Astro Technology Company - -Permission is hereby granted, free of -charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice -(including the next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO -EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ---- - -Code from [@astrocommunity/webapi](https://www.npmjs.com/@astrocommunity/webapi) is licensed under the CC0-1.0 License. - -Code from [event-target-shim](https://www.npmjs.com/package/event-target-shim) is licensed under the MIT License (MIT), Copyright Toru Nagashima. diff --git a/packages/webapi/README.md b/packages/webapi/README.md deleted file mode 100644 index 695c8be8e..000000000 --- a/packages/webapi/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# WebAPI - -**WebAPI** lets you use Web APIs not present in Node v16 and later. - -```sh -npm install @astrojs/webapi -``` - -```js -import { polyfill } from '@astrojs/webapi' - -polyfill(globalThis) - -const t = new EventTarget() -const e = new CustomEvent('hello') - -t.addEventListener('hello', console.log) - -t.dispatchEvent(e) // logs `e` event from `t` -``` - -These APIs are combined from popular open source projects and configured to share implementation details. This allows their behavior to match browser expectations as well as reduce their combined memory footprint. - -## Features - -- [ByteLengthQueuingStrategy](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy) -- [CanvasRenderingContext2D](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) -- [CSSStyleSheet](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet) -- [CountQueuingStrategy](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy) -- [CustomElementRegistry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry) -- [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) -- [DOMException](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) -- [Document](https://developer.mozilla.org/en-US/docs/Web/API/Document) -- [DocumentFragment](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment) -- [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) -- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) -- [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) -- [File](https://developer.mozilla.org/en-US/docs/Web/API/File) -- [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) -- [HTMLDocument](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument) -- [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) -- [HTMLBodyElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement) -- [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) -- [HTMLDivElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement) -- [HTMLHeadElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHeadElement) -- [HTMLHtmlElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLHtmlElement) -- [HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement) -- [HTMLSpanElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLSpanElement) -- [HTMLStyleElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement) -- [HTMLTemplateElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement) -- [HTMLUnknownElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLUnknownElement) -- [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) -- [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) -- [Image](https://developer.mozilla.org/en-US/docs/Web/API/Image) -- [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) -- [MediaQueryList](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList) -- [MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) -- [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) -- [NodeIterator](https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator) -- [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) -- [ReadableByteStreamController](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController) -- [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) -- [ReadableStreamBYOBReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader) -- [ReadableStreamBYOBRequest](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest) -- [ReadableStreamDefaultController](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController) -- [ReadableStreamDefaultReader](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader) -- [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) -- [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) -- [ShadowRoot](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot) -- [Storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage) -- [StyleSheet](https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet) -- [TransformStream](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream) -- [TreeWalker](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker) -- [WritableStream](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream) -- [WritableStreamDefaultController](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController) -- [WritableStreamDefaultWriter](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter) -- [Window](https://developer.mozilla.org/en-US/docs/Web/API/Window) -- [cancelAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame) -- [cancelIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/cancelIdleCallback) -- [clearTimeout](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout) -- [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch) -- [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/localStorage) -- [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/requestAnimationFrame) -- [requestIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/requestIdleCallback) -- [setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) -- [structuredClone](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) -- [URLPattern](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) - -## Usage - -You can use WebAPIs as individual exports. - -```js -import { Event, EventTarget, File, fetch, Response } from '@astrojs/webapi' -``` - -You can apply WebAPIs to an object, like `globalThis`. - -```js -import { polyfill } from '@astrojs/webapi' - -polyfill(globalThis) -``` - -## Polyfill Options - -The `exclude` option receives a list of WebAPIs to exclude from polyfilling. - -```js -polyfill(globalThis, { - // disables polyfills for setTimeout clearTimeout - exclude: 'setTimeout clearTimeout', -}) -``` - -The `exclude` option accepts shorthands to exclude multiple polyfills. These shorthands end with the plus sign (`+`). - -```js -polyfill(globalThis, { - // disables polyfills for setTimeout clearTimeout - exclude: 'Timeout+', -}) -``` - -```js -polyfill(globalThis, { - // disables polyfills for Node, Window, Document, HTMLElement, etc. - exclude: 'Node+', -}) -``` - -```js -polyfill(globalThis, { - // disables polyfills for Event, EventTarget, Node, Window, Document, HTMLElement, etc. - exclude: 'Event+', -}) -``` - -| Shorthand | Excludes | -| :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `Document+` | `Document`, `HTMLDocument` | -| `Element+` | `Element`, and exclusions from `HTMLElement+` | -| `Event+` | `Event`, `CustomEvent`, `EventTarget`, `MediaQueryList`, `Window`, and exclusions from `Node+` | -| `EventTarget+` | `Event`, `CustomEvent`, `EventTarget`, `MediaQueryList`, `Window`, and exclusions from `Node+` | -| `HTMLElement+` | `CustomElementsRegistry`, `HTMLElement`, `HTMLBodyElement`, `HTMLCanvasElement`, `HTMLDivElement`, `HTMLHeadElement`, `HTMLHtmlElement`, `HTMLImageElement`, `HTMLStyleElement`, `HTMLTemplateElement`, `HTMLUnknownElement`, `Image` | -| `Node+` | `Node`, `DocumentFragment`, `ShadowRoot`, `Document`, `HTMLDocument`, and exclusions from `Element+` | -| `StyleSheet+` | `StyleSheet`, `CSSStyleSheet` | - ---- - -## License & Attribution - -Thank you to Jon Neal for his work on the original [webapi](https://github.com/astro-community/webapi) project that this package is forked from. Licensed under the CC0-1.0 License. - -Code from [event-target-shim](https://www.npmjs.com/package/event-target-shim) is licensed under the MIT License (MIT), Copyright Toru Nagashima. diff --git a/packages/webapi/apply.js b/packages/webapi/apply.js deleted file mode 100644 index 4efd06fe1..000000000 --- a/packages/webapi/apply.js +++ /dev/null @@ -1,5 +0,0 @@ -import { polyfill } from './mod.js' - -export * from './mod.js' - -polyfill(globalThis) diff --git a/packages/webapi/mod.d.ts b/packages/webapi/mod.d.ts deleted file mode 100644 index 60bdbab37..000000000 --- a/packages/webapi/mod.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// organize-imports-ignore -export { pathToPosix } from './lib/utils'; -export { alert, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, crypto, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter, } from './mod.js'; -export declare const polyfill: { - (target: any, options?: PolyfillOptions): any; - internals(target: any, name: string): any; -}; -interface PolyfillOptions { - exclude?: string | string[]; - override?: Record; -} \ No newline at end of file diff --git a/packages/webapi/package.json b/packages/webapi/package.json deleted file mode 100644 index d214b4c97..000000000 --- a/packages/webapi/package.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "name": "@astrojs/webapi", - "description": "Use Web APIs in Node", - "version": "2.2.0", - "type": "module", - "exports": { - ".": { - "import": "./mod.js", - "types": "./mod.d.ts" - }, - "./apply": { - "import": "./apply.js" - } - }, - "main": "mod.js", - "types": "mod.d.ts", - "files": [ - "apply.js", - "mod.d.ts", - "mod.js", - "mod.js.map" - ], - "keywords": [ - "astro", - "api", - "cancelAnimationFrame", - "clearImmediate", - "clearInterval", - "fetch", - "requestAnimationFrame", - "setImmediate", - "setInterval", - "web" - ], - "repository": { - "type": "git", - "url": "https://github.com/withastro/astro.git", - "directory": "packages/webapi" - }, - "author": "withastro", - "license": "MIT", - "contributors": [ - "Jonathan Neal (https://github.com/jonathantneal)", - "Toru Nagashima (https://github.com/mysticatea)", - "Jimmy Wärting (https://github.com/jimmywarting)", - "David Frank (https://github.com/bitinn)", - "Mattias Buelens (https://github.com/MattiasBuelens)", - "Diwank Singh (https://github.com/creatorrr)" - ], - "bugs": "https://github.com/withastro/astro/issues", - "homepage": "https://github.com/withastro/astro/tree/main/packages/webapi#readme", - "dependencies": { - "undici": "^5.22.1" - }, - "devDependencies": { - "@rollup/plugin-alias": "^3.1.9", - "@rollup/plugin-inject": "^4.0.4", - "@rollup/plugin-node-resolve": "^13.3.0", - "@rollup/plugin-typescript": "^8.5.0", - "@types/chai": "^4.3.5", - "@types/mocha": "^9.1.1", - "@types/node": "^18.16.18", - "@ungap/structured-clone": "^0.3.4", - "chai": "^4.3.7", - "event-target-shim": "^6.0.2", - "magic-string": "^0.30.2", - "mocha": "^9.2.2", - "rollup": "^2.79.1", - "tslib": "^2.5.3", - "typescript": "~5.0.2", - "urlpattern-polyfill": "^1.0.0-rc5" - }, - "scripts": { - "build": "node run/build.js", - "build:ci": "node run/build.js", - "dev": "node run/build.js", - "release": "node run/build.js && npm publish --access public", - "test": "mocha --parallel --timeout 15000" - }, - "prettier": { - "semi": false, - "singleQuote": true, - "trailingComma": "es5", - "useTabs": true, - "overrides": [ - { - "files": [ - ".stackblitzrc", - "*.json" - ], - "options": { - "useTabs": false - } - } - ] - } -} diff --git a/packages/webapi/run/build.js b/packages/webapi/run/build.js deleted file mode 100644 index 017820746..000000000 --- a/packages/webapi/run/build.js +++ /dev/null @@ -1,224 +0,0 @@ -import { default as alias } from '@rollup/plugin-alias' -import { default as inject } from '@rollup/plugin-inject' -import { nodeResolve } from '@rollup/plugin-node-resolve' -import { default as typescript } from '@rollup/plugin-typescript' -import { default as MagicString } from 'magic-string' -import { - readFile as nodeReadFile, - rename, - rm, - writeFile, -} from 'node:fs/promises' -import { createRequire } from 'node:module' -import path from 'node:path' -import { rollup } from 'rollup' - -const readFileCache = Object.create(null) -const require = createRequire(import.meta.url) - -const readFile = (/** @type {string} */ id) => - readFileCache[id] || (readFileCache[id] = nodeReadFile(id, 'utf8')) - -const pathToDOMException = path.resolve('src', 'lib', 'DOMException.js') -const pathToEventTargetShim = path.resolve( - 'node_modules', - 'event-target-shim', - 'index.mjs' -) -const pathToStructuredClone = path.resolve( - 'node_modules', - '@ungap', - 'structured-clone', - 'esm', - 'index.js' -) - -const plugins = [ - typescript({ - tsconfig: './tsconfig.json', - }), - alias({ - entries: [ - { find: '@ungap/structured-clone', replacement: pathToStructuredClone }, - { find: 'event-target-shim', replacement: pathToEventTargetShim }, - { - find: 'event-target-shim/dist/event-target-shim.js', - replacement: pathToEventTargetShim, - }, - { - find: 'event-target-shim/dist/event-target-shim.umd.js', - replacement: pathToEventTargetShim, - }, - { find: 'node-domexception', replacement: pathToDOMException }, - ], - }), - nodeResolve({ - dedupe: ['net', 'node:net'], - }), - inject({ - // import { Promise as P } from 'es6-promise' - // P: [ 'es6-promise', 'Promise' ], - DOMException: [pathToDOMException, 'DOMException'], - Document: ['./Document', 'Document'], - Element: ['./Element', 'Element'], - Event: ['event-target-shim', 'Event'], - EventTarget: ['event-target-shim', 'EventTarget'], - defineEventAttribute: ['event-target-shim', 'defineEventAttribute'], - HTMLElement: ['./Element', 'HTMLElement'], - HTMLImageElement: ['./Element', 'HTMLImageElement'], - HTMLUnknownElement: ['./Element', 'HTMLUnknownElement'], - MediaQueryList: ['./MediaQueryList', 'MediaQueryList'], - Node: ['./Node', 'Node'], - ReadableStream: ['node:stream/web', 'ReadableStream'], - ShadowRoot: ['./Node', 'ShadowRoot'], - Window: ['./Window', 'Window'], - 'globalThis.ReadableStream': ['node:stream/web', 'ReadableStream'], - }), - { - async load(id) { - const pathToEsm = id - const pathToMap = `${pathToEsm}.map` - - const code = await readFile(pathToEsm, 'utf8') - - const indexes = [] - - const replacements = [ - // remove unused imports - [/(^|\n)import\s+[^']+'node:(buffer|fs|path|worker_threads)'/g, ``], - [/const \{ stat \} = fs/g, ``], - - // remove unused polyfill utils - [/\nif \(\s*typeof Global[\W\w]+?\n\}/g, ``], - [/\nif \(\s*typeof window[\W\w]+?\n\}/g, ``], - [/\nif \(!globalThis\.ReadableStream\) \{[\W\w]+?\n\}/g, ``], - [/\nif \(typeof SymbolPolyfill[\W\w]+?\n\}/g, ``], - - // remove unused polyfills - [/\nconst globals = getGlobals\(\);/g, ``], - [/\nconst queueMicrotask = [\W\w]+?\n\}\)\(\);/g, ``], - [/\nconst NativeDOMException =[^;]+;/g, ``], - [ - /\nconst SymbolPolyfill\s*=[^;]+;/g, - '\nconst SymbolPolyfill = Symbol;', - ], - [ - /\n(const|let) DOMException[^;]*;/g, - `let DOMException$1=DOMException`, - ], - [/\nconst DOMException = globalThis.DOMException[\W\w]+?\}\)\(\)/g, ``], - [/\nimport DOMException from 'node-domexception'/g, ``], - - // use shared AbortController methods - [/ new DOMException\$1/g, `new DOMException`], - [/ from 'net'/g, `from 'node:net'`], - [/ throw createInvalidStateError/g, `throw new DOMException`], - [/= createAbortController/g, `= new AbortController`], - [/\nconst queueMicrotask = [\W\w]+?\n\}\)\(\)\;/g, ``], - - // remove Body.prototype.buffer deprecation notice - [/\nBody\.prototype\.buffer[^\n]+/g, ``], - - // remove Body.prototype.data deprecation notice - [/\n data: \{get: deprecate[\W\w]+?\)\}/g, ``], - ] - - for (const [replacee, replacer] of replacements) { - replacee.index = 0 - - let replaced = null - - while ((replaced = replacee.exec(code)) !== null) { - const leadIndex = replaced.index - const tailIndex = replaced.index + replaced[0].length - - indexes.unshift([leadIndex, tailIndex, replacer]) - } - } - - if (indexes.length) { - const magicString = new MagicString(code) - - indexes.sort(([leadOfA], [leadOfB]) => leadOfA - leadOfB) - - for (const [leadIndex, tailindex, replacer] of indexes) { - magicString.overwrite(leadIndex, tailindex, replacer) - } - - const magicMap = magicString.generateMap({ - source: pathToEsm, - file: pathToMap, - includeContent: true, - }) - - const modifiedEsm = magicString.toString() - const modifiedMap = magicMap.toString() - - return { code: modifiedEsm, map: modifiedMap } - } - }, - }, -] - -async function build() { - const configs = [ - { - inputOptions: { - input: 'src/polyfill.ts', - plugins: plugins, - external: ['undici'], - onwarn(warning, warn) { - if (warning.code !== 'UNRESOLVED_IMPORT') warn(warning) - }, - }, - outputOptions: { - inlineDynamicImports: true, - file: 'mod.js', - format: 'esm', - sourcemap: true, - }, - }, - ] - - for (const config of configs) { - const bundle = await rollup(config.inputOptions) - - // or write the bundle to disk - await bundle.write(config.outputOptions) - - // closes the bundle - await bundle.close() - - // delete the lib directory - await rm('lib', { force: true, recursive: true }) - await rm('exclusions.d.ts', { force: true, recursive: true }) - await rm('exclusions.d.ts.map', { force: true, recursive: true }) - await rm('inheritance.d.ts', { force: true, recursive: true }) - await rm('inheritance.d.ts.map', { force: true, recursive: true }) - await rm('polyfill.d.ts.map', { force: true, recursive: true }) - await rm('polyfill.js.map', { force: true, recursive: true }) - await rm('polyfill.js', { force: true, recursive: true }) - await rm('ponyfill.d.ts', { force: true, recursive: true }) - await rm('ponyfill.d.ts.map', { force: true, recursive: true }) - await rm('ponyfill.js.map', { force: true, recursive: true }) - await rm('ponyfill.js', { force: true, recursive: true }) - - await rename('polyfill.d.ts', 'mod.d.ts') - - const modDTS = await readFile('./mod.d.ts') - - writeFile( - 'mod.d.ts', - '// organize-imports-ignore\n' + - modDTS - .replace('\n//# sourceMappingURL=polyfill.d.ts.map', '') - .replace('ponyfill.js', 'mod.js') - ) - writeFile( - 'apply.js', - `import { polyfill } from './mod.js'\n\nexport * from './mod.js'\n\npolyfill(globalThis)\n` - ) - } -} - -build() diff --git a/packages/webapi/src/exclusions.ts b/packages/webapi/src/exclusions.ts deleted file mode 100644 index a664483dc..000000000 --- a/packages/webapi/src/exclusions.ts +++ /dev/null @@ -1,57 +0,0 @@ -const exclusionsForHTMLElement = [ - 'CustomElementsRegistry', - 'HTMLElement', - 'HTMLBodyElement', - 'HTMLCanvasElement', - 'HTMLDivElement', - 'HTMLHeadElement', - 'HTMLHtmlElement', - 'HTMLImageElement', - 'HTMLStyleElement', - 'HTMLTemplateElement', - 'HTMLUnknownElement', - 'Image', -] -const exclusionsForElement = ['Element', ...exclusionsForHTMLElement] as const -const exclusionsForDocument = [ - 'CustomElementsRegistry', - 'Document', - 'HTMLDocument', - 'document', - 'customElements', -] as const -const exclusionsForNode = [ - 'Node', - 'DocumentFragment', - 'ShadowRoot', - ...exclusionsForDocument, - ...exclusionsForElement, -] as const -const exclusionsForEventTarget = [ - 'Event', - 'CustomEvent', - 'EventTarget', - 'OffscreenCanvas', - 'MediaQueryList', - 'Window', - ...exclusionsForNode, -] as const -const exclusionsForEvent = [ - 'Event', - 'CustomEvent', - 'EventTarget', - 'MediaQueryList', - 'OffscreenCanvas', - 'Window', - ...exclusionsForNode, -] as const - -export const exclusions = { - 'Document+': exclusionsForDocument, - 'Element+': exclusionsForElement, - 'Event+': exclusionsForEvent, - 'EventTarget+': exclusionsForEventTarget, - 'HTMLElement+': exclusionsForHTMLElement, - 'Node+': exclusionsForNode, - 'StyleSheet+': ['StyleSheet', 'CSSStyleSheet'], -} diff --git a/packages/webapi/src/inheritance.ts b/packages/webapi/src/inheritance.ts deleted file mode 100644 index 6e3165633..000000000 --- a/packages/webapi/src/inheritance.ts +++ /dev/null @@ -1,26 +0,0 @@ -export const inheritance = { - CSSStyleSheet: 'StyleSheet', - CustomEvent: 'Event', - DOMException: 'Error', - Document: 'Node', - DocumentFragment: 'Node', - Element: 'Node', - HTMLDocument: 'Document', - HTMLElement: 'Element', - HTMLBodyElement: 'HTMLElement', - HTMLCanvasElement: 'HTMLElement', - HTMLDivElement: 'HTMLElement', - HTMLHeadElement: 'HTMLElement', - HTMLHtmlElement: 'HTMLElement', - HTMLImageElement: 'HTMLElement', - HTMLSpanElement: 'HTMLElement', - HTMLStyleElement: 'HTMLElement', - HTMLTemplateElement: 'HTMLElement', - HTMLUnknownElement: 'HTMLElement', - Image: 'HTMLElement', - MediaQueryList: 'EventTarget', - Node: 'EventTarget', - OffscreenCanvas: 'EventTarget', - ShadowRoot: 'DocumentFragment', - Window: 'EventTarget', -} as const diff --git a/packages/webapi/src/lib/Alert.ts b/packages/webapi/src/lib/Alert.ts deleted file mode 100644 index 0aacd645f..000000000 --- a/packages/webapi/src/lib/Alert.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function alert(...messages: any[]) { - console.log(...messages) -} diff --git a/packages/webapi/src/lib/AnimationFrame.ts b/packages/webapi/src/lib/AnimationFrame.ts deleted file mode 100644 index e29d3cabf..000000000 --- a/packages/webapi/src/lib/AnimationFrame.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { - clearTimeout as nodeClearTimeout, - setTimeout as nodeSetTimeout, -} from 'node:timers' -import * as _ from './utils.js' - -const INTERNAL = { tick: 0, pool: new Map() } - -export function requestAnimationFrame< - TArgs extends any[], - TFunc extends (...args: TArgs) => any ->(callback: TFunc): number { - if (!INTERNAL.pool.size) { - nodeSetTimeout(() => { - const next = _.__performance_now() - - for (const func of INTERNAL.pool.values()) { - func(next) - } - - INTERNAL.pool.clear() - }, 1000 / 16) - } - - const func = _.__function_bind(callback, undefined) - const tick = ++INTERNAL.tick - - INTERNAL.pool.set(tick, func) - - return tick -} - -export function cancelAnimationFrame(requestId: number): void { - const timeout = INTERNAL.pool.get(requestId) - - if (timeout) { - nodeClearTimeout(timeout) - - INTERNAL.pool.delete(requestId) - } -} diff --git a/packages/webapi/src/lib/CanvasRenderingContext2D.ts b/packages/webapi/src/lib/CanvasRenderingContext2D.ts deleted file mode 100644 index 147a80ca9..000000000 --- a/packages/webapi/src/lib/CanvasRenderingContext2D.ts +++ /dev/null @@ -1,222 +0,0 @@ -import type { HTMLCanvasElement } from './HTMLCanvasElement' -import type { OffscreenCanvas } from './OffscreenCanvas' - -import { ImageData } from './ImageData' -import * as _ from './utils' - -export class CanvasRenderingContext2D { - get canvas(): HTMLCanvasElement | OffscreenCanvas | null { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'canvas').canvas - } - - get direction(): 'ltr' | 'rtl' | 'inherit' { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'direction') - .direction - } - - get fillStyle(): string { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'fillStyle') - .fillStyle - } - - get filter(): string { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'filter').filter - } - - get globalAlpha(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'globalAlpha') - .globalAlpha - } - - get globalCompositeOperation(): string { - return _.internalsOf( - this, - 'CanvasRenderingContext2D', - 'globalCompositeOperation' - ).globalCompositeOperation - } - - get font(): string { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'font').font - } - - get imageSmoothingEnabled(): boolean { - return _.internalsOf( - this, - 'CanvasRenderingContext2D', - 'imageSmoothingEnabled' - ).imageSmoothingEnabled - } - - get imageSmoothingQuality(): 'low' | 'medium' | 'high' { - return _.internalsOf( - this, - 'CanvasRenderingContext2D', - 'imageSmoothingQuality' - ).imageSmoothingQuality - } - - get lineCap(): 'butt' | 'round' | 'square' { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'lineCap').lineCap - } - - get lineDashOffset(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'lineDashOffset') - .lineDashOffset - } - - get lineJoin(): 'bevel' | 'round' | 'miter' { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'lineJoin').lineJoin - } - - get lineWidth(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'lineWidth') - .lineWidth - } - - get miterLimit(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'miterLimit') - .miterLimit - } - - get strokeStyle(): string { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'strokeStyle') - .strokeStyle - } - - get shadowOffsetX(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'shadowOffsetX') - .shadowOffsetX - } - - get shadowOffsetY(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'shadowOffsetY') - .shadowOffsetY - } - - get shadowBlur(): number { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'shadowBlur') - .shadowBlur - } - - get shadowColor(): string { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'shadowColor') - .shadowColor - } - - get textAlign(): 'left' | 'right' | 'center' | 'start' | 'end' { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'textAlign') - .textAlign - } - - get textBaseline(): - | 'top' - | 'hanging' - | 'middle' - | 'alphabetic' - | 'ideographic' - | 'bottom' { - return _.internalsOf(this, 'CanvasRenderingContext2D', 'textBaseline') - .textBaseline - } - - arc() {} - arcTo() {} - beginPath() {} - bezierCurveTo() {} - clearRect() {} - clip() {} - closePath() {} - - createImageData(width: number, height: number): void - createImageData(imagedata: ImageData): void - - createImageData(arg0: number | ImageData, arg1?: void | number) { - /** Whether ImageData is provided. */ - const hasData = _.__object_isPrototypeOf(ImageData.prototype, arg0) - - const w = hasData ? (arg0 as ImageData).width : (arg0 as number) - const h = hasData ? (arg0 as ImageData).height : (arg1 as number) - const d = hasData - ? (arg0 as ImageData).data - : new Uint8ClampedArray(w * h * 4) - - return new ImageData(d, w, h) - } - - createLinearGradient() {} - createPattern() {} - createRadialGradient() {} - drawFocusIfNeeded() {} - drawImage() {} - ellipse() {} - fill() {} - fillRect() {} - fillText() {} - getContextAttributes() {} - getImageData() {} - getLineDash() {} - getTransform() {} - isPointInPath() {} - isPointInStroke() {} - lineTo() {} - measureText() {} - moveTo() {} - putImageData() {} - quadraticCurveTo() {} - rect() {} - resetTransform() {} - restore() {} - rotate() {} - save() {} - scale() {} - setLineDash() {} - setTransform() {} - stroke() {} - strokeRect() {} - strokeText() {} - transform() {} - translate() {} -} - -_.allowStringTag(CanvasRenderingContext2D) - -export const __createCanvasRenderingContext2D = ( - canvas: EventTarget -): CanvasRenderingContext2D => { - const renderingContext2D = Object.create( - CanvasRenderingContext2D.prototype - ) as CanvasRenderingContext2D - - _.INTERNALS.set(renderingContext2D, { - canvas, - direction: 'inherit', - fillStyle: '#000', - filter: 'none', - font: '10px sans-serif', - globalAlpha: 0, - globalCompositeOperation: 'source-over', - imageSmoothingEnabled: false, - imageSmoothingQuality: 'high', - lineCap: 'butt', - lineDashOffset: 0.0, - lineJoin: 'miter', - lineWidth: 1.0, - miterLimit: 10.0, - shadowBlur: 0, - shadowColor: '#000', - shadowOffsetX: 0, - shadowOffsetY: 0, - strokeStyle: '#000', - textAlign: 'start', - textBaseline: 'alphabetic', - }) - - return renderingContext2D -} - -/** Returns whether the value is an instance of ImageData. */ -const isImageData = (value: T) => - (Object(value).data instanceof Uint8ClampedArray) as T extends ImageData - ? true - : false diff --git a/packages/webapi/src/lib/CharacterData.ts b/packages/webapi/src/lib/CharacterData.ts deleted file mode 100644 index 430657ffb..000000000 --- a/packages/webapi/src/lib/CharacterData.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as _ from './utils' - -export class CharacterData extends Node { - constructor(data: string) { - _.INTERNALS.set(super(), { - data: String(data), - } as CharacterDataInternals) - } - get data(): string { - return _.internalsOf(this, 'CharacterData', 'data') - .data - } - - get textContent(): string { - return _.internalsOf( - this, - 'CharacterData', - 'textContent' - ).data - } -} - -export class Comment extends CharacterData {} - -export class Text extends CharacterData { - get assignedSlot(): HTMLSlotElement | null { - return null - } - - get wholeText(): string { - return _.internalsOf( - this, - 'CharacterData', - 'textContent' - ).data - } -} - -_.allowStringTag(CharacterData) -_.allowStringTag(Text) -_.allowStringTag(Comment) - -interface CharacterDataInternals { - data: string -} diff --git a/packages/webapi/src/lib/CustomElementRegistry.ts b/packages/webapi/src/lib/CustomElementRegistry.ts deleted file mode 100644 index 21f775d5e..000000000 --- a/packages/webapi/src/lib/CustomElementRegistry.ts +++ /dev/null @@ -1,92 +0,0 @@ -import * as _ from './utils' - -export class CustomElementRegistry { - /** Defines a new custom element using the given tag name and HTMLElement constructor. */ - define( - name: string, - constructor: Function, - options?: ElementDefinitionOptions - ) { - const internals = _.internalsOf( - this, - 'CustomElementRegistry', - 'define' - ) - - name = String(name) - - if (/[A-Z]/.test(name)) - throw new SyntaxError( - 'Custom element name cannot contain an uppercase ASCII letter' - ) - if (!/^[a-z]/.test(name)) - throw new SyntaxError( - 'Custom element name must have a lowercase ASCII letter as its first character' - ) - if (!/-/.test(name)) - throw new SyntaxError('Custom element name must contain a hyphen') - - _.INTERNALS.set(constructor, { - attributes: {}, - localName: name, - } as any) - - internals.constructorByName.set(name, constructor) - internals.nameByConstructor.set(constructor, name) - - void options - } - - /** Returns the constructor associated with the given tag name. */ - get(name: string) { - const internals = _.internalsOf( - this, - 'CustomElementRegistry', - 'get' - ) - - name = String(name).toLowerCase() - - return internals.constructorByName.get(name) - } - - getName(constructor: Function) { - const internals = _.internalsOf( - this, - 'CustomElementRegistry', - 'getName' - ) - - return internals.nameByConstructor.get(constructor) - } -} - -_.allowStringTag(CustomElementRegistry) - -interface CustomElementRegistryInternals { - constructorByName: Map - nameByConstructor: Map -} - -interface ElementDefinitionOptions { - extends?: string | undefined -} - -export const initCustomElementRegistry = ( - target: Record, - exclude: Set -) => { - if (exclude.has('customElements')) return - - const CustomElementRegistry = - target.CustomElementRegistry || globalThis.CustomElementRegistry - - const customElements: CustomElementRegistry = - target.customElements || - (target.customElements = new CustomElementRegistry()) - - _.INTERNALS.set(customElements, { - constructorByName: new Map(), - nameByConstructor: new Map(), - } as CustomElementRegistryInternals) -} diff --git a/packages/webapi/src/lib/CustomEvent.ts b/packages/webapi/src/lib/CustomEvent.ts deleted file mode 100644 index 1269b7216..000000000 --- a/packages/webapi/src/lib/CustomEvent.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Event } from 'event-target-shim' -import * as _ from './utils' - -class CustomEvent< - TEventType extends string = string -> extends Event { - constructor(type: TEventType, params?: CustomEventInit) { - params = Object(params) as Required - - super(type, params) - - if ('detail' in params) this.detail = params.detail - } - - detail!: any -} - -_.allowStringTag(CustomEvent) - -export { CustomEvent } - -interface CustomEventInit { - bubbles?: boolean - cancelable?: false - detail?: any -} diff --git a/packages/webapi/src/lib/DOMException.ts b/packages/webapi/src/lib/DOMException.ts deleted file mode 100644 index 539871c6b..000000000 --- a/packages/webapi/src/lib/DOMException.ts +++ /dev/null @@ -1,40 +0,0 @@ -import * as _ from './utils' - -export class DOMException extends Error { - constructor(message = '', name = 'Error') { - super(message) - - this.code = 0 - this.name = name - } - - code!: number - - static INDEX_SIZE_ERR = 1 - static DOMSTRING_SIZE_ERR = 2 - static HIERARCHY_REQUEST_ERR = 3 - static WRONG_DOCUMENT_ERR = 4 - static INVALID_CHARACTER_ERR = 5 - static NO_DATA_ALLOWED_ERR = 6 - static NO_MODIFICATION_ALLOWED_ERR = 7 - static NOT_FOUND_ERR = 8 - static NOT_SUPPORTED_ERR = 9 - static INUSE_ATTRIBUTE_ERR = 10 - static INVALID_STATE_ERR = 11 - static SYNTAX_ERR = 12 - static INVALID_MODIFICATION_ERR = 13 - static NAMESPACE_ERR = 14 - static INVALID_ACCESS_ERR = 15 - static VALIDATION_ERR = 16 - static TYPE_MISMATCH_ERR = 17 - static SECURITY_ERR = 18 - static NETWORK_ERR = 19 - static ABORT_ERR = 20 - static URL_MISMATCH_ERR = 21 - static QUOTA_EXCEEDED_ERR = 22 - static TIMEOUT_ERR = 23 - static INVALID_NODE_TYPE_ERR = 24 - static DATA_CLONE_ERR = 25 -} - -_.allowStringTag(DOMException) diff --git a/packages/webapi/src/lib/Document.ts b/packages/webapi/src/lib/Document.ts deleted file mode 100644 index b9c30b3a3..000000000 --- a/packages/webapi/src/lib/Document.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { Text } from './CharacterData' -import { TreeWalker } from './TreeWalker' -import * as _ from './utils' - -export class Document extends Node { - createElement(name: string) { - const internals = _.internalsOf( - this, - 'Document', - 'createElement' - ) - - const customElementInternals: CustomElementRegistryInternals = - _.INTERNALS.get(internals.target.customElements) - - name = String(name).toLowerCase() - - const TypeOfHTMLElement = - internals.constructorByName.get(name) || - (customElementInternals && - customElementInternals.constructorByName.get(name)) || - HTMLUnknownElement - - const element = Object.setPrototypeOf( - new EventTarget(), - TypeOfHTMLElement.prototype - ) as HTMLElement - - _.INTERNALS.set(element, { - attributes: {}, - localName: name, - ownerDocument: this, - shadowInit: null as unknown as ShadowRootInit, - shadowRoot: null as unknown as ShadowRoot, - } as ElementInternals) - - return element - } - - createNodeIterator( - root: Node, - whatToShow: number = NodeFilter.SHOW_ALL, - filter?: NodeIteratorInternals['filter'] - ) { - const target = Object.create(NodeIterator.prototype) - - _.INTERNALS.set(target, { - filter, - pointerBeforeReferenceNode: false, - referenceNode: root, - root, - whatToShow, - } as NodeIteratorInternals) - - return target - } - - createTextNode(data: string) { - return new Text(data) - } - - createTreeWalker( - root: Node, - whatToShow: number = NodeFilter.SHOW_ALL, - filter?: NodeFilter, - expandEntityReferences?: boolean - ) { - const target = Object.create(TreeWalker.prototype) - - _.INTERNALS.set(target, { - filter, - currentNode: root, - root, - whatToShow, - } as TreeWalkerInternals) - - return target - } - - get adoptedStyleSheets(): StyleSheet[] { - return [] - } - - get styleSheets(): StyleSheet[] { - return [] - } - - body!: HTMLBodyElement - documentElement!: HTMLHtmlElement - head!: HTMLHeadElement -} - -export class HTMLDocument extends Document {} - -_.allowStringTag(Document) -_.allowStringTag(HTMLDocument) - -export const initDocument = (target: Target, exclude: Set) => { - if (exclude.has('document')) return - - const EventTarget = target.EventTarget || globalThis.EventTarget - const HTMLDocument = target.HTMLDocument || globalThis.HTMLDocument - - const document: HTMLDocument = (target.document = Object.setPrototypeOf( - new EventTarget(), - HTMLDocument.prototype - )) - - _.INTERNALS.set(document, { - target, - constructorByName: new Map([ - ['body', target.HTMLBodyElement], - ['canvas', target.HTMLCanvasElement], - ['div', target.HTMLDivElement], - ['head', target.HTMLHeadElement], - ['html', target.HTMLHtmlElement], - ['img', target.HTMLImageElement], - ['span', target.HTMLSpanElement], - ['style', target.HTMLStyleElement], - ]), - nameByConstructor: new Map(), - } as DocumentInternals) - - const initElement = (name: string, Class: Function) => { - const target = Object.setPrototypeOf(new EventTarget(), Class.prototype) - - _.INTERNALS.set(target, { - attributes: {}, - localName: name, - ownerDocument: document, - shadowRoot: null as unknown as ShadowRoot, - shadowInit: null as unknown as ShadowRootInit, - } as ElementInternals) - - return target - } - - document.body = initElement('body', target.HTMLBodyElement) as HTMLBodyElement - document.head = initElement('head', target.HTMLHeadElement) as HTMLHeadElement - document.documentElement = initElement( - 'html', - target.HTMLHtmlElement - ) as HTMLHtmlElement -} - -interface DocumentInternals { - body: HTMLBodyElement - documentElement: HTMLHtmlElement - head: HTMLHeadElement - constructorByName: Map - nameByConstructor: Map - target: Target -} - -interface CustomElementRegistryInternals { - constructorByName: Map - nameByConstructor: Map -} - -interface ElementInternals { - attributes: { [name: string]: string } - localName: string - ownerDocument: Document - shadowRoot: ShadowRoot - shadowInit: ShadowRootInit -} - -interface ShadowRootInit extends Record { - mode?: string -} - -interface Target extends Record { - HTMLBodyElement: typeof HTMLBodyElement - HTMLDivElement: typeof HTMLDivElement - HTMLElement: typeof HTMLElement - HTMLHeadElement: typeof HTMLHeadElement - HTMLHtmlElement: typeof HTMLHtmlElement - HTMLSpanElement: typeof HTMLSpanElement - HTMLStyleElement: typeof HTMLStyleElement - customElements: CustomElementRegistry - document: DocumentInternals -} - -interface NodeIteratorInternals { - filter: NodeFilter - pointerBeforeReferenceNode: boolean - referenceNode: Node - root: Node - whatToShow: number -} - -interface TreeWalkerInternals { - filter: NodeFilter - currentNode: Node - root: Node - whatToShow: number -} diff --git a/packages/webapi/src/lib/Element.ts b/packages/webapi/src/lib/Element.ts deleted file mode 100644 index 013571e63..000000000 --- a/packages/webapi/src/lib/Element.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as _ from './utils' - -export class Element extends Node { - constructor() { - super() - - if (_.INTERNALS.has(new.target)) { - const internals = _.internalsOf(new.target, 'Element', 'localName') - _.INTERNALS.set(this, { - attributes: {}, - localName: (internals as unknown as Element).localName, - ownerDocument: this.ownerDocument, - shadowInit: null as unknown as ShadowRootInit, - shadowRoot: null as unknown as ShadowRoot, - } as ElementInternals) - } - } - - hasAttribute(name: string): boolean { - void name - - return false - } - - getAttribute(name: string): string | null { - return null - } - - setAttribute(name: string, value: string): void { - void name - void value - } - - removeAttribute(name: string): void { - void name - } - - attachShadow(init: Partial) { - if (arguments.length < 1) - throw new TypeError( - `Failed to execute 'attachShadow' on 'Element': 1 argument required, but only 0 present.` - ) - - if (init !== Object(init)) - throw new TypeError( - `Failed to execute 'attachShadow' on 'Element': The provided value is not of type 'ShadowRootInit'.` - ) - - if (init.mode !== 'open' && init.mode !== 'closed') - throw new TypeError( - `Failed to execute 'attachShadow' on 'Element': Failed to read the 'mode' property from 'ShadowRootInit': The provided value '${init.mode}' is not a valid enum value of type ShadowRootMode.` - ) - - const internals = _.internalsOf( - this, - 'Element', - 'attachShadow' - ) - - if (internals.shadowRoot) throw new Error('The operation is not supported.') - - internals.shadowInit = internals.shadowInit || { - mode: init.mode, - delegatesFocus: Boolean(init.delegatesFocus), - } - - internals.shadowRoot = - internals.shadowRoot || - (/^open$/.test(internals.shadowInit.mode as string) - ? (Object.setPrototypeOf( - new EventTarget(), - ShadowRoot.prototype - ) as ShadowRoot) - : null) - - return internals.shadowRoot - } - - get assignedSlot(): HTMLSlotElement | null { - return null - } - - get innerHTML(): string { - _.internalsOf(this, 'Element', 'innerHTML') - - return '' - } - - set innerHTML(value) { - _.internalsOf(this, 'Element', 'innerHTML') - - void value - } - - get shadowRoot(): ShadowRoot | null { - const internals = _.internalsOf( - this, - 'Element', - 'shadowRoot' - ) - - return Object(internals.shadowInit).mode === 'open' - ? internals.shadowRoot - : null - } - - get localName(): string { - return _.internalsOf(this, 'Element', 'localName') - .localName as string - } - - get nodeName(): string { - return ( - _.internalsOf(this, 'Element', 'nodeName') - .localName as string - ).toUpperCase() - } - - get tagName(): string { - return ( - _.internalsOf(this, 'Element', 'tagName') - .localName as string - ).toUpperCase() - } -} - -export class HTMLElement extends Element {} - -export class HTMLBodyElement extends HTMLElement {} - -export class HTMLDivElement extends HTMLElement {} - -export class HTMLHeadElement extends HTMLElement {} - -export class HTMLHtmlElement extends HTMLElement {} - -export class HTMLSpanElement extends HTMLElement {} - -export class HTMLStyleElement extends HTMLElement {} - -export class HTMLTemplateElement extends HTMLElement {} - -export class HTMLUnknownElement extends HTMLElement {} - -_.allowStringTag(Element) -_.allowStringTag(HTMLElement) -_.allowStringTag(HTMLBodyElement) -_.allowStringTag(HTMLDivElement) -_.allowStringTag(HTMLHeadElement) -_.allowStringTag(HTMLHtmlElement) -_.allowStringTag(HTMLSpanElement) -_.allowStringTag(HTMLStyleElement) -_.allowStringTag(HTMLTemplateElement) -_.allowStringTag(HTMLUnknownElement) - -export interface ElementInternals { - attributes: { [name: string]: string } - localName?: string - shadowRoot: ShadowRoot | null - shadowInit: ShadowRootInit | void -} - -export interface ShadowRootInit { - mode: 'open' | 'closed' - delegatesFocus: boolean -} diff --git a/packages/webapi/src/lib/HTMLCanvasElement.ts b/packages/webapi/src/lib/HTMLCanvasElement.ts deleted file mode 100644 index a38471498..000000000 --- a/packages/webapi/src/lib/HTMLCanvasElement.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { CanvasRenderingContext2D } from './CanvasRenderingContext2D' - -import { __createCanvasRenderingContext2D } from './CanvasRenderingContext2D' -import * as _ from './utils' - -export class HTMLCanvasElement extends HTMLElement { - get height(): number { - return _.internalsOf(this, 'HTMLCanvasElement', 'height').height - } - - set height(value) { - _.internalsOf(this, 'HTMLCanvasElement', 'height').height = - Number(value) || 0 - } - - get width(): number { - return _.internalsOf(this, 'HTMLCanvasElement', 'width').width - } - - set width(value) { - _.internalsOf(this, 'HTMLCanvasElement', 'width').width = Number(value) || 0 - } - - captureStream(): null { - return null - } - - getContext( - contextType: PredefinedContextId - ): CanvasRenderingContext2D | null { - const internals = _.internalsOf( - this, - 'HTMLCanvasElement', - 'getContext' - ) - - switch (contextType) { - case '2d': - if (internals.renderingContext2D) return internals.renderingContext2D - - internals.renderingContext2D = __createCanvasRenderingContext2D(this) - - return internals.renderingContext2D - default: - return null - } - } - - toBlob() {} - - toDataURL() {} - - transferControlToOffscreen() {} -} - -_.allowStringTag(HTMLCanvasElement) - -interface HTMLCanvasElementInternals { - width: number - height: number - renderingContext2D: CanvasRenderingContext2D -} - -type PredefinedContextId = - | '2d' - | 'bitmaprenderer' - | 'webgl' - | 'webgl2' - | 'webgpu' diff --git a/packages/webapi/src/lib/HTMLImageElement.ts b/packages/webapi/src/lib/HTMLImageElement.ts deleted file mode 100644 index fd9e5f605..000000000 --- a/packages/webapi/src/lib/HTMLImageElement.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { HTMLElement } from './Element' -import * as _ from './utils' - -export class HTMLImageElement extends HTMLElement { - get src(): string { - return _.internalsOf(this, 'HTMLImageElement', 'src').src - } - - set src(value) { - const internals = _.internalsOf(this, 'HTMLImageElement', 'src') - - internals.src = String(value) - } -} - -_.allowStringTag(HTMLImageElement) diff --git a/packages/webapi/src/lib/IdleCallback.ts b/packages/webapi/src/lib/IdleCallback.ts deleted file mode 100644 index bc73f22f1..000000000 --- a/packages/webapi/src/lib/IdleCallback.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { - clearTimeout as nodeClearTimeout, - setTimeout as nodeSetTimeout, -} from 'node:timers' -import * as _ from './utils.js' - -const INTERNAL = { tick: 0, pool: new Map() } - -export function requestIdleCallback< - TArgs extends any[], - TFunc extends (...args: TArgs) => any ->(callback: TFunc): number { - if (!INTERNAL.pool.size) { - nodeSetTimeout(() => { - const next = _.__performance_now() - - for (const func of INTERNAL.pool.values()) { - func(next) - } - - INTERNAL.pool.clear() - }, 1000 / 16) - } - - const func = _.__function_bind(callback, undefined) - const tick = ++INTERNAL.tick - - INTERNAL.pool.set(tick, func) - - return tick -} - -export function cancelIdleCallback(requestId: number): void { - const timeout = INTERNAL.pool.get(requestId) - - if (timeout) { - nodeClearTimeout(timeout) - - INTERNAL.pool.delete(requestId) - } -} diff --git a/packages/webapi/src/lib/Image.ts b/packages/webapi/src/lib/Image.ts deleted file mode 100644 index c2e0a10fb..000000000 --- a/packages/webapi/src/lib/Image.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { HTMLImageElement } from './HTMLImageElement' -import * as _ from './utils' - -export function Image() { - // @ts-expect-error - _.INTERNALS.set(this, { - attributes: {}, - localName: 'img', - innerHTML: '', - shadowRoot: null, - shadowInit: null, - }) -} - -Image.prototype = HTMLImageElement.prototype diff --git a/packages/webapi/src/lib/ImageData.ts b/packages/webapi/src/lib/ImageData.ts deleted file mode 100644 index 595b5023f..000000000 --- a/packages/webapi/src/lib/ImageData.ts +++ /dev/null @@ -1,111 +0,0 @@ -import * as _ from './utils' - -export class ImageData { - constructor(width: number, height: number) - constructor(width: number, height: number, settings: ImageDataSettings) - constructor(data: Uint8ClampedArray, width: number) - constructor(data: Uint8ClampedArray, width: number, height: number) - constructor( - data: Uint8ClampedArray, - width: number, - height: number, - settings: ImageDataSettings - ) - - constructor( - arg0: number | Uint8ClampedArray, - arg1: number, - ...args: [] | [number] | [ImageDataSettings] | [number, ImageDataSettings] - ) { - if (arguments.length < 2) - throw new TypeError( - `Failed to construct 'ImageData': 2 arguments required.` - ) - - /** Whether Uint8ClampedArray data is provided. */ - const hasData = _.__object_isPrototypeOf(Uint8ClampedArray.prototype, arg0) - - /** Image data, either provided or calculated. */ - const d = hasData - ? (arg0 as Uint8ClampedArray) - : new Uint8ClampedArray( - asNumber(arg0, 'width') * asNumber(arg1, 'height') * 4 - ) - - /** Image width. */ - const w = asNumber(hasData ? arg1 : arg0, 'width') - - /** Image height. */ - const h = d.length / w / 4 - - /** Image color space. */ - const c = String( - Object(hasData ? args[1] : args[0]).colorSpace || 'srgb' - ) as PredefinedColorSpace - - // throw if a provided height does not match the calculated height - if (args.length && asNumber(args[0], 'height') !== h) - throw new DOMException( - 'height is not equal to (4 * width * height)', - 'IndexSizeError' - ) - - // throw if a provided colorspace does not match a known colorspace - if (c !== 'srgb' && c !== 'rec2020' && c !== 'display-p3') - throw new TypeError('colorSpace is not known value') - - Object.defineProperty(this, 'data', { - configurable: true, - enumerable: true, - value: d, - }) - - _.INTERNALS.set(this, { - width: w, - height: h, - colorSpace: c, - } as ImageDataInternals) - } - - get data(): Uint8ClampedArray { - _.internalsOf(this, 'ImageData', 'data') - - return ( - Object.getOwnPropertyDescriptor(this, 'data') as { - value: Uint8ClampedArray - } - ).value - } - - get width(): ImageDataInternals['width'] { - return _.internalsOf(this, 'ImageData', 'width').width - } - - get height(): ImageDataInternals['height'] { - return _.internalsOf(this, 'ImageData', 'height').height - } -} - -_.allowStringTag(ImageData) - -/** Returns a coerced number, optionally throwing if the number is zero-ish. */ -const asNumber = (value: any, axis: string): number => { - value = Number(value) || 0 - - if (value === 0) - throw new TypeError(`The source ${axis} is zero or not a number.`) - - return value -} - -interface ImageDataInternals { - colorSpace: PredefinedColorSpace - height: number - width: number -} - -interface ImageDataSettings { - colorSpace?: PredefinedColorSpace -} - -type PredefinedColorSpace = 'srgb' | 'rec2020' | 'display-p3' diff --git a/packages/webapi/src/lib/MediaQueryList.ts b/packages/webapi/src/lib/MediaQueryList.ts deleted file mode 100644 index cc9137183..000000000 --- a/packages/webapi/src/lib/MediaQueryList.ts +++ /dev/null @@ -1,40 +0,0 @@ -import * as _ from './utils' - -export class MediaQueryList extends EventTarget { - get matches(): boolean { - return _.internalsOf(this, 'MediaQueryList', 'matches').matches - } - - get media(): string { - return _.internalsOf(this, 'MediaQueryList', 'media').media - } -} - -_.allowStringTag(MediaQueryList) - -export const initMediaQueryList = (target: Target, exclude: Set) => { - if (exclude.has('MediaQueryList') || exclude.has('matchMedia')) return - - const EventTarget = target.EventTarget || globalThis.EventTarget - const MediaQueryList = target.MediaQueryList || globalThis.MediaQueryList - - target.matchMedia = function matchMedia(media: string) { - const mql = Object.setPrototypeOf( - new EventTarget(), - MediaQueryList.prototype - ) as MediaQueryList - - _.INTERNALS.set(mql, { - matches: false, - media, - }) - - return mql - } -} - -interface Target extends Record { - matchMedia: { - (media: string): MediaQueryList - } -} diff --git a/packages/webapi/src/lib/Node.ts b/packages/webapi/src/lib/Node.ts deleted file mode 100644 index 464404b34..000000000 --- a/packages/webapi/src/lib/Node.ts +++ /dev/null @@ -1,192 +0,0 @@ -import * as _ from './utils' - -export class Node extends EventTarget { - append(...nodesOrDOMStrings: NodeOrString[]): void { - void nodesOrDOMStrings - } - - appendChild(childNode: Node): Node { - return childNode - } - - after(...nodesOrDOMStrings: NodeOrString[]): void { - void nodesOrDOMStrings - } - - before(...nodesOrDOMStrings: NodeOrString[]): void { - void nodesOrDOMStrings - } - - prepend(...nodesOrDOMStrings: NodeOrString[]): void { - void nodesOrDOMStrings - } - - replaceChild(newChild: Node, oldChild: Node): Node { - void newChild - - return oldChild - } - - removeChild(childNode: Node): Node { - return childNode - } - - get attributes(): object { - return {} - } - - get childNodes(): Node[] { - return [] - } - - get children(): Element[] { - return [] - } - - get ownerDocument(): Node | null { - return null - } - - get nodeValue(): string { - return '' - } - - set nodeValue(value: string) { - void value - } - - get textContent(): string { - return '' - } - - set textContent(value: string) { - void value - } - - get previousElementSibling(): Node | null { - return null - } - - get nextElementSibling(): Node | null { - return null - } - - [Symbol.for('nodejs.util.inspect.custom')]( - depth: number, - options: Record - ) { - return `${this.constructor.name}` - } -} - -export class DocumentFragment extends Node {} - -export class ShadowRoot extends DocumentFragment { - get innerHTML() { - return '' - } - - set innerHTML(value: string) { - void value - } -} - -export const NodeFilter = Object.assign( - { - NodeFilter() { - throw new TypeError('Illegal constructor') - }, - }.NodeFilter, - { - FILTER_ACCEPT: 1, - FILTER_REJECT: 2, - FILTER_SKIP: 3, - SHOW_ALL: 4294967295, - SHOW_ELEMENT: 1, - SHOW_ATTRIBUTE: 2, - SHOW_TEXT: 4, - SHOW_CDATA_SECTION: 8, - SHOW_ENTITY_REFERENCE: 16, - SHOW_ENTITY: 32, - SHOW_PROCESSING_INSTRUCTION: 64, - SHOW_COMMENT: 128, - SHOW_DOCUMENT: 256, - SHOW_DOCUMENT_TYPE: 512, - SHOW_DOCUMENT_FRAGMENT: 1024, - SHOW_NOTATION: 2048, - } -) - -export class NodeIterator { - nextNode(): Node | null { - return null - } - - previousNode(): Node | null { - return null - } - - get filter(): NodeFilter { - const internals = _.internalsOf( - this, - 'NodeIterator', - 'filter' - ) - return internals.filter - } - - get pointerBeforeReferenceNode(): boolean { - const internals = _.internalsOf( - this, - 'NodeIterator', - 'pointerBeforeReferenceNode' - ) - return internals.pointerBeforeReferenceNode - } - - get referenceNode(): Node { - const internals = _.internalsOf( - this, - 'NodeIterator', - 'referenceNode' - ) - return internals.referenceNode - } - - get root(): Node { - const internals = _.internalsOf( - this, - 'NodeIterator', - 'root' - ) - return internals.root - } - - get whatToShow(): number { - const internals = _.internalsOf( - this, - 'NodeIterator', - 'whatToShow' - ) - return internals.whatToShow - } -} - -_.allowStringTag(Node) -_.allowStringTag(NodeIterator) -_.allowStringTag(DocumentFragment) -_.allowStringTag(ShadowRoot) - -type NodeOrString = string | Node - -export interface NodeFilter { - acceptNode(node: Node): number -} - -export interface NodeIteratorInternals { - filter: NodeFilter - pointerBeforeReferenceNode: boolean - referenceNode: Node - root: Node - whatToShow: number -} diff --git a/packages/webapi/src/lib/Observer.ts b/packages/webapi/src/lib/Observer.ts deleted file mode 100644 index 845de1312..000000000 --- a/packages/webapi/src/lib/Observer.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as _ from './utils' - -export class IntersectionObserver { - disconnect() {} - - observe() {} - - takeRecords() { - return [] - } - - unobserve() {} -} - -export class MutationObserver { - disconnect() {} - - observe() {} - - takeRecords() { - return [] - } - - unobserve() {} -} - -export class ResizeObserver { - disconnect() {} - - observe() {} - - takeRecords() { - return [] - } - - unobserve() {} -} - -_.allowStringTag(MutationObserver) -_.allowStringTag(IntersectionObserver) -_.allowStringTag(ResizeObserver) diff --git a/packages/webapi/src/lib/OffscreenCanvas.ts b/packages/webapi/src/lib/OffscreenCanvas.ts deleted file mode 100644 index e799f7210..000000000 --- a/packages/webapi/src/lib/OffscreenCanvas.ts +++ /dev/null @@ -1,102 +0,0 @@ -import type { CanvasRenderingContext2D } from './CanvasRenderingContext2D' - -import { __createCanvasRenderingContext2D } from './CanvasRenderingContext2D' -import * as _ from './utils' - -export class OffscreenCanvas extends EventTarget { - constructor(width: number, height: number) { - super() - - if (arguments.length < 2) - throw new TypeError( - `Failed to construct 'OffscreenCanvas': 2 arguments required.` - ) - - width = Number(width) || 0 - height = Number(height) || 0 - - _.INTERNALS.set(this, { width, height } as OffscreenCanvasInternals) - } - - get height(): number { - return _.internalsOf(this, 'OffscreenCanvas', 'height').height - } - - set height(value) { - _.internalsOf(this, 'OffscreenCanvas', 'height').height = Number(value) || 0 - } - - get width(): number { - return _.internalsOf(this, 'OffscreenCanvas', 'width').width - } - - set width(value) { - _.internalsOf(this, 'OffscreenCanvas', 'width').width = Number(value) || 0 - } - - getContext( - contextType: PredefinedContextId - ): CanvasRenderingContext2D | null { - const internals = _.internalsOf( - this, - 'HTMLCanvasElement', - 'getContext' - ) - - switch (contextType) { - case '2d': - if (internals.renderingContext2D) return internals.renderingContext2D - - internals.renderingContext2D = __createCanvasRenderingContext2D(this) - - return internals.renderingContext2D - default: - return null - } - } - - convertToBlob(options: Partial) { - options = Object(options) - - const quality = Number(options.quality) || 0 - const type = getImageType(String(options.type).trim().toLowerCase()) - - void quality - - return Promise.resolve(new Blob([], { type })) - } -} - -_.allowStringTag(OffscreenCanvas) - -const getImageType = (type: string): PredefinedImageType => - type === 'image/avif' || - type === 'image/jpeg' || - type === 'image/png' || - type === 'image/webp' - ? type - : 'image/png' - -interface OffscreenCanvasInternals { - height: number - renderingContext2D: CanvasRenderingContext2D - width: number -} - -interface ConvertToBlobOptions { - quality: number - type: PredefinedImageType -} - -type PredefinedContextId = - | '2d' - | 'bitmaprenderer' - | 'webgl' - | 'webgl2' - | 'webgpu' - -type PredefinedImageType = - | 'image/avif' - | 'image/jpeg' - | 'image/png' - | 'image/webp' diff --git a/packages/webapi/src/lib/Storage.ts b/packages/webapi/src/lib/Storage.ts deleted file mode 100644 index 7f9426552..000000000 --- a/packages/webapi/src/lib/Storage.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as _ from './utils' - -export class Storage { - clear(): void { - _.internalsOf(this, 'Storage', 'clear').storage.clear() - } - - getItem(key: string): string | null { - return getStringOrNull( - _.internalsOf(this, 'Storage', 'getItem').storage.get( - String(key) - ) - ) - } - - key(index: number): string | null { - return getStringOrNull( - [ - ..._.internalsOf( - this, - 'Storage', - 'key' - ).storage.keys(), - ][Number(index) || 0] - ) - } - - removeItem(key: string): void { - _.internalsOf(this, 'Storage', 'getItem').storage.delete( - String(key) - ) - } - - setItem(key: string, value: any): void { - _.internalsOf(this, 'Storage', 'getItem').storage.set( - String(key), - String(value) - ) - } - - get length() { - return _.internalsOf(this, 'Storage', 'size').storage.size - } -} - -const getStringOrNull = (value: string | void) => - typeof value === 'string' ? value : null - -export const initStorage = (target: Target, exclude: Set) => { - if (exclude.has('Storage') || exclude.has('localStorage')) return - - target.localStorage = Object.create(Storage.prototype) - - const storageInternals = new Map() - - _.INTERNALS.set(target.localStorage, { - storage: storageInternals, - } as StorageInternals) -} - -interface StorageInternals { - storage: Map -} - -interface Target { - localStorage: Storage -} diff --git a/packages/webapi/src/lib/StyleSheet.ts b/packages/webapi/src/lib/StyleSheet.ts deleted file mode 100644 index d4b2d9e33..000000000 --- a/packages/webapi/src/lib/StyleSheet.ts +++ /dev/null @@ -1,24 +0,0 @@ -import * as _ from './utils' - -export class StyleSheet {} - -export class CSSStyleSheet extends StyleSheet { - async replace(text: string) { - void text - - return new CSSStyleSheet() - } - - replaceSync(text: string) { - void text - - return new CSSStyleSheet() - } - - get cssRules() { - return [] - } -} - -_.allowStringTag(StyleSheet) -_.allowStringTag(CSSStyleSheet) diff --git a/packages/webapi/src/lib/Timeout.ts b/packages/webapi/src/lib/Timeout.ts deleted file mode 100644 index 2ad4f153e..000000000 --- a/packages/webapi/src/lib/Timeout.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - clearTimeout as nodeClearTimeout, - setTimeout as nodeSetTimeout, -} from 'node:timers' -import * as _ from './utils.js' - -const INTERNAL = { tick: 0, pool: new Map() } - -export function setTimeout< - TArgs extends any[], - TFunc extends (...args: TArgs) => any ->(callback: TFunc, delay = 0, ...args: TArgs): number { - const func = _.__function_bind(callback, globalThis) - const tick = ++INTERNAL.tick - const timeout = nodeSetTimeout(func as any, delay, ...args) - - INTERNAL.pool.set(tick, timeout) - - return tick -} - -export function clearTimeout(timeoutId: number): void { - const timeout = INTERNAL.pool.get(timeoutId) - - if (timeout) { - nodeClearTimeout(timeout) - - INTERNAL.pool.delete(timeoutId) - } -} diff --git a/packages/webapi/src/lib/TreeWalker.ts b/packages/webapi/src/lib/TreeWalker.ts deleted file mode 100644 index 423397022..000000000 --- a/packages/webapi/src/lib/TreeWalker.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as _ from './utils' - -export class TreeWalker { - parentNode(): Node | null { - return null - } - - firstChild(): Node | null { - return null - } - - lastChild(): Node | null { - return null - } - - previousSibling(): Node | null { - return null - } - - nextSibling(): Node | null { - return null - } - - previousNode(): Node | null { - return null - } - - nextNode(): Node | null { - return null - } - - get currentNode(): Node { - const internals = _.internalsOf( - this, - 'TreeWalker', - 'currentNode' - ) - return internals.currentNode - } - - get root(): Node { - const internals = _.internalsOf( - this, - 'TreeWalker', - 'root' - ) - return internals.root - } - - get whatToShow(): number { - const internals = _.internalsOf( - this, - 'TreeWalker', - 'whatToShow' - ) - return internals.whatToShow - } -} - -_.allowStringTag(TreeWalker) - -export interface TreeWalkerInternals { - filter: NodeFilter - currentNode: Node - root: Node - whatToShow: number -} diff --git a/packages/webapi/src/lib/Window.ts b/packages/webapi/src/lib/Window.ts deleted file mode 100644 index ac3312c93..000000000 --- a/packages/webapi/src/lib/Window.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as _ from './utils' - -export class Window extends EventTarget { - get self(): this { - return this - } - - get top(): this { - return this - } - - get window(): this { - return this - } - - get innerHeight(): number { - return 0 - } - - get innerWidth(): number { - return 0 - } - - get scrollX(): number { - return 0 - } - - get scrollY(): number { - return 0 - } -} - -_.allowStringTag(Window) - -export const initWindow = (target: Target, exclude: Set) => { - if (exclude.has('Window') || exclude.has('window')) return - - target.window = target -} - -export interface WindowInternals { - document: null - location: URL - window: this -} - -interface Target extends Record { - window: this -} diff --git a/packages/webapi/src/lib/structuredClone.ts b/packages/webapi/src/lib/structuredClone.ts deleted file mode 100644 index f51fb529f..000000000 --- a/packages/webapi/src/lib/structuredClone.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { deserialize } from '@ungap/structured-clone/esm/deserialize.js' -import { serialize } from '@ungap/structured-clone/esm/serialize.js' - -export default (any: any, options: any) => deserialize(serialize(any, options)) diff --git a/packages/webapi/src/lib/utils.ts b/packages/webapi/src/lib/utils.ts deleted file mode 100644 index 63a6bba7b..000000000 --- a/packages/webapi/src/lib/utils.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { performance } from 'node:perf_hooks' - -/** Returns the function bound to the given object. */ -export const __function_bind = Function.bind.bind( - Function.call as unknown as any -) as any>( - callback: TFunc, - thisArg: unknown, - ...args: TArgs -) => TFunc - -/** Returns whether the object prototype exists in another object. */ -export const __object_isPrototypeOf = Function.call.bind( - Object.prototype.isPrototypeOf -) as { (p: T1, v: T2): T2 extends T1 ? true : false } - -/** Current high resolution millisecond timestamp. */ -export const __performance_now = performance.now as () => number - -// @ts-expect-error -export const INTERNALS = new WeakMap() - -export const internalsOf = ( - target: T | object, - className: string, - propName: string -): T => { - const internals: T = INTERNALS.get(target) - - if (!internals) - throw new TypeError( - `${className}.${propName} can only be used on instances of ${className}` - ) - - return internals -} - -export const allowStringTag = (value: any) => - (value.prototype[Symbol.toStringTag] = value.name) - -/** Returns any kind of path as a posix path. */ -export const pathToPosix = (pathname: any) => - String(pathname == null ? '' : pathname) - .replace( - // convert slashes - /\\+/g, - '/' - ) - .replace( - // prefix a slash to drive letters - /^(?=[A-Za-z]:\/)/, - '/' - ) - .replace( - // encode path characters - /%/g, - '%25' - ) - .replace(/\n/g, '%0A') - .replace(/\r/g, '%0D') - .replace(/\t/g, '%09') diff --git a/packages/webapi/src/polyfill.ts b/packages/webapi/src/polyfill.ts deleted file mode 100644 index 5fadd5a68..000000000 --- a/packages/webapi/src/polyfill.ts +++ /dev/null @@ -1,325 +0,0 @@ -import { - alert, - ByteLengthQueuingStrategy, - cancelAnimationFrame, - cancelIdleCallback, - CanvasRenderingContext2D, - CharacterData, - clearTimeout, - Comment, - CountQueuingStrategy, - crypto, - CSSStyleSheet, - CustomElementRegistry, - CustomEvent, - Document, - DocumentFragment, - DOMException, - Element, - Event, - EventTarget, - fetch, - File, - FormData, - Headers, - HTMLBodyElement, - HTMLCanvasElement, - HTMLDivElement, - HTMLDocument, - HTMLElement, - HTMLHeadElement, - HTMLHtmlElement, - HTMLImageElement, - HTMLSpanElement, - HTMLStyleElement, - HTMLTemplateElement, - HTMLUnknownElement, - Image, - ImageData, - initCustomElementRegistry, - initDocument, - initMediaQueryList, - initStorage, - initWindow, - IntersectionObserver, - MediaQueryList, - MutationObserver, - Node, - NodeFilter, - NodeIterator, - OffscreenCanvas, - ReadableByteStreamController, - ReadableStream, - ReadableStreamBYOBReader, - ReadableStreamBYOBRequest, - ReadableStreamDefaultController, - ReadableStreamDefaultReader, - Request, - requestAnimationFrame, - requestIdleCallback, - ResizeObserver, - Response, - setTimeout, - ShadowRoot, - Storage, - structuredClone, - StyleSheet, - Text, - TransformStream, - TreeWalker, - URLPattern, - Window, - WritableStream, - WritableStreamDefaultController, - WritableStreamDefaultWriter, -} from './ponyfill' - -import { exclusions } from './exclusions' -import { inheritance } from './inheritance' - -export { pathToPosix } from './lib/utils' -export { - alert, - ByteLengthQueuingStrategy, - cancelAnimationFrame, - cancelIdleCallback, - CanvasRenderingContext2D, - CharacterData, - clearTimeout, - Comment, - CountQueuingStrategy, - crypto, - CSSStyleSheet, - CustomElementRegistry, - CustomEvent, - Document, - DocumentFragment, - DOMException, - Element, - Event, - EventTarget, - fetch, - File, - FormData, - Headers, - HTMLBodyElement, - HTMLCanvasElement, - HTMLDivElement, - HTMLDocument, - HTMLElement, - HTMLHeadElement, - HTMLHtmlElement, - HTMLImageElement, - HTMLSpanElement, - HTMLStyleElement, - HTMLTemplateElement, - HTMLUnknownElement, - Image, - ImageData, - IntersectionObserver, - MediaQueryList, - MutationObserver, - Node, - NodeFilter, - NodeIterator, - OffscreenCanvas, - ReadableByteStreamController, - ReadableStream, - ReadableStreamBYOBReader, - ReadableStreamBYOBRequest, - ReadableStreamDefaultController, - ReadableStreamDefaultReader, - Request, - requestAnimationFrame, - requestIdleCallback, - ResizeObserver, - Response, - setTimeout, - ShadowRoot, - structuredClone, - StyleSheet, - Text, - TransformStream, - TreeWalker, - URLPattern, - Window, - WritableStream, - WritableStreamDefaultController, - WritableStreamDefaultWriter, -} from './ponyfill.js' - -export const polyfill = (target: any, options?: PolyfillOptions) => { - const webAPIs = { - ByteLengthQueuingStrategy, - CanvasRenderingContext2D, - CharacterData, - Comment, - CountQueuingStrategy, - CSSStyleSheet, - CustomElementRegistry, - CustomEvent, - Document, - DocumentFragment, - DOMException, - Element, - Event, - EventTarget, - File, - FormData, - HTMLDocument, - HTMLElement, - HTMLBodyElement, - HTMLCanvasElement, - HTMLDivElement, - HTMLHeadElement, - HTMLHtmlElement, - HTMLImageElement, - HTMLSpanElement, - HTMLStyleElement, - HTMLTemplateElement, - HTMLUnknownElement, - Headers, - IntersectionObserver, - Image, - ImageData, - MediaQueryList, - MutationObserver, - Node, - NodeFilter, - NodeIterator, - OffscreenCanvas, - ReadableByteStreamController, - ReadableStream, - ReadableStreamBYOBReader, - ReadableStreamBYOBRequest, - ReadableStreamDefaultController, - ReadableStreamDefaultReader, - Request, - ResizeObserver, - Response, - ShadowRoot, - Storage, - StyleSheet, - Text, - TransformStream, - TreeWalker, - URLPattern, - WritableStream, - WritableStreamDefaultController, - WritableStreamDefaultWriter, - Window, - - alert, - cancelAnimationFrame, - cancelIdleCallback, - clearTimeout, - crypto, - fetch, - requestAnimationFrame, - requestIdleCallback, - setTimeout, - structuredClone, - } - - // initialize exclude options - const excludeOptions = new Set( - typeof Object(options).exclude === 'string' - ? String(Object(options).exclude).trim().split(/\s+/) - : Array.isArray(Object(options).exclude) - ? Object(options).exclude.reduce( - (array: string[], entry: unknown) => - array.splice( - array.length, - 0, - ...(typeof entry === 'string' ? entry.trim().split(/\s+/) : []) - ) && array, - [] - ) - : [] - ) as Set - - // expand exclude options using exclusion shorthands - for (const excludeOption of excludeOptions) { - if (excludeOption in exclusions) { - for (const exclusion of exclusions[ - excludeOption as keyof typeof exclusions - ]) { - excludeOptions.add(exclusion) - } - } - } - - // apply each WebAPI - for (const name of Object.keys(webAPIs)) { - // skip WebAPIs that are excluded - if (excludeOptions.has(name)) continue - - // skip WebAPIs that are built-in - if (Object.hasOwnProperty.call(target, name)) continue - - // define WebAPIs on the target - Object.defineProperty(target, name, { - configurable: true, - enumerable: true, - writable: true, - value: webAPIs[name as keyof typeof webAPIs], - }) - } - - // ensure WebAPIs correctly inherit other WebAPIs - for (const name of Object.keys(webAPIs)) { - // skip WebAPIs that are excluded - if (excludeOptions.has(name)) continue - - // skip WebAPIs that do not extend other WebAPIs - if (!Object.hasOwnProperty.call(inheritance, name)) continue - - const Class = target[name] - const Super = target[inheritance[name as keyof typeof inheritance]] - - // skip WebAPIs that are not available - if (!Class || !Super) continue - - // skip WebAPIs that are already inherited correctly - if (Object.getPrototypeOf(Class.prototype) === Super.prototype) continue - - // define WebAPIs inheritance - Object.setPrototypeOf(Class.prototype, Super.prototype) - } - - if ( - !excludeOptions.has('HTMLDocument') && - !excludeOptions.has('HTMLElement') - ) { - initDocument(target, excludeOptions) - - if (!excludeOptions.has('CustomElementRegistry')) { - initCustomElementRegistry(target, excludeOptions) - } - } - - initMediaQueryList(target, excludeOptions) - initStorage(target, excludeOptions) - initWindow(target, excludeOptions) - - return target -} - -polyfill.internals = (target: any, name: string) => { - const init = { - CustomElementRegistry: initCustomElementRegistry, - Document: initDocument, - MediaQueryList: initMediaQueryList, - Storage: initStorage, - Window: initWindow, - } - - init[name as keyof typeof init](target, new Set()) - - return target -} - -interface PolyfillOptions { - exclude?: string | string[] - override?: Record -} diff --git a/packages/webapi/src/ponyfill.ts b/packages/webapi/src/ponyfill.ts deleted file mode 100644 index fcad54ebe..000000000 --- a/packages/webapi/src/ponyfill.ts +++ /dev/null @@ -1,148 +0,0 @@ -// @ts-check -import { Event, EventTarget } from 'event-target-shim' // Look into removing when Node 18 is dropped for Node 20 -import { webcrypto as crypto } from 'node:crypto' // Remove when Node 18 is dropped for Node 20 -import { - ByteLengthQueuingStrategy, - CountQueuingStrategy, - ReadableByteStreamController, - ReadableStream, - ReadableStreamBYOBReader, - ReadableStreamBYOBRequest, - ReadableStreamDefaultController, - ReadableStreamDefaultReader, - TransformStream, - WritableStream, - WritableStreamDefaultController, - WritableStreamDefaultWriter, -} from 'node:stream/web' // Remove when Node 16 is dropped for Node 18. -import { File, FormData, Headers, Request, Response, fetch } from 'undici' // Remove when Node 16 is dropped for Node 18. -import { URLPattern } from 'urlpattern-polyfill' -import { - cancelAnimationFrame, - requestAnimationFrame, -} from './lib/AnimationFrame' -import { CharacterData, Comment, Text } from './lib/CharacterData' -import { CustomEvent } from './lib/CustomEvent' // Look into removing when Node 18 is dropped for Node 20 -import { DOMException } from './lib/DOMException' -import { cancelIdleCallback, requestIdleCallback } from './lib/IdleCallback' -import { clearTimeout, setTimeout } from './lib/Timeout' -import { TreeWalker } from './lib/TreeWalker' -import structuredClone from './lib/structuredClone' // Remove when Node 16 is dropped for Node 18. - -import { CanvasRenderingContext2D } from './lib/CanvasRenderingContext2D' -import { - CustomElementRegistry, - initCustomElementRegistry, -} from './lib/CustomElementRegistry' -import { Document, HTMLDocument, initDocument } from './lib/Document' -import { - Element, - HTMLBodyElement, - HTMLDivElement, - HTMLElement, - HTMLHeadElement, - HTMLHtmlElement, - HTMLSpanElement, - HTMLStyleElement, - HTMLTemplateElement, - HTMLUnknownElement, -} from './lib/Element' -import { HTMLCanvasElement } from './lib/HTMLCanvasElement' -import { HTMLImageElement } from './lib/HTMLImageElement' -import { Image } from './lib/Image' -import { ImageData } from './lib/ImageData' -import { MediaQueryList, initMediaQueryList } from './lib/MediaQueryList' -import { - DocumentFragment, - Node, - NodeFilter, - NodeIterator, - ShadowRoot, -} from './lib/Node' -import { - IntersectionObserver, - MutationObserver, - ResizeObserver, -} from './lib/Observer' -import { OffscreenCanvas } from './lib/OffscreenCanvas' -import { Storage, initStorage } from './lib/Storage' -import { CSSStyleSheet, StyleSheet } from './lib/StyleSheet' -import { Window, initWindow } from './lib/Window' - -import { alert } from './lib/Alert' - -export { - ByteLengthQueuingStrategy, - CSSStyleSheet, - CanvasRenderingContext2D, - CharacterData, - Comment, - CountQueuingStrategy, - CustomElementRegistry, - CustomEvent, - DOMException, - Document, - DocumentFragment, - Element, - Event, - EventTarget, - File, - FormData, - HTMLBodyElement, - HTMLCanvasElement, - HTMLDivElement, - HTMLDocument, - HTMLElement, - HTMLHeadElement, - HTMLHtmlElement, - HTMLImageElement, - HTMLSpanElement, - HTMLStyleElement, - HTMLTemplateElement, - HTMLUnknownElement, - Headers, - Image, - ImageData, - IntersectionObserver, - MediaQueryList, - MutationObserver, - Node, - NodeFilter, - NodeIterator, - OffscreenCanvas, - ReadableByteStreamController, - ReadableStream, - ReadableStreamBYOBReader, - ReadableStreamBYOBRequest, - ReadableStreamDefaultController, - ReadableStreamDefaultReader, - Request, - ResizeObserver, - Response, - ShadowRoot, - Storage, - StyleSheet, - Text, - TransformStream, - TreeWalker, - URLPattern, - Window, - WritableStream, - WritableStreamDefaultController, - WritableStreamDefaultWriter, - alert, - cancelAnimationFrame, - cancelIdleCallback, - clearTimeout, - crypto, - fetch, - initCustomElementRegistry, - initDocument, - initMediaQueryList, - initStorage, - initWindow, - requestAnimationFrame, - requestIdleCallback, - setTimeout, - structuredClone, -} diff --git a/packages/webapi/src/types.d.ts b/packages/webapi/src/types.d.ts deleted file mode 100644 index 3592b7d5a..000000000 --- a/packages/webapi/src/types.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'node:*' -declare module '@ungap/structured-clone/esm/index.js' -declare module '@ungap/structured-clone/esm/deserialize.js' -declare module '@ungap/structured-clone/esm/serialize.js' diff --git a/packages/webapi/test/basic.js b/packages/webapi/test/basic.js deleted file mode 100644 index 9eb5864d5..000000000 --- a/packages/webapi/test/basic.js +++ /dev/null @@ -1,87 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('Basic', () => { - before(() => polyfill(globalThis)) - - it('Globals exist', () => { - const webAPIs = [ - 'ByteLengthQueuingStrategy', - 'CSSStyleSheet', - 'CountQueuingStrategy', - 'CustomElementRegistry', - 'CustomEvent', - 'DOMException', - 'Document', - 'DocumentFragment', - 'Element', - 'Event', - 'EventTarget', - 'File', - 'FormData', - 'HTMLDocument', - 'HTMLElement', - 'HTMLDivElement', - 'HTMLHeadElement', - 'HTMLHtmlElement', - 'HTMLImageElement', - 'HTMLStyleElement', - 'HTMLTemplateElement', - 'HTMLUnknownElement', - 'Headers', - 'IntersectionObserver', - 'Image', - 'MediaQueryList', - 'MutationObserver', - 'Node', - 'ReadableByteStreamController', - 'ReadableStream', - 'ReadableStreamBYOBReader', - 'ReadableStreamBYOBRequest', - 'ReadableStreamDefaultController', - 'ReadableStreamDefaultReader', - 'Request', - 'Response', - 'ShadowRoot', - 'StyleSheet', - 'TransformStream', - 'WritableStream', - 'WritableStreamDefaultController', - 'WritableStreamDefaultWriter', - 'Window', - 'cancelAnimationFrame', - 'cancelIdleCallback', - 'clearTimeout', - 'fetch', - 'requestAnimationFrame', - 'requestIdleCallback', - 'setTimeout', - ] - - for (const name of webAPIs) { - expect(globalThis[name]).to.be.a('function') - } - }) - - it('Classes extend as expected', () => { - expect(HTMLElement.prototype).to.be.an.instanceof(Element) - expect(Element.prototype).to.be.an.instanceof(Node) - expect(Node.prototype).to.be.an.instanceof(EventTarget) - }) - - it('DOM Methods have no effect', () => { - const element = document.createElement('div') - - expect(element.innerHTML).to.be.empty - element.innerHTML = 'frozen' - expect(element.innerHTML).to.be.empty - - expect(element.textContent).to.be.empty - element.textContent = 'frozen' - expect(element.textContent).to.be.empty - }) - - it('globalThis.window === globalThis', () => { - expect(globalThis.window).to.equal(globalThis) - }) -}) diff --git a/packages/webapi/test/characterdata.js b/packages/webapi/test/characterdata.js deleted file mode 100644 index b9973db9f..000000000 --- a/packages/webapi/test/characterdata.js +++ /dev/null @@ -1,42 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('CharacterData', () => { - const target = {} - - before(() => polyfill(target)) - - it('Includes CharacterData functionality', () => { - expect(target).to.have.property('CharacterData') - expect(target).to.have.property('Text') - expect(target).to.have.property('Comment') - }) - - it('Supports new Comment', () => { - expect(() => { - new target.Comment() - }).not.to.throw() - - expect(new target.Comment().constructor.name).to.equal('Comment') - expect(Object.prototype.toString.call(new target.Comment())).to.equal( - '[object Comment]' - ) - - expect(new target.Comment('hello').data).to.equal('hello') - expect(new target.Comment('hello').textContent).to.equal('hello') - }) - - it('Supports new Text', () => { - expect(() => { - new target.Text() - }).not.to.throw() - - expect(new target.Text().constructor.name).to.equal('Text') - expect(Object.prototype.toString.call(new target.Text())).to.equals( - '[object Text]' - ) - - expect(new target.Text('hello').data).to.equal('hello') - expect(new target.Text('hello').textContent).to.equal('hello') - }) -}) diff --git a/packages/webapi/test/elements.js b/packages/webapi/test/elements.js deleted file mode 100644 index f758559a5..000000000 --- a/packages/webapi/test/elements.js +++ /dev/null @@ -1,70 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('Custom Elements', () => { - const target = {} - - beforeEach(() => polyfill(target)) - - it('Includes Custom Element functionality', () => { - expect(target).to.have.property('CustomElementRegistry') - expect(target).to.have.property('customElements') - expect(target).to.have.property('HTMLElement') - }) - - it('Supports Custom Element creation', () => { - const CustomElement = class HTMLCustomElement extends target.HTMLElement {} - - target.customElements.define('custom-element', CustomElement) - - expect(target.customElements.get('custom-element')).to.equal(CustomElement) - expect(target.customElements.getName(CustomElement)).to.equal( - 'custom-element' - ) - }) - - it('Supports Custom Elements created from Document', () => { - expect(target.document.body.localName).to.equal('body') - expect(target.document.body.tagName).to.equal('BODY') - - expect( - target.document.createElement('custom-element').constructor.name - ).to.equal('HTMLUnknownElement') - - const CustomElement = class HTMLCustomElement extends target.HTMLElement {} - - target.customElements.define('custom-element', CustomElement) - - expect( - target.document.createElement('custom-element').constructor.name - ).to.equal('HTMLCustomElement') - }) - - it('Supports Custom Elements with properties', () => { - const testSymbol = Symbol.for('webapi.test') - - const CustomElement = class HTMLCustomElement extends target.HTMLElement { - otherMethod = () => testSymbol - - method() { - return this.otherMethod() - } - - static method() { - return this.otherMethod() - } - - static otherMethod() { - return testSymbol - } - } - - target.customElements.define('custom-element', CustomElement) - - expect(CustomElement.method()).to.equal(testSymbol) - - const customElement = new CustomElement() - - expect(customElement.method()).to.equal(testSymbol) - }) -}) diff --git a/packages/webapi/test/fetch.js b/packages/webapi/test/fetch.js deleted file mode 100644 index ce0a2e700..000000000 --- a/packages/webapi/test/fetch.js +++ /dev/null @@ -1,40 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('Fetch', () => { - const target = {} - - before(() => polyfill(target)) - - it('Fetch functionality', () => { - expect(target).to.have.property('fetch').that.is.a('function') - }) - - it('Fetch with https', async () => { - const { fetch } = target - - const response = await fetch('https://astro.build') - - expect(response.constructor).to.equal(target.Response) - - const html = await response.text() - - expect(html).to.include(' { - const { fetch } = target - - const jsonURI = `data:application/json,${encodeURIComponent( - JSON.stringify({ - name: '@astrojs/webapi', - }) - )}` - - const response = await fetch(jsonURI) - - const json = await response.json() - - expect(json.name).to.equal('@astrojs/webapi') - }) -}) diff --git a/packages/webapi/test/imagedata.js b/packages/webapi/test/imagedata.js deleted file mode 100644 index b386a18d6..000000000 --- a/packages/webapi/test/imagedata.js +++ /dev/null @@ -1,54 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('ImageData', () => { - const target = {} - - before(() => polyfill(target)) - - it('Supports ImageData', () => { - expect(target).to.have.property('ImageData').that.is.a('function') - }) - - it('Supports new (data: Uint8ClampedArray, width: number, height: number): ImageData', () => { - const w = 640 - const h = 480 - const d = new Uint8ClampedArray(w * h * 4) - - const id = new target.ImageData(d, w, h) - - expect(id.data).to.equal(d) - expect(id.width).to.equal(w) - expect(id.height).to.equal(h) - }) - - it('Supports new (data: Uint8ClampedArray, width: number): ImageData', () => { - const w = 640 - const h = 480 - const d = new Uint8ClampedArray(w * h * 4) - - const id = new target.ImageData(d, w) - - expect(id.data).to.equal(d) - expect(id.width).to.equal(w) - expect(id.height).to.equal(h) - }) - - it('Supports new (width: number, height: number): ImageData', () => { - const w = 640 - const h = 480 - - const id = new target.ImageData(w, h) - - expect(id.data).to.have.lengthOf(w * h * 4) - expect(id.width).to.equal(w) - expect(id.height).to.equal(h) - }) - - it('Supports Object.keys(new ImageData(640, 480))', () => { - const keys = Object.keys(new target.ImageData(640, 480)) - - expect(keys).to.have.lengthOf(1) - expect(keys[0]).to.equal('data') - }) -}) diff --git a/packages/webapi/test/internals.js b/packages/webapi/test/internals.js deleted file mode 100644 index 054b7e488..000000000 --- a/packages/webapi/test/internals.js +++ /dev/null @@ -1,26 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -it('Includes polyfill.internals functionality', () => { - const target = {} - - polyfill(target, { exclude: 'window document' }) - - const pseudo = { ...target } - - expect(pseudo).to.not.have.property('document') - - const CustomElement = class extends pseudo.HTMLElement {} - - pseudo.customElements.define('custom-element', CustomElement) - - polyfill.internals(pseudo, 'Document') - - expect(pseudo).to.have.property('document') - - expect( - CustomElement.prototype.isPrototypeOf( - pseudo.document.createElement('custom-element') - ) - ).to.equal(true) -}) diff --git a/packages/webapi/test/media.js b/packages/webapi/test/media.js deleted file mode 100644 index e6e7b82d4..000000000 --- a/packages/webapi/test/media.js +++ /dev/null @@ -1,20 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('Media', () => { - const target = {} - - before(() => polyfill(target)) - - it('Includes MediaQueryList functionality', () => { - expect(target).to.have.property('MediaQueryList') - expect(target).to.have.property('matchMedia') - }) - - it('Supports matchMedia creation', () => { - const mql = target.matchMedia('(min-width: 640px)') - - expect(mql.matches).to.equal(false) - expect(mql.media).to.equal('(min-width: 640px)') - }) -}) diff --git a/packages/webapi/test/offscreencanvas.js b/packages/webapi/test/offscreencanvas.js deleted file mode 100644 index 6223e78e8..000000000 --- a/packages/webapi/test/offscreencanvas.js +++ /dev/null @@ -1,39 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('OffscreenCanvas', () => { - const target = {} - - before(() => polyfill(target)) - - it('Supports OffscreenCanvas', () => { - expect(target).to.have.property('OffscreenCanvas').that.is.a('function') - }) - - it('Supports new (width: number, height: number): OffscreenCanvas', () => { - const w = 640 - const h = 480 - - const canvas = new target.OffscreenCanvas(w, h) - - expect(canvas.width).to.equal(w) - expect(canvas.height).to.equal(h) - }) - - it('Supports OffscreenCanvas#getContext', () => { - const w = 640 - const h = 480 - - const canvas = new target.OffscreenCanvas(w, h) - - const context = canvas.getContext('2d') - - expect(context.canvas).to.equal(canvas) - - const imageData = context.createImageData(w, h) - - expect(imageData.width).to.equal(w) - expect(imageData.height).to.equal(h) - expect(imageData.data).to.have.lengthOf(w * h * 4) - }) -}) diff --git a/packages/webapi/test/options.js b/packages/webapi/test/options.js deleted file mode 100644 index 0db1cbfe3..000000000 --- a/packages/webapi/test/options.js +++ /dev/null @@ -1,44 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('Options', () => { - it('Can exclude HTMLElement+', () => { - const target = {} - - polyfill(target, { - exclude: 'HTMLElement+', - }) - - expect(target).to.have.property('Event') - expect(target).to.have.property('EventTarget') - expect(target).to.have.property('Element') - expect(target).to.not.have.property('HTMLElement') - expect(target).to.not.have.property('HTMLDivElement') - }) - - it('Can exclude Event+', () => { - const target = {} - - polyfill(target, { - exclude: 'Event+', - }) - - expect(target).to.not.have.property('Event') - expect(target).to.not.have.property('EventTarget') - expect(target).to.not.have.property('Element') - expect(target).to.not.have.property('HTMLElement') - expect(target).to.not.have.property('HTMLDivElement') - }) - - it('Can exclude document', () => { - const target = {} - - polyfill(target, { - exclude: 'document', - }) - - expect(target).to.have.property('Document') - expect(target).to.have.property('HTMLDocument') - expect(target).to.not.have.property('document') - }) -}) diff --git a/packages/webapi/test/storage.js b/packages/webapi/test/storage.js deleted file mode 100644 index 9a185644a..000000000 --- a/packages/webapi/test/storage.js +++ /dev/null @@ -1,32 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('Storage', () => { - const target = {} - - before(() => polyfill(target)) - - it('Includes Storage functionality', () => { - expect(target).to.have.property('Storage').that.is.a('function') - expect(target).to.have.property('localStorage').that.is.an('object') - }) - - it('Supports Storage methods', () => { - expect(target.localStorage.setItem('hello', 'world')).to.equal(undefined) - expect(target.localStorage.getItem('hello')).to.equal('world') - expect(target.localStorage.key(0)).to.equal('hello') - expect(target.localStorage.key(1)).to.equal(null) - expect(target.localStorage.length).to.equal(1) - expect(target.localStorage.setItem('world', 'hello')).to.equal(undefined) - expect(target.localStorage.key(1)).to.equal('world') - expect(target.localStorage.key(2)).to.equal(null) - expect(target.localStorage.length).to.equal(2) - expect(target.localStorage.removeItem('hello')).to.equal(undefined) - expect(target.localStorage.key(0)).to.equal('world') - expect(target.localStorage.key(1)).to.equal(null) - expect(target.localStorage.length).to.equal(1) - expect(target.localStorage.clear()).to.equal(undefined) - expect(target.localStorage.key(0)).to.equal(null) - expect(target.localStorage.length).to.equal(0) - }) -}) diff --git a/packages/webapi/test/structuredclone.js b/packages/webapi/test/structuredclone.js deleted file mode 100644 index 0503cf904..000000000 --- a/packages/webapi/test/structuredclone.js +++ /dev/null @@ -1,28 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('structuredClone', () => { - const target = {} - - before(() => polyfill(target)) - - it('Includes structuredClone', () => { - expect(target).to.have.property('structuredClone').that.is.a('function') - }) - - it('Supports structuredClone usage', () => { - const obj = { - foo: 'bar', - baz: { - qux: 'quux', - }, - } - - const clone = target.structuredClone(obj) - - expect(obj).to.not.equal(clone) - expect(obj.baz).to.not.equal(clone.baz) - - expect(obj.baz.qux).to.equal(clone.baz.qux) - }) -}) diff --git a/packages/webapi/test/urlpattern.js b/packages/webapi/test/urlpattern.js deleted file mode 100644 index b9ef6b31f..000000000 --- a/packages/webapi/test/urlpattern.js +++ /dev/null @@ -1,19 +0,0 @@ -import { expect } from 'chai' -import { polyfill } from '../mod.js' - -describe('URLPattern', () => { - const target = {} - - before(() => polyfill(target)) - - it('Includes URLPattern', () => { - expect(target).to.have.property('URLPattern').that.is.a('function') - }) - - it('Supports URLPattern usage', () => { - const pattern = new target.URLPattern({ pathname: '/hello/:name' }) - const match = pattern.exec('https://example.com/hello/Deno') - - expect(match.pathname.groups).to.deep.equal({ name: 'Deno' }) - }) -}) diff --git a/packages/webapi/tsconfig.json b/packages/webapi/tsconfig.json deleted file mode 100644 index 2d7e33d82..000000000 --- a/packages/webapi/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "include": ["src/*"], - "exclude": ["node_modules"], - "compilerOptions": { - "target": "ES2021", - "module": "ES2022", - "moduleResolution": "node", - "esModuleInterop": true, - "declaration": true, - "declarationDir": ".", - "strict": true, - "sourceMap": true, - "declarationMap": true - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 15bc70591..47c2d5ca5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,13 +14,13 @@ importers: .: dependencies: - '@astrojs/webapi': - specifier: workspace:* - version: link:packages/webapi astro-benchmark: specifier: workspace:* version: link:benchmark devDependencies: + '@astrojs/check': + specifier: ^0.1.0 + version: 0.1.0(prettier-plugin-astro@0.11.0)(prettier@3.0.1)(typescript@5.1.6) '@changesets/changelog-github': specifier: ^0.4.8 version: 0.4.8 @@ -32,13 +32,13 @@ importers: version: 18.16.18 '@typescript-eslint/eslint-plugin': specifier: 6.0.0 - version: 6.0.0(@typescript-eslint/parser@6.0.0)(eslint@8.43.0)(typescript@5.0.2) + version: 6.0.0(@typescript-eslint/parser@6.0.0)(eslint@8.43.0)(typescript@5.1.6) '@typescript-eslint/parser': specifier: 6.0.0 - version: 6.0.0(eslint@8.43.0)(typescript@5.0.2) + version: 6.0.0(eslint@8.43.0)(typescript@5.1.6) esbuild: - specifier: ^0.17.19 - version: 0.17.19 + specifier: ^0.18.16 + version: 0.18.16 eslint: specifier: ^8.43.0 version: 8.43.0 @@ -50,7 +50,7 @@ importers: version: 2.6.0 eslint-plugin-prettier: specifier: ^4.2.1 - version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.8) + version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.0.1) only-allow: specifier: ^1.1.1 version: 1.1.1 @@ -58,11 +58,11 @@ importers: specifier: ^0.10.0 version: 0.10.0 prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: ^3.0.1 + version: 3.0.1 prettier-plugin-astro: - specifier: ^0.10.0 - version: 0.10.0 + specifier: ^0.11.0 + version: 0.11.0 tiny-glob: specifier: ^0.2.9 version: 0.2.9 @@ -70,8 +70,8 @@ importers: specifier: ^1.10.3 version: 1.10.3 typescript: - specifier: ~5.0.2 - version: 5.0.2 + specifier: ~5.1.6 + version: 5.1.6 benchmark: dependencies: @@ -108,9 +108,6 @@ importers: benchmark/packages/timer: dependencies: - '@astrojs/webapi': - specifier: workspace:* - version: link:../../../packages/webapi server-destroy: specifier: ^1.0.1 version: 1.0.1 @@ -128,44 +125,44 @@ importers: examples/basics: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/blog: dependencies: '@astrojs/mdx': - specifier: ^0.19.7 + specifier: ^1.0.0-beta.0 version: link:../../packages/integrations/mdx '@astrojs/rss': - specifier: ^2.4.4 + specifier: ^3.0.0-beta.0 version: link:../../packages/astro-rss '@astrojs/sitemap': - specifier: ^2.0.2 + specifier: ^3.0.0-beta.0 version: link:../../packages/integrations/sitemap astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/deno: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro devDependencies: '@astrojs/deno': - specifier: ^4.3.0 + specifier: ^5.0.0-beta.0 version: link:../../packages/integrations/deno examples/framework-alpine: dependencies: '@astrojs/alpinejs': - specifier: ^0.2.2 + specifier: ^0.3.0-beta.0 version: link:../../packages/integrations/alpinejs '@types/alpinejs': specifier: ^3.7.1 @@ -174,19 +171,19 @@ importers: specifier: ^3.12.2 version: 3.12.2 astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/framework-lit: dependencies: '@astrojs/lit': - specifier: ^2.1.1 + specifier: ^3.0.0-beta.0 version: link:../../packages/integrations/lit '@webcomponents/template-shadowroot': specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro lit: specifier: ^2.7.5 @@ -195,22 +192,22 @@ importers: examples/framework-multiple: dependencies: '@astrojs/preact': - specifier: ^2.2.2 + specifier: ^3.0.0-beta.1 version: link:../../packages/integrations/preact '@astrojs/react': - specifier: ^2.2.2 + specifier: ^3.0.0-beta.2 version: link:../../packages/integrations/react '@astrojs/solid-js': - specifier: ^2.2.0 + specifier: ^3.0.0-beta.1 version: link:../../packages/integrations/solid '@astrojs/svelte': - specifier: ^3.1.0 + specifier: ^4.0.0-beta.0 version: link:../../packages/integrations/svelte '@astrojs/vue': - specifier: ^2.2.1 + specifier: ^3.0.0-beta.0 version: link:../../packages/integrations/vue astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro preact: specifier: ^10.15.1 @@ -234,13 +231,13 @@ importers: examples/framework-preact: dependencies: '@astrojs/preact': - specifier: ^2.2.2 + specifier: ^3.0.0-beta.1 version: link:../../packages/integrations/preact '@preact/signals': specifier: ^1.1.3 version: 1.1.3(preact@10.15.1) astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro preact: specifier: ^10.15.1 @@ -249,7 +246,7 @@ importers: examples/framework-react: dependencies: '@astrojs/react': - specifier: ^2.2.2 + specifier: ^3.0.0-beta.2 version: link:../../packages/integrations/react '@types/react': specifier: ^18.2.13 @@ -258,7 +255,7 @@ importers: specifier: ^18.2.6 version: 18.2.6 astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -270,10 +267,10 @@ importers: examples/framework-solid: dependencies: '@astrojs/solid-js': - specifier: ^2.2.0 + specifier: ^3.0.0-beta.1 version: link:../../packages/integrations/solid astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro solid-js: specifier: ^1.7.6 @@ -282,10 +279,10 @@ importers: examples/framework-svelte: dependencies: '@astrojs/svelte': - specifier: ^3.1.0 + specifier: ^4.0.0-beta.0 version: link:../../packages/integrations/svelte astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro svelte: specifier: ^3.59.1 @@ -294,10 +291,10 @@ importers: examples/framework-vue: dependencies: '@astrojs/vue': - specifier: ^2.2.1 + specifier: ^3.0.0-beta.0 version: link:../../packages/integrations/vue astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro vue: specifier: ^3.3.4 @@ -306,25 +303,25 @@ importers: examples/hackernews: dependencies: '@astrojs/node': - specifier: ^5.3.4 + specifier: ^6.0.0-beta.0 version: link:../../packages/integrations/node astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/middleware: dependencies: '@astrojs/node': - specifier: ^5.3.4 + specifier: ^6.0.0-beta.0 version: link:../../packages/integrations/node astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -333,31 +330,31 @@ importers: examples/minimal: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/ssr: dependencies: '@astrojs/node': - specifier: ^5.3.4 + specifier: ^6.0.0-beta.0 version: link:../../packages/integrations/node '@astrojs/svelte': - specifier: ^3.1.0 + specifier: ^4.0.0-beta.0 version: link:../../packages/integrations/svelte astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro svelte: specifier: ^3.59.1 @@ -366,19 +363,19 @@ importers: examples/with-markdoc: dependencies: '@astrojs/markdoc': - specifier: ^0.4.4 + specifier: ^1.0.0-beta.1 version: link:../../packages/integrations/markdoc astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/with-markdown-plugins: dependencies: '@astrojs/markdown-remark': - specifier: ^2.2.1 + specifier: ^3.0.0-beta.0 version: link:../../packages/markdown/remark astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro hast-util-select: specifier: ^5.0.5 @@ -399,19 +396,19 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro examples/with-mdx: dependencies: '@astrojs/mdx': - specifier: ^0.19.7 + specifier: ^1.0.0-beta.0 version: link:../../packages/integrations/mdx '@astrojs/preact': - specifier: ^2.2.2 + specifier: ^3.0.0-beta.1 version: link:../../packages/integrations/preact astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro preact: specifier: ^10.15.1 @@ -420,13 +417,13 @@ importers: examples/with-nanostores: dependencies: '@astrojs/preact': - specifier: ^2.2.2 + specifier: ^3.0.0-beta.1 version: link:../../packages/integrations/preact '@nanostores/preact': specifier: ^0.4.1 version: 0.4.1(nanostores@0.8.1)(preact@10.15.1) astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro nanostores: specifier: ^0.8.1 @@ -437,14 +434,17 @@ importers: examples/with-tailwindcss: dependencies: + '@astrojs/mdx': + specifier: ^1.0.0-beta.0 + version: link:../../packages/integrations/mdx '@astrojs/tailwind': - specifier: ^4.0.0 + specifier: ^5.0.0-beta.0 version: link:../../packages/integrations/tailwind '@types/canvas-confetti': specifier: ^1.6.0 version: 1.6.0 astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro autoprefixer: specifier: ^10.4.14 @@ -462,7 +462,7 @@ importers: examples/with-vite-plugin-pwa: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro vite-plugin-pwa: specifier: 0.14.7 @@ -474,7 +474,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^2.10.9 + specifier: ^3.0.0-beta.2 version: link:../../packages/astro vitest: specifier: ^0.31.4 @@ -483,23 +483,17 @@ importers: packages/astro: dependencies: '@astrojs/compiler': - specifier: ^1.8.0 - version: 1.8.0 + specifier: ^1.8.1 + version: 1.8.1 '@astrojs/internal-helpers': - specifier: ^0.1.2 + specifier: workspace:* version: link:../internal-helpers - '@astrojs/language-server': - specifier: ^1.0.0 - version: 1.0.0 '@astrojs/markdown-remark': - specifier: ^2.2.1 + specifier: workspace:* version: link:../markdown/remark '@astrojs/telemetry': - specifier: ^2.1.1 + specifier: workspace:* version: link:../telemetry - '@astrojs/webapi': - specifier: ^2.2.0 - version: link:../webapi '@babel/core': specifier: ^7.22.5 version: 7.22.5 @@ -521,12 +515,6 @@ importers: '@types/babel__core': specifier: ^7.20.1 version: 7.20.1 - '@types/dom-view-transitions': - specifier: ^1.0.1 - version: 1.0.1 - '@types/yargs-parser': - specifier: ^21.0.0 - version: 21.0.0 acorn: specifier: ^8.9.0 version: 8.9.0 @@ -548,6 +536,9 @@ importers: debug: specifier: ^4.3.4 version: 4.3.4 + deepmerge-ts: + specifier: ^4.3.0 + version: 4.3.0 devalue: specifier: ^4.3.2 version: 4.3.2 @@ -558,11 +549,11 @@ importers: specifier: ^1.3.0 version: 1.3.0 esbuild: - specifier: ^0.17.19 - version: 0.17.19 + specifier: ^0.18.16 + version: 0.18.16 estree-walker: - specifier: 3.0.0 - version: 3.0.0 + specifier: ^3.0.3 + version: 3.0.3 execa: specifier: ^6.1.0 version: 6.1.0 @@ -593,9 +584,6 @@ importers: mime: specifier: ^3.0.0 version: 3.0.0 - network-information-types: - specifier: ^0.1.1 - version: 0.1.1(typescript@5.0.2) ora: specifier: ^6.3.1 version: 6.3.1 @@ -620,6 +608,9 @@ importers: server-destroy: specifier: ^1.0.1 version: 1.0.1 + sharp: + specifier: ^0.32.1 + version: 0.32.1 shiki: specifier: ^0.14.1 version: 0.14.1 @@ -632,9 +623,6 @@ importers: tsconfig-resolver: specifier: ^3.0.1 version: 3.0.1 - typescript: - specifier: '*' - version: 5.0.2 unist-util-visit: specifier: ^4.1.2 version: 4.1.2 @@ -657,6 +645,9 @@ importers: specifier: ^3.20.6 version: 3.20.6 devDependencies: + '@astrojs/check': + specifier: ^0.1.0 + version: 0.1.0(prettier-plugin-astro@0.11.0)(prettier@3.0.1)(typescript@5.1.6) '@playwright/test': specifier: ^1.29.2 version: 1.29.2 @@ -684,6 +675,9 @@ importers: '@types/diff': specifier: ^5.0.3 version: 5.0.3 + '@types/dom-view-transitions': + specifier: ^1.0.1 + version: 1.0.1 '@types/estree': specifier: ^0.0.51 version: 0.0.51 @@ -711,12 +705,6 @@ importers: '@types/prompts': specifier: ^2.4.4 version: 2.4.4 - '@types/resolve': - specifier: ^1.20.2 - version: 1.20.2 - '@types/rimraf': - specifier: ^3.0.2 - version: 3.0.2 '@types/send': specifier: ^0.17.1 version: 0.17.1 @@ -726,6 +714,9 @@ importers: '@types/unist': specifier: ^2.0.6 version: 2.0.6 + '@types/yargs-parser': + specifier: ^21.0.0 + version: 21.0.0 astro-scripts: specifier: workspace:* version: link:../../scripts @@ -744,6 +735,9 @@ importers: mocha: specifier: ^9.2.2 version: 9.2.2 + network-information-types: + specifier: ^0.1.1 + version: 0.1.1(typescript@5.1.6) node-mocks-http: specifier: ^1.12.2 version: 1.12.2 @@ -765,15 +759,9 @@ importers: sass: specifier: ^1.63.4 version: 1.63.4 - sharp: - specifier: ^0.32.1 - version: 0.32.1 srcset-parse: specifier: ^1.1.0 version: 1.1.0 - undici: - specifier: ^5.22.1 - version: 5.22.1 unified: specifier: ^10.1.2 version: 10.1.2 @@ -2548,17 +2536,6 @@ importers: specifier: workspace:* version: link:../../.. - packages/astro/test/fixtures/custom-elements: - dependencies: - '@test/custom-element-renderer': - specifier: workspace:* - version: link:my-component-lib - astro: - specifier: workspace:* - version: link:../../.. - - packages/astro/test/fixtures/custom-elements/my-component-lib: {} - packages/astro/test/fixtures/data-collections: dependencies: astro: @@ -2775,6 +2752,9 @@ importers: specifier: ^3.3.4 version: 3.3.4 devDependencies: + '@astrojs/mdx': + specifier: workspace:* + version: link:../../../../integrations/mdx '@astrojs/preact': specifier: workspace:* version: link:../../../../integrations/preact @@ -3563,9 +3543,18 @@ importers: '@astrojs/cli-kit': specifier: ^0.2.3 version: 0.2.3 + chai: + specifier: ^4.3.7 + version: 4.3.7 + execa: + specifier: ^6.1.0 + version: 6.1.0 giget: - specifier: ^1.1.2 - version: 1.1.2 + specifier: 1.0.0 + version: 1.0.0 + mocha: + specifier: ^9.2.2 + version: 9.2.2 node-fetch-native: specifier: ^1.2.0 version: 1.2.0 @@ -3582,12 +3571,6 @@ importers: astro-scripts: specifier: workspace:* version: link:../../scripts - chai: - specifier: ^4.3.7 - version: 4.3.7 - mocha: - specifier: ^9.2.2 - version: 9.2.2 strip-ansi: specifier: ^7.1.0 version: 7.1.0 @@ -3609,14 +3592,14 @@ importers: packages/integrations/cloudflare: dependencies: '@astrojs/underscore-redirects': - specifier: ^0.2.0 + specifier: workspace:* version: link:../../underscore-redirects '@cloudflare/workers-types': specifier: ^4.20230518.0 version: 4.20230518.0 esbuild: - specifier: ^0.17.19 - version: 0.17.19 + specifier: ^0.18.16 + version: 0.18.16 tiny-glob: specifier: ^0.2.9 version: 0.2.9 @@ -3764,205 +3747,6 @@ importers: specifier: workspace:* version: link:../../../../../astro - packages/integrations/image: - dependencies: - '@altano/tiny-async-pool': - specifier: ^1.0.2 - version: 1.0.2 - http-cache-semantics: - specifier: ^4.1.1 - version: 4.1.1 - image-size: - specifier: ^1.0.2 - version: 1.0.2 - kleur: - specifier: ^4.1.5 - version: 4.1.5 - magic-string: - specifier: ^0.30.2 - version: 0.30.2 - mime: - specifier: ^3.0.0 - version: 3.0.0 - devDependencies: - '@types/http-cache-semantics': - specifier: ^4.0.1 - version: 4.0.1 - '@types/mime': - specifier: ^2.0.3 - version: 2.0.3 - astro: - specifier: workspace:* - version: link:../../astro - astro-scripts: - specifier: workspace:* - version: link:../../../scripts - chai: - specifier: ^4.3.7 - version: 4.3.7 - cheerio: - specifier: 1.0.0-rc.12 - version: 1.0.0-rc.12 - fast-glob: - specifier: ^3.2.12 - version: 3.2.12 - mocha: - specifier: ^9.2.2 - version: 9.2.2 - rollup-plugin-copy: - specifier: ^3.4.0 - version: 3.4.0 - sharp: - specifier: ^0.32.1 - version: 0.32.1 - srcset-parse: - specifier: ^1.1.0 - version: 1.1.0 - vite: - specifier: ^4.4.6 - version: 4.4.6(@types/node@18.16.18)(sass@1.63.4) - - packages/integrations/image/test/fixtures/assets-prefix: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - astro: - specifier: workspace:* - version: link:../../../../../astro - - packages/integrations/image/test/fixtures/background-color-image: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/basic-image: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/basic-picture: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/get-image-remote: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/no-alt-text-image: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/no-alt-text-picture: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/rotation: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - - packages/integrations/image/test/fixtures/squoosh-service: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - - packages/integrations/image/test/fixtures/with-mdx: - dependencies: - '@astrojs/image': - specifier: workspace:* - version: link:../../.. - '@astrojs/mdx': - specifier: workspace:* - version: link:../../../../mdx - '@astrojs/node': - specifier: workspace:* - version: link:../../../../node - astro: - specifier: workspace:* - version: link:../../../../../astro - sharp: - specifier: ^0.32.1 - version: 0.32.1 - packages/integrations/lit: dependencies: '@lit-labs/ssr': @@ -4003,17 +3787,17 @@ importers: packages/integrations/markdoc: dependencies: '@astrojs/internal-helpers': - specifier: ^0.1.2 + specifier: workspace:* version: link:../../internal-helpers '@astrojs/prism': - specifier: ^2.1.2 + specifier: workspace:* version: link:../../astro-prism '@markdoc/markdoc': specifier: ^0.3.0 version: 0.3.0 esbuild: - specifier: ^0.17.19 - version: 0.17.19 + specifier: ^0.18.16 + version: 0.18.16 github-slugger: specifier: ^2.0.0 version: 2.0.0 @@ -4034,7 +3818,7 @@ importers: version: 3.20.6 devDependencies: '@astrojs/markdown-remark': - specifier: ^2.2.1 + specifier: workspace:* version: link:../../markdown/remark '@types/chai': specifier: ^4.3.5 @@ -4179,10 +3963,10 @@ importers: packages/integrations/mdx: dependencies: '@astrojs/markdown-remark': - specifier: ^2.2.1 + specifier: workspace:* version: link:../../markdown/remark '@astrojs/prism': - specifier: ^2.1.2 + specifier: workspace:* version: link:../../astro-prism '@mdx-js/mdx': specifier: ^2.3.0 @@ -4292,7 +4076,7 @@ importers: version: 10.1.0 remark-shiki-twoslash: specifier: ^3.1.3 - version: 3.1.3(typescript@5.0.2) + version: 3.1.3(typescript@5.1.6) remark-toc: specifier: ^8.0.1 version: 8.0.1 @@ -4432,17 +4216,14 @@ importers: packages/integrations/netlify: dependencies: '@astrojs/underscore-redirects': - specifier: ^0.2.0 + specifier: workspace:* version: link:../../underscore-redirects - '@astrojs/webapi': - specifier: ^2.2.0 - version: link:../../webapi '@netlify/functions': specifier: ^1.6.0 version: 1.6.0 esbuild: - specifier: ^0.15.18 - version: 0.15.18 + specifier: ^0.18.16 + version: 0.18.16 devDependencies: '@netlify/edge-functions': specifier: ^2.0.0 @@ -4475,45 +4256,6 @@ importers: specifier: ^4.4.6 version: 4.4.6(@types/node@14.18.51) - packages/integrations/netlify/test/edge-functions/fixtures/dynimport: - dependencies: - '@astrojs/netlify': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/integrations/netlify/test/edge-functions/fixtures/edge-basic: - dependencies: - '@astrojs/netlify': - specifier: workspace:* - version: link:../../../.. - '@astrojs/react': - specifier: workspace:* - version: link:../../../../../react - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/integrations/netlify/test/edge-functions/fixtures/prerender: - dependencies: - '@astrojs/netlify': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/integrations/netlify/test/edge-functions/fixtures/root-dynamic: - dependencies: - '@astrojs/netlify': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - packages/integrations/netlify/test/hosted/hosted-astro-project: dependencies: '@astrojs/netlify': @@ -4525,9 +4267,6 @@ importers: packages/integrations/node: dependencies: - '@astrojs/webapi': - specifier: ^2.2.0 - version: link:../../webapi send: specifier: ^0.18.0 version: 0.18.0 @@ -4692,18 +4431,21 @@ importers: packages/integrations/preact: dependencies: - '@babel/core': - specifier: ^7.22.5 - version: 7.22.5 '@babel/plugin-transform-react-jsx': specifier: ^7.22.5 version: 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-react-jsx-development': + specifier: ^7.22.5 + version: 7.22.5 + '@preact/preset-vite': + specifier: ^2.5.0 + version: 2.5.0(preact@10.15.1) '@preact/signals': specifier: ^1.1.3 version: 1.1.3(preact@10.15.1) - babel-plugin-module-resolver: - specifier: ^5.0.0 - version: 5.0.0 + babel-plugin-transform-hook-names: + specifier: ^1.0.2 + version: 1.0.2 preact-render-to-string: specifier: ^5.2.6 version: 5.2.6(preact@10.15.1) @@ -4766,12 +4508,12 @@ importers: packages/integrations/react: dependencies: - '@babel/core': - specifier: ^7.22.5 - version: 7.22.5 - '@babel/plugin-transform-react-jsx': - specifier: ^7.22.5 - version: 7.22.5(@babel/core@7.22.5) + '@astrojs/internal-helpers': + specifier: 0.2.0-beta.1 + version: link:../../internal-helpers + '@vitejs/plugin-react': + specifier: ^4.0.3 + version: 4.0.3(vite@4.4.6) ultrahtml: specifier: ^1.2.0 version: 1.2.0 @@ -4882,12 +4624,9 @@ importers: packages/integrations/solid: dependencies: - babel-preset-solid: - specifier: ^1.7.7 - version: 1.7.7 - vitefu: - specifier: ^0.2.4 - version: 0.2.4(vite@4.4.6) + vite-plugin-solid: + specifier: ^2.7.0 + version: 2.7.0(solid-js@1.7.6) devDependencies: astro: specifier: workspace:* @@ -4906,7 +4645,7 @@ importers: version: 2.4.2(svelte@3.59.1)(vite@4.4.6) svelte2tsx: specifier: ^0.6.15 - version: 0.6.15(svelte@3.59.1)(typescript@5.0.2) + version: 0.6.15(svelte@3.59.1)(typescript@5.1.6) devDependencies: astro: specifier: workspace:* @@ -4962,11 +4701,8 @@ importers: packages/integrations/vercel: dependencies: '@astrojs/internal-helpers': - specifier: ^0.1.2 + specifier: workspace:* version: link:../../internal-helpers - '@astrojs/webapi': - specifier: ^2.2.0 - version: link:../../webapi '@vercel/analytics': specifier: ^0.1.11 version: 0.1.11 @@ -4974,8 +4710,8 @@ importers: specifier: ^0.22.6 version: 0.22.6 esbuild: - specifier: ^0.17.19 - version: 0.17.19 + specifier: ^0.18.16 + version: 0.18.16 fast-glob: specifier: ^3.2.12 version: 3.2.12 @@ -5023,6 +4759,15 @@ importers: specifier: workspace:* version: link:../../../../../astro + packages/integrations/vercel/test/fixtures/functionPerRoute: + dependencies: + '@astrojs/vercel': + specifier: workspace:* + version: link:../../.. + astro: + specifier: workspace:* + version: link:../../../../../astro + packages/integrations/vercel/test/fixtures/image: dependencies: '@astrojs/vercel': @@ -5150,157 +4895,10 @@ importers: specifier: workspace:* version: link:../../scripts - packages/markdown/component: - devDependencies: - '@types/mocha': - specifier: ^9.1.1 - version: 9.1.1 - astro: - specifier: workspace:* - version: link:../../astro - chai: - specifier: ^4.3.7 - version: 4.3.7 - cheerio: - specifier: 1.0.0-rc.12 - version: 1.0.0-rc.12 - github-slugger: - specifier: ^1.5.0 - version: 1.5.0 - mocha: - specifier: ^9.2.2 - version: 9.2.2 - rehype-autolink-headings: - specifier: ^6.1.1 - version: 6.1.1 - rehype-slug: - specifier: ^5.0.1 - version: 5.1.0 - rehype-toc: - specifier: ^3.0.2 - version: 3.0.2 - remark-code-titles: - specifier: ^0.1.2 - version: 0.1.2 - - packages/markdown/component/test/fixtures/astro-markdown: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../.. - '@astrojs/preact': - specifier: workspace:* - version: link:../../../../../integrations/preact - '@astrojs/svelte': - specifier: workspace:* - version: link:../../../../../integrations/svelte - astro: - specifier: workspace:* - version: link:../../../../../astro - preact: - specifier: ^10.15.1 - version: 10.15.1 - svelte: - specifier: ^3.59.1 - version: 3.59.1 - - packages/markdown/component/test/fixtures/astro-markdown-plugins: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../.. - '@astrojs/preact': - specifier: workspace:* - version: link:../../../../../integrations/preact - astro: - specifier: workspace:* - version: link:../../../../../astro - hast-util-select: - specifier: ^5.0.2 - version: 5.0.5 - preact: - specifier: ^10.15.1 - version: 10.15.1 - rehype-slug: - specifier: ^5.0.1 - version: 5.1.0 - - packages/markdown/component/test/fixtures/astro-markdown-shiki: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../.. - astro: - specifier: workspace:* - version: link:../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/langs: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/normal: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - - packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true: - dependencies: - '@astrojs/markdown-component': - specifier: workspace:* - version: link:../../../.. - astro: - specifier: workspace:* - version: link:../../../../../../astro - packages/markdown/remark: dependencies: '@astrojs/prism': - specifier: ^2.1.2 + specifier: ^3.0.0-beta.0 version: link:../../astro-prism github-slugger: specifier: ^1.5.0 @@ -5393,9 +4991,6 @@ importers: is-wsl: specifier: ^2.2.0 version: 2.2.0 - undici: - specifier: ^5.22.1 - version: 5.22.1 which-pm-runs: specifier: ^1.1.0 version: 1.1.0 @@ -5443,72 +5038,14 @@ importers: specifier: ^9.2.2 version: 9.2.2 - packages/webapi: - dependencies: - undici: - specifier: ^5.22.1 - version: 5.22.1 - devDependencies: - '@rollup/plugin-alias': - specifier: ^3.1.9 - version: 3.1.9(rollup@2.79.1) - '@rollup/plugin-inject': - specifier: ^4.0.4 - version: 4.0.4(rollup@2.79.1) - '@rollup/plugin-node-resolve': - specifier: ^13.3.0 - version: 13.3.0(rollup@2.79.1) - '@rollup/plugin-typescript': - specifier: ^8.5.0 - version: 8.5.0(rollup@2.79.1)(tslib@2.5.3)(typescript@5.0.2) - '@types/chai': - specifier: ^4.3.5 - version: 4.3.5 - '@types/mocha': - specifier: ^9.1.1 - version: 9.1.1 - '@types/node': - specifier: ^18.16.18 - version: 18.16.18 - '@ungap/structured-clone': - specifier: ^0.3.4 - version: 0.3.4 - chai: - specifier: ^4.3.7 - version: 4.3.7 - event-target-shim: - specifier: ^6.0.2 - version: 6.0.2 - magic-string: - specifier: ^0.30.2 - version: 0.30.2 - mocha: - specifier: ^9.2.2 - version: 9.2.2 - rollup: - specifier: ^2.79.1 - version: 2.79.1 - tslib: - specifier: ^2.5.3 - version: 2.5.3 - typescript: - specifier: ~5.0.2 - version: 5.0.2 - urlpattern-polyfill: - specifier: ^1.0.0-rc5 - version: 1.0.0-rc5 - scripts: dependencies: - '@astrojs/webapi': - specifier: workspace:* - version: link:../packages/webapi arg: specifier: ^5.0.2 version: 5.0.2 esbuild: - specifier: ^0.17.19 - version: 0.17.19 + specifier: ^0.18.16 + version: 0.18.16 globby: specifier: ^12.2.0 version: 12.2.0 @@ -5533,7 +5070,7 @@ importers: version: 7.0.0 esbuild-plugin-copy: specifier: ^2.1.1 - version: 2.1.1(esbuild@0.17.19) + version: 2.1.1(esbuild@0.18.16) execa: specifier: ^6.1.0 version: 6.1.0 @@ -5547,10 +5084,6 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - /@altano/tiny-async-pool@1.0.2: - resolution: {integrity: sha512-qQzaI0TBUPdpjZ3qo5b2ziQY9MSNpbziH2ZrE5lvtUZL+kn9GwVuVJwoOubaoNkeDB+rqEefnpu1k+oMpOCYiw==} - dev: false - /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} @@ -5618,6 +5151,23 @@ packages: lite-youtube-embed: 0.2.0 dev: false + /@astrojs/check@0.1.0(prettier-plugin-astro@0.11.0)(prettier@3.0.1)(typescript@5.1.6): + resolution: {integrity: sha512-tgjq+Vehgv0dwdsRlT4ai3QgT3etn8W5C4E4dvQ0Xe9ccwjKdMTWmpty5exfBtHLLAAOvwe5/OkYQsQ9OyKoVw==} + hasBin: true + peerDependencies: + typescript: ^5.0.0 + dependencies: + '@astrojs/language-server': 2.2.0(prettier-plugin-astro@0.11.0)(prettier@3.0.1)(typescript@5.1.6) + chokidar: 3.5.3 + fast-glob: 3.3.1 + kleur: 4.1.5 + typescript: 5.1.6 + yargs: 17.7.2 + transitivePeerDependencies: + - prettier + - prettier-plugin-astro + dev: true + /@astrojs/cli-kit@0.2.3: resolution: {integrity: sha512-MjB42mpIG/F2rFtdp4f3NylFCILuFSib2yITSq65fRaDFn8+UC8EMh6T7Jr3YqHAbUY5r8V8QWNgH4keOEO2BA==} dependencies: @@ -5626,28 +5176,48 @@ packages: sisteransi: 1.0.5 dev: false - /@astrojs/compiler@1.8.0: - resolution: {integrity: sha512-E0TI/uyO8n+IPSZ4Fvl9Lne8JKEasR6ZMGvE2G096oTWOXSsPAhRs2LomV3z+/VRepo2h+t/SdVo54wox4eJwA==} + /@astrojs/compiler@1.5.7: + resolution: {integrity: sha512-dFU7GAMbpTUGPkRoCoMQrGFlTe3qIiQMSOxIXp/nB1Do4My9uogjEmBHdR5Cwr4i6rc5/1R3Od9v8kU/pkHXGQ==} + dev: true - /@astrojs/language-server@1.0.0: - resolution: {integrity: sha512-oEw7AwJmzjgy6HC9f5IdrphZ1GVgfV/+7xQuyf52cpTiRWd/tJISK3MsKP0cDkVlfodmNABNFnAaAWuLZEiiiA==} + /@astrojs/compiler@1.8.1: + resolution: {integrity: sha512-C28qplQzgIJ+JU9S+1wNx+ue2KCBUp0TTAd10EWAEkk4RsL3Tzlw0BYvLDDb4KP9jS48lXmR4/1TtZ4aavYJ8Q==} + + /@astrojs/language-server@2.2.0(prettier-plugin-astro@0.11.0)(prettier@3.0.1)(typescript@5.1.6): + resolution: {integrity: sha512-zyEumkwcep3pGyMpcEJFEn96jV6pEg3CUtjehnT9KseDFqf+gPYTbw5nwOpN9uXIJ/E5bAxhqpkr3J2LCQHRrg==} hasBin: true + peerDependencies: + prettier: ^3.0.0 + prettier-plugin-astro: ^0.11.0 + peerDependenciesMeta: + prettier: + optional: true + prettier-plugin-astro: + optional: true dependencies: - '@astrojs/compiler': 1.8.0 - '@jridgewell/trace-mapping': 0.3.18 - '@vscode/emmet-helper': 2.8.8 - events: 3.3.0 - prettier: 2.8.8 - prettier-plugin-astro: 0.8.1 - synckit: 0.8.5 - vscode-css-languageservice: 6.2.6 - vscode-html-languageservice: 5.0.5 - vscode-languageserver: 8.1.0 - vscode-languageserver-protocol: 3.17.3 - vscode-languageserver-textdocument: 1.0.8 - vscode-languageserver-types: 3.17.3 + '@astrojs/compiler': 1.5.7 + '@jridgewell/sourcemap-codec': 1.4.15 + '@volar/kit': 1.10.0(typescript@5.1.6) + '@volar/language-core': 1.10.0 + '@volar/language-server': 1.10.0 + '@volar/language-service': 1.10.0 + '@volar/source-map': 1.10.0 + '@volar/typescript': 1.10.0 + fast-glob: 3.3.1 + muggle-string: 0.3.1 + prettier: 3.0.1 + prettier-plugin-astro: 0.11.0 + volar-service-css: 0.0.11(@volar/language-service@1.10.0) + volar-service-emmet: 0.0.11(@volar/language-service@1.10.0) + volar-service-html: 0.0.11(@volar/language-service@1.10.0) + volar-service-prettier: 0.0.11(@volar/language-service@1.10.0)(prettier@3.0.1) + volar-service-typescript: 0.0.11(@volar/language-service@1.10.0)(@volar/typescript@1.10.0) + volar-service-typescript-twoslash-queries: 0.0.11(@volar/language-service@1.10.0) + vscode-html-languageservice: 5.0.6 vscode-uri: 3.0.7 - dev: false + transitivePeerDependencies: + - typescript + dev: true /@babel/code-frame@7.22.5: resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} @@ -5729,8 +5299,8 @@ packages: semver: 6.3.1 dev: false - /@babel/helper-create-class-features-plugin@7.21.8(@babel/core@7.22.5): - resolution: {integrity: sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw==} + /@babel/helper-create-class-features-plugin@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-Pwyi89uO4YrGKxL/eNJ8lfEH55DnRloGPOseaA8NFNL6jAUnn+KccaISiFazCj5IolPPDjGSdzQzXVzODVRqUQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 @@ -5742,14 +5312,12 @@ packages: '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 - '@babel/helper-member-expression-to-functions': 7.21.5 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.22.5 + '@babel/helper-member-expression-to-functions': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.9(@babel/core@7.22.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 - transitivePeerDependencies: - - supports-color dev: false /@babel/helper-create-regexp-features-plugin@7.21.8(@babel/core@7.22.5): @@ -5806,8 +5374,8 @@ packages: '@babel/types': 7.22.5 dev: false - /@babel/helper-member-expression-to-functions@7.21.5: - resolution: {integrity: sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg==} + /@babel/helper-member-expression-to-functions@7.22.5: + resolution: {integrity: sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.22.5 @@ -5850,8 +5418,8 @@ packages: - supports-color dev: false - /@babel/helper-optimise-call-expression@7.18.6: - resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} + /@babel/helper-optimise-call-expression@7.22.5: + resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.22.5 @@ -5880,18 +5448,19 @@ packages: - supports-color dev: false - /@babel/helper-replace-supers@7.21.5: - resolution: {integrity: sha512-/y7vBgsr9Idu4M6MprbOVUfH3vs7tsIfnVWv/Ml2xgwvyH6LTngdfbf5AdsKwkJy4zgy1X/kuNrEKvhhK28Yrg==} + /@babel/helper-replace-supers@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + peerDependenciesMeta: + '@babel/core': + optional: true dependencies: + '@babel/core': 7.22.5 '@babel/helper-environment-visitor': 7.22.5 - '@babel/helper-member-expression-to-functions': 7.21.5 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.5 - '@babel/types': 7.22.5 - transitivePeerDependencies: - - supports-color + '@babel/helper-member-expression-to-functions': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 dev: false /@babel/helper-simple-access@7.22.5: @@ -5901,8 +5470,8 @@ packages: '@babel/types': 7.22.5 dev: false - /@babel/helper-skip-transparent-expression-wrappers@7.20.0: - resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.22.5 @@ -5915,6 +5484,13 @@ packages: '@babel/types': 7.22.5 dev: false + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false + /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} @@ -5923,11 +5499,6 @@ packages: resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.21.0: - resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} - engines: {node: '>=6.9.0'} - dev: false - /@babel/helper-validator-option@7.22.5: resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} @@ -5995,7 +5566,7 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.22.5) dev: false @@ -6027,10 +5598,8 @@ packages: optional: true dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.21.8(@babel/core@7.22.5) + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - transitivePeerDependencies: - - supports-color dev: false /@babel/plugin-proposal-class-static-block@7.21.0(@babel/core@7.22.5): @@ -6043,11 +5612,9 @@ packages: optional: true dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.21.8(@babel/core@7.22.5) + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.5) - transitivePeerDependencies: - - supports-color dev: false /@babel/plugin-proposal-dynamic-import@7.18.6(@babel/core@7.22.5): @@ -6176,7 +5743,7 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.5) dev: false @@ -6190,10 +5757,8 @@ packages: optional: true dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.21.8(@babel/core@7.22.5) + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - transitivePeerDependencies: - - supports-color dev: false /@babel/plugin-proposal-private-property-in-object@7.21.0(@babel/core@7.22.5): @@ -6207,11 +5772,9 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.21.8(@babel/core@7.22.5) + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.5) - transitivePeerDependencies: - - supports-color dev: false /@babel/plugin-proposal-unicode-property-regex@7.18.6(@babel/core@7.22.5): @@ -6450,8 +6013,8 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: false - /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.22.5): - resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -6533,13 +6096,11 @@ packages: '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.22.5) '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 - '@babel/helper-optimise-call-expression': 7.18.6 + '@babel/helper-optimise-call-expression': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-replace-supers': 7.21.5 - '@babel/helper-split-export-declaration': 7.22.5 + '@babel/helper-replace-supers': 7.22.9(@babel/core@7.22.5) + '@babel/helper-split-export-declaration': 7.22.6 globals: 11.12.0 - transitivePeerDependencies: - - supports-color dev: false /@babel/plugin-transform-computed-properties@7.21.5(@babel/core@7.22.5): @@ -6680,8 +6241,8 @@ packages: - supports-color dev: false - /@babel/plugin-transform-modules-commonjs@7.21.5(@babel/core@7.22.5): - resolution: {integrity: sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==} + /@babel/plugin-transform-modules-commonjs@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -6769,9 +6330,7 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-replace-supers': 7.21.5 - transitivePeerDependencies: - - supports-color + '@babel/helper-replace-supers': 7.22.9(@babel/core@7.22.5) dev: false /@babel/plugin-transform-parameters@7.21.3(@babel/core@7.22.5): @@ -6800,6 +6359,44 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: false + /@babel/plugin-transform-react-jsx-development@7.22.5: + resolution: {integrity: sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + dependencies: + '@babel/plugin-transform-react-jsx': 7.22.5(@babel/core@7.22.5) + dev: false + + /@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + dependencies: + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-react-jsx-source@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + dependencies: + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + /@babel/plugin-transform-react-jsx@7.22.5(@babel/core@7.22.5): resolution: {integrity: sha512-rog5gZaVbUip5iWDMTYbVM15XQq+RkUKhET/IHR6oizR+JEoN6CAfTTuHcK4vwUyzca30qqHqEpzBOnaRMWYMA==} engines: {node: '>=6.9.0'} @@ -6868,7 +6465,7 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 dev: false /@babel/plugin-transform-sticky-regex@7.18.6(@babel/core@7.22.5): @@ -6921,11 +6518,25 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.21.8(@babel/core@7.22.5) + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.22.5) - transitivePeerDependencies: - - supports-color + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.5) + dev: false + + /@babel/plugin-transform-typescript@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-BnVR1CpKiuD0iobHPaM1iLvcwPYN2uVFAqoLVSpEDKWuOikoCv5HbKLxclhKYUXlWkX86DoZGtqI4XhbOsyrMg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + dependencies: + '@babel/core': 7.22.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.5) dev: false /@babel/plugin-transform-unicode-escapes@7.21.5(@babel/core@7.22.5): @@ -6968,7 +6579,7 @@ packages: '@babel/core': 7.22.5 '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-option': 7.21.0 + '@babel/helper-validator-option': 7.22.5 '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.18.6(@babel/core@7.22.5) '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.20.7(@babel/core@7.22.5) '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.22.5) @@ -7017,7 +6628,7 @@ packages: '@babel/plugin-transform-literals': 7.18.9(@babel/core@7.22.5) '@babel/plugin-transform-member-expression-literals': 7.18.6(@babel/core@7.22.5) '@babel/plugin-transform-modules-amd': 7.20.11(@babel/core@7.22.5) - '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.22.5) + '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/core@7.22.5) '@babel/plugin-transform-modules-systemjs': 7.20.11(@babel/core@7.22.5) '@babel/plugin-transform-modules-umd': 7.18.6(@babel/core@7.22.5) '@babel/plugin-transform-named-capturing-groups-regex': 7.20.5(@babel/core@7.22.5) @@ -7061,6 +6672,25 @@ packages: esutils: 2.0.3 dev: false + /@babel/preset-typescript@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + dependencies: + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.5 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-typescript': 7.22.9(@babel/core@7.22.5) + transitivePeerDependencies: + - supports-color + dev: false + /@babel/regjsgen@0.8.0: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} dev: false @@ -7236,7 +6866,7 @@ packages: resolution: {integrity: sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==} dependencies: dataloader: 1.4.0 - node-fetch: 2.6.12 + node-fetch: 2.6.11 transitivePeerDependencies: - encoding dev: true @@ -7329,8 +6959,8 @@ packages: mime: 3.0.0 dev: true - /@cloudflare/workerd-darwin-64@1.20230807.0: - resolution: {integrity: sha512-p1XgkX6OcomFSRSHiIo6XbWB40sMExnFUWtZFfSvB7oNmkrtEvUCI3iuh+ibFI5IDSZqsRKyIHx6Oe22Z0ei5A==} + /@cloudflare/workerd-darwin-64@1.20230814.1: + resolution: {integrity: sha512-aQUO7q7qXl+SVtOiMMlVKLNOSeL6GX43RKeflwzsD74dGgyHPiSfw5KCvXhkVbyN7u+yYF6HyFdaIvHLfn5jyA==} engines: {node: '>=16'} cpu: [x64] os: [darwin] @@ -7338,8 +6968,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-darwin-arm64@1.20230807.0: - resolution: {integrity: sha512-HjhjRFPvDg3Sh4TXyz38Z+AhaLA+0AiAmYKRadcnKhysjOaTew86POS3xdaKiZ3xG83J7rsLcqajW54znbmCkg==} + /@cloudflare/workerd-darwin-arm64@1.20230814.1: + resolution: {integrity: sha512-U2mcgi+AiuI/4EY5Wk/GmygiNoCNw/V2mcHmxESqe4r6XbJYOzBdEsjnqJ05rqd0JlEM8m64jRtE6/qBnQHygg==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] @@ -7347,8 +6977,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-linux-64@1.20230807.0: - resolution: {integrity: sha512-PPuGKoRILFTlZDC7uGXgrYBucopqkvicaov/ypbPmUVb/DfrXGqftEkNbXlyiXY1g0t10wXRiSZWi7hOBOIH7w==} + /@cloudflare/workerd-linux-64@1.20230814.1: + resolution: {integrity: sha512-Q4kITXLTCuG2i2Z01fbb5AjVRRIf3+lS4ZVsFbTbIwtcOOG4Ozcw7ee7tKsFES7hFqR4Eg9gMG4/aS0mmi+L2g==} engines: {node: '>=16'} cpu: [x64] os: [linux] @@ -7356,8 +6986,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-linux-arm64@1.20230807.0: - resolution: {integrity: sha512-ESAf2tXarK8dJl07voa/NI2BBpH1duldfgeQQQmor437A3+gSqQSBhAEmh05bjHy6dYHXgZtwLPky+LL6hmyBA==} + /@cloudflare/workerd-linux-arm64@1.20230814.1: + resolution: {integrity: sha512-BX5SaksXw+pkREVw3Rw2eSNXplqZw+14CcwW/5x/4oq/C6yn5qCvKxJfM7pukJGMI4wkJPOYops7B3g27FB/HA==} engines: {node: '>=16'} cpu: [arm64] os: [linux] @@ -7365,8 +6995,8 @@ packages: dev: true optional: true - /@cloudflare/workerd-windows-64@1.20230807.0: - resolution: {integrity: sha512-DYKkLtT4lNRdVx+2fbYgPxdF7ypJn9bT2HYMZ93N7XPwaKFx2svBRMrZkwBcvwuNb+99Z0jnaQwdcFnHcFLzZA==} + /@cloudflare/workerd-windows-64@1.20230814.1: + resolution: {integrity: sha512-GWHqfyhsG/1wm2W8afkYX3q3fWXUWWD8NGtHfAs6ZVTHdW3mmYyMhKR0lc6ptBwz5i5aXRlP2S+CxxxwwDbKpw==} engines: {node: '>=16'} cpu: [x64] os: [win32] @@ -7553,17 +7183,17 @@ packages: resolution: {integrity: sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==} dependencies: '@emmetio/scanner': 1.0.4 - dev: false + dev: true /@emmetio/css-abbreviation@2.1.8: resolution: {integrity: sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==} dependencies: '@emmetio/scanner': 1.0.4 - dev: false + dev: true /@emmetio/scanner@1.0.4: resolution: {integrity: sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==} - dev: false + dev: true /@esbuild-plugins/node-globals-polyfill@0.1.1(esbuild@0.16.3): resolution: {integrity: sha512-MR0oAA+mlnJWrt1RQVQ+4VYuRJW/P2YmRTv1AsplObyvuBMnPHiizUF95HHYiSsMGLhyGtWufaq2XQg6+iurBg==} @@ -7598,6 +7228,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-arm64@0.18.16: @@ -7632,6 +7263,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-arm@0.18.16: @@ -7657,6 +7289,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-x64@0.18.16: @@ -7682,6 +7315,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: false optional: true /@esbuild/darwin-arm64@0.18.16: @@ -7707,6 +7341,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: false optional: true /@esbuild/darwin-x64@0.18.16: @@ -7732,6 +7367,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: false optional: true /@esbuild/freebsd-arm64@0.18.16: @@ -7757,6 +7393,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: false optional: true /@esbuild/freebsd-x64@0.18.16: @@ -7782,6 +7419,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-arm64@0.18.16: @@ -7807,6 +7445,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-arm@0.18.16: @@ -7832,6 +7471,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-ia32@0.18.16: @@ -7866,6 +7506,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-loong64@0.18.16: @@ -7891,6 +7532,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-mips64el@0.18.16: @@ -7916,6 +7558,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-ppc64@0.18.16: @@ -7941,6 +7584,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-riscv64@0.18.16: @@ -7966,6 +7610,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-s390x@0.18.16: @@ -7991,6 +7636,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-x64@0.18.16: @@ -8016,6 +7662,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: false optional: true /@esbuild/netbsd-x64@0.18.16: @@ -8041,6 +7688,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: false optional: true /@esbuild/openbsd-x64@0.18.16: @@ -8066,6 +7714,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: false optional: true /@esbuild/sunos-x64@0.18.16: @@ -8091,6 +7740,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-arm64@0.18.16: @@ -8116,6 +7766,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-ia32@0.18.16: @@ -8141,6 +7792,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-x64@0.18.16: @@ -8315,11 +7967,11 @@ packages: detect-libc: 2.0.1 https-proxy-agent: 5.0.1 make-dir: 3.1.0 - node-fetch: 2.6.12 + node-fetch: 2.6.11 nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.5.4 + semver: 7.5.3 tar: 6.1.15 transitivePeerDependencies: - encoding @@ -8349,7 +8001,7 @@ packages: estree-util-build-jsx: 2.2.2 estree-util-is-identifier-name: 2.1.0 estree-util-to-js: 1.2.0 - estree-walker: 3.0.0 + estree-walker: 3.0.3 hast-util-to-estree: 2.3.2 markdown-extensions: 1.1.1 periscopic: 3.1.0 @@ -8522,7 +8174,7 @@ packages: '@octokit/request-error': 2.1.0 '@octokit/types': 6.41.0 is-plain-object: 5.0.0 - node-fetch: 2.6.12 + node-fetch: 2.6.11 universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding @@ -8546,18 +8198,6 @@ packages: parse5: 7.1.2 dev: false - /@pkgr/utils@2.4.0: - resolution: {integrity: sha512-2OCURAmRtdlL8iUDTypMrrxfwe8frXTeXaxGsVOaYtc/wrUyk8Z/0OBetM7cdlsy7ZFWlMX72VogKeh+A4Xcjw==} - engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dependencies: - cross-spawn: 7.0.3 - fast-glob: 3.2.12 - is-glob: 4.0.3 - open: 9.1.0 - picocolors: 1.0.0 - tslib: 2.5.3 - dev: false - /@playwright/test@1.29.2: resolution: {integrity: sha512-+3/GPwOgcoF0xLz/opTnahel1/y42PdcgZ4hs+BZGIUjtmEFSXGg+nFoaH3NSmuc7a6GSFwXDJ5L7VXpqzigNg==} engines: {node: '>=14'} @@ -8567,6 +8207,30 @@ packages: playwright-core: 1.29.2 dev: true + /@preact/preset-vite@2.5.0(preact@10.15.1): + resolution: {integrity: sha512-BUhfB2xQ6ex0yPkrT1Z3LbfPzjpJecOZwQ/xJrXGFSZD84+ObyS//41RdEoQCMWsM0t7UHGaujUxUBub7WM1Jw==} + peerDependencies: + '@babel/core': 7.x + vite: 2.x || 3.x || 4.x + peerDependenciesMeta: + '@babel/core': + optional: true + vite: + optional: true + dependencies: + '@babel/plugin-transform-react-jsx': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-react-jsx-development': 7.22.5 + '@prefresh/vite': 2.4.1(preact@10.15.1) + '@rollup/pluginutils': 4.2.1 + babel-plugin-transform-hook-names: 1.0.2 + debug: 4.3.4 + kolorist: 1.8.0 + resolve: 1.22.2 + transitivePeerDependencies: + - preact + - supports-color + dev: false + /@preact/signals-core@1.3.0: resolution: {integrity: sha512-M+M3ZOtd1dtV/uasyk4SZu1vbfEJ4NeENv0F7F12nijZYedB5wSgbtZcuACyssnTznhF4ctUyrR0dZHuHfyWKA==} dev: false @@ -8589,18 +8253,40 @@ packages: preact: 10.15.1 dev: false - /@rollup/plugin-alias@3.1.9(rollup@2.79.1): - resolution: {integrity: sha512-QI5fsEvm9bDzt32k39wpOwZhVzRcL5ydcffUHMyLVaVaLeC70I8TJZ17F1z1eMoLu4E/UOcH9BWVkKpIKdrfiw==} - engines: {node: '>=8.0.0'} + /@prefresh/babel-plugin@0.5.0: + resolution: {integrity: sha512-joAwpkUDwo7ZqJnufXRGzUb+udk20RBgfA8oLPBh5aJH2LeStmV1luBfeJTztPdyCscC2j2SmZ/tVxFRMIxAEw==} + dev: false + + /@prefresh/core@1.5.1(preact@10.15.1): + resolution: {integrity: sha512-e0mB0Oxtog6ZpKPDBYbzFniFJDIktuKMzOHp7sguntU+ot0yi6dbhJRE9Css1qf0u16wdSZjpL2W2ODWuU05Cw==} peerDependencies: - rollup: ^1.20.0||^2.0.0 + preact: ^10.0.0 + dependencies: + preact: 10.15.1 + dev: false + + /@prefresh/utils@1.2.0: + resolution: {integrity: sha512-KtC/fZw+oqtwOLUFM9UtiitB0JsVX0zLKNyRTA332sqREqSALIIQQxdUCS1P3xR/jT1e2e8/5rwH6gdcMLEmsQ==} + dev: false + + /@prefresh/vite@2.4.1(preact@10.15.1): + resolution: {integrity: sha512-vthWmEqu8TZFeyrBNc9YE5SiC3DVSzPgsOCp/WQ7FqdHpOIJi7Z8XvCK06rBPOtG4914S52MjG9Ls22eVAiuqQ==} + peerDependencies: + preact: ^10.4.0 + vite: '>=2.0.0' peerDependenciesMeta: - rollup: + vite: optional: true dependencies: - rollup: 2.79.1 - slash: 3.0.0 - dev: true + '@babel/core': 7.22.5 + '@prefresh/babel-plugin': 0.5.0 + '@prefresh/core': 1.5.1(preact@10.15.1) + '@prefresh/utils': 1.2.0 + '@rollup/pluginutils': 4.2.1 + preact: 10.15.1 + transitivePeerDependencies: + - supports-color + dev: false /@rollup/plugin-babel@5.3.1(@babel/core@7.22.5)(rollup@2.79.1): resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} @@ -8623,20 +8309,6 @@ packages: rollup: 2.79.1 dev: false - /@rollup/plugin-inject@4.0.4(rollup@2.79.1): - resolution: {integrity: sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ==} - peerDependencies: - rollup: ^1.20.0 || ^2.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - estree-walker: 2.0.2 - magic-string: 0.25.9 - rollup: 2.79.1 - dev: true - /@rollup/plugin-node-resolve@11.2.1(rollup@2.79.1): resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} engines: {node: '>= 10.0.0'} @@ -8655,24 +8327,6 @@ packages: rollup: 2.79.1 dev: false - /@rollup/plugin-node-resolve@13.3.0(rollup@2.79.1): - resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} - engines: {node: '>= 10.0.0'} - peerDependencies: - rollup: ^2.42.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - '@types/resolve': 1.17.1 - deepmerge: 4.3.1 - is-builtin-module: 3.2.1 - is-module: 1.0.0 - resolve: 1.22.2 - rollup: 2.79.1 - dev: true - /@rollup/plugin-replace@2.4.2(rollup@2.79.1): resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} peerDependencies: @@ -8700,26 +8354,6 @@ packages: rollup: 3.20.1 dev: false - /@rollup/plugin-typescript@8.5.0(rollup@2.79.1)(tslib@2.5.3)(typescript@5.0.2): - resolution: {integrity: sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==} - engines: {node: '>=8.0.0'} - peerDependencies: - rollup: ^2.14.0 - tslib: '*' - typescript: '>=3.7.0' - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - dependencies: - '@rollup/pluginutils': 3.1.0(rollup@2.79.1) - resolve: 1.22.2 - rollup: 2.79.1 - tslib: 2.5.3 - typescript: 5.0.2 - dev: true - /@rollup/pluginutils@3.1.0(rollup@2.79.1): resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} @@ -8733,6 +8367,7 @@ packages: estree-walker: 1.0.1 picomatch: 2.3.1 rollup: 2.79.1 + dev: false /@rollup/pluginutils@4.2.1: resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} @@ -8829,7 +8464,7 @@ packages: /@ts-morph/common@0.20.0: resolution: {integrity: sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==} dependencies: - fast-glob: 3.2.12 + fast-glob: 3.3.1 minimatch: 7.4.6 mkdirp: 2.1.6 path-browserify: 1.0.1 @@ -8922,7 +8557,7 @@ packages: /@types/dom-view-transitions@1.0.1: resolution: {integrity: sha512-A9S1ijj/4MX06I1W/6on8lhaYyq1Ir7gaOvfllW1o4RzVWW88HAeqX0pUx9VgOLnNpdiGeUW2CTkg18p5LWIrA==} - dev: false + dev: true /@types/estree-jsx@1.0.0: resolution: {integrity: sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ==} @@ -8931,6 +8566,7 @@ packages: /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} + dev: false /@types/estree@0.0.51: resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} @@ -8943,30 +8579,10 @@ packages: resolution: {integrity: sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==} dev: true - /@types/fs-extra@8.1.2: - resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} - dependencies: - '@types/node': 18.16.18 - dev: true - /@types/github-slugger@1.3.0: resolution: {integrity: sha512-J/rMZa7RqiH/rT29TEVZO4nBoDP9XJOjnbbIofg7GQKs4JIduEO3WLpte+6WeUz/TcrXKlY+bM7FYrp8yFB+3g==} dev: true - /@types/glob@7.2.0: - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 18.16.18 - dev: true - - /@types/glob@8.1.0: - resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 18.16.18 - dev: true - /@types/hast@2.3.4: resolution: {integrity: sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==} dependencies: @@ -9035,10 +8651,6 @@ packages: resolution: {integrity: sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==} dev: true - /@types/minimatch@5.1.2: - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - dev: true - /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -9137,17 +8749,11 @@ packages: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: '@types/node': 18.16.18 + dev: false /@types/resolve@1.20.2: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} - /@types/rimraf@3.0.2: - resolution: {integrity: sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==} - dependencies: - '@types/glob': 8.1.0 - '@types/node': 18.16.3 - dev: true - /@types/sax@1.2.4: resolution: {integrity: sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==} dependencies: @@ -9208,8 +8814,9 @@ packages: /@types/yargs-parser@21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} + dev: true - /@typescript-eslint/eslint-plugin@6.0.0(@typescript-eslint/parser@6.0.0)(eslint@8.43.0)(typescript@5.0.2): + /@typescript-eslint/eslint-plugin@6.0.0(@typescript-eslint/parser@6.0.0)(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-xuv6ghKGoiq856Bww/yVYnXGsKa588kY3M0XK7uUW/3fJNNULKRfZfSBkMTSpqGG/8ZCXCadfh8G/z/B4aqS/A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -9221,10 +8828,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 6.0.0(eslint@8.43.0)(typescript@5.0.2) + '@typescript-eslint/parser': 6.0.0(eslint@8.43.0)(typescript@5.1.6) '@typescript-eslint/scope-manager': 6.0.0 - '@typescript-eslint/type-utils': 6.0.0(eslint@8.43.0)(typescript@5.0.2) - '@typescript-eslint/utils': 6.0.0(eslint@8.43.0)(typescript@5.0.2) + '@typescript-eslint/type-utils': 6.0.0(eslint@8.43.0)(typescript@5.1.6) + '@typescript-eslint/utils': 6.0.0(eslint@8.43.0)(typescript@5.1.6) '@typescript-eslint/visitor-keys': 6.0.0 debug: 4.3.4 eslint: 8.43.0 @@ -9234,13 +8841,13 @@ packages: natural-compare: 1.4.0 natural-compare-lite: 1.4.0 semver: 7.5.3 - ts-api-utils: 1.0.1(typescript@5.0.2) - typescript: 5.0.2 + ts-api-utils: 1.0.1(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.0.0(eslint@8.43.0)(typescript@5.0.2): + /@typescript-eslint/parser@6.0.0(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-TNaufYSPrr1U8n+3xN+Yp9g31vQDJqhXzzPSHfQDLcaO4tU+mCfODPxCwf4H530zo7aUBE3QIdxCXamEnG04Tg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -9252,11 +8859,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.0.0 '@typescript-eslint/types': 6.0.0 - '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.0.2) + '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.1.6) '@typescript-eslint/visitor-keys': 6.0.0 debug: 4.3.4 eslint: 8.43.0 - typescript: 5.0.2 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -9269,7 +8876,7 @@ packages: '@typescript-eslint/visitor-keys': 6.0.0 dev: true - /@typescript-eslint/type-utils@6.0.0(eslint@8.43.0)(typescript@5.0.2): + /@typescript-eslint/type-utils@6.0.0(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-ah6LJvLgkoZ/pyJ9GAdFkzeuMZ8goV6BH7eC9FPmojrnX9yNCIsfjB+zYcnex28YO3RFvBkV6rMV6WpIqkPvoQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -9279,12 +8886,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.0.2) - '@typescript-eslint/utils': 6.0.0(eslint@8.43.0)(typescript@5.0.2) + '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.1.6) + '@typescript-eslint/utils': 6.0.0(eslint@8.43.0)(typescript@5.1.6) debug: 4.3.4 eslint: 8.43.0 - ts-api-utils: 1.0.1(typescript@5.0.2) - typescript: 5.0.2 + ts-api-utils: 1.0.1(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -9294,7 +8901,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.0.0(typescript@5.0.2): + /@typescript-eslint/typescript-estree@6.0.0(typescript@5.1.6): resolution: {integrity: sha512-2zq4O7P6YCQADfmJ5OTDQTP3ktajnXIRrYAtHM9ofto/CJZV3QfJ89GEaM2BNGeSr1KgmBuLhEkz5FBkS2RQhQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -9308,14 +8915,14 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.0.2) - typescript: 5.0.2 + semver: 7.5.3 + ts-api-utils: 1.0.1(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@6.0.0(eslint@8.43.0)(typescript@5.0.2): + /@typescript-eslint/utils@6.0.0(eslint@8.43.0)(typescript@5.1.6): resolution: {integrity: sha512-SOr6l4NB6HE4H/ktz0JVVWNXqCJTOo/mHnvIte1ZhBQ0Cvd04x5uKZa3zT6tiodL06zf5xxdK8COiDvPnQ27JQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -9326,10 +8933,10 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 6.0.0 '@typescript-eslint/types': 6.0.0 - '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.0.2) + '@typescript-eslint/typescript-estree': 6.0.0(typescript@5.1.6) eslint: 8.43.0 eslint-scope: 5.1.1 - semver: 7.5.4 + semver: 7.5.3 transitivePeerDependencies: - supports-color - typescript @@ -9371,11 +8978,6 @@ packages: /@ungap/promise-all-settled@1.1.2: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} - dev: true - - /@ungap/structured-clone@0.3.4: - resolution: {integrity: sha512-TSVh8CpnwNAsPC5wXcIyh92Bv1gq6E9cNDeeLu7Z4h8V4/qWtXJp7y42qljRkqcpmsve1iozwv1wr+3BNdILCg==} - dev: true /@vercel/analytics@0.1.11: resolution: {integrity: sha512-mj5CPR02y0BRs1tN3oZcBNAX9a8NxsIUl9vElDPcqxnMfP0RbRc9fI9Ud7+QDg/1Izvt5uMumsr+6YsmVHcyuw==} @@ -9411,6 +9013,24 @@ packages: - supports-color dev: false + /@vitejs/plugin-react@4.0.3(vite@4.4.6): + resolution: {integrity: sha512-pwXDog5nwwvSIzwrvYYmA2Ljcd/ZNlcsSG2Q9CNDBwnsd55UGAyr2doXtB5j+2uymRCnCfExlznzzSFbBRcoCg==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^4.2.0 + peerDependenciesMeta: + vite: + optional: true + dependencies: + '@babel/core': 7.22.5 + '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.22.5) + react-refresh: 0.14.0 + vite: 4.4.6(@types/node@18.16.18)(sass@1.63.4) + transitivePeerDependencies: + - supports-color + dev: false + /@vitejs/plugin-vue-jsx@3.0.1(vite@4.4.6)(vue@3.3.4): resolution: {integrity: sha512-+Jb7ggL48FSPS1uhPnJbJwWa9Sr90vQ+d0InW+AhBM22n+cfuYqJZDckBc+W3QSHe1WDvewMZfa4wZOtk5pRgw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -9483,6 +9103,61 @@ packages: pretty-format: 27.5.1 dev: false + /@volar/kit@1.10.0(typescript@5.1.6): + resolution: {integrity: sha512-3ijH2Gqe8kWnij58rwaBID22J/b+VT457ZEf5TwyPDqHTrfNCZIVitpdD5WlLD4Wy/D0Vymwj2ct9TNc1hkOmQ==} + peerDependencies: + typescript: '*' + dependencies: + '@volar/language-service': 1.10.0 + typesafe-path: 0.2.2 + typescript: 5.1.6 + vscode-languageserver-textdocument: 1.0.8 + vscode-uri: 3.0.7 + dev: true + + /@volar/language-core@1.10.0: + resolution: {integrity: sha512-ddyWwSYqcbEZNFHm+Z3NZd6M7Ihjcwl/9B5cZd8kECdimVXUFdFi60XHWD27nrWtUQIsUYIG7Ca1WBwV2u2LSQ==} + dependencies: + '@volar/source-map': 1.10.0 + dev: true + + /@volar/language-server@1.10.0: + resolution: {integrity: sha512-EFOjdKvV6iCfGmBPuf/L7zK93E8eE/kCBWM5xyG92pJm6tq5R/CLx968CPc7rlWykitKMXJumACNzIeXnnlyEw==} + dependencies: + '@volar/language-core': 1.10.0 + '@volar/language-service': 1.10.0 + '@volar/typescript': 1.10.0 + '@vscode/l10n': 0.0.11 + request-light: 0.7.0 + typesafe-path: 0.2.2 + vscode-languageserver: 8.1.0 + vscode-languageserver-protocol: 3.17.3 + vscode-languageserver-textdocument: 1.0.8 + vscode-uri: 3.0.7 + dev: true + + /@volar/language-service@1.10.0: + resolution: {integrity: sha512-qWeve/sUwBX94Ozb0A4vDLwjkDJDLz/k0VtRhNzN43PRGaCphl+dYMKftn1e7nYTcfcDKd5HjjfN+tT7txZ6kw==} + dependencies: + '@volar/language-core': 1.10.0 + '@volar/source-map': 1.10.0 + vscode-languageserver-protocol: 3.17.3 + vscode-languageserver-textdocument: 1.0.8 + vscode-uri: 3.0.7 + dev: true + + /@volar/source-map@1.10.0: + resolution: {integrity: sha512-/ibWdcOzDGiq/GM1JU2eX8fH1bvAhl66hfe8yEgLEzg9txgr6qb5sQ/DEz5PcDL75tF5H5sCRRwn8Eu8ezi9mw==} + dependencies: + muggle-string: 0.3.1 + dev: true + + /@volar/typescript@1.10.0: + resolution: {integrity: sha512-OtqGtFbUKYC0pLNIk3mHQp5xWnvL1CJIUc9VE39VdZ/oqpoBh5jKfb9uJ45Y4/oP/WYTrif/Uxl1k8VTPz66Gg==} + dependencies: + '@volar/language-core': 1.10.0 + dev: true + /@vscode/emmet-helper@2.8.8: resolution: {integrity: sha512-QuD4CmNeXSFxuP8VZwI6qL+8vmmd7JcSdwsEIdsrzb4YumWs/+4rXRX9MM+NsFfUO69g6ezngCD7XRd6jY9TQw==} dependencies: @@ -9491,15 +9166,15 @@ packages: vscode-languageserver-textdocument: 1.0.8 vscode-languageserver-types: 3.17.3 vscode-uri: 2.1.2 - dev: false + dev: true - /@vscode/l10n@0.0.13: - resolution: {integrity: sha512-A3uY356uOU9nGa+TQIT/i3ziWUgJjVMUrGGXSrtRiTwklyCFjGVWIOHoEIHbJpiyhDkJd9kvIWUOfXK1IkK8XQ==} - dev: false + /@vscode/l10n@0.0.11: + resolution: {integrity: sha512-ukOMWnCg1tCvT7WnDfsUKQOFDQGsyR5tNgRpwmqi+5/vzU3ghdDXzvIM4IOPdSb3OeSsBNvmSL8nxIVOqi2WXA==} + dev: true /@vscode/l10n@0.0.14: resolution: {integrity: sha512-/yrv59IEnmh655z1oeDnGcvMYwnEzNzHLgeYcQCkhYX0xBvYWrAuefoiLcPBUkMpJsb46bqQ6Yv4pwTTQ4d3Qg==} - dev: false + dev: true /@vue/babel-helper-vue-transform-on@1.0.2: resolution: {integrity: sha512-hz4R8tS5jMn8lDq6iD+yWL6XNB699pGIVLk7WSJnn1dbpjaazsjZQkieJoRX6gW5zpYSCFqQ7jUquPNY65tQYA==} @@ -9717,7 +9392,6 @@ packages: /ansi-colors@4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} engines: {node: '>=6'} - dev: true /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} @@ -9942,7 +9616,7 @@ packages: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} - /babel-plugin-jsx-dom-expressions@0.36.10: + /babel-plugin-jsx-dom-expressions@0.36.10(@babel/core@7.22.5): resolution: {integrity: sha512-QA2k/14WGw+RgcGGnEuLWwnu4em6CGhjeXtjvgOYyFHYS2a+CzPeaVQHDOlfuiBcjq/3hWMspHMIMnPEOIzdBg==} peerDependencies: '@babel/core': ^7.20.12 @@ -9950,6 +9624,7 @@ packages: '@babel/core': optional: true dependencies: + '@babel/core': 7.22.5 '@babel/helper-module-imports': 7.18.6 '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.5) '@babel/types': 7.22.5 @@ -9957,17 +9632,6 @@ packages: validate-html-nesting: 1.2.2 dev: false - /babel-plugin-module-resolver@5.0.0: - resolution: {integrity: sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==} - engines: {node: '>= 16'} - dependencies: - find-babel-config: 2.0.0 - glob: 8.1.0 - pkg-up: 3.1.0 - reselect: 4.1.8 - resolve: 1.22.2 - dev: false - /babel-plugin-polyfill-corejs2@0.3.3(@babel/core@7.22.5): resolution: {integrity: sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==} peerDependencies: @@ -10013,15 +9677,25 @@ packages: - supports-color dev: false - /babel-preset-solid@1.7.7: - resolution: {integrity: sha512-tdxVzx3kgcIjNXAOmGRbzIhFBPeJjSakiN9yM+IYdL/+LtXNnbGqb0Va5tJb8Sjbk+QVEriovCyuzB5T7jeTvg==} + /babel-plugin-transform-hook-names@1.0.2: + resolution: {integrity: sha512-5gafyjyyBTTdX/tQQ0hRgu4AhNHG/hqWi0ZZmg2xvs2FgRkJXzDNKBZCyoYqgFkovfDrgM8OoKg8karoUvWeCw==} + peerDependencies: + '@babel/core': ^7.12.10 + peerDependenciesMeta: + '@babel/core': + optional: true + dev: false + + /babel-preset-solid@1.7.4(@babel/core@7.22.5): + resolution: {integrity: sha512-0mbHNYkbOVYhH6L95VlHVkBEVQjOXSzUqLDiFxUcsg/tU4yTM/qx7FI8C+kmos9LHckQBSm3wtwoe1BZLNJR1w==} peerDependencies: '@babel/core': ^7.0.0 peerDependenciesMeta: '@babel/core': optional: true dependencies: - babel-plugin-jsx-dom-expressions: 0.36.10 + '@babel/core': 7.22.5 + babel-plugin-jsx-dom-expressions: 0.36.10(@babel/core@7.22.5) dev: false /bail@2.0.2: @@ -10056,11 +9730,6 @@ packages: prebuild-install: 7.1.1 dev: true - /big-integer@1.6.51: - resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} - engines: {node: '>=0.6'} - dev: false - /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} @@ -10124,13 +9793,6 @@ packages: wrap-ansi: 8.1.0 dev: false - /bplist-parser@0.2.0: - resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} - engines: {node: '>= 5.10.0'} - dependencies: - big-integer: 1.6.51 - dev: false - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -10160,7 +9822,6 @@ packages: /browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - dev: true /browserslist@4.21.5: resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} @@ -10191,12 +9852,6 @@ packages: /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} - - /bundle-name@3.0.0: - resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} - engines: {node: '>=12'} - dependencies: - run-applescript: 5.0.0 dev: false /busboy@1.6.0: @@ -10204,6 +9859,7 @@ packages: engines: {node: '>=10.16.0'} dependencies: streamsearch: 1.1.0 + dev: true /bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} @@ -10475,7 +10131,6 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - dev: true /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} @@ -10516,6 +10171,7 @@ packages: dependencies: color-name: 1.1.4 simple-swizzle: 0.2.2 + dev: false /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} @@ -10528,10 +10184,7 @@ packages: dependencies: color-convert: 2.0.1 color-string: 1.9.1 - - /colorette@1.4.0: - resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} - dev: true + dev: false /colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -10585,7 +10238,7 @@ packages: js-string-escape: 1.0.1 lodash: 4.17.21 md5-hex: 3.0.1 - semver: 7.5.4 + semver: 7.5.3 well-known-symbols: 2.0.0 dev: false @@ -10818,7 +10471,6 @@ packages: dependencies: ms: 2.1.2 supports-color: 8.1.1 - dev: true /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -10847,7 +10499,6 @@ packages: /decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} - dev: true /decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} @@ -10882,26 +10533,14 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true + /deepmerge-ts@4.3.0: + resolution: {integrity: sha512-if3ZYdkD2dClhnXR5reKtG98cwyaRT1NeugQoAPTTfsOpV9kqyeiBF9Qa5RHjemb3KzD5ulqygv6ED3t5j9eJw==} + engines: {node: '>=12.4.0'} + dev: false + /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - - /default-browser-id@3.0.0: - resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} - engines: {node: '>=12'} - dependencies: - bplist-parser: 0.2.0 - untildify: 4.0.0 - dev: false - - /default-browser@4.0.0: - resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} - engines: {node: '>=14.16'} - dependencies: - bundle-name: 3.0.0 - default-browser-id: 3.0.0 - execa: 7.1.1 - titleize: 3.0.0 dev: false /defaults@1.0.4: @@ -10909,11 +10548,6 @@ packages: dependencies: clone: 1.0.4 - /define-lazy-prop@3.0.0: - resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} - engines: {node: '>=12'} - dev: false - /define-properties@1.2.0: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} @@ -11002,7 +10636,6 @@ packages: /diff@5.0.0: resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} engines: {node: '>=0.3.1'} - dev: true /diff@5.1.0: resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} @@ -11103,7 +10736,7 @@ packages: dependencies: '@emmetio/abbreviation': 2.3.3 '@emmetio/css-abbreviation': 2.1.8 - dev: false + dev: true /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -11360,14 +10993,14 @@ packages: dev: false optional: true - /esbuild-plugin-copy@2.1.1(esbuild@0.17.19): + /esbuild-plugin-copy@2.1.1(esbuild@0.18.16): resolution: {integrity: sha512-Bk66jpevTcV8KMFzZI1P7MZKZ+uDcrZm2G2egZ2jNIvVnivDpodZI+/KnpL3Jnap0PBdIHU7HwFGB8r+vV5CVw==} peerDependencies: esbuild: '>= 0.14.0' dependencies: chalk: 4.1.2 chokidar: 3.5.3 - esbuild: 0.17.19 + esbuild: 0.18.16 fs-extra: 10.1.0 globby: 11.1.0 dev: true @@ -11496,6 +11129,7 @@ packages: '@esbuild/win32-arm64': 0.17.19 '@esbuild/win32-ia32': 0.17.19 '@esbuild/win32-x64': 0.17.19 + dev: false /esbuild@0.18.16: resolution: {integrity: sha512-1xLsOXrDqwdHxyXb/x/SOyg59jpf/SH7YMvU5RNSU7z3TInaASNJWNFJ6iRvLvLETZMasF3d1DdZLg7sgRimRQ==} @@ -11541,7 +11175,6 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - dev: true /escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} @@ -11587,7 +11220,7 @@ packages: engines: {node: '>=4.0.0'} dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.43.0)(prettier@3.0.1): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -11600,7 +11233,7 @@ packages: dependencies: eslint: 8.43.0 eslint-config-prettier: 8.8.0(eslint@8.43.0) - prettier: 2.8.8 + prettier: 3.0.1 prettier-linter-helpers: 1.0.0 dev: true @@ -11727,7 +11360,7 @@ packages: dependencies: '@types/estree-jsx': 1.0.0 estree-util-is-identifier-name: 2.1.0 - estree-walker: 3.0.0 + estree-walker: 3.0.3 dev: false /estree-util-is-identifier-name@2.1.0: @@ -11755,12 +11388,15 @@ packages: /estree-walker@1.0.1: resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} + dev: false /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - /estree-walker@3.0.0: - resolution: {integrity: sha512-s6ceX0NFiU/vKPiKvFdR83U1Zffu7upwZsGwpoqfg5rbbq1l50WQ5hCeIvM6E6oD4shUHCYMsiFPns4Jk0YfMQ==} + /estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + dependencies: + '@types/estree': 1.0.1 dev: false /esutils@2.0.3: @@ -11772,31 +11408,6 @@ packages: engines: {node: '>= 0.6'} dev: false - /event-target-shim@6.0.2: - resolution: {integrity: sha512-8q3LsZjRezbFZ2PN+uP+Q7pnHUMmAOziU2vA2OwoFaKIXxlxl38IylhSSgUorWu/rf4er67w0ikBqjBFk/pomA==} - engines: {node: '>=10.13.0'} - dev: true - - /events@3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: false - - /execa@5.1.1: - resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 2.1.0 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - dev: false - /execa@6.1.0: resolution: {integrity: sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -11811,21 +11422,6 @@ packages: signal-exit: 3.0.7 strip-final-newline: 3.0.0 - /execa@7.1.1: - resolution: {integrity: sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - dev: false - /exit-hook@2.2.1: resolution: {integrity: sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==} engines: {node: '>=6'} @@ -11874,6 +11470,17 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 + /fast-glob@3.3.1: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -11939,21 +11546,6 @@ packages: dependencies: to-regex-range: 5.0.1 - /find-babel-config@2.0.0: - resolution: {integrity: sha512-dOKT7jvF3hGzlW60Gc3ONox/0rRZ/tz7WCil0bqA1In/3I8f1BctpXahRnEKDySZqci7u+dqq93sZST9fOJpFw==} - engines: {node: '>=16.0.0'} - dependencies: - json5: 2.2.3 - path-exists: 4.0.0 - dev: false - - /find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} - engines: {node: '>=6'} - dependencies: - locate-path: 3.0.0 - dev: false - /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -11985,7 +11577,6 @@ packages: /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true - dev: true /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} @@ -12130,7 +11721,6 @@ packages: /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - dev: true /get-func-name@2.0.0: resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} @@ -12183,8 +11773,8 @@ packages: - supports-color dev: true - /giget@1.1.2: - resolution: {integrity: sha512-HsLoS07HiQ5oqvObOI+Qb2tyZH4Gj5nYGfF9qQcZNrPw+uEFhdXtgJr01aO2pWadGHucajYDLxxbtQkm97ON2A==} + /giget@1.0.0: + resolution: {integrity: sha512-KWELZn3Nxq5+0So485poHrFriK9Bn3V/x9y+wgqrHkbmnGbjfLmZ685/SVA/ovW+ewoqW0gVI47pI4yW/VNobQ==} hasBin: true dependencies: colorette: 2.0.20 @@ -12193,7 +11783,7 @@ packages: mri: 1.2.0 node-fetch-native: 1.2.0 pathe: 1.1.0 - tar: 6.1.15 + tar: 6.1.14 transitivePeerDependencies: - supports-color dev: false @@ -12203,6 +11793,7 @@ packages: /github-slugger@1.5.0: resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} + dev: false /github-slugger@2.0.0: resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} @@ -12242,7 +11833,6 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} @@ -12254,17 +11844,6 @@ packages: once: 1.4.0 path-is-absolute: 1.0.1 - /glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - dev: false - /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -12286,27 +11865,13 @@ packages: /globalyzer@0.1.0: resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} - /globby@10.0.1: - resolution: {integrity: sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==} - engines: {node: '>=8'} - dependencies: - '@types/glob': 7.2.0 - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.2.12 - glob: 7.2.3 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 3.0.0 - dev: true - /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -12329,7 +11894,7 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 4.0.0 @@ -12367,7 +11932,6 @@ packages: /growl@1.10.5: resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} engines: {node: '>=4.x'} - dev: true /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} @@ -12696,20 +12260,10 @@ packages: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true - /human-signals@2.1.0: - resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} - engines: {node: '>=10.17.0'} - dev: false - /human-signals@3.0.1: resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==} engines: {node: '>=12.20.0'} - /human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - dev: false - /hyperid@3.1.1: resolution: {integrity: sha512-RveV33kIksycSf7HLkq1sHB5wW0OwuX8ot8MYnY++gaaPXGFfKpBncHrAWxdpuEeRlazUMGWefwP1w6o6GaumA==} dependencies: @@ -12742,14 +12296,6 @@ packages: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} - /image-size@1.0.2: - resolution: {integrity: sha512-xfOoWjceHntRb3qFCrh5ZFORYH8XCdYpASltMhZ/Q0KZiOwjdE/Yl2QCiWdwD+lygV5bMCvauzgu5PxBX/Yerg==} - engines: {node: '>=14.0.0'} - hasBin: true - dependencies: - queue: 6.0.2 - dev: false - /immutable@4.3.0: resolution: {integrity: sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==} @@ -12834,6 +12380,7 @@ packages: /is-arrayish@0.3.2: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + dev: false /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} @@ -12857,13 +12404,6 @@ packages: resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} engines: {node: '>=4'} - /is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - dependencies: - builtin-modules: 3.3.0 - dev: true - /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -12928,14 +12468,6 @@ packages: /is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} - /is-inside-container@1.0.0: - resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} - engines: {node: '>=14.16'} - hasBin: true - dependencies: - is-docker: 3.0.0 - dev: false - /is-interactive@2.0.0: resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} engines: {node: '>=12'} @@ -12943,6 +12475,7 @@ packages: /is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + dev: false /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} @@ -12986,17 +12519,11 @@ packages: /is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} - dev: true /is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} - /is-plain-object@3.0.1: - resolution: {integrity: sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==} - engines: {node: '>=0.10.0'} - dev: true - /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} engines: {node: '>=0.10.0'} @@ -13074,7 +12601,6 @@ packages: /is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} - dev: true /is-unicode-supported@1.3.0: resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} @@ -13086,6 +12612,11 @@ packages: dependencies: call-bind: 1.0.2 + /is-what@4.1.15: + resolution: {integrity: sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA==} + engines: {node: '>=12.13'} + dev: false + /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} @@ -13266,7 +12797,7 @@ packages: /jsonc-parser@2.3.1: resolution: {integrity: sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==} - dev: false + dev: true /jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} @@ -13316,6 +12847,10 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} + /kolorist@1.8.0: + resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + dev: false + /leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -13405,14 +12940,6 @@ packages: engines: {node: '>=14'} dev: false - /locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} - engines: {node: '>=6'} - dependencies: - p-locate: 3.0.0 - path-exists: 3.0.0 - dev: false - /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -13467,7 +12994,6 @@ packages: dependencies: chalk: 4.1.2 is-unicode-supported: 0.1.0 - dev: true /log-symbols@5.1.0: resolution: {integrity: sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==} @@ -13850,6 +13376,13 @@ packages: yargs-parser: 18.1.3 dev: true + /merge-anything@5.1.7: + resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==} + engines: {node: '>=12.13'} + dependencies: + is-what: 4.1.15 + dev: false + /merge-descriptors@1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: true @@ -14263,7 +13796,7 @@ packages: source-map-support: 0.5.21 stoppable: 1.1.0 undici: 5.22.1 - workerd: 1.20230807.0 + workerd: 1.20230814.1 ws: 8.13.0 youch: 3.2.3 zod: 3.20.6 @@ -14283,7 +13816,6 @@ packages: engines: {node: '>=10'} dependencies: brace-expansion: 1.1.11 - dev: true /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} @@ -14400,7 +13932,6 @@ packages: yargs: 16.2.0 yargs-parser: 20.2.4 yargs-unparser: 2.0.0 - dev: true /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} @@ -14421,6 +13952,10 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + /muggle-string@0.3.1: + resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} + dev: true + /mustache@4.2.0: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true @@ -14437,7 +13972,6 @@ packages: resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - dev: true /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} @@ -14470,13 +14004,13 @@ packages: engines: {node: '>= 0.4.0'} dev: true - /network-information-types@0.1.1(typescript@5.0.2): + /network-information-types@0.1.1(typescript@5.1.6): resolution: {integrity: sha512-mLXNafJYOkiJB6IlF727YWssTRpXitR+tKSLyA5VAdBi3SOvLf5gtizHgxf241YHPWocnAO/fAhVrB/68tPHDw==} peerDependencies: typescript: '>= 3.0.0' dependencies: - typescript: 5.0.2 - dev: false + typescript: 5.1.6 + dev: true /nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} @@ -14505,10 +14039,11 @@ packages: resolution: {integrity: sha512-zNy02qivjjRosswoYmPi8hIKJRr8MpQyeKT6qlcq/OnOgA3Rhoae+IYOqsM9V5+JnHWmxKnWOT2GxvtqdtOCXA==} engines: {node: '>=10'} dependencies: - semver: 7.5.4 + semver: 7.5.3 /node-addon-api@6.1.0: resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} + dev: false /node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} @@ -14519,8 +14054,8 @@ packages: resolution: {integrity: sha512-5IAMBTl9p6PaAjYCnMv5FmqIF6GcZnawAVnzaCG0rX2aYZJ4CxEkZNtVPuTRug7fL7wyM5BQYTlAzcyMPi6oTQ==} dev: false - /node-fetch@2.6.12: - resolution: {integrity: sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==} + /node-fetch@2.6.11: + resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==} engines: {node: 4.x || >=6.0.0} peerDependencies: encoding: ^0.1.0 @@ -14629,13 +14164,6 @@ packages: string.prototype.padend: 3.1.4 dev: true - /npm-run-path@4.0.1: - resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} - engines: {node: '>=8'} - dependencies: - path-key: 3.1.1 - dev: false - /npm-run-path@5.1.0: resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -14722,16 +14250,6 @@ packages: which-pm-runs: 1.1.0 dev: true - /open@9.1.0: - resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} - engines: {node: '>=14.16'} - dependencies: - default-browser: 4.0.0 - define-lazy-prop: 3.0.0 - is-inside-container: 1.0.0 - is-wsl: 2.2.0 - dev: false - /optionator@0.8.3: resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} engines: {node: '>= 0.8.0'} @@ -14816,13 +14334,6 @@ packages: yocto-queue: 1.0.0 dev: false - /p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} - engines: {node: '>=6'} - dependencies: - p-limit: 2.3.0 - dev: false - /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -14967,11 +14478,6 @@ packages: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: true - /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - dev: false - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -15021,7 +14527,7 @@ packages: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} dependencies: '@types/estree': 1.0.1 - estree-walker: 3.0.0 + estree-walker: 3.0.3 is-reference: 3.0.1 dev: false @@ -15069,13 +14575,6 @@ packages: pathe: 1.1.0 dev: false - /pkg-up@3.1.0: - resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} - engines: {node: '>=8'} - dependencies: - find-up: 3.0.0 - dev: false - /playwright-core@1.29.2: resolution: {integrity: sha512-94QXm4PMgFoHAhlCuoWyaBYKb92yOcGVHdQLoxQ7Wjlc7Flg4aC/jbFW7xMR52OfXMVkWicue4WXE7QEegbIRA==} engines: {node: '>=14'} @@ -15551,29 +15050,26 @@ packages: fast-diff: 1.2.0 dev: true - /prettier-plugin-astro@0.10.0: - resolution: {integrity: sha512-dPzop0gKZyVGpTDQmfy+e7FKXC9JT3mlpfYA2diOVz+Ui+QR1U4G/s+OesKl2Hib2JJOtAYJs/l+ovgT0ljlFA==} + /prettier-plugin-astro@0.11.0: + resolution: {integrity: sha512-rl2hJ4Kty/aEfGjk3i4JS+bpng9MjgvwqLRNzeb9NqYhqKoWNwOR39cIJXFjU1vR3zYOPnwWNRMelKb0orunYA==} engines: {node: ^14.15.0 || >=16.0.0, pnpm: '>=7.14.0'} dependencies: - '@astrojs/compiler': 1.8.0 - prettier: 2.8.8 + '@astrojs/compiler': 1.8.1 + prettier: 3.0.1 sass-formatter: 0.7.6 dev: true - /prettier-plugin-astro@0.8.1: - resolution: {integrity: sha512-lJ/mG/Lz/ccSwNtwqpFS126mtMVzFVyYv0ddTF9wqwrEG4seECjKDAyw/oGv915rAcJi8jr89990nqfpmG+qdg==} - engines: {node: ^14.15.0 || >=16.0.0, pnpm: '>=7.14.0'} - dependencies: - '@astrojs/compiler': 1.8.0 - prettier: 2.8.8 - sass-formatter: 0.7.6 - synckit: 0.8.5 - dev: false - /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true + dev: true + + /prettier@3.0.1: + resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} + engines: {node: '>=14'} + hasBin: true + dev: true /pretty-bytes@5.6.0: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} @@ -15675,12 +15171,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - /queue@6.0.2: - resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} - dependencies: - inherits: 2.0.4 - dev: false - /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} @@ -15730,6 +15220,11 @@ packages: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: false + /react-refresh@0.14.0: + resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==} + engines: {node: '>=0.10.0'} + dev: false + /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} @@ -16031,7 +15526,7 @@ packages: mdast-util-to-hast: 12.3.0 unified: 10.1.2 - /remark-shiki-twoslash@3.1.3(typescript@5.0.2): + /remark-shiki-twoslash@3.1.3(typescript@5.1.6): resolution: {integrity: sha512-4e8OH3ySOCw5wUbDcPszokOKjKuebOqlP2WlySvC7ITBOq27BiGsFlq+FNWhxppZ+JzhTWah4gQrnMjX3KDbAQ==} peerDependencies: typescript: '>3' @@ -16042,9 +15537,9 @@ packages: fenceparser: 1.1.1 regenerator-runtime: 0.13.11 shiki: 0.10.1 - shiki-twoslash: 3.1.2(typescript@5.0.2) + shiki-twoslash: 3.1.2(typescript@5.1.6) tslib: 2.1.0 - typescript: 5.0.2 + typescript: 5.1.6 unist-util-visit: 2.0.3 transitivePeerDependencies: - supports-color @@ -16067,10 +15562,13 @@ packages: unified: 10.1.2 dev: true + /request-light@0.7.0: + resolution: {integrity: sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==} + dev: true + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} - dev: true /require-from-string@2.0.2: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} @@ -16085,10 +15583,6 @@ packages: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} dev: true - /reselect@4.1.8: - resolution: {integrity: sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==} - dev: false - /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -16163,17 +15657,6 @@ packages: dependencies: glob: 7.2.3 - /rollup-plugin-copy@3.4.0: - resolution: {integrity: sha512-rGUmYYsYsceRJRqLVlE9FivJMxJ7X6jDlP79fmFkL8sJs7VVMSVyA2yfyL+PGyO/vJs4A87hwhgVfz61njI+uQ==} - engines: {node: '>=8.3'} - dependencies: - '@types/fs-extra': 8.1.2 - colorette: 1.4.0 - fs-extra: 8.1.0 - globby: 10.0.1 - is-plain-object: 3.0.1 - dev: true - /rollup-plugin-inject@3.0.2: resolution: {integrity: sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==} deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. @@ -16217,6 +15700,7 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 + dev: false /rollup@3.20.1: resolution: {integrity: sha512-sz2w8cBJlWQ2E17RcpvHuf4sk2BQx4tfKDnjNPikEpLEevrbIAR7CH3PGa2hpPwWbNgPaA9yh9Jzljds5bc9zg==} @@ -16233,20 +15717,13 @@ packages: optionalDependencies: fsevents: 2.3.2 - /rollup@3.26.3: - resolution: {integrity: sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ==} + /rollup@3.27.0: + resolution: {integrity: sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: fsevents: 2.3.2 - /run-applescript@5.0.0: - resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} - engines: {node: '>=12'} - dependencies: - execa: 5.1.1 - dev: false - /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -16254,6 +15731,7 @@ packages: /s.color@0.0.15: resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==} + dev: true /sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} @@ -16279,6 +15757,7 @@ packages: resolution: {integrity: sha512-hXdxU6PCkiV3XAiSnX+XLqz2ohHoEnVUlrd8LEVMAI80uB1+OTScIkH9n6qQwImZpTye1r1WG1rbGUteHNhoHg==} dependencies: suf-log: 2.5.3 + dev: true /sass@1.63.4: resolution: {integrity: sha512-Sx/+weUmK+oiIlI+9sdD0wZHsqpbgQg8wSwSnGBjwb5GwqFhYNwwnI+UWZtLjKvKyFlKkatRK235qQ3mokyPoQ==} @@ -16349,13 +15828,6 @@ packages: dependencies: lru-cache: 6.0.0 - /semver@7.5.4: - resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -16387,7 +15859,6 @@ packages: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} dependencies: randombytes: 2.1.0 - dev: true /seroval@0.5.1: resolution: {integrity: sha512-ZfhQVB59hmIauJG5Ydynupy8KHyr5imGNtdDhbZG68Ufh1Ynkv9KOYOAABf71oVbQxJ8VkWnMHAjEHE7fWkH5g==} @@ -16419,6 +15890,7 @@ packages: simple-get: 4.0.1 tar-fs: 2.1.1 tunnel-agent: 0.6.0 + dev: false /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} @@ -16450,7 +15922,7 @@ packages: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} dev: true - /shiki-twoslash@3.1.2(typescript@5.0.2): + /shiki-twoslash@3.1.2(typescript@5.1.6): resolution: {integrity: sha512-JBcRIIizi+exIA/OUhYkV6jtyeZco0ykCkIRd5sgwIt1Pm4pz+maoaRZpm6SkhPwvif4fCA7xOtJOykhpIV64Q==} peerDependencies: typescript: '>3' @@ -16459,7 +15931,7 @@ packages: '@typescript/vfs': 1.3.4 fenceparser: 1.1.1 shiki: 0.10.1 - typescript: 5.0.2 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -16512,6 +15984,7 @@ packages: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} dependencies: is-arrayish: 0.3.2 + dev: false /sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -16588,6 +16061,17 @@ packages: csstype: 3.1.2 seroval: 0.5.1 + /solid-refresh@0.5.3(solid-js@1.7.6): + resolution: {integrity: sha512-Otg5it5sjOdZbQZJnvo99TEBAr6J7PQ5AubZLNU6szZzg3RQQ5MX04oteBIIGDs0y2Qv8aXKm9e44V8z+UnFdw==} + peerDependencies: + solid-js: ^1.3 + dependencies: + '@babel/generator': 7.22.5 + '@babel/helper-module-imports': 7.22.5 + '@babel/types': 7.22.5 + solid-js: 1.7.6 + dev: false + /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -16705,6 +16189,7 @@ packages: /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} + dev: true /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -16821,11 +16306,6 @@ packages: engines: {node: '>=10'} dev: false - /strip-final-newline@2.0.0: - resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} - engines: {node: '>=6'} - dev: false - /strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} @@ -16844,7 +16324,6 @@ packages: /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - dev: true /strip-json-comments@5.0.0: resolution: {integrity: sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==} @@ -16890,6 +16369,7 @@ packages: resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==} dependencies: s.color: 0.0.15 + dev: true /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -16908,7 +16388,6 @@ packages: engines: {node: '>=10'} dependencies: has-flag: 4.0.0 - dev: true /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} @@ -16923,7 +16402,7 @@ packages: svelte: 3.59.1 dev: false - /svelte2tsx@0.6.15(svelte@3.59.1)(typescript@5.0.2): + /svelte2tsx@0.6.15(svelte@3.59.1)(typescript@5.1.6): resolution: {integrity: sha512-+j6RmA3g5pPs1DHa/rdzJjjhZuCfWx0IbNPaR99A2bvOSPPY6BlVkBGU0urI+DGcWHhYEG28Flo942KqlAkpEQ==} peerDependencies: svelte: ^3.55 || ^4.0 @@ -16935,7 +16414,7 @@ packages: dedent-js: 1.0.1 pascal-case: 3.1.2 svelte: 3.59.1 - typescript: 5.0.2 + typescript: 5.1.6 dev: false /svelte@3.59.1: @@ -16950,14 +16429,6 @@ packages: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true - /synckit@0.8.5: - resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} - engines: {node: ^14.18.0 || >=16.0.0} - dependencies: - '@pkgr/utils': 2.4.0 - tslib: 2.5.3 - dev: false - /tailwindcss@3.3.2: resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} engines: {node: '>=14.0.0'} @@ -17012,6 +16483,18 @@ packages: inherits: 2.0.4 readable-stream: 3.6.2 + /tar@6.1.14: + resolution: {integrity: sha512-piERznXu0U7/pW7cdSn7hjqySIVTYT6F76icmFk7ptU7dDYlXTm5r9A6K04R2vU3olYgoKeo1Cg3eeu5nhftAw==} + engines: {node: '>=10'} + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 5.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + dev: false + /tar@6.1.15: resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==} engines: {node: '>=10'} @@ -17105,11 +16588,6 @@ packages: engines: {node: '>=14.0.0'} dev: false - /titleize@3.0.0: - resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} - engines: {node: '>=12'} - dev: false - /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -17168,13 +16646,13 @@ packages: /trough@2.1.0: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} - /ts-api-utils@1.0.1(typescript@5.0.2): + /ts-api-utils@1.0.1(typescript@5.1.6): resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.0.2 + typescript: 5.1.6 dev: true /ts-interface-checker@0.1.13: @@ -17369,9 +16847,19 @@ packages: for-each: 0.3.3 is-typed-array: 1.1.10 - /typescript@5.0.2: - resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} - engines: {node: '>=12.20'} + /typesafe-path@0.2.2: + resolution: {integrity: sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==} + dev: true + + /typescript-auto-import-cache@0.3.0: + resolution: {integrity: sha512-Rq6/q4O9iyqUdjvOoyas7x/Qf9nWUMeqpP3YeTaLA+uECgfy5wOhfOS+SW/+fZ/uI/ZcKaf+2/ZhFzXh8xfofQ==} + dependencies: + semver: 7.5.3 + dev: true + + /typescript@5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + engines: {node: '>=14.17'} hasBin: true /ufo@1.1.2: @@ -17409,6 +16897,7 @@ packages: engines: {node: '>=14.0'} dependencies: busboy: 1.6.0 + dev: true /unherit@3.0.1: resolution: {integrity: sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==} @@ -17589,11 +17078,6 @@ packages: engines: {node: '>= 0.8'} dev: true - /untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - dev: false - /upath@1.2.0: resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} engines: {node: '>=4'} @@ -17625,10 +17109,6 @@ packages: requires-port: 1.0.0 dev: true - /urlpattern-polyfill@1.0.0-rc5: - resolution: {integrity: sha512-OxVmQLKMQbDZX1m8Ljuf26rzMUJ7lm3cnBAicqrB0qmo1qb/koH7EXayeHiZdiyc6Z0OnaHETW2JCoVHgTnGGA==} - dev: true - /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -17726,6 +17206,27 @@ packages: - supports-color dev: false + /vite-plugin-solid@2.7.0(solid-js@1.7.6): + resolution: {integrity: sha512-avp/Jl5zOp/Itfo67xtDB2O61U7idviaIp4mLsjhCa13PjKNasz+IID0jYTyqUp9SFx6/PmBr6v4KgDppqompg==} + peerDependencies: + solid-js: ^1.7.2 + vite: ^3.0.0 || ^4.0.0 + peerDependenciesMeta: + vite: + optional: true + dependencies: + '@babel/core': 7.22.5 + '@babel/preset-typescript': 7.22.5(@babel/core@7.22.5) + '@types/babel__core': 7.20.1 + babel-preset-solid: 1.7.4(@babel/core@7.22.5) + merge-anything: 5.1.7 + solid-js: 1.7.6 + solid-refresh: 0.5.3(solid-js@1.7.6) + vitefu: 0.2.4(vite@4.4.6) + transitivePeerDependencies: + - supports-color + dev: false + /vite@4.3.9(@types/node@18.16.18): resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -17790,7 +17291,7 @@ packages: '@types/node': 14.18.51 esbuild: 0.18.16 postcss: 8.4.27 - rollup: 3.26.3 + rollup: 3.27.0 optionalDependencies: fsevents: 2.3.2 dev: true @@ -17826,7 +17327,7 @@ packages: '@types/node': 18.16.18 esbuild: 0.18.16 postcss: 8.4.27 - rollup: 3.26.3 + rollup: 3.27.0 sass: 1.63.4 optionalDependencies: fsevents: 2.3.2 @@ -17917,6 +17418,89 @@ packages: acorn-walk: 8.2.0 dev: true + /volar-service-css@0.0.11(@volar/language-service@1.10.0): + resolution: {integrity: sha512-8wkycHM+wSbsRSEvW4GCj3rKJRj+KxnGfRhQC1GfQVx4eMHJHHeSrB4ANPm5mBYbmnJPIxxIgZHp7VoMqDZH4g==} + peerDependencies: + '@volar/language-service': ~1.10.0 + peerDependenciesMeta: + '@volar/language-service': + optional: true + dependencies: + '@volar/language-service': 1.10.0 + vscode-css-languageservice: 6.2.6 + vscode-uri: 3.0.7 + dev: true + + /volar-service-emmet@0.0.11(@volar/language-service@1.10.0): + resolution: {integrity: sha512-9q6F1FaL3q/kxvt8EhbAmW8FtIf8Zi9FMHbuPSOQMn7/JlfXBtkB7y97uXvtQWpoxCumkuhY7kb1iBwtu7U+Eg==} + peerDependencies: + '@volar/language-service': ~1.10.0 + peerDependenciesMeta: + '@volar/language-service': + optional: true + dependencies: + '@volar/language-service': 1.10.0 + '@vscode/emmet-helper': 2.8.8 + volar-service-html: 0.0.11(@volar/language-service@1.10.0) + dev: true + + /volar-service-html@0.0.11(@volar/language-service@1.10.0): + resolution: {integrity: sha512-Lm8ynBTDI8wMsPwZCoo5s195HBOGCONSZq4sUvrVXPjD1i5eKf+rYIVm7+h/cgbdqZApe8dWFbbqXgLGLodwIA==} + peerDependencies: + '@volar/language-service': ~1.10.0 + peerDependenciesMeta: + '@volar/language-service': + optional: true + dependencies: + '@volar/language-service': 1.10.0 + vscode-html-languageservice: 5.0.6 + vscode-uri: 3.0.7 + dev: true + + /volar-service-prettier@0.0.11(@volar/language-service@1.10.0)(prettier@3.0.1): + resolution: {integrity: sha512-A4vEU5BUitNNAySb+t/fCjEoL01uYUkoe/Fe5UxR3JJbdgr2nTeXb5IlW90/1vzmnTKZznadJV4i1SoAf2CRbg==} + peerDependencies: + '@volar/language-service': ~1.10.0 + prettier: ^2.2 || ^3.0 + peerDependenciesMeta: + '@volar/language-service': + optional: true + prettier: + optional: true + dependencies: + '@volar/language-service': 1.10.0 + prettier: 3.0.1 + dev: true + + /volar-service-typescript-twoslash-queries@0.0.11(@volar/language-service@1.10.0): + resolution: {integrity: sha512-onNK1g3vZVlPiD9HHFrGVNkdFWndosDSkMUWOWN5PxcocvVuZRZ8TN2iB2Ct0VDIZaXN3PK+fQpPCpq+yy1fXA==} + peerDependencies: + '@volar/language-service': ~1.10.0 + peerDependenciesMeta: + '@volar/language-service': + optional: true + dependencies: + '@volar/language-service': 1.10.0 + dev: true + + /volar-service-typescript@0.0.11(@volar/language-service@1.10.0)(@volar/typescript@1.10.0): + resolution: {integrity: sha512-l0zY4RuqmLFIdqcKk8IfG2F1M0cn9Km1AdtTld1/kj8KyGhQfe2PsuVjz9wCG6SsR6kQt97YrpscZDvhb5aqQA==} + peerDependencies: + '@volar/language-service': ~1.10.0 + '@volar/typescript': ~1.10.0 + peerDependenciesMeta: + '@volar/language-service': + optional: true + dependencies: + '@volar/language-service': 1.10.0 + '@volar/typescript': 1.10.0 + semver: 7.5.3 + typescript-auto-import-cache: 0.3.0 + vscode-languageserver-textdocument: 1.0.8 + vscode-nls: 5.2.0 + vscode-uri: 3.0.7 + dev: true + /vscode-css-languageservice@6.2.6: resolution: {integrity: sha512-SA2WkeOecIpUiEbZnjOsP/fI5CRITZEiQGSHXKiDQDwLApfKcnLhZwMtOBbIifSzESVcQa7b/shX/nbnF4NoCg==} dependencies: @@ -17924,43 +17508,47 @@ packages: vscode-languageserver-textdocument: 1.0.8 vscode-languageserver-types: 3.17.3 vscode-uri: 3.0.7 - dev: false + dev: true - /vscode-html-languageservice@5.0.5: - resolution: {integrity: sha512-7788ZT+I7/UhFoI4+bzaAiGGZEW7X39kTeuytLtw6jJA6W7ez85bWKYoFDcwrPNmywj3n/IkU9Op9asaje44jg==} + /vscode-html-languageservice@5.0.6: + resolution: {integrity: sha512-gCixNg6fjPO7+kwSMBAVXcwDRHdjz1WOyNfI0n5Wx0J7dfHG8ggb3zD1FI8E2daTZrwS1cooOiSoc1Xxph4qRQ==} dependencies: - '@vscode/l10n': 0.0.13 + '@vscode/l10n': 0.0.14 vscode-languageserver-textdocument: 1.0.8 vscode-languageserver-types: 3.17.3 vscode-uri: 3.0.7 - dev: false + dev: true /vscode-jsonrpc@8.1.0: resolution: {integrity: sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==} engines: {node: '>=14.0.0'} - dev: false + dev: true /vscode-languageserver-protocol@3.17.3: resolution: {integrity: sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==} dependencies: vscode-jsonrpc: 8.1.0 vscode-languageserver-types: 3.17.3 - dev: false + dev: true /vscode-languageserver-textdocument@1.0.8: resolution: {integrity: sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==} - dev: false + dev: true /vscode-languageserver-types@3.17.3: resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==} - dev: false + dev: true /vscode-languageserver@8.1.0: resolution: {integrity: sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==} hasBin: true dependencies: vscode-languageserver-protocol: 3.17.3 - dev: false + dev: true + + /vscode-nls@5.2.0: + resolution: {integrity: sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==} + dev: true /vscode-oniguruma@1.7.0: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} @@ -17974,11 +17562,11 @@ packages: /vscode-uri@2.1.2: resolution: {integrity: sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==} - dev: false + dev: true /vscode-uri@3.0.7: resolution: {integrity: sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==} - dev: false + dev: true /vue@3.3.4: resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} @@ -18322,22 +17910,21 @@ packages: workbox-core: 6.6.0 dev: false - /workerd@1.20230807.0: - resolution: {integrity: sha512-yDdHld8wm5lQ6M/WYD68tIzbAmPjcgAoVAYhAHQFaXZSpryjIw9mT3O/NEloyZ8xiickpoPuNSQ4ffxPLao2+Q==} + /workerd@1.20230814.1: + resolution: {integrity: sha512-zJeSEteXuAD+bpYJT8WvzTAHvIAkKPVxOV+Jy6zCLKz5e08N3OUbAF+wrvGWc8b2aB1sj+IYsdXfkv4puH+qXQ==} engines: {node: '>=16'} hasBin: true requiresBuild: true optionalDependencies: - '@cloudflare/workerd-darwin-64': 1.20230807.0 - '@cloudflare/workerd-darwin-arm64': 1.20230807.0 - '@cloudflare/workerd-linux-64': 1.20230807.0 - '@cloudflare/workerd-linux-arm64': 1.20230807.0 - '@cloudflare/workerd-windows-64': 1.20230807.0 + '@cloudflare/workerd-darwin-64': 1.20230814.1 + '@cloudflare/workerd-darwin-arm64': 1.20230814.1 + '@cloudflare/workerd-linux-64': 1.20230814.1 + '@cloudflare/workerd-linux-arm64': 1.20230814.1 + '@cloudflare/workerd-windows-64': 1.20230814.1 dev: true /workerpool@6.2.0: resolution: {integrity: sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==} - dev: true /wrangler@3.5.0: resolution: {integrity: sha512-lvYo2JUxRXdobzd0hs96FT354DvKAYoAiPslceEpKmr0oHCreMWhU5AStfZwg1PEaJJZCwP17LqA5GgjvQ6zyg==} @@ -18380,7 +17967,6 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: true /wrap-ansi@8.1.0: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} @@ -18449,7 +18035,6 @@ packages: /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} - dev: true /yallist@2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} @@ -18476,7 +18061,6 @@ packages: /yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} - dev: true /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} @@ -18490,7 +18074,6 @@ packages: decamelize: 4.0.0 flat: 5.0.2 is-plain-obj: 2.1.0 - dev: true /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} @@ -18520,7 +18103,6 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 20.2.4 - dev: true /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} @@ -18566,21 +18148,25 @@ packages: file:packages/astro/test/fixtures/css-assets/packages/font-awesome: resolution: {directory: packages/astro/test/fixtures/css-assets/packages/font-awesome, type: directory} name: '@test/astro-font-awesome-package' + version: 0.0.1 dev: false file:packages/astro/test/fixtures/multiple-renderers/renderers/one: resolution: {directory: packages/astro/test/fixtures/multiple-renderers/renderers/one, type: directory} name: '@test/astro-renderer-one' + version: 1.0.0 dev: false file:packages/astro/test/fixtures/multiple-renderers/renderers/two: resolution: {directory: packages/astro/test/fixtures/multiple-renderers/renderers/two, type: directory} name: '@test/astro-renderer-two' + version: 1.0.0 dev: false file:packages/astro/test/fixtures/solid-component/deps/solid-jsx-component: resolution: {directory: packages/astro/test/fixtures/solid-component/deps/solid-jsx-component, type: directory} name: '@test/solid-jsx-component' + version: 0.0.0 dependencies: solid-js: 1.7.6 dev: false diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index 6d1189b71..b516e6b51 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -12,7 +12,7 @@ const defaultConfig = { minify: false, format: 'esm', platform: 'node', - target: 'node16', + target: 'node18', sourcemap: false, sourcesContent: false, }; diff --git a/scripts/package.json b/scripts/package.json index 1bb517750..e6b97f60f 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -8,9 +8,8 @@ "astro-scripts": "./index.js" }, "dependencies": { - "@astrojs/webapi": "workspace:*", "arg": "^5.0.2", - "esbuild": "^0.17.19", + "esbuild": "^0.18.16", "globby": "^12.2.0", "kleur": "^4.1.4", "p-limit": "^4.0.0", diff --git a/scripts/smoke/cleanup.js b/scripts/smoke/cleanup.js index 0d7db79f3..3b03951f9 100644 --- a/scripts/smoke/cleanup.js +++ b/scripts/smoke/cleanup.js @@ -3,11 +3,8 @@ // @ts-check import { execa } from 'execa'; -import { polyfill } from '@astrojs/webapi'; -import { fileURLToPath } from 'node:url'; import { promises as fs } from 'node:fs'; - -polyfill(globalThis, { exclude: 'window document' }); +import { fileURLToPath } from 'node:url'; /* Configuration /* ========================================================================== */ diff --git a/scripts/smoke/index.js b/scripts/smoke/index.js index 9bdaff820..7ab78e286 100644 --- a/scripts/smoke/index.js +++ b/scripts/smoke/index.js @@ -3,11 +3,8 @@ // @ts-check import { execa } from 'execa'; -import { polyfill } from '@astrojs/webapi'; -import { fileURLToPath } from 'node:url'; import { promises as fs } from 'node:fs'; - -polyfill(globalThis, { exclude: 'window document' }); +import { fileURLToPath } from 'node:url'; /** URL directory containing the entire project. */ const rootDir = new URL('../../', import.meta.url); diff --git a/tsconfig.base.json b/tsconfig.base.json index 0eb3c65c1..337005ad4 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -3,7 +3,8 @@ "declaration": true, "emitDeclarationOnly": true, "strict": true, - "moduleResolution": "node", + // All packages are built with ESBuild, so we can use `moduleResolution: 'bundler'` + "moduleResolution": "Bundler", "esModuleInterop": true, "skipLibCheck": true, "verbatimModuleSyntax": true