summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/afraid-dots-whisper.md31
-rw-r--r--.changeset/chilled-ducks-grin.md5
-rw-r--r--.changeset/dirty-lies-cover.md32
-rw-r--r--.changeset/fair-emus-divide.md39
-rw-r--r--.changeset/famous-queens-itch.md5
-rw-r--r--.changeset/four-houses-compete.md18
-rw-r--r--.changeset/gentle-deers-yawn.md5
-rw-r--r--.changeset/gentle-meals-crash.md9
-rw-r--r--.changeset/heavy-walls-arrive.md8
-rw-r--r--.changeset/loud-candles-admire.md5
-rw-r--r--.changeset/mighty-dancers-lay.md5
-rw-r--r--.changeset/neat-suns-search.md17
-rw-r--r--.changeset/odd-books-live.md23
-rw-r--r--.changeset/pre.json57
-rw-r--r--.changeset/purple-buses-prove.md5
-rw-r--r--.changeset/rude-ears-play.md5
-rw-r--r--.changeset/six-grapes-look.md15
-rw-r--r--.changeset/spicy-eels-rush.md8
-rw-r--r--.changeset/three-adults-exist.md5
-rw-r--r--.changeset/three-onions-repeat.md5
-rw-r--r--.changeset/tricky-candles-suffer.md39
-rw-r--r--.changeset/twelve-coats-rush.md35
-rw-r--r--.changeset/twenty-cheetahs-deny.md17
-rw-r--r--.changeset/unlucky-hotels-try.md5
-rw-r--r--.changeset/unlucky-ravens-type.md14
-rw-r--r--.changeset/unlucky-sheep-build.md7
-rw-r--r--.changeset/violet-peaches-invent.md5
-rw-r--r--.changeset/young-roses-teach.md5
-rw-r--r--.devcontainer/basics/devcontainer.json4
-rw-r--r--.devcontainer/blog/devcontainer.json4
-rw-r--r--.devcontainer/deno/devcontainer.json4
-rw-r--r--.devcontainer/docs/devcontainer.json4
-rw-r--r--.devcontainer/framework-alpine/devcontainer.json4
-rw-r--r--.devcontainer/framework-lit/devcontainer.json4
-rw-r--r--.devcontainer/framework-multiple/devcontainer.json4
-rw-r--r--.devcontainer/framework-preact/devcontainer.json4
-rw-r--r--.devcontainer/framework-react/devcontainer.json4
-rw-r--r--.devcontainer/framework-solid/devcontainer.json4
-rw-r--r--.devcontainer/framework-svelte/devcontainer.json4
-rw-r--r--.devcontainer/framework-vue/devcontainer.json4
-rw-r--r--.devcontainer/hackernews/devcontainer.json4
-rw-r--r--.devcontainer/minimal/devcontainer.json4
-rw-r--r--.devcontainer/non-html-pages/devcontainer.json4
-rw-r--r--.devcontainer/portfolio/devcontainer.json4
-rw-r--r--.devcontainer/ssr/devcontainer.json4
-rw-r--r--.devcontainer/with-markdown-plugins/devcontainer.json4
-rw-r--r--.devcontainer/with-markdown-shiki/devcontainer.json4
-rw-r--r--.devcontainer/with-mdx/devcontainer.json4
-rw-r--r--.devcontainer/with-nanostores/devcontainer.json4
-rw-r--r--.devcontainer/with-tailwindcss/devcontainer.json4
-rw-r--r--.devcontainer/with-vite-plugin-pwa/devcontainer.json4
-rw-r--r--.devcontainer/with-vitest/devcontainer.json4
-rw-r--r--.eslintignore1
-rw-r--r--.github/ISSUE_TEMPLATE/---01-bug-report.yml2
-rw-r--r--.github/workflows/check.yml2
-rw-r--r--.github/workflows/ci.yml14
-rw-r--r--.github/workflows/main.yml2
-rw-r--r--.github/workflows/release.yml2
-rw-r--r--.github/workflows/scripts.yml2
-rw-r--r--.github/workflows/snapshot-release.yml2
-rw-r--r--.gitpod.yml2
-rw-r--r--.nvmrc2
-rw-r--r--.prettierignore1
-rw-r--r--.prettierrc.cjs2
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--benchmark/packages/timer/package.json1
-rw-r--r--benchmark/packages/timer/src/server.ts7
-rw-r--r--benchmark/packages/timer/tsconfig.json4
-rw-r--r--examples/basics/README.md2
-rw-r--r--examples/basics/sandbox.config.json2
-rw-r--r--examples/blog/README.md2
-rw-r--r--examples/blog/package.json8
-rw-r--r--examples/blog/sandbox.config.json2
-rw-r--r--examples/blog/src/content/blog/markdown-style-guide.md2
-rw-r--r--examples/blog/src/pages/blog/[...slug].astro2
-rw-r--r--examples/component/package.json2
-rw-r--r--examples/deno/README.md2
-rw-r--r--examples/deno/package.json4
-rw-r--r--examples/deno/sandbox.config.json2
-rw-r--r--examples/framework-alpine/package.json4
-rw-r--r--examples/framework-alpine/sandbox.config.json2
-rw-r--r--examples/framework-lit/package.json4
-rw-r--r--examples/framework-lit/sandbox.config.json2
-rw-r--r--examples/framework-multiple/package.json12
-rw-r--r--examples/framework-multiple/sandbox.config.json2
-rw-r--r--examples/framework-preact/package.json4
-rw-r--r--examples/framework-preact/sandbox.config.json2
-rw-r--r--examples/framework-react/package.json4
-rw-r--r--examples/framework-react/sandbox.config.json2
-rw-r--r--examples/framework-solid/package.json4
-rw-r--r--examples/framework-solid/sandbox.config.json2
-rw-r--r--examples/framework-svelte/package.json4
-rw-r--r--examples/framework-svelte/sandbox.config.json2
-rw-r--r--examples/framework-vue/package.json4
-rw-r--r--examples/framework-vue/sandbox.config.json2
-rw-r--r--examples/hackernews/README.md2
-rw-r--r--examples/hackernews/package.json4
-rw-r--r--examples/hackernews/sandbox.config.json2
-rw-r--r--examples/integration/package.json2
-rw-r--r--examples/middleware/package.json4
-rw-r--r--examples/minimal/README.md2
-rw-r--r--examples/minimal/package.json2
-rw-r--r--examples/minimal/sandbox.config.json2
-rw-r--r--examples/non-html-pages/README.md2
-rw-r--r--examples/non-html-pages/package.json2
-rw-r--r--examples/non-html-pages/sandbox.config.json2
-rw-r--r--examples/portfolio/README.md2
-rw-r--r--examples/portfolio/package.json2
-rw-r--r--examples/portfolio/sandbox.config.json2
-rw-r--r--examples/portfolio/src/pages/work/[...slug].astro2
-rw-r--r--examples/ssr/package.json6
-rw-r--r--examples/ssr/src/pages/cart.astro2
-rw-r--r--examples/with-markdoc/README.md2
-rw-r--r--examples/with-markdoc/package.json4
-rw-r--r--examples/with-markdoc/sandbox.config.json2
-rw-r--r--examples/with-markdown-plugins/package.json4
-rw-r--r--examples/with-markdown-plugins/sandbox.config.json2
-rw-r--r--examples/with-markdown-shiki/package.json2
-rw-r--r--examples/with-markdown-shiki/sandbox.config.json2
-rw-r--r--examples/with-mdx/package.json6
-rw-r--r--examples/with-mdx/sandbox.config.json2
-rw-r--r--examples/with-nanostores/package.json4
-rw-r--r--examples/with-nanostores/sandbox.config.json2
-rw-r--r--examples/with-tailwindcss/package.json5
-rw-r--r--examples/with-tailwindcss/sandbox.config.json2
-rw-r--r--examples/with-vite-plugin-pwa/README.md2
-rw-r--r--examples/with-vite-plugin-pwa/package.json2
-rw-r--r--examples/with-vite-plugin-pwa/sandbox.config.json2
-rw-r--r--examples/with-vitest/package.json2
-rw-r--r--examples/with-vitest/sandbox.config.json2
-rw-r--r--package.json14
-rw-r--r--packages/astro-prism/CHANGELOG.md6
-rw-r--r--packages/astro-prism/package.json6
-rw-r--r--packages/astro-prism/tsconfig.json2
-rw-r--r--packages/astro-rss/CHANGELOG.md6
-rw-r--r--packages/astro-rss/package.json2
-rw-r--r--packages/astro-rss/tsconfig.json2
-rw-r--r--packages/astro/CHANGELOG.md219
-rw-r--r--packages/astro/astro-jsx.d.ts2
-rwxr-xr-xpackages/astro/astro.js4
-rw-r--r--packages/astro/content-types.template.d.ts12
-rw-r--r--packages/astro/e2e/astro-envs.test.js4
-rw-r--r--packages/astro/package.json32
-rw-r--r--packages/astro/src/@types/astro.ts109
-rw-r--r--packages/astro/src/assets/generate.ts5
-rw-r--r--packages/astro/src/assets/image-endpoint.ts2
-rw-r--r--packages/astro/src/assets/services/noop.ts17
-rw-r--r--packages/astro/src/assets/vite-plugin-assets.ts27
-rw-r--r--packages/astro/src/cli/check/index.ts419
-rw-r--r--packages/astro/src/cli/check/print.ts119
-rw-r--r--packages/astro/src/cli/dev/index.ts2
-rw-r--r--packages/astro/src/cli/index.ts16
-rw-r--r--packages/astro/src/cli/install-package.ts124
-rw-r--r--packages/astro/src/core/app/index.ts1
-rw-r--r--packages/astro/src/core/app/node.ts1
-rw-r--r--packages/astro/src/core/app/types.ts2
-rw-r--r--packages/astro/src/core/build/generate.ts8
-rw-r--r--packages/astro/src/core/build/plugins/plugin-analyzer.ts3
-rw-r--r--packages/astro/src/core/build/plugins/plugin-pages.ts6
-rw-r--r--packages/astro/src/core/build/plugins/plugin-ssr.ts27
-rw-r--r--packages/astro/src/core/config/schema.ts40
-rw-r--r--packages/astro/src/core/cookies/cookies.ts16
-rw-r--r--packages/astro/src/core/create-vite.ts25
-rw-r--r--packages/astro/src/core/endpoint/index.ts6
-rw-r--r--packages/astro/src/core/logger/console.ts2
-rw-r--r--packages/astro/src/core/logger/core.ts69
-rw-r--r--packages/astro/src/core/logger/node.ts14
-rw-r--r--packages/astro/src/core/polyfill.ts23
-rw-r--r--packages/astro/src/core/render/core.ts8
-rw-r--r--packages/astro/src/core/render/environment.ts5
-rw-r--r--packages/astro/src/core/render/params-and-props.ts1
-rw-r--r--packages/astro/src/core/render/result.ts34
-rw-r--r--packages/astro/src/core/render/route-cache.ts11
-rw-r--r--packages/astro/src/core/routing/validation.ts19
-rw-r--r--packages/astro/src/integrations/astroFeaturesValidation.ts157
-rw-r--r--packages/astro/src/integrations/index.ts102
-rw-r--r--packages/astro/src/runtime/server/endpoint.ts65
-rw-r--r--packages/astro/src/runtime/server/render/page.ts3
-rw-r--r--packages/astro/src/runtime/server/response.ts80
-rw-r--r--packages/astro/src/vite-plugin-astro-postprocess/index.ts3
-rw-r--r--packages/astro/src/vite-plugin-astro-server/environment.ts1
-rw-r--r--packages/astro/src/vite-plugin-astro-server/plugin.ts1
-rw-r--r--packages/astro/src/vite-plugin-head/index.ts2
-rw-r--r--packages/astro/test/0-css.test.js42
-rw-r--r--packages/astro/test/astro-envs.test.js4
-rw-r--r--packages/astro/test/astro-get-static-paths.test.js7
-rw-r--r--packages/astro/test/astro-global.test.js6
-rw-r--r--packages/astro/test/astro-partial-html.test.js2
-rw-r--r--packages/astro/test/cli.test.js4
-rw-r--r--packages/astro/test/config-vite-css-target.test.js2
-rw-r--r--packages/astro/test/custom-elements.test.js70
-rw-r--r--packages/astro/test/dev-routing.test.js8
-rw-r--r--packages/astro/test/featuresSupport.test.js55
-rw-r--r--packages/astro/test/fixtures/api-routes/src/pages/binary.dat.ts2
-rw-r--r--packages/astro/test/fixtures/api-routes/src/pages/context/data/[param].json.js2
-rw-r--r--packages/astro/test/fixtures/astro-basic/astro.config.mjs2
-rw-r--r--packages/astro/test/fixtures/astro-cookies/src/pages/early-return.astro2
-rw-r--r--packages/astro/test/fixtures/astro-cookies/src/pages/get-json.astro2
-rw-r--r--packages/astro/test/fixtures/astro-cookies/src/pages/set-prefs.js2
-rw-r--r--packages/astro/test/fixtures/astro-get-static-paths/src/pages/data/[slug].json.ts2
-rw-r--r--packages/astro/test/fixtures/astro-get-static-paths/src/pages/nested-arrays/[slug].astro8
-rw-r--r--packages/astro/test/fixtures/astro-markdown-frontmatter-injection/src/pages/glob.json.js2
-rw-r--r--packages/astro/test/fixtures/astro-markdown/src/pages/headings-glob.json.js2
-rw-r--r--packages/astro/test/fixtures/astro-markdown/src/pages/raw-content.json.js2
-rw-r--r--packages/astro/test/fixtures/astro-markdown/src/pages/vite-env-vars-glob.json.js2
-rw-r--r--packages/astro/test/fixtures/astro-pagination/src/pages/posts/[slug]/[page].astro2
-rw-r--r--packages/astro/test/fixtures/content-collection-references/src/pages/welcome-data.json.js2
-rw-r--r--packages/astro/test/fixtures/content-collections/src/pages/collections.json.js2
-rw-r--r--packages/astro/test/fixtures/content-collections/src/pages/entries.json.js2
-rw-r--r--packages/astro/test/fixtures/core-image-ssr/src/pages/api.ts2
-rw-r--r--packages/astro/test/fixtures/custom-elements/astro.config.mjs6
-rw-r--r--packages/astro/test/fixtures/custom-elements/my-component-lib/hydration-polyfill.js1
-rw-r--r--packages/astro/test/fixtures/custom-elements/my-component-lib/index.js31
-rw-r--r--packages/astro/test/fixtures/custom-elements/my-component-lib/package.json13
-rw-r--r--packages/astro/test/fixtures/custom-elements/my-component-lib/polyfill.js2
-rw-r--r--packages/astro/test/fixtures/custom-elements/my-component-lib/server.js30
-rw-r--r--packages/astro/test/fixtures/custom-elements/my-component-lib/shim.js28
-rw-r--r--packages/astro/test/fixtures/custom-elements/package.json9
-rw-r--r--packages/astro/test/fixtures/custom-elements/src/components/my-element.js13
-rw-r--r--packages/astro/test/fixtures/custom-elements/src/pages/ctr.astro16
-rw-r--r--packages/astro/test/fixtures/custom-elements/src/pages/index.astro15
-rw-r--r--packages/astro/test/fixtures/custom-elements/src/pages/nested.astro11
-rw-r--r--packages/astro/test/fixtures/custom-elements/src/pages/nossr.astro14
-rw-r--r--packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js2
-rw-r--r--packages/astro/test/fixtures/data-collections/src/pages/authors/all.json.js2
-rw-r--r--packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js2
-rw-r--r--packages/astro/test/fixtures/data-collections/src/pages/translations/all.json.js2
-rw-r--r--packages/astro/test/fixtures/dynamic-endpoint-collision/src/pages/api/catch/[...slug].ts2
-rw-r--r--packages/astro/test/fixtures/middleware-dev/src/pages/api/endpoint.js2
-rw-r--r--packages/astro/test/fixtures/non-html-pages/src/pages/about.json.ts2
-rw-r--r--packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts2
-rw-r--r--packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[...slug].json.ts2
-rw-r--r--packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[foo]-[bar].json.ts2
-rw-r--r--packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/api/route.js2
-rw-r--r--packages/astro/test/fixtures/ssr-api-route/src/pages/binary.js2
-rw-r--r--packages/astro/test/fixtures/ssr-api-route/src/pages/context/[param].js2
-rw-r--r--packages/astro/test/fixtures/ssr-api-route/src/pages/food.json.js4
-rw-r--r--packages/astro/test/fixtures/ssr-api-route/src/pages/login.js2
-rw-r--r--packages/astro/test/fixtures/ssr-dynamic/src/pages/api/products/[id].js2
-rw-r--r--packages/astro/test/fixtures/ssr-locals/src/pages/api.js2
-rw-r--r--packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/data/[slug].json.ts2
-rw-r--r--packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/nested-arrays/[slug].astro10
-rw-r--r--packages/astro/test/fixtures/ssr-preview/preview.mjs2
-rw-r--r--packages/astro/test/fixtures/static-build/src/pages/company.json.ts4
-rw-r--r--packages/astro/test/fixtures/static-build/src/pages/data/[slug].json.ts4
-rw-r--r--packages/astro/test/fixtures/static-build/src/pages/posts.json.js2
-rw-r--r--packages/astro/test/fixtures/with-endpoint-routes/src/pages/[slug].json.ts2
-rw-r--r--packages/astro/test/fixtures/with-endpoint-routes/src/pages/data/[slug].json.ts2
-rw-r--r--packages/astro/test/fixtures/with-endpoint-routes/src/pages/home.json.ts2
-rw-r--r--packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/[image].svg.ts2
-rw-r--r--packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/hex.ts2
-rw-r--r--packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/static.svg.ts2
-rw-r--r--packages/astro/test/preview-routing.test.js8
-rw-r--r--packages/astro/test/public-base-404.test.js2
-rw-r--r--packages/astro/test/scoped-style-strategy.test.js34
-rw-r--r--packages/astro/test/ssr-api-route.test.js1
-rw-r--r--packages/astro/test/ssr-manifest.test.js1
-rw-r--r--packages/astro/test/ssr-prerender-get-static-paths.test.js12
-rw-r--r--packages/astro/test/static-build.test.js2
-rw-r--r--packages/astro/test/test-adapter.js9
-rw-r--r--packages/astro/test/test-utils.js7
-rw-r--r--packages/astro/test/units/cookies/delete.test.js2
-rw-r--r--packages/astro/test/units/cookies/get.test.js14
-rw-r--r--packages/astro/test/units/integrations/api.test.js186
-rw-r--r--packages/astro/tsconfig.json2
-rw-r--r--packages/astro/tsconfigs/base.json14
-rw-r--r--packages/astro/tsconfigs/strict.json5
-rw-r--r--packages/create-astro/CHANGELOG.md6
-rw-r--r--packages/create-astro/package.json4
-rw-r--r--packages/create-astro/tsconfig.json2
-rw-r--r--packages/integrations/alpinejs/CHANGELOG.md6
-rw-r--r--packages/integrations/alpinejs/package.json2
-rw-r--r--packages/integrations/alpinejs/tsconfig.json2
-rw-r--r--packages/integrations/cloudflare/CHANGELOG.md40
-rw-r--r--packages/integrations/cloudflare/package.json8
-rw-r--r--packages/integrations/cloudflare/src/index.ts20
-rw-r--r--packages/integrations/cloudflare/test/fixtures/basics/astro.config.mjs2
-rw-r--r--packages/integrations/cloudflare/tsconfig.json2
-rw-r--r--packages/integrations/deno/CHANGELOG.md37
-rw-r--r--packages/integrations/deno/package.json4
-rw-r--r--packages/integrations/deno/src/index.ts10
-rw-r--r--packages/integrations/deno/test/fixtures/basics/astro.config.mjs2
-rw-r--r--packages/integrations/deno/test/fixtures/dynimport/astro.config.mjs2
-rw-r--r--packages/integrations/deno/tsconfig.json4
-rw-r--r--packages/integrations/image/CHANGELOG.md11
-rw-r--r--packages/integrations/image/README.md18
-rw-r--r--packages/integrations/image/package.json4
-rw-r--r--packages/integrations/image/src/build/ssg.ts2
-rw-r--r--packages/integrations/image/src/endpoint.ts2
-rw-r--r--packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/basic-image/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/basic-picture/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/get-image-remote/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/no-alt-text-image/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/no-alt-text-picture/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/rotation/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/squoosh-service/astro.config.mjs2
-rw-r--r--packages/integrations/image/test/fixtures/with-mdx/astro.config.mjs2
-rw-r--r--packages/integrations/image/tsconfig.json2
-rw-r--r--packages/integrations/lit/CHANGELOG.md6
-rw-r--r--packages/integrations/lit/package.json2
-rw-r--r--packages/integrations/lit/tsconfig.json2
-rw-r--r--packages/integrations/markdoc/CHANGELOG.md13
-rw-r--r--packages/integrations/markdoc/package.json14
-rw-r--r--packages/integrations/markdoc/src/content-entry-type.ts8
-rw-r--r--packages/integrations/markdoc/src/extensions/prism.ts7
-rw-r--r--packages/integrations/markdoc/src/extensions/shiki.ts7
-rw-r--r--packages/integrations/markdoc/src/html/transform/html-token-transform.ts2
-rw-r--r--packages/integrations/markdoc/src/runtime.ts3
-rw-r--r--packages/integrations/markdoc/tsconfig.json4
-rw-r--r--packages/integrations/mdx/CHANGELOG.md19
-rw-r--r--packages/integrations/mdx/package.json11
-rw-r--r--packages/integrations/mdx/src/index.ts20
-rw-r--r--packages/integrations/mdx/src/remark-images-to-component.ts2
-rw-r--r--packages/integrations/mdx/tsconfig.json2
-rw-r--r--packages/integrations/netlify/CHANGELOG.md76
-rw-r--r--packages/integrations/netlify/package.json9
-rw-r--r--packages/integrations/netlify/src/integration-edge-functions.ts10
-rw-r--r--packages/integrations/netlify/src/integration-functions.ts22
-rw-r--r--packages/integrations/netlify/src/netlify-functions.ts8
-rw-r--r--packages/integrations/netlify/test/functions/edge-middleware.test.js1
-rw-r--r--packages/integrations/netlify/test/functions/split-support.test.js4
-rw-r--r--packages/integrations/netlify/tsconfig.json2
-rw-r--r--packages/integrations/node/CHANGELOG.md39
-rw-r--r--packages/integrations/node/README.md2
-rw-r--r--packages/integrations/node/package.json8
-rw-r--r--packages/integrations/node/src/index.ts10
-rw-r--r--packages/integrations/node/src/response-iterator.ts11
-rw-r--r--packages/integrations/node/src/server.ts8
-rw-r--r--packages/integrations/node/src/types.ts2
-rw-r--r--packages/integrations/node/test/bad-urls.test.js2
-rw-r--r--packages/integrations/node/test/fixtures/api-route/src/pages/binary.ts2
-rw-r--r--packages/integrations/node/test/fixtures/api-route/src/pages/recipes.js2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-multi.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-single.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-multi.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-single.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/kitchen-sink.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-multi.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-single.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-empty-headers-object.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-undefined-headers-object.ts2
-rw-r--r--packages/integrations/node/test/fixtures/headers/src/pages/endpoints/simple.ts2
-rw-r--r--packages/integrations/node/test/image.test.js6
-rw-r--r--packages/integrations/node/test/prerender-404.test.js1
-rw-r--r--packages/integrations/node/test/prerender.test.js1
-rw-r--r--packages/integrations/node/tsconfig.json2
-rw-r--r--packages/integrations/partytown/CHANGELOG.md6
-rw-r--r--packages/integrations/partytown/package.json2
-rw-r--r--packages/integrations/partytown/tsconfig.json2
-rw-r--r--packages/integrations/preact/CHANGELOG.md6
-rw-r--r--packages/integrations/preact/package.json4
-rw-r--r--packages/integrations/preact/tsconfig.json2
-rw-r--r--packages/integrations/prefetch/CHANGELOG.md6
-rw-r--r--packages/integrations/prefetch/package.json2
-rw-r--r--packages/integrations/prefetch/playwright.config.js2
-rw-r--r--packages/integrations/prefetch/tsconfig.json2
-rw-r--r--packages/integrations/react/CHANGELOG.md6
-rw-r--r--packages/integrations/react/package.json4
-rw-r--r--packages/integrations/react/tsconfig.json2
-rw-r--r--packages/integrations/sitemap/CHANGELOG.md6
-rw-r--r--packages/integrations/sitemap/package.json2
-rw-r--r--packages/integrations/sitemap/tsconfig.json2
-rw-r--r--packages/integrations/solid/CHANGELOG.md6
-rw-r--r--packages/integrations/solid/package.json4
-rw-r--r--packages/integrations/solid/tsconfig.json2
-rw-r--r--packages/integrations/svelte/CHANGELOG.md11
-rw-r--r--packages/integrations/svelte/package.json6
-rw-r--r--packages/integrations/svelte/tsconfig.json2
-rw-r--r--packages/integrations/tailwind/CHANGELOG.md11
-rw-r--r--packages/integrations/tailwind/package.json4
-rw-r--r--packages/integrations/tailwind/tsconfig.json2
-rw-r--r--packages/integrations/turbolinks/CHANGELOG.md6
-rw-r--r--packages/integrations/turbolinks/package.json2
-rw-r--r--packages/integrations/turbolinks/tsconfig.json2
-rw-r--r--packages/integrations/vercel/CHANGELOG.md76
-rw-r--r--packages/integrations/vercel/package.json9
-rw-r--r--packages/integrations/vercel/src/edge/adapter.ts10
-rw-r--r--packages/integrations/vercel/src/image/dev-service.ts5
-rw-r--r--packages/integrations/vercel/src/serverless/adapter.ts28
-rw-r--r--packages/integrations/vercel/src/serverless/entrypoint.ts6
-rw-r--r--packages/integrations/vercel/test/fixtures/basic/astro.config.mjs4
-rw-r--r--packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs9
-rw-r--r--packages/integrations/vercel/test/fixtures/functionPerRoute/package.json9
-rw-r--r--packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro8
-rw-r--r--packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro8
-rw-r--r--packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs9
-rw-r--r--packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs9
-rw-r--r--packages/integrations/vercel/test/no-output.test.js2
-rw-r--r--packages/integrations/vercel/test/split.test.js5
-rw-r--r--packages/integrations/vercel/tsconfig.json2
-rw-r--r--packages/integrations/vue/CHANGELOG.md11
-rw-r--r--packages/integrations/vue/package.json6
-rw-r--r--packages/integrations/vue/tsconfig.json2
-rw-r--r--packages/internal-helpers/CHANGELOG.md6
-rw-r--r--packages/internal-helpers/package.json2
-rw-r--r--packages/internal-helpers/tsconfig.json2
-rw-r--r--packages/markdown/component/CHANGELOG.md78
-rw-r--r--packages/markdown/component/Markdown.astro49
-rw-r--r--packages/markdown/component/package.json43
-rw-r--r--packages/markdown/component/readme.md16
-rw-r--r--packages/markdown/component/test/astro-markdown-plugins.test.js37
-rw-r--r--packages/markdown/component/test/astro-markdown-shiki.test.js147
-rw-r--r--packages/markdown/component/test/astro-markdown.test.js244
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-plugins/add-classes.mjs18
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-plugins/astro.config.mjs7
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-plugins/package.json13
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-plugins/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-plugins/src/pages/astro.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/astro.config.mjs19
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/pages/astro.astro31
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/astro.config.mjs5
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/pages/astro.astro18
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/astro.config.mjs10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/pages/astro.astro14
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/astro.config.mjs6
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/astro.astro14
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/index.md24
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/astro.config.mjs6
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/pages/astro.astro18
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/astro.config.mjs6
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/pages/astro.astro18
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/astro.config.mjs6
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/package.json9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/pages/astro.astro18
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/astro.config.mjs9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/package.json13
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/Counter.jsx7
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/Example.jsx5
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/Hello.jsx5
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/SlotComponent.astro13
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/SvelteButton.svelte11
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/TextBlock.jsx20
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/components/index.js5
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/content/code-element.md3
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/imported-md/plain.md6
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/layouts/content.astro10
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/layouts/layout-props.astro17
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/braces.astro13
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/children.md12
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/close.astro12
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-element.astro7
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/code-in-md.md16
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/code.astro13
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment-with-js.md23
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/comment.md2
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/complex.astro16
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/content.astro6
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/dash.md14
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/deep.astro29
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/empty-code.md20
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/external.astro19
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/imported-md/with-components.astro9
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/layout-props.md4
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/nested-list.astro32
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/no-elements.astro5
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/post.astro16
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/pages/scopedStyles-code.astro21
-rw-r--r--packages/markdown/component/test/fixtures/astro-markdown/src/scripts/test.js1
-rw-r--r--packages/markdown/component/test/test-utils.js10
-rw-r--r--packages/markdown/remark/CHANGELOG.md8
-rw-r--r--packages/markdown/remark/package.json6
-rw-r--r--packages/telemetry/CHANGELOG.md6
-rw-r--r--packages/telemetry/package.json10
-rw-r--r--packages/telemetry/src/config.ts1
-rw-r--r--packages/telemetry/src/post.ts2
-rw-r--r--packages/telemetry/tsconfig.json2
-rw-r--r--packages/underscore-redirects/CHANGELOG.md6
-rw-r--r--packages/underscore-redirects/package.json2
-rw-r--r--packages/underscore-redirects/tsconfig.json2
-rw-r--r--packages/webapi/.gitignore2
-rw-r--r--packages/webapi/CHANGELOG.md109
-rw-r--r--packages/webapi/LICENSE27
-rw-r--r--packages/webapi/README.md155
-rw-r--r--packages/webapi/apply.js5
-rw-r--r--packages/webapi/mod.d.ts13
-rw-r--r--packages/webapi/package.json97
-rw-r--r--packages/webapi/run/build.js224
-rw-r--r--packages/webapi/src/exclusions.ts57
-rw-r--r--packages/webapi/src/inheritance.ts26
-rw-r--r--packages/webapi/src/lib/Alert.ts3
-rw-r--r--packages/webapi/src/lib/AnimationFrame.ts41
-rw-r--r--packages/webapi/src/lib/CanvasRenderingContext2D.ts222
-rw-r--r--packages/webapi/src/lib/CharacterData.ts45
-rw-r--r--packages/webapi/src/lib/CustomElementRegistry.ts92
-rw-r--r--packages/webapi/src/lib/CustomEvent.ts26
-rw-r--r--packages/webapi/src/lib/DOMException.ts40
-rw-r--r--packages/webapi/src/lib/Document.ts197
-rw-r--r--packages/webapi/src/lib/Element.ts166
-rw-r--r--packages/webapi/src/lib/HTMLCanvasElement.ts69
-rw-r--r--packages/webapi/src/lib/HTMLImageElement.ts16
-rw-r--r--packages/webapi/src/lib/IdleCallback.ts41
-rw-r--r--packages/webapi/src/lib/Image.ts15
-rw-r--r--packages/webapi/src/lib/ImageData.ts111
-rw-r--r--packages/webapi/src/lib/MediaQueryList.ts40
-rw-r--r--packages/webapi/src/lib/Node.ts192
-rw-r--r--packages/webapi/src/lib/Observer.ts41
-rw-r--r--packages/webapi/src/lib/OffscreenCanvas.ts102
-rw-r--r--packages/webapi/src/lib/Storage.ts67
-rw-r--r--packages/webapi/src/lib/StyleSheet.ts24
-rw-r--r--packages/webapi/src/lib/Timeout.ts30
-rw-r--r--packages/webapi/src/lib/TreeWalker.ts67
-rw-r--r--packages/webapi/src/lib/Window.ts49
-rw-r--r--packages/webapi/src/lib/structuredClone.ts4
-rw-r--r--packages/webapi/src/lib/utils.ts61
-rw-r--r--packages/webapi/src/polyfill.ts325
-rw-r--r--packages/webapi/src/ponyfill.ts148
-rw-r--r--packages/webapi/src/types.d.ts4
-rw-r--r--packages/webapi/test/basic.js87
-rw-r--r--packages/webapi/test/characterdata.js42
-rw-r--r--packages/webapi/test/elements.js70
-rw-r--r--packages/webapi/test/fetch.js40
-rw-r--r--packages/webapi/test/imagedata.js54
-rw-r--r--packages/webapi/test/internals.js26
-rw-r--r--packages/webapi/test/media.js20
-rw-r--r--packages/webapi/test/offscreencanvas.js39
-rw-r--r--packages/webapi/test/options.js44
-rw-r--r--packages/webapi/test/storage.js32
-rw-r--r--packages/webapi/test/structuredclone.js28
-rw-r--r--packages/webapi/test/urlpattern.js19
-rw-r--r--packages/webapi/tsconfig.json15
-rw-r--r--pnpm-lock.yaml1089
-rw-r--r--scripts/cmd/build.js2
-rw-r--r--scripts/package.json3
-rw-r--r--scripts/smoke/cleanup.js5
-rw-r--r--scripts/smoke/index.js5
-rw-r--r--tsconfig.base.json3
541 files changed, 3325 insertions, 7105 deletions
diff --git a/.changeset/afraid-dots-whisper.md b/.changeset/afraid-dots-whisper.md
new file mode 100644
index 000000000..c4371a7f3
--- /dev/null
+++ b/.changeset/afraid-dots-whisper.md
@@ -0,0 +1,31 @@
+---
+'@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/image': 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/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/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 `<Markdown />` 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/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/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-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/pre.json b/.changeset/pre.json
new file mode 100644
index 000000000..d4468ad74
--- /dev/null
+++ b/.changeset/pre.json
@@ -0,0 +1,57 @@
+{
+ "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/image": "0.17.2",
+ "@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",
+ "chilled-ducks-grin",
+ "dirty-lies-cover",
+ "fair-emus-divide",
+ "famous-queens-itch",
+ "four-houses-compete",
+ "heavy-walls-arrive",
+ "loud-candles-admire",
+ "mighty-dancers-lay",
+ "odd-books-live",
+ "rude-ears-play",
+ "spicy-eels-rush",
+ "three-adults-exist",
+ "three-onions-repeat",
+ "tricky-candles-suffer",
+ "twelve-coats-rush",
+ "twenty-cheetahs-deny",
+ "unlucky-hotels-try",
+ "unlucky-ravens-type",
+ "unlucky-sheep-build",
+ "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/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/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/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/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/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/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 5e8015a35..48e354816 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.1",
- "astro": "^2.10.3"
+ "@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.0"
}
}
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 e7cede3d3..58a03467d 100644
--- a/examples/blog/src/content/blog/markdown-style-guide.md
+++ b/examples/blog/src/content/blog/markdown-style-guide.md
@@ -58,7 +58,7 @@ The blockquote element represents content that is quoted from another source, op
## Code Blocks
```html
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
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 afdf917dc..7e670784d 100644
--- a/examples/component/package.json
+++ b/examples/component/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^2.10.3"
+ "astro": "^3.0.0-beta.0"
},
"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 ecec4192f..a9aa9ce8f 100644
--- a/examples/deno/package.json
+++ b/examples/deno/package.json
@@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^2.10.3"
+ "astro": "^3.0.0-beta.0"
},
"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 b39e4f1fe..3fcb2d879 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.3"
+ "astro": "^3.0.0-beta.0"
}
}
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 5b551ec66..b868a3010 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.3",
+ "astro": "^3.0.0-beta.0",
"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/package.json b/examples/framework-multiple/package.json
index fcf8fbccb..11400c309 100644
--- a/examples/framework-multiple/package.json
+++ b/examples/framework-multiple/package.json
@@ -11,12 +11,12 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/preact": "^2.2.1",
- "@astrojs/react": "^2.2.1",
- "@astrojs/solid-js": "^2.2.0",
- "@astrojs/svelte": "^3.1.0",
- "@astrojs/vue": "^2.2.1",
- "astro": "^2.10.3",
+ "@astrojs/preact": "^3.0.0-beta.0",
+ "@astrojs/react": "^3.0.0-beta.0",
+ "@astrojs/solid-js": "^3.0.0-beta.0",
+ "@astrojs/svelte": "^4.0.0-beta.0",
+ "@astrojs/vue": "^3.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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-preact/package.json b/examples/framework-preact/package.json
index 679833521..30ad40bda 100644
--- a/examples/framework-preact/package.json
+++ b/examples/framework-preact/package.json
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/preact": "^2.2.1",
+ "@astrojs/preact": "^3.0.0-beta.0",
"@preact/signals": "^1.1.3",
- "astro": "^2.10.3",
+ "astro": "^3.0.0-beta.0",
"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 66c1bc47b..a680274da 100644
--- a/examples/framework-react/package.json
+++ b/examples/framework-react/package.json
@@ -11,10 +11,10 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/react": "^2.2.1",
+ "@astrojs/react": "^3.0.0-beta.0",
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
- "astro": "^2.10.3",
+ "astro": "^3.0.0-beta.0",
"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 900058bee..d8328ea07 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.3",
+ "@astrojs/solid-js": "^3.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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 c42ae96ba..b7a31c466 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.3",
+ "@astrojs/svelte": "^4.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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 badfa3a83..87e1aa282 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.3",
+ "@astrojs/vue": "^3.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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 b60b4a9f2..63b4c4920 100644
--- a/examples/hackernews/package.json
+++ b/examples/hackernews/package.json
@@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/node": "^5.3.2",
- "astro": "^2.10.3"
+ "@astrojs/node": "^6.0.0-beta.0",
+ "astro": "^3.0.0-beta.0"
}
}
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 d67aaeafa..7a6ed5eb2 100644
--- a/examples/integration/package.json
+++ b/examples/integration/package.json
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
- "astro": "^2.10.3"
+ "astro": "^3.0.0-beta.0"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
diff --git a/examples/middleware/package.json b/examples/middleware/package.json
index e03ac240e..ab37a8949 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.2",
- "astro": "^2.10.3",
+ "@astrojs/node": "^6.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"html-minifier": "^4.0.0"
}
}
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 15a7f43b3..dde9ab90b 100644
--- a/examples/minimal/package.json
+++ b/examples/minimal/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^2.10.3"
+ "astro": "^3.0.0-beta.0"
}
}
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 6d33c50cb..dcf2c10c4 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.3"
+ "astro": "^3.0.0-beta.0"
}
}
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 31c4783ac..b58385568 100644
--- a/examples/portfolio/package.json
+++ b/examples/portfolio/package.json
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
- "astro": "^2.10.3"
+ "astro": "^3.0.0-beta.0"
}
}
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 9f321b2bb..eb434e8fc 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.2",
- "@astrojs/svelte": "^3.1.0",
- "astro": "^2.10.3",
+ "@astrojs/node": "^6.0.0-beta.0",
+ "@astrojs/svelte": "^4.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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 560c5d395..5e8a22537 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.3"
+ "@astrojs/markdoc": "^1.0.0-beta.0",
+ "astro": "^3.0.0-beta.0"
}
}
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 aee18c636..4b81aca1f 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.3",
+ "@astrojs/markdown-remark": "^3.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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 711596f8b..47abed19c 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.3"
+ "astro": "^3.0.0-beta.0"
}
}
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 c66b554e6..81205e3c8 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.1",
- "astro": "^2.10.3",
+ "@astrojs/mdx": "^1.0.0-beta.0",
+ "@astrojs/preact": "^3.0.0-beta.0",
+ "astro": "^3.0.0-beta.0",
"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 afc6bd45e..ea780053f 100644
--- a/examples/with-nanostores/package.json
+++ b/examples/with-nanostores/package.json
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
- "@astrojs/preact": "^2.2.1",
+ "@astrojs/preact": "^3.0.0-beta.0",
"@nanostores/preact": "^0.4.1",
- "astro": "^2.10.3",
+ "astro": "^3.0.0-beta.0",
"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 56d74f08b..da98bc64d 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.3",
+ "astro": "^3.0.0-beta.0",
"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 a6fb3bfe0..235600647 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.3",
+ "astro": "^3.0.0-beta.0",
"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 e45ee30f3..60151e1c9 100644
--- a/examples/with-vitest/package.json
+++ b/examples/with-vitest/package.json
@@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
- "astro": "^2.10.3",
+ "astro": "^3.0.0-beta.0",
"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 a3da9d2c5..1ed5c949a 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1,5 +1,224 @@
# astro
+## 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.3
### 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/content-types.template.d.ts b/packages/astro/content-types.template.d.ts
index 277d00acf..ba9fe1c2a 100644
--- a/packages/astro/content-types.template.d.ts
+++ b/packages/astro/content-types.template.d.ts
@@ -44,7 +44,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'>,
]
>;
}>;
@@ -87,7 +87,7 @@ declare module 'astro:content' {
export function getEntryBySlug<
C extends keyof ContentEntryMap,
- E extends ValidContentEntrySlug<C> | (string & {})
+ E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
@@ -112,7 +112,7 @@ declare module 'astro:content' {
export function getEntry<
C extends keyof ContentEntryMap,
- E extends ValidContentEntrySlug<C> | (string & {})
+ E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
@@ -121,7 +121,7 @@ declare module 'astro:content' {
: Promise<CollectionEntry<C> | 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;
@@ -130,7 +130,7 @@ declare module 'astro:content' {
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
- E extends ValidContentEntrySlug<C> | (string & {})
+ E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E
@@ -139,7 +139,7 @@ declare module 'astro:content' {
: Promise<CollectionEntry<C> | 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/package.json b/packages/astro/package.json
index bf888e3ae..8e505e8b0 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -1,6 +1,6 @@
{
"name": "astro",
- "version": "2.10.3",
+ "version": "3.0.0-beta.0",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
@@ -56,6 +56,7 @@
"./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",
@@ -115,12 +116,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",
@@ -141,8 +140,8 @@
"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",
@@ -154,6 +153,7 @@
"mime": "^3.0.0",
"network-information-types": "^0.1.1",
"ora": "^6.3.1",
+ "sharp": "^0.32.1",
"p-limit": "^4.0.0",
"path-to-regexp": "^6.2.1",
"preferred-pm": "^3.0.3",
@@ -165,7 +165,6 @@
"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",
@@ -197,6 +196,7 @@
"@types/send": "^0.17.1",
"@types/server-destroy": "^1.0.1",
"@types/unist": "^2.0.6",
+ "@astrojs/check": "^0.1.0",
"astro-scripts": "workspace:*",
"chai": "^4.3.7",
"cheerio": "1.0.0-rc.12",
@@ -210,21 +210,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 1e594332d..f7b07dbfe 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -20,8 +20,10 @@ import type { AstroConfigSchema } 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,
@@ -326,7 +328,7 @@ type ServerConfig = {
/**
* @name server.port
* @type {number}
- * @default `3000`
+ * @default `4321`
* @description
* Set which port the dev server should listen on.
*
@@ -570,12 +572,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
- * <a href="/docs/about/">About</a>
- * <img src=`${import.meta.env.BASE_URL}image.png`>
- * ```
+ * 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;
@@ -608,19 +605,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
@@ -914,7 +913,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 })
* }
* ```
*/
@@ -936,7 +935,7 @@ export interface AstroUserConfig {
* @docs
* @name server.port
* @type {number}
- * @default `3000`
+ * @default `4321`
* @description
* Set which port the server should listen on.
*
@@ -986,7 +985,7 @@ export interface AstroUserConfig {
* @docs
* @name image.service (Experimental)
* @type {{entrypoint: 'astro/assets/services/sharp' | 'astro/assets/services/squoosh' | string, config: Record<string, any>}}
- * @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.
@@ -1414,6 +1413,17 @@ export interface DataEntryType {
export type GetDataEntryInfoReturnType = { data: Record<string, unknown>; 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;
@@ -1530,10 +1540,7 @@ export type GetStaticPathsResultKeyed = GetStaticPathsResult & {
*/
export type GetStaticPaths = (
options: GetStaticPathsOptions
-) =>
- | Promise<GetStaticPathsResult | GetStaticPathsResult[]>
- | GetStaticPathsResult
- | GetStaticPathsResult[];
+) => Promise<GetStaticPathsResult> | GetStaticPathsResult;
/**
* Infers the shape of the `params` property returned by `getStaticPaths()`.
@@ -1676,12 +1683,52 @@ export type PaginateFunction = (data: any[], args?: PaginateOptions) => GetStati
export type Params = Record<string, string | undefined>;
+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;
@@ -1869,7 +1916,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<Fn>[0] : never;
export interface AstroIntegration {
@@ -1887,6 +1934,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.
@@ -1895,10 +1943,17 @@ export interface AstroIntegration {
'astro:config:done'?: (options: {
config: AstroConfig;
setAdapter: (adapter: AstroAdapter) => void;
+ logger: AstroIntegrationLogger;
}) => void | Promise<void>;
- 'astro:server:setup'?: (options: { server: vite.ViteDevServer }) => void | Promise<void>;
- 'astro:server:start'?: (options: { address: AddressInfo }) => void | Promise<void>;
- 'astro:server:done'?: () => void | Promise<void>;
+ 'astro:server:setup'?: (options: {
+ server: vite.ViteDevServer;
+ logger: AstroIntegrationLogger;
+ }) => void | Promise<void>;
+ 'astro:server:start'?: (options: {
+ address: AddressInfo;
+ logger: AstroIntegrationLogger;
+ }) => void | Promise<void>;
+ 'astro:server:done'?: (options: { logger: AstroIntegrationLogger }) => void | Promise<void>;
'astro:build:ssr'?: (options: {
manifest: SerializedSSRManifest;
/**
@@ -1910,19 +1965,25 @@ export interface AstroIntegration {
* File path of the emitted middleware
*/
middlewareEntryPoint: URL | undefined;
+ logger: AstroIntegrationLogger;
}) => void | Promise<void>;
- 'astro:build:start'?: () => void | Promise<void>;
+ 'astro:build:start'?: (options: { logger: AstroIntegrationLogger }) => void | Promise<void>;
'astro:build:setup'?: (options: {
vite: vite.InlineConfig;
pages: Map<string, PageBuildData>;
target: 'client' | 'server';
updateConfig: (newConfig: vite.InlineConfig) => void;
+ logger: AstroIntegrationLogger;
+ }) => void | Promise<void>;
+ 'astro:build:generated'?: (options: {
+ dir: URL;
+ logger: AstroIntegrationLogger;
}) => void | Promise<void>;
- 'astro:build:generated'?: (options: { dir: URL }) => void | Promise<void>;
'astro:build:done'?: (options: {
pages: { pathname: string }[];
dir: URL;
routes: RouteData[];
+ logger: AstroIntegrationLogger;
}) => void | Promise<void>;
};
}
diff --git a/packages/astro/src/assets/generate.ts b/packages/astro/src/assets/generate.ts
index d6cb02e56..04488ed8f 100644
--- a/packages/astro/src/assets/generate.ts
+++ b/packages/astro/src/assets/generate.ts
@@ -27,6 +27,11 @@ export async function generateImage(
options: ImageTransform,
filepath: string
): Promise<GenerationData | undefined> {
+ if (typeof buildOpts.settings.config.image === 'undefined') {
+ throw new Error(
+ "Astro hasn't set a default service for `astro:assets`. This is an internal error and you should report it."
+ );
+ }
if (!isESMImportedImage(options.src)) {
return undefined;
}
diff --git a/packages/astro/src/assets/image-endpoint.ts b/packages/astro/src/assets/image-endpoint.ts
index 0553272c2..8dc15c36a 100644
--- a/packages/astro/src/assets/image-endpoint.ts
+++ b/packages/astro/src/assets/image-endpoint.ts
@@ -24,7 +24,7 @@ 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();
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/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts
index 565253001..2ab87b7c1 100644
--- a/packages/astro/src/assets/vite-plugin-assets.ts
+++ b/packages/astro/src/assets/vite-plugin-assets.ts
@@ -1,10 +1,8 @@
-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,
@@ -23,37 +21,12 @@ 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
{
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';
-
-type DiagnosticResult = {
- errors: number;
- warnings: number;
- hints: number;
-};
-
-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<AstroChecker | undefined> {
- 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.`,
- });
- return;
- }
-
- // Load settings
- 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 { 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()],
- })
- );
-
- return new AstroChecker({
- syncInternal,
- settings,
- fileSystem: fs,
+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';
+
+export async function check(flags: Arguments) {
+ const logging = createLoggingFromFlags(flags);
+ const getPackageOpts = { skipAsk: flags.yes || flags.y, cwd: flags.root };
+ const checkPackage = await getPackage<typeof import('@astrojs/check')>(
+ '@astrojs/check',
logging,
- diagnosticChecker,
- isWatchMode: checkFlags.watch,
- });
-}
-
-type CheckerConstructor = {
- diagnosticChecker: AstroCheck;
-
- isWatchMode: boolean;
-
- syncInternal: typeof syncInternal;
-
- settings: Readonly<AstroSettings>;
-
- logging: Readonly<LogOptions>;
-
- 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<CheckResult> {
- return await this.#checkAllFiles(true);
- }
-
- /**
- * Check all `.astro` files and then start watching for changes.
- */
- public async watch(): Promise<CheckResult> {
- 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<CheckResult> {
- // 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,
- });
- }
+ getPackageOpts,
+ ['typescript']
+ );
+ const typescript = await getPackage('typescript', logging, getPackageOpts);
- /**
- * Logs the result of the various diagnostics
- *
- * @param result Result emitted by AstroChecker.#breakDownDiagnostics
- */
- #logDiagnosticsSeverity(result: Readonly<DiagnosticResult>) {
- 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('-')} `)
+ 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;
}
- /**
- * It loops through all diagnostics and break down diagnostics that are errors, warnings or hints.
- */
- #breakDownDiagnostics(diagnostics: Readonly<GetDiagnosticsResult[]>): 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;
+ // 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 exitCode = await sync(inlineConfig);
+ if (exitCode !== 0) {
+ process.exit(exitCode);
}
-}
-
-/**
- * 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<number> {
- 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,
- });
- }
+ const { check: checker, parseArgsAsCheckConfig } = checkPackage;
- return files.length;
-}
+ const config = parseArgsAsCheckConfig(process.argv);
-/**
- * Parse flags and sets defaults
- */
-function parseFlags(flags: Flags): CheckFlags {
- return {
- watch: flags.watch ?? false,
- };
+ 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 <custom-address>', `Expose on a network IP address at <custom-address>`],
['--open', 'Automatically open the app in the browser on server start'],
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<T>(
+ packageName: string,
+ logging: LogOptions,
+ options: GetPackageOptions,
+ otherDeps: string[] = []
+): Promise<T | undefined> {
+ 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<boolean> {
+ 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/core/app/index.ts b/packages/astro/src/core/app/index.ts
index bec5368b6..43f7a3926 100644
--- a/packages/astro/src/core/app/index.ts
+++ b/packages/astro/src/core/app/index.ts
@@ -88,7 +88,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,
diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts
index 2cfc686a2..f31af36db 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/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/generate.ts b/packages/astro/src/core/build/generate.ts
index 708295296..3e3a44ce0 100644
--- a/packages/astro/src/core/build/generate.ts
+++ b/packages/astro/src/core/build/generate.ts
@@ -28,6 +28,7 @@ import {
} from '../../core/build/internal.js';
import {
isRelativePath,
+ joinPaths,
prependForwardSlash,
removeLeadingForwardSlash,
removeTrailingForwardSlash,
@@ -300,7 +301,6 @@ async function getPathsForRoute(
mod,
route,
routeCache: opts.routeCache,
- isValidate: false,
logging: opts.logging,
ssr: isServerLikeOutput(opts.settings.config),
}).catch((err) => {
@@ -438,11 +438,11 @@ 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;
@@ -508,7 +508,6 @@ async function generatePath(
const env = createEnvironment({
adapterName: manifest.adapterName,
logging,
- markdown: manifest.markdown,
mode: opts.mode,
renderers: manifest.renderers,
clientDirectives: manifest.clientDirectives,
@@ -620,7 +619,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/plugins/plugin-analyzer.ts b/packages/astro/src/core/build/plugins/plugin-analyzer.ts
index c05328005..b62de1a2b 100644
--- a/packages/astro/src/core/build/plugins/plugin-analyzer.ts
+++ b/packages/astro/src/core/build/plugins/plugin-analyzer.ts
@@ -1,3 +1,4 @@
+import type { Node as ESTreeNode } from 'estree-walker';
import type { ModuleInfo, PluginContext } from 'rollup';
import type { Plugin as VitePlugin } from 'vite';
import type { PluginMetadata as AstroPluginMetadata } from '../../../vite-plugin-astro/types';
@@ -36,7 +37,7 @@ async function doesParentImportChild(
const imports: Array<ImportDeclaration> = [];
const exports: Array<ExportNamedDeclaration | ExportDefaultDeclaration> = [];
- walk(parentInfo.ast, {
+ walk(parentInfo.ast as ESTreeNode, {
enter(node) {
if (node.type === 'ImportDeclaration') {
imports.push(node as ImportDeclaration);
diff --git a/packages/astro/src/core/build/plugins/plugin-pages.ts b/packages/astro/src/core/build/plugins/plugin-pages.ts
index 2ee438a6a..966426439 100644
--- a/packages/astro/src/core/build/plugins/plugin-pages.ts
+++ b/packages/astro/src/core/build/plugins/plugin-pages.ts
@@ -74,7 +74,11 @@ 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 (
+ // TODO: remover in Astro 4.0
+ !opts.settings.config.build.excludeMiddleware ||
+ opts.settings.adapter?.adapterFeatures?.edgeMiddleware === true
+ ) {
const middlewareModule = await this.resolve(MIDDLEWARE_MODULE_ID);
if (middlewareModule) {
imports.push(`import { onRequest } from "${middlewareModule.id}";`);
diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts
index 514fe2409..ed4cd7b72 100644
--- a/packages/astro/src/core/build/plugins/plugin-ssr.ts
+++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts
@@ -3,7 +3,7 @@ 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, runHookBuildSsr } from '../../../integrations/index.js';
import { isServerLikeOutput } from '../../../prerender/utils.js';
import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js';
import type { SerializedRouteInfo, SerializedSSRManifest } from '../../app/types';
@@ -103,12 +103,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;
@@ -122,7 +126,7 @@ export function pluginSSR(
return;
}
- if (options.settings.config.build.split) {
+ if (options.settings.config.build.split || functionPerRouteEnabled) {
return;
}
@@ -155,11 +159,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<string>();
for (const path of Object.keys(options.allPages)) {
@@ -229,12 +234,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;
@@ -247,7 +254,7 @@ export function pluginSSRSplit(
if (!ssr) {
return;
}
- if (!options.settings.config.build.split) {
+ if (!options.settings.config.build.split && !functionPerRouteEnabled) {
return;
}
@@ -276,7 +283,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';
@@ -337,7 +344,10 @@ export async function createManifest(
buildOpts: StaticBuildOptions,
internals: BuildInternals
): Promise<SerializedSSRManifest> {
- if (buildOpts.settings.config.build.split) {
+ if (
+ buildOpts.settings.config.build.split ||
+ isFunctionPerRouteEnabled(buildOpts.settings.adapter)
+ ) {
if (internals.ssrSplitEntryChunks.size === 0) {
throw new Error(`Did not generate an entry chunk for SSR in serverless mode`);
}
@@ -479,7 +489,6 @@ function buildManifest(
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),
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index 34c1e5549..64dda0f93 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: [],
@@ -87,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
@@ -124,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()
@@ -183,7 +191,7 @@ export const AstroConfigSchema = z.object({
}),
})
.default({
- service: { entrypoint: 'astro/assets/services/squoosh', config: {} },
+ service: { entrypoint: 'astro/assets/services/sharp', config: {} },
}),
markdown: z
.object({
@@ -358,22 +366,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 <link> and <script> tags. Set your site's base with the base configuration.`);
- }
-
- if (trimmedBase.length && config.trailingSlash === 'never') {
- config.base = prependForwardSlash(trimmedBase);
+ // Handle `base` trailing slash based on `trailingSlash` config
+ if (config.trailingSlash === 'never') {
+ config.base = prependForwardSlash(removeTrailingForwardSlash(config.base));
+ } else if (config.trailingSlash === 'always') {
+ config.base = prependForwardSlash(appendForwardSlash(config.base));
} else {
- config.base = prependForwardSlash(appendForwardSlash(trimmedBase));
+ config.base = prependForwardSlash(config.base);
}
return config;
diff --git a/packages/astro/src/core/cookies/cookies.ts b/packages/astro/src/core/cookies/cookies.ts
index 013357f32..604f30e63 100644
--- a/packages/astro/src/core/cookies/cookies.ts
+++ b/packages/astro/src/core/cookies/cookies.ts
@@ -15,14 +15,14 @@ interface AstroCookieSetOptions {
type AstroCookieDeleteOptions = Pick<AstroCookieSetOptions, 'domain' | 'path'>;
interface AstroCookieInterface {
- value: string | undefined;
+ value: string;
json(): Record<string, any>;
number(): number;
boolean(): boolean;
}
interface AstroCookiesInterface {
- get(key: string): AstroCookieInterface;
+ get(key: string): AstroCookieInterface | undefined;
has(key: string): boolean;
set(
key: string,
@@ -37,7 +37,7 @@ const DELETED_VALUE = 'deleted';
const responseSentSymbol = Symbol.for('astro.responseSent');
class AstroCookie implements AstroCookieInterface {
- constructor(public value: string | undefined) {}
+ constructor(public value: string) {}
json() {
if (this.value === undefined) {
throw new Error(`Cannot convert undefined to an object.`);
@@ -97,20 +97,22 @@ class AstroCookies implements AstroCookiesInterface {
* @param key The cookie to get.
* @returns An object containing the cookie value as well as convenience methods for converting its value.
*/
- get(key: string): AstroCookie {
+ get(key: string): AstroCookie | undefined {
// Check for outgoing Set-Cookie values first
if (this.#outgoing?.has(key)) {
let [serializedValue, , isSetValue] = this.#outgoing.get(key)!;
if (isSetValue) {
return new AstroCookie(serializedValue);
} else {
- return new AstroCookie(undefined);
+ return undefined;
}
}
const values = this.#ensureParsed();
- const value = values[key];
- return new AstroCookie(value);
+ if (key in values) {
+ const value = values[key];
+ return new AstroCookie(value);
+ }
}
/**
diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts
index 0fb64ef69..efb78d137 100644
--- a/packages/astro/src/core/create-vite.ts
+++ b/packages/astro/src/core/create-vite.ts
@@ -234,37 +234,12 @@ export async function createVite(
result = vite.mergeConfig(result, settings.config.vite || {});
}
result = vite.mergeConfig(result, commandConfig);
- if (result.plugins) {
- sortPlugins(result.plugins);
- }
result.customLogger = vite.createLogger(result.logLevel ?? 'warn');
return result;
}
-function isVitePlugin(plugin: vite.PluginOption): plugin is vite.Plugin {
- return Boolean(plugin?.hasOwnProperty('name'));
-}
-
-function findPluginIndexByName(pluginOptions: vite.PluginOption[], name: string): number {
- return pluginOptions.findIndex(function (pluginOption) {
- // Use isVitePlugin to ignore nulls, booleans, promises, and arrays
- // CAUTION: could be a problem if a plugin we're searching for becomes async!
- return isVitePlugin(pluginOption) && pluginOption.name === name;
- });
-}
-
-function sortPlugins(pluginOptions: vite.PluginOption[]) {
- // HACK: move mdxPlugin to top because it needs to run before internal JSX plugin
- const mdxPluginIndex = findPluginIndexByName(pluginOptions, '@mdx-js/rollup');
- if (mdxPluginIndex === -1) return;
- const jsxPluginIndex = findPluginIndexByName(pluginOptions, 'astro:jsx');
- const mdxPlugin = pluginOptions[mdxPluginIndex];
- pluginOptions.splice(mdxPluginIndex, 1);
- pluginOptions.splice(jsxPluginIndex, 0, mdxPlugin);
-}
-
const COMMON_DEPENDENCIES_NOT_ASTRO = [
'autoprefixer',
'react',
diff --git a/packages/astro/src/core/endpoint/index.ts b/packages/astro/src/core/endpoint/index.ts
index 485190e47..97b26e380 100644
--- a/packages/astro/src/core/endpoint/index.ts
+++ b/packages/astro/src/core/endpoint/index.ts
@@ -7,13 +7,13 @@ import type {
Params,
} from '../../@types/astro';
import type { Environment, RenderContext } from '../render/index';
-
import { renderEndpoint } from '../../runtime/server/index.js';
import { ASTRO_VERSION } from '../constants.js';
import { AstroCookies, attachToResponse } from '../cookies/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { warn } from '../logger/core.js';
import { callMiddleware } from '../middleware/callMiddleware.js';
+
const clientAddressSymbol = Symbol.for('astro.clientAddress');
const clientLocalsSymbol = Symbol.for('astro.locals');
@@ -117,11 +117,11 @@ export async function callEndpoint<MiddlewareResult = Response | EndpointOutput>
onRequest as MiddlewareEndpointHandler,
context,
async () => {
- return await renderEndpoint(mod, context, env.ssr);
+ return await renderEndpoint(mod, context, env.ssr, env.logging);
}
);
} else {
- response = await renderEndpoint(mod, context, env.ssr);
+ response = await renderEndpoint(mod, context, env.ssr, env.logging);
}
if (response instanceof Response) {
diff --git a/packages/astro/src/core/logger/console.ts b/packages/astro/src/core/logger/console.ts
index dfe732bd7..f39f6b74d 100644
--- a/packages/astro/src/core/logger/console.ts
+++ b/packages/astro/src/core/logger/console.ts
@@ -15,7 +15,7 @@ export const consoleLogDestination = {
function getPrefix() {
let prefix = '';
- let type = event.type;
+ let type = event.label;
if (type) {
// hide timestamp when type is undefined
prefix += dim(dateTimeFormat.format(new Date()) + ' ');
diff --git a/packages/astro/src/core/logger/core.ts b/packages/astro/src/core/logger/core.ts
index 4f0c281e0..e5d0aee1f 100644
--- a/packages/astro/src/core/logger/core.ts
+++ b/packages/astro/src/core/logger/core.ts
@@ -6,7 +6,6 @@ interface LogWritable<T> {
}
export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; // same as Pino
-export type LoggerEvent = 'info' | 'warn' | 'error';
export interface LogOptions {
dest: LogWritable<LogMessage>;
@@ -29,7 +28,7 @@ export const dateTimeFormat = new Intl.DateTimeFormat([], {
});
export interface LogMessage {
- type: string | null;
+ label: string | null;
level: LoggerLevel;
message: string;
}
@@ -43,11 +42,11 @@ export const levels: Record<LoggerLevel, number> = {
};
/** Full logging API */
-export function log(opts: LogOptions, level: LoggerLevel, type: string | null, message: string) {
+export function log(opts: LogOptions, level: LoggerLevel, label: string | null, message: string) {
const logLevel = opts.level;
const dest = opts.dest;
const event: LogMessage = {
- type,
+ label,
level,
message,
};
@@ -61,18 +60,18 @@ export function log(opts: LogOptions, level: LoggerLevel, type: string | null, m
}
/** Emit a user-facing message. Useful for UI and other console messages. */
-export function info(opts: LogOptions, type: string | null, message: string) {
- return log(opts, 'info', type, message);
+export function info(opts: LogOptions, label: string | null, message: string) {
+ return log(opts, 'info', label, message);
}
/** Emit a warning message. Useful for high-priority messages that aren't necessarily errors. */
-export function warn(opts: LogOptions, type: string | null, message: string) {
- return log(opts, 'warn', type, message);
+export function warn(opts: LogOptions, label: string | null, message: string) {
+ return log(opts, 'warn', label, message);
}
/** Emit a error message, Useful when Astro can't recover from some error. */
-export function error(opts: LogOptions, type: string | null, message: string) {
- return log(opts, 'error', type, message);
+export function error(opts: LogOptions, label: string | null, message: string) {
+ return log(opts, 'error', label, message);
}
type LogFn = typeof info | typeof warn | typeof error;
@@ -127,3 +126,53 @@ export function timerMessage(message: string, startTime: number = Date.now()) {
timeDiff < 750 ? `${Math.round(timeDiff)}ms` : `${(timeDiff / 1000).toFixed(1)}s`;
return `${message} ${dim(timeDisplay)}`;
}
+
+export class Logger {
+ options: LogOptions;
+ constructor(options: LogOptions) {
+ this.options = options;
+ }
+
+ info(label: string, message: string) {
+ info(this.options, label, message);
+ }
+ warn(label: string, message: string) {
+ warn(this.options, label, message);
+ }
+ error(label: string, message: string) {
+ error(this.options, label, message);
+ }
+ debug(label: string, message: string) {
+ debug(this.options, label, message);
+ }
+}
+
+export class AstroIntegrationLogger {
+ options: LogOptions;
+ label: string;
+
+ constructor(logging: LogOptions, label: string) {
+ this.options = logging;
+ this.label = label;
+ }
+
+ /**
+ * Creates a new logger instance with a new label, but the same log options.
+ */
+ fork(label: string): AstroIntegrationLogger {
+ return new AstroIntegrationLogger(this.options, label);
+ }
+
+ info(message: string) {
+ info(this.options, this.label, message);
+ }
+ warn(message: string) {
+ warn(this.options, this.label, message);
+ }
+ error(message: string) {
+ error(this.options, this.label, message);
+ }
+ debug(message: string) {
+ debug(this.options, this.label, message);
+ }
+}
diff --git a/packages/astro/src/core/logger/node.ts b/packages/astro/src/core/logger/node.ts
index 513ba257e..aeef4bd84 100644
--- a/packages/astro/src/core/logger/node.ts
+++ b/packages/astro/src/core/logger/node.ts
@@ -21,19 +21,19 @@ export const nodeLogDestination = new Writable({
function getPrefix() {
let prefix = '';
- let type = event.type;
- if (type) {
+ let label = event.label;
+ if (label) {
// hide timestamp when type is undefined
prefix += dim(dateTimeFormat.format(new Date()) + ' ');
if (event.level === 'info') {
- type = bold(cyan(`[${type}]`));
+ label = bold(cyan(`[${label}]`));
} else if (event.level === 'warn') {
- type = bold(yellow(`[${type}]`));
+ label = bold(yellow(`[${label}]`));
} else if (event.level === 'error') {
- type = bold(red(`[${type}]`));
+ label = bold(red(`[${label}]`));
}
- prefix += `${type} `;
+ prefix += `${label} `;
}
return reset(prefix);
}
@@ -87,7 +87,7 @@ export const nodeLogOptions: Required<LogOptions> = {
};
export interface LogMessage {
- type: string | null;
+ label: string | null;
level: LoggerLevel;
message: string;
}
diff --git a/packages/astro/src/core/polyfill.ts b/packages/astro/src/core/polyfill.ts
index 99e0d5cc5..daceb53e2 100644
--- a/packages/astro/src/core/polyfill.ts
+++ b/packages/astro/src/core/polyfill.ts
@@ -1,8 +1,21 @@
-import { polyfill } from '@astrojs/webapi';
+import { File } from 'node:buffer';
+import crypto from 'node:crypto';
+
+// NOTE: This file does not intend to polyfill everything that exists, its main goal is to make life easier
+// for users deploying to runtime that do support these features. In the future, we hope for this file to disappear.
export function apply() {
- // polyfill WebAPIs for Node.js runtime
- polyfill(globalThis, {
- exclude: 'window document',
- });
+ // Remove when Node 18 is dropped for Node 20
+ if (!globalThis.crypto) {
+ Object.defineProperty(globalThis, 'crypto', {
+ value: crypto.webcrypto,
+ });
+ }
+
+ // Remove when Node 18 is dropped for Node 20
+ if (!globalThis.File) {
+ Object.defineProperty(globalThis, 'File', {
+ value: File,
+ });
+ }
}
diff --git a/packages/astro/src/core/render/core.ts b/packages/astro/src/core/render/core.ts
index d6228fbbe..eca7552e6 100644
--- a/packages/astro/src/core/render/core.ts
+++ b/packages/astro/src/core/render/core.ts
@@ -42,7 +42,6 @@ async function renderPage({ mod, renderContext, env, cookies }: RenderPage) {
links: renderContext.links,
styles: renderContext.styles,
logging: env.logging,
- markdown: env.markdown,
params: renderContext.params,
pathname: renderContext.pathname,
componentMetadata: renderContext.componentMetadata,
@@ -59,12 +58,7 @@ async function renderPage({ mod, renderContext, env, cookies }: RenderPage) {
locals: renderContext.locals ?? {},
});
- // Support `export const components` for `MDX` pages
- if (typeof (mod as any).components === 'object') {
- Object.assign(renderContext.props, { components: (mod as any).components });
- }
-
- let response = await runtimeRenderPage(
+ const response = await runtimeRenderPage(
result,
Component,
renderContext.props,
diff --git a/packages/astro/src/core/render/environment.ts b/packages/astro/src/core/render/environment.ts
index de7cbe6a8..32dfb454b 100644
--- a/packages/astro/src/core/render/environment.ts
+++ b/packages/astro/src/core/render/environment.ts
@@ -1,4 +1,3 @@
-import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
import type { AstroSettings, RuntimeMode, SSRLoadedRenderer } from '../../@types/astro';
import type { LogOptions } from '../logger/core.js';
import type { ModuleLoader } from '../module-loader';
@@ -16,10 +15,6 @@ export interface Environment {
adapterName?: string;
/** logging options */
logging: LogOptions;
- /**
- * Used to support `Astro.__renderMarkdown` for legacy `<Markdown />` component
- */
- markdown: MarkdownRenderingOptions;
/** "development" or "production" */
mode: RuntimeMode;
compressHTML: boolean;
diff --git a/packages/astro/src/core/render/params-and-props.ts b/packages/astro/src/core/render/params-and-props.ts
index a5e4fa222..fc08c495e 100644
--- a/packages/astro/src/core/render/params-and-props.ts
+++ b/packages/astro/src/core/render/params-and-props.ts
@@ -33,7 +33,6 @@ export async function getParamsAndProps(opts: GetParamsAndPropsOptions): Promise
mod,
route,
routeCache,
- isValidate: true,
logging,
ssr,
});
diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts
index 968b232d4..72fa4ddcf 100644
--- a/packages/astro/src/core/render/result.ts
+++ b/packages/astro/src/core/render/result.ts
@@ -1,4 +1,3 @@
-import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
import type {
AstroGlobal,
AstroGlobalPartial,
@@ -27,10 +26,6 @@ export interface CreateResultArgs {
*/
ssr: boolean;
logging: LogOptions;
- /**
- * Used to support `Astro.__renderMarkdown` for legacy `<Markdown />` component
- */
- markdown: MarkdownRenderingOptions;
params: Params;
pathname: string;
renderers: SSRLoadedRenderer[];
@@ -128,10 +123,8 @@ class Slots {
}
}
-let renderMarkdown: any = null;
-
export function createResult(args: CreateResultArgs): SSRResult {
- const { markdown, params, request, resolve, locals } = args;
+ const { params, request, resolve, locals } = args;
const url = new URL(request.url);
const headers = new Headers();
@@ -222,31 +215,6 @@ export function createResult(args: CreateResultArgs): SSRResult {
slots: astroSlots as unknown as AstroGlobal['slots'],
};
- Object.defineProperty(Astro, '__renderMarkdown', {
- // Ensure this API is not exposed to users
- enumerable: false,
- writable: false,
- // TODO: Remove this hole "Deno" logic once our plugin gets Deno support
- value: async function (content: string, opts: MarkdownRenderingOptions) {
- // @ts-expect-error
- if (typeof Deno !== 'undefined') {
- throw new Error('Markdown is not supported in Deno SSR');
- }
-
- if (!renderMarkdown) {
- // The package is saved in this variable because Vite is too smart
- // and will try to inline it in buildtime
- let astroRemark = '@astrojs/';
- astroRemark += 'markdown-remark';
-
- renderMarkdown = (await import(astroRemark)).renderMarkdown;
- }
-
- const { code } = await renderMarkdown(content, { ...markdown, ...(opts ?? {}) });
- return code;
- },
- });
-
return Astro;
},
resolve,
diff --git a/packages/astro/src/core/render/route-cache.ts b/packages/astro/src/core/render/route-cache.ts
index 7ad247ef8..804f09183 100644
--- a/packages/astro/src/core/render/route-cache.ts
+++ b/packages/astro/src/core/render/route-cache.ts
@@ -18,7 +18,6 @@ interface CallGetStaticPathsOptions {
mod: ComponentInstance;
route: RouteData;
routeCache: RouteCache;
- isValidate: boolean;
logging: LogOptions;
ssr: boolean;
}
@@ -27,7 +26,6 @@ export async function callGetStaticPaths({
mod,
route,
routeCache,
- isValidate,
logging,
ssr,
}: CallGetStaticPathsOptions): Promise<GetStaticPathsResultKeyed> {
@@ -58,14 +56,7 @@ export async function callGetStaticPaths({
},
});
- // Flatten the array before validating the content, otherwise users using `.map` will run into errors
- if (Array.isArray(staticPaths)) {
- staticPaths = staticPaths.flat();
- }
-
- if (isValidate) {
- validateGetStaticPathsResult(staticPaths, logging, route);
- }
+ validateGetStaticPathsResult(staticPaths, logging, route);
const keyedStaticPaths = staticPaths as GetStaticPathsResultKeyed;
keyedStaticPaths.keyed = new Map<string, GetStaticPathsItem>();
diff --git a/packages/astro/src/core/routing/validation.ts b/packages/astro/src/core/routing/validation.ts
index 9a562c044..b5c29b16e 100644
--- a/packages/astro/src/core/routing/validation.ts
+++ b/packages/astro/src/core/routing/validation.ts
@@ -54,6 +54,15 @@ export function validateGetStaticPathsResult(
}
result.forEach((pathObject) => {
+ if ((typeof pathObject === 'object' && Array.isArray(pathObject)) || pathObject === null) {
+ throw new AstroError({
+ ...AstroErrorData.InvalidGetStaticPathsEntry,
+ message: AstroErrorData.InvalidGetStaticPathsEntry.message(
+ Array.isArray(pathObject) ? 'array' : typeof pathObject
+ ),
+ });
+ }
+
if (
pathObject.params === undefined ||
pathObject.params === null ||
@@ -67,16 +76,6 @@ export function validateGetStaticPathsResult(
});
}
- if (typeof pathObject.params !== 'object') {
- throw new AstroError({
- ...AstroErrorData.InvalidGetStaticPathParam,
- message: AstroErrorData.InvalidGetStaticPathParam.message(typeof pathObject.params),
- location: {
- file: route.component,
- },
- });
- }
-
// TODO: Replace those with errors? They technically don't crash the build, but users might miss the warning. - erika, 2022-11-07
for (const [key, val] of Object.entries(pathObject.params)) {
if (!(typeof val === 'undefined' || typeof val === 'string' || typeof val === 'number')) {
diff --git a/packages/astro/src/integrations/astroFeaturesValidation.ts b/packages/astro/src/integrations/astroFeaturesValidation.ts
new file mode 100644
index 000000000..c494b35f4
--- /dev/null
+++ b/packages/astro/src/integrations/astroFeaturesValidation.ts
@@ -0,0 +1,157 @@
+import type {
+ AstroAssetsFeature,
+ AstroConfig,
+ AstroFeatureMap,
+ SupportsKind,
+} from '../@types/astro';
+import { error, warn, type LogOptions } from '../core/logger/core.js';
+
+const STABLE = 'stable';
+const DEPRECATED = 'deprecated';
+const UNSUPPORTED = 'unsupported';
+const EXPERIMENTAL = 'experimental';
+
+const UNSUPPORTED_ASSETS_FEATURE: AstroAssetsFeature = {
+ supportKind: UNSUPPORTED,
+ isSquooshCompatible: false,
+ isSharpCompatible: false,
+};
+
+// NOTE: remove for Astro 4.0
+const ALL_UNSUPPORTED: Required<AstroFeatureMap> = {
+ serverOutput: UNSUPPORTED,
+ staticOutput: UNSUPPORTED,
+ hybridOutput: UNSUPPORTED,
+ assets: UNSUPPORTED_ASSETS_FEATURE,
+};
+
+type ValidationResult = {
+ [Property in keyof AstroFeatureMap]: boolean;
+};
+
+/**
+ * Checks whether an adapter supports certain features that are enabled via Astro configuration.
+ *
+ * If a configuration is enabled and "unlocks" a feature, but the adapter doesn't support, the function
+ * will throw a runtime error.
+ *
+ */
+export function validateSupportedFeatures(
+ adapterName: string,
+ featureMap: AstroFeatureMap = ALL_UNSUPPORTED,
+ config: AstroConfig,
+ logging: LogOptions
+): ValidationResult {
+ const {
+ assets = UNSUPPORTED_ASSETS_FEATURE,
+ serverOutput = UNSUPPORTED,
+ staticOutput = UNSUPPORTED,
+ hybridOutput = UNSUPPORTED,
+ } = featureMap;
+ const validationResult: ValidationResult = {};
+
+ validationResult.staticOutput = validateSupportKind(
+ staticOutput,
+ adapterName,
+ logging,
+ 'staticOutput',
+ () => config?.output === 'static'
+ );
+
+ validationResult.hybridOutput = validateSupportKind(
+ hybridOutput,
+ adapterName,
+ logging,
+ 'hybridOutput',
+ () => config?.output === 'hybrid'
+ );
+
+ validationResult.serverOutput = validateSupportKind(
+ serverOutput,
+ adapterName,
+ logging,
+ 'serverOutput',
+ () => config?.output === 'server'
+ );
+ validationResult.assets = validateAssetsFeature(assets, adapterName, config, logging);
+
+ return validationResult;
+}
+
+function validateSupportKind(
+ supportKind: SupportsKind,
+ adapterName: string,
+ logging: LogOptions,
+ featureName: string,
+ hasCorrectConfig: () => boolean
+): boolean {
+ if (supportKind === STABLE) {
+ return true;
+ } else if (supportKind === DEPRECATED) {
+ featureIsDeprecated(adapterName, logging);
+ } else if (supportKind === EXPERIMENTAL) {
+ featureIsExperimental(adapterName, logging);
+ }
+
+ if (hasCorrectConfig() && supportKind === UNSUPPORTED) {
+ featureIsUnsupported(adapterName, logging, featureName);
+ return false;
+ } else {
+ return true;
+ }
+}
+
+function featureIsUnsupported(adapterName: string, logging: LogOptions, featureName: string) {
+ error(
+ logging,
+ `${adapterName}`,
+ `The feature ${featureName} is not supported by the adapter ${adapterName}.`
+ );
+}
+
+function featureIsExperimental(adapterName: string, logging: LogOptions) {
+ warn(logging, `${adapterName}`, 'The feature is experimental and subject to issues or changes.');
+}
+
+function featureIsDeprecated(adapterName: string, logging: LogOptions) {
+ warn(
+ logging,
+ `${adapterName}`,
+ 'The feature is deprecated and will be moved in the next release.'
+ );
+}
+
+const SHARP_SERVICE = 'astro/assets/services/sharp';
+const SQUOOSH_SERVICE = 'astro/assets/services/squoosh';
+
+function validateAssetsFeature(
+ assets: AstroAssetsFeature,
+ adapterName: string,
+ config: AstroConfig,
+ logging: LogOptions
+): boolean {
+ const {
+ supportKind = UNSUPPORTED,
+ isSharpCompatible = false,
+ isSquooshCompatible = false,
+ } = assets;
+ if (config?.image?.service?.entrypoint === SHARP_SERVICE && !isSharpCompatible) {
+ error(
+ logging,
+ 'astro',
+ `The currently selected adapter \`${adapterName}\` is not compatible with the image service "Sharp".`
+ );
+ return false;
+ }
+
+ if (config?.image?.service?.entrypoint === SQUOOSH_SERVICE && !isSquooshCompatible) {
+ error(
+ logging,
+ 'astro',
+ `The currently selected adapter \`${adapterName}\` is not compatible with the image service "Squoosh".`
+ );
+ return false;
+ }
+
+ return validateSupportKind(supportKind, adapterName, logging, 'assets', () => true);
+}
diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts
index cf50df0e1..71c5a5e63 100644
--- a/packages/astro/src/integrations/index.ts
+++ b/packages/astro/src/integrations/index.ts
@@ -4,7 +4,9 @@ import type { AddressInfo } from 'node:net';
import { fileURLToPath } from 'node:url';
import type { InlineConfig, ViteDevServer } from 'vite';
import type {
+ AstroAdapter,
AstroConfig,
+ AstroIntegration,
AstroRenderer,
AstroSettings,
ContentEntryType,
@@ -16,8 +18,9 @@ import type { SerializedSSRManifest } from '../core/app/types';
import type { PageBuildData } from '../core/build/types';
import { buildClientDirectiveEntrypoint } from '../core/client-directive/index.js';
import { mergeConfig } from '../core/config/index.js';
-import { info, type LogOptions } from '../core/logger/core.js';
+import { AstroIntegrationLogger, error, info, warn, type LogOptions } from '../core/logger/core.js';
import { isServerLikeOutput } from '../prerender/utils.js';
+import { validateSupportedFeatures } from './astroFeaturesValidation.js';
async function withTakingALongTimeMsg<T>({
name,
@@ -38,6 +41,19 @@ async function withTakingALongTimeMsg<T>({
return result;
}
+// Used internally to store instances of loggers.
+const Loggers = new WeakMap<AstroIntegration, AstroIntegrationLogger>();
+
+function getLogger(integration: AstroIntegration, logging: LogOptions) {
+ if (Loggers.has(integration)) {
+ // SAFETY: we check the existence in the if block
+ return Loggers.get(integration)!;
+ }
+ const logger = new AstroIntegrationLogger(logging, integration.name);
+ Loggers.set(integration, logger);
+ return logger;
+}
+
export async function runHookConfigSetup({
settings,
command,
@@ -72,6 +88,8 @@ export async function runHookConfigSetup({
* ```
*/
if (integration.hooks?.['astro:config:setup']) {
+ const logger = getLogger(integration, logging);
+
const hooks: HookParameters<'astro:config:setup'> = {
config: updatedConfig,
command,
@@ -107,6 +125,7 @@ export async function runHookConfigSetup({
}
addedClientDirectives.set(name, buildClientDirectiveEntrypoint(name, entrypoint));
},
+ logger,
};
// ---
@@ -167,6 +186,7 @@ export async function runHookConfigDone({
logging: LogOptions;
}) {
for (const integration of settings.config.integrations) {
+ const logger = getLogger(integration, logging);
if (integration?.hooks?.['astro:config:done']) {
await withTakingALongTimeMsg({
name: integration.name,
@@ -178,8 +198,44 @@ export async function runHookConfigDone({
`Integration "${integration.name}" conflicts with "${settings.adapter.name}". You can only configure one deployment integration.`
);
}
+ if (!adapter.supportedAstroFeatures) {
+ // NOTE: throw an error in Astro 4.0
+ warn(
+ logging,
+ 'astro',
+ `The adapter ${adapter.name} doesn't provide a feature map. From Astro 3.0, an adapter can provide a feature map. Not providing a feature map will cause an error in Astro 4.0.`
+ );
+ } else {
+ const validationResult = validateSupportedFeatures(
+ adapter.name,
+ adapter.supportedAstroFeatures,
+ settings.config,
+ logging
+ );
+ for (const [featureName, supported] of Object.entries(validationResult)) {
+ if (!supported) {
+ error(
+ logging,
+ 'astro',
+ `The adapter ${adapter.name} doesn't support the feature ${featureName}. Your project won't be built. You should not use it.`
+ );
+ }
+ }
+ if (!validationResult.assets) {
+ info(
+ logging,
+ 'astro',
+ `The selected adapter ${adapter.name} does not support Sharp or Squoosh for image processing. To ensure your project is still able to build, image processing has been disabled.`
+ );
+ settings.config.image.service = {
+ entrypoint: 'astro/assets/services/noop',
+ config: {},
+ };
+ }
+ }
settings.adapter = adapter;
},
+ logger,
}),
logging,
});
@@ -198,9 +254,10 @@ export async function runHookServerSetup({
}) {
for (const integration of config.integrations) {
if (integration?.hooks?.['astro:server:setup']) {
+ const logger = getLogger(integration, logging);
await withTakingALongTimeMsg({
name: integration.name,
- hookResult: integration.hooks['astro:server:setup']({ server }),
+ hookResult: integration.hooks['astro:server:setup']({ server, logger }),
logging,
});
}
@@ -217,10 +274,12 @@ export async function runHookServerStart({
logging: LogOptions;
}) {
for (const integration of config.integrations) {
+ const logger = getLogger(integration, logging);
+
if (integration?.hooks?.['astro:server:start']) {
await withTakingALongTimeMsg({
name: integration.name,
- hookResult: integration.hooks['astro:server:start']({ address }),
+ hookResult: integration.hooks['astro:server:start']({ address, logger }),
logging,
});
}
@@ -235,10 +294,12 @@ export async function runHookServerDone({
logging: LogOptions;
}) {
for (const integration of config.integrations) {
+ const logger = getLogger(integration, logging);
+
if (integration?.hooks?.['astro:server:done']) {
await withTakingALongTimeMsg({
name: integration.name,
- hookResult: integration.hooks['astro:server:done'](),
+ hookResult: integration.hooks['astro:server:done']({ logger }),
logging,
});
}
@@ -254,9 +315,11 @@ export async function runHookBuildStart({
}) {
for (const integration of config.integrations) {
if (integration?.hooks?.['astro:build:start']) {
+ const logger = getLogger(integration, logging);
+
await withTakingALongTimeMsg({
name: integration.name,
- hookResult: integration.hooks['astro:build:start'](),
+ hookResult: integration.hooks['astro:build:start']({ logger }),
logging,
});
}
@@ -280,6 +343,8 @@ export async function runHookBuildSetup({
for (const integration of config.integrations) {
if (integration?.hooks?.['astro:build:setup']) {
+ const logger = getLogger(integration, logging);
+
await withTakingALongTimeMsg({
name: integration.name,
hookResult: integration.hooks['astro:build:setup']({
@@ -289,6 +354,7 @@ export async function runHookBuildSetup({
updateConfig: (newConfig) => {
updatedConfig = mergeConfig(updatedConfig, newConfig);
},
+ logger,
}),
logging,
});
@@ -315,12 +381,15 @@ export async function runHookBuildSsr({
}: RunHookBuildSsr) {
for (const integration of config.integrations) {
if (integration?.hooks?.['astro:build:ssr']) {
+ const logger = getLogger(integration, logging);
+
await withTakingALongTimeMsg({
name: integration.name,
hookResult: integration.hooks['astro:build:ssr']({
manifest,
entryPoints,
middlewareEntryPoint,
+ logger,
}),
logging,
});
@@ -338,10 +407,12 @@ export async function runHookBuildGenerated({
const dir = isServerLikeOutput(config) ? config.build.client : config.outDir;
for (const integration of config.integrations) {
+ const logger = getLogger(integration, logging);
+
if (integration?.hooks?.['astro:build:generated']) {
await withTakingALongTimeMsg({
name: integration.name,
- hookResult: integration.hooks['astro:build:generated']({ dir }),
+ hookResult: integration.hooks['astro:build:generated']({ dir, logger }),
logging,
});
}
@@ -361,15 +432,34 @@ export async function runHookBuildDone({ config, pages, routes, logging }: RunHo
for (const integration of config.integrations) {
if (integration?.hooks?.['astro:build:done']) {
+ const logger = getLogger(integration, logging);
+
await withTakingALongTimeMsg({
name: integration.name,
hookResult: integration.hooks['astro:build:done']({
pages: pages.map((p) => ({ pathname: p })),
dir,
routes,
+ logger,
}),
logging,
});
}
}
}
+
+export function isFunctionPerRouteEnabled(adapter: AstroAdapter | undefined): boolean {
+ if (adapter?.adapterFeatures?.functionPerRoute === true) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+export function isEdgeMiddlewareEnabled(adapter: AstroAdapter | undefined): boolean {
+ if (adapter?.adapterFeatures?.edgeMiddleware === true) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/packages/astro/src/runtime/server/endpoint.ts b/packages/astro/src/runtime/server/endpoint.ts
index c56ab7646..89c35957c 100644
--- a/packages/astro/src/runtime/server/endpoint.ts
+++ b/packages/astro/src/runtime/server/endpoint.ts
@@ -1,28 +1,56 @@
import type { APIContext, EndpointHandler, Params } from '../../@types/astro';
+import { type LogOptions, warn } from '../../core/logger/core.js';
-function getHandlerFromModule(mod: EndpointHandler, method: string) {
+function getHandlerFromModule(mod: EndpointHandler, method: string, logging: LogOptions) {
+ const lowerCaseMethod = method.toLowerCase();
+
+ // TODO: remove in Astro 4.0
+ if (mod[lowerCaseMethod]) {
+ warn(
+ logging,
+ 'astro',
+ `Lower case endpoint names are deprecated and will not be supported in Astro 4.0. Rename the endpoint ${lowerCaseMethod} to ${method}.`
+ );
+ }
// If there was an exact match on `method`, return that function.
if (mod[method]) {
return mod[method];
}
+
+ // TODO: remove in Astro 4.0
+ if (mod[lowerCaseMethod]) {
+ return mod[lowerCaseMethod];
+ }
+ // TODO: remove in Astro 4.0
// Handle `del` instead of `delete`, since `delete` is a reserved word in JS.
if (method === 'delete' && mod['del']) {
return mod['del'];
}
+ // TODO: remove in Astro 4.0
// If a single `all` handler was used, return that function.
if (mod['all']) {
return mod['all'];
}
+ if (mod['ALL']) {
+ return mod['ALL'];
+ }
// Otherwise, no handler found.
return undefined;
}
/** Renders an endpoint request to completion, returning the body. */
-export async function renderEndpoint(mod: EndpointHandler, context: APIContext, ssr: boolean) {
- const { request, params } = context;
- const chosenMethod = request.method?.toLowerCase();
- const handler = getHandlerFromModule(mod, chosenMethod);
- if (!ssr && ssr === false && chosenMethod && chosenMethod !== 'get') {
+export async function renderEndpoint(
+ mod: EndpointHandler,
+ context: APIContext,
+ ssr: boolean,
+ logging: LogOptions
+) {
+ const { request } = context;
+
+ const chosenMethod = request.method?.toUpperCase();
+ const handler = getHandlerFromModule(mod, chosenMethod, logging);
+ // TODO: remove the 'get' check in Astro 4.0
+ if (!ssr && ssr === false && chosenMethod && chosenMethod !== 'GET' && chosenMethod !== 'get') {
// eslint-disable-next-line no-console
console.warn(`
${chosenMethod} requests are not available when building a static site. Update your config to \`output: 'server'\` or \`output: 'hybrid'\` with an \`export const prerender = false\` to handle ${chosenMethod} requests.`);
@@ -40,35 +68,10 @@ ${chosenMethod} requests are not available when building a static site. Update y
return response;
}
- // TODO: Remove support for old API in Astro 3.0
- if (handler.length > 1) {
- // eslint-disable-next-line no-console
- console.warn(`
-API routes with 2 arguments have been deprecated. Instead they take a single argument in the form of:
-
-export function get({ params, request }) {
- //...
-}
-
-Update your code to remove this warning.`);
- }
-
const proxy = new Proxy(context, {
get(target, prop) {
if (prop in target) {
return Reflect.get(target, prop);
- } else if (prop in params) {
- // TODO: Remove support for old API in Astro 3.0
- // eslint-disable-next-line no-console
- console.warn(`
-API routes no longer pass params as the first argument. Instead an object containing a params property is provided in the form of:
-
-export function get({ params }) {
- // ...
-}
-
-Update your code to remove this warning.`);
- return Reflect.get(params, prop);
} else {
return undefined;
}
diff --git a/packages/astro/src/runtime/server/render/page.ts b/packages/astro/src/runtime/server/render/page.ts
index cabbe8dae..74e8a45b7 100644
--- a/packages/astro/src/runtime/server/render/page.ts
+++ b/packages/astro/src/runtime/server/render/page.ts
@@ -2,7 +2,6 @@ import type { RouteData, SSRResult } from '../../../@types/astro';
import { renderComponentToString, type NonAstroPageComponent } from './component.js';
import type { AstroComponentFactory } from './index';
-import { createResponse } from '../response.js';
import { isAstroComponentFactory } from './astro/index.js';
import { renderToReadableStream, renderToString } from './astro/render.js';
import { encoder } from './common.js';
@@ -64,6 +63,6 @@ export async function renderPage(
body = encoder.encode(body);
headers.set('Content-Length', body.byteLength.toString());
}
- const response = createResponse(body, { ...init, headers });
+ const response = new Response(body, { ...init, headers });
return response;
}
diff --git a/packages/astro/src/runtime/server/response.ts b/packages/astro/src/runtime/server/response.ts
deleted file mode 100644
index bcfda19aa..000000000
--- a/packages/astro/src/runtime/server/response.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { streamAsyncIterator } from './util.js';
-
-const isNodeJS =
- typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]';
-
-let StreamingCompatibleResponse: typeof Response | undefined;
-
-function createResponseClass() {
- StreamingCompatibleResponse = class extends Response {
- #isStream: boolean;
- #body: any;
- constructor(body?: BodyInit | null, init?: ResponseInit) {
- let isStream = body instanceof ReadableStream;
- super(isStream ? null : body, init);
- this.#isStream = isStream;
- this.#body = body;
- }
-
- get body() {
- return this.#body;
- }
-
- async text(): Promise<string> {
- if (this.#isStream && isNodeJS) {
- let decoder = new TextDecoder();
- let body = this.#body;
- let out = '';
- for await (let chunk of streamAsyncIterator(body)) {
- out += decoder.decode(chunk);
- }
- return out;
- }
- return super.text();
- }
-
- async arrayBuffer(): Promise<ArrayBuffer> {
- if (this.#isStream && isNodeJS) {
- let body = this.#body;
- let chunks: Uint8Array[] = [];
- let len = 0;
- for await (let chunk of streamAsyncIterator(body)) {
- chunks.push(chunk);
- len += chunk.length;
- }
- let ab = new Uint8Array(len);
- let offset = 0;
- for (const chunk of chunks) {
- ab.set(chunk, offset);
- offset += chunk.length;
- }
- return ab;
- }
- return super.arrayBuffer();
- }
-
- clone() {
- return new StreamingCompatibleResponse!(this.#body, {
- status: this.status,
- statusText: this.statusText,
- headers: this.headers,
- });
- }
- };
-
- return StreamingCompatibleResponse;
-}
-
-type CreateResponseFn = (body?: BodyInit | null, init?: ResponseInit) => Response;
-
-export const createResponse: CreateResponseFn = isNodeJS
- ? (body, init) => {
- if (typeof body === 'string' || ArrayBuffer.isView(body)) {
- return new Response(body, init);
- }
- if (typeof StreamingCompatibleResponse === 'undefined') {
- return new (createResponseClass())(body, init);
- }
- return new StreamingCompatibleResponse(body, init);
- }
- : (body, init) => new Response(body, init);
diff --git a/packages/astro/src/vite-plugin-astro-postprocess/index.ts b/packages/astro/src/vite-plugin-astro-postprocess/index.ts
index 9a2e185af..39acd000c 100644
--- a/packages/astro/src/vite-plugin-astro-postprocess/index.ts
+++ b/packages/astro/src/vite-plugin-astro-postprocess/index.ts
@@ -1,4 +1,5 @@
import { parse } from 'acorn';
+import type { Node as ESTreeNode } from 'estree-walker';
import { walk } from 'estree-walker';
import MagicString from 'magic-string';
import type { Plugin } from 'vite';
@@ -28,7 +29,7 @@ export default function astro(): Plugin {
sourceType: 'module',
});
- walk(ast, {
+ walk(ast as ESTreeNode, {
enter(node: any) {
// Transform `Astro.glob("./pages/*.astro")` to `Astro.glob(import.meta.glob("./pages/*.astro"), () => "./pages/*.astro")`
// Also handle for `Astro2.glob()`
diff --git a/packages/astro/src/vite-plugin-astro-server/environment.ts b/packages/astro/src/vite-plugin-astro-server/environment.ts
index bcf783bf2..ce7b92662 100644
--- a/packages/astro/src/vite-plugin-astro-server/environment.ts
+++ b/packages/astro/src/vite-plugin-astro-server/environment.ts
@@ -17,7 +17,6 @@ export function createDevelopmentEnvironment(
let env = createEnvironment({
adapterName: manifest.adapterName,
logging,
- markdown: manifest.markdown,
mode,
// This will be overridden in the dev server
renderers: [],
diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts
index 681aac341..cb74f9d9a 100644
--- a/packages/astro/src/vite-plugin-astro-server/plugin.ts
+++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts
@@ -92,7 +92,6 @@ export function createDevelopmentManifest(settings: AstroSettings): SSRManifest
entryModules: {},
routes: [],
adapterName: '',
- markdown: settings.config.markdown,
clientDirectives: settings.clientDirectives,
renderers: [],
base: settings.config.base,
diff --git a/packages/astro/src/vite-plugin-head/index.ts b/packages/astro/src/vite-plugin-head/index.ts
index 9cfdc739f..ca95a334e 100644
--- a/packages/astro/src/vite-plugin-head/index.ts
+++ b/packages/astro/src/vite-plugin-head/index.ts
@@ -16,7 +16,7 @@ export default function configHeadVitePlugin(): vite.Plugin {
function propagateMetadata<
P extends keyof PluginMetadata['astro'],
- V extends PluginMetadata['astro'][P]
+ V extends PluginMetadata['astro'][P],
>(
this: { getModuleInfo(id: string): ModuleInfo | null },
id: string,
diff --git a/packages/astro/test/0-css.test.js b/packages/astro/test/0-css.test.js
index 76bfba296..9a05074fb 100644
--- a/packages/astro/test/0-css.test.js
+++ b/packages/astro/test/0-css.test.js
@@ -39,15 +39,27 @@ describe('CSS', function () {
it('HTML and CSS scoped correctly', async () => {
const el1 = $('#dynamic-class');
const el2 = $('#dynamic-vis');
- const classes = $('#class').attr('class').split(' ');
- const scopedClass = classes.find((name) => /^astro-[A-Za-z0-9-]+/.test(name));
+ const classes = $('#class');
+ let scopedAttribute;
+ for (const [key] of Object.entries(classes[0].attribs)) {
+ if (/^data-astro-cid-[A-Za-z0-9-]+/.test(key)) {
+ // Ema: this is ugly, but for reasons that I don't want to explore, cheerio
+ // lower case the hash of the attribute
+ scopedAttribute = key
+ .toUpperCase()
+ .replace('data-astro-cid-'.toUpperCase(), 'data-astro-cid-');
+ }
+ }
+ if (!scopedAttribute) {
+ throw new Error("Couldn't find scoped attribute");
+ }
// 1. check HTML
- expect(el1.attr('class')).to.equal(`blue ${scopedClass}`);
- expect(el2.attr('class')).to.equal(`visible ${scopedClass}`);
+ expect(el1.attr('class')).to.equal(`blue`);
+ expect(el2.attr('class')).to.equal(`visible`);
// 2. check CSS
- const expected = `.blue:where(.${scopedClass}){color:#b0e0e6}.color\\:blue:where(.${scopedClass}){color:#b0e0e6}.visible:where(.${scopedClass}){display:block}`;
+ const expected = `.blue[${scopedAttribute}],.color\\:blue[${scopedAttribute}]{color:#b0e0e6}.visible[${scopedAttribute}]{display:block}`;
expect(bundledCSS).to.include(expected);
});
@@ -60,8 +72,12 @@ describe('CSS', function () {
expect($('#no-scope').attr('class')).to.equal(undefined);
});
- it('Child inheritance', async () => {
- expect($('#passed-in').attr('class')).to.match(/outer astro-[A-Z0-9]+ astro-[A-Z0-9]+/);
+ it('Child inheritance', (done) => {
+ for (const [key] of Object.entries($('#passed-in')[0].attribs)) {
+ if (/^data-astro-cid-[A-Za-z0-9-]+/.test(key)) {
+ done();
+ }
+ }
});
it('Using hydrated components adds astro-island styles', async () => {
@@ -70,11 +86,11 @@ describe('CSS', function () {
});
it('<style lang="sass">', async () => {
- expect(bundledCSS).to.match(new RegExp('h1\\:where\\(.astro-[^{]*{color:#90ee90}'));
+ expect(bundledCSS).to.match(new RegExp('h1\\[data-astro-cid-[^{]*{color:#90ee90}'));
});
it('<style lang="scss">', async () => {
- expect(bundledCSS).to.match(new RegExp('h1\\:where\\(.astro-[^{]*{color:#ff69b4}'));
+ expect(bundledCSS).to.match(new RegExp('h1\\[data-astro-cid-[^{]*{color:#ff69b4}'));
});
});
@@ -331,10 +347,10 @@ describe('CSS', function () {
it('resolves Astro styles', async () => {
const allInjectedStyles = $('style').text();
- expect(allInjectedStyles).to.contain('.linked-css:where(.astro-');
- expect(allInjectedStyles).to.contain('.linked-sass:where(.astro-');
- expect(allInjectedStyles).to.contain('.linked-scss:where(.astro-');
- expect(allInjectedStyles).to.contain('.wrapper:where(.astro-');
+ expect(allInjectedStyles).to.contain('.linked-css[data-astro-cid-');
+ expect(allInjectedStyles).to.contain('.linked-sass[data-astro-cid-');
+ expect(allInjectedStyles).to.contain('.linked-scss[data-astro-cid-');
+ expect(allInjectedStyles).to.contain('.wrapper[data-astro-cid-');
});
it('resolves Styles from React', async () => {
diff --git a/packages/astro/test/astro-envs.test.js b/packages/astro/test/astro-envs.test.js
index 402878da5..c923ae065 100644
--- a/packages/astro/test/astro-envs.test.js
+++ b/packages/astro/test/astro-envs.test.js
@@ -109,7 +109,7 @@ describe('Environment Variables', () => {
expect(res.status).to.equal(200);
let indexHtml = await res.text();
let $ = cheerio.load(indexHtml);
- expect($('#base-url').text()).to.equal('/blog/');
+ expect($('#base-url').text()).to.equal('/blog');
});
it('does render destructured builtin SITE env', async () => {
@@ -117,7 +117,7 @@ describe('Environment Variables', () => {
expect(res.status).to.equal(200);
let indexHtml = await res.text();
let $ = cheerio.load(indexHtml);
- expect($('#base-url').text()).to.equal('/blog/');
+ expect($('#base-url').text()).to.equal('/blog');
});
});
});
diff --git a/packages/astro/test/astro-get-static-paths.test.js b/packages/astro/test/astro-get-static-paths.test.js
index 784ff1718..66aa5b94d 100644
--- a/packages/astro/test/astro-get-static-paths.test.js
+++ b/packages/astro/test/astro-get-static-paths.test.js
@@ -1,6 +1,6 @@
import { expect } from 'chai';
-import { loadFixture } from './test-utils.js';
import * as cheerio from 'cheerio';
+import { loadFixture } from './test-utils.js';
describe('getStaticPaths - build calls', () => {
/** @type {import('./test-utils').Fixture} */
@@ -92,11 +92,6 @@ describe('getStaticPaths - dev calls', () => {
});
describe('route params type validation', () => {
- it('resolves 200 on nested array parameters', async () => {
- const res = await fixture.fetch('/nested-arrays/slug1');
- expect(res.status).to.equal(200);
- });
-
it('resolves 200 on matching static path - string params', async () => {
// route provided with { params: { year: "2022", slug: "post-2" }}
const res = await fixture.fetch('/blog/2022/post-1');
diff --git a/packages/astro/test/astro-global.test.js b/packages/astro/test/astro-global.test.js
index d49868584..f003bc035 100644
--- a/packages/astro/test/astro-global.test.js
+++ b/packages/astro/test/astro-global.test.js
@@ -54,10 +54,10 @@ describe('Astro Global', () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
- expect($('#pathname').text()).to.equal('/blog/');
+ expect($('#pathname').text()).to.equal('/blog');
expect($('#searchparams').text()).to.equal('{}');
- expect($('#child-pathname').text()).to.equal('/blog/');
- expect($('#nested-child-pathname').text()).to.equal('/blog/');
+ expect($('#child-pathname').text()).to.equal('/blog');
+ expect($('#nested-child-pathname').text()).to.equal('/blog');
});
it('Astro.site', async () => {
diff --git a/packages/astro/test/astro-partial-html.test.js b/packages/astro/test/astro-partial-html.test.js
index 6073f1bd1..162c6985d 100644
--- a/packages/astro/test/astro-partial-html.test.js
+++ b/packages/astro/test/astro-partial-html.test.js
@@ -26,7 +26,7 @@ describe('Partial HTML', async () => {
// test 2: correct CSS present
const allInjectedStyles = $('style').text();
- expect(allInjectedStyles).to.match(/\:where\(\.astro-[^{]+{color:red}/);
+ expect(allInjectedStyles).to.match(/\[data-astro-cid-[^{]+{color:red}/);
});
it('injects framework styles', async () => {
diff --git a/packages/astro/test/cli.test.js b/packages/astro/test/cli.test.js
index 7626cc495..82cf7a12d 100644
--- a/packages/astro/test/cli.test.js
+++ b/packages/astro/test/cli.test.js
@@ -131,8 +131,8 @@ describe('astro cli', () => {
// Note: our tests run in parallel so this could be 3000+!
expect(Number.parseInt(localURL.port)).to.be.greaterThanOrEqual(
- 3000,
- `Expected Port to be >= 3000`
+ 4321,
+ `Expected Port to be >= 4321`
);
expect(networkURL.port).to.be.equal(
localURL.port,
diff --git a/packages/astro/test/config-vite-css-target.test.js b/packages/astro/test/config-vite-css-target.test.js
index 1dc2cce32..cb9fa8de2 100644
--- a/packages/astro/test/config-vite-css-target.test.js
+++ b/packages/astro/test/config-vite-css-target.test.js
@@ -32,7 +32,7 @@ describe('CSS', function () {
it('vite.build.cssTarget is respected', async () => {
expect(bundledCSS).to.match(
- new RegExp('.class\\:where\\(.astro-[^{]*{top:0;right:0;bottom:0;left:0}')
+ new RegExp('.class\\[data-astro-[^{]*{top:0;right:0;bottom:0;left:0}')
);
});
});
diff --git a/packages/astro/test/custom-elements.test.js b/packages/astro/test/custom-elements.test.js
deleted file mode 100644
index 53a13b478..000000000
--- a/packages/astro/test/custom-elements.test.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import { expect } from 'chai';
-import { load as cheerioLoad } from 'cheerio';
-import { loadFixture } from './test-utils.js';
-
-describe('Custom Elements', () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({
- root: './fixtures/custom-elements/',
- });
- await fixture.build();
- });
-
- it('Work as constructors', async () => {
- const html = await fixture.readFile('/ctr/index.html');
- const $ = cheerioLoad(html);
-
- // test 1: Element rendered
- expect($('my-element')).to.have.lengthOf(1);
-
- // test 2: shadow rendered
- expect($('my-element template[shadowroot=open][shadowrootmode=open]')).to.have.lengthOf(1);
- });
-
- it('Works with exported tagName', async () => {
- const html = await fixture.readFile('/index.html');
- const $ = cheerioLoad(html);
-
- // test 1: Element rendered
- expect($('my-element')).to.have.lengthOf(1);
-
- // test 2: shadow rendered
- expect($('my-element template[shadowroot=open][shadowrootmode=open]')).to.have.lengthOf(1);
- });
-
- it.skip('Hydration works with exported tagName', async () => {
- const html = await fixture.readFile('/load/index.html');
- const $ = cheerioLoad(html);
-
- // SSR
- // test 1: Element rendered
- expect($('my-element')).to.have.lengthOf(1);
-
- // test 2: shadow rendered
- expect($('my-element template[shadowroot=open][shadowrootmode=open]')).to.have.lengthOf(1);
-
- // Hydration
- // test 3: Component and polyfill scripts bundled separately
- expect($('script')).to.have.lengthOf(2);
- });
-
- it('Custom elements not claimed by renderer are rendered as regular HTML', async () => {
- const html = await fixture.readFile('/nossr/index.html');
- const $ = cheerioLoad(html);
-
- // test 1: Rendered the client-only element
- expect($('client-element')).to.have.lengthOf(1);
- // No children
- expect($('client-element').text()).to.equal('');
- });
-
- it('Can import a client-only element that is nested in JSX', async () => {
- const html = await fixture.readFile('/nested/index.html');
- const $ = cheerioLoad(html);
-
- // test 1: Element rendered
- expect($('client-only-element')).to.have.lengthOf(1);
- });
-});
diff --git a/packages/astro/test/dev-routing.test.js b/packages/astro/test/dev-routing.test.js
index 186355b43..ff5f3a75d 100644
--- a/packages/astro/test/dev-routing.test.js
+++ b/packages/astro/test/dev-routing.test.js
@@ -113,9 +113,9 @@ describe('Development Routing', () => {
expect(response.status).to.equal(200);
});
- it('404 when loading subpath root without trailing slash', async () => {
+ it('200 when loading subpath root without trailing slash', async () => {
const response = await fixture.fetch('/blog');
- expect(response.status).to.equal(404);
+ expect(response.status).to.equal(200);
});
it('200 when loading another page with subpath used', async () => {
@@ -163,9 +163,9 @@ describe('Development Routing', () => {
expect(response.status).to.equal(200);
});
- it('404 when loading subpath root without trailing slash', async () => {
+ it('200 when loading subpath root without trailing slash', async () => {
const response = await fixture.fetch('/blog');
- expect(response.status).to.equal(404);
+ expect(response.status).to.equal(200);
});
it('200 when loading another page with subpath used', async () => {
diff --git a/packages/astro/test/featuresSupport.test.js b/packages/astro/test/featuresSupport.test.js
new file mode 100644
index 000000000..fba8da475
--- /dev/null
+++ b/packages/astro/test/featuresSupport.test.js
@@ -0,0 +1,55 @@
+import { loadFixture } from './test-utils.js';
+import { expect } from 'chai';
+import testAdapter from './test-adapter.js';
+
+describe('Adapter', () => {
+ let fixture;
+
+ it("should error if the adapter doesn't support edge middleware", async () => {
+ try {
+ fixture = await loadFixture({
+ root: './fixtures/middleware-dev/',
+ output: 'server',
+ build: {
+ excludeMiddleware: true,
+ },
+ adapter: testAdapter({
+ extendAdapter: {
+ supportsFeatures: {
+ edgeMiddleware: 'Unsupported',
+ },
+ },
+ }),
+ });
+ await fixture.build();
+ } catch (e) {
+ expect(e.toString()).to.contain(
+ "The adapter my-ssr-adapter doesn't support the feature build.excludeMiddleware."
+ );
+ }
+ });
+
+ it("should error if the adapter doesn't support split build", async () => {
+ try {
+ fixture = await loadFixture({
+ root: './fixtures/middleware-dev/',
+ output: 'server',
+ build: {
+ split: true,
+ },
+ adapter: testAdapter({
+ extendAdapter: {
+ supportsFeatures: {
+ functionPerPage: 'Unsupported',
+ },
+ },
+ }),
+ });
+ await fixture.build();
+ } catch (e) {
+ expect(e.toString()).to.contain(
+ "The adapter my-ssr-adapter doesn't support the feature build.split."
+ );
+ }
+ });
+});
diff --git a/packages/astro/test/fixtures/api-routes/src/pages/binary.dat.ts b/packages/astro/test/fixtures/api-routes/src/pages/binary.dat.ts
index c73589633..cbd382fc3 100644
--- a/packages/astro/test/fixtures/api-routes/src/pages/binary.dat.ts
+++ b/packages/astro/test/fixtures/api-routes/src/pages/binary.dat.ts
@@ -1,5 +1,5 @@
import type { APIRoute } from 'astro';
-export const get: APIRoute = async function () {
+export const GET: APIRoute = async function () {
return new Response(new Uint8Array([0xff]));
};
diff --git a/packages/astro/test/fixtures/api-routes/src/pages/context/data/[param].json.js b/packages/astro/test/fixtures/api-routes/src/pages/context/data/[param].json.js
index 2ed42a5ec..d18eb086f 100644
--- a/packages/astro/test/fixtures/api-routes/src/pages/context/data/[param].json.js
+++ b/packages/astro/test/fixtures/api-routes/src/pages/context/data/[param].json.js
@@ -14,7 +14,7 @@ export function getStaticPaths() {
]
}
-export function get({ params, request }) {
+export function GET({ params, request }) {
return {
body: JSON.stringify({
param: params.param,
diff --git a/packages/astro/test/fixtures/astro-basic/astro.config.mjs b/packages/astro/test/fixtures/astro-basic/astro.config.mjs
index b7b7dafe6..1b2eb163d 100644
--- a/packages/astro/test/fixtures/astro-basic/astro.config.mjs
+++ b/packages/astro/test/fixtures/astro-basic/astro.config.mjs
@@ -5,5 +5,5 @@ import preact from '@astrojs/preact';
export default defineConfig({
integrations: [preact()],
// make sure CLI flags have precedence
- server: () => ({ port: 3000 })
+ server: () => ({ port: 4321 })
});
diff --git a/packages/astro/test/fixtures/astro-cookies/src/pages/early-return.astro b/packages/astro/test/fixtures/astro-cookies/src/pages/early-return.astro
index 2796b3989..1457cb882 100644
--- a/packages/astro/test/fixtures/astro-cookies/src/pages/early-return.astro
+++ b/packages/astro/test/fixtures/astro-cookies/src/pages/early-return.astro
@@ -1,5 +1,5 @@
---
-const mode = Astro.cookies.get('prefs').json().mode;
+const mode = Astro.cookies.get('prefs')!.json().mode;
Astro.cookies.set('prefs', {
mode: mode === 'light' ? 'dark' : 'light'
diff --git a/packages/astro/test/fixtures/astro-cookies/src/pages/get-json.astro b/packages/astro/test/fixtures/astro-cookies/src/pages/get-json.astro
index 034881d22..44ee024ae 100644
--- a/packages/astro/test/fixtures/astro-cookies/src/pages/get-json.astro
+++ b/packages/astro/test/fixtures/astro-cookies/src/pages/get-json.astro
@@ -1,5 +1,5 @@
---
-const cookie = Astro.cookies.get('prefs');
+const cookie = Astro.cookies.get('prefs')!;
const prefs = cookie.json();
---
<html>
diff --git a/packages/astro/test/fixtures/astro-cookies/src/pages/set-prefs.js b/packages/astro/test/fixtures/astro-cookies/src/pages/set-prefs.js
index ccbdceff6..93a6a96de 100644
--- a/packages/astro/test/fixtures/astro-cookies/src/pages/set-prefs.js
+++ b/packages/astro/test/fixtures/astro-cookies/src/pages/set-prefs.js
@@ -1,5 +1,5 @@
-export function post({ cookies }) {
+export function POST({ cookies }) {
const mode = cookies.get('prefs').json().mode;
cookies.set('prefs', {
diff --git a/packages/astro/test/fixtures/astro-get-static-paths/src/pages/data/[slug].json.ts b/packages/astro/test/fixtures/astro-get-static-paths/src/pages/data/[slug].json.ts
index 3c7cc63ba..32a0fd140 100644
--- a/packages/astro/test/fixtures/astro-get-static-paths/src/pages/data/[slug].json.ts
+++ b/packages/astro/test/fixtures/astro-get-static-paths/src/pages/data/[slug].json.ts
@@ -5,7 +5,7 @@ export async function getStaticPaths() {
];
}
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
title: '[slug]'
diff --git a/packages/astro/test/fixtures/astro-get-static-paths/src/pages/nested-arrays/[slug].astro b/packages/astro/test/fixtures/astro-get-static-paths/src/pages/nested-arrays/[slug].astro
deleted file mode 100644
index 9bd7b4f41..000000000
--- a/packages/astro/test/fixtures/astro-get-static-paths/src/pages/nested-arrays/[slug].astro
+++ /dev/null
@@ -1,8 +0,0 @@
----
- export function getStaticPaths() {
- return [
- [ { params: {slug: "slug1"} } ],
- [ { params: {slug: "slug2"} } ],
- ]
- }
----
diff --git a/packages/astro/test/fixtures/astro-markdown-frontmatter-injection/src/pages/glob.json.js b/packages/astro/test/fixtures/astro-markdown-frontmatter-injection/src/pages/glob.json.js
index a56f5306f..3aae6d89a 100644
--- a/packages/astro/test/fixtures/astro-markdown-frontmatter-injection/src/pages/glob.json.js
+++ b/packages/astro/test/fixtures/astro-markdown-frontmatter-injection/src/pages/glob.json.js
@@ -1,4 +1,4 @@
-export async function get() {
+export async function GET() {
const docs = await import.meta.glob('./*.md', { eager: true });
return {
body: JSON.stringify(Object.values(docs).map(doc => doc.frontmatter)),
diff --git a/packages/astro/test/fixtures/astro-markdown/src/pages/headings-glob.json.js b/packages/astro/test/fixtures/astro-markdown/src/pages/headings-glob.json.js
index 631250c33..b2c9ea6ea 100644
--- a/packages/astro/test/fixtures/astro-markdown/src/pages/headings-glob.json.js
+++ b/packages/astro/test/fixtures/astro-markdown/src/pages/headings-glob.json.js
@@ -1,6 +1,6 @@
import { getHeadings } from './with-layout.md';
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
headings: getHeadings(),
diff --git a/packages/astro/test/fixtures/astro-markdown/src/pages/raw-content.json.js b/packages/astro/test/fixtures/astro-markdown/src/pages/raw-content.json.js
index ef933a373..82977443d 100644
--- a/packages/astro/test/fixtures/astro-markdown/src/pages/raw-content.json.js
+++ b/packages/astro/test/fixtures/astro-markdown/src/pages/raw-content.json.js
@@ -1,6 +1,6 @@
import { rawContent, compiledContent } from './basic.md';
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
raw: rawContent(),
diff --git a/packages/astro/test/fixtures/astro-markdown/src/pages/vite-env-vars-glob.json.js b/packages/astro/test/fixtures/astro-markdown/src/pages/vite-env-vars-glob.json.js
index 4a7e4dd78..7a5d00f47 100644
--- a/packages/astro/test/fixtures/astro-markdown/src/pages/vite-env-vars-glob.json.js
+++ b/packages/astro/test/fixtures/astro-markdown/src/pages/vite-env-vars-glob.json.js
@@ -1,6 +1,6 @@
import { frontmatter } from './vite-env-vars.md';
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify(frontmatter),
}
diff --git a/packages/astro/test/fixtures/astro-pagination/src/pages/posts/[slug]/[page].astro b/packages/astro/test/fixtures/astro-pagination/src/pages/posts/[slug]/[page].astro
index c4cc39739..33df98cf5 100644
--- a/packages/astro/test/fixtures/astro-pagination/src/pages/posts/[slug]/[page].astro
+++ b/packages/astro/test/fixtures/astro-pagination/src/pages/posts/[slug]/[page].astro
@@ -1,7 +1,7 @@
---
export async function getStaticPaths({paginate}) {
const allPosts = await Astro.glob('../../post/*.md');
- return ['red', 'blue'].map((filter) => {
+ return ['red', 'blue'].flatMap((filter) => {
const filteredPosts = allPosts.filter((post) => post.frontmatter.tag === filter);
return paginate(filteredPosts, {
params: { slug: filter },
diff --git a/packages/astro/test/fixtures/content-collection-references/src/pages/welcome-data.json.js b/packages/astro/test/fixtures/content-collection-references/src/pages/welcome-data.json.js
index 4f529dac6..a461a1a65 100644
--- a/packages/astro/test/fixtures/content-collection-references/src/pages/welcome-data.json.js
+++ b/packages/astro/test/fixtures/content-collection-references/src/pages/welcome-data.json.js
@@ -1,6 +1,6 @@
import { getEntry, getEntries } from 'astro:content';
-export async function get() {
+export async function GET() {
const welcomePost = await getEntry('blog', 'welcome');
if (!welcomePost?.data) {
diff --git a/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js b/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js
index e74d03ad9..e335d2b05 100644
--- a/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js
+++ b/packages/astro/test/fixtures/content-collections/src/pages/collections.json.js
@@ -2,7 +2,7 @@ import { getCollection } from 'astro:content';
import * as devalue from 'devalue';
import { stripAllRenderFn } from '../utils.js';
-export async function get() {
+export async function GET() {
const withoutConfig = stripAllRenderFn(await getCollection('without-config'));
const withSchemaConfig = stripAllRenderFn(await getCollection('with-schema-config'));
const withSlugConfig = stripAllRenderFn(await getCollection('with-custom-slugs'));
diff --git a/packages/astro/test/fixtures/content-collections/src/pages/entries.json.js b/packages/astro/test/fixtures/content-collections/src/pages/entries.json.js
index 0d7d22d08..311b76cc8 100644
--- a/packages/astro/test/fixtures/content-collections/src/pages/entries.json.js
+++ b/packages/astro/test/fixtures/content-collections/src/pages/entries.json.js
@@ -2,7 +2,7 @@ import { getEntryBySlug } from 'astro:content';
import * as devalue from 'devalue';
import { stripRenderFn } from '../utils.js';
-export async function get() {
+export async function GET() {
const columbiaWithoutConfig = stripRenderFn(await getEntryBySlug('without-config', 'columbia'));
const oneWithSchemaConfig = stripRenderFn(await getEntryBySlug('with-schema-config', 'one'));
const twoWithSlugConfig = stripRenderFn(await getEntryBySlug('with-custom-slugs', 'interesting-two'));
diff --git a/packages/astro/test/fixtures/core-image-ssr/src/pages/api.ts b/packages/astro/test/fixtures/core-image-ssr/src/pages/api.ts
index c10946318..7847baf62 100644
--- a/packages/astro/test/fixtures/core-image-ssr/src/pages/api.ts
+++ b/packages/astro/test/fixtures/core-image-ssr/src/pages/api.ts
@@ -1,6 +1,6 @@
import type { APIRoute } from "../../../../../src/@types/astro";
-export const get = (async ({ params, request }) => {
+export const GET = (async ({ params, request }) => {
const url = new URL(request.url);
const src = url.searchParams.get("src");
diff --git a/packages/astro/test/fixtures/custom-elements/astro.config.mjs b/packages/astro/test/fixtures/custom-elements/astro.config.mjs
deleted file mode 100644
index 439334f8f..000000000
--- a/packages/astro/test/fixtures/custom-elements/astro.config.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-import { defineConfig } from 'astro/config';
-import ceIntegration from '@test/custom-element-renderer';
-
-export default defineConfig({
- integrations: [ceIntegration()],
-})
diff --git a/packages/astro/test/fixtures/custom-elements/my-component-lib/hydration-polyfill.js b/packages/astro/test/fixtures/custom-elements/my-component-lib/hydration-polyfill.js
deleted file mode 100644
index 665844481..000000000
--- a/packages/astro/test/fixtures/custom-elements/my-component-lib/hydration-polyfill.js
+++ /dev/null
@@ -1 +0,0 @@
-globalThis.somePolyfillHere = '';
diff --git a/packages/astro/test/fixtures/custom-elements/my-component-lib/index.js b/packages/astro/test/fixtures/custom-elements/my-component-lib/index.js
deleted file mode 100644
index 5b9bba7e6..000000000
--- a/packages/astro/test/fixtures/custom-elements/my-component-lib/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-function getViteConfiguration() {
- return {
- optimizeDeps: {
- include: ['@test/custom-element-renderer/polyfill.js', '@test/custom-element-renderer/hydration-polyfill.js'],
- exclude: ['@test/custom-element-renderer/server.js']
- },
- };
-}
-
-export default function () {
- return {
- name: '@test/custom-element-renderer',
- hooks: {
- 'astro:config:setup': ({ updateConfig, addRenderer, injectScript }) => {
- // Inject the necessary polyfills on every page
- injectScript('head-inline', `import('@test/custom-element-renderer/polyfill.js');`);
- // Inject the hydration code, before a component is hydrated.
- injectScript('before-hydration', `import('@test/custom-element-renderer/hydration-polyfill.js');`);
- // Add the lit renderer so that Astro can understand lit components.
- addRenderer({
- name: '@test/custom-element-renderer',
- serverEntrypoint: '@test/custom-element-renderer/server.js',
- });
- // Update the vite configuration.
- updateConfig({
- vite: getViteConfiguration(),
- });
- },
- },
- };
-}
diff --git a/packages/astro/test/fixtures/custom-elements/my-component-lib/package.json b/packages/astro/test/fixtures/custom-elements/my-component-lib/package.json
deleted file mode 100644
index f1d53b985..000000000
--- a/packages/astro/test/fixtures/custom-elements/my-component-lib/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "@test/custom-element-renderer",
- "version": "0.1.0",
- "private": true,
- "main": "index.js",
- "type": "module",
- "exports": {
- ".": "./index.js",
- "./server.js": "./server.js",
- "./polyfill.js": "./polyfill.js",
- "./hydration-polyfill.js": "./hydration-polyfill.js"
- }
-}
diff --git a/packages/astro/test/fixtures/custom-elements/my-component-lib/polyfill.js b/packages/astro/test/fixtures/custom-elements/my-component-lib/polyfill.js
deleted file mode 100644
index 92788352b..000000000
--- a/packages/astro/test/fixtures/custom-elements/my-component-lib/polyfill.js
+++ /dev/null
@@ -1,2 +0,0 @@
-console.log('this is a polyfill');
-export default {};
diff --git a/packages/astro/test/fixtures/custom-elements/my-component-lib/server.js b/packages/astro/test/fixtures/custom-elements/my-component-lib/server.js
deleted file mode 100644
index 688923159..000000000
--- a/packages/astro/test/fixtures/custom-elements/my-component-lib/server.js
+++ /dev/null
@@ -1,30 +0,0 @@
-function getConstructor(Component) {
- if (typeof Component === 'string') {
- const tagName = Component;
- Component = customElements.get(tagName);
- }
- return Component;
-}
-
-function check(component) {
- const Component = getConstructor(component);
- if (typeof Component === 'function' && globalThis.HTMLElement.isPrototypeOf(Component)) {
- return true;
- }
- return false;
-}
-
-function renderToStaticMarkup(component, props, innerHTML) {
- const Component = getConstructor(component);
- const el = new Component();
- el.connectedCallback();
- const html = `<${el.localName}><template shadowroot="open" shadowrootmode="open">${el.shadowRoot.innerHTML}</template>${el.innerHTML}</${el.localName}>`
- return {
- html
- };
-}
-
-export default {
- check,
- renderToStaticMarkup
-};
diff --git a/packages/astro/test/fixtures/custom-elements/my-component-lib/shim.js b/packages/astro/test/fixtures/custom-elements/my-component-lib/shim.js
deleted file mode 100644
index eb969e528..000000000
--- a/packages/astro/test/fixtures/custom-elements/my-component-lib/shim.js
+++ /dev/null
@@ -1,28 +0,0 @@
-globalThis.customElements = {
- _elements: new Map(),
- define(name, ctr) {
- ctr.tagName = name;
- this._elements.set(name, ctr);
- },
- get(name) {
- return this._elements.get(name);
- }
-};
-
-globalThis.HTMLElement = class {
- attachShadow() {
- this.shadowRoot = new HTMLElement();
- }
-
- get localName() {
- return this.constructor.tagName;
- }
-
- get innerHTML() {
- return this._innerHTML;
- }
-
- set innerHTML(val) {
- this._innerHTML = val;
- }
-};
diff --git a/packages/astro/test/fixtures/custom-elements/package.json b/packages/astro/test/fixtures/custom-elements/package.json
deleted file mode 100644
index 80246a3b0..000000000
--- a/packages/astro/test/fixtures/custom-elements/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/custom-elements",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@test/custom-element-renderer": "workspace:*"
- }
-}
diff --git a/packages/astro/test/fixtures/custom-elements/src/components/my-element.js b/packages/astro/test/fixtures/custom-elements/src/components/my-element.js
deleted file mode 100644
index ffc5e6ffb..000000000
--- a/packages/astro/test/fixtures/custom-elements/src/components/my-element.js
+++ /dev/null
@@ -1,13 +0,0 @@
-export const tagName = 'my-element';
-
-class MyElement extends HTMLElement {
- connectedCallback() {
- this.attachShadow({ mode: 'open' });
- this.shadowRoot.innerHTML = `<span id="custom">Hello from a custom element!</span>`;
- this.innerHTML = `<div id="custom-light">Light dom!</div>`
- }
-}
-
-customElements.define(tagName, MyElement);
-
-export default MyElement;
diff --git a/packages/astro/test/fixtures/custom-elements/src/pages/ctr.astro b/packages/astro/test/fixtures/custom-elements/src/pages/ctr.astro
deleted file mode 100644
index 8b1c83512..000000000
--- a/packages/astro/test/fixtures/custom-elements/src/pages/ctr.astro
+++ /dev/null
@@ -1,16 +0,0 @@
----
-import MyElement from '../components/my-element.js';
-
-const title = 'My App';
----
-
-<html>
-<head>
- <title>{title}</title>
-</head>
-<body>
- <h1>{title}</h1>
-
- <MyElement />
-</body>
-</html> \ No newline at end of file
diff --git a/packages/astro/test/fixtures/custom-elements/src/pages/index.astro b/packages/astro/test/fixtures/custom-elements/src/pages/index.astro
deleted file mode 100644
index b7380624a..000000000
--- a/packages/astro/test/fixtures/custom-elements/src/pages/index.astro
+++ /dev/null
@@ -1,15 +0,0 @@
----
-import '../components/my-element.js';
-const title = 'My App';
----
-
-<html>
-<head>
- <title>{title}</title>
-</head>
-<body>
- <h1>{title}</h1>
-
- <my-element></my-element>
-</body>
-</html> \ No newline at end of file
diff --git a/packages/astro/test/fixtures/custom-elements/src/pages/nested.astro b/packages/astro/test/fixtures/custom-elements/src/pages/nested.astro
deleted file mode 100644
index f23e3b6bc..000000000
--- a/packages/astro/test/fixtures/custom-elements/src/pages/nested.astro
+++ /dev/null
@@ -1,11 +0,0 @@
----
-let show = true
----
-<html>
-<head>
- <title>Custom element not imported but nested</title>
-</head>
-<body>
- {show && <client-only-element></client-only-element>}
-</body>
-</html> \ No newline at end of file
diff --git a/packages/astro/test/fixtures/custom-elements/src/pages/nossr.astro b/packages/astro/test/fixtures/custom-elements/src/pages/nossr.astro
deleted file mode 100644
index 53e580afb..000000000
--- a/packages/astro/test/fixtures/custom-elements/src/pages/nossr.astro
+++ /dev/null
@@ -1,14 +0,0 @@
----
-const title = 'My App';
----
-
-<html>
-<head>
- <title>{title}</title>
-</head>
-<body>
- <h1>{title}</h1>
-
- <client-element></client-element>
-</body>
-</html> \ No newline at end of file
diff --git a/packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js b/packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js
index 1cc26fb73..76f4d5760 100644
--- a/packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js
+++ b/packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js
@@ -7,7 +7,7 @@ export function getStaticPaths() {
}
/** @param {import('astro').APIContext} params */
-export async function get({ params }) {
+export async function GET({ params }) {
const { id } = params;
const author = await getEntry('authors-without-config', id);
if (!author) {
diff --git a/packages/astro/test/fixtures/data-collections/src/pages/authors/all.json.js b/packages/astro/test/fixtures/data-collections/src/pages/authors/all.json.js
index e4c804064..5b5007fed 100644
--- a/packages/astro/test/fixtures/data-collections/src/pages/authors/all.json.js
+++ b/packages/astro/test/fixtures/data-collections/src/pages/authors/all.json.js
@@ -1,6 +1,6 @@
import { getCollection } from 'astro:content';
-export async function get() {
+export async function GET() {
const authors = await getCollection('authors-without-config');
return {
diff --git a/packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js b/packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js
index 73c90354d..ab8cc764e 100644
--- a/packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js
+++ b/packages/astro/test/fixtures/data-collections/src/pages/translations/[lang].json.js
@@ -7,7 +7,7 @@ export function getStaticPaths() {
}
/** @param {import('astro').APIContext} params */
-export async function get({ params }) {
+export async function GET({ params }) {
const { lang } = params;
const translations = await getEntry('i18n', lang);
if (!translations) {
diff --git a/packages/astro/test/fixtures/data-collections/src/pages/translations/all.json.js b/packages/astro/test/fixtures/data-collections/src/pages/translations/all.json.js
index 7d953838f..e8a1fee92 100644
--- a/packages/astro/test/fixtures/data-collections/src/pages/translations/all.json.js
+++ b/packages/astro/test/fixtures/data-collections/src/pages/translations/all.json.js
@@ -1,6 +1,6 @@
import { getCollection } from 'astro:content';
-export async function get() {
+export async function GET() {
const translations = await getCollection('i18n');
return {
diff --git a/packages/astro/test/fixtures/dynamic-endpoint-collision/src/pages/api/catch/[...slug].ts b/packages/astro/test/fixtures/dynamic-endpoint-collision/src/pages/api/catch/[...slug].ts
index 8f64c2401..8fccd6695 100644
--- a/packages/astro/test/fixtures/dynamic-endpoint-collision/src/pages/api/catch/[...slug].ts
+++ b/packages/astro/test/fixtures/dynamic-endpoint-collision/src/pages/api/catch/[...slug].ts
@@ -2,7 +2,7 @@ import type { APIRoute } from "astro";
const slugs = ["one", undefined];
-export const get: APIRoute = ({ params }) => {
+export const GET: APIRoute = ({ params }) => {
return {
body: JSON.stringify({
slug: params.slug || "index",
diff --git a/packages/astro/test/fixtures/middleware-dev/src/pages/api/endpoint.js b/packages/astro/test/fixtures/middleware-dev/src/pages/api/endpoint.js
index dadff6edb..69d989bc0 100644
--- a/packages/astro/test/fixtures/middleware-dev/src/pages/api/endpoint.js
+++ b/packages/astro/test/fixtures/middleware-dev/src/pages/api/endpoint.js
@@ -1,4 +1,4 @@
-export function get() {
+export function GET() {
const object = {
name: 'Endpoint!!',
};
diff --git a/packages/astro/test/fixtures/non-html-pages/src/pages/about.json.ts b/packages/astro/test/fixtures/non-html-pages/src/pages/about.json.ts
index af61847f3..0c3ec18ea 100644
--- a/packages/astro/test/fixtures/non-html-pages/src/pages/about.json.ts
+++ b/packages/astro/test/fixtures/non-html-pages/src/pages/about.json.ts
@@ -1,7 +1,7 @@
// Returns the file body for this non-HTML file.
// The content type is based off of the extension in the filename,
// in this case: about.json.
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
name: 'Astro',
diff --git a/packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts b/packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts
index 0c2d3806b..3ee26f0bf 100644
--- a/packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts
+++ b/packages/astro/test/fixtures/non-html-pages/src/pages/placeholder.png.ts
@@ -2,7 +2,7 @@ import { promises as fs } from 'node:fs';
import type { APIRoute } from 'astro';
-export const get: APIRoute = async function get() {
+export const GET: APIRoute = async function get() {
try {
// Image is in the public domain. Sourced from
// https://en.wikipedia.org/wiki/File:Portrait_placeholder.png
diff --git a/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[...slug].json.ts b/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[...slug].json.ts
index 142b11711..bc7e1b774 100644
--- a/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[...slug].json.ts
+++ b/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[...slug].json.ts
@@ -1,6 +1,6 @@
import type { APIRoute } from 'astro';
-export const get: APIRoute = async ({ params }) => {
+export const GET: APIRoute = async ({ params }) => {
return {
body: JSON.stringify({
path: params.slug,
diff --git a/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[foo]-[bar].json.ts b/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[foo]-[bar].json.ts
index 2e66a22ae..b06efff6f 100644
--- a/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[foo]-[bar].json.ts
+++ b/packages/astro/test/fixtures/routing-priority/src/pages/api/catch/[foo]-[bar].json.ts
@@ -1,6 +1,6 @@
import type { APIRoute } from 'astro';
-export const get: APIRoute = async ({ params }) => {
+export const GET: APIRoute = async ({ params }) => {
return {
body: JSON.stringify({
foo: params.foo,
diff --git a/packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/api/route.js b/packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/api/route.js
index c44461be9..5a1cacc11 100644
--- a/packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/api/route.js
+++ b/packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/api/route.js
@@ -1,5 +1,5 @@
-export function post() {
+export function POST() {
return {
body: JSON.stringify({ ok: true })
};
diff --git a/packages/astro/test/fixtures/ssr-api-route/src/pages/binary.js b/packages/astro/test/fixtures/ssr-api-route/src/pages/binary.js
index 3e1c70c81..407c45666 100644
--- a/packages/astro/test/fixtures/ssr-api-route/src/pages/binary.js
+++ b/packages/astro/test/fixtures/ssr-api-route/src/pages/binary.js
@@ -1,6 +1,6 @@
import fs from 'node:fs';
-export function get() {
+export function GET() {
return {
body: 'ok'
};
diff --git a/packages/astro/test/fixtures/ssr-api-route/src/pages/context/[param].js b/packages/astro/test/fixtures/ssr-api-route/src/pages/context/[param].js
index 0ff1f625a..ba110ee13 100644
--- a/packages/astro/test/fixtures/ssr-api-route/src/pages/context/[param].js
+++ b/packages/astro/test/fixtures/ssr-api-route/src/pages/context/[param].js
@@ -1,7 +1,7 @@
/**
* @param {import('astro').APIContext} api
*/
-export function get(ctx) {
+export function GET(ctx) {
return {
body: JSON.stringify({
cookiesExist: !!ctx.cookies,
diff --git a/packages/astro/test/fixtures/ssr-api-route/src/pages/food.json.js b/packages/astro/test/fixtures/ssr-api-route/src/pages/food.json.js
index 1f9ea5f29..f4021c9e5 100644
--- a/packages/astro/test/fixtures/ssr-api-route/src/pages/food.json.js
+++ b/packages/astro/test/fixtures/ssr-api-route/src/pages/food.json.js
@@ -1,5 +1,5 @@
-export function get() {
+export function GET() {
return {
body: JSON.stringify([
{ name: 'lettuce' },
@@ -9,7 +9,7 @@ export function get() {
};
}
-export async function post({ params, request }) {
+export async function POST({ params, request }) {
const body = await request.text();
return new Response(body === `some data` ? `ok` : `not ok`, {
status: 200,
diff --git a/packages/astro/test/fixtures/ssr-api-route/src/pages/login.js b/packages/astro/test/fixtures/ssr-api-route/src/pages/login.js
index dfce0b5d6..0e851df74 100644
--- a/packages/astro/test/fixtures/ssr-api-route/src/pages/login.js
+++ b/packages/astro/test/fixtures/ssr-api-route/src/pages/login.js
@@ -1,5 +1,5 @@
/** @type {import('astro').APIRoute} */
-export function post({ cookies }) {
+export function POST({ cookies }) {
cookies.set('foo', 'foo', {
httpOnly: true
});
diff --git a/packages/astro/test/fixtures/ssr-dynamic/src/pages/api/products/[id].js b/packages/astro/test/fixtures/ssr-dynamic/src/pages/api/products/[id].js
index 4d96b62a5..8c7c39302 100644
--- a/packages/astro/test/fixtures/ssr-dynamic/src/pages/api/products/[id].js
+++ b/packages/astro/test/fixtures/ssr-dynamic/src/pages/api/products/[id].js
@@ -1,5 +1,5 @@
-export function get({ params }) {
+export function GET({ params }) {
return {
body: JSON.stringify(params)
};
diff --git a/packages/astro/test/fixtures/ssr-locals/src/pages/api.js b/packages/astro/test/fixtures/ssr-locals/src/pages/api.js
index d4f7386fb..366f26aae 100644
--- a/packages/astro/test/fixtures/ssr-locals/src/pages/api.js
+++ b/packages/astro/test/fixtures/ssr-locals/src/pages/api.js
@@ -1,5 +1,5 @@
-export async function get({ locals }) {
+export async function GET({ locals }) {
let out = { ...locals };
return new Response(JSON.stringify(out), {
diff --git a/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/data/[slug].json.ts b/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/data/[slug].json.ts
index 16e2a90ca..d969873c5 100644
--- a/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/data/[slug].json.ts
+++ b/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/data/[slug].json.ts
@@ -7,7 +7,7 @@ export async function getStaticPaths() {
];
}
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
title: '[slug]'
diff --git a/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/nested-arrays/[slug].astro b/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/nested-arrays/[slug].astro
deleted file mode 100644
index 25d1bfff4..000000000
--- a/packages/astro/test/fixtures/ssr-prerender-get-static-paths/src/pages/nested-arrays/[slug].astro
+++ /dev/null
@@ -1,10 +0,0 @@
----
- export function getStaticPaths() {
- return [
- [ { params: {slug: "slug1"} } ],
- [ { params: {slug: "slug2"} } ],
- ]
- }
-
- export const prerender = true;
----
diff --git a/packages/astro/test/fixtures/ssr-preview/preview.mjs b/packages/astro/test/fixtures/ssr-preview/preview.mjs
index 745f22624..d8d57afa8 100644
--- a/packages/astro/test/fixtures/ssr-preview/preview.mjs
+++ b/packages/astro/test/fixtures/ssr-preview/preview.mjs
@@ -1,7 +1,7 @@
export default () => {
// noop
return {
- port: 3000,
+ port: 4321,
closed() {},
stop() {}
}
diff --git a/packages/astro/test/fixtures/static-build/src/pages/company.json.ts b/packages/astro/test/fixtures/static-build/src/pages/company.json.ts
index ee3f2f1ad..08f45a7b8 100644
--- a/packages/astro/test/fixtures/static-build/src/pages/company.json.ts
+++ b/packages/astro/test/fixtures/static-build/src/pages/company.json.ts
@@ -1,8 +1,8 @@
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
name: 'Astro Technology Company',
url: 'https://astro.build/'
})
}
-} \ No newline at end of file
+}
diff --git a/packages/astro/test/fixtures/static-build/src/pages/data/[slug].json.ts b/packages/astro/test/fixtures/static-build/src/pages/data/[slug].json.ts
index 2bcfe50a1..2fa13ac18 100644
--- a/packages/astro/test/fixtures/static-build/src/pages/data/[slug].json.ts
+++ b/packages/astro/test/fixtures/static-build/src/pages/data/[slug].json.ts
@@ -5,7 +5,7 @@ export async function getStaticPaths() {
]
}
-export async function get({ params }) {
+export async function GET({ params }) {
return {
body: JSON.stringify({
slug: params.slug,
@@ -13,4 +13,4 @@ export async function get({ params }) {
url: 'https://astro.build/'
})
}
-} \ No newline at end of file
+}
diff --git a/packages/astro/test/fixtures/static-build/src/pages/posts.json.js b/packages/astro/test/fixtures/static-build/src/pages/posts.json.js
index 6463fdbad..aefbbffff 100644
--- a/packages/astro/test/fixtures/static-build/src/pages/posts.json.js
+++ b/packages/astro/test/fixtures/static-build/src/pages/posts.json.js
@@ -13,7 +13,7 @@ async function fetchPosts() {
return posts.sort((a, b) => a.title.localeCompare(b.title));
}
-export async function get() {
+export async function GET() {
const posts = await fetchPosts();
return {
diff --git a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/[slug].json.ts b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/[slug].json.ts
index 364c886e3..783031605 100644
--- a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/[slug].json.ts
+++ b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/[slug].json.ts
@@ -5,7 +5,7 @@ export async function getStaticPaths() {
];
}
-export async function get({ params }) {
+export async function GET({ params }) {
return {
body: JSON.stringify({
slug: params.slug,
diff --git a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/data/[slug].json.ts b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/data/[slug].json.ts
index 4392c7ee7..707c39fa9 100644
--- a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/data/[slug].json.ts
+++ b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/data/[slug].json.ts
@@ -5,7 +5,7 @@ export async function getStaticPaths() {
];
}
-export async function get({ params }) {
+export async function GET({ params }) {
return {
body: JSON.stringify({
slug: params.slug,
diff --git a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/home.json.ts b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/home.json.ts
index 8046af6df..5eaac42f1 100644
--- a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/home.json.ts
+++ b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/home.json.ts
@@ -1,4 +1,4 @@
-export async function get() {
+export async function GET() {
return {
body: JSON.stringify({
title: 'home'
diff --git a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/[image].svg.ts b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/[image].svg.ts
index e728394f4..c6fa88711 100644
--- a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/[image].svg.ts
+++ b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/[image].svg.ts
@@ -5,7 +5,7 @@ export async function getStaticPaths() {
];
}
-export async function get({ params }) {
+export async function GET({ params }) {
return {
body: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200">
<title>${params.image}</title>
diff --git a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/hex.ts b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/hex.ts
index 546796fed..84dd6dcaa 100644
--- a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/hex.ts
+++ b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/hex.ts
@@ -1,6 +1,6 @@
import { readFileSync } from "node:fs";
-export async function get({ params, request }) {
+export async function GET({ params, request }) {
const buffer = readFileSync(new URL('../../astro.png', import.meta.url));
return {
body: buffer.toString('hex'),
diff --git a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/static.svg.ts b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/static.svg.ts
index 727a0eae8..93fcf4022 100644
--- a/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/static.svg.ts
+++ b/packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/static.svg.ts
@@ -1,4 +1,4 @@
-export async function get() {
+export async function GET() {
return {
body: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200">
<title>Static SVG</title>
diff --git a/packages/astro/test/preview-routing.test.js b/packages/astro/test/preview-routing.test.js
index 5c365b07c..4c99881b6 100644
--- a/packages/astro/test/preview-routing.test.js
+++ b/packages/astro/test/preview-routing.test.js
@@ -157,9 +157,9 @@ describe('Preview Routing', () => {
expect(response.status).to.equal(200);
});
- it('404 when loading subpath root without trailing slash', async () => {
+ it('200 when loading subpath root without trailing slash', async () => {
const response = await fixture.fetch('/blog');
- expect(response.status).to.equal(404);
+ expect(response.status).to.equal(200);
});
it('200 when loading another page with subpath used', async () => {
@@ -345,9 +345,9 @@ describe('Preview Routing', () => {
expect(response.status).to.equal(200);
});
- it('404 when loading subpath root without trailing slash', async () => {
+ it('200 when loading subpath root without trailing slash', async () => {
const response = await fixture.fetch('/blog');
- expect(response.status).to.equal(404);
+ expect(response.status).to.equal(200);
});
it('200 when loading another page with subpath used', async () => {
diff --git a/packages/astro/test/public-base-404.test.js b/packages/astro/test/public-base-404.test.js
index c8d58471d..969e2a952 100644
--- a/packages/astro/test/public-base-404.test.js
+++ b/packages/astro/test/public-base-404.test.js
@@ -44,7 +44,7 @@ describe('Public dev with base', () => {
expect(response.status).to.equal(404);
const html = await response.text();
$ = cheerio.load(html);
- expect($('a').first().text()).to.equal('/blog/');
+ expect($('a').first().text()).to.equal('/blog');
});
it('default 404 page when loading /none/', async () => {
diff --git a/packages/astro/test/scoped-style-strategy.test.js b/packages/astro/test/scoped-style-strategy.test.js
index 022ef3d6f..a59f227ad 100644
--- a/packages/astro/test/scoped-style-strategy.test.js
+++ b/packages/astro/test/scoped-style-strategy.test.js
@@ -3,7 +3,7 @@ import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('scopedStyleStrategy', () => {
- describe('default', () => {
+ describe('scopedStyleStrategy: "where"', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
let stylesheet;
@@ -11,6 +11,7 @@ describe('scopedStyleStrategy', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/scoped-style-strategy/',
+ scopedStyleStrategy: 'where',
});
await fixture.build();
@@ -57,4 +58,35 @@ describe('scopedStyleStrategy', () => {
expect(stylesheet).to.match(/h1\.astro/);
});
});
+
+ describe('default', () => {
+ /** @type {import('./test-utils').Fixture} */
+ let fixture;
+ let stylesheet;
+
+ before(async () => {
+ fixture = await loadFixture({
+ root: './fixtures/scoped-style-strategy/',
+ });
+ await fixture.build();
+
+ const html = await fixture.readFile('/index.html');
+ const $ = cheerio.load(html);
+ const $link = $('link[rel=stylesheet]');
+ const href = $link.attr('href');
+ stylesheet = await fixture.readFile(href);
+ });
+
+ it('does not include :where pseudo-selector', () => {
+ expect(stylesheet).to.not.match(/:where/);
+ });
+
+ it('does not include the class name directly in the selector', () => {
+ expect(stylesheet).to.not.match(/h1\.astro/);
+ });
+
+ it('includes the data attribute hash', () => {
+ expect(stylesheet).to.include('h1[data-astro-cid-');
+ });
+ });
});
diff --git a/packages/astro/test/ssr-api-route.test.js b/packages/astro/test/ssr-api-route.test.js
index 3e2d5c327..899404b1e 100644
--- a/packages/astro/test/ssr-api-route.test.js
+++ b/packages/astro/test/ssr-api-route.test.js
@@ -1,6 +1,5 @@
import { expect } from 'chai';
import net from 'node:net';
-import { File, FormData } from 'undici';
import testAdapter from './test-adapter.js';
import { loadFixture } from './test-utils.js';
diff --git a/packages/astro/test/ssr-manifest.test.js b/packages/astro/test/ssr-manifest.test.js
index 4e5521220..bd9483505 100644
--- a/packages/astro/test/ssr-manifest.test.js
+++ b/packages/astro/test/ssr-manifest.test.js
@@ -11,7 +11,6 @@ describe('astro:ssr-manifest', () => {
fixture = await loadFixture({
root: './fixtures/ssr-manifest/',
output: 'server',
- compressHTML: true,
adapter: testAdapter(),
});
await fixture.build();
diff --git a/packages/astro/test/ssr-prerender-get-static-paths.test.js b/packages/astro/test/ssr-prerender-get-static-paths.test.js
index 391e7485d..3fe2950cb 100644
--- a/packages/astro/test/ssr-prerender-get-static-paths.test.js
+++ b/packages/astro/test/ssr-prerender-get-static-paths.test.js
@@ -1,7 +1,7 @@
import { expect } from 'chai';
-import { loadFixture } from './test-utils.js';
import * as cheerio from 'cheerio';
import testAdapter from './test-adapter.js';
+import { loadFixture } from './test-utils.js';
describe('Prerender', () => {
/** @type {import('./test-utils').Fixture} */
@@ -102,11 +102,6 @@ describe('Prerender', () => {
});
describe('route params type validation', () => {
- it('resolves 200 on nested array parameters', async () => {
- const res = await fixture.fetch('/blog/nested-arrays/slug1');
- expect(res.status).to.equal(200);
- });
-
it('resolves 200 on matching static path - string params', async () => {
// route provided with { params: { year: "2022", slug: "post-2" }}
const res = await fixture.fetch('/blog/blog/2022/post-1');
@@ -234,11 +229,6 @@ describe('Prerender', () => {
});
describe('route params type validation', () => {
- it('resolves 200 on nested array parameters', async () => {
- const res = await fixture.fetch('/blog/nested-arrays/slug1');
- expect(res.status).to.equal(200);
- });
-
it('resolves 200 on matching static path - string params', async () => {
// route provided with { params: { year: "2022", slug: "post-2" }}
const res = await fixture.fetch('/blog/blog/2022/post-1');
diff --git a/packages/astro/test/static-build.test.js b/packages/astro/test/static-build.test.js
index d4a687a5d..0552c353f 100644
--- a/packages/astro/test/static-build.test.js
+++ b/packages/astro/test/static-build.test.js
@@ -175,7 +175,7 @@ describe('Static build', () => {
let found = false;
for (const log of logs) {
if (
- log.type === 'ssg' &&
+ log.label === 'ssg' &&
/[hH]eaders are not exposed in static \(SSG\) output mode/.test(log.message)
) {
found = true;
diff --git a/packages/astro/test/test-adapter.js b/packages/astro/test/test-adapter.js
index 85b4d69c0..67058023d 100644
--- a/packages/astro/test/test-adapter.js
+++ b/packages/astro/test/test-adapter.js
@@ -71,6 +71,15 @@ export default function (
name: 'my-ssr-adapter',
serverEntrypoint: '@my-ssr',
exports: ['manifest', 'createApp'],
+ supportedFeatures: {
+ assets: {
+ supportKind: 'Stable',
+ isNodeCompatible: true,
+ },
+ serverOutput: 'Stable',
+ staticOutput: 'Stable',
+ hybridOutput: 'Stable',
+ },
...extendAdapter,
});
},
diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js
index 27f5d83f7..a58d417d7 100644
--- a/packages/astro/test/test-utils.js
+++ b/packages/astro/test/test-utils.js
@@ -1,4 +1,3 @@
-import { polyfill } from '@astrojs/webapi';
import { execa } from 'execa';
import fastGlob from 'fast-glob';
import fs from 'node:fs';
@@ -17,16 +16,10 @@ import { nodeLogDestination } from '../dist/core/logger/node.js';
import preview from '../dist/core/preview/index.js';
import { sync } from '../dist/core/sync/index.js';
-// polyfill WebAPIs to globalThis for Node v12, Node v14, and Node v16
-polyfill(globalThis, {
- exclude: 'window document',
-});
-
// Disable telemetry when running tests
process.env.ASTRO_TELEMETRY_DISABLED = true;
/**
- * @typedef {import('undici').Response} Response
* @typedef {import('../src/core/dev/dev').DedvServer} DevServer
* @typedef {import('../src/@types/astro').AstroInlineConfig & { root?: string | URL }} AstroInlineConfig
* @typedef {import('../src/core/preview/index').PreviewServer} PreviewServer
diff --git a/packages/astro/test/units/cookies/delete.test.js b/packages/astro/test/units/cookies/delete.test.js
index 67fa1306b..f4c9fab53 100644
--- a/packages/astro/test/units/cookies/delete.test.js
+++ b/packages/astro/test/units/cookies/delete.test.js
@@ -30,7 +30,7 @@ describe('astro/src/core/cookies', () => {
expect(cookies.get('foo').value).to.equal('bar');
cookies.delete('foo');
- expect(cookies.get('foo').value).to.equal(undefined);
+ expect(cookies.get('foo')).to.equal(undefined);
});
it('calling cookies.has() after returns false', () => {
diff --git a/packages/astro/test/units/cookies/get.test.js b/packages/astro/test/units/cookies/get.test.js
index f044d715a..216128907 100644
--- a/packages/astro/test/units/cookies/get.test.js
+++ b/packages/astro/test/units/cookies/get.test.js
@@ -16,6 +16,13 @@ describe('astro/src/core/cookies', () => {
expect(cookies.get('foo').value).to.equal('bar');
});
+ it("Returns undefined is the value doesn't exist", () => {
+ const req = new Request('http://example.com/');
+ let cookies = new AstroCookies(req);
+ let cookie = cookies.get('foo');
+ expect(cookie).to.equal(undefined);
+ });
+
describe('.json()', () => {
it('returns a JavaScript object', () => {
const req = new Request('http://example.com/', {
@@ -29,13 +36,6 @@ describe('astro/src/core/cookies', () => {
expect(json).to.be.an('object');
expect(json.key).to.equal('value');
});
-
- it('throws if the value is undefined', () => {
- const req = new Request('http://example.com/');
- let cookies = new AstroCookies(req);
- let cookie = cookies.get('foo');
- expect(() => cookie.json()).to.throw('Cannot convert undefined to an object.');
- });
});
describe('.number()', () => {
diff --git a/packages/astro/test/units/integrations/api.test.js b/packages/astro/test/units/integrations/api.test.js
index 919628da2..a420dd6c9 100644
--- a/packages/astro/test/units/integrations/api.test.js
+++ b/packages/astro/test/units/integrations/api.test.js
@@ -1,5 +1,7 @@
import { expect } from 'chai';
import { runHookBuildSetup } from '../../../dist/integrations/index.js';
+import { validateSupportedFeatures } from '../../../dist/integrations/astroFeaturesValidation.js';
+import { defaultLogging } from '../test-utils.js';
describe('Integration API', () => {
it('runHookBuildSetup should work', async () => {
@@ -28,3 +30,187 @@ describe('Integration API', () => {
expect(updatedViteConfig).to.haveOwnProperty('define');
});
});
+
+describe('Astro feature map', function () {
+ it('should support the feature when stable', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {
+ hybridOutput: 'stable',
+ },
+ {
+ output: 'hybrid',
+ },
+ defaultLogging
+ );
+ expect(result['hybridOutput']).to.be.true;
+ });
+
+ it('should not support the feature when not provided', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ undefined,
+ {
+ output: 'hybrid',
+ },
+ defaultLogging
+ );
+ expect(result['hybridOutput']).to.be.false;
+ });
+
+ it('should not support the feature when an empty object is provided', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {},
+ {
+ output: 'hybrid',
+ },
+ defaultLogging
+ );
+ expect(result['hybridOutput']).to.be.false;
+ });
+
+ describe('static output', function () {
+ it('should be supported with the correct config', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ { staticOutput: 'stable' },
+ {
+ output: 'static',
+ },
+ defaultLogging
+ );
+ expect(result['staticOutput']).to.be.true;
+ });
+
+ it("should not be valid if the config is correct, but the it's unsupported", () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ { staticOutput: 'unsupported' },
+ {
+ output: 'static',
+ },
+ defaultLogging
+ );
+ expect(result['staticOutput']).to.be.false;
+ });
+ });
+ describe('hybrid output', function () {
+ it('should be supported with the correct config', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ { hybridOutput: 'stable' },
+ {
+ output: 'hybrid',
+ },
+ defaultLogging
+ );
+ expect(result['hybridOutput']).to.be.true;
+ });
+
+ it("should not be valid if the config is correct, but the it's unsupported", () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {
+ hybridOutput: 'unsupported',
+ },
+ {
+ output: 'hybrid',
+ },
+ defaultLogging
+ );
+ expect(result['hybridOutput']).to.be.false;
+ });
+ });
+ describe('server output', function () {
+ it('should be supported with the correct config', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ { serverOutput: 'stable' },
+ {
+ output: 'server',
+ },
+ defaultLogging
+ );
+ expect(result['serverOutput']).to.be.true;
+ });
+
+ it("should not be valid if the config is correct, but the it's unsupported", () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {
+ serverOutput: 'unsupported',
+ },
+ {
+ output: 'server',
+ },
+ defaultLogging
+ );
+ expect(result['serverOutput']).to.be.false;
+ });
+ });
+
+ describe('assets', function () {
+ it('should be supported when it is sharp compatible', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: true,
+ },
+ },
+ {
+ image: {
+ service: {
+ entrypoint: 'astro/assets/services/sharp',
+ },
+ },
+ },
+ defaultLogging
+ );
+ expect(result['assets']).to.be.true;
+ });
+ it('should be supported when it is squoosh compatible', () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {
+ assets: {
+ supportKind: 'stable',
+ isSquooshCompatible: true,
+ },
+ },
+ {
+ image: {
+ service: {
+ entrypoint: 'astro/assets/services/squoosh',
+ },
+ },
+ },
+ defaultLogging
+ );
+ expect(result['assets']).to.be.true;
+ });
+
+ it("should not be valid if the config is correct, but the it's unsupported", () => {
+ let result = validateSupportedFeatures(
+ 'test',
+ {
+ assets: {
+ supportKind: 'unsupported',
+ isNodeCompatible: false,
+ },
+ },
+ {
+ image: {
+ service: {
+ entrypoint: 'astro/assets/services/sharp',
+ },
+ },
+ },
+ defaultLogging
+ );
+ expect(result['assets']).to.be.false;
+ });
+ });
+});
diff --git a/packages/astro/tsconfig.json b/packages/astro/tsconfig.json
index 839239eaf..63854a31d 100644
--- a/packages/astro/tsconfig.json
+++ b/packages/astro/tsconfig.json
@@ -6,7 +6,7 @@
"declarationDir": "./dist",
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021",
+ "target": "ES2022",
"jsx": "preserve",
"types": ["@types/dom-view-transitions", "network-information-types"]
}
diff --git a/packages/astro/tsconfigs/base.json b/packages/astro/tsconfigs/base.json
index aa1f17543..d921ef4be 100644
--- a/packages/astro/tsconfigs/base.json
+++ b/packages/astro/tsconfigs/base.json
@@ -5,14 +5,19 @@
"target": "ESNext",
"module": "ESNext",
// Enable node-style module resolution, for things like npm package imports.
- "moduleResolution": "node",
+ "moduleResolution": "Bundler",
+ // Allow importing TypeScript files using their native extension (.ts(x)).
+ "allowImportingTsExtensions": true,
// Enable JSON imports.
"resolveJsonModule": true,
- // Enable stricter transpilation for better output.
+ // Enforce the usage of type-only imports when needed, which helps avoiding bundling issues.
+ "verbatimModuleSyntax": true,
+ // Ensure that each file can be transpiled without relying on other imports.
+ // This is redundant with the previous option, however it ensures that it's on even if someone disable `verbatimModuleSyntax`
"isolatedModules": true,
// Astro directly run TypeScript code, no transpilation needed.
"noEmit": true,
- // Report an error when importing a file using a casing different from the casing on disk.
+ // Report an error when importing a file using a casing different from another import of the same file.
"forceConsistentCasingInFileNames": true,
// Properly support importing CJS modules in ESM
"esModuleInterop": true,
@@ -23,9 +28,6 @@
"paths": {
"~/assets/*": ["src/assets/*"]
},
- // TypeScript 5.0 changed how `isolatedModules` and `importsNotUsedAsValues` works, deprecating the later
- // Until the majority of users are on TypeScript 5.0, we'll have to supress those deprecation errors
- "ignoreDeprecations": "5.0",
// Allow JavaScript files to be imported
"allowJs": true
}
diff --git a/packages/astro/tsconfigs/strict.json b/packages/astro/tsconfigs/strict.json
index bc87a68e0..3064440a5 100644
--- a/packages/astro/tsconfigs/strict.json
+++ b/packages/astro/tsconfigs/strict.json
@@ -2,8 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"compilerOptions": {
- "strict": true,
- // Error when a value import is only used as a type.
- "importsNotUsedAsValues": "error"
+ // Enable strict mode. This enables a few options at a time, see https://www.typescriptlang.org/tsconfig#strict for a list.
+ "strict": true
}
}
diff --git a/packages/create-astro/CHANGELOG.md b/packages/create-astro/CHANGELOG.md
index 6f9211cbf..558ae689a 100644
--- a/packages/create-astro/CHANGELOG.md
+++ b/packages/create-astro/CHANGELOG.md
@@ -1,5 +1,11 @@
# create-astro
+## 4.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.
+
## 3.1.11
### Patch Changes
diff --git a/packages/create-astro/package.json b/packages/create-astro/package.json
index 3d4aa6d7f..8b3034c0b 100644
--- a/packages/create-astro/package.json
+++ b/packages/create-astro/package.json
@@ -1,6 +1,6 @@
{
"name": "create-astro",
- "version": "3.1.11",
+ "version": "4.0.0-beta.0",
"type": "module",
"author": "withastro",
"license": "MIT",
@@ -47,6 +47,6 @@
"strip-json-comments": "^5.0.0"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/create-astro/tsconfig.json b/packages/create-astro/tsconfig.json
index 720167fad..1ab34c5a2 100644
--- a/packages/create-astro/tsconfig.json
+++ b/packages/create-astro/tsconfig.json
@@ -5,7 +5,7 @@
"allowJs": true,
"emitDeclarationOnly": false,
"noEmit": true,
- "target": "ES2021",
+ "target": "ES2022",
"module": "ES2022",
"outDir": "./dist",
"declarationDir": "./dist/types"
diff --git a/packages/integrations/alpinejs/CHANGELOG.md b/packages/integrations/alpinejs/CHANGELOG.md
index f19d0c229..4f517f765 100644
--- a/packages/integrations/alpinejs/CHANGELOG.md
+++ b/packages/integrations/alpinejs/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/alpinejs
+## 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.2
### Patch Changes
diff --git a/packages/integrations/alpinejs/package.json b/packages/integrations/alpinejs/package.json
index d1b6a6b49..9b4cd3d5b 100644
--- a/packages/integrations/alpinejs/package.json
+++ b/packages/integrations/alpinejs/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/alpinejs",
"description": "Use Alpine within Astro",
- "version": "0.2.2",
+ "version": "0.3.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
diff --git a/packages/integrations/alpinejs/tsconfig.json b/packages/integrations/alpinejs/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/alpinejs/tsconfig.json
+++ b/packages/integrations/alpinejs/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/cloudflare/CHANGELOG.md b/packages/integrations/cloudflare/CHANGELOG.md
index b561a710a..2411aca36 100644
--- a/packages/integrations/cloudflare/CHANGELOG.md
+++ b/packages/integrations/cloudflare/CHANGELOG.md
@@ -1,5 +1,45 @@
# @astrojs/cloudflare
+## 7.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.
+
+- [`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
+
+### 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,
+ },
+ },
+ };
+ }
+ ```
+
+### 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)]:
+ - astro@3.0.0-beta.0
+ - @astrojs/underscore-redirects@0.3.0-beta.0
+
## 6.6.2
### Patch Changes
diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json
index b44062aec..c4f4ac54c 100644
--- a/packages/integrations/cloudflare/package.json
+++ b/packages/integrations/cloudflare/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/cloudflare",
"description": "Deploy your site to Cloudflare Workers/Pages",
- "version": "6.6.2",
+ "version": "7.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -39,13 +39,13 @@
"test:match": "mocha --exit --timeout 30000 -g"
},
"dependencies": {
- "@astrojs/underscore-redirects": "^0.2.0",
+ "@astrojs/underscore-redirects": "workspace:*",
"@cloudflare/workers-types": "^4.20230518.0",
- "esbuild": "^0.17.19",
+ "esbuild": "^0.18.16",
"tiny-glob": "^0.2.9"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3"
+ "astro": "workspace:^3.0.0-beta.0"
},
"devDependencies": {
"astro": "workspace:*",
diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts
index ef452aa95..a3bb76fbb 100644
--- a/packages/integrations/cloudflare/src/index.ts
+++ b/packages/integrations/cloudflare/src/index.ts
@@ -24,11 +24,31 @@ export function getAdapter(isModeDirectory: boolean): AstroAdapter {
name: '@astrojs/cloudflare',
serverEntrypoint: '@astrojs/cloudflare/server.directory.js',
exports: ['onRequest', 'manifest'],
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'unsupported',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'unsupported',
+ isSharpCompatible: false,
+ isSquooshCompatible: false,
+ },
+ },
}
: {
name: '@astrojs/cloudflare',
serverEntrypoint: '@astrojs/cloudflare/server.advanced.js',
exports: ['default'],
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'unsupported',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: false,
+ isSquooshCompatible: false,
+ },
+ },
};
}
diff --git a/packages/integrations/cloudflare/test/fixtures/basics/astro.config.mjs b/packages/integrations/cloudflare/test/fixtures/basics/astro.config.mjs
index 105247b1b..407dc4355 100644
--- a/packages/integrations/cloudflare/test/fixtures/basics/astro.config.mjs
+++ b/packages/integrations/cloudflare/test/fixtures/basics/astro.config.mjs
@@ -6,5 +6,5 @@ process.env.SECRET_STUFF = 'secret'
export default defineConfig({
adapter: cloudflare(),
- output: 'server',
+ output: 'server'
});
diff --git a/packages/integrations/cloudflare/tsconfig.json b/packages/integrations/cloudflare/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/cloudflare/tsconfig.json
+++ b/packages/integrations/cloudflare/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/deno/CHANGELOG.md b/packages/integrations/deno/CHANGELOG.md
index b7ecf636f..de93048e4 100644
--- a/packages/integrations/deno/CHANGELOG.md
+++ b/packages/integrations/deno/CHANGELOG.md
@@ -1,5 +1,42 @@
# @astrojs/deno
+## 5.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.
+
+### 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,
+ },
+ },
+ };
+ }
+ ```
+
+### 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)]:
+ - astro@3.0.0-beta.0
+
## 4.3.0
### Minor Changes
diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json
index a7ecb6f14..8079cbac5 100644
--- a/packages/integrations/deno/package.json
+++ b/packages/integrations/deno/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/deno",
"description": "Deploy your site to a Deno server",
- "version": "4.3.0",
+ "version": "5.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -36,7 +36,7 @@
"esbuild": "^0.15.18"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3"
+ "astro": "workspace:^3.0.0-beta.0"
},
"devDependencies": {
"astro": "workspace:*",
diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts
index db645eb69..3b011c830 100644
--- a/packages/integrations/deno/src/index.ts
+++ b/packages/integrations/deno/src/index.ts
@@ -89,6 +89,16 @@ export function getAdapter(args?: Options): AstroAdapter {
serverEntrypoint: '@astrojs/deno/server.js',
args: args ?? {},
exports: ['stop', 'handle', 'start', 'running'],
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'stable',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: false,
+ isSquooshCompatible: false,
+ },
+ },
};
}
diff --git a/packages/integrations/deno/test/fixtures/basics/astro.config.mjs b/packages/integrations/deno/test/fixtures/basics/astro.config.mjs
index b5187f891..cf80fdb2e 100644
--- a/packages/integrations/deno/test/fixtures/basics/astro.config.mjs
+++ b/packages/integrations/deno/test/fixtures/basics/astro.config.mjs
@@ -6,5 +6,5 @@ import mdx from '@astrojs/mdx';
export default defineConfig({
adapter: deno(),
integrations: [react(), mdx()],
- output: 'server',
+ output: 'server'
})
diff --git a/packages/integrations/deno/test/fixtures/dynimport/astro.config.mjs b/packages/integrations/deno/test/fixtures/dynimport/astro.config.mjs
index d670faac6..009023113 100644
--- a/packages/integrations/deno/test/fixtures/dynimport/astro.config.mjs
+++ b/packages/integrations/deno/test/fixtures/dynimport/astro.config.mjs
@@ -3,5 +3,5 @@ import deno from '@astrojs/deno';
export default defineConfig({
adapter: deno(),
- output: 'server',
+ output: 'server'
})
diff --git a/packages/integrations/deno/tsconfig.json b/packages/integrations/deno/tsconfig.json
index 64d4ef454..f3c96447a 100644
--- a/packages/integrations/deno/tsconfig.json
+++ b/packages/integrations/deno/tsconfig.json
@@ -5,6 +5,8 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022",
+ // TODO: Due to the shim for Deno imports in `server.ts`, we can't use moduleResolution: 'bundler' or the types get very weird.
+ "moduleResolution": "Node"
}
}
diff --git a/packages/integrations/image/CHANGELOG.md b/packages/integrations/image/CHANGELOG.md
index 9deccac59..79f4e39d3 100644
--- a/packages/integrations/image/CHANGELOG.md
+++ b/packages/integrations/image/CHANGELOG.md
@@ -1,5 +1,16 @@
# @astrojs/image
+## 1.0.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.
+
+### 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)]:
+ - astro@3.0.0-beta.0
+
## 0.17.3
### Patch Changes
diff --git a/packages/integrations/image/README.md b/packages/integrations/image/README.md
index a31854923..0d7db86fa 100644
--- a/packages/integrations/image/README.md
+++ b/packages/integrations/image/README.md
@@ -130,14 +130,14 @@ import heroImage from '../assets/hero.png';
// optimized image, keeping the original width, height, and image format
<Image src={heroImage} alt="descriptive text" />
-// specify multiple sizes for responsive images or art direction
+ // specify multiple sizes for responsive images or art direction
<Picture
src={heroImage}
widths={[200, 400, 800]}
sizes="(max-width: 800px) 100vw, 800px"
alt="descriptive text"
/>
----
+ ---
```
The included image transformers support resizing images and encoding them to different image formats. Third-party image services will be able to add support for custom transformations as well (ex: `blur`, `filter`, `rotate`, etc).
@@ -566,16 +566,16 @@ import heroImage from '../assets/hero.png';
// optimized image, keeping the original width, height, and image format
<Image src={heroImage} alt="descriptive text" />
-// height will be recalculated to match the original aspect ratio
+ // height will be recalculated to match the original aspect ratio
<Image src={heroImage} width={300} alt="descriptive text" />
-// cropping to a specific width and height
+ // cropping to a specific width and height
<Image src={heroImage} width={300} height={600} alt="descriptive text" />
-// cropping to a specific aspect ratio and converting to an avif format
+ // cropping to a specific aspect ratio and converting to an avif format
<Image src={heroImage} width={300} aspectRatio="16:9" format="avif" alt="descriptive text" />
-// image imports can also be inlined directly
+ // image imports can also be inlined directly
<Image src={import('../assets/hero.png')} alt="descriptive text" />
```
@@ -612,7 +612,7 @@ const imageUrl = 'https://astro.build/assets/press/full-logo-dark.png';
// cropping to a specific width and height
<Image src={imageUrl} width={750} height={250} format="avif" alt="descriptive text" />
-// height will be recalculated to match the aspect ratio
+ // height will be recalculated to match the aspect ratio
<Image src={imageUrl} width={750} aspectRatio={16 / 9} format="avif" alt="descriptive text" />
```
@@ -641,7 +641,7 @@ const imageUrl =
alt="descriptive text"
/>
-// Remote image (aspect ratio is required)
+ // Remote image (aspect ratio is required)
<Picture
src={imageUrl}
widths={[200, 400, 800]}
@@ -650,7 +650,7 @@ const imageUrl =
alt="descriptive text"
/>
-// Inlined imports are supported
+ // Inlined imports are supported
<Picture
src={import('../assets/hero.png')}
widths={[200, 400, 800]}
diff --git a/packages/integrations/image/package.json b/packages/integrations/image/package.json
index 0119a5f16..b4d01c9dd 100644
--- a/packages/integrations/image/package.json
+++ b/packages/integrations/image/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/image",
"description": "Load and transform images in your Astro site",
- "version": "0.17.3",
+ "version": "1.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -63,7 +63,7 @@
"vite": "^4.4.6"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3",
+ "astro": "workspace:^3.0.0-beta.0",
"sharp": ">=0.31.0"
},
"peerDependenciesMeta": {
diff --git a/packages/integrations/image/src/build/ssg.ts b/packages/integrations/image/src/build/ssg.ts
index 4a6d84d53..d06d055a3 100644
--- a/packages/integrations/image/src/build/ssg.ts
+++ b/packages/integrations/image/src/build/ssg.ts
@@ -127,7 +127,7 @@ export async function ssgBuild({
async function processStaticImage([src, transformsMap]: [
string,
- Map<string, TransformOptions>
+ Map<string, TransformOptions>,
]): Promise<void> {
let inputFile: string | undefined = undefined;
let inputBuffer: Buffer | undefined = undefined;
diff --git a/packages/integrations/image/src/endpoint.ts b/packages/integrations/image/src/endpoint.ts
index 5a8ca554b..d3810e5dd 100644
--- a/packages/integrations/image/src/endpoint.ts
+++ b/packages/integrations/image/src/endpoint.ts
@@ -20,7 +20,7 @@ async function loadRemoteImage(src: URL) {
}
}
-export const get: APIRoute = async ({ request }) => {
+export const GET: APIRoute = async ({ request }) => {
try {
const url = new URL(request.url);
const transform = loader.parseTransform(url.searchParams);
diff --git a/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs b/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/background-color-image/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/basic-image/astro.config.mjs b/packages/integrations/image/test/fixtures/basic-image/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/basic-image/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/basic-image/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/basic-picture/astro.config.mjs b/packages/integrations/image/test/fixtures/basic-picture/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/basic-picture/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/basic-picture/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/get-image-remote/astro.config.mjs b/packages/integrations/image/test/fixtures/get-image-remote/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/get-image-remote/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/get-image-remote/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/no-alt-text-image/astro.config.mjs b/packages/integrations/image/test/fixtures/no-alt-text-image/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/no-alt-text-image/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/no-alt-text-image/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/no-alt-text-picture/astro.config.mjs b/packages/integrations/image/test/fixtures/no-alt-text-picture/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/no-alt-text-picture/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/no-alt-text-picture/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/rotation/astro.config.mjs b/packages/integrations/image/test/fixtures/rotation/astro.config.mjs
index f00c6ebae..f2b44a4a0 100644
--- a/packages/integrations/image/test/fixtures/rotation/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/rotation/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
});
diff --git a/packages/integrations/image/test/fixtures/squoosh-service/astro.config.mjs b/packages/integrations/image/test/fixtures/squoosh-service/astro.config.mjs
index 7dafac3b6..fcbb8ec5e 100644
--- a/packages/integrations/image/test/fixtures/squoosh-service/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/squoosh-service/astro.config.mjs
@@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent' })]
});
diff --git a/packages/integrations/image/test/fixtures/with-mdx/astro.config.mjs b/packages/integrations/image/test/fixtures/with-mdx/astro.config.mjs
index 7989a6f57..3aae5b3a2 100644
--- a/packages/integrations/image/test/fixtures/with-mdx/astro.config.mjs
+++ b/packages/integrations/image/test/fixtures/with-mdx/astro.config.mjs
@@ -4,6 +4,6 @@ import mdx from '@astrojs/mdx';
// https://astro.build/config
export default defineConfig({
- site: 'http://localhost:3000',
+ site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' }), mdx()]
});
diff --git a/packages/integrations/image/tsconfig.json b/packages/integrations/image/tsconfig.json
index 56b6b4e2d..0a210b9fc 100644
--- a/packages/integrations/image/tsconfig.json
+++ b/packages/integrations/image/tsconfig.json
@@ -5,7 +5,7 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021",
+ "target": "ES2022",
"typeRoots": ["node_modules/@types", "node_modules/@netlify"]
}
}
diff --git a/packages/integrations/lit/CHANGELOG.md b/packages/integrations/lit/CHANGELOG.md
index 67e48d200..d26dd1777 100644
--- a/packages/integrations/lit/CHANGELOG.md
+++ b/packages/integrations/lit/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/lit
+## 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/integrations/lit/package.json b/packages/integrations/lit/package.json
index 4e21843a0..99d3130ce 100644
--- a/packages/integrations/lit/package.json
+++ b/packages/integrations/lit/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/lit",
- "version": "2.1.1",
+ "version": "3.0.0-beta.0",
"description": "Use Lit components within Astro",
"type": "module",
"types": "./dist/index.d.ts",
diff --git a/packages/integrations/lit/tsconfig.json b/packages/integrations/lit/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/lit/tsconfig.json
+++ b/packages/integrations/lit/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/markdoc/CHANGELOG.md b/packages/integrations/markdoc/CHANGELOG.md
index 7a7a7f0ba..661d37c11 100644
--- a/packages/integrations/markdoc/CHANGELOG.md
+++ b/packages/integrations/markdoc/CHANGELOG.md
@@ -1,5 +1,18 @@
# @astrojs/markdoc
+## 1.0.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.
+
+### 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
+ - @astrojs/internal-helpers@0.2.0-beta.0
+
## 0.4.4
### Patch Changes
diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json
index 887976543..5426686af 100644
--- a/packages/integrations/markdoc/package.json
+++ b/packages/integrations/markdoc/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/markdoc",
"description": "Add support for Markdoc in your Astro site",
- "version": "0.4.4",
+ "version": "1.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -63,10 +63,10 @@
"test:match": "mocha --timeout 20000 -g"
},
"dependencies": {
- "@astrojs/internal-helpers": "^0.1.2",
- "@astrojs/prism": "^2.1.2",
+ "@astrojs/internal-helpers": "workspace:*",
+ "@astrojs/prism": "workspace:*",
"@markdoc/markdoc": "^0.3.0",
- "esbuild": "^0.17.19",
+ "esbuild": "^0.18.16",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
"htmlparser2": "^9.0.0",
@@ -75,10 +75,10 @@
"zod": "^3.17.3"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3"
+ "astro": "workspace:^3.0.0-beta.0"
},
"devDependencies": {
- "@astrojs/markdown-remark": "^2.2.1",
+ "@astrojs/markdown-remark": "workspace:*",
"@types/chai": "^4.3.5",
"@types/html-escaper": "^3.0.0",
"@types/markdown-it": "^12.2.3",
@@ -93,6 +93,6 @@
"vite": "^4.4.6"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/markdoc/src/content-entry-type.ts b/packages/integrations/markdoc/src/content-entry-type.ts
index 52493fa71..0998f69a0 100644
--- a/packages/integrations/markdoc/src/content-entry-type.ts
+++ b/packages/integrations/markdoc/src/content-entry-type.ts
@@ -3,14 +3,13 @@ import Markdoc from '@markdoc/markdoc';
import type { AstroConfig, ContentEntryType } from 'astro';
import matter from 'gray-matter';
import fs from 'node:fs';
+import path from 'node:path';
import { fileURLToPath } from 'node:url';
+import type * as rollup from 'rollup';
import type { ErrorPayload as ViteErrorPayload } from 'vite';
import type { ComponentConfig } from './config.js';
import { MarkdocError, isComponentConfig, isValidUrl, prependForwardSlash } from './utils.js';
-// @ts-expect-error Cannot get the types here without `moduleResolution: 'nodenext'`
import { emitESMImage } from 'astro/assets/utils';
-import path from 'node:path';
-import type * as rollup from 'rollup';
import { htmlTokenTransform } from './html/transform/html-token-transform.js';
import type { MarkdocConfigResult } from './load-config.js';
import type { MarkdocIntegrationOptions } from './options.js';
@@ -198,8 +197,7 @@ async function emitOptimizedImages(
const src = await emitESMImage(
resolved.id,
ctx.pluginContext.meta.watchMode,
- ctx.pluginContext.emitFile,
- { config: ctx.astroConfig }
+ ctx.pluginContext.emitFile
);
node.attributes.__optimizedSrc = src;
} else {
diff --git a/packages/integrations/markdoc/src/extensions/prism.ts b/packages/integrations/markdoc/src/extensions/prism.ts
index e28112c9a..5cfd628ca 100644
--- a/packages/integrations/markdoc/src/extensions/prism.ts
+++ b/packages/integrations/markdoc/src/extensions/prism.ts
@@ -1,8 +1,5 @@
-// leave space, so organize imports doesn't mess up comments
-// @ts-expect-error Cannot find module 'astro/runtime/server/index.js' or its corresponding type declarations.
-import { unescapeHTML } from 'astro/runtime/server/index.js';
-
import { runHighlighterWithAstro } from '@astrojs/prism/dist/highlighter';
+import { unescapeHTML } from 'astro/runtime/server/index.js';
import { Markdoc, type AstroMarkdocConfig } from '../config.js';
export default function prism(): AstroMarkdocConfig {
@@ -16,7 +13,7 @@ export default function prism(): AstroMarkdocConfig {
// Use `unescapeHTML` to return `HTMLString` for Astro renderer to inline as HTML
return unescapeHTML(
`<pre class="${classLanguage}"><code class="${classLanguage}">${html}</code></pre>`
- );
+ ) as any;
},
},
},
diff --git a/packages/integrations/markdoc/src/extensions/shiki.ts b/packages/integrations/markdoc/src/extensions/shiki.ts
index 1229a09fb..a553a6bae 100644
--- a/packages/integrations/markdoc/src/extensions/shiki.ts
+++ b/packages/integrations/markdoc/src/extensions/shiki.ts
@@ -1,9 +1,6 @@
-// leave space, so organize imports doesn't mess up comments
-// @ts-expect-error Cannot find module 'astro/runtime/server/index.js' or its corresponding type declarations.
-import { unescapeHTML } from 'astro/runtime/server/index.js';
-
import Markdoc from '@markdoc/markdoc';
import type { ShikiConfig } from 'astro';
+import { unescapeHTML } from 'astro/runtime/server/index.js';
import type * as shikiTypes from 'shiki';
import { getHighlighter } from 'shiki';
import type { AstroMarkdocConfig } from '../config.js';
@@ -123,7 +120,7 @@ export default async function shiki({
}
// Use `unescapeHTML` to return `HTMLString` for Astro renderer to inline as HTML
- return unescapeHTML(html);
+ return unescapeHTML(html) as any;
},
},
},
diff --git a/packages/integrations/markdoc/src/html/transform/html-token-transform.ts b/packages/integrations/markdoc/src/html/transform/html-token-transform.ts
index 0d5dcfb81..cfa511a9f 100644
--- a/packages/integrations/markdoc/src/html/transform/html-token-transform.ts
+++ b/packages/integrations/markdoc/src/html/transform/html-token-transform.ts
@@ -1,4 +1,4 @@
-import { Tokenizer } from '@markdoc/markdoc';
+import type { Tokenizer } from '@markdoc/markdoc';
import { Parser } from 'htmlparser2';
import type * as Token from 'markdown-it/lib/token';
diff --git a/packages/integrations/markdoc/src/runtime.ts b/packages/integrations/markdoc/src/runtime.ts
index 1792d6caf..60057f53a 100644
--- a/packages/integrations/markdoc/src/runtime.ts
+++ b/packages/integrations/markdoc/src/runtime.ts
@@ -6,7 +6,6 @@ import Markdoc, {
type RenderableTreeNode,
} from '@markdoc/markdoc';
import type { AstroInstance } from 'astro';
-// @ts-expect-error Cannot find module 'astro/runtime/server/index.js' or its corresponding type declarations.
import { createComponent, renderComponent } from 'astro/runtime/server/index.js';
import type { AstroMarkdocConfig } from './config.js';
import { setupHeadingConfig } from './heading-ids.js';
@@ -204,7 +203,7 @@ export function createContentComponent(
return renderComponent(result, Renderer.name, Renderer, { stringifiedAst, config }, {});
},
propagation: 'self',
- });
+ } as any);
}
// statically define a partial MarkdocConfig which registers the required "html-tag" Markdoc tag when the "allowHTML" feature is enabled
diff --git a/packages/integrations/markdoc/tsconfig.json b/packages/integrations/markdoc/tsconfig.json
index 44baf375c..af1b43564 100644
--- a/packages/integrations/markdoc/tsconfig.json
+++ b/packages/integrations/markdoc/tsconfig.json
@@ -3,8 +3,8 @@
"include": ["src"],
"compilerOptions": {
"allowJs": true,
- "module": "ES2020",
+ "module": "ES2022",
"outDir": "./dist",
- "target": "ES2020"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md
index 531e8809f..ac853011d 100644
--- a/packages/integrations/mdx/CHANGELOG.md
+++ b/packages/integrations/mdx/CHANGELOG.md
@@ -1,5 +1,24 @@
# @astrojs/mdx
+## 1.0.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.
+
+- [`dfc2d93e3`](https://github.com/withastro/astro/commit/dfc2d93e3c645995379358fabbdfa9aab99f43d8) Thanks [@bluwy](https://github.com/bluwy)! - Add `astro` as peer dependency
+
+### Patch Changes
+
+- [`dfc2d93e3`](https://github.com/withastro/astro/commit/dfc2d93e3c645995379358fabbdfa9aab99f43d8) Thanks [@bluwy](https://github.com/bluwy)! - Re-orders the MDX plugin to run before Astro's JSX plugin
+
+- [`631b9c410`](https://github.com/withastro/astro/commit/631b9c410d5d66fa384674027ba95d69ebb5063f) Thanks [@bluwy](https://github.com/bluwy)! - Handle `components` exports handling itself
+
+- 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
+ - @astrojs/markdown-remark@3.0.0-beta.0
+
## 0.19.7
### Patch Changes
diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json
index 7e38cb1b6..f5ed6fad8 100644
--- a/packages/integrations/mdx/package.json
+++ b/packages/integrations/mdx/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/mdx",
"description": "Add support for MDX pages in your Astro site",
- "version": "0.19.7",
+ "version": "1.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -34,8 +34,8 @@
"test:match": "mocha --timeout 20000 -g"
},
"dependencies": {
- "@astrojs/markdown-remark": "^2.2.1",
- "@astrojs/prism": "^2.1.2",
+ "@astrojs/markdown-remark": "workspace:*",
+ "@astrojs/prism": "workspace:*",
"@mdx-js/mdx": "^2.3.0",
"acorn": "^8.9.0",
"es-module-lexer": "^1.3.0",
@@ -53,6 +53,9 @@
"unist-util-visit": "^4.1.2",
"vfile": "^5.3.7"
},
+ "peerDependencies": {
+ "astro": "workspace:^3.0.0-beta.0"
+ },
"devDependencies": {
"@types/chai": "^4.3.5",
"@types/estree": "^1.0.1",
@@ -78,6 +81,6 @@
"vite": "^4.4.6"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts
index 1d0320213..ecf2a9a95 100644
--- a/packages/integrations/mdx/src/index.ts
+++ b/packages/integrations/mdx/src/index.ts
@@ -95,6 +95,21 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
enforce: 'pre',
configResolved(resolved) {
importMetaEnv = { ...importMetaEnv, ...resolved.env };
+
+ // HACK: move ourselves before Astro's JSX plugin to transform things in the right order
+ const jsxPluginIndex = resolved.plugins.findIndex((p) => p.name === 'astro:jsx');
+ if (jsxPluginIndex !== -1) {
+ const myPluginIndex = resolved.plugins.findIndex(
+ (p) => p.name === '@mdx-js/rollup'
+ );
+ if (myPluginIndex !== -1) {
+ const myPlugin = resolved.plugins[myPluginIndex];
+ // @ts-ignore-error ignore readonly annotation
+ resolved.plugins.splice(myPluginIndex, 1);
+ // @ts-ignore-error ignore readonly annotation
+ resolved.plugins.splice(jsxPluginIndex, 0, myPlugin);
+ }
+ }
},
// Override transform to alter code before MDX compilation
// ex. inject layouts
@@ -156,11 +171,14 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
code += `\nexport const file = ${JSON.stringify(fileId)};`;
}
if (!moduleExports.find(({ n }) => n === 'Content')) {
+ // If have `export const components`, pass that as props to `Content` as fallback
+ const hasComponents = moduleExports.find(({ n }) => n === 'components');
+
// Make `Content` the default export so we can wrap `MDXContent` and pass in `Fragment`
code = code.replace('export default MDXContent;', '');
code += `\nexport const Content = (props = {}) => MDXContent({
...props,
- components: { Fragment, ...props.components },
+ components: { Fragment${hasComponents ? ', ...components' : ''}, ...props.components },
});
export default Content;`;
}
diff --git a/packages/integrations/mdx/src/remark-images-to-component.ts b/packages/integrations/mdx/src/remark-images-to-component.ts
index 8a3166f49..bb9657f42 100644
--- a/packages/integrations/mdx/src/remark-images-to-component.ts
+++ b/packages/integrations/mdx/src/remark-images-to-component.ts
@@ -1,5 +1,5 @@
import type { MarkdownVFile } from '@astrojs/markdown-remark';
-import { type Image, type Parent } from 'mdast';
+import type { Image, Parent } from 'mdast';
import type { MdxJsxFlowElement, MdxjsEsm } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
import { jsToTreeNode } from './utils.js';
diff --git a/packages/integrations/mdx/tsconfig.json b/packages/integrations/mdx/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/mdx/tsconfig.json
+++ b/packages/integrations/mdx/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/netlify/CHANGELOG.md b/packages/integrations/netlify/CHANGELOG.md
index 57f318c29..108964c49 100644
--- a/packages/integrations/netlify/CHANGELOG.md
+++ b/packages/integrations/netlify/CHANGELOG.md
@@ -1,5 +1,81 @@
# @astrojs/netlify
+## 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.
+
+- [`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
+
+- [`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.
+
+### 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,
+ },
+ },
+ };
+ }
+ ```
+
+- [`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
+ }),
+ });
+ ```
+
+### 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)]:
+ - astro@3.0.0-beta.0
+ - @astrojs/underscore-redirects@0.3.0-beta.0
+
## 2.5.2
### Patch Changes
diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json
index 7c0ef47ce..1214dc6f7 100644
--- a/packages/integrations/netlify/package.json
+++ b/packages/integrations/netlify/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/netlify",
"description": "Deploy your site to Netlify",
- "version": "2.5.2",
+ "version": "3.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -38,13 +38,12 @@
"test:hosted": "mocha --exit --timeout 30000 test/hosted"
},
"dependencies": {
- "@astrojs/underscore-redirects": "^0.2.0",
- "@astrojs/webapi": "^2.2.0",
+ "@astrojs/underscore-redirects": "workspace:*",
"@netlify/functions": "^1.6.0",
- "esbuild": "^0.15.18"
+ "esbuild": "^0.18.16"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3"
+ "astro": "workspace:^3.0.0-beta.0"
},
"devDependencies": {
"@netlify/edge-functions": "^2.0.0",
diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts
index ac7c124fb..4e8bc6aa4 100644
--- a/packages/integrations/netlify/src/integration-edge-functions.ts
+++ b/packages/integrations/netlify/src/integration-edge-functions.ts
@@ -11,6 +11,16 @@ export function getAdapter(): AstroAdapter {
name: '@astrojs/netlify/edge-functions',
serverEntrypoint: '@astrojs/netlify/netlify-edge-functions.js',
exports: ['default'],
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'stable',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: false,
+ isSquooshCompatible: false,
+ },
+ },
};
}
diff --git a/packages/integrations/netlify/src/integration-functions.ts b/packages/integrations/netlify/src/integration-functions.ts
index a950167e5..b8d56ad65 100644
--- a/packages/integrations/netlify/src/integration-functions.ts
+++ b/packages/integrations/netlify/src/integration-functions.ts
@@ -8,12 +8,26 @@ import { createRedirects } from './shared.js';
export const NETLIFY_EDGE_MIDDLEWARE_FILE = 'netlify-edge-middleware';
export const ASTRO_LOCALS_HEADER = 'x-astro-locals';
-export function getAdapter(args: Args = {}): AstroAdapter {
+export function getAdapter({ functionPerRoute, edgeMiddleware, ...args }: Args): AstroAdapter {
return {
name: '@astrojs/netlify/functions',
serverEntrypoint: '@astrojs/netlify/netlify-functions.js',
exports: ['handler'],
args,
+ adapterFeatures: {
+ functionPerRoute,
+ edgeMiddleware,
+ },
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'stable',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: true,
+ isSquooshCompatible: true,
+ },
+ },
};
}
@@ -21,12 +35,16 @@ interface NetlifyFunctionsOptions {
dist?: URL;
builders?: boolean;
binaryMediaTypes?: string[];
+ edgeMiddleware?: boolean;
+ functionPerRoute?: boolean;
}
function netlifyFunctions({
dist,
builders,
binaryMediaTypes,
+ functionPerRoute = false,
+ edgeMiddleware = false,
}: NetlifyFunctionsOptions = {}): AstroIntegration {
let _config: AstroConfig;
let _entryPoints: Map<RouteData, URL>;
@@ -53,7 +71,7 @@ function netlifyFunctions({
_entryPoints = entryPoints;
},
'astro:config:done': ({ config, setAdapter }) => {
- setAdapter(getAdapter({ binaryMediaTypes, builders }));
+ setAdapter(getAdapter({ binaryMediaTypes, builders, functionPerRoute, edgeMiddleware }));
_config = config;
ssrEntryFile = config.build.serverEntry.replace(/\.m?js/, '');
diff --git a/packages/integrations/netlify/src/netlify-functions.ts b/packages/integrations/netlify/src/netlify-functions.ts
index cc6636ec4..3da0718b0 100644
--- a/packages/integrations/netlify/src/netlify-functions.ts
+++ b/packages/integrations/netlify/src/netlify-functions.ts
@@ -1,16 +1,16 @@
-import { polyfill } from '@astrojs/webapi';
import { builder, type Handler } from '@netlify/functions';
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
+import { applyPolyfills } from 'astro/app/node';
import { ASTRO_LOCALS_HEADER } from './integration-functions.js';
-polyfill(globalThis, {
- exclude: 'window document',
-});
+applyPolyfills();
export interface Args {
builders?: boolean;
binaryMediaTypes?: string[];
+ edgeMiddleware: boolean;
+ functionPerRoute: boolean;
}
function parseContentType(header?: string) {
diff --git a/packages/integrations/netlify/test/functions/edge-middleware.test.js b/packages/integrations/netlify/test/functions/edge-middleware.test.js
index 219fd1ced..a83720a4d 100644
--- a/packages/integrations/netlify/test/functions/edge-middleware.test.js
+++ b/packages/integrations/netlify/test/functions/edge-middleware.test.js
@@ -10,6 +10,7 @@ describe('Middleware', () => {
output: 'server',
adapter: netlifyAdapter({
dist: new URL('./fixtures/middleware-with-handler-file/dist/', import.meta.url),
+ edgeMiddleware: true,
}),
site: `http://example.com`,
integrations: [testIntegration()],
diff --git a/packages/integrations/netlify/test/functions/split-support.test.js b/packages/integrations/netlify/test/functions/split-support.test.js
index 217b3c0d3..fde8b5eb1 100644
--- a/packages/integrations/netlify/test/functions/split-support.test.js
+++ b/packages/integrations/netlify/test/functions/split-support.test.js
@@ -13,6 +13,7 @@ describe('Split support', () => {
output: 'server',
adapter: netlifyAdapter({
dist: new URL('./fixtures/split-support/dist/', import.meta.url),
+ functionPerRoute: true,
}),
site: `http://example.com`,
integrations: [
@@ -22,9 +23,6 @@ describe('Split support', () => {
},
}),
],
- build: {
- split: true,
- },
});
await fixture.build();
});
diff --git a/packages/integrations/netlify/tsconfig.json b/packages/integrations/netlify/tsconfig.json
index 4442d4c36..66b0102c7 100644
--- a/packages/integrations/netlify/tsconfig.json
+++ b/packages/integrations/netlify/tsconfig.json
@@ -5,7 +5,7 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021",
+ "target": "ES2022",
"typeRoots": ["node_modules/@types", "node_modules/@netlify"],
"allowImportingTsExtensions": true
}
diff --git a/packages/integrations/node/CHANGELOG.md b/packages/integrations/node/CHANGELOG.md
index 484ac50db..884eb21f8 100644
--- a/packages/integrations/node/CHANGELOG.md
+++ b/packages/integrations/node/CHANGELOG.md
@@ -1,5 +1,44 @@
# @astrojs/node
+## 6.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.
+
+- [`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.
+
+### 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,
+ },
+ },
+ };
+ }
+ ```
+
+### 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)]:
+ - astro@3.0.0-beta.0
+
## 5.3.2
### Patch Changes
diff --git a/packages/integrations/node/README.md b/packages/integrations/node/README.md
index e97544956..5d3642be6 100644
--- a/packages/integrations/node/README.md
+++ b/packages/integrations/node/README.md
@@ -159,7 +159,7 @@ For standalone mode the server handles file servering in addition to the page an
You can override the host and port the standalone server runs on by passing them as environment variables at runtime:
```shell
-HOST=0.0.0.0 PORT=3000 node ./dist/server/entry.mjs
+HOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs
```
#### HTTPS
diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json
index ad01866f7..c01abae80 100644
--- a/packages/integrations/node/package.json
+++ b/packages/integrations/node/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/node",
"description": "Deploy your site to a Node.js server",
- "version": "5.3.2",
+ "version": "6.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -33,12 +33,11 @@
"test": "mocha --exit --timeout 20000 test/"
},
"dependencies": {
- "@astrojs/webapi": "^2.2.0",
"send": "^0.18.0",
"server-destroy": "^1.0.1"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3"
+ "astro": "workspace:^3.0.0-beta.0"
},
"devDependencies": {
"@types/node": "^18.16.18",
@@ -49,7 +48,6 @@
"chai": "^4.3.7",
"cheerio": "1.0.0-rc.12",
"mocha": "^9.2.2",
- "node-mocks-http": "^1.12.2",
- "undici": "^5.22.1"
+ "node-mocks-http": "^1.12.2"
}
}
diff --git a/packages/integrations/node/src/index.ts b/packages/integrations/node/src/index.ts
index 17a8f4502..7435a60ed 100644
--- a/packages/integrations/node/src/index.ts
+++ b/packages/integrations/node/src/index.ts
@@ -8,6 +8,16 @@ export function getAdapter(options: Options): AstroAdapter {
previewEntrypoint: '@astrojs/node/preview.js',
exports: ['handler', 'startServer'],
args: options,
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'stable',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: true,
+ isSquooshCompatible: true,
+ },
+ },
};
}
diff --git a/packages/integrations/node/src/response-iterator.ts b/packages/integrations/node/src/response-iterator.ts
index 01624d81d..0dd6e63af 100644
--- a/packages/integrations/node/src/response-iterator.ts
+++ b/packages/integrations/node/src/response-iterator.ts
@@ -6,7 +6,6 @@
import type { ReadableStreamDefaultReadResult } from 'node:stream/web';
import { Readable as NodeReadableStream } from 'stream';
-import type { Response as NodeResponse } from 'undici';
interface NodeStreamIterator<T> {
next(): Promise<IteratorResult<T, boolean | undefined>>;
@@ -35,8 +34,8 @@ function isBuffer(value: any): value is Buffer {
);
}
-function isNodeResponse(value: any): value is NodeResponse {
- return !!(value as NodeResponse).body;
+function isNodeResponse(value: any): value is Response {
+ return !!(value as Response).body;
}
function isReadableStream(value: any): value is ReadableStream<any> {
@@ -121,7 +120,7 @@ function nodeStreamIterator<T>(stream: NodeReadableStream): AsyncIterableIterato
| IteratorResult<T, boolean | undefined>
| PromiseLike<IteratorResult<T, boolean | undefined>>
) => void,
- (reason?: any) => void
+ (reason?: any) => void,
][] = [];
function onData(chunk: any) {
@@ -201,9 +200,7 @@ function asyncIterator<T>(source: AsyncIterableIterator<T>): AsyncIterableIterat
};
}
-export function responseIterator<T>(
- response: Response | NodeResponse | Buffer
-): AsyncIterableIterator<T> {
+export function responseIterator<T>(response: Response | Buffer): AsyncIterableIterator<T> {
let body: unknown = response;
if (isNodeResponse(response)) body = response.body;
diff --git a/packages/integrations/node/src/server.ts b/packages/integrations/node/src/server.ts
index 98f5cd14b..04c81c2d1 100644
--- a/packages/integrations/node/src/server.ts
+++ b/packages/integrations/node/src/server.ts
@@ -1,14 +1,10 @@
-import { polyfill } from '@astrojs/webapi';
import type { SSRManifest } from 'astro';
-import { NodeApp } from 'astro/app/node';
+import { NodeApp, applyPolyfills } from 'astro/app/node';
import middleware from './nodeMiddleware.js';
import startServer from './standalone.js';
import type { Options } from './types';
-polyfill(globalThis, {
- exclude: 'window document',
-});
-
+applyPolyfills();
export function createExports(manifest: SSRManifest, options: Options) {
const app = new NodeApp(manifest);
return {
diff --git a/packages/integrations/node/src/types.ts b/packages/integrations/node/src/types.ts
index b0bd4a681..85f4f4fbc 100644
--- a/packages/integrations/node/src/types.ts
+++ b/packages/integrations/node/src/types.ts
@@ -21,7 +21,7 @@ export type RequestHandlerParams = [
req: IncomingMessage,
res: ServerResponse,
next?: (err?: unknown) => void,
- locals?: object
+ locals?: object,
];
export type ErrorHandlerParams = [unknown, ...RequestHandlerParams];
diff --git a/packages/integrations/node/test/bad-urls.test.js b/packages/integrations/node/test/bad-urls.test.js
index 24a6e7747..de7484b80 100644
--- a/packages/integrations/node/test/bad-urls.test.js
+++ b/packages/integrations/node/test/bad-urls.test.js
@@ -41,6 +41,6 @@ describe('API routes', () => {
}
const stillWork = await fixture.fetch('/');
const text = await stillWork.text();
- expect(text).to.equal('<!DOCTYPE html>\nHello!');
+ expect(text).to.equal('<!DOCTYPE html>Hello!');
});
});
diff --git a/packages/integrations/node/test/fixtures/api-route/src/pages/binary.ts b/packages/integrations/node/test/fixtures/api-route/src/pages/binary.ts
index 6b50bc341..b1c7ce263 100644
--- a/packages/integrations/node/test/fixtures/api-route/src/pages/binary.ts
+++ b/packages/integrations/node/test/fixtures/api-route/src/pages/binary.ts
@@ -1,5 +1,5 @@
-export async function post({ request }: { request: Request }) {
+export async function POST({ request }: { request: Request }) {
let body = await request.arrayBuffer();
let data = new Uint8Array(body);
let r = data.reverse();
diff --git a/packages/integrations/node/test/fixtures/api-route/src/pages/recipes.js b/packages/integrations/node/test/fixtures/api-route/src/pages/recipes.js
index edbd15a0e..7297b9643 100644
--- a/packages/integrations/node/test/fixtures/api-route/src/pages/recipes.js
+++ b/packages/integrations/node/test/fixtures/api-route/src/pages/recipes.js
@@ -1,5 +1,5 @@
-export async function post({ request }) {
+export async function POST({ request }) {
let body = await request.json();
const recipes = [
{
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-multi.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-multi.ts
index 53d0c214c..aaae88e59 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-multi.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-multi.ts
@@ -1,6 +1,6 @@
import type { APIContext } from 'astro';
-export async function get({ request, cookies }: APIContext) {
+export async function GET({ request, cookies }: APIContext) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
cookies.set('from1', 'astro1');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-single.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-single.ts
index 5150f3990..03e74c604 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-single.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-cookies-single.ts
@@ -1,6 +1,6 @@
import type { APIContext } from 'astro';
-export async function get({ request, cookies }: APIContext) {
+export async function GET({ request, cookies }: APIContext) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
cookies.set('from1', 'astro1');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-multi.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-multi.ts
index 215b1a5ba..36906da3a 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-multi.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-multi.ts
@@ -1,6 +1,6 @@
import type { APIContext } from 'astro';
-export async function get({ request, cookies }: APIContext) {
+export async function GET({ request, cookies }: APIContext) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
headers.append('set-cookie', 'from1=response1');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-single.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-single.ts
index 7202941da..3c1fc4775 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-single.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/astro-response-cookie-single.ts
@@ -1,6 +1,6 @@
import type { APIContext } from 'astro';
-export async function get({ request, cookies }: APIContext) {
+export async function GET({ request, cookies }: APIContext) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
headers.append('set-cookie', 'from1=response1');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/kitchen-sink.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/kitchen-sink.ts
index 2b3074a85..fb7c30cbc 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/kitchen-sink.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/kitchen-sink.ts
@@ -1,4 +1,4 @@
-export async function get({ request }: { request: Request }) {
+export async function GET({ request }: { request: Request }) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
headers.append('x-SINGLE', 'single');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-multi.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-multi.ts
index ed3f867f4..d974737ee 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-multi.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-multi.ts
@@ -1,4 +1,4 @@
-export async function get({ request }: { request: Request }) {
+export async function GET({ request }: { request: Request }) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
headers.append('Set-Cookie', 'hello1=world1');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-single.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-single.ts
index 25de307ef..f543ae062 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-single.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-cookies-single.ts
@@ -1,4 +1,4 @@
-export async function get({ request }: { request: Request }) {
+export async function GET({ request }: { request: Request }) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
headers.append('Set-Cookie', 'hello1=world1');
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-empty-headers-object.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-empty-headers-object.ts
index 0c79cb537..b8a9e122e 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-empty-headers-object.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-empty-headers-object.ts
@@ -1,4 +1,4 @@
-export async function get({ request }: { request: Request }) {
+export async function GET({ request }: { request: Request }) {
const headers = new Headers();
return new Response('hello world', { headers });
}
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-undefined-headers-object.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-undefined-headers-object.ts
index 1afc6d843..72f7af071 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-undefined-headers-object.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/response-undefined-headers-object.ts
@@ -1,3 +1,3 @@
-export async function get({ request }: { request: Request }) {
+export async function GET({ request }: { request: Request }) {
return new Response('hello world', { headers: undefined });
}
diff --git a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/simple.ts b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/simple.ts
index 3b728f6fa..9c6bcacaa 100644
--- a/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/simple.ts
+++ b/packages/integrations/node/test/fixtures/headers/src/pages/endpoints/simple.ts
@@ -1,4 +1,4 @@
-export async function get({ request }: { request: Request }) {
+export async function GET({ request }: { request: Request }) {
const headers = new Headers();
headers.append('content-type', 'text/plain;charset=utf-8');
headers.append('X-HELLO', 'world');
diff --git a/packages/integrations/node/test/image.test.js b/packages/integrations/node/test/image.test.js
index 0834bc175..55942c924 100644
--- a/packages/integrations/node/test/image.test.js
+++ b/packages/integrations/node/test/image.test.js
@@ -2,7 +2,8 @@ import { expect } from 'chai';
import nodejs from '../dist/index.js';
import { loadFixture } from './test-utils.js';
-describe('Image endpoint', () => {
+// Temporary skip until we figure out the "Could not find Sharp" issue as `sharp` is bundled
+describe.skip('Image endpoint', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
let devPreview;
@@ -32,9 +33,6 @@ describe('Image endpoint', () => {
'/_image?href=/_astro/some_penguin.97ef5f92.png&w=50&f=webp'
);
- console.log(resImage);
- const content = resImage.text();
- console.log(content);
expect(resImage.status).to.equal(200);
});
});
diff --git a/packages/integrations/node/test/prerender-404.test.js b/packages/integrations/node/test/prerender-404.test.js
index 626f584e0..3a39a9470 100644
--- a/packages/integrations/node/test/prerender-404.test.js
+++ b/packages/integrations/node/test/prerender-404.test.js
@@ -2,7 +2,6 @@ import nodejs from '../dist/index.js';
import { loadFixture } from './test-utils.js';
import { expect } from 'chai';
import * as cheerio from 'cheerio';
-import { fetch } from 'undici';
/**
* @typedef {import('../../../astro/test/test-utils').Fixture} Fixture
diff --git a/packages/integrations/node/test/prerender.test.js b/packages/integrations/node/test/prerender.test.js
index f895a6458..65e3b4cb2 100644
--- a/packages/integrations/node/test/prerender.test.js
+++ b/packages/integrations/node/test/prerender.test.js
@@ -2,7 +2,6 @@ import nodejs from '../dist/index.js';
import { loadFixture } from './test-utils.js';
import { expect } from 'chai';
import * as cheerio from 'cheerio';
-import { fetch } from 'undici';
/**
* @typedef {import('../../../astro/test/test-utils').Fixture} Fixture
diff --git a/packages/integrations/node/tsconfig.json b/packages/integrations/node/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/node/tsconfig.json
+++ b/packages/integrations/node/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/partytown/CHANGELOG.md b/packages/integrations/partytown/CHANGELOG.md
index 4143a9035..06fdf55b9 100644
--- a/packages/integrations/partytown/CHANGELOG.md
+++ b/packages/integrations/partytown/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/partytown
+## 2.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.
+
## 1.2.3
### Patch Changes
diff --git a/packages/integrations/partytown/package.json b/packages/integrations/partytown/package.json
index d613b02f0..90441bc7a 100644
--- a/packages/integrations/partytown/package.json
+++ b/packages/integrations/partytown/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/partytown",
"description": "Use Partytown to move scripts into a web worker in your Astro project",
- "version": "1.2.3",
+ "version": "2.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
diff --git a/packages/integrations/partytown/tsconfig.json b/packages/integrations/partytown/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/partytown/tsconfig.json
+++ b/packages/integrations/partytown/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/preact/CHANGELOG.md b/packages/integrations/preact/CHANGELOG.md
index 96856cf85..e24312338 100644
--- a/packages/integrations/preact/CHANGELOG.md
+++ b/packages/integrations/preact/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/preact
+## 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.2.1
### Patch Changes
diff --git a/packages/integrations/preact/package.json b/packages/integrations/preact/package.json
index 9efc7d2c5..f1a5f08f4 100644
--- a/packages/integrations/preact/package.json
+++ b/packages/integrations/preact/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/preact",
"description": "Use Preact components within Astro",
- "version": "2.2.1",
+ "version": "3.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -50,6 +50,6 @@
"preact": "^10.6.5"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/preact/tsconfig.json b/packages/integrations/preact/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/preact/tsconfig.json
+++ b/packages/integrations/preact/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/prefetch/CHANGELOG.md b/packages/integrations/prefetch/CHANGELOG.md
index 959c28677..7aa303e38 100644
--- a/packages/integrations/prefetch/CHANGELOG.md
+++ b/packages/integrations/prefetch/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/prefetch
+## 0.4.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.3.0
### Minor Changes
diff --git a/packages/integrations/prefetch/package.json b/packages/integrations/prefetch/package.json
index 1a1a9258b..0261ef8d3 100644
--- a/packages/integrations/prefetch/package.json
+++ b/packages/integrations/prefetch/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/prefetch",
"description": "Prefetch page navigations in your Astro site",
- "version": "0.3.0",
+ "version": "0.4.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
diff --git a/packages/integrations/prefetch/playwright.config.js b/packages/integrations/prefetch/playwright.config.js
index d9600393e..7fb92ae0c 100644
--- a/packages/integrations/prefetch/playwright.config.js
+++ b/packages/integrations/prefetch/playwright.config.js
@@ -25,7 +25,7 @@ const config = {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
- baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000',
+ baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:4321',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
diff --git a/packages/integrations/prefetch/tsconfig.json b/packages/integrations/prefetch/tsconfig.json
index 194a092ff..6457dfe8c 100644
--- a/packages/integrations/prefetch/tsconfig.json
+++ b/packages/integrations/prefetch/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md
index 268b1c8ea..9b5173098 100644
--- a/packages/integrations/react/CHANGELOG.md
+++ b/packages/integrations/react/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/react
+## 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.2.1
### Patch Changes
diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json
index fa68cd5f0..958ee5ed7 100644
--- a/packages/integrations/react/package.json
+++ b/packages/integrations/react/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/react",
"description": "Use React components within Astro",
- "version": "2.2.1",
+ "version": "3.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -62,6 +62,6 @@
"react-dom": "^17.0.2 || ^18.0.0"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/react/tsconfig.json b/packages/integrations/react/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/react/tsconfig.json
+++ b/packages/integrations/react/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/sitemap/CHANGELOG.md b/packages/integrations/sitemap/CHANGELOG.md
index d6e63254a..c6c64db1e 100644
--- a/packages/integrations/sitemap/CHANGELOG.md
+++ b/packages/integrations/sitemap/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/sitemap
+## 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.0.1
### Patch Changes
diff --git a/packages/integrations/sitemap/package.json b/packages/integrations/sitemap/package.json
index d559cfb47..583184142 100644
--- a/packages/integrations/sitemap/package.json
+++ b/packages/integrations/sitemap/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/sitemap",
"description": "Generate a sitemap for your Astro site",
- "version": "2.0.1",
+ "version": "3.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
diff --git a/packages/integrations/sitemap/tsconfig.json b/packages/integrations/sitemap/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/sitemap/tsconfig.json
+++ b/packages/integrations/sitemap/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/solid/CHANGELOG.md b/packages/integrations/solid/CHANGELOG.md
index a23dd7f7a..197286f76 100644
--- a/packages/integrations/solid/CHANGELOG.md
+++ b/packages/integrations/solid/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/solid-js
+## 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.2.0
### Minor Changes
diff --git a/packages/integrations/solid/package.json b/packages/integrations/solid/package.json
index 407b0cc73..c962e025a 100644
--- a/packages/integrations/solid/package.json
+++ b/packages/integrations/solid/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/solid-js",
- "version": "2.2.0",
+ "version": "3.0.0-beta.0",
"description": "Use Solid components within Astro",
"type": "module",
"types": "./dist/index.d.ts",
@@ -47,6 +47,6 @@
"solid-js": "^1.4.3"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/solid/tsconfig.json b/packages/integrations/solid/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/solid/tsconfig.json
+++ b/packages/integrations/solid/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md
index 4f13fe9c1..41ddb63ba 100644
--- a/packages/integrations/svelte/CHANGELOG.md
+++ b/packages/integrations/svelte/CHANGELOG.md
@@ -1,5 +1,16 @@
# @astrojs/svelte
+## 4.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.
+
+### 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)]:
+ - astro@3.0.0-beta.0
+
## 3.1.0
### Minor Changes
diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json
index 295e10054..7b03b9413 100644
--- a/packages/integrations/svelte/package.json
+++ b/packages/integrations/svelte/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/svelte",
- "version": "3.1.0",
+ "version": "4.0.0-beta.0",
"description": "Use Svelte components within Astro",
"type": "module",
"types": "./dist/index.d.ts",
@@ -48,10 +48,10 @@
"vite": "^4.4.6"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3",
+ "astro": "workspace:^3.0.0-beta.0",
"svelte": "^3.55.0 || ^4.0.0"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/svelte/tsconfig.json b/packages/integrations/svelte/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/svelte/tsconfig.json
+++ b/packages/integrations/svelte/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/tailwind/CHANGELOG.md b/packages/integrations/tailwind/CHANGELOG.md
index fa55606bc..f9441ba1b 100644
--- a/packages/integrations/tailwind/CHANGELOG.md
+++ b/packages/integrations/tailwind/CHANGELOG.md
@@ -1,5 +1,16 @@
# @astrojs/tailwind
+## 5.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.
+
+### 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)]:
+ - astro@3.0.0-beta.0
+
## 4.0.0
### Major Changes
diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json
index bb643eced..7e678bb80 100644
--- a/packages/integrations/tailwind/package.json
+++ b/packages/integrations/tailwind/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/tailwind",
"description": "Use Tailwind CSS to style your Astro site",
- "version": "4.0.0",
+ "version": "5.0.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
@@ -43,7 +43,7 @@
"vite": "^4.4.6"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3",
+ "astro": "workspace:^3.0.0-beta.0",
"tailwindcss": "^3.0.24"
}
}
diff --git a/packages/integrations/tailwind/tsconfig.json b/packages/integrations/tailwind/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/tailwind/tsconfig.json
+++ b/packages/integrations/tailwind/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/turbolinks/CHANGELOG.md b/packages/integrations/turbolinks/CHANGELOG.md
index e9bd6a75a..f9a5a870e 100644
--- a/packages/integrations/turbolinks/CHANGELOG.md
+++ b/packages/integrations/turbolinks/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/turbolinks
+## 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.2
### Patch Changes
diff --git a/packages/integrations/turbolinks/package.json b/packages/integrations/turbolinks/package.json
index 067b8de28..b80bd8f80 100644
--- a/packages/integrations/turbolinks/package.json
+++ b/packages/integrations/turbolinks/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/turbolinks",
"description": "Deprecated — Use Turbolinks to speed up page navigation in your Astro site",
- "version": "0.2.2",
+ "version": "0.3.0-beta.0",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
diff --git a/packages/integrations/turbolinks/tsconfig.json b/packages/integrations/turbolinks/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/turbolinks/tsconfig.json
+++ b/packages/integrations/turbolinks/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md
index 899005dc0..ebc411bcd 100644
--- a/packages/integrations/vercel/CHANGELOG.md
+++ b/packages/integrations/vercel/CHANGELOG.md
@@ -1,5 +1,81 @@
# @astrojs/vercel
+## 4.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.
+
+- [`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
+
+- [`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.
+
+### 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,
+ },
+ },
+ };
+ }
+ ```
+
+- [`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
+ }),
+ });
+ ```
+
+### 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)]:
+ - astro@3.0.0-beta.0
+ - @astrojs/internal-helpers@0.2.0-beta.0
+
## 3.8.0
### Minor Changes
diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json
index e18f4452c..3c13c8a98 100644
--- a/packages/integrations/vercel/package.json
+++ b/packages/integrations/vercel/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/vercel",
"description": "Deploy your site to Vercel",
- "version": "3.8.0",
+ "version": "4.0.0-beta.0",
"type": "module",
"author": "withastro",
"license": "MIT",
@@ -51,17 +51,16 @@
"test:hosted": "mocha --exit --timeout 30000 test/hosted"
},
"dependencies": {
- "@astrojs/internal-helpers": "^0.1.2",
- "@astrojs/webapi": "^2.2.0",
+ "@astrojs/internal-helpers": "workspace:*",
"@vercel/analytics": "^0.1.11",
"@vercel/nft": "^0.22.6",
- "esbuild": "^0.17.19",
+ "esbuild": "^0.18.16",
"fast-glob": "^3.2.12",
"set-cookie-parser": "^2.6.0",
"web-vitals": "^3.3.2"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3"
+ "astro": "workspace:^3.0.0-beta.0"
},
"devDependencies": {
"@types/set-cookie-parser": "^2.4.2",
diff --git a/packages/integrations/vercel/src/edge/adapter.ts b/packages/integrations/vercel/src/edge/adapter.ts
index b83c9f2b7..b613f502c 100644
--- a/packages/integrations/vercel/src/edge/adapter.ts
+++ b/packages/integrations/vercel/src/edge/adapter.ts
@@ -27,6 +27,16 @@ function getAdapter(): AstroAdapter {
name: PACKAGE_NAME,
serverEntrypoint: `${PACKAGE_NAME}/entrypoint`,
exports: ['default'],
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'stable',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: false,
+ isSquooshCompatible: false,
+ },
+ },
};
}
diff --git a/packages/integrations/vercel/src/image/dev-service.ts b/packages/integrations/vercel/src/image/dev-service.ts
index 04df9932a..d812efb93 100644
--- a/packages/integrations/vercel/src/image/dev-service.ts
+++ b/packages/integrations/vercel/src/image/dev-service.ts
@@ -1,5 +1,4 @@
import type { LocalImageService } from 'astro';
-// @ts-expect-error
import squooshService from 'astro/assets/services/squoosh';
import { sharedValidateOptions } from './shared';
@@ -14,7 +13,9 @@ const service: LocalImageService = {
props.width = inputtedWidth;
}
- return squooshService.getHTMLAttributes(props, serviceOptions);
+ return squooshService.getHTMLAttributes
+ ? squooshService.getHTMLAttributes(props, serviceOptions)
+ : {};
},
getURL(options) {
const fileSrc = typeof options.src === 'string' ? options.src : options.src.src;
diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts
index 1a2f9d82a..9a8ead137 100644
--- a/packages/integrations/vercel/src/serverless/adapter.ts
+++ b/packages/integrations/vercel/src/serverless/adapter.ts
@@ -29,11 +29,31 @@ const SUPPORTED_NODE_VERSIONS: Record<
18: { status: 'current' },
};
-function getAdapter(): AstroAdapter {
+function getAdapter({
+ edgeMiddleware,
+ functionPerRoute,
+}: {
+ edgeMiddleware: boolean;
+ functionPerRoute: boolean;
+}): AstroAdapter {
return {
name: PACKAGE_NAME,
serverEntrypoint: `${PACKAGE_NAME}/entrypoint`,
exports: ['default'],
+ adapterFeatures: {
+ edgeMiddleware,
+ functionPerRoute,
+ },
+ supportedAstroFeatures: {
+ hybridOutput: 'stable',
+ staticOutput: 'stable',
+ serverOutput: 'stable',
+ assets: {
+ supportKind: 'stable',
+ isSharpCompatible: true,
+ isSquooshCompatible: true,
+ },
+ },
};
}
@@ -43,6 +63,8 @@ export interface VercelServerlessConfig {
analytics?: boolean;
imageService?: boolean;
imagesConfig?: VercelImageConfig;
+ edgeMiddleware?: boolean;
+ functionPerRoute?: boolean;
}
export default function vercelServerless({
@@ -51,6 +73,8 @@ export default function vercelServerless({
analytics,
imageService,
imagesConfig,
+ functionPerRoute = false,
+ edgeMiddleware = false,
}: VercelServerlessConfig = {}): AstroIntegration {
let _config: AstroConfig;
let buildTempFolder: URL;
@@ -112,7 +136,7 @@ export default function vercelServerless({
},
'astro:config:done': ({ setAdapter, config }) => {
throwIfAssetsNotEnabled(config, imageService);
- setAdapter(getAdapter());
+ setAdapter(getAdapter({ functionPerRoute, edgeMiddleware }));
_config = config;
buildTempFolder = config.build.server;
serverEntry = config.build.serverEntry;
diff --git a/packages/integrations/vercel/src/serverless/entrypoint.ts b/packages/integrations/vercel/src/serverless/entrypoint.ts
index 9e3cb1da0..f132d71f3 100644
--- a/packages/integrations/vercel/src/serverless/entrypoint.ts
+++ b/packages/integrations/vercel/src/serverless/entrypoint.ts
@@ -1,14 +1,12 @@
-import { polyfill } from '@astrojs/webapi';
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
+import { applyPolyfills } from 'astro/app/node';
import type { IncomingMessage, ServerResponse } from 'node:http';
import { ASTRO_LOCALS_HEADER } from './adapter';
import { getRequest, setResponse } from './request-transform';
-polyfill(globalThis, {
- exclude: 'window document',
-});
+applyPolyfills();
export const createExports = (manifest: SSRManifest) => {
const app = new App(manifest);
diff --git a/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs b/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs
index 664b64d56..6e2e304d9 100644
--- a/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs
+++ b/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs
@@ -2,5 +2,7 @@ import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';
export default defineConfig({
- adapter: vercel()
+ adapter: vercel({
+ functionPerRoute: true
+ })
});
diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs b/packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs
new file mode 100644
index 000000000..fefc69a83
--- /dev/null
+++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs
@@ -0,0 +1,9 @@
+import { defineConfig } from 'astro/config';
+import vercel from '@astrojs/vercel/serverless';
+
+export default defineConfig({
+ adapter: vercel({
+ functionPerRoute: true
+ }),
+ output: "server"
+});
diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/package.json b/packages/integrations/vercel/test/fixtures/functionPerRoute/package.json
new file mode 100644
index 000000000..e33f178bb
--- /dev/null
+++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "@test/astro-vercel-function-per-route",
+ "version": "0.0.0",
+ "private": true,
+ "dependencies": {
+ "@astrojs/vercel": "workspace:*",
+ "astro": "workspace:*"
+ }
+}
diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro
new file mode 100644
index 000000000..0c7fb90a7
--- /dev/null
+++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>One</title>
+ </head>
+ <body>
+ <h1>One</h1>
+ </body>
+</html>
diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro
new file mode 100644
index 000000000..e7ba9910e
--- /dev/null
+++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>Two</title>
+ </head>
+ <body>
+ <h1>Two</h1>
+ </body>
+</html>
diff --git a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs
index 321a8bde3..33910b50a 100644
--- a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs
+++ b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs
@@ -2,9 +2,8 @@ import {defineConfig} from "astro/config";
import vercel from "@astrojs/vercel/serverless";
export default defineConfig({
- adapter: vercel(),
- build: {
- excludeMiddleware: true
- },
+ adapter: vercel({
+ edgeMiddleware: true
+ }),
output: 'server'
-}); \ No newline at end of file
+});
diff --git a/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs
index 321a8bde3..33910b50a 100644
--- a/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs
+++ b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs
@@ -2,9 +2,8 @@ import {defineConfig} from "astro/config";
import vercel from "@astrojs/vercel/serverless";
export default defineConfig({
- adapter: vercel(),
- build: {
- excludeMiddleware: true
- },
+ adapter: vercel({
+ edgeMiddleware: true
+ }),
output: 'server'
-}); \ No newline at end of file
+});
diff --git a/packages/integrations/vercel/test/no-output.test.js b/packages/integrations/vercel/test/no-output.test.js
index af4d9c2b6..3894ee779 100644
--- a/packages/integrations/vercel/test/no-output.test.js
+++ b/packages/integrations/vercel/test/no-output.test.js
@@ -19,6 +19,6 @@ describe('Missing output config', () => {
error = err;
}
expect(error).to.not.be.equal(undefined);
- expect(error.message).to.include(`output: "server"`);
+ expect(error.message).to.include('output: "server"');
});
});
diff --git a/packages/integrations/vercel/test/split.test.js b/packages/integrations/vercel/test/split.test.js
index 9044954f2..85affb3ff 100644
--- a/packages/integrations/vercel/test/split.test.js
+++ b/packages/integrations/vercel/test/split.test.js
@@ -7,11 +7,8 @@ describe('build: split', () => {
before(async () => {
fixture = await loadFixture({
- root: './fixtures/basic/',
+ root: './fixtures/functionPerRoute/',
output: 'server',
- build: {
- split: true,
- },
});
await fixture.build();
});
diff --git a/packages/integrations/vercel/tsconfig.json b/packages/integrations/vercel/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/vercel/tsconfig.json
+++ b/packages/integrations/vercel/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/integrations/vue/CHANGELOG.md b/packages/integrations/vue/CHANGELOG.md
index 26e4a2803..d64508660 100644
--- a/packages/integrations/vue/CHANGELOG.md
+++ b/packages/integrations/vue/CHANGELOG.md
@@ -1,5 +1,16 @@
# @astrojs/vue
+## 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.
+
+### 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)]:
+ - astro@3.0.0-beta.0
+
## 2.2.1
### Patch Changes
diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json
index 420541b6e..716d4a743 100644
--- a/packages/integrations/vue/package.json
+++ b/packages/integrations/vue/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/vue",
- "version": "2.2.1",
+ "version": "3.0.0-beta.0",
"description": "Use Vue components within Astro",
"type": "module",
"types": "./dist/index.d.ts",
@@ -56,10 +56,10 @@
"vue": "^3.3.4"
},
"peerDependencies": {
- "astro": "workspace:^2.10.3",
+ "astro": "workspace:^3.0.0-beta.0",
"vue": "^3.2.30"
},
"engines": {
- "node": ">=16.12.0"
+ "node": ">=18.14.1"
}
}
diff --git a/packages/integrations/vue/tsconfig.json b/packages/integrations/vue/tsconfig.json
index 64d4ef454..af1b43564 100644
--- a/packages/integrations/vue/tsconfig.json
+++ b/packages/integrations/vue/tsconfig.json
@@ -5,6 +5,6 @@
"allowJs": true,
"module": "ES2022",
"outDir": "./dist",
- "target": "ES2021"
+ "target": "ES2022"
}
}
diff --git a/packages/internal-helpers/CHANGELOG.md b/packages/internal-helpers/CHANGELOG.md
index 9dc44567c..dd0b2ced5 100644
--- a/packages/internal-helpers/CHANGELOG.md
+++ b/packages/internal-helpers/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/internal-helpers
+## 0.2.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.1.2
### Patch Changes
diff --git a/packages/internal-helpers/package.json b/packages/internal-helpers/package.json
index 4035b5d8d..3c22b374c 100644
--- a/packages/internal-helpers/package.json
+++ b/packages/internal-helpers/package.json
@@ -1,7 +1,7 @@
{
"name": "@astrojs/internal-helpers",
"description": "Internal helpers used by core Astro packages.",
- "version": "0.1.2",
+ "version": "0.2.0-beta.0",
"type": "module",
"author": "withastro",
"license": "MIT",
diff --git a/packages/internal-helpers/tsconfig.json b/packages/internal-helpers/tsconfig.json
index 569016e9d..fd652e629 100644
--- a/packages/internal-helpers/tsconfig.json
+++ b/packages/internal-helpers/tsconfig.json
@@ -3,7 +3,7 @@
"include": ["src"],
"compilerOptions": {
"allowJs": true,
- "target": "ES2021",
+ "target": "ES2022",
"module": "ES2022",
"outDir": "./dist"
}
diff --git a/packages/markdown/component/CHANGELOG.md b/packages/markdown/component/CHANGELOG.md
deleted file mode 100644
index bd49bc439..000000000
--- a/packages/markdown/component/CHANGELOG.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# @astrojs/markdown-component
-
-## 1.0.5
-
-### Patch Changes
-
-- [#7343](https://github.com/withastro/astro/pull/7343) [`3d9a392a0`](https://github.com/withastro/astro/commit/3d9a392a09133aeb7a6efeb59c307f27a9b83198) Thanks [@matthewp](https://github.com/matthewp)! - Fix Markdown component error message false positive
-
-## 1.0.4
-
-### Patch Changes
-
-- [#7104](https://github.com/withastro/astro/pull/7104) [`826e02890`](https://github.com/withastro/astro/commit/826e0289005f645b902375b98d5549c6a95ccafa) Thanks [@bluwy](https://github.com/bluwy)! - Specify `"files"` field to only publish necessary files
-
-## 1.0.3
-
-### Patch Changes
-
-- [#6494](https://github.com/withastro/astro/pull/6494) [`a13e9d7e3`](https://github.com/withastro/astro/commit/a13e9d7e33baccf51e7d4815f99b481ad174bc57) Thanks [@Yan-Thomas](https://github.com/Yan-Thomas)! - Consistency improvements to several package descriptions
-
-## 1.0.2
-
-### Patch Changes
-
-- [#5281](https://github.com/withastro/astro/pull/5281) [`a558cf317`](https://github.com/withastro/astro/commit/a558cf317a98bfb79688a31ddb81c910e16e79c2) Thanks [@aleksa-codes](https://github.com/aleksa-codes)! - Update URLs in package.json
-
-## 1.0.1
-
-### Patch Changes
-
-- [#4208](https://github.com/withastro/astro/pull/4208) [`fe3b42398`](https://github.com/withastro/astro/commit/fe3b423982faa87c106e6a072bb14cb0a6678064) Thanks [@myakura](https://github.com/myakura)! - README update
-
-## 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.2.1
-
-### Patch Changes
-
-- [#4085](https://github.com/withastro/astro/pull/4085) [`c15cb3663`](https://github.com/withastro/astro/commit/c15cb36636320012c7d0c9d6ac8620029da70b0b) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix TypeScript error when importing the component
-
-## 0.2.0
-
-### Minor Changes
-
-- [#4016](https://github.com/withastro/astro/pull/4016) [`00fab4ce1`](https://github.com/withastro/astro/commit/00fab4ce135eb799cac69140403d7724686733d6) Thanks [@bholmesdev](https://github.com/bholmesdev)! - The use of components and JSX expressions in Markdown are no longer supported by default.
-
- For long term support, migrate to the `@astrojs/mdx` integration for MDX support (including `.mdx` pages!).
-
- Not ready to migrate to MDX? Add the legacy flag to your Astro config to re-enable the previous Markdown support.
-
- ```js
- // https://astro.build/config
- export default defineConfig({
- legacy: {
- astroFlavoredMarkdown: true,
- },
- });
- ```
-
-* [#3986](https://github.com/withastro/astro/pull/3986) [`bccd88f0e`](https://github.com/withastro/astro/commit/bccd88f0ebe1fbf383c0cee4b27a4c24c72dea72) Thanks [@matthewp](https://github.com/matthewp)! - Move the Markdown component to its own package
-
- This change moves the Markdown component into its own package where it will be maintained separately. All that needs to change from a user's perspective is the import statement:
-
- ```astro
-
- ```
-
- Becomes:
-
- ```astro
-
- ```
diff --git a/packages/markdown/component/Markdown.astro b/packages/markdown/component/Markdown.astro
deleted file mode 100644
index a9d095fb5..000000000
--- a/packages/markdown/component/Markdown.astro
+++ /dev/null
@@ -1,49 +0,0 @@
----
-interface Props {
- content?: string;
-}
-
-const dedent = (str: string) => {
- const _str = str.split('\n').filter(s => s.trimStart().length > 0);
- if (_str.length === 0) {
- return str.trimStart();
- }
- const trimmedSpace = _str[0].replace(_str[0].trimStart(), '');
- return str
- .split('\n')
- .map((ln) => ln.startsWith(trimmedSpace) ? ln.replace(trimmedSpace, '') : ln)
- .join('\n');
-}
-
-// Internal props that should not be part of the external interface.
-interface InternalProps extends Props {
- class: string;
- $scope: string;
-}
-
-let { content, class: className } = Astro.props as InternalProps;
-let html = null;
-let htmlContent = '';
-
-// If no content prop provided, use the slot.
-if (!content) {
- content = await Astro.slots.render('default');
- if (content !== undefined && content !== null) {
- content = dedent(content);
- }
-}
-
-if (content) {
- htmlContent = await (Astro as any).__renderMarkdown(content, {
- $: {
- scopedClassName: className,
- },
- });
-}
-
-html = htmlContent;
----
-
-<>
-{html ? <Fragment set:html={html} /> : <slot />}
-</>
diff --git a/packages/markdown/component/package.json b/packages/markdown/component/package.json
deleted file mode 100644
index b3c0fca9a..000000000
--- a/packages/markdown/component/package.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "@astrojs/markdown-component",
- "description": "Use the legacy Markdown component in your Astro site",
- "version": "1.0.5",
- "type": "module",
- "author": "withastro",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/withastro/astro.git",
- "directory": "packages/markdown/component"
- },
- "bugs": "https://github.com/withastro/astro/issues",
- "homepage": "https://docs.astro.build/en/migrate/#markdown--component-removed",
- "main": "./Markdown.astro",
- "exports": {
- ".": {
- "astro": "./Markdown.astro"
- }
- },
- "files": [
- "Markdown.astro"
- ],
- "scripts": {
- "test": "mocha --exit --timeout 20000"
- },
- "devDependencies": {
- "@types/mocha": "^9.1.1",
- "astro": "workspace:*",
- "chai": "^4.3.7",
- "cheerio": "1.0.0-rc.12",
- "github-slugger": "^1.5.0",
- "mocha": "^9.2.2",
- "rehype-autolink-headings": "^6.1.1",
- "rehype-slug": "^5.0.1",
- "rehype-toc": "^3.0.2",
- "remark-code-titles": "^0.1.2"
- },
- "keywords": [
- "astro",
- "astro-component"
- ]
-}
diff --git a/packages/markdown/component/readme.md b/packages/markdown/component/readme.md
deleted file mode 100644
index ac621c82b..000000000
--- a/packages/markdown/component/readme.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# @astrojs/markdown-component
-
-This package brings legacy support for the `<Markdown />` component to all Astro projects.
-
-> **Warning**
-> The `<Markdown />` component does not work in SSR. Consider [importing Markdown content](https://docs.astro.build/en/guides/markdown-content/#importing-markdown) instead.
-
-```astro
----
-import Markdown from '@astrojs/markdown-component';
----
-
-<Markdown># Markdown syntax is now supported! **Yay!**</Markdown>
-```
-
-See our [Markdown Guide](https://docs.astro.build/en/guides/markdown-content/) for more info.
diff --git a/packages/markdown/component/test/astro-markdown-plugins.test.js b/packages/markdown/component/test/astro-markdown-plugins.test.js
deleted file mode 100644
index c748d81c9..000000000
--- a/packages/markdown/component/test/astro-markdown-plugins.test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import { expect } from 'chai';
-import * as cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
-import addClasses from './fixtures/astro-markdown-plugins/add-classes.mjs';
-
-describe('Astro Markdown plugins', () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({
- root: './fixtures/astro-markdown-plugins/',
- markdown: {
- remarkPlugins: [
- 'remark-code-titles',
- ['rehype-autolink-headings', { behavior: 'prepend' }],
- ],
- rehypePlugins: [
- 'rehype-slug',
- ['rehype-toc', { headings: ['h2', 'h3'] }],
- [addClasses, { 'h1,h2,h3': 'title' }],
- ],
- },
- });
- await fixture.build();
- });
-
- it('Can render Astro <Markdown> with plugins', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- // test 1: Added a TOC
- expect($('.toc')).to.have.lengthOf(1);
-
- // teste 2: Added .title to h1
- expect($('#hello-world').hasClass('title')).to.equal(true);
- });
-});
diff --git a/packages/markdown/component/test/astro-markdown-shiki.test.js b/packages/markdown/component/test/astro-markdown-shiki.test.js
deleted file mode 100644
index 580552770..000000000
--- a/packages/markdown/component/test/astro-markdown-shiki.test.js
+++ /dev/null
@@ -1,147 +0,0 @@
-import { expect } from 'chai';
-import * as cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
-
-describe('Astro Markdown Shiki', () => {
- describe('Render shiki', () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/normal/' });
- await fixture.build();
- });
-
- it('Can render Astro <Markdown> with shiki', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- // There should be no HTML from Prism
- expect($('.token')).to.have.lengthOf(0);
-
- expect($('pre')).to.have.lengthOf(2);
-
- expect($('span.line')).to.have.lengthOf(2);
- expect($('span.line').get(0).children).to.have.lengthOf(1);
- expect($('span.line').get(1).children).to.have.lengthOf(5);
- });
- });
-
- describe('Themes', () => {
- describe('Integrated theme', async () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/themes-integrated/' });
- await fixture.build();
- });
-
- it('<Markdown /> component', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- expect($('pre')).to.have.lengthOf(1);
- expect($('pre').hasClass('astro-code')).to.equal(true);
- expect($('pre').attr().style).to.equal('background-color: #fff; overflow-x: auto;');
- });
- });
-
- describe('Custom theme', async () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/themes-custom/' });
- await fixture.build();
- });
-
- it('<Markdown /> component', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- expect($('pre')).to.have.lengthOf(1);
- expect($('pre').hasClass('astro-code')).to.equal(true);
- expect($('pre').attr().style).to.equal('background-color: #FDFDFE; overflow-x: auto;');
- });
- });
- });
-
- describe('Custom langs', () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/langs/' });
- await fixture.build();
- });
-
- it('<Markdown /> component', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- const segments = $('.line').get(6).children;
- expect(segments).to.have.lengthOf(3);
- expect(segments[0].attribs.style).to.be.equal('color: #E1E4E8');
- expect(segments[1].attribs.style).to.be.equal('color: #79B8FF');
-
- const unknownLang = $('.line').last().html();
- expect(unknownLang).to.be.equal(
- '<span style="color: #e1e4e8">This language does not exist</span>'
- );
- });
- });
-
- describe('Wrap', () => {
- describe('wrap = true', () => {
- const style =
- 'background-color: #24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;';
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/wrap-true/' });
- await fixture.build();
- });
-
- it('<Markdown /> component', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- expect($('pre').get(0).attribs.style).to.equal(style);
- expect($('pre').get(1).attribs.style).to.equal(style);
- });
- });
- });
-
- describe('wrap = false', () => {
- const style = 'background-color: #24292e; overflow-x: auto;';
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/wrap-false/' });
- await fixture.build();
- });
-
- it('<Markdown /> component', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- expect($('pre').get(0).attribs.style).to.equal(style);
- expect($('pre').get(1).attribs.style).to.equal(style);
- });
- });
-
- describe('wrap = null', () => {
- const style = 'background-color: #24292e';
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({ root: './fixtures/astro-markdown-shiki/wrap-null/' });
- await fixture.build();
- });
-
- it('<Markdown /> component', async () => {
- const html = await fixture.readFile('/astro/index.html');
- const $ = cheerio.load(html);
-
- expect($('pre').get(0).attribs.style).to.equal(style);
- expect($('pre').get(1).attribs.style).to.equal(style);
- });
- });
-});
diff --git a/packages/markdown/component/test/astro-markdown.test.js b/packages/markdown/component/test/astro-markdown.test.js
deleted file mode 100644
index 72546802f..000000000
--- a/packages/markdown/component/test/astro-markdown.test.js
+++ /dev/null
@@ -1,244 +0,0 @@
-import { expect } from 'chai';
-import * as cheerio from 'cheerio';
-import { loadFixture } from './test-utils.js';
-
-describe('Astro Markdown', () => {
- let fixture;
-
- before(async () => {
- fixture = await loadFixture({
- root: './fixtures/astro-markdown/',
- });
- await fixture.build();
- });
-
- // NOTE: This test uses legacy markdown, which requires `github-slugger` to be installed.
- // This breaks in strict dependency installation, but since it's a legacy feature, ignore for now.
- it('Can load markdown pages with Astro', async () => {
- const html = await fixture.readFile('/post/index.html');
- const $ = cheerio.load(html);
-
- // test 1: There is a div added in markdown
- expect($('#first').length).to.be.ok;
-
- // test 2: There is a div added via a component from markdown
- expect($('#test').length).to.be.ok;
- });
-
- it('Can handle code elements without extra spacing', async () => {
- const html = await fixture.readFile('/code-element/index.html');
- const $ = cheerio.load(html);
-
- $('code').each((_, el) => {
- expect($(el).html()).to.equal($(el).html().trim());
- });
- });
-
- it('Correctly handles component children in markdown pages (#3319)', async () => {
- const html = await fixture.readFile('/children/index.html');
-
- expect(html).not.to.contain('<p></p>');
- });
-
- it('Can handle HTML comments in markdown pages', async () => {
- const html = await fixture.readFile('/comment/index.html');
- const $ = cheerio.load(html);
-
- expect($('h1').text()).to.equal('It works!');
- });
-
- it('Prevents `*/` sequences from breaking HTML comments (#3476)', async () => {
- const html = await fixture.readFile('/comment-with-js/index.html');
- const $ = cheerio.load(html);
-
- expect($('h1').text()).to.equal('It still works!');
- });
-
- it('Can handle HTML comments in inline code', async () => {
- const html = await fixture.readFile('/comment-with-js/index.html');
- const $ = cheerio.load(html);
-
- expect($('p code').text()).to.equal('<!-- HTML comments in code -->');
- });
-
- it('Can handle HTML comments in code fences', async () => {
- const html = await fixture.readFile('/comment-with-js/index.html');
- const $ = cheerio.load(html);
-
- expect($('pre > code').text()).to.equal('<!-- HTML comments in code fence -->');
- });
-
- it('Can load more complex jsxy stuff', async () => {
- const html = await fixture.readFile('/complex/index.html');
- const $ = cheerio.load(html);
-
- expect($('#test').text()).to.equal('Hello world');
- });
-
- it('Empty code blocks do not fail', async () => {
- const html = await fixture.readFile('/empty-code/index.html');
- const $ = cheerio.load(html);
-
- // test 1: There is not a `<code>` in the codeblock
- expect($('pre')[0].children).to.have.lengthOf(1);
-
- // test 2: The empty `<pre>` failed to render
- expect($('pre')[1].children).to.have.lengthOf(0);
- });
-
- it('Runs code blocks through syntax highlighter', async () => {
- const html = await fixture.readFile('/code/index.html');
- const $ = cheerio.load(html);
-
- // test 1: There are child spans in code blocks
- expect($('code span').length).greaterThan(0);
- });
-
- it('Scoped styles should not break syntax highlight', async () => {
- const html = await fixture.readFile('/scopedStyles-code/index.html');
- const $ = cheerio.load(html);
-
- // test 1: <pre> tag has correct shiki class
- expect($('pre').hasClass('astro-code')).to.equal(true);
-
- // test 2: inline styles are still applied
- expect($('pre').is('[style]')).to.equal(true);
-
- // test 3: There are styled child spans in code blocks
- expect($('pre code span').length).to.be.greaterThan(0);
- expect($('pre code span').is('[style]')).to.equal(true);
- });
-
- function isAstroScopedClass(cls) {
- return /^astro-.*/.test(cls);
- }
-
- it('Scoped styles should be applied to syntax highlighted lines', async () => {
- const html = await fixture.readFile('/scopedStyles-code/index.html');
- const $ = cheerio.load(html);
-
- // test 1: the "pre" tag receives scoped style
- const preClassList = $('pre').attr('class').split(/\s+/);
- expect(preClassList.length).to.equal(3);
- const preAstroClass = preClassList.find(isAstroScopedClass);
- expect(Boolean(preAstroClass)).to.equal(true);
-
- // test 2: each "span" line receives scoped style
- const spanClassList = $('pre code span').attr('class').split(/\s+/);
- expect(spanClassList.length).to.equal(2);
- const spanAstroClass = spanClassList.find(isAstroScopedClass);
- expect(Boolean(spanAstroClass)).to.equal(true);
- });
-
- it('Renders correctly when deeply nested on a page', async () => {
- const html = await fixture.readFile('/deep/index.html');
- const $ = cheerio.load(html);
-
- // test 1: Rendered all children
- expect($('#deep').children()).to.have.lengthOf(3);
-
- // tests 2–4: Only rendered title in each section
- expect($('.a').children()).to.have.lengthOf(1);
- expect($('.b').children()).to.have.lengthOf(1);
- expect($('.c').children()).to.have.lengthOf(1);
-
- // test 5–7: Rendered title in correct section
- expect($('.a > h2').text()).to.equal('A');
- expect($('.b > h2').text()).to.equal('B');
- expect($('.c > h2').text()).to.equal('C');
- });
-
- it('Renders dynamic content though the content attribute', async () => {
- const html = await fixture.readFile('/external/index.html');
- const $ = cheerio.load(html);
-
- // test 1: Rendered markdown content
- expect($('#outer')).to.have.lengthOf(1);
-
- // test 2: Nested markdown content
- expect($('#inner')).to.have.lengthOf(1);
-
- // test 3: Scoped class passed down
- expect($('#inner').is('[class]')).to.equal(true);
- });
-
- it('Renders curly braces correctly', async () => {
- const html = await fixture.readFile('/braces/index.html');
- const $ = cheerio.load(html);
-
- // test 1: Rendered curly braces markdown content
- expect($('code')).to.have.lengthOf(3);
-
- // test 2: Rendered curly braces markdown content
- expect($('code:first-child').text()).to.equal('({})');
-
- // test 3: Rendered curly braces markdown content
- expect($('code:nth-child(2)').text()).to.equal('{...props}');
-
- // test 4: Rendered curly braces markdown content
- expect($('code:last-child').text()).to.equal('{/* JavaScript */}');
- });
-
- it('Does not close parent early when using content attribute (#494)', async () => {
- const html = await fixture.readFile('/close/index.html');
- const $ = cheerio.load(html);
-
- // test <Markdown content /> closed div#target early
- expect($('#target').children()).to.have.lengthOf(2);
- });
-
- it('Can render markdown with --- for horizontal rule', async () => {
- const html = await fixture.readFile('/dash/index.html');
- expect(!!html).to.equal(true);
- });
-
- it('Can render markdown content prop (#1259)', async () => {
- const html = await fixture.readFile('/content/index.html');
- const $ = cheerio.load(html);
-
- // test Markdown rendered correctly via content prop
- expect($('h1').text()).to.equal('Foo');
- });
-
- it("doesn't occurs TypeError when no elements", async () => {
- const html = await fixture.readFile('/no-elements/index.html');
- // render html without error
- expect(html).to.be.ok;
- });
-
- it('can render nested list correctly', async () => {
- const html = await fixture.readFile('/nested-list/index.html');
- const $ = cheerio.load(html);
- /**
- * - list
- * - list
- */
- expect($('#target > ul > li').children()).to.have.lengthOf(1);
- expect($('#target > ul > li > ul > li').text()).to.equal('nested list');
- /**
- * 1. Hello
- * 1. nested hello
- */
- expect($('#target > ol > li').children()).to.have.lengthOf(1);
- expect($('#target > ol > li > ol > li').text()).to.equal('nested hello');
- });
-
- it('Escapes HTML tags in code blocks', async () => {
- const html = await fixture.readFile('/code-in-md/index.html');
- const $ = cheerio.load(html);
-
- expect($('code').eq(0).html()).to.equal('&lt;script&gt;');
- expect($('blockquote').length).to.equal(1);
- expect($('code').eq(1).html()).to.equal('&lt;/script&gt;');
- expect($('pre').html()).to.contain('&gt;This should also work without any problems.&lt;');
- });
-
- it('Generate the right props for the layout', async () => {
- const html = await fixture.readFile('/layout-props/index.html');
- const $ = cheerio.load(html);
-
- expect($('#title').text()).to.equal('Hello world!');
- expect($('#url').text()).to.equal('/layout-props');
- expect($('#file').text()).to.match(/.*\/layout-props.md$/);
- });
-});
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-plugins/add-classes.mjs b/packages/markdown/component/test/fixtures/astro-markdown-plugins/add-classes.mjs
deleted file mode 100644
index 39acabd52..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-plugins/add-classes.mjs
+++ /dev/null
@@ -1,18 +0,0 @@
-import { selectAll } from 'hast-util-select';
-
-export default (additions) => {
- const adders = Object.entries(additions).map(adder);
- return (node) => adders.forEach((a) => a(node));
-};
-
-const adder = ([selector, className]) => {
- const writer = write(className);
- return (node) => selectAll(selector, node).forEach(writer);
-};
-
-const write =
- (className) =>
- ({ properties }) => {
- if (!properties.className) properties.className = className;
- else properties.className += ` ${className}`;
- };
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-plugins/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-plugins/astro.config.mjs
deleted file mode 100644
index 08916b1fe..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-plugins/astro.config.mjs
+++ /dev/null
@@ -1,7 +0,0 @@
-import { defineConfig } from 'astro/config';
-import preact from '@astrojs/preact';
-
-// https://astro.build/config
-export default defineConfig({
- integrations: [preact()],
-});
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-plugins/package.json b/packages/markdown/component/test/fixtures/astro-markdown-plugins/package.json
deleted file mode 100644
index 61cfbc161..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-plugins/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-component-plugins",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "@astrojs/markdown-component": "workspace:*",
- "@astrojs/preact": "workspace:*",
- "astro": "workspace:*",
- "hast-util-select": "^5.0.2",
- "preact": "^10.15.1",
- "rehype-slug": "^5.0.1"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-plugins/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-plugins/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-plugins/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-plugins/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-plugins/src/pages/astro.astro
deleted file mode 100644
index f039638e4..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-plugins/src/pages/astro.astro
+++ /dev/null
@@ -1,10 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/astro.config.mjs
deleted file mode 100644
index 130596b0c..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/astro.config.mjs
+++ /dev/null
@@ -1,19 +0,0 @@
-const riGrammar = JSON.parse(
- String.raw`{"name":"rinfo","patterns":[{"include":"#lf-rinfo"}],"repository":{"lf-rinfo":{"patterns":[{"include":"#control"},{"include":"#operator"},{"include":"#strings"},{"include":"#number"},{"include":"#comment"},{"include":"#literal"}]},"control":{"patterns":[{"name":"keyword.control.ri","match":"\\b(si|mientras|repetir)\\b"},{"name":"keyword.other.ri","match":"\\b(programa|robots|areas|variables|comenzar|fin)\\b"},{"name":"support.function.other.ri","match":"\\b(tomarFlor|HayFlorEnLaBolsa|HayFlorEnLaEsquina|depositarFlor|HayPapelEnLaBolsa|HayPapelEnLaEsquina|tomarPapel|depositarPapel)\\b"}]},"operator":{"comment":"Captures operators and also puts them in different sub-groups that further describe them","patterns":[{"match":"\\+|-|\\*|/","name":"keyword.operator.arithmetic.ri"},{"match":"<|>|<=|>=|=|<>|!=","name":"keyword.operator.comparison.ri"},{"match":"\\b(Pos|Informar|Leer|Iniciar|AsignarArea|AreaC)\\b","name":"support.function.arithmetic.ri"},{"match":":=","name":"keyword.operator.assign.ri"},{"match":"(&|~)","name":"support.function.logical.ri"}]},"strings":{"name":"string.quoted.double.ri","beginCaptures":{"0":{"name":"string.quoted.double.begin.ri"}},"endCaptures":{"0":{"name":"string.quoted.double.end.ri"}},"begin":"\"","end":"\"","patterns":[{"name":"constant.character.escape.ri","match":"\\\\."}]},"comment":{"patterns":[{"name":"comment.block.ri","begin":"{","end":"}","patterns":[{"include":"#comment"}]}]},"literal":{"patterns":[{"name":"constant.language.ri","match":"\\b(verdadero|falso|boolean|numero)\\b"}]},"number":{"patterns":[{"comment":"Captures decimal numbers, with the negative sign being considered an operator","match":"(-)?(?:((?:\\b\\d+(?:\\.\\d*)?|\\.\\d+)(?:\\b|e-?\\d+\\b)%?)|(\\$[0-9]+\\b))","captures":{"1":{"name":"keyword.operator.arithmetic.ri"},"2":{"name":"constant.numeric.decimal.ri"},"3":{"name":"constant.numeric.hex.ri"}}}]}},"scopeName":"source.rinfo"}`
-);
-
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- shikiConfig: {
- langs: [
- {
- id: 'rinfo',
- scopeName: 'source.rinfo',
- grammar: riGrammar,
- aliases: ['ri'],
- },
- ],
- },
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/package.json
deleted file mode 100644
index 98e1b2806..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-langs",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/pages/astro.astro
deleted file mode 100644
index 68b22b7e8..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/langs/src/pages/astro.astro
+++ /dev/null
@@ -1,31 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```rinfo
- programa Rinfo
- areas
- ciuadad: AreaC(1,1,100,100)
- robots
- robot robot1
- comenzar
- Informar(PosAv, PosCa)
- fin
- variables
- Rinfo: robot1
- comenzar
- AsignarArea(Rinfo, ciudad)
- Iniciar(Rinfo, 1, 1)
- fin
- ```
-
- ```unknown
- This language does not exist
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/astro.config.mjs
deleted file mode 100644
index acd4c5abc..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/astro.config.mjs
+++ /dev/null
@@ -1,5 +0,0 @@
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/package.json
deleted file mode 100644
index 21082f4ee..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-normal",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/pages/astro.astro
deleted file mode 100644
index 473b21dc1..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/normal/src/pages/astro.astro
+++ /dev/null
@@ -1,18 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```
- plaintext
- ```
-
- ```js
- console.log('JavaScript')
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/package.json
deleted file mode 100644
index e25b78c20..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-component-shiki",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/astro.config.mjs
deleted file mode 100644
index 23617bbf4..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/astro.config.mjs
+++ /dev/null
@@ -1,10 +0,0 @@
-const serendipity = JSON.parse(
- String.raw`{"name":"Serendipity Morning","type":"light","colors":{"activityBar.activeBorder":"#4E5377","activityBar.background":"#FDFDFE","activityBar.dropBorder":"#D8DAE4","activityBar.foreground":"#4E5377","activityBar.inactiveForeground":"#5F6488","activityBarBadge.background":"#F19A8E","activityBarBadge.foreground":"#FDFDFE","badge.background":"#F19A8E","badge.foreground":"#FDFDFE","banner.background":"#F1F1F4","banner.foreground":"#4E5377","banner.iconForeground":"#5F6488","breadcrumb.activeSelectionForeground":"#F19A8E","breadcrumb.background":"#FDFDFE","breadcrumb.focusForeground":"#5F6488","breadcrumb.foreground":"#8388AD","breadcrumbPicker.background":"#F1F1F4","button.background":"#F19A8E","button.foreground":"#FDFDFE","button.hoverBackground":"#F19A8Ee6","button.secondaryBackground":"#F1F1F4","button.secondaryForeground":"#4E5377","button.secondaryHoverBackground":"#D8DAE4","charts.lines":"#5F6488","charts.foreground":"#4E5377","charts.blue":"#7397DE","charts.green":"#3788BE","charts.orange":"#F19A8E","charts.purple":"#77AAB3","charts.red":"#D26A5D","charts.yellow":"#886CDB","checkbox.background":"#F1F1F4","checkbox.border":"#6e6a8614","checkbox.foreground":"#4E5377","debugExceptionWidget.background":"#F1F1F4","debugExceptionWidget.border":"#6e6a8614","debugIcon.breakpointCurrentStackframeForeground":"#5F6488","debugIcon.breakpointDisabledForeground":"#5F6488","debugIcon.breakpointForeground":"#5F6488","debugIcon.breakpointStackframeForeground":"#5F6488","debugIcon.breakpointUnverifiedForeground":"#5F6488","debugIcon.continueForeground":"#5F6488","debugIcon.disconnectForeground":"#5F6488","debugIcon.pauseForeground":"#5F6488","debugIcon.restartForeground":"#5F6488","debugIcon.startForeground":"#5F6488","debugIcon.stepBackForeground":"#5F6488","debugIcon.stepIntoForeground":"#5F6488","debugIcon.stepOutForeground":"#5F6488","debugIcon.stepOverForeground":"#5F6488","debugIcon.stopForeground":"#D26A5D","debugToolBar.background":"#F1F1F4","debugToolBar.border":"#D8DAE4","descriptionForeground":"#5F6488","diffEditor.border":"#D8DAE4","diffEditor.diagonalFill":"#6e6a8626","diffEditor.insertedTextBackground":"#7397DE14","diffEditor.insertedTextBorder":"#7397DE80","diffEditor.removedTextBackground":"#D26A5D14","diffEditor.removedTextBorder":"#D26A5D80","dropdown.background":"#F1F1F4","dropdown.border":"#6e6a8614","dropdown.foreground":"#4E5377","dropdown.listBackground":"#F1F1F4","editor.background":"#FDFDFE","editor.findMatchBackground":"#6e6a8626","editor.findMatchHighlightBackground":"#6e6a8626","editor.findRangeHighlightBackground":"#6e6a8626","editor.findRangeHighlightBorder":"#0000","editor.focusedStackFrameHighlightBackground":"#6e6a8614","editor.foldBackground":"#F1F1F4","editor.foreground":"#4E5377","editor.hoverHighlightBackground":"#0000","editor.inactiveSelectionBackground":"#6e6a860d","editor.inlineValuesBackground":"#0000","editor.inlineValuesForeground":"#5F6488","editor.lineHighlightBackground":"#6e6a860d","editor.lineHighlightBorder":"#0000","editor.linkedEditingBackground":"#F1F1F4","editor.rangeHighlightBackground":"#6e6a860d","editor.rangeHighlightBorder":"#0000","editor.selectionBackground":"#6e6a8614","editor.selectionForeground":"#4E5377","editor.selectionHighlightBackground":"#6e6a8614","editor.selectionHighlightBorder":"#0000","editor.snippetFinalTabstopHighlightBackground":"#6e6a8614","editor.snippetFinalTabstopHighlightBorder":"#F1F1F4","editor.snippetTabstopHighlightBackground":"#6e6a8614","editor.snippetTabstopHighlightBorder":"#F1F1F4","editor.stackFrameHighlightBackground":"#6e6a8614","editor.symbolHighlightBackground":"#6e6a8614","editor.symbolHighlightBorder":"#0000","editor.wordHighlightBackground":"#6e6a8614","editor.wordHighlightBorder":"#0000","editor.wordHighlightStrongBackground":"#6e6a8614","editor.wordHighlightStrongBorder":"#6e6a8614","editorBracketHighlight.foreground1":"#D26A5D80","editorBracketHighlight.foreground2":"#3788BE80","editorBracketHighlight.foreground3":"#886CDB80","editorBracketHighlight.foreground4":"#7397DE80","editorBracketHighlight.foreground5":"#F19A8E80","editorBracketHighlight.foreground6":"#77AAB380","editorBracketMatch.background":"#0000","editorBracketMatch.border":"#5F6488","editorBracketPairGuide.activeBackground1":"#3788BE","editorBracketPairGuide.activeBackground2":"#F19A8E","editorBracketPairGuide.activeBackground3":"#77AAB3","editorBracketPairGuide.activeBackground4":"#7397DE","editorBracketPairGuide.activeBackground5":"#886CDB","editorBracketPairGuide.activeBackground6":"#D26A5D","editorBracketPairGuide.background1":"#3788BE80","editorBracketPairGuide.background2":"#F19A8E80","editorBracketPairGuide.background3":"#77AAB380","editorBracketPairGuide.background4":"#7397DE80","editorBracketPairGuide.background5":"#886CDB80","editorBracketPairGuide.background6":"#D26A5D80","editorCodeLens.foreground":"#F19A8E","editorCursor.background":"#4E5377","editorCursor.foreground":"#8388AD","editorError.border":"#0000","editorError.foreground":"#D26A5D","editorGhostText.foreground":"#5F6488","editorGroup.border":"#0000","editorGroup.dropBackground":"#F1F1F4","editorGroup.emptyBackground":"#0000","editorGroup.focusedEmptyBorder":"#0000","editorGroupHeader.noTabsBackground":"#0000","editorGroupHeader.tabsBackground":"#0000","editorGroupHeader.tabsBorder":"#0000","editorGutter.addedBackground":"#7397DE","editorGutter.background":"#0000","editorGutter.commentRangeForeground":"#5F6488","editorGutter.deletedBackground":"#D26A5D","editorGutter.foldingControlForeground":"#77AAB3","editorGutter.modifiedBackground":"#F19A8E","editorHint.border":"#0000","editorHint.foreground":"#5F6488","editorHoverWidget.background":"#F1F1F4","editorHoverWidget.border":"#8388AD80","editorHoverWidget.foreground":"#5F6488","editorHoverWidget.highlightForeground":"#4E5377","editorHoverWidget.statusBarBackground":"#0000","editorIndentGuide.activeBackground":"#8388AD","editorIndentGuide.background":"#6e6a8626","editorInfo.border":"#D8DAE4","editorInfo.foreground":"#7397DE","editorInlayHint.background":"#D8DAE4","editorInlayHint.foreground":"#5F6488","editorInlayHint.parameterBackground":"#D8DAE4","editorInlayHint.parameterForeground":"#77AAB3","editorInlayHint.typeBackground":"#D8DAE4","editorInlayHint.typeForeground":"#7397DE","editorLightBulb.foreground":"#3788BE","editorLightBulbAutoFix.foreground":"#F19A8E","editorLineNumber.activeForeground":"#4E5377","editorLineNumber.foreground":"#5F6488","editorLink.activeForeground":"#F19A8E","editorMarkerNavigation.background":"#F1F1F4","editorMarkerNavigationError.background":"#F1F1F4","editorMarkerNavigationInfo.background":"#F1F1F4","editorMarkerNavigationWarning.background":"#F1F1F4","editorOverviewRuler.addedForeground":"#7397DE80","editorOverviewRuler.background":"#FDFDFE","editorOverviewRuler.border":"#6e6a8626","editorOverviewRuler.bracketMatchForeground":"#5F6488","editorOverviewRuler.commonContentForeground":"#6e6a860d","editorOverviewRuler.currentContentForeground":"#6e6a8614","editorOverviewRuler.deletedForeground":"#D26A5D80","editorOverviewRuler.errorForeground":"#D26A5D80","editorOverviewRuler.findMatchForeground":"#6e6a8626","editorOverviewRuler.incomingContentForeground":"#77AAB380","editorOverviewRuler.infoForeground":"#7397DE80","editorOverviewRuler.modifiedForeground":"#F19A8E80","editorOverviewRuler.rangeHighlightForeground":"#6e6a8626","editorOverviewRuler.selectionHighlightForeground":"#6e6a8626","editorOverviewRuler.warningForeground":"#886CDB80","editorOverviewRuler.wordHighlightForeground":"#6e6a8614","editorOverviewRuler.wordHighlightStrongForeground":"#6e6a8626","editorPane.background":"#0000","editorRuler.foreground":"#6e6a8626","editorSuggestWidget.background":"#F1F1F4","editorSuggestWidget.border":"#0000","editorSuggestWidget.focusHighlightForeground":"#F19A8E","editorSuggestWidget.foreground":"#5F6488","editorSuggestWidget.highlightForeground":"#F19A8E","editorSuggestWidget.selectedBackground":"#6e6a8614","editorSuggestWidget.selectedForeground":"#4E5377","editorSuggestWidget.selectedIconForeground":"#4E5377","editorUnnecessaryCode.border":"#0000","editorUnnecessaryCode.opacity":"#00000080","editorWarning.border":"#0000","editorWarning.foreground":"#886CDB","editorWhitespace.foreground":"#8388AD","editorWidget.background":"#F1F1F4","editorWidget.border":"#D8DAE4","editorWidget.foreground":"#5F6488","editorWidget.resizeBorder":"#8388AD","errorForeground":"#D26A5D","extensionBadge.remoteBackground":"#77AAB3","extensionBadge.remoteForeground":"#FDFDFE","extensionButton.prominentBackground":"#F19A8E","extensionButton.prominentForeground":"#FDFDFE","extensionButton.prominentHoverBackground":"#F19A8Ee6","extensionIcon.starForeground":"#F19A8E","extensionIcon.verifiedForeground":"#77AAB3","focusBorder":"#6e6a8614","foreground":"#4E5377","gitDecoration.addedResourceForeground":"#7397DE","gitDecoration.conflictingResourceForeground":"#D26A5D","gitDecoration.deletedResourceForeground":"#5F6488","gitDecoration.ignoredResourceForeground":"#8388AD","gitDecoration.modifiedResourceForeground":"#F19A8E","gitDecoration.renamedResourceForeground":"#3788BE","gitDecoration.stageDeletedResourceForeground":"#D26A5D","gitDecoration.stageModifiedResourceForeground":"#77AAB3","gitDecoration.submoduleResourceForeground":"#886CDB","gitDecoration.untrackedResourceForeground":"#886CDB","icon.foreground":"#5F6488","input.background":"#D8DAE480","input.border":"#6e6a8614","input.foreground":"#4E5377","input.placeholderForeground":"#5F6488","inputOption.activeBackground":"#F19A8E","inputOption.activeBorder":"#0000","inputOption.activeForeground":"#FDFDFE","inputValidation.errorBackground":"#0000","inputValidation.errorBorder":"#0000","inputValidation.errorForeground":"#D26A5D","inputValidation.infoBackground":"#0000","inputValidation.infoBorder":"#0000","inputValidation.infoForeground":"#7397DE","inputValidation.warningBackground":"#0000","inputValidation.warningBorder":"#0000","inputValidation.warningForeground":"#7397DE80","keybindingLabel.background":"#D8DAE4","keybindingLabel.border":"#6e6a8626","keybindingLabel.bottomBorder":"#6e6a8626","keybindingLabel.foreground":"#77AAB3","keybindingTable.headerBackground":"#D8DAE4","keybindingTable.rowsBackground":"#F1F1F4","list.activeSelectionBackground":"#6e6a8614","list.activeSelectionForeground":"#4E5377","list.activeSelectionIconForeground":"#4E5377","list.deemphasizedForeground":"#5F6488","list.dropBackground":"#F1F1F4","list.errorForeground":"#D26A5D","list.filterMatchBackground":"#F1F1F4","list.filterMatchBorder":"#F19A8E","list.focusBackground":"#6e6a8626","list.focusForeground":"#4E5377","list.focusOutline":"#6e6a8614","list.highlightForeground":"#F19A8E","list.hoverBackground":"#6e6a860d","list.hoverForeground":"#4E5377","list.inactiveFocusBackground":"#6e6a860d","list.inactiveSelectionBackground":"#F1F1F4","list.inactiveSelectionForeground":"#4E5377","list.inactiveSelectionIconForeground":"#5F6488","list.invalidItemForeground":"#D26A5D","list.warningForeground":"#886CDB","listFilterWidget.background":"#F1F1F4","listFilterWidget.noMatchesOutline":"#D26A5D","listFilterWidget.outline":"#D8DAE4","menu.background":"#F1F1F4","menu.border":"#6e6a860d","menu.foreground":"#4E5377","menu.selectionBackground":"#6e6a8614","menu.selectionBorder":"#D8DAE4","menu.selectionForeground":"#4E5377","menu.separatorBackground":"#4E5377","menubar.selectionBackground":"#6e6a8614","menubar.selectionBorder":"#6e6a860d","menubar.selectionForeground":"#4E5377","merge.border":"#D8DAE4","merge.commonContentBackground":"#6e6a8614","merge.commonHeaderBackground":"#6e6a8614","merge.currentContentBackground":"#886CDB80","merge.currentHeaderBackground":"#886CDB80","merge.incomingContentBackground":"#7397DE80","merge.incomingHeaderBackground":"#7397DE80","minimap.background":"#F1F1F4","minimap.errorHighlight":"#D26A5D80","minimap.findMatchHighlight":"#6e6a8614","minimap.selectionHighlight":"#6e6a8614","minimap.warningHighlight":"#886CDB80","minimapGutter.addedBackground":"#7397DE","minimapGutter.deletedBackground":"#D26A5D","minimapGutter.modifiedBackground":"#F19A8E","minimapSlider.activeBackground":"#6e6a8626","minimapSlider.background":"#6e6a8614","minimapSlider.hoverBackground":"#6e6a8614","notificationCenter.border":"#6e6a8614","notificationCenterHeader.background":"#F1F1F4","notificationCenterHeader.foreground":"#5F6488","notificationLink.foreground":"#77AAB3","notifications.background":"#F1F1F4","notifications.border":"#6e6a8614","notifications.foreground":"#4E5377","notificationsErrorIcon.foreground":"#D26A5D","notificationsInfoIcon.foreground":"#7397DE","notificationsWarningIcon.foreground":"#886CDB","notificationToast.border":"#6e6a8614","panel.background":"#F1F1F4","panel.border":"#0000","panel.dropBorder":"#D8DAE4","panelInput.border":"#F1F1F4","panelSection.dropBackground":"#6e6a8614","panelSectionHeader.background":"#F1F1F4","panelSectionHeader.foreground":"#4E5377","panelTitle.activeBorder":"#6e6a8626","panelTitle.activeForeground":"#4E5377","panelTitle.inactiveForeground":"#5F6488","peekView.border":"#D8DAE4","peekViewEditor.background":"#F1F1F4","peekViewEditor.matchHighlightBackground":"#6e6a8626","peekViewResult.background":"#F1F1F4","peekViewResult.fileForeground":"#5F6488","peekViewResult.lineForeground":"#5F6488","peekViewResult.matchHighlightBackground":"#6e6a8626","peekViewResult.selectionBackground":"#6e6a8614","peekViewResult.selectionForeground":"#4E5377","peekViewTitle.background":"#D8DAE4","peekViewTitleDescription.foreground":"#5F6488","pickerGroup.border":"#6e6a8626","pickerGroup.foreground":"#77AAB3","ports.iconRunningProcessForeground":"#F19A8E","problemsErrorIcon.foreground":"#D26A5D","problemsInfoIcon.foreground":"#7397DE","problemsWarningIcon.foreground":"#886CDB","progressBar.background":"#F19A8E","quickInput.background":"#F1F1F4","quickInput.foreground":"#5F6488","quickInputList.focusBackground":"#6e6a8614","quickInputList.focusForeground":"#4E5377","quickInputList.focusIconForeground":"#4E5377","scrollbar.shadow":"#0000","scrollbarSlider.activeBackground":"#6e6a8626","scrollbarSlider.background":"#6e6a860d","scrollbarSlider.hoverBackground":"#6e6a8614","searchEditor.findMatchBackground":"#6e6a8614","selection.background":"#6e6a8626","settings.focusedRowBackground":"#F1F1F4","settings.headerForeground":"#4E5377","settings.modifiedItemIndicator":"#F19A8E","settings.focusedRowBorder":"#6e6a8614","settings.rowHoverBackground":"#F1F1F4","sideBar.background":"#FDFDFE","sideBar.dropBackground":"#F1F1F4","sideBar.foreground":"#5F6488","sideBarSectionHeader.background":"#0000","sideBarSectionHeader.border":"#6e6a8614","statusBar.background":"#FDFDFE","statusBar.debuggingBackground":"#77AAB3","statusBar.debuggingForeground":"#FDFDFE","statusBar.foreground":"#5F6488","statusBar.noFolderBackground":"#FDFDFE","statusBar.noFolderForeground":"#5F6488","statusBarItem.activeBackground":"#6e6a8626","statusBarItem.hoverBackground":"#6e6a8614","statusBarItem.prominentBackground":"#D8DAE4","statusBarItem.prominentForeground":"#4E5377","statusBarItem.prominentHoverBackground":"#6e6a8614","statusBarItem.remoteBackground":"#FDFDFE","statusBarItem.remoteForeground":"#886CDB","statusBarItem.errorBackground":"#FDFDFE","statusBarItem.errorForeground":"#D26A5D","symbolIcon.arrayForeground":"#5F6488","symbolIcon.classForeground":"#5F6488","symbolIcon.colorForeground":"#5F6488","symbolIcon.constantForeground":"#5F6488","symbolIcon.constructorForeground":"#5F6488","symbolIcon.enumeratorForeground":"#5F6488","symbolIcon.enumeratorMemberForeground":"#5F6488","symbolIcon.eventForeground":"#5F6488","symbolIcon.fieldForeground":"#5F6488","symbolIcon.fileForeground":"#5F6488","symbolIcon.folderForeground":"#5F6488","symbolIcon.functionForeground":"#5F6488","symbolIcon.interfaceForeground":"#5F6488","symbolIcon.keyForeground":"#5F6488","symbolIcon.keywordForeground":"#5F6488","symbolIcon.methodForeground":"#5F6488","symbolIcon.moduleForeground":"#5F6488","symbolIcon.namespaceForeground":"#5F6488","symbolIcon.nullForeground":"#5F6488","symbolIcon.numberForeground":"#5F6488","symbolIcon.objectForeground":"#5F6488","symbolIcon.operatorForeground":"#5F6488","symbolIcon.packageForeground":"#5F6488","symbolIcon.propertyForeground":"#5F6488","symbolIcon.referenceForeground":"#5F6488","symbolIcon.snippetForeground":"#5F6488","symbolIcon.stringForeground":"#5F6488","symbolIcon.structForeground":"#5F6488","symbolIcon.textForeground":"#5F6488","symbolIcon.typeParameterForeground":"#5F6488","symbolIcon.unitForeground":"#5F6488","symbolIcon.variableForeground":"#5F6488","tab.activeBackground":"#6e6a860d","tab.activeForeground":"#4E5377","tab.activeModifiedBorder":"#7397DE","tab.border":"#0000","tab.hoverBackground":"#6e6a8614","tab.inactiveBackground":"#0000","tab.inactiveForeground":"#5F6488","tab.inactiveModifiedBorder":"#7397DE80","tab.lastPinnedBorder":"#8388AD","tab.unfocusedActiveBackground":"#0000","tab.unfocusedHoverBackground":"#0000","tab.unfocusedInactiveBackground":"#0000","tab.unfocusedInactiveModifiedBorder":"#7397DE80","terminal.ansiWhite":"#4E5377","terminal.ansiBrightWhite":"#4E5377","terminal.ansiBlack":"#D8DAE4","terminal.ansiBrightBlack":"#5F6488","terminal.ansiBlue":"#7397DE","terminal.ansiBrightBlue":"#7397DE","terminal.ansiCyan":"#F19A8E","terminal.ansiBrightCyan":"#F19A8E","terminal.ansiGreen":"#3788BE","terminal.ansiBrightGreen":"#3788BE","terminal.ansiMagenta":"#77AAB3","terminal.ansiBrightMagenta":"#77AAB3","terminal.ansiRed":"#D26A5D","terminal.ansiBrightRed":"#D26A5D","terminal.ansiBrightYellow":"#886CDB","terminal.ansiYellow":"#886CDB","terminal.dropBackground":"#6e6a8614","terminal.foreground":"#4E5377","terminal.selectionBackground":"#6e6a8614","terminal.tab.activeBorder":"#4E5377","terminalCursor.background":"#4E5377","terminalCursor.foreground":"#8388AD","textBlockQuote.background":"#F1F1F4","textBlockQuote.border":"#6e6a8614","textCodeBlock.background":"#F1F1F4","textLink.activeForeground":"#77AAB3e6","textLink.foreground":"#77AAB3","textPreformat.foreground":"#886CDB","textSeparator.foreground":"#5F6488","titleBar.activeBackground":"#FDFDFE","titleBar.activeForeground":"#5F6488","titleBar.inactiveBackground":"#F1F1F4","titleBar.inactiveForeground":"#5F6488","toolbar.activeBackground":"#6e6a8626","toolbar.hoverBackground":"#6e6a8614","tree.indentGuidesStroke":"#5F6488","walkThrough.embeddedEditorBackground":"#FDFDFE","welcomePage.background":"#FDFDFE","welcomePage.buttonBackground":"#F1F1F4","welcomePage.buttonHoverBackground":"#D8DAE4","widget.shadow":"#D8DAE44d","window.activeBorder":"#F1F1F4","window.inactiveBorder":"#F1F1F4"},"tokenColors":[{"scope":["comment"],"settings":{"foreground":"#8388AD","fontStyle":"italic"}},{"scope":["constant"],"settings":{"foreground":"#3788BE"}},{"scope":["constant.numeric","constant.language","constant.character.escape"],"settings":{"foreground":"#F19A8E"}},{"scope":["entity.name"],"settings":{"foreground":"#F19A8E"}},{"scope":["entity.name.section","entity.name.tag","entity.name.namespace","entity.name.type"],"settings":{"foreground":"#7397DE"}},{"scope":["entity.other.attribute-name","entity.other.inherited-class"],"settings":{"foreground":"#77AAB3","fontStyle":"italic"}},{"scope":["invalid"],"settings":{"foreground":"#D26A5D"}},{"scope":["invalid.deprecated"],"settings":{"foreground":"#5F6488"}},{"scope":["keyword"],"settings":{"foreground":"#3788BE"}},{"scope":["meta.tag","meta.brace"],"settings":{"foreground":"#4E5377"}},{"scope":["meta.import","meta.export"],"settings":{"foreground":"#3788BE"}},{"scope":"meta.directive.vue","settings":{"foreground":"#77AAB3","fontStyle":"italic"}},{"scope":"meta.property-name.css","settings":{"foreground":"#7397DE"}},{"scope":"meta.property-value.css","settings":{"foreground":"#886CDB"}},{"scope":"meta.tag.other.html","settings":{"foreground":"#5F6488"}},{"scope":["punctuation"],"settings":{"foreground":"#5F6488"}},{"scope":["punctuation.accessor"],"settings":{"foreground":"#3788BE"}},{"scope":["punctuation.definition.string"],"settings":{"foreground":"#886CDB"}},{"scope":["punctuation.definition.tag"],"settings":{"foreground":"#8388AD"}},{"scope":["storage.type","storage.modifier"],"settings":{"foreground":"#3788BE"}},{"scope":["string"],"settings":{"foreground":"#886CDB"}},{"scope":["support"],"settings":{"foreground":"#7397DE"}},{"scope":["support.constant"],"settings":{"foreground":"#886CDB"}},{"scope":["support.function"],"settings":{"foreground":"#D26A5D","fontStyle":"italic"}},{"scope":["variable"],"settings":{"foreground":"#F19A8E","fontStyle":"italic"}},{"scope":["variable.other","variable.language","variable.function","variable.argument"],"settings":{"foreground":"#4E5377"}},{"scope":["variable.parameter"],"settings":{"foreground":"#77AAB3"}}]}`
-);
-
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- shikiConfig: { theme: serendipity },
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/package.json
deleted file mode 100644
index f42a39c06..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-themes-custom",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/pages/astro.astro
deleted file mode 100644
index aae5ddbba..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-custom/src/pages/astro.astro
+++ /dev/null
@@ -1,14 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```js
- console.log('JavaScript')
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/astro.config.mjs
deleted file mode 100644
index 7ddfeeb16..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/astro.config.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- shikiConfig: { theme: 'github-light' },
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/package.json
deleted file mode 100644
index d4e1c515a..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-themes-integrated",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/astro.astro
deleted file mode 100644
index aae5ddbba..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/astro.astro
+++ /dev/null
@@ -1,14 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```js
- console.log('JavaScript')
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/index.md b/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/index.md
deleted file mode 100644
index a75170537..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/themes-integrated/src/pages/index.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-layout: ../layouts/content.astro
----
-
-# Hello world
-
-```yaml
-apiVersion: v3
-kind: Pod
-metadata:
- name: rss-site
- labels:
- app: web
-spec:
- containers:
- - name: front-end
- image: nginx
- ports:
- - containerPort: 80
- - name: rss-reader
- image: nickchase/rss-php-nginx:v1
- ports:
- - containerPort: 88
-```
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/astro.config.mjs
deleted file mode 100644
index e95742529..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/astro.config.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- shikiConfig: { wrap: false },
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/package.json
deleted file mode 100644
index 9e593db67..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-wrap-false",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/pages/astro.astro
deleted file mode 100644
index 473b21dc1..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-false/src/pages/astro.astro
+++ /dev/null
@@ -1,18 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```
- plaintext
- ```
-
- ```js
- console.log('JavaScript')
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/astro.config.mjs
deleted file mode 100644
index b1fa06335..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/astro.config.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- shikiConfig: { wrap: null },
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/package.json
deleted file mode 100644
index a32cc28b6..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-wrap-null",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/pages/astro.astro
deleted file mode 100644
index 473b21dc1..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-null/src/pages/astro.astro
+++ /dev/null
@@ -1,18 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```
- plaintext
- ```
-
- ```js
- console.log('JavaScript')
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/astro.config.mjs
deleted file mode 100644
index 0e95f569b..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/astro.config.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- markdown: {
- syntaxHighlight: 'shiki',
- shikiConfig: { wrap: true },
- },
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/package.json b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/package.json
deleted file mode 100644
index d3440f66f..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-shiki-wrap-true",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "astro": "workspace:*",
- "@astrojs/markdown-component": "workspace:*"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/layouts/content.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/layouts/content.astro
deleted file mode 100644
index 925a243a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/layouts/content.astro
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/pages/astro.astro b/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/pages/astro.astro
deleted file mode 100644
index 473b21dc1..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown-shiki/wrap-true/src/pages/astro.astro
+++ /dev/null
@@ -1,18 +0,0 @@
----
-import Markdown from '@astrojs/markdown-component';
-import Layout from '../layouts/content.astro';
----
-
-<Layout>
- <Markdown is:raw>
- # Hello world
-
- ```
- plaintext
- ```
-
- ```js
- console.log('JavaScript')
- ```
- </Markdown>
-</Layout>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/astro.config.mjs b/packages/markdown/component/test/fixtures/astro-markdown/astro.config.mjs
deleted file mode 100644
index be33a26cc..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/astro.config.mjs
+++ /dev/null
@@ -1,9 +0,0 @@
-import { defineConfig } from 'astro/config';
-import preact from '@astrojs/preact';
-import svelte from "@astrojs/svelte";
-
-// https://astro.build/config
-export default defineConfig({
- integrations: [preact(), svelte()],
- site: 'https://astro.build/',
-});
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/package.json b/packages/markdown/component/test/fixtures/astro-markdown/package.json
deleted file mode 100644
index fdabe3a03..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "@test/astro-markdown-component-astro-markdown-component",
- "version": "0.0.0",
- "private": true,
- "dependencies": {
- "@astrojs/markdown-component": "workspace:*",
- "@astrojs/preact": "workspace:*",
- "@astrojs/svelte": "workspace:*",
- "astro": "workspace:*",
- "preact": "^10.15.1",
- "svelte": "^3.59.1"
- }
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/Counter.jsx b/packages/markdown/component/test/fixtures/astro-markdown/src/components/Counter.jsx
deleted file mode 100644
index a75f858b5..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/Counter.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { h } from 'preact';
-import { useState } from 'preact/hooks';
-
-export default function () {
- const [count, setCount] = useState(0);
- return <button onClick={() => setCount(count + 1)}>{count}</button>;
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/Example.jsx b/packages/markdown/component/test/fixtures/astro-markdown/src/components/Example.jsx
deleted file mode 100644
index e1f67ee50..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/Example.jsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { h } from 'preact';
-
-export default function () {
- return <div id="test">Testing</div>;
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/Hello.jsx b/packages/markdown/component/test/fixtures/astro-markdown/src/components/Hello.jsx
deleted file mode 100644
index d30dec516..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/Hello.jsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { h } from 'preact';
-
-export default function ({ name }) {
- return <div id="test">Hello {name}</div>;
-}
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/SlotComponent.astro b/packages/markdown/component/test/fixtures/astro-markdown/src/components/SlotComponent.astro
deleted file mode 100644
index f0aa9fc1c..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/SlotComponent.astro
+++ /dev/null
@@ -1,13 +0,0 @@
-<article>
- <section class="fragmentSlot">
- <slot name="fragmentSlot">❌ Missing content for slot "fragmentSlot"</slot>
- </section>
-
- <section class="pSlot">
- <slot name="pSlot">❌ Missing content for slot "pSlot"</slot>
- </section>
-
- <section class="defaultSlot">
- <slot>❌ Missing content for default slot</slot>
- </section>
-</article>
diff --git a/packages/markdown/component/test/fixtures/astro-markdown/src/components/SvelteButton.svelte b/packages/markdown/component/test/fixtures/astro-markdown/src/components/SvelteButton.svelte
deleted file mode 100644
index 74f3ff6a9..000000000
--- a/packages/markdown/component/test/fixtures/astro-markdown/src/components/SvelteButton.svelte
+++ /dev/null
@@ -1,11 +0,0 @@
-<script>
- let cool = false
-</script>
-
-<button on:click={() => cool = true}>This is cool right? {cool}</button>
-
-<style>
- button {
- background: green;
- }
-</style>
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 (
- <div
- className={`${
- noPadding ? "" : "md:px-2 lg:px-4"
- } flex-1 prose prose-headings:font-grotesk`}
- >
- <h3>{title}</h3>
- <p>{children}</p>
- </div>
- );
-};
-
-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 <code class="custom-class">nospace</code> 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 @@
-<html>
- <head>
- <!-- Head Stuff -->
- </head>
- <body>
- <div class="container">
- <slot></slot>
- </div>
- </body>
-</html>
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;
----
-
-<html>
- <body>
- <div id="title">{title}</div>
- <div id="url">{url}</div>
- <div id="file">{file}</div>
- </body>
-</html> \ 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.';
----
-
-<Markdown is:raw>
- ## Interesting Topic
-
- `({})`
- `{...props}`
- `{/* JavaScript */}`
-</Markdown>
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 */}
-
-<TextBlock title="Hello world!" noPadding>
- <ul class="not-prose">
- <li>A</li>
- <li>B</li>
- <li>C</li>
- </ul>
-</TextBlock>
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`;
----
-
-<main>
- <div id="target">
- <Markdown content={content} />
- <p>Some other stuff</p>
- </div>
- <p>Lastly...</p>
-</main>
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');
----
-
-<div>
- {content.map(({ Content }) => <Content />)}
-</div>
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
-
-`<script>` tags in **Astro** components are now built,
-bundled and optimized by default.
-
-> Markdown formatting still works between tags in inline code blocks.
-
-We can also use closing `</script>` tags without any problems.
-
-# Fenced code blocks
-
-```html
-<body>
- <div>This should also work without any problems.</div>
-</body>
-```
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.';
----
-
-<Markdown is:raw>
- ## Interesting Topic
-
- ```js
- const thing = () => {};
- ```
-</Markdown>
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 @@
-<!--
-HTML comments with */ inside!
--->
-
-<!--
-```js
-/**
- * It even works inside nested fenced code blocks!
- */
-function test() {
- /* Yay */
- return 'Nice!';
-}
-```
--->
-
-```
-<!-- HTML comments in code fence -->
-```
-
-`<!-- HTML comments in code -->`
-
-# 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 @@
-<!-- HTML comments! -->
-# 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.';
----
-
-<Layout>
- <Markdown>
- ## Interesting Topic
-
- <Hello name={`world`} />
- </Markdown>
-</Layout>
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';
----
-
-<Markdown content={content} />
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.';
----
-
-<div id="deep">
- <section class="a">
- <Markdown is:raw>
- ## A
- </Markdown>
- </section>
-
- <section class="b">
- <Markdown is:raw>
- ## B
- </Markdown>
- </section>
-
- <section class="c">
- <Markdown is:raw>
- ## C
- </Markdown>
- </section>
-</div>
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
-
-```
-
-```
-
-<pre></pre> \ 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`;
----
-
-<style>
- #root { color: green; }
-</style>
-<div id="root">
- <Markdown content={outer} />
-
- <Markdown>
- # Nested
-
- <Markdown content={inner} />
- </Markdown>
-</div>
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')
----
-
-<Layout>
- {posts.map(({ Content }) => <Content />)}
-</Layout>
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`
----
-
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width" />
- <title>Welcome to Astro</title>
- </head>
-
- <body>
- <h1>Welcome to <a href="https://astro.build/">Astro</a></h1>
- <div id="target">
- <Markdown is:raw>
- - list
- - nested list
-
- 1. Hello
- 1. nested hello
- </Markdown>
- </div>
- </body>
-</html>
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';
----
-
-<Markdown is:raw></Markdown>
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.';
----
-
-<Markdown>
- ## Interesting Topic
-
- <div id="first">Some content</div>
-
- <Example></Example>
-</Markdown>
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';
-
----
-<style>
- #root {
- color: green;
- }
-</style>
-<Layout>
- <div id="root">
- <Markdown>
- ## Interesting Topic
-
- ```js
- const thing = () => {};
- ```
- </Markdown>
- </div>
-</Layout>
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/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md
index a4edcc553..33590cf2a 100644
--- a/packages/telemetry/CHANGELOG.md
+++ b/packages/telemetry/CHANGELOG.md
@@ -1,5 +1,11 @@
# @astrojs/telemetry
+## 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..b739e13e2 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.0",
"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<string, any>): Promise<any> {
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
-
-<details>
-<summary>See changes in 2.0.0-beta.1</summary>
-
-### 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
-
-</details>
-
-## 2.0.0-beta.0
-
-<details>
-<summary>See changes in 2.0.0-beta.0</summary>
-
-### 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
-
-</details>
-
-## 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<string, {
- (...args: any[]): any;
- }>;
-} \ 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 = <T>(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<CharacterDataInternals>(this, 'CharacterData', 'data')
- .data
- }
-
- get textContent(): string {
- return _.internalsOf<CharacterDataInternals>(
- 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<CharacterDataInternals>(
- 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<CustomElementRegistryInternals>(
- 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<CustomElementRegistryInternals>(
- this,
- 'CustomElementRegistry',
- 'get'
- )
-
- name = String(name).toLowerCase()
-
- return internals.constructorByName.get(name)
- }
-
- getName(constructor: Function) {
- const internals = _.internalsOf<CustomElementRegistryInternals>(
- this,
- 'CustomElementRegistry',
- 'getName'
- )
-
- return internals.nameByConstructor.get(constructor)
- }
-}
-
-_.allowStringTag(CustomElementRegistry)
-
-interface CustomElementRegistryInternals {
- constructorByName: Map<string, Function>
- nameByConstructor: Map<Function, string>
-}
-
-interface ElementDefinitionOptions {
- extends?: string | undefined
-}
-
-export const initCustomElementRegistry = (
- target: Record<any, any>,
- exclude: Set<string>
-) => {
- 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<TEventType> {
- constructor(type: TEventType, params?: CustomEventInit) {
- params = Object(params) as Required<CustomEventInit>
-
- 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<DocumentInternals>(
- 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<string>) => {
- 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<string, Function>([
- ['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<string, Function>
- nameByConstructor: Map<Function, string>
- target: Target
-}
-
-interface CustomElementRegistryInternals {
- constructorByName: Map<string, Function>
- nameByConstructor: Map<Function, string>
-}
-
-interface ElementInternals {
- attributes: { [name: string]: string }
- localName: string
- ownerDocument: Document
- shadowRoot: ShadowRoot
- shadowInit: ShadowRootInit
-}
-
-interface ShadowRootInit extends Record<any, any> {
- mode?: string
-}
-
-interface Target extends Record<any, any> {
- 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<ShadowRootInit>) {
- 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<ElementInternals>(
- 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<ElementInternals>(this, 'Element', 'innerHTML')
-
- return ''
- }
-
- set innerHTML(value) {
- _.internalsOf<ElementInternals>(this, 'Element', 'innerHTML')
-
- void value
- }
-
- get shadowRoot(): ShadowRoot | null {
- const internals = _.internalsOf<ElementInternals>(
- this,
- 'Element',
- 'shadowRoot'
- )
-
- return Object(internals.shadowInit).mode === 'open'
- ? internals.shadowRoot
- : null
- }
-
- get localName(): string {
- return _.internalsOf<ElementInternals>(this, 'Element', 'localName')
- .localName as string
- }
-
- get nodeName(): string {
- return (
- _.internalsOf<ElementInternals>(this, 'Element', 'nodeName')
- .localName as string
- ).toUpperCase()
- }
-
- get tagName(): string {
- return (
- _.internalsOf<ElementInternals>(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<HTMLCanvasElementInternals>(
- 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<ImageDataInternals>(this, 'ImageData', 'data')
-
- return (
- Object.getOwnPropertyDescriptor(this, 'data') as {
- value: Uint8ClampedArray
- }
- ).value
- }
-
- get width(): ImageDataInternals['width'] {
- return _.internalsOf<ImageDataInternals>(this, 'ImageData', 'width').width
- }
-
- get height(): ImageDataInternals['height'] {
- return _.internalsOf<ImageDataInternals>(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<string>) => {
- 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<any, any> {
- 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<string, any>
- ) {
- 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<NodeIteratorInternals>(
- this,
- 'NodeIterator',
- 'filter'
- )
- return internals.filter
- }
-
- get pointerBeforeReferenceNode(): boolean {
- const internals = _.internalsOf<NodeIteratorInternals>(
- this,
- 'NodeIterator',
- 'pointerBeforeReferenceNode'
- )
- return internals.pointerBeforeReferenceNode
- }
-
- get referenceNode(): Node {
- const internals = _.internalsOf<NodeIteratorInternals>(
- this,
- 'NodeIterator',
- 'referenceNode'
- )
- return internals.referenceNode
- }
-
- get root(): Node {
- const internals = _.internalsOf<NodeIteratorInternals>(
- this,
- 'NodeIterator',
- 'root'
- )
- return internals.root
- }
-
- get whatToShow(): number {
- const internals = _.internalsOf<NodeIteratorInternals>(
- 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<OffscreenCanvasInternals>(
- 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<ConvertToBlobOptions>) {
- 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<StorageInternals>(this, 'Storage', 'clear').storage.clear()
- }
-
- getItem(key: string): string | null {
- return getStringOrNull(
- _.internalsOf<StorageInternals>(this, 'Storage', 'getItem').storage.get(
- String(key)
- )
- )
- }
-
- key(index: number): string | null {
- return getStringOrNull(
- [
- ..._.internalsOf<StorageInternals>(
- this,
- 'Storage',
- 'key'
- ).storage.keys(),
- ][Number(index) || 0]
- )
- }
-
- removeItem(key: string): void {
- _.internalsOf<StorageInternals>(this, 'Storage', 'getItem').storage.delete(
- String(key)
- )
- }
-
- setItem(key: string, value: any): void {
- _.internalsOf<StorageInternals>(this, 'Storage', 'getItem').storage.set(
- String(key),
- String(value)
- )
- }
-
- get length() {
- return _.internalsOf<StorageInternals>(this, 'Storage', 'size').storage.size
- }
-}
-
-const getStringOrNull = (value: string | void) =>
- typeof value === 'string' ? value : null
-
-export const initStorage = (target: Target, exclude: Set<string>) => {
- if (exclude.has('Storage') || exclude.has('localStorage')) return
-
- target.localStorage = Object.create(Storage.prototype)
-
- const storageInternals = new Map<string, string>()
-
- _.INTERNALS.set(target.localStorage, {
- storage: storageInternals,
- } as StorageInternals)
-}
-
-interface StorageInternals {
- storage: Map<string, string>
-}
-
-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<TreeWalkerInternals>(
- this,
- 'TreeWalker',
- 'currentNode'
- )
- return internals.currentNode
- }
-
- get root(): Node {
- const internals = _.internalsOf<TreeWalkerInternals>(
- this,
- 'TreeWalker',
- 'root'
- )
- return internals.root
- }
-
- get whatToShow(): number {
- const internals = _.internalsOf<TreeWalkerInternals>(
- 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<string>) => {
- if (exclude.has('Window') || exclude.has('window')) return
-
- target.window = target
-}
-
-export interface WindowInternals {
- document: null
- location: URL
- window: this
-}
-
-interface Target extends Record<any, any> {
- 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 <TArgs extends any[], TFunc extends (...args: TArgs) => 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 { <T1 extends object, T2>(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<unknown, any>()
-
-export const internalsOf = <T extends object>(
- 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<string>
-
- // 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<string>())
-
- return target
-}
-
-interface PolyfillOptions {
- exclude?: string | string[]
- override?: Record<string, { (...args: any[]): any }>
-}
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('<html')
- })
-
- it('Fetch with data', async () => {
- 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 789238fe0..2d790f820 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
@@ -129,43 +126,43 @@ importers:
dependencies:
astro:
specifier: ^2.10.3
- version: link:../../packages/astro
+ version: 2.10.3(@types/node@18.16.18)
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.1
+ specifier: ^3.0.0-beta.0
version: link:../../packages/integrations/sitemap
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/component:
devDependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/deno:
dependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
lit:
specifier: ^2.7.5
@@ -195,22 +192,22 @@ importers:
examples/framework-multiple:
dependencies:
'@astrojs/preact':
- specifier: ^2.2.1
+ specifier: ^3.0.0-beta.0
version: link:../../packages/integrations/preact
'@astrojs/react':
- specifier: ^2.2.1
+ specifier: ^3.0.0-beta.0
version: link:../../packages/integrations/react
'@astrojs/solid-js':
- specifier: ^2.2.0
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
preact:
specifier: ^10.15.1
@@ -234,13 +231,13 @@ importers:
examples/framework-preact:
dependencies:
'@astrojs/preact':
- specifier: ^2.2.1
+ specifier: ^3.0.0-beta.0
version: link:../../packages/integrations/preact
'@preact/signals':
specifier: ^1.1.3
version: 1.1.3(preact@10.15.1)
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
preact:
specifier: ^10.15.1
@@ -249,7 +246,7 @@ importers:
examples/framework-react:
dependencies:
'@astrojs/react':
- specifier: ^2.2.1
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
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.0
version: link:../../packages/integrations/solid
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
vue:
specifier: ^3.3.4
@@ -306,25 +303,25 @@ importers:
examples/hackernews:
dependencies:
'@astrojs/node':
- specifier: ^5.3.2
+ specifier: ^6.0.0-beta.0
version: link:../../packages/integrations/node
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/integration:
devDependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/middleware:
dependencies:
'@astrojs/node':
- specifier: ^5.3.2
+ specifier: ^6.0.0-beta.0
version: link:../../packages/integrations/node
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
html-minifier:
specifier: ^4.0.0
@@ -333,31 +330,31 @@ importers:
examples/minimal:
dependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/non-html-pages:
dependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/portfolio:
dependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
examples/ssr:
dependencies:
'@astrojs/node':
- specifier: ^5.3.2
+ 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.3
+ specifier: ^3.0.0-beta.0
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.0
version: link:../../packages/integrations/markdoc
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
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.1
+ specifier: ^3.0.0-beta.0
version: link:../../packages/integrations/preact
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
preact:
specifier: ^10.15.1
@@ -420,13 +417,13 @@ importers:
examples/with-nanostores:
dependencies:
'@astrojs/preact':
- specifier: ^2.2.1
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
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.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
autoprefixer:
specifier: ^10.4.14
@@ -462,7 +462,7 @@ importers:
examples/with-vite-plugin-pwa:
dependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
version: link:../../packages/astro
vite-plugin-pwa:
specifier: 0.14.7
@@ -474,7 +474,7 @@ importers:
examples/with-vitest:
dependencies:
astro:
- specifier: ^2.10.3
+ specifier: ^3.0.0-beta.0
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
@@ -561,11 +555,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
@@ -595,7 +589,7 @@ importers:
version: 3.0.0
network-information-types:
specifier: ^0.1.1
- version: 0.1.1(typescript@5.0.2)
+ version: 0.1.1(typescript@5.1.6)
ora:
specifier: ^6.3.1
version: 6.3.1
@@ -620,6 +614,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 +629,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 +651,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
@@ -762,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
@@ -2554,17 +2545,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:
@@ -3639,14 +3619,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
@@ -4012,17 +3992,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
@@ -4043,7 +4023,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
@@ -4188,10 +4168,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
@@ -4301,7 +4281,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
@@ -4441,17 +4421,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
@@ -4534,9 +4511,6 @@ importers:
packages/integrations/node:
dependencies:
- '@astrojs/webapi':
- specifier: ^2.2.0
- version: link:../../webapi
send:
specifier: ^0.18.0
version: 0.18.0
@@ -4571,9 +4545,6 @@ importers:
node-mocks-http:
specifier: ^1.12.2
version: 1.12.2
- undici:
- specifier: ^5.22.1
- version: 5.22.1
packages/integrations/node/test/fixtures/api-route:
dependencies:
@@ -4882,7 +4853,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:*
@@ -4938,11 +4909,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
@@ -4950,8 +4918,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
@@ -4999,6 +4967,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':
@@ -5126,157 +5103,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
@@ -5369,9 +5199,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
@@ -5419,72 +5246,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
@@ -5509,7 +5278,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
@@ -5594,6 +5363,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:
@@ -5602,14 +5388,26 @@ packages:
sisteransi: 1.0.5
dev: false
+ /@astrojs/compiler@1.5.7:
+ resolution: {integrity: sha512-dFU7GAMbpTUGPkRoCoMQrGFlTe3qIiQMSOxIXp/nB1Do4My9uogjEmBHdR5Cwr4i6rc5/1R3Od9v8kU/pkHXGQ==}
+ dev: true
+
/@astrojs/compiler@1.8.0:
resolution: {integrity: sha512-E0TI/uyO8n+IPSZ4Fvl9Lne8JKEasR6ZMGvE2G096oTWOXSsPAhRs2LomV3z+/VRepo2h+t/SdVo54wox4eJwA==}
+ dev: false
+
+ /@astrojs/compiler@1.8.1:
+ resolution: {integrity: sha512-C28qplQzgIJ+JU9S+1wNx+ue2KCBUp0TTAd10EWAEkk4RsL3Tzlw0BYvLDDb4KP9jS48lXmR4/1TtZ4aavYJ8Q==}
+
+ /@astrojs/internal-helpers@0.1.2:
+ resolution: {integrity: sha512-YXLk1CUDdC9P5bjFZcGjz+cE/ZDceXObDTXn/GCID4r8LjThuexxi+dlJqukmUpkSItzQqgzfWnrPLxSFPejdA==}
+ dev: false
/@astrojs/language-server@1.0.0:
resolution: {integrity: sha512-oEw7AwJmzjgy6HC9f5IdrphZ1GVgfV/+7xQuyf52cpTiRWd/tJISK3MsKP0cDkVlfodmNABNFnAaAWuLZEiiiA==}
hasBin: true
dependencies:
- '@astrojs/compiler': 1.8.0
+ '@astrojs/compiler': 1.8.1
'@jridgewell/trace-mapping': 0.3.18
'@vscode/emmet-helper': 2.8.8
events: 3.3.0
@@ -5617,7 +5415,7 @@ packages:
prettier-plugin-astro: 0.8.1
synckit: 0.8.5
vscode-css-languageservice: 6.2.6
- vscode-html-languageservice: 5.0.5
+ vscode-html-languageservice: 5.0.6
vscode-languageserver: 8.1.0
vscode-languageserver-protocol: 3.17.3
vscode-languageserver-textdocument: 1.0.8
@@ -5625,6 +5423,94 @@ packages:
vscode-uri: 3.0.7
dev: false
+ /@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.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
+ transitivePeerDependencies:
+ - typescript
+ dev: true
+
+ /@astrojs/markdown-remark@2.2.1(astro@2.10.3):
+ resolution: {integrity: sha512-VF0HRv4GpC1XEMLnsKf6jth7JSmlt9qpqP0josQgA2eSpCIAC/Et+y94mgdBIZVBYH/yFnMoIxgKVe93xfO2GA==}
+ peerDependencies:
+ astro: '*'
+ dependencies:
+ '@astrojs/prism': 2.1.2
+ astro: 2.10.3(@types/node@18.16.18)
+ github-slugger: 1.5.0
+ import-meta-resolve: 2.2.2
+ rehype-raw: 6.1.1
+ rehype-stringify: 9.0.3
+ remark-gfm: 3.0.1
+ remark-parse: 10.0.2
+ remark-rehype: 10.1.0
+ remark-smartypants: 2.0.0
+ shiki: 0.14.1
+ unified: 10.1.2
+ unist-util-visit: 4.1.2
+ vfile: 5.3.7
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@astrojs/prism@2.1.2:
+ resolution: {integrity: sha512-3antim1gb34689GHRQFJ88JEo93HuZKQBnmxDT5W/nxiNz1p/iRxnCTEhIbJhqMOTRbbo5h2ldm5qSxx+TMFQA==}
+ engines: {node: '>=16.12.0'}
+ dependencies:
+ prismjs: 1.29.0
+ dev: false
+
+ /@astrojs/telemetry@2.1.1:
+ resolution: {integrity: sha512-4pRhyeQr0MLB5PKYgkdu+YE8sSpMbHL8dUuslBWBIdgcYjtD1SufPMBI8pgXJ+xlwrQJHKKfK2X1KonHYuOS9A==}
+ engines: {node: '>=16.12.0'}
+ dependencies:
+ ci-info: 3.8.0
+ debug: 4.3.4
+ dlv: 1.1.3
+ dset: 3.1.2
+ is-docker: 3.0.0
+ is-wsl: 2.2.0
+ undici: 5.22.1
+ which-pm-runs: 1.1.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@astrojs/webapi@2.2.0:
+ resolution: {integrity: sha512-mHAOApWyjqSe5AQMOUD9rsZJqbMQqe3Wosb1a40JV6Okvyxj1G6GTlthwYadWCymq/lbgwh0PLiY8Fr4eFxtuQ==}
+ dependencies:
+ undici: 5.22.1
+ dev: false
+
/@babel/code-frame@7.22.5:
resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==}
engines: {node: '>=6.9.0'}
@@ -7484,17 +7370,14 @@ packages:
resolution: {integrity: sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==}
dependencies:
'@emmetio/scanner': 1.0.4
- dev: false
/@emmetio/css-abbreviation@2.1.8:
resolution: {integrity: sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw==}
dependencies:
'@emmetio/scanner': 1.0.4
- dev: false
/@emmetio/scanner@1.0.4:
resolution: {integrity: sha512-IqRuJtQff7YHHBk4G8YZ45uB9BaAGcwQeVzgj/zj8/UdOhtQpEIupUhSk8dys6spFIWVZVeK20CzGEnqR5SbqA==}
- dev: false
/@esbuild-plugins/node-globals-polyfill@0.1.1(esbuild@0.14.47):
resolution: {integrity: sha512-MR0oAA+mlnJWrt1RQVQ+4VYuRJW/P2YmRTv1AsplObyvuBMnPHiizUF95HHYiSsMGLhyGtWufaq2XQg6+iurBg==}
@@ -7520,6 +7403,7 @@ packages:
cpu: [arm64]
os: [android]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/android-arm64@0.18.16:
@@ -7545,6 +7429,7 @@ packages:
cpu: [arm]
os: [android]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/android-arm@0.18.16:
@@ -7561,6 +7446,7 @@ packages:
cpu: [x64]
os: [android]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/android-x64@0.18.16:
@@ -7577,6 +7463,7 @@ packages:
cpu: [arm64]
os: [darwin]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/darwin-arm64@0.18.16:
@@ -7593,6 +7480,7 @@ packages:
cpu: [x64]
os: [darwin]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/darwin-x64@0.18.16:
@@ -7609,6 +7497,7 @@ packages:
cpu: [arm64]
os: [freebsd]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/freebsd-arm64@0.18.16:
@@ -7625,6 +7514,7 @@ packages:
cpu: [x64]
os: [freebsd]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/freebsd-x64@0.18.16:
@@ -7641,6 +7531,7 @@ packages:
cpu: [arm64]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-arm64@0.18.16:
@@ -7657,6 +7548,7 @@ packages:
cpu: [arm]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-arm@0.18.16:
@@ -7673,6 +7565,7 @@ packages:
cpu: [ia32]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-ia32@0.18.16:
@@ -7698,6 +7591,7 @@ packages:
cpu: [loong64]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-loong64@0.18.16:
@@ -7714,6 +7608,7 @@ packages:
cpu: [mips64el]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-mips64el@0.18.16:
@@ -7730,6 +7625,7 @@ packages:
cpu: [ppc64]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-ppc64@0.18.16:
@@ -7746,6 +7642,7 @@ packages:
cpu: [riscv64]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-riscv64@0.18.16:
@@ -7762,6 +7659,7 @@ packages:
cpu: [s390x]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-s390x@0.18.16:
@@ -7778,6 +7676,7 @@ packages:
cpu: [x64]
os: [linux]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/linux-x64@0.18.16:
@@ -7794,6 +7693,7 @@ packages:
cpu: [x64]
os: [netbsd]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/netbsd-x64@0.18.16:
@@ -7810,6 +7710,7 @@ packages:
cpu: [x64]
os: [openbsd]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/openbsd-x64@0.18.16:
@@ -7826,6 +7727,7 @@ packages:
cpu: [x64]
os: [sunos]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/sunos-x64@0.18.16:
@@ -7842,6 +7744,7 @@ packages:
cpu: [arm64]
os: [win32]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/win32-arm64@0.18.16:
@@ -7858,6 +7761,7 @@ packages:
cpu: [ia32]
os: [win32]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/win32-ia32@0.18.16:
@@ -7874,6 +7778,7 @@ packages:
cpu: [x64]
os: [win32]
requiresBuild: true
+ dev: false
optional: true
/@esbuild/win32-x64@0.18.16:
@@ -8086,7 +7991,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
@@ -8460,7 +8365,7 @@ packages:
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
dependencies:
cross-spawn: 7.0.3
- fast-glob: 3.2.12
+ fast-glob: 3.3.1
is-glob: 4.0.3
open: 9.1.0
picocolors: 1.0.0
@@ -8498,19 +8403,6 @@ 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'}
- peerDependencies:
- rollup: ^1.20.0||^2.0.0
- peerDependenciesMeta:
- rollup:
- optional: true
- dependencies:
- rollup: 2.79.1
- slash: 3.0.0
- dev: true
-
/@rollup/plugin-babel@5.3.1(@babel/core@7.22.5)(rollup@2.79.1):
resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==}
engines: {node: '>= 10.0.0'}
@@ -8532,20 +8424,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'}
@@ -8564,24 +8442,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:
@@ -8609,26 +8469,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'}
@@ -8642,6 +8482,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==}
@@ -8846,6 +8687,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==}
@@ -9052,6 +8894,7 @@ 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==}
@@ -9128,7 +8971,7 @@ packages:
/@types/yargs-parser@21.0.0:
resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==}
- /@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:
@@ -9140,10 +8983,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
@@ -9153,13 +8996,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:
@@ -9171,11 +9014,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
@@ -9188,7 +9031,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:
@@ -9198,12 +9041,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
@@ -9213,7 +9056,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:
@@ -9228,13 +9071,13 @@ packages:
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
+ 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:
@@ -9245,7 +9088,7 @@ 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
@@ -9291,10 +9134,6 @@ packages:
/@ungap/promise-all-settled@1.1.2:
resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==}
- /@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==}
peerDependencies:
@@ -9401,6 +9240,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:
@@ -9409,15 +9303,13 @@ packages:
vscode-languageserver-textdocument: 1.0.8
vscode-languageserver-types: 3.17.3
vscode-uri: 2.1.2
- dev: false
- /@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
/@vue/babel-helper-vue-transform-on@1.0.2:
resolution: {integrity: sha512-hz4R8tS5jMn8lDq6iD+yWL6XNB699pGIVLk7WSJnn1dbpjaazsjZQkieJoRX6gW5zpYSCFqQ7jUquPNY65tQYA==}
@@ -9789,6 +9681,85 @@ packages:
ultrahtml: 0.1.3
dev: false
+ /astro@2.10.3(@types/node@18.16.18):
+ resolution: {integrity: sha512-Hp8HhamDsRw31QYftKNmPktbr9+YJ5CQMSAlg0ED667hhH0KkgfVV77bqRojsLlj6f/6qBYGMgooGQdtfdie1Q==}
+ engines: {node: '>=16.12.0', npm: '>=6.14.0'}
+ hasBin: true
+ peerDependencies:
+ sharp: '>=0.31.0'
+ peerDependenciesMeta:
+ sharp:
+ optional: true
+ dependencies:
+ '@astrojs/compiler': 1.8.0
+ '@astrojs/internal-helpers': 0.1.2
+ '@astrojs/language-server': 1.0.0
+ '@astrojs/markdown-remark': 2.2.1(astro@2.10.3)
+ '@astrojs/telemetry': 2.1.1
+ '@astrojs/webapi': 2.2.0
+ '@babel/core': 7.22.5
+ '@babel/generator': 7.22.5
+ '@babel/parser': 7.22.5
+ '@babel/plugin-transform-react-jsx': 7.22.5(@babel/core@7.22.5)
+ '@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
+ ci-info: 3.8.0
+ 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
+ execa: 6.1.0
+ fast-glob: 3.2.12
+ github-slugger: 2.0.0
+ gray-matter: 4.0.3
+ html-escaper: 3.0.3
+ js-yaml: 4.1.0
+ kleur: 4.1.5
+ magic-string: 0.30.2
+ mime: 3.0.0
+ network-information-types: 0.1.1(typescript@5.1.6)
+ ora: 6.3.1
+ p-limit: 4.0.0
+ path-to-regexp: 6.2.1
+ preferred-pm: 3.0.3
+ prompts: 2.4.2
+ rehype: 12.0.1
+ semver: 7.5.4
+ server-destroy: 1.0.1
+ shiki: 0.14.1
+ string-width: 5.1.2
+ strip-ansi: 7.1.0
+ tsconfig-resolver: 3.0.1
+ typescript: 5.1.6
+ unist-util-visit: 4.1.2
+ vfile: 5.3.7
+ vite: 4.4.6(@types/node@18.16.18)(sass@1.63.4)
+ vitefu: 0.2.4(vite@4.4.6)
+ which-pm: 2.0.0
+ yargs-parser: 21.1.1
+ zod: 3.20.6
+ transitivePeerDependencies:
+ - '@types/node'
+ - less
+ - lightningcss
+ - sass
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ dev: false
+
/async-sema@3.1.1:
resolution: {integrity: sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==}
dev: false
@@ -10094,6 +10065,7 @@ packages:
/builtin-modules@3.3.0:
resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==}
engines: {node: '>=6'}
+ dev: false
/builtins@5.0.1:
resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==}
@@ -10793,6 +10765,7 @@ packages:
/deepmerge@4.3.1:
resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
engines: {node: '>=0.10.0'}
+ dev: false
/default-browser-id@3.0.0:
resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==}
@@ -11015,7 +10988,6 @@ packages:
dependencies:
'@emmetio/abbreviation': 2.3.3
'@emmetio/css-abbreviation': 2.1.8
- dev: false
/emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
@@ -11416,14 +11388,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
@@ -11586,6 +11558,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==}
@@ -11676,7 +11649,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:
@@ -11689,7 +11662,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
@@ -11816,7 +11789,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:
@@ -11844,6 +11817,7 @@ 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==}
@@ -11852,6 +11826,12 @@ packages:
resolution: {integrity: sha512-s6ceX0NFiU/vKPiKvFdR83U1Zffu7upwZsGwpoqfg5rbbq1l50WQ5hCeIvM6E6oD4shUHCYMsiFPns4Jk0YfMQ==}
dev: false
+ /estree-walker@3.0.3:
+ resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
+ dependencies:
+ '@types/estree': 1.0.1
+ dev: false
+
/esutils@2.0.3:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
@@ -11861,11 +11841,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'}
@@ -11958,6 +11933,16 @@ 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
+
/fast-json-stable-stringify@2.1.0:
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
@@ -12275,6 +12260,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==}
@@ -12927,13 +12913,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'}
@@ -13013,6 +12992,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==}
@@ -13334,7 +13314,6 @@ packages:
/jsonc-parser@2.3.1:
resolution: {integrity: sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==}
- dev: false
/jsonc-parser@3.2.0:
resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==}
@@ -14494,6 +14473,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
@@ -14542,12 +14525,12 @@ 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
+ typescript: 5.1.6
dev: false
/nice-try@1.0.5:
@@ -15090,7 +15073,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
@@ -15620,12 +15603,12 @@ 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
@@ -15633,7 +15616,7 @@ packages:
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
+ '@astrojs/compiler': 1.8.1
prettier: 2.8.8
sass-formatter: 0.7.6
synckit: 0.8.5
@@ -15644,6 +15627,12 @@ packages:
engines: {node: '>=10.13.0'}
hasBin: 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==}
engines: {node: '>=6'}
@@ -16096,7 +16085,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'
@@ -16107,9 +16096,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
@@ -16132,6 +16121,10 @@ 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'}
@@ -16281,6 +16274,7 @@ packages:
hasBin: true
optionalDependencies:
fsevents: 2.3.2
+ dev: false
/rollup@3.20.1:
resolution: {integrity: sha512-sz2w8cBJlWQ2E17RcpvHuf4sk2BQx4tfKDnjNPikEpLEevrbIAR7CH3PGa2hpPwWbNgPaA9yh9Jzljds5bc9zg==}
@@ -16514,7 +16508,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'
@@ -16523,7 +16517,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
@@ -16978,7 +16972,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
@@ -16990,7 +16984,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:
@@ -17235,13 +17229,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:
@@ -17436,9 +17430,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.4
+ dev: true
+
+ /typescript@5.1.6:
+ resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==}
+ engines: {node: '>=14.17'}
hasBin: true
/ufo@1.1.2:
@@ -17479,6 +17483,7 @@ packages:
engines: {node: '>=14.0'}
dependencies:
busboy: 1.6.0
+ dev: false
/unherit@3.0.1:
resolution: {integrity: sha512-akOOQ/Yln8a2sgcLj4U0Jmx0R5jpIg2IUyRrWOzmEbjBtGzBdHtSeFKgoEcoH4KYIG/Pb8GQ/BwtYm0GCq1Sqg==}
@@ -17695,10 +17700,6 @@ packages:
requires-port: 1.0.0
dev: true
- /urlpattern-polyfill@1.0.0-rc5:
- resolution: {integrity: sha512-OxVmQLKMQbDZX1m8Ljuf26rzMUJ7lm3cnBAicqrB0qmo1qb/koH7EXayeHiZdiyc6Z0OnaHETW2JCoVHgTnGGA==}
- dev: true
-
/urlpattern-polyfill@4.0.3:
resolution: {integrity: sha512-DOE84vZT2fEcl9gqCUTcnAw5ZY5Id55ikUcziSUntuEFL3pRvavg5kwDmTEUJkeCHInTlV/HexFomgYnzO5kdQ==}
dev: true
@@ -17998,6 +17999,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.4
+ 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:
@@ -18005,43 +18089,40 @@ packages:
vscode-languageserver-textdocument: 1.0.8
vscode-languageserver-types: 3.17.3
vscode-uri: 3.0.7
- dev: false
- /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
/vscode-jsonrpc@8.1.0:
resolution: {integrity: sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==}
engines: {node: '>=14.0.0'}
- dev: false
/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
/vscode-languageserver-textdocument@1.0.8:
resolution: {integrity: sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==}
- dev: false
/vscode-languageserver-types@3.17.3:
resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==}
- dev: false
/vscode-languageserver@8.1.0:
resolution: {integrity: sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==}
hasBin: true
dependencies:
vscode-languageserver-protocol: 3.17.3
- dev: false
+
+ /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==}
@@ -18055,11 +18136,9 @@ packages:
/vscode-uri@2.1.2:
resolution: {integrity: sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==}
- dev: false
/vscode-uri@3.0.7:
resolution: {integrity: sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==}
- dev: false
/vue@3.3.4:
resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==}
@@ -18631,25 +18710,21 @@ 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