From 07613b96bbe7a74179895c8cbe5f364133edd9ee Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Wed, 30 Aug 2023 11:08:41 +0100 Subject: [PATCH 1/6] chore: use biome to format JSON and JavaScript files --- .changeset/config.json | 20 +- .devcontainer/basics/devcontainer.json | 50 +- .devcontainer/blog/devcontainer.json | 50 +- .devcontainer/component/devcontainer.json | 30 +- .devcontainer/deno/devcontainer.json | 50 +- .devcontainer/devcontainer.json | 40 +- .devcontainer/docs/devcontainer.json | 50 +- .../framework-alpine/devcontainer.json | 50 +- .devcontainer/framework-lit/devcontainer.json | 50 +- .../framework-multiple/devcontainer.json | 50 +- .../framework-preact/devcontainer.json | 50 +- .../framework-react/devcontainer.json | 50 +- .../framework-solid/devcontainer.json | 50 +- .../framework-svelte/devcontainer.json | 50 +- .devcontainer/framework-vue/devcontainer.json | 50 +- .devcontainer/hackernews/devcontainer.json | 50 +- .devcontainer/integration/devcontainer.json | 30 +- .devcontainer/minimal/devcontainer.json | 50 +- .../non-html-pages/devcontainer.json | 50 +- .devcontainer/portfolio/devcontainer.json | 50 +- .devcontainer/ssr/devcontainer.json | 50 +- .../with-markdown-plugins/devcontainer.json | 50 +- .../with-markdown-shiki/devcontainer.json | 50 +- .devcontainer/with-mdx/devcontainer.json | 50 +- .../with-nanostores/devcontainer.json | 50 +- .../with-tailwindcss/devcontainer.json | 50 +- .../with-vite-plugin-pwa/devcontainer.json | 50 +- .devcontainer/with-vitest/devcontainer.json | 50 +- .github/scripts/bundle-size.mjs | 56 +- .prettierignore | 5 + .vscode/extensions.json | 14 +- .vscode/launch.json | 52 +- .vscode/tasks.json | 24 +- benchmark/bench/memory.js | 4 +- benchmark/bench/render.js | 4 +- benchmark/bench/server-stress.js | 4 +- benchmark/index.js | 2 +- benchmark/packages/timer/src/preview.ts | 2 +- benchmark/packages/timer/src/server.ts | 2 +- biome.json | 38 ++ examples/basics/.vscode/extensions.json | 4 +- examples/basics/.vscode/launch.json | 18 +- examples/blog/.vscode/extensions.json | 4 +- examples/blog/.vscode/launch.json | 18 +- examples/blog/astro.config.mjs | 2 +- examples/blog/src/pages/rss.xml.js | 2 +- examples/deno/.vscode/extensions.json | 4 +- examples/deno/.vscode/launch.json | 18 +- .../framework-alpine/.vscode/extensions.json | 4 +- examples/framework-alpine/.vscode/launch.json | 18 +- examples/framework-alpine/astro.config.mjs | 2 +- .../framework-lit/.vscode/extensions.json | 4 +- examples/framework-lit/.vscode/launch.json | 18 +- examples/framework-lit/astro.config.mjs | 2 +- .../.vscode/extensions.json | 4 +- .../framework-multiple/.vscode/launch.json | 18 +- examples/framework-multiple/astro.config.mjs | 4 +- .../framework-preact/.vscode/extensions.json | 4 +- examples/framework-preact/.vscode/launch.json | 18 +- examples/framework-preact/astro.config.mjs | 2 +- .../src/components/Counter.tsx | 2 +- .../framework-react/.vscode/extensions.json | 4 +- examples/framework-react/.vscode/launch.json | 18 +- examples/framework-react/astro.config.mjs | 2 +- .../framework-solid/.vscode/extensions.json | 4 +- examples/framework-solid/.vscode/launch.json | 18 +- examples/framework-solid/astro.config.mjs | 2 +- .../framework-svelte/.vscode/extensions.json | 4 +- examples/framework-svelte/.vscode/launch.json | 18 +- examples/framework-svelte/astro.config.mjs | 2 +- .../framework-vue/.vscode/extensions.json | 4 +- examples/framework-vue/.vscode/launch.json | 18 +- examples/framework-vue/astro.config.mjs | 2 +- examples/hackernews/.vscode/extensions.json | 4 +- examples/hackernews/.vscode/launch.json | 18 +- examples/hackernews/astro.config.mjs | 2 +- examples/middleware/astro.config.mjs | 2 +- examples/middleware/src/middleware.ts | 2 +- examples/minimal/.vscode/extensions.json | 4 +- examples/minimal/.vscode/launch.json | 18 +- .../non-html-pages/.vscode/extensions.json | 4 +- examples/non-html-pages/.vscode/launch.json | 18 +- examples/portfolio/.vscode/extensions.json | 4 +- examples/portfolio/.vscode/launch.json | 18 +- examples/ssr/.vscode/extensions.json | 4 +- examples/ssr/.vscode/launch.json | 18 +- examples/ssr/astro.config.mjs | 4 +- examples/ssr/src/models/db.json | 52 +- examples/ssr/src/pages/api/products/[id].ts | 2 +- examples/with-markdoc/.vscode/extensions.json | 4 +- examples/with-markdoc/.vscode/launch.json | 18 +- examples/with-markdoc/astro.config.mjs | 2 +- examples/with-markdoc/markdoc.config.mjs | 2 +- .../with-markdown-plugins/add-classes.mjs | 10 +- examples/with-mdx/.vscode/extensions.json | 4 +- examples/with-mdx/.vscode/launch.json | 18 +- examples/with-mdx/astro.config.mjs | 2 +- examples/with-nanostores/astro.config.mjs | 2 +- .../src/components/AddToCartForm.tsx | 4 +- examples/with-tailwindcss/astro.config.mjs | 2 +- .../test/pagesGlobToRssItems.test.js | 2 +- packages/astro-rss/test/rss.test.js | 98 ++- packages/astro/components/Shiki.js | 2 +- packages/astro/components/shiki-languages.js | 582 +++++++++++++----- packages/astro/components/shiki-themes.js | 63 +- packages/astro/content-types.template.d.ts | 12 +- .../e2e/custom-client-directives.test.js | 2 +- packages/astro/e2e/error-cyclic.test.js | 2 +- packages/astro/e2e/error-sass.test.js | 2 +- packages/astro/e2e/nested-recursive.test.js | 2 +- packages/astro/e2e/test-utils.js | 2 +- packages/astro/e2e/vue-component.test.js | 2 +- .../astro/performance/content-benchmark.mjs | 4 +- packages/astro/src/assets/build/generate.ts | 2 +- packages/astro/src/assets/internal.ts | 2 +- packages/astro/src/assets/services/noop.ts | 2 +- packages/astro/src/assets/services/sharp.ts | 4 +- packages/astro/src/assets/services/squoosh.ts | 4 +- packages/astro/src/assets/types.ts | 4 +- packages/astro/src/cli/add/index.ts | 8 +- packages/astro/src/cli/flags.ts | 2 +- packages/astro/src/cli/install-package.ts | 1 + packages/astro/src/content/runtime.ts | 2 +- .../astro/src/content/server-listeners.ts | 4 +- packages/astro/src/content/types-generator.ts | 12 +- packages/astro/src/content/utils.ts | 8 +- .../src/content/vite-plugin-content-assets.ts | 2 +- .../content/vite-plugin-content-imports.ts | 4 +- .../vite-plugin-content-virtual-mod.ts | 6 +- packages/astro/src/core/app/index.ts | 2 +- packages/astro/src/core/build/generate.ts | 6 +- packages/astro/src/core/build/index.ts | 2 +- .../src/core/build/plugins/plugin-css.ts | 2 +- packages/astro/src/core/build/static-build.ts | 10 +- packages/astro/src/core/compile/compile.ts | 2 +- packages/astro/src/core/compile/style.ts | 4 +- packages/astro/src/core/config/config.ts | 2 +- packages/astro/src/core/config/vite-load.ts | 2 +- packages/astro/src/core/endpoint/index.ts | 4 +- packages/astro/src/core/errors/dev/utils.ts | 8 +- packages/astro/src/core/errors/errors-data.ts | 4 +- packages/astro/src/core/logger/node.ts | 4 +- packages/astro/src/events/error.ts | 6 +- packages/astro/src/integrations/index.ts | 2 +- packages/astro/src/jsx-runtime/index.ts | 2 +- packages/astro/src/runtime/server/index.ts | 2 +- packages/astro/src/runtime/server/jsx.ts | 2 +- .../astro/src/runtime/server/render/any.ts | 2 +- .../src/runtime/server/render/astro/render.ts | 2 +- .../astro/src/runtime/server/render/common.ts | 4 +- .../astro/src/runtime/server/render/slot.ts | 2 +- .../astro/src/runtime/server/transition.ts | 7 +- .../src/vite-plugin-astro-server/route.ts | 2 +- packages/astro/src/vite-plugin-astro/hmr.ts | 2 +- packages/astro/src/vite-plugin-astro/index.ts | 2 +- packages/astro/src/vite-plugin-env/index.ts | 2 +- packages/astro/src/vite-plugin-head/index.ts | 2 +- .../src/vite-plugin-inject-env-ts/index.ts | 4 +- .../astro/src/vite-plugin-scanner/index.ts | 2 +- .../astro/src/vite-plugin-scripts/page-ssr.ts | 2 +- packages/astro/test/astro-assets.test.js | 2 +- packages/astro/test/astro-cookies.test.js | 2 +- packages/astro/test/astro-envs.test.js | 2 +- .../astro/test/astro-markdown-plugins.test.js | 2 +- packages/astro/test/astro-markdown.test.js | 2 +- .../astro/test/astro-not-response.test.js | 2 +- packages/astro/test/astro-pages.test.js | 2 +- packages/astro/test/before-hydration.test.js | 2 +- packages/astro/test/build-assets.test.js | 2 +- packages/astro/test/cli.test.js | 8 +- packages/astro/test/client-address.test.js | 4 +- packages/astro/test/config-mode.test.js | 2 +- .../test/content-collections-render.test.js | 2 +- .../astro/test/content-collections.test.js | 22 +- packages/astro/test/core-image.test.js | 4 +- .../astro/test/css-inline-stylesheets.test.js | 2 +- packages/astro/test/css-order.test.js | 2 +- packages/astro/test/debug-component.test.js | 2 +- packages/astro/test/dont-delete-root.test.js | 2 +- packages/astro/test/featuresSupport.test.js | 2 +- packages/astro/test/hoisted-imports.test.js | 2 +- packages/astro/test/middleware.test.js | 6 +- packages/astro/test/minification-html.test.js | 2 +- packages/astro/test/redirects.test.js | 2 +- packages/astro/test/ssr-404-500-pages.test.js | 4 +- .../test/ssr-adapter-build-config.test.js | 2 +- packages/astro/test/ssr-api-route.test.js | 2 +- packages/astro/test/ssr-assets.test.js | 2 +- packages/astro/test/ssr-dynamic.test.js | 2 +- packages/astro/test/ssr-env.test.js | 2 +- .../astro/test/ssr-hoisted-script.test.js | 2 +- packages/astro/test/ssr-large-array.test.js | 2 +- packages/astro/test/ssr-lit.test.js | 2 +- packages/astro/test/ssr-locals.test.js | 2 +- packages/astro/test/ssr-manifest.test.js | 4 +- packages/astro/test/ssr-markdown.test.js | 2 +- packages/astro/test/ssr-params.test.js | 2 +- packages/astro/test/ssr-partytown.test.js | 2 +- packages/astro/test/ssr-prerender.test.js | 2 +- packages/astro/test/ssr-preview.test.js | 2 +- packages/astro/test/ssr-request.test.js | 2 +- packages/astro/test/ssr-response.test.js | 2 +- packages/astro/test/ssr-scripts.test.js | 2 +- .../astro/test/ssr-split-manifest.test.js | 10 +- .../test/static-build-frameworks.test.js | 2 +- packages/astro/test/static-build.test.js | 2 +- packages/astro/test/test-adapter.js | 6 +- packages/astro/test/test-utils.js | 8 +- .../test/units/assets/remote-pattern.test.js | 4 +- .../test/units/compile/invalid-css.test.js | 4 +- .../test/units/config/config-resolve.test.js | 2 +- .../test/units/config/config-server.test.js | 2 +- .../test/units/config/config-tsconfig.test.js | 6 +- .../test/units/config/config-validate.test.js | 4 +- .../content-collections/error-map.test.js | 4 +- .../content-collections/frontmatter.test.js | 2 +- .../get-entry-info.test.js | 2 +- .../get-entry-type.test.js | 2 +- packages/astro/test/units/dev/base.test.js | 2 +- .../collections-mixed-content-errors.test.js | 2 +- .../units/dev/collections-renderentry.test.js | 4 +- packages/astro/test/units/dev/dev.test.js | 4 +- .../test/units/dev/head-injection.test.js | 2 +- .../astro/test/units/dev/hydration.test.js | 2 +- packages/astro/test/units/dev/restart.test.js | 2 +- packages/astro/test/units/dev/styles.test.js | 2 +- .../astro/test/units/integrations/api.test.js | 2 +- .../astro/test/units/render/chunk.test.js | 2 +- .../test/units/render/components.test.js | 2 +- packages/astro/test/units/render/head.test.js | 10 +- packages/astro/test/units/render/jsx.test.js | 14 +- .../test/units/routing/route-matching.test.js | 20 +- packages/astro/test/units/shiki/shiki.test.js | 2 +- packages/astro/test/units/test-utils.js | 12 +- .../vite-plugin-astro-server/request.test.js | 4 +- .../units/vite-plugin-astro/compile.test.js | 4 +- packages/astro/tsconfigs/base.json | 54 +- packages/astro/tsconfigs/strict.json | 12 +- packages/astro/tsconfigs/strictest.json | 48 +- .../create-astro/src/actions/dependencies.ts | 2 +- .../create-astro/src/actions/project-name.ts | 2 +- packages/create-astro/src/actions/template.ts | 4 +- .../create-astro/src/actions/typescript.ts | 2 +- packages/create-astro/test/git.test.js | 4 +- packages/create-astro/test/typescript.test.js | 2 +- packages/create-astro/test/utils.js | 2 +- .../cloudflare/src/server.advanced.ts | 2 +- .../cloudflare/src/server.directory.ts | 2 +- .../cloudflare/test/basics.test.js | 2 +- .../integrations/cloudflare/test/cf.test.js | 2 +- .../cloudflare/test/directory.test.js | 2 +- .../test/function-per-route.test.js | 2 +- .../cloudflare/test/no-output.test.js | 2 +- .../cloudflare/test/prerender.test.js | 2 +- .../cloudflare/test/runtime.test.js | 2 +- .../cloudflare/test/with-solid-js.test.js | 2 +- packages/integrations/deno/src/index.ts | 4 +- packages/integrations/deno/src/server.ts | 2 +- .../integrations/deno/test/basics.test.ts | 4 +- .../deno/test/dynamic-import.test.ts | 2 +- packages/integrations/deno/test/helpers.ts | 2 +- packages/integrations/lit/server-shim.js | 2 +- packages/integrations/lit/server.js | 2 +- packages/integrations/lit/src/index.ts | 2 +- packages/integrations/lit/test/server.test.js | 2 +- .../markdoc/components/TreeNode.ts | 12 +- .../markdoc/src/content-entry-type.ts | 6 +- .../markdoc/src/extensions/prism.ts | 2 +- packages/integrations/markdoc/src/index.ts | 2 +- .../integrations/markdoc/src/load-config.ts | 4 +- .../markdoc/test/content-collections.test.js | 4 +- .../markdoc/test/headings.test.js | 2 +- .../markdoc/test/image-assets.test.js | 2 +- .../markdoc/test/propagated-assets.test.js | 2 +- .../markdoc/test/render-html.test.js | 2 +- .../integrations/markdoc/test/render.test.js | 2 +- .../markdoc/test/syntax-highlighting.test.js | 8 +- .../markdoc/test/variables.test.js | 2 +- .../mdx/test/css-head-mdx.test.js | 2 +- .../mdx/test/mdx-get-static-paths.test.js | 2 +- .../integrations/mdx/test/mdx-math.test.js | 4 +- .../integrations/mdx/test/mdx-plugins.test.js | 4 +- .../mdx/test/mdx-syntax-highlighting.test.js | 4 +- .../netlify/src/integration-functions.ts | 2 +- .../netlify/src/netlify-functions.ts | 2 +- packages/integrations/netlify/src/shared.ts | 6 +- .../test/functions/base64-response.test.js | 2 +- .../netlify/test/functions/builders.test.js | 2 +- .../netlify/test/functions/cookies.test.js | 2 +- .../test/functions/edge-middleware.test.js | 4 +- .../netlify/test/static/redirects.test.js | 2 +- packages/integrations/node/src/preview.ts | 4 +- .../node/src/response-iterator.ts | 4 +- packages/integrations/node/src/standalone.ts | 2 +- packages/integrations/node/src/types.ts | 2 +- .../integrations/node/test/api-route.test.js | 6 +- .../integrations/node/test/encoded.test.js | 4 +- .../integrations/node/test/errors.test.js | 4 +- .../integrations/node/test/headers.test.js.js | 4 +- .../integrations/node/test/locals.test.js | 4 +- .../node/test/node-middleware.test.js | 4 +- .../node/test/prerender-404-500.test.js | 4 +- .../integrations/node/test/prerender.test.js | 4 +- packages/integrations/node/test/test-utils.js | 2 +- .../node/test/url-protocol.test.js | 2 +- .../node/test/well-known-locations.test.js | 2 +- packages/integrations/partytown/src/index.ts | 8 +- packages/integrations/partytown/src/sirv.ts | 2 +- .../prefetch/test/custom-selectors.test.js | 2 +- packages/integrations/react/client-v17.js | 35 +- packages/integrations/react/client.js | 57 +- packages/integrations/react/server.js | 2 +- .../react/test/react-component.test.js | 4 +- packages/integrations/react/vnode-children.js | 4 +- packages/integrations/sitemap/src/index.ts | 4 +- packages/integrations/sitemap/src/schema.ts | 9 +- .../integrations/sitemap/test/filter.test.js | 2 +- .../integrations/sitemap/test/routes.test.js | 2 +- .../integrations/sitemap/test/ssr.test.js | 2 +- .../sitemap/test/staticPaths.test.js | 2 +- .../integrations/sitemap/test/test-utils.js | 2 +- .../sitemap/test/trailing-slash.test.js | 2 +- packages/integrations/svelte/src/index.ts | 2 +- .../integrations/vercel/src/lib/redirects.ts | 2 +- .../vercel/src/serverless/entrypoint.ts | 2 +- .../src/serverless/request-transform.ts | 2 +- .../vercel/test/no-output.test.js | 2 +- .../integrations/vercel/test/split.test.js | 2 +- packages/integrations/vue/client.js | 49 +- packages/integrations/vue/server.js | 4 +- packages/integrations/vue/static-html.js | 2 +- .../vue/test/app-entrypoint.test.js | 2 +- .../remark/src/frontmatter-injection.ts | 2 +- packages/markdown/remark/src/load-plugins.ts | 2 +- packages/markdown/remark/src/types.ts | 4 +- packages/telemetry/src/config.ts | 6 +- packages/telemetry/src/index.ts | 6 +- packages/telemetry/src/system-info.ts | 4 +- packages/underscore-redirects/src/astro.ts | 2 +- .../underscore-redirects/test/astro.test.js | 2 +- .../underscore-redirects/test/print.test.js | 2 +- .../underscore-redirects/test/weight.test.js | 2 +- scripts/cmd/build.js | 2 +- scripts/cmd/copy.js | 4 +- scripts/cmd/prebuild.js | 4 +- scripts/deps/update-example-versions.js | 2 +- scripts/notify/index.js | 4 +- scripts/stats/index.js | 2 +- tsconfig.eslint.json | 8 +- turbo.json | 90 +-- 350 files changed, 2170 insertions(+), 1754 deletions(-) create mode 100644 biome.json diff --git a/.changeset/config.json b/.changeset/config.json index e8ba17558376..d2ea229c6640 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,12 +1,12 @@ { - "$schema": "https://unpkg.com/@changesets/config@1.7.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "withastro/astro" }], - "commit": false, - "linked": [], - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { - "onlyUpdatePeerDependentsWhenOutOfRange": true - } + "$schema": "https://unpkg.com/@changesets/config@1.7.0/schema.json", + "changelog": ["@changesets/changelog-github", { "repo": "withastro/astro" }], + "commit": false, + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true + } } diff --git a/.devcontainer/basics/devcontainer.json b/.devcontainer/basics/devcontainer.json index bb1707ff063b..755f87bee1e7 100644 --- a/.devcontainer/basics/devcontainer.json +++ b/.devcontainer/basics/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Basics", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Basics", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/basics", + "workspaceFolder": "/workspaces/astro/examples/basics", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/blog/devcontainer.json b/.devcontainer/blog/devcontainer.json index d587fead507d..2a2773053217 100644 --- a/.devcontainer/blog/devcontainer.json +++ b/.devcontainer/blog/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Blog", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Blog", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/blog", + "workspaceFolder": "/workspaces/astro/examples/blog", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/component/devcontainer.json b/.devcontainer/component/devcontainer.json index c2d3e50c3545..71c56d28d0c2 100644 --- a/.devcontainer/component/devcontainer.json +++ b/.devcontainer/component/devcontainer.json @@ -1,21 +1,21 @@ { - "name": "Component Template", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Component Template", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/component", + "workspaceFolder": "/workspaces/astro/examples/component", - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "customizations": { - "codespaces": { - "openFiles": ["src/MyComponent.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/MyComponent.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/deno/devcontainer.json b/.devcontainer/deno/devcontainer.json index 05b733527f65..041b143e7fa7 100644 --- a/.devcontainer/deno/devcontainer.json +++ b/.devcontainer/deno/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Deno", - "build": { - "dockerfile": "../examples.deno.Dockerfile" - }, + "name": "Deno", + "build": { + "dockerfile": "../examples.deno.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/deno", + "workspaceFolder": "/workspaces/astro/examples/deno", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6b8edf60573c..99bb2dfd239c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,27 +1,27 @@ { - "name": "Contribute to Astro", - "build": { - "dockerfile": "Dockerfile" - }, + "name": "Contribute to Astro", + "build": { + "dockerfile": "Dockerfile" + }, - "features": { - "ghcr.io/devcontainers/features/desktop-lite:1": {} - }, + "features": { + "ghcr.io/devcontainers/features/desktop-lite:1": {} + }, - "postCreateCommand": "pnpm install && pnpm run build", + "postCreateCommand": "pnpm install && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Astro tests": "pnpm run test" - }, + "postAttachCommand": { + "Astro tests": "pnpm run test" + }, - "customizations": { - "codespaces": { - "openFiles": ["README.md", "CONTRIBUTING.md"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["README.md", "CONTRIBUTING.md"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/docs/devcontainer.json b/.devcontainer/docs/devcontainer.json index a26ff9d8c751..e38058d9f217 100644 --- a/.devcontainer/docs/devcontainer.json +++ b/.devcontainer/docs/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Docs Site", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Docs Site", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/docs", + "workspaceFolder": "/workspaces/astro/examples/docs", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-alpine/devcontainer.json b/.devcontainer/framework-alpine/devcontainer.json index 1b8f26503d69..d309dbf63bfd 100644 --- a/.devcontainer/framework-alpine/devcontainer.json +++ b/.devcontainer/framework-alpine/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Alpine", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Alpine", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-alpine", + "workspaceFolder": "/workspaces/astro/examples/framework-alpine", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-lit/devcontainer.json b/.devcontainer/framework-lit/devcontainer.json index 4eb1d59791d0..934fbff06867 100644 --- a/.devcontainer/framework-lit/devcontainer.json +++ b/.devcontainer/framework-lit/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Lit", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Lit", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-lit", + "workspaceFolder": "/workspaces/astro/examples/framework-lit", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-multiple/devcontainer.json b/.devcontainer/framework-multiple/devcontainer.json index 660df3e32411..59719cd95704 100644 --- a/.devcontainer/framework-multiple/devcontainer.json +++ b/.devcontainer/framework-multiple/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Kitchen Sink (Multiple Frameworks)", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Kitchen Sink (Multiple Frameworks)", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-multiple", + "workspaceFolder": "/workspaces/astro/examples/framework-multiple", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-preact/devcontainer.json b/.devcontainer/framework-preact/devcontainer.json index 5c71cb6f2d0d..47214355c67d 100644 --- a/.devcontainer/framework-preact/devcontainer.json +++ b/.devcontainer/framework-preact/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Preact", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Preact", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-preact", + "workspaceFolder": "/workspaces/astro/examples/framework-preact", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-react/devcontainer.json b/.devcontainer/framework-react/devcontainer.json index f130c26ff3a4..56d89ac99147 100644 --- a/.devcontainer/framework-react/devcontainer.json +++ b/.devcontainer/framework-react/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "React", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "React", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-react", + "workspaceFolder": "/workspaces/astro/examples/framework-react", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-solid/devcontainer.json b/.devcontainer/framework-solid/devcontainer.json index 4a3e65ec855a..2df288194e73 100644 --- a/.devcontainer/framework-solid/devcontainer.json +++ b/.devcontainer/framework-solid/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Solid", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Solid", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-solid", + "workspaceFolder": "/workspaces/astro/examples/framework-solid", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-svelte/devcontainer.json b/.devcontainer/framework-svelte/devcontainer.json index d8db14287d87..7da6c8449d4c 100644 --- a/.devcontainer/framework-svelte/devcontainer.json +++ b/.devcontainer/framework-svelte/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Svelte", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Svelte", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-svelte", + "workspaceFolder": "/workspaces/astro/examples/framework-svelte", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-vue/devcontainer.json b/.devcontainer/framework-vue/devcontainer.json index db9a6287834c..34bccf6a4830 100644 --- a/.devcontainer/framework-vue/devcontainer.json +++ b/.devcontainer/framework-vue/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Vue", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Vue", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-vue", + "workspaceFolder": "/workspaces/astro/examples/framework-vue", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/hackernews/devcontainer.json b/.devcontainer/hackernews/devcontainer.json index dc113624d6c1..5c24e4958c5b 100644 --- a/.devcontainer/hackernews/devcontainer.json +++ b/.devcontainer/hackernews/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Hackernews", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Hackernews", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/hackernews", + "workspaceFolder": "/workspaces/astro/examples/hackernews", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/[...stories].astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/[...stories].astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/integration/devcontainer.json b/.devcontainer/integration/devcontainer.json index 8e6a4df8d852..10f45155f86f 100644 --- a/.devcontainer/integration/devcontainer.json +++ b/.devcontainer/integration/devcontainer.json @@ -1,21 +1,21 @@ { - "name": "Integration Package", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Integration Package", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/integration", + "workspaceFolder": "/workspaces/astro/examples/integration", - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "customizations": { - "codespaces": { - "openFiles": ["index.ts"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["index.ts"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/minimal/devcontainer.json b/.devcontainer/minimal/devcontainer.json index 1756ffd8baaf..de48a32a63c2 100644 --- a/.devcontainer/minimal/devcontainer.json +++ b/.devcontainer/minimal/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Minimal", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Minimal", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/minimal", + "workspaceFolder": "/workspaces/astro/examples/minimal", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/non-html-pages/devcontainer.json b/.devcontainer/non-html-pages/devcontainer.json index b47fae4e9186..0ff0c2ccca38 100644 --- a/.devcontainer/non-html-pages/devcontainer.json +++ b/.devcontainer/non-html-pages/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Non-HTML Pages", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Non-HTML Pages", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/non-html-pages", + "workspaceFolder": "/workspaces/astro/examples/non-html-pages", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/portfolio/devcontainer.json b/.devcontainer/portfolio/devcontainer.json index 39e283d83b5d..075ccbf672c6 100644 --- a/.devcontainer/portfolio/devcontainer.json +++ b/.devcontainer/portfolio/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Portfolio", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Portfolio", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/portfolio", + "workspaceFolder": "/workspaces/astro/examples/portfolio", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/ssr/devcontainer.json b/.devcontainer/ssr/devcontainer.json index 2ace9a1dd012..01ba4f2640a1 100644 --- a/.devcontainer/ssr/devcontainer.json +++ b/.devcontainer/ssr/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "SSR", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "SSR", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/ssr", + "workspaceFolder": "/workspaces/astro/examples/ssr", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-markdown-plugins/devcontainer.json b/.devcontainer/with-markdown-plugins/devcontainer.json index 21894a77c42b..bbf70fd650b6 100644 --- a/.devcontainer/with-markdown-plugins/devcontainer.json +++ b/.devcontainer/with-markdown-plugins/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Markdown with Plugins", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Markdown with Plugins", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins", + "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.md"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.md"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-markdown-shiki/devcontainer.json b/.devcontainer/with-markdown-shiki/devcontainer.json index a3f51750adbf..19b2325a928c 100644 --- a/.devcontainer/with-markdown-shiki/devcontainer.json +++ b/.devcontainer/with-markdown-shiki/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Markdown with Shiki", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Markdown with Shiki", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki", + "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.md"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.md"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-mdx/devcontainer.json b/.devcontainer/with-mdx/devcontainer.json index 13ff67464285..197a30f3c808 100644 --- a/.devcontainer/with-mdx/devcontainer.json +++ b/.devcontainer/with-mdx/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "MDX", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "MDX", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-mdx", + "workspaceFolder": "/workspaces/astro/examples/with-mdx", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.mdx"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.mdx"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-nanostores/devcontainer.json b/.devcontainer/with-nanostores/devcontainer.json index 656776b2a049..6a630600d240 100644 --- a/.devcontainer/with-nanostores/devcontainer.json +++ b/.devcontainer/with-nanostores/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Nanostores", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Nanostores", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-nanostores", + "workspaceFolder": "/workspaces/astro/examples/with-nanostores", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-tailwindcss/devcontainer.json b/.devcontainer/with-tailwindcss/devcontainer.json index 6e7298a6f994..737989d4b7be 100644 --- a/.devcontainer/with-tailwindcss/devcontainer.json +++ b/.devcontainer/with-tailwindcss/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Tailwind", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Tailwind", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss", + "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-vite-plugin-pwa/devcontainer.json b/.devcontainer/with-vite-plugin-pwa/devcontainer.json index d716cded01b6..cf2ef2b7be41 100644 --- a/.devcontainer/with-vite-plugin-pwa/devcontainer.json +++ b/.devcontainer/with-vite-plugin-pwa/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Vite PWA", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Vite PWA", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa", + "workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-vitest/devcontainer.json b/.devcontainer/with-vitest/devcontainer.json index 7931089395da..6879a0c258e1 100644 --- a/.devcontainer/with-vitest/devcontainer.json +++ b/.devcontainer/with-vitest/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Vitest", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Vitest", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-vitest", + "workspaceFolder": "/workspaces/astro/examples/with-vitest", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.github/scripts/bundle-size.mjs b/.github/scripts/bundle-size.mjs index 66911eab1021..6f117b414f1e 100644 --- a/.github/scripts/bundle-size.mjs +++ b/.github/scripts/bundle-size.mjs @@ -1,18 +1,18 @@ -import { build } from 'esbuild'; import { existsSync } from 'node:fs'; +import { build } from 'esbuild'; const CLIENT_RUNTIME_PATH = 'packages/astro/src/runtime/client/'; function formatBytes(bytes, decimals = 2) { - if (bytes === 0) return '0 B'; + if (bytes === 0) return '0 B'; - const k = 1024; - const dm = decimals < 0 ? 0 : decimals; - const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + const k = 1024; + const dm = decimals < 0 ? 0 : decimals; + const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; - const i = Math.floor(Math.log(bytes) / Math.log(k)); + const i = Math.floor(Math.log(bytes) / Math.log(k)); - return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; + return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; } export default async function checkBundleSize({ github, context }) { @@ -24,7 +24,7 @@ export default async function checkBundleSize({ github, context }) { pull_number: PR_NUM, }); const clientRuntimeFiles = files.filter((file) => { - return file.filename.startsWith(CLIENT_RUNTIME_PATH) && file.status !== 'removed' + return file.filename.startsWith(CLIENT_RUNTIME_PATH) && file.status !== 'removed'; }); if (clientRuntimeFiles.length === 0) return; @@ -35,17 +35,26 @@ export default async function checkBundleSize({ github, context }) { const output = await bundle(clientRuntimeFiles); for (let [filename, { oldSize, newSize, sourceFile }] of Object.entries(output)) { - filename = ['idle', 'load', 'media', 'only', 'visible'].includes(filename) ? `client:${filename}` : filename; - const prefix = (newSize - oldSize) === 0 ? '' : (newSize - oldSize) > 0 ? '+ ' : '- '; + filename = ['idle', 'load', 'media', 'only', 'visible'].includes(filename) + ? `client:${filename}` + : filename; + const prefix = newSize - oldSize === 0 ? '' : newSize - oldSize > 0 ? '+ ' : '- '; const change = `${prefix}${formatBytes(newSize - oldSize)}`; - table.push(`| [\`${filename}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${context.payload.pull_request.head.ref}/${sourceFile}) | ${formatBytes(oldSize)} | ${formatBytes(newSize)} | ${change} |`); + table.push( + `| [\`${filename}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${ + context.payload.pull_request.head.ref + }/${sourceFile}) | ${formatBytes(oldSize)} | ${formatBytes(newSize)} | ${change} |` + ); } const { data: comments } = await github.rest.issues.listComments({ ...context.repo, - issue_number: PR_NUM - }) - const comment = comments.find(comment => comment.user.login === 'github-actions[bot]' && comment.body.includes('Bundle Size Check')); + issue_number: PR_NUM, + }); + const comment = comments.find( + (comment) => + comment.user.login === 'github-actions[bot]' && comment.body.includes('Bundle Size Check') + ); const method = comment ? 'updateComment' : 'createComment'; const payload = comment ? { comment_id: comment.id } : { issue_number: PR_NUM }; await github.rest.issues[method]({ @@ -60,26 +69,35 @@ ${table.join('\n')}`, } async function bundle(files) { - const { metafile } = await build({ - entryPoints: [...files.map(({ filename }) => filename), ...files.map(({ filename }) => `main/${filename}`).filter(f => existsSync(f))], + entryPoints: [ + ...files.map(({ filename }) => filename), + ...files.map(({ filename }) => `main/${filename}`).filter((f) => existsSync(f)), + ], bundle: true, minify: true, sourcemap: false, target: ['es2018'], outdir: 'out', metafile: true, - }) + }); return Object.entries(metafile.outputs).reduce((acc, [filename, info]) => { filename = filename.slice('out/'.length); if (filename.startsWith('main/')) { filename = filename.slice('main/'.length).replace(CLIENT_RUNTIME_PATH, '').replace('.js', ''); const oldSize = info.bytes; - return Object.assign(acc, { [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { oldSize }) }); + return Object.assign(acc, { + [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { oldSize }), + }); } filename = filename.replace(CLIENT_RUNTIME_PATH, '').replace('.js', ''); const newSize = info.bytes; - return Object.assign(acc, { [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { newSize, sourceFile: Object.keys(info.inputs).find(src => src.endsWith('.ts')) }) }); + return Object.assign(acc, { + [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { + newSize, + sourceFile: Object.keys(info.inputs).find((src) => src.endsWith('.ts')), + }), + }); }, {}); } diff --git a/.prettierignore b/.prettierignore index af84e34338c1..c822e0a50027 100644 --- a/.prettierignore +++ b/.prettierignore @@ -16,3 +16,8 @@ benchmark/results/ # Files pnpm-lock.yaml +*.js +*.ts +*.mjs +*.cjs +*.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d8411afe0257..d10a1ead43f3 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,9 @@ { - "recommendations": [ - "astro-build.astro-vscode", - "esbenp.prettier-vscode", - "editorconfig.editorconfig", - "dbaeumer.vscode-eslint" - ], - "unwantedRecommendations": [] + "recommendations": [ + "astro-build.astro-vscode", + "esbenp.prettier-vscode", + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint" + ], + "unwantedRecommendations": [] } diff --git a/.vscode/launch.json b/.vscode/launch.json index b575d4b70649..44c94ef5ae2b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,29 +1,29 @@ // A launch configuration that compiles the extension and then opens it inside a new window { - "version": "0.2.0", - "configurations": [ - { - "name": "Launch Client", - "type": "extensionHost", - "request": "launch", - "runtimeExecutable": "${execPath}", - "args": ["--extensionDevelopmentPath=${workspaceRoot}/tools/vscode"], - "outFiles": ["${workspaceRoot}/tools/vscode/dist/**/*.js"] - }, - { - "type": "node", - "request": "attach", - "name": "Attach to Server", - "port": 6040, - "restart": true, - "outFiles": ["${workspaceRoot}/tools/languageserver/dist/**/*.js"], - "skipFiles": ["/**"] - } - ], - "compounds": [ - { - "name": "Launch Extension", - "configurations": ["Launch Client", "Attach to Server"] - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Client", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}/tools/vscode"], + "outFiles": ["${workspaceRoot}/tools/vscode/dist/**/*.js"] + }, + { + "type": "node", + "request": "attach", + "name": "Attach to Server", + "port": 6040, + "restart": true, + "outFiles": ["${workspaceRoot}/tools/languageserver/dist/**/*.js"], + "skipFiles": ["/**"] + } + ], + "compounds": [ + { + "name": "Launch Extension", + "configurations": ["Launch Client", "Attach to Server"] + } + ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d81861501054..068a3d4af1dd 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,14 +1,14 @@ { - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "build:vscode", - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - } - } - ] + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "build:vscode", + "group": "build", + "presentation": { + "panel": "dedicated", + "reveal": "never" + } + } + ] } diff --git a/benchmark/bench/memory.js b/benchmark/bench/memory.js index 34a4972f78b1..831adf83b907 100644 --- a/benchmark/bench/memory.js +++ b/benchmark/bench/memory.js @@ -1,7 +1,7 @@ -import { execaCommand } from 'execa'; -import { markdownTable } from 'markdown-table'; import fs from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; +import { execaCommand } from 'execa'; +import { markdownTable } from 'markdown-table'; import { astroBin } from './_util.js'; /** @typedef {Record} AstroTimerStat */ diff --git a/benchmark/bench/render.js b/benchmark/bench/render.js index ac733bdeaa61..49f20f2676ad 100644 --- a/benchmark/bench/render.js +++ b/benchmark/bench/render.js @@ -1,9 +1,9 @@ -import { execaCommand } from 'execa'; -import { markdownTable } from 'markdown-table'; import fs from 'node:fs/promises'; import http from 'node:http'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import { execaCommand } from 'execa'; +import { markdownTable } from 'markdown-table'; import { waitUntilBusy } from 'port-authority'; import { calculateStat, astroBin } from './_util.js'; import { renderFiles } from '../make-project/render-default.js'; diff --git a/benchmark/bench/server-stress.js b/benchmark/bench/server-stress.js index ca165e239a3a..f629d7481d91 100644 --- a/benchmark/bench/server-stress.js +++ b/benchmark/bench/server-stress.js @@ -1,8 +1,8 @@ +import fs from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; import autocannon from 'autocannon'; import { execaCommand } from 'execa'; import { markdownTable } from 'markdown-table'; -import fs from 'node:fs/promises'; -import { fileURLToPath } from 'node:url'; import { waitUntilBusy } from 'port-authority'; import pb from 'pretty-bytes'; import { astroBin } from './_util.js'; diff --git a/benchmark/index.js b/benchmark/index.js index 1c38993b13bf..b55decce4071 100755 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -1,7 +1,7 @@ -import mri from 'mri'; import fs from 'node:fs/promises'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; +import mri from 'mri'; const args = mri(process.argv.slice(2)); diff --git a/benchmark/packages/timer/src/preview.ts b/benchmark/packages/timer/src/preview.ts index 4ee43ebd0e9e..aa503c11bf57 100644 --- a/benchmark/packages/timer/src/preview.ts +++ b/benchmark/packages/timer/src/preview.ts @@ -1,5 +1,5 @@ -import type { CreatePreviewServer } from 'astro'; import { createServer } from 'node:http'; +import type { CreatePreviewServer } from 'astro'; import enableDestroy from 'server-destroy'; const preview: CreatePreviewServer = async function ({ serverEntrypoint, host, port }) { diff --git a/benchmark/packages/timer/src/server.ts b/benchmark/packages/timer/src/server.ts index d33e65c00ab8..9905a627b755 100644 --- a/benchmark/packages/timer/src/server.ts +++ b/benchmark/packages/timer/src/server.ts @@ -1,6 +1,6 @@ +import type { IncomingMessage, ServerResponse } from 'node:http'; import type { SSRManifest } from 'astro'; import { NodeApp, applyPolyfills } from 'astro/app/node'; -import type { IncomingMessage, ServerResponse } from 'node:http'; applyPolyfills(); diff --git a/biome.json b/biome.json new file mode 100644 index 000000000000..dc78e1dedc3f --- /dev/null +++ b/biome.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.0.0/schema.json", + "organizeImports": { + "enabled": true + }, + "files": { + "ignoreUnknown": true, + "ignore": [ + "examples/basics/src/layouts/**", + "examples/with-nanostores/src/layouts/**", + "benchmark/projects/**", + "benchmark/results/**", + "**/dist", + "**/smoke", + "**/node_modules", + "**/fixtures", + "**/vendor", + "**/.vercel" + ] + }, + "linter": { + "enabled": false + }, + "formatter": { + "lineWidth": 100 + }, + "javascript": { + "formatter": { + "quoteStyle": "single", + "trailingComma": "es5" + } + }, + "json": { + "parser": { + "allowComments": true + } + } +} diff --git a/examples/basics/.vscode/extensions.json b/examples/basics/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/basics/.vscode/extensions.json +++ b/examples/basics/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/basics/.vscode/launch.json b/examples/basics/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/basics/.vscode/launch.json +++ b/examples/basics/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/blog/.vscode/extensions.json b/examples/blog/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/blog/.vscode/extensions.json +++ b/examples/blog/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/blog/.vscode/launch.json b/examples/blog/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/blog/.vscode/launch.json +++ b/examples/blog/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs index 3b2f75c840d3..9d2bd05581cf 100644 --- a/examples/blog/astro.config.mjs +++ b/examples/blog/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import mdx from '@astrojs/mdx'; +import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; diff --git a/examples/blog/src/pages/rss.xml.js b/examples/blog/src/pages/rss.xml.js index 9ff9801e0b30..3ecd8879face 100644 --- a/examples/blog/src/pages/rss.xml.js +++ b/examples/blog/src/pages/rss.xml.js @@ -1,6 +1,6 @@ import rss from '@astrojs/rss'; +import { SITE_DESCRIPTION, SITE_TITLE } from '../consts'; import { getCollection } from 'astro:content'; -import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; export async function GET(context) { const posts = await getCollection('blog'); diff --git a/examples/deno/.vscode/extensions.json b/examples/deno/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/deno/.vscode/extensions.json +++ b/examples/deno/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/deno/.vscode/launch.json b/examples/deno/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/deno/.vscode/launch.json +++ b/examples/deno/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-alpine/.vscode/extensions.json b/examples/framework-alpine/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-alpine/.vscode/extensions.json +++ b/examples/framework-alpine/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-alpine/.vscode/launch.json b/examples/framework-alpine/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-alpine/.vscode/launch.json +++ b/examples/framework-alpine/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-alpine/astro.config.mjs b/examples/framework-alpine/astro.config.mjs index 60bfc7d45d92..a9277a8c48a5 100644 --- a/examples/framework-alpine/astro.config.mjs +++ b/examples/framework-alpine/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import alpine from '@astrojs/alpinejs'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-lit/.vscode/extensions.json b/examples/framework-lit/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-lit/.vscode/extensions.json +++ b/examples/framework-lit/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-lit/.vscode/launch.json b/examples/framework-lit/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-lit/.vscode/launch.json +++ b/examples/framework-lit/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-lit/astro.config.mjs b/examples/framework-lit/astro.config.mjs index 99733e933767..b3d14109034b 100644 --- a/examples/framework-lit/astro.config.mjs +++ b/examples/framework-lit/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import lit from '@astrojs/lit'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-multiple/.vscode/extensions.json b/examples/framework-multiple/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-multiple/.vscode/extensions.json +++ b/examples/framework-multiple/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-multiple/.vscode/launch.json b/examples/framework-multiple/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-multiple/.vscode/launch.json +++ b/examples/framework-multiple/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-multiple/astro.config.mjs b/examples/framework-multiple/astro.config.mjs index 36f75aec2610..f46837fe137e 100644 --- a/examples/framework-multiple/astro.config.mjs +++ b/examples/framework-multiple/astro.config.mjs @@ -1,9 +1,9 @@ -import { defineConfig } from 'astro/config'; import preact from '@astrojs/preact'; import react from '@astrojs/react'; +import solid from '@astrojs/solid-js'; import svelte from '@astrojs/svelte'; import vue from '@astrojs/vue'; -import solid from '@astrojs/solid-js'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-preact/.vscode/extensions.json b/examples/framework-preact/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-preact/.vscode/extensions.json +++ b/examples/framework-preact/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-preact/.vscode/launch.json b/examples/framework-preact/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-preact/.vscode/launch.json +++ b/examples/framework-preact/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-preact/astro.config.mjs b/examples/framework-preact/astro.config.mjs index b1c8d1150ee7..0a16d2b9dbba 100644 --- a/examples/framework-preact/astro.config.mjs +++ b/examples/framework-preact/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import preact from '@astrojs/preact'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-preact/src/components/Counter.tsx b/examples/framework-preact/src/components/Counter.tsx index 5d702fb42ed9..4a65c1a927d3 100644 --- a/examples/framework-preact/src/components/Counter.tsx +++ b/examples/framework-preact/src/components/Counter.tsx @@ -1,4 +1,4 @@ -import { h, Fragment } from 'preact'; +import { Fragment, h } from 'preact'; import './Counter.css'; export default function Counter({ children, count }) { diff --git a/examples/framework-react/.vscode/extensions.json b/examples/framework-react/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-react/.vscode/extensions.json +++ b/examples/framework-react/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-react/.vscode/launch.json b/examples/framework-react/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-react/.vscode/launch.json +++ b/examples/framework-react/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-react/astro.config.mjs b/examples/framework-react/astro.config.mjs index 4b5a68ec00b8..f7586fd0d97f 100644 --- a/examples/framework-react/astro.config.mjs +++ b/examples/framework-react/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import react from '@astrojs/react'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-solid/.vscode/extensions.json b/examples/framework-solid/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-solid/.vscode/extensions.json +++ b/examples/framework-solid/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-solid/.vscode/launch.json b/examples/framework-solid/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-solid/.vscode/launch.json +++ b/examples/framework-solid/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-solid/astro.config.mjs b/examples/framework-solid/astro.config.mjs index 623fb8ea5e31..2a012fc59091 100644 --- a/examples/framework-solid/astro.config.mjs +++ b/examples/framework-solid/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import solid from '@astrojs/solid-js'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-svelte/.vscode/extensions.json b/examples/framework-svelte/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-svelte/.vscode/extensions.json +++ b/examples/framework-svelte/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-svelte/.vscode/launch.json b/examples/framework-svelte/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-svelte/.vscode/launch.json +++ b/examples/framework-svelte/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-svelte/astro.config.mjs b/examples/framework-svelte/astro.config.mjs index 194e4591765f..f275635df246 100644 --- a/examples/framework-svelte/astro.config.mjs +++ b/examples/framework-svelte/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import svelte from '@astrojs/svelte'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/framework-vue/.vscode/extensions.json b/examples/framework-vue/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/framework-vue/.vscode/extensions.json +++ b/examples/framework-vue/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-vue/.vscode/launch.json b/examples/framework-vue/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/framework-vue/.vscode/launch.json +++ b/examples/framework-vue/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-vue/astro.config.mjs b/examples/framework-vue/astro.config.mjs index f30130a95318..8a28297076b0 100644 --- a/examples/framework-vue/astro.config.mjs +++ b/examples/framework-vue/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import vue from '@astrojs/vue'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/hackernews/.vscode/extensions.json b/examples/hackernews/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/hackernews/.vscode/extensions.json +++ b/examples/hackernews/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/hackernews/.vscode/launch.json b/examples/hackernews/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/hackernews/.vscode/launch.json +++ b/examples/hackernews/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/hackernews/astro.config.mjs b/examples/hackernews/astro.config.mjs index 68ba7fac5876..9977243f46a2 100644 --- a/examples/hackernews/astro.config.mjs +++ b/examples/hackernews/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/middleware/astro.config.mjs b/examples/middleware/astro.config.mjs index 68ba7fac5876..9977243f46a2 100644 --- a/examples/middleware/astro.config.mjs +++ b/examples/middleware/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/middleware/src/middleware.ts b/examples/middleware/src/middleware.ts index eb764453545c..6737e6ca7204 100644 --- a/examples/middleware/src/middleware.ts +++ b/examples/middleware/src/middleware.ts @@ -1,5 +1,5 @@ -import { defineMiddleware, sequence } from 'astro:middleware'; import htmlMinifier from 'html-minifier'; +import { defineMiddleware, sequence } from 'astro:middleware'; const limit = 50; diff --git a/examples/minimal/.vscode/extensions.json b/examples/minimal/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/minimal/.vscode/extensions.json +++ b/examples/minimal/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/minimal/.vscode/launch.json b/examples/minimal/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/minimal/.vscode/launch.json +++ b/examples/minimal/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/non-html-pages/.vscode/extensions.json b/examples/non-html-pages/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/non-html-pages/.vscode/extensions.json +++ b/examples/non-html-pages/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/non-html-pages/.vscode/launch.json b/examples/non-html-pages/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/non-html-pages/.vscode/launch.json +++ b/examples/non-html-pages/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/portfolio/.vscode/extensions.json b/examples/portfolio/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/portfolio/.vscode/extensions.json +++ b/examples/portfolio/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/portfolio/.vscode/launch.json b/examples/portfolio/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/portfolio/.vscode/launch.json +++ b/examples/portfolio/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/ssr/.vscode/extensions.json b/examples/ssr/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/ssr/.vscode/extensions.json +++ b/examples/ssr/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/ssr/.vscode/launch.json b/examples/ssr/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/ssr/.vscode/launch.json +++ b/examples/ssr/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/ssr/astro.config.mjs b/examples/ssr/astro.config.mjs index b79949397d94..1c3348445b9c 100644 --- a/examples/ssr/astro.config.mjs +++ b/examples/ssr/astro.config.mjs @@ -1,6 +1,6 @@ -import { defineConfig } from 'astro/config'; -import svelte from '@astrojs/svelte'; import node from '@astrojs/node'; +import svelte from '@astrojs/svelte'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/ssr/src/models/db.json b/examples/ssr/src/models/db.json index 76f9e4da3432..6401b1803fcb 100644 --- a/examples/ssr/src/models/db.json +++ b/examples/ssr/src/models/db.json @@ -1,28 +1,28 @@ { - "products": [ - { - "id": 1, - "name": "Cereal", - "price": 3.99, - "image": "/images/products/cereal.jpg" - }, - { - "id": 2, - "name": "Yogurt", - "price": 3.97, - "image": "/images/products/yogurt.jpg" - }, - { - "id": 3, - "name": "Rolled Oats", - "price": 2.89, - "image": "/images/products/oats.jpg" - }, - { - "id": 4, - "name": "Muffins", - "price": 4.39, - "image": "/images/products/muffins.jpg" - } - ] + "products": [ + { + "id": 1, + "name": "Cereal", + "price": 3.99, + "image": "/images/products/cereal.jpg" + }, + { + "id": 2, + "name": "Yogurt", + "price": 3.97, + "image": "/images/products/yogurt.jpg" + }, + { + "id": 3, + "name": "Rolled Oats", + "price": 2.89, + "image": "/images/products/oats.jpg" + }, + { + "id": 4, + "name": "Muffins", + "price": 4.39, + "image": "/images/products/muffins.jpg" + } + ] } diff --git a/examples/ssr/src/pages/api/products/[id].ts b/examples/ssr/src/pages/api/products/[id].ts index abcd02da8b54..f5d10cb11c78 100644 --- a/examples/ssr/src/pages/api/products/[id].ts +++ b/examples/ssr/src/pages/api/products/[id].ts @@ -1,5 +1,5 @@ -import { productMap } from '../../../models/db'; import type { APIContext } from 'astro'; +import { productMap } from '../../../models/db'; export function GET({ params }: APIContext) { const id = Number(params.id); diff --git a/examples/with-markdoc/.vscode/extensions.json b/examples/with-markdoc/.vscode/extensions.json index 22a15055d638..3a1c9ecdb6a7 100644 --- a/examples/with-markdoc/.vscode/extensions.json +++ b/examples/with-markdoc/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/with-markdoc/.vscode/launch.json b/examples/with-markdoc/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/with-markdoc/.vscode/launch.json +++ b/examples/with-markdoc/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/with-markdoc/astro.config.mjs b/examples/with-markdoc/astro.config.mjs index 29d846359bb2..1bd8ba93f461 100644 --- a/examples/with-markdoc/astro.config.mjs +++ b/examples/with-markdoc/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import markdoc from '@astrojs/markdoc'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/with-markdoc/markdoc.config.mjs b/examples/with-markdoc/markdoc.config.mjs index 90608d56408c..f1d1b71f8f59 100644 --- a/examples/with-markdoc/markdoc.config.mjs +++ b/examples/with-markdoc/markdoc.config.mjs @@ -1,4 +1,4 @@ -import { defineMarkdocConfig, component } from '@astrojs/markdoc/config'; +import { component, defineMarkdocConfig } from '@astrojs/markdoc/config'; export default defineMarkdocConfig({ tags: { diff --git a/examples/with-markdown-plugins/add-classes.mjs b/examples/with-markdown-plugins/add-classes.mjs index 39acabd52670..f55c69d3114d 100644 --- a/examples/with-markdown-plugins/add-classes.mjs +++ b/examples/with-markdown-plugins/add-classes.mjs @@ -10,9 +10,7 @@ const adder = ([selector, className]) => { return (node) => selectAll(selector, node).forEach(writer); }; -const write = - (className) => - ({ properties }) => { - if (!properties.className) properties.className = className; - else properties.className += ` ${className}`; - }; +const write = (className) => ({ properties }) => { + if (!properties.className) properties.className = className; + else properties.className += ` ${className}`; +}; diff --git a/examples/with-mdx/.vscode/extensions.json b/examples/with-mdx/.vscode/extensions.json index 56f043d30eef..26d70b4090e1 100644 --- a/examples/with-mdx/.vscode/extensions.json +++ b/examples/with-mdx/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"], + "unwantedRecommendations": [] } diff --git a/examples/with-mdx/.vscode/launch.json b/examples/with-mdx/.vscode/launch.json index d6422097621f..230708db40bb 100644 --- a/examples/with-mdx/.vscode/launch.json +++ b/examples/with-mdx/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/with-mdx/astro.config.mjs b/examples/with-mdx/astro.config.mjs index d797941ec2cb..8d07c7a4fadb 100644 --- a/examples/with-mdx/astro.config.mjs +++ b/examples/with-mdx/astro.config.mjs @@ -1,6 +1,6 @@ -import { defineConfig } from 'astro/config'; import mdx from '@astrojs/mdx'; import preact from '@astrojs/preact'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/with-nanostores/astro.config.mjs b/examples/with-nanostores/astro.config.mjs index 3e161041b59d..67703ece67a4 100644 --- a/examples/with-nanostores/astro.config.mjs +++ b/examples/with-nanostores/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import preact from '@astrojs/preact'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/examples/with-nanostores/src/components/AddToCartForm.tsx b/examples/with-nanostores/src/components/AddToCartForm.tsx index 7498443f67f6..b65e78a18a22 100644 --- a/examples/with-nanostores/src/components/AddToCartForm.tsx +++ b/examples/with-nanostores/src/components/AddToCartForm.tsx @@ -1,6 +1,6 @@ -import { isCartOpen, addCartItem } from '../cartStore'; -import type { CartItemDisplayInfo } from '../cartStore'; import type { ComponentChildren } from 'preact'; +import { addCartItem, isCartOpen } from '../cartStore'; +import type { CartItemDisplayInfo } from '../cartStore'; type Props = { item: CartItemDisplayInfo; diff --git a/examples/with-tailwindcss/astro.config.mjs b/examples/with-tailwindcss/astro.config.mjs index 4ad396807723..83409b7485e4 100644 --- a/examples/with-tailwindcss/astro.config.mjs +++ b/examples/with-tailwindcss/astro.config.mjs @@ -1,5 +1,5 @@ -import { defineConfig } from 'astro/config'; import tailwind from '@astrojs/tailwind'; +import { defineConfig } from 'astro/config'; // https://astro.build/config export default defineConfig({ diff --git a/packages/astro-rss/test/pagesGlobToRssItems.test.js b/packages/astro-rss/test/pagesGlobToRssItems.test.js index 82af5ba125e2..774d1c737911 100644 --- a/packages/astro-rss/test/pagesGlobToRssItems.test.js +++ b/packages/astro-rss/test/pagesGlobToRssItems.test.js @@ -1,7 +1,7 @@ import chai from 'chai'; import chaiPromises from 'chai-as-promised'; -import { phpFeedItem, web1FeedItem } from './test-utils.js'; import { pagesGlobToRssItems } from '../dist/index.js'; +import { phpFeedItem, web1FeedItem } from './test-utils.js'; chai.use(chaiPromises); diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index 5dfb48b32adf..e575e034a00a 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -1,18 +1,18 @@ -import rss, { getRssString } from '../dist/index.js'; -import { rssSchema } from '../dist/schema.js'; import chai from 'chai'; import chaiPromises from 'chai-as-promised'; import chaiXml from 'chai-xml'; +import rss, { getRssString } from '../dist/index.js'; +import { rssSchema } from '../dist/schema.js'; import { - title, description, - site, phpFeedItem, phpFeedItemWithContent, phpFeedItemWithCustomData, + site, + title, web1FeedItem, - web1FeedItemWithContent, web1FeedItemWithAllData, + web1FeedItemWithContent, } from './test-utils.js'; chai.use(chaiPromises); @@ -21,15 +21,93 @@ chai.use(chaiXml); // note: I spent 30 minutes looking for a nice node-based snapshot tool // ...and I gave up. Enjoy big strings! // prettier-ignore -const validXmlResult = `<![CDATA[${title}]]>${site}/<![CDATA[${phpFeedItem.title}]]>${site}${phpFeedItem.link}/${site}${phpFeedItem.link}/${new Date(phpFeedItem.pubDate).toUTCString()}<![CDATA[${web1FeedItem.title}]]>${site}${web1FeedItem.link}/${site}${web1FeedItem.link}/${new Date(web1FeedItem.pubDate).toUTCString()}`; +const validXmlResult = `<![CDATA[${title}]]>${site}/<![CDATA[${ + phpFeedItem.title +}]]>${site}${phpFeedItem.link}/${site}${ + phpFeedItem.link +}/${new Date( + phpFeedItem.pubDate +).toUTCString()}<![CDATA[${ + web1FeedItem.title +}]]>${site}${web1FeedItem.link}/${site}${ + web1FeedItem.link +}/${new Date( + web1FeedItem.pubDate +).toUTCString()}`; // prettier-ignore -const validXmlWithoutWeb1FeedResult = `<![CDATA[${title}]]>${site}/<![CDATA[${phpFeedItem.title}]]>${site}${phpFeedItem.link}/${site}${phpFeedItem.link}/${new Date(phpFeedItem.pubDate).toUTCString()}`; +const validXmlWithoutWeb1FeedResult = `<![CDATA[${title}]]>${site}/<![CDATA[${ + phpFeedItem.title +}]]>${site}${phpFeedItem.link}/${site}${ + phpFeedItem.link +}/${new Date( + phpFeedItem.pubDate +).toUTCString()}`; // prettier-ignore -const validXmlWithContentResult = `<![CDATA[${title}]]>${site}/<![CDATA[${phpFeedItemWithContent.title}]]>${site}${phpFeedItemWithContent.link}/${site}${phpFeedItemWithContent.link}/${new Date(phpFeedItemWithContent.pubDate).toUTCString()}<![CDATA[${web1FeedItemWithContent.title}]]>${site}${web1FeedItemWithContent.link}/${site}${web1FeedItemWithContent.link}/${new Date(web1FeedItemWithContent.pubDate).toUTCString()}`; +const validXmlWithContentResult = `<![CDATA[${title}]]>${site}/<![CDATA[${ + phpFeedItemWithContent.title +}]]>${site}${phpFeedItemWithContent.link}/${site}${ + phpFeedItemWithContent.link +}/${new Date( + phpFeedItemWithContent.pubDate +).toUTCString()}<![CDATA[${ + web1FeedItemWithContent.title +}]]>${site}${web1FeedItemWithContent.link}/${site}${ + web1FeedItemWithContent.link +}/${new Date( + web1FeedItemWithContent.pubDate +).toUTCString()}`; // prettier-ignore -const validXmlResultWithAllData = `<![CDATA[${title}]]>${site}/<![CDATA[${phpFeedItem.title}]]>${site}${phpFeedItem.link}/${site}${phpFeedItem.link}/${new Date(phpFeedItem.pubDate).toUTCString()}<![CDATA[${web1FeedItemWithAllData.title}]]>${site}${web1FeedItemWithAllData.link}/${site}${web1FeedItemWithAllData.link}/${new Date(web1FeedItemWithAllData.pubDate).toUTCString()}${web1FeedItemWithAllData.categories[0]}${web1FeedItemWithAllData.categories[1]}${web1FeedItemWithAllData.author}${web1FeedItemWithAllData.commentsUrl}${web1FeedItemWithAllData.source.title}`; +const validXmlResultWithAllData = `<![CDATA[${title}]]>${site}/<![CDATA[${ + phpFeedItem.title +}]]>${site}${phpFeedItem.link}/${site}${ + phpFeedItem.link +}/${new Date( + phpFeedItem.pubDate +).toUTCString()}<![CDATA[${ + web1FeedItemWithAllData.title +}]]>${site}${web1FeedItemWithAllData.link}/${site}${ + web1FeedItemWithAllData.link +}/${new Date( + web1FeedItemWithAllData.pubDate +).toUTCString()}${web1FeedItemWithAllData.categories[0]}${ + web1FeedItemWithAllData.categories[1] +}${web1FeedItemWithAllData.author}${ + web1FeedItemWithAllData.commentsUrl +}${ + web1FeedItemWithAllData.source.title +}`; // prettier-ignore -const validXmlWithCustomDataResult = `<![CDATA[${title}]]>${site}/<![CDATA[${phpFeedItemWithCustomData.title}]]>${site}${phpFeedItemWithCustomData.link}/${site}${phpFeedItemWithCustomData.link}/${new Date(phpFeedItemWithCustomData.pubDate).toUTCString()}${phpFeedItemWithCustomData.customData}<![CDATA[${web1FeedItemWithContent.title}]]>${site}${web1FeedItemWithContent.link}/${site}${web1FeedItemWithContent.link}/${new Date(web1FeedItemWithContent.pubDate).toUTCString()}`; +const validXmlWithCustomDataResult = `<![CDATA[${title}]]>${site}/<![CDATA[${ + phpFeedItemWithCustomData.title +}]]>${site}${phpFeedItemWithCustomData.link}/${site}${ + phpFeedItemWithCustomData.link +}/${new Date(phpFeedItemWithCustomData.pubDate).toUTCString()}${ + phpFeedItemWithCustomData.customData +}<![CDATA[${web1FeedItemWithContent.title}]]>${site}${ + web1FeedItemWithContent.link +}/${site}${ + web1FeedItemWithContent.link +}/${new Date( + web1FeedItemWithContent.pubDate +).toUTCString()}`; // prettier-ignore const validXmlWithStylesheet = `<![CDATA[${title}]]>${site}/`; // prettier-ignore diff --git a/packages/astro/components/Shiki.js b/packages/astro/components/Shiki.js index 1a2a4b1568e2..1d1c1397d087 100644 --- a/packages/astro/components/Shiki.js +++ b/packages/astro/components/Shiki.js @@ -1,6 +1,6 @@ import { getHighlighter as getShikiHighlighter } from 'shiki'; -import { themes } from './shiki-themes.js'; import { languages } from './shiki-languages.js'; +import { themes } from './shiki-themes.js'; // Caches Promise for reuse when the same theme and langs are provided const _resolvedHighlighters = new Map(); diff --git a/packages/astro/components/shiki-languages.js b/packages/astro/components/shiki-languages.js index 2fcbc407a5d5..a72a63eb2ba6 100644 --- a/packages/astro/components/shiki-languages.js +++ b/packages/astro/components/shiki-languages.js @@ -19,158 +19,432 @@ function handleLang(grammar, language) { // prettier-ignore export const languages = { - 'abap': () => import('shiki/languages/abap.tmLanguage.json').then((mod) => handleLang(mod.default, 'abap')), - 'actionscript-3': () => import('shiki/languages/actionscript-3.tmLanguage.json').then((mod) => handleLang(mod.default, 'actionscript-3')), - 'ada': () => import('shiki/languages/ada.tmLanguage.json').then((mod) => handleLang(mod.default, 'ada')), - 'apache': () => import('shiki/languages/apache.tmLanguage.json').then((mod) => handleLang(mod.default, 'apache')), - 'apex': () => import('shiki/languages/apex.tmLanguage.json').then((mod) => handleLang(mod.default, 'apex')), - 'apl': () => import('shiki/languages/apl.tmLanguage.json').then((mod) => handleLang(mod.default, 'apl')), - 'applescript': () => import('shiki/languages/applescript.tmLanguage.json').then((mod) => handleLang(mod.default, 'applescript')), - 'ara': () => import('shiki/languages/ara.tmLanguage.json').then((mod) => handleLang(mod.default, 'ara')), - 'asm': () => import('shiki/languages/asm.tmLanguage.json').then((mod) => handleLang(mod.default, 'asm')), - 'astro': () => import('shiki/languages/astro.tmLanguage.json').then((mod) => handleLang(mod.default, 'astro')), - 'awk': () => import('shiki/languages/awk.tmLanguage.json').then((mod) => handleLang(mod.default, 'awk')), - 'ballerina': () => import('shiki/languages/ballerina.tmLanguage.json').then((mod) => handleLang(mod.default, 'ballerina')), - 'bat': () => import('shiki/languages/bat.tmLanguage.json').then((mod) => handleLang(mod.default, 'bat')), - 'berry': () => import('shiki/languages/berry.tmLanguage.json').then((mod) => handleLang(mod.default, 'berry')), - 'bibtex': () => import('shiki/languages/bibtex.tmLanguage.json').then((mod) => handleLang(mod.default, 'bibtex')), - 'bicep': () => import('shiki/languages/bicep.tmLanguage.json').then((mod) => handleLang(mod.default, 'bicep')), - 'blade': () => import('shiki/languages/blade.tmLanguage.json').then((mod) => handleLang(mod.default, 'blade')), - 'c': () => import('shiki/languages/c.tmLanguage.json').then((mod) => handleLang(mod.default, 'c')), - 'cadence': () => import('shiki/languages/cadence.tmLanguage.json').then((mod) => handleLang(mod.default, 'cadence')), - 'clarity': () => import('shiki/languages/clarity.tmLanguage.json').then((mod) => handleLang(mod.default, 'clarity')), - 'clojure': () => import('shiki/languages/clojure.tmLanguage.json').then((mod) => handleLang(mod.default, 'clojure')), - 'cmake': () => import('shiki/languages/cmake.tmLanguage.json').then((mod) => handleLang(mod.default, 'cmake')), - 'cobol': () => import('shiki/languages/cobol.tmLanguage.json').then((mod) => handleLang(mod.default, 'cobol')), - 'codeql': () => import('shiki/languages/codeql.tmLanguage.json').then((mod) => handleLang(mod.default, 'codeql')), - 'coffee': () => import('shiki/languages/coffee.tmLanguage.json').then((mod) => handleLang(mod.default, 'coffee')), - 'cpp-macro': () => import('shiki/languages/cpp-macro.tmLanguage.json').then((mod) => handleLang(mod.default, 'cpp-macro')), - 'cpp': () => import('shiki/languages/cpp.tmLanguage.json').then((mod) => handleLang(mod.default, 'cpp')), - 'crystal': () => import('shiki/languages/crystal.tmLanguage.json').then((mod) => handleLang(mod.default, 'crystal')), - 'csharp': () => import('shiki/languages/csharp.tmLanguage.json').then((mod) => handleLang(mod.default, 'csharp')), - 'css': () => import('shiki/languages/css.tmLanguage.json').then((mod) => handleLang(mod.default, 'css')), - 'cue': () => import('shiki/languages/cue.tmLanguage.json').then((mod) => handleLang(mod.default, 'cue')), - 'd': () => import('shiki/languages/d.tmLanguage.json').then((mod) => handleLang(mod.default, 'd')), - 'dart': () => import('shiki/languages/dart.tmLanguage.json').then((mod) => handleLang(mod.default, 'dart')), - 'dax': () => import('shiki/languages/dax.tmLanguage.json').then((mod) => handleLang(mod.default, 'dax')), - 'diff': () => import('shiki/languages/diff.tmLanguage.json').then((mod) => handleLang(mod.default, 'diff')), - 'docker': () => import('shiki/languages/docker.tmLanguage.json').then((mod) => handleLang(mod.default, 'docker')), - 'dream-maker': () => import('shiki/languages/dream-maker.tmLanguage.json').then((mod) => handleLang(mod.default, 'dream-maker')), - 'elixir': () => import('shiki/languages/elixir.tmLanguage.json').then((mod) => handleLang(mod.default, 'elixir')), - 'elm': () => import('shiki/languages/elm.tmLanguage.json').then((mod) => handleLang(mod.default, 'elm')), - 'erb': () => import('shiki/languages/erb.tmLanguage.json').then((mod) => handleLang(mod.default, 'erb')), - 'erlang': () => import('shiki/languages/erlang.tmLanguage.json').then((mod) => handleLang(mod.default, 'erlang')), - 'fish': () => import('shiki/languages/fish.tmLanguage.json').then((mod) => handleLang(mod.default, 'fish')), - 'fsharp': () => import('shiki/languages/fsharp.tmLanguage.json').then((mod) => handleLang(mod.default, 'fsharp')), - 'gherkin': () => import('shiki/languages/gherkin.tmLanguage.json').then((mod) => handleLang(mod.default, 'gherkin')), - 'git-commit': () => import('shiki/languages/git-commit.tmLanguage.json').then((mod) => handleLang(mod.default, 'git-commit')), - 'git-rebase': () => import('shiki/languages/git-rebase.tmLanguage.json').then((mod) => handleLang(mod.default, 'git-rebase')), - 'glsl': () => import('shiki/languages/glsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'glsl')), - 'gnuplot': () => import('shiki/languages/gnuplot.tmLanguage.json').then((mod) => handleLang(mod.default, 'gnuplot')), - 'go': () => import('shiki/languages/go.tmLanguage.json').then((mod) => handleLang(mod.default, 'go')), - 'graphql': () => import('shiki/languages/graphql.tmLanguage.json').then((mod) => handleLang(mod.default, 'graphql')), - 'groovy': () => import('shiki/languages/groovy.tmLanguage.json').then((mod) => handleLang(mod.default, 'groovy')), - 'hack': () => import('shiki/languages/hack.tmLanguage.json').then((mod) => handleLang(mod.default, 'hack')), - 'haml': () => import('shiki/languages/haml.tmLanguage.json').then((mod) => handleLang(mod.default, 'haml')), - 'handlebars': () => import('shiki/languages/handlebars.tmLanguage.json').then((mod) => handleLang(mod.default, 'handlebars')), - 'haskell': () => import('shiki/languages/haskell.tmLanguage.json').then((mod) => handleLang(mod.default, 'haskell')), - 'hcl': () => import('shiki/languages/hcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hcl')), - 'hlsl': () => import('shiki/languages/hlsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hlsl')), - 'html': () => import('shiki/languages/html.tmLanguage.json').then((mod) => handleLang(mod.default, 'html')), - 'http': () => import('shiki/languages/http.tmLanguage.json').then((mod) => handleLang(mod.default, 'http')), - 'imba': () => import('shiki/languages/imba.tmLanguage.json').then((mod) => handleLang(mod.default, 'imba')), - 'ini': () => import('shiki/languages/ini.tmLanguage.json').then((mod) => handleLang(mod.default, 'ini')), - 'java': () => import('shiki/languages/java.tmLanguage.json').then((mod) => handleLang(mod.default, 'java')), - 'javascript': () => import('shiki/languages/javascript.tmLanguage.json').then((mod) => handleLang(mod.default, 'javascript')), - 'jinja-html': () => import('shiki/languages/jinja-html.tmLanguage.json').then((mod) => handleLang(mod.default, 'jinja-html')), - 'jinja': () => import('shiki/languages/jinja.tmLanguage.json').then((mod) => handleLang(mod.default, 'jinja')), - 'jison': () => import('shiki/languages/jison.tmLanguage.json').then((mod) => handleLang(mod.default, 'jison')), - 'json': () => import('shiki/languages/json.tmLanguage.json').then((mod) => handleLang(mod.default, 'json')), - 'json5': () => import('shiki/languages/json5.tmLanguage.json').then((mod) => handleLang(mod.default, 'json5')), - 'jsonc': () => import('shiki/languages/jsonc.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsonc')), - 'jsonnet': () => import('shiki/languages/jsonnet.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsonnet')), - 'jssm': () => import('shiki/languages/jssm.tmLanguage.json').then((mod) => handleLang(mod.default, 'jssm')), - 'jsx': () => import('shiki/languages/jsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsx')), - 'julia': () => import('shiki/languages/julia.tmLanguage.json').then((mod) => handleLang(mod.default, 'julia')), - 'kotlin': () => import('shiki/languages/kotlin.tmLanguage.json').then((mod) => handleLang(mod.default, 'kotlin')), - 'latex': () => import('shiki/languages/latex.tmLanguage.json').then((mod) => handleLang(mod.default, 'latex')), - 'less': () => import('shiki/languages/less.tmLanguage.json').then((mod) => handleLang(mod.default, 'less')), - 'liquid': () => import('shiki/languages/liquid.tmLanguage.json').then((mod) => handleLang(mod.default, 'liquid')), - 'lisp': () => import('shiki/languages/lisp.tmLanguage.json').then((mod) => handleLang(mod.default, 'lisp')), - 'logo': () => import('shiki/languages/logo.tmLanguage.json').then((mod) => handleLang(mod.default, 'logo')), - 'lua': () => import('shiki/languages/lua.tmLanguage.json').then((mod) => handleLang(mod.default, 'lua')), - 'make': () => import('shiki/languages/make.tmLanguage.json').then((mod) => handleLang(mod.default, 'make')), - 'markdown': () => import('shiki/languages/markdown.tmLanguage.json').then((mod) => handleLang(mod.default, 'markdown')), - 'marko': () => import('shiki/languages/marko.tmLanguage.json').then((mod) => handleLang(mod.default, 'marko')), - 'matlab': () => import('shiki/languages/matlab.tmLanguage.json').then((mod) => handleLang(mod.default, 'matlab')), - 'mdx': () => import('shiki/languages/mdx.tmLanguage.json').then((mod) => handleLang(mod.default, 'mdx')), - 'mermaid': () => import('shiki/languages/mermaid.tmLanguage.json').then((mod) => handleLang(mod.default, 'mermaid')), - 'nginx': () => import('shiki/languages/nginx.tmLanguage.json').then((mod) => handleLang(mod.default, 'nginx')), - 'nim': () => import('shiki/languages/nim.tmLanguage.json').then((mod) => handleLang(mod.default, 'nim')), - 'nix': () => import('shiki/languages/nix.tmLanguage.json').then((mod) => handleLang(mod.default, 'nix')), - 'objective-c': () => import('shiki/languages/objective-c.tmLanguage.json').then((mod) => handleLang(mod.default, 'objective-c')), - 'objective-cpp': () => import('shiki/languages/objective-cpp.tmLanguage.json').then((mod) => handleLang(mod.default, 'objective-cpp')), - 'ocaml': () => import('shiki/languages/ocaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'ocaml')), - 'pascal': () => import('shiki/languages/pascal.tmLanguage.json').then((mod) => handleLang(mod.default, 'pascal')), - 'perl': () => import('shiki/languages/perl.tmLanguage.json').then((mod) => handleLang(mod.default, 'perl')), - 'php-html': () => import('shiki/languages/php-html.tmLanguage.json').then((mod) => handleLang(mod.default, 'php-html')), - 'php': () => import('shiki/languages/php.tmLanguage.json').then((mod) => handleLang(mod.default, 'php')), - 'plsql': () => import('shiki/languages/plsql.tmLanguage.json').then((mod) => handleLang(mod.default, 'plsql')), - 'postcss': () => import('shiki/languages/postcss.tmLanguage.json').then((mod) => handleLang(mod.default, 'postcss')), - 'powerquery': () => import('shiki/languages/powerquery.tmLanguage.json').then((mod) => handleLang(mod.default, 'powerquery')), - 'powershell': () => import('shiki/languages/powershell.tmLanguage.json').then((mod) => handleLang(mod.default, 'powershell')), - 'prisma': () => import('shiki/languages/prisma.tmLanguage.json').then((mod) => handleLang(mod.default, 'prisma')), - 'prolog': () => import('shiki/languages/prolog.tmLanguage.json').then((mod) => handleLang(mod.default, 'prolog')), - 'proto': () => import('shiki/languages/proto.tmLanguage.json').then((mod) => handleLang(mod.default, 'proto')), - 'pug': () => import('shiki/languages/pug.tmLanguage.json').then((mod) => handleLang(mod.default, 'pug')), - 'puppet': () => import('shiki/languages/puppet.tmLanguage.json').then((mod) => handleLang(mod.default, 'puppet')), - 'purescript': () => import('shiki/languages/purescript.tmLanguage.json').then((mod) => handleLang(mod.default, 'purescript')), - 'python': () => import('shiki/languages/python.tmLanguage.json').then((mod) => handleLang(mod.default, 'python')), - 'r': () => import('shiki/languages/r.tmLanguage.json').then((mod) => handleLang(mod.default, 'r')), - 'raku': () => import('shiki/languages/raku.tmLanguage.json').then((mod) => handleLang(mod.default, 'raku')), - 'razor': () => import('shiki/languages/razor.tmLanguage.json').then((mod) => handleLang(mod.default, 'razor')), - 'rel': () => import('shiki/languages/rel.tmLanguage.json').then((mod) => handleLang(mod.default, 'rel')), - 'riscv': () => import('shiki/languages/riscv.tmLanguage.json').then((mod) => handleLang(mod.default, 'riscv')), - 'rst': () => import('shiki/languages/rst.tmLanguage.json').then((mod) => handleLang(mod.default, 'rst')), - 'ruby': () => import('shiki/languages/ruby.tmLanguage.json').then((mod) => handleLang(mod.default, 'ruby')), - 'rust': () => import('shiki/languages/rust.tmLanguage.json').then((mod) => handleLang(mod.default, 'rust')), - 'sas': () => import('shiki/languages/sas.tmLanguage.json').then((mod) => handleLang(mod.default, 'sas')), - 'sass': () => import('shiki/languages/sass.tmLanguage.json').then((mod) => handleLang(mod.default, 'sass')), - 'scala': () => import('shiki/languages/scala.tmLanguage.json').then((mod) => handleLang(mod.default, 'scala')), - 'scheme': () => import('shiki/languages/scheme.tmLanguage.json').then((mod) => handleLang(mod.default, 'scheme')), - 'scss': () => import('shiki/languages/scss.tmLanguage.json').then((mod) => handleLang(mod.default, 'scss')), - 'shaderlab': () => import('shiki/languages/shaderlab.tmLanguage.json').then((mod) => handleLang(mod.default, 'shaderlab')), - 'shellscript': () => import('shiki/languages/shellscript.tmLanguage.json').then((mod) => handleLang(mod.default, 'shellscript')), - 'smalltalk': () => import('shiki/languages/smalltalk.tmLanguage.json').then((mod) => handleLang(mod.default, 'smalltalk')), - 'solidity': () => import('shiki/languages/solidity.tmLanguage.json').then((mod) => handleLang(mod.default, 'solidity')), - 'sparql': () => import('shiki/languages/sparql.tmLanguage.json').then((mod) => handleLang(mod.default, 'sparql')), - 'sql': () => import('shiki/languages/sql.tmLanguage.json').then((mod) => handleLang(mod.default, 'sql')), - 'ssh-config': () => import('shiki/languages/ssh-config.tmLanguage.json').then((mod) => handleLang(mod.default, 'ssh-config')), - 'stata': () => import('shiki/languages/stata.tmLanguage.json').then((mod) => handleLang(mod.default, 'stata')), - 'stylus': () => import('shiki/languages/stylus.tmLanguage.json').then((mod) => handleLang(mod.default, 'stylus')), - 'svelte': () => import('shiki/languages/svelte.tmLanguage.json').then((mod) => handleLang(mod.default, 'svelte')), - 'swift': () => import('shiki/languages/swift.tmLanguage.json').then((mod) => handleLang(mod.default, 'swift')), - 'system-verilog': () => import('shiki/languages/system-verilog.tmLanguage.json').then((mod) => handleLang(mod.default, 'system-verilog')), - 'tasl': () => import('shiki/languages/tasl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tasl')), - 'tcl': () => import('shiki/languages/tcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tcl')), - 'tex': () => import('shiki/languages/tex.tmLanguage.json').then((mod) => handleLang(mod.default, 'tex')), - 'toml': () => import('shiki/languages/toml.tmLanguage.json').then((mod) => handleLang(mod.default, 'toml')), - 'tsx': () => import('shiki/languages/tsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'tsx')), - 'turtle': () => import('shiki/languages/turtle.tmLanguage.json').then((mod) => handleLang(mod.default, 'turtle')), - 'twig': () => import('shiki/languages/twig.tmLanguage.json').then((mod) => handleLang(mod.default, 'twig')), - 'typescript': () => import('shiki/languages/typescript.tmLanguage.json').then((mod) => handleLang(mod.default, 'typescript')), - 'v': () => import('shiki/languages/v.tmLanguage.json').then((mod) => handleLang(mod.default, 'v')), - 'vb': () => import('shiki/languages/vb.tmLanguage.json').then((mod) => handleLang(mod.default, 'vb')), - 'verilog': () => import('shiki/languages/verilog.tmLanguage.json').then((mod) => handleLang(mod.default, 'verilog')), - 'vhdl': () => import('shiki/languages/vhdl.tmLanguage.json').then((mod) => handleLang(mod.default, 'vhdl')), - 'viml': () => import('shiki/languages/viml.tmLanguage.json').then((mod) => handleLang(mod.default, 'viml')), - 'vue-html': () => import('shiki/languages/vue-html.tmLanguage.json').then((mod) => handleLang(mod.default, 'vue-html')), - 'vue': () => import('shiki/languages/vue.tmLanguage.json').then((mod) => handleLang(mod.default, 'vue')), - 'wasm': () => import('shiki/languages/wasm.tmLanguage.json').then((mod) => handleLang(mod.default, 'wasm')), - 'wenyan': () => import('shiki/languages/wenyan.tmLanguage.json').then((mod) => handleLang(mod.default, 'wenyan')), - 'wgsl': () => import('shiki/languages/wgsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'wgsl')), - 'xml': () => import('shiki/languages/xml.tmLanguage.json').then((mod) => handleLang(mod.default, 'xml')), - 'xsl': () => import('shiki/languages/xsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'xsl')), - 'yaml': () => import('shiki/languages/yaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'yaml')), - 'zenscript': () => import('shiki/languages/zenscript.tmLanguage.json').then((mod) => handleLang(mod.default, 'zenscript')), + abap: () => + import('shiki/languages/abap.tmLanguage.json').then((mod) => handleLang(mod.default, 'abap')), + 'actionscript-3': () => + import('shiki/languages/actionscript-3.tmLanguage.json').then((mod) => + handleLang(mod.default, 'actionscript-3') + ), + ada: () => + import('shiki/languages/ada.tmLanguage.json').then((mod) => handleLang(mod.default, 'ada')), + apache: () => + import('shiki/languages/apache.tmLanguage.json').then((mod) => + handleLang(mod.default, 'apache') + ), + apex: () => + import('shiki/languages/apex.tmLanguage.json').then((mod) => handleLang(mod.default, 'apex')), + apl: () => + import('shiki/languages/apl.tmLanguage.json').then((mod) => handleLang(mod.default, 'apl')), + applescript: () => + import('shiki/languages/applescript.tmLanguage.json').then((mod) => + handleLang(mod.default, 'applescript') + ), + ara: () => + import('shiki/languages/ara.tmLanguage.json').then((mod) => handleLang(mod.default, 'ara')), + asm: () => + import('shiki/languages/asm.tmLanguage.json').then((mod) => handleLang(mod.default, 'asm')), + astro: () => + import('shiki/languages/astro.tmLanguage.json').then((mod) => handleLang(mod.default, 'astro')), + awk: () => + import('shiki/languages/awk.tmLanguage.json').then((mod) => handleLang(mod.default, 'awk')), + ballerina: () => + import('shiki/languages/ballerina.tmLanguage.json').then((mod) => + handleLang(mod.default, 'ballerina') + ), + bat: () => + import('shiki/languages/bat.tmLanguage.json').then((mod) => handleLang(mod.default, 'bat')), + berry: () => + import('shiki/languages/berry.tmLanguage.json').then((mod) => handleLang(mod.default, 'berry')), + bibtex: () => + import('shiki/languages/bibtex.tmLanguage.json').then((mod) => + handleLang(mod.default, 'bibtex') + ), + bicep: () => + import('shiki/languages/bicep.tmLanguage.json').then((mod) => handleLang(mod.default, 'bicep')), + blade: () => + import('shiki/languages/blade.tmLanguage.json').then((mod) => handleLang(mod.default, 'blade')), + c: () => import('shiki/languages/c.tmLanguage.json').then((mod) => handleLang(mod.default, 'c')), + cadence: () => + import('shiki/languages/cadence.tmLanguage.json').then((mod) => + handleLang(mod.default, 'cadence') + ), + clarity: () => + import('shiki/languages/clarity.tmLanguage.json').then((mod) => + handleLang(mod.default, 'clarity') + ), + clojure: () => + import('shiki/languages/clojure.tmLanguage.json').then((mod) => + handleLang(mod.default, 'clojure') + ), + cmake: () => + import('shiki/languages/cmake.tmLanguage.json').then((mod) => handleLang(mod.default, 'cmake')), + cobol: () => + import('shiki/languages/cobol.tmLanguage.json').then((mod) => handleLang(mod.default, 'cobol')), + codeql: () => + import('shiki/languages/codeql.tmLanguage.json').then((mod) => + handleLang(mod.default, 'codeql') + ), + coffee: () => + import('shiki/languages/coffee.tmLanguage.json').then((mod) => + handleLang(mod.default, 'coffee') + ), + 'cpp-macro': () => + import('shiki/languages/cpp-macro.tmLanguage.json').then((mod) => + handleLang(mod.default, 'cpp-macro') + ), + cpp: () => + import('shiki/languages/cpp.tmLanguage.json').then((mod) => handleLang(mod.default, 'cpp')), + crystal: () => + import('shiki/languages/crystal.tmLanguage.json').then((mod) => + handleLang(mod.default, 'crystal') + ), + csharp: () => + import('shiki/languages/csharp.tmLanguage.json').then((mod) => + handleLang(mod.default, 'csharp') + ), + css: () => + import('shiki/languages/css.tmLanguage.json').then((mod) => handleLang(mod.default, 'css')), + cue: () => + import('shiki/languages/cue.tmLanguage.json').then((mod) => handleLang(mod.default, 'cue')), + d: () => import('shiki/languages/d.tmLanguage.json').then((mod) => handleLang(mod.default, 'd')), + dart: () => + import('shiki/languages/dart.tmLanguage.json').then((mod) => handleLang(mod.default, 'dart')), + dax: () => + import('shiki/languages/dax.tmLanguage.json').then((mod) => handleLang(mod.default, 'dax')), + diff: () => + import('shiki/languages/diff.tmLanguage.json').then((mod) => handleLang(mod.default, 'diff')), + docker: () => + import('shiki/languages/docker.tmLanguage.json').then((mod) => + handleLang(mod.default, 'docker') + ), + 'dream-maker': () => + import('shiki/languages/dream-maker.tmLanguage.json').then((mod) => + handleLang(mod.default, 'dream-maker') + ), + elixir: () => + import('shiki/languages/elixir.tmLanguage.json').then((mod) => + handleLang(mod.default, 'elixir') + ), + elm: () => + import('shiki/languages/elm.tmLanguage.json').then((mod) => handleLang(mod.default, 'elm')), + erb: () => + import('shiki/languages/erb.tmLanguage.json').then((mod) => handleLang(mod.default, 'erb')), + erlang: () => + import('shiki/languages/erlang.tmLanguage.json').then((mod) => + handleLang(mod.default, 'erlang') + ), + fish: () => + import('shiki/languages/fish.tmLanguage.json').then((mod) => handleLang(mod.default, 'fish')), + fsharp: () => + import('shiki/languages/fsharp.tmLanguage.json').then((mod) => + handleLang(mod.default, 'fsharp') + ), + gherkin: () => + import('shiki/languages/gherkin.tmLanguage.json').then((mod) => + handleLang(mod.default, 'gherkin') + ), + 'git-commit': () => + import('shiki/languages/git-commit.tmLanguage.json').then((mod) => + handleLang(mod.default, 'git-commit') + ), + 'git-rebase': () => + import('shiki/languages/git-rebase.tmLanguage.json').then((mod) => + handleLang(mod.default, 'git-rebase') + ), + glsl: () => + import('shiki/languages/glsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'glsl')), + gnuplot: () => + import('shiki/languages/gnuplot.tmLanguage.json').then((mod) => + handleLang(mod.default, 'gnuplot') + ), + go: () => + import('shiki/languages/go.tmLanguage.json').then((mod) => handleLang(mod.default, 'go')), + graphql: () => + import('shiki/languages/graphql.tmLanguage.json').then((mod) => + handleLang(mod.default, 'graphql') + ), + groovy: () => + import('shiki/languages/groovy.tmLanguage.json').then((mod) => + handleLang(mod.default, 'groovy') + ), + hack: () => + import('shiki/languages/hack.tmLanguage.json').then((mod) => handleLang(mod.default, 'hack')), + haml: () => + import('shiki/languages/haml.tmLanguage.json').then((mod) => handleLang(mod.default, 'haml')), + handlebars: () => + import('shiki/languages/handlebars.tmLanguage.json').then((mod) => + handleLang(mod.default, 'handlebars') + ), + haskell: () => + import('shiki/languages/haskell.tmLanguage.json').then((mod) => + handleLang(mod.default, 'haskell') + ), + hcl: () => + import('shiki/languages/hcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hcl')), + hlsl: () => + import('shiki/languages/hlsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'hlsl')), + html: () => + import('shiki/languages/html.tmLanguage.json').then((mod) => handleLang(mod.default, 'html')), + http: () => + import('shiki/languages/http.tmLanguage.json').then((mod) => handleLang(mod.default, 'http')), + imba: () => + import('shiki/languages/imba.tmLanguage.json').then((mod) => handleLang(mod.default, 'imba')), + ini: () => + import('shiki/languages/ini.tmLanguage.json').then((mod) => handleLang(mod.default, 'ini')), + java: () => + import('shiki/languages/java.tmLanguage.json').then((mod) => handleLang(mod.default, 'java')), + javascript: () => + import('shiki/languages/javascript.tmLanguage.json').then((mod) => + handleLang(mod.default, 'javascript') + ), + 'jinja-html': () => + import('shiki/languages/jinja-html.tmLanguage.json').then((mod) => + handleLang(mod.default, 'jinja-html') + ), + jinja: () => + import('shiki/languages/jinja.tmLanguage.json').then((mod) => handleLang(mod.default, 'jinja')), + jison: () => + import('shiki/languages/jison.tmLanguage.json').then((mod) => handleLang(mod.default, 'jison')), + json: () => + import('shiki/languages/json.tmLanguage.json').then((mod) => handleLang(mod.default, 'json')), + json5: () => + import('shiki/languages/json5.tmLanguage.json').then((mod) => handleLang(mod.default, 'json5')), + jsonc: () => + import('shiki/languages/jsonc.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsonc')), + jsonnet: () => + import('shiki/languages/jsonnet.tmLanguage.json').then((mod) => + handleLang(mod.default, 'jsonnet') + ), + jssm: () => + import('shiki/languages/jssm.tmLanguage.json').then((mod) => handleLang(mod.default, 'jssm')), + jsx: () => + import('shiki/languages/jsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'jsx')), + julia: () => + import('shiki/languages/julia.tmLanguage.json').then((mod) => handleLang(mod.default, 'julia')), + kotlin: () => + import('shiki/languages/kotlin.tmLanguage.json').then((mod) => + handleLang(mod.default, 'kotlin') + ), + latex: () => + import('shiki/languages/latex.tmLanguage.json').then((mod) => handleLang(mod.default, 'latex')), + less: () => + import('shiki/languages/less.tmLanguage.json').then((mod) => handleLang(mod.default, 'less')), + liquid: () => + import('shiki/languages/liquid.tmLanguage.json').then((mod) => + handleLang(mod.default, 'liquid') + ), + lisp: () => + import('shiki/languages/lisp.tmLanguage.json').then((mod) => handleLang(mod.default, 'lisp')), + logo: () => + import('shiki/languages/logo.tmLanguage.json').then((mod) => handleLang(mod.default, 'logo')), + lua: () => + import('shiki/languages/lua.tmLanguage.json').then((mod) => handleLang(mod.default, 'lua')), + make: () => + import('shiki/languages/make.tmLanguage.json').then((mod) => handleLang(mod.default, 'make')), + markdown: () => + import('shiki/languages/markdown.tmLanguage.json').then((mod) => + handleLang(mod.default, 'markdown') + ), + marko: () => + import('shiki/languages/marko.tmLanguage.json').then((mod) => handleLang(mod.default, 'marko')), + matlab: () => + import('shiki/languages/matlab.tmLanguage.json').then((mod) => + handleLang(mod.default, 'matlab') + ), + mdx: () => + import('shiki/languages/mdx.tmLanguage.json').then((mod) => handleLang(mod.default, 'mdx')), + mermaid: () => + import('shiki/languages/mermaid.tmLanguage.json').then((mod) => + handleLang(mod.default, 'mermaid') + ), + nginx: () => + import('shiki/languages/nginx.tmLanguage.json').then((mod) => handleLang(mod.default, 'nginx')), + nim: () => + import('shiki/languages/nim.tmLanguage.json').then((mod) => handleLang(mod.default, 'nim')), + nix: () => + import('shiki/languages/nix.tmLanguage.json').then((mod) => handleLang(mod.default, 'nix')), + 'objective-c': () => + import('shiki/languages/objective-c.tmLanguage.json').then((mod) => + handleLang(mod.default, 'objective-c') + ), + 'objective-cpp': () => + import('shiki/languages/objective-cpp.tmLanguage.json').then((mod) => + handleLang(mod.default, 'objective-cpp') + ), + ocaml: () => + import('shiki/languages/ocaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'ocaml')), + pascal: () => + import('shiki/languages/pascal.tmLanguage.json').then((mod) => + handleLang(mod.default, 'pascal') + ), + perl: () => + import('shiki/languages/perl.tmLanguage.json').then((mod) => handleLang(mod.default, 'perl')), + 'php-html': () => + import('shiki/languages/php-html.tmLanguage.json').then((mod) => + handleLang(mod.default, 'php-html') + ), + php: () => + import('shiki/languages/php.tmLanguage.json').then((mod) => handleLang(mod.default, 'php')), + plsql: () => + import('shiki/languages/plsql.tmLanguage.json').then((mod) => handleLang(mod.default, 'plsql')), + postcss: () => + import('shiki/languages/postcss.tmLanguage.json').then((mod) => + handleLang(mod.default, 'postcss') + ), + powerquery: () => + import('shiki/languages/powerquery.tmLanguage.json').then((mod) => + handleLang(mod.default, 'powerquery') + ), + powershell: () => + import('shiki/languages/powershell.tmLanguage.json').then((mod) => + handleLang(mod.default, 'powershell') + ), + prisma: () => + import('shiki/languages/prisma.tmLanguage.json').then((mod) => + handleLang(mod.default, 'prisma') + ), + prolog: () => + import('shiki/languages/prolog.tmLanguage.json').then((mod) => + handleLang(mod.default, 'prolog') + ), + proto: () => + import('shiki/languages/proto.tmLanguage.json').then((mod) => handleLang(mod.default, 'proto')), + pug: () => + import('shiki/languages/pug.tmLanguage.json').then((mod) => handleLang(mod.default, 'pug')), + puppet: () => + import('shiki/languages/puppet.tmLanguage.json').then((mod) => + handleLang(mod.default, 'puppet') + ), + purescript: () => + import('shiki/languages/purescript.tmLanguage.json').then((mod) => + handleLang(mod.default, 'purescript') + ), + python: () => + import('shiki/languages/python.tmLanguage.json').then((mod) => + handleLang(mod.default, 'python') + ), + r: () => import('shiki/languages/r.tmLanguage.json').then((mod) => handleLang(mod.default, 'r')), + raku: () => + import('shiki/languages/raku.tmLanguage.json').then((mod) => handleLang(mod.default, 'raku')), + razor: () => + import('shiki/languages/razor.tmLanguage.json').then((mod) => handleLang(mod.default, 'razor')), + rel: () => + import('shiki/languages/rel.tmLanguage.json').then((mod) => handleLang(mod.default, 'rel')), + riscv: () => + import('shiki/languages/riscv.tmLanguage.json').then((mod) => handleLang(mod.default, 'riscv')), + rst: () => + import('shiki/languages/rst.tmLanguage.json').then((mod) => handleLang(mod.default, 'rst')), + ruby: () => + import('shiki/languages/ruby.tmLanguage.json').then((mod) => handleLang(mod.default, 'ruby')), + rust: () => + import('shiki/languages/rust.tmLanguage.json').then((mod) => handleLang(mod.default, 'rust')), + sas: () => + import('shiki/languages/sas.tmLanguage.json').then((mod) => handleLang(mod.default, 'sas')), + sass: () => + import('shiki/languages/sass.tmLanguage.json').then((mod) => handleLang(mod.default, 'sass')), + scala: () => + import('shiki/languages/scala.tmLanguage.json').then((mod) => handleLang(mod.default, 'scala')), + scheme: () => + import('shiki/languages/scheme.tmLanguage.json').then((mod) => + handleLang(mod.default, 'scheme') + ), + scss: () => + import('shiki/languages/scss.tmLanguage.json').then((mod) => handleLang(mod.default, 'scss')), + shaderlab: () => + import('shiki/languages/shaderlab.tmLanguage.json').then((mod) => + handleLang(mod.default, 'shaderlab') + ), + shellscript: () => + import('shiki/languages/shellscript.tmLanguage.json').then((mod) => + handleLang(mod.default, 'shellscript') + ), + smalltalk: () => + import('shiki/languages/smalltalk.tmLanguage.json').then((mod) => + handleLang(mod.default, 'smalltalk') + ), + solidity: () => + import('shiki/languages/solidity.tmLanguage.json').then((mod) => + handleLang(mod.default, 'solidity') + ), + sparql: () => + import('shiki/languages/sparql.tmLanguage.json').then((mod) => + handleLang(mod.default, 'sparql') + ), + sql: () => + import('shiki/languages/sql.tmLanguage.json').then((mod) => handleLang(mod.default, 'sql')), + 'ssh-config': () => + import('shiki/languages/ssh-config.tmLanguage.json').then((mod) => + handleLang(mod.default, 'ssh-config') + ), + stata: () => + import('shiki/languages/stata.tmLanguage.json').then((mod) => handleLang(mod.default, 'stata')), + stylus: () => + import('shiki/languages/stylus.tmLanguage.json').then((mod) => + handleLang(mod.default, 'stylus') + ), + svelte: () => + import('shiki/languages/svelte.tmLanguage.json').then((mod) => + handleLang(mod.default, 'svelte') + ), + swift: () => + import('shiki/languages/swift.tmLanguage.json').then((mod) => handleLang(mod.default, 'swift')), + 'system-verilog': () => + import('shiki/languages/system-verilog.tmLanguage.json').then((mod) => + handleLang(mod.default, 'system-verilog') + ), + tasl: () => + import('shiki/languages/tasl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tasl')), + tcl: () => + import('shiki/languages/tcl.tmLanguage.json').then((mod) => handleLang(mod.default, 'tcl')), + tex: () => + import('shiki/languages/tex.tmLanguage.json').then((mod) => handleLang(mod.default, 'tex')), + toml: () => + import('shiki/languages/toml.tmLanguage.json').then((mod) => handleLang(mod.default, 'toml')), + tsx: () => + import('shiki/languages/tsx.tmLanguage.json').then((mod) => handleLang(mod.default, 'tsx')), + turtle: () => + import('shiki/languages/turtle.tmLanguage.json').then((mod) => + handleLang(mod.default, 'turtle') + ), + twig: () => + import('shiki/languages/twig.tmLanguage.json').then((mod) => handleLang(mod.default, 'twig')), + typescript: () => + import('shiki/languages/typescript.tmLanguage.json').then((mod) => + handleLang(mod.default, 'typescript') + ), + v: () => import('shiki/languages/v.tmLanguage.json').then((mod) => handleLang(mod.default, 'v')), + vb: () => + import('shiki/languages/vb.tmLanguage.json').then((mod) => handleLang(mod.default, 'vb')), + verilog: () => + import('shiki/languages/verilog.tmLanguage.json').then((mod) => + handleLang(mod.default, 'verilog') + ), + vhdl: () => + import('shiki/languages/vhdl.tmLanguage.json').then((mod) => handleLang(mod.default, 'vhdl')), + viml: () => + import('shiki/languages/viml.tmLanguage.json').then((mod) => handleLang(mod.default, 'viml')), + 'vue-html': () => + import('shiki/languages/vue-html.tmLanguage.json').then((mod) => + handleLang(mod.default, 'vue-html') + ), + vue: () => + import('shiki/languages/vue.tmLanguage.json').then((mod) => handleLang(mod.default, 'vue')), + wasm: () => + import('shiki/languages/wasm.tmLanguage.json').then((mod) => handleLang(mod.default, 'wasm')), + wenyan: () => + import('shiki/languages/wenyan.tmLanguage.json').then((mod) => + handleLang(mod.default, 'wenyan') + ), + wgsl: () => + import('shiki/languages/wgsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'wgsl')), + xml: () => + import('shiki/languages/xml.tmLanguage.json').then((mod) => handleLang(mod.default, 'xml')), + xsl: () => + import('shiki/languages/xsl.tmLanguage.json').then((mod) => handleLang(mod.default, 'xsl')), + yaml: () => + import('shiki/languages/yaml.tmLanguage.json').then((mod) => handleLang(mod.default, 'yaml')), + zenscript: () => + import('shiki/languages/zenscript.tmLanguage.json').then((mod) => + handleLang(mod.default, 'zenscript') + ), }; diff --git a/packages/astro/components/shiki-themes.js b/packages/astro/components/shiki-themes.js index 8f6c4fccdfc5..512d9747b0a3 100644 --- a/packages/astro/components/shiki-themes.js +++ b/packages/astro/components/shiki-themes.js @@ -5,33 +5,38 @@ // prettier-ignore export const themes = { - 'css-variables': () => import('shiki/themes/css-variables.json').then(mod => mod.default), - 'dark-plus': () => import('shiki/themes/dark-plus.json').then(mod => mod.default), - 'dracula-soft': () => import('shiki/themes/dracula-soft.json').then(mod => mod.default), - 'dracula': () => import('shiki/themes/dracula.json').then(mod => mod.default), - 'github-dark-dimmed': () => import('shiki/themes/github-dark-dimmed.json').then(mod => mod.default), - 'github-dark': () => import('shiki/themes/github-dark.json').then(mod => mod.default), - 'github-light': () => import('shiki/themes/github-light.json').then(mod => mod.default), - 'hc_light': () => import('shiki/themes/hc_light.json').then(mod => mod.default), - 'light-plus': () => import('shiki/themes/light-plus.json').then(mod => mod.default), - 'material-theme-darker': () => import('shiki/themes/material-theme-darker.json').then(mod => mod.default), - 'material-theme-lighter': () => import('shiki/themes/material-theme-lighter.json').then(mod => mod.default), - 'material-theme-ocean': () => import('shiki/themes/material-theme-ocean.json').then(mod => mod.default), - 'material-theme-palenight': () => import('shiki/themes/material-theme-palenight.json').then(mod => mod.default), - 'material-theme': () => import('shiki/themes/material-theme.json').then(mod => mod.default), - 'min-dark': () => import('shiki/themes/min-dark.json').then(mod => mod.default), - 'min-light': () => import('shiki/themes/min-light.json').then(mod => mod.default), - 'monokai': () => import('shiki/themes/monokai.json').then(mod => mod.default), - 'nord': () => import('shiki/themes/nord.json').then(mod => mod.default), - 'one-dark-pro': () => import('shiki/themes/one-dark-pro.json').then(mod => mod.default), - 'poimandres': () => import('shiki/themes/poimandres.json').then(mod => mod.default), - 'rose-pine-dawn': () => import('shiki/themes/rose-pine-dawn.json').then(mod => mod.default), - 'rose-pine-moon': () => import('shiki/themes/rose-pine-moon.json').then(mod => mod.default), - 'rose-pine': () => import('shiki/themes/rose-pine.json').then(mod => mod.default), - 'slack-dark': () => import('shiki/themes/slack-dark.json').then(mod => mod.default), - 'slack-ochin': () => import('shiki/themes/slack-ochin.json').then(mod => mod.default), - 'solarized-dark': () => import('shiki/themes/solarized-dark.json').then(mod => mod.default), - 'solarized-light': () => import('shiki/themes/solarized-light.json').then(mod => mod.default), - 'vitesse-dark': () => import('shiki/themes/vitesse-dark.json').then(mod => mod.default), - 'vitesse-light': () => import('shiki/themes/vitesse-light.json').then(mod => mod.default), + 'css-variables': () => import('shiki/themes/css-variables.json').then((mod) => mod.default), + 'dark-plus': () => import('shiki/themes/dark-plus.json').then((mod) => mod.default), + 'dracula-soft': () => import('shiki/themes/dracula-soft.json').then((mod) => mod.default), + dracula: () => import('shiki/themes/dracula.json').then((mod) => mod.default), + 'github-dark-dimmed': () => + import('shiki/themes/github-dark-dimmed.json').then((mod) => mod.default), + 'github-dark': () => import('shiki/themes/github-dark.json').then((mod) => mod.default), + 'github-light': () => import('shiki/themes/github-light.json').then((mod) => mod.default), + hc_light: () => import('shiki/themes/hc_light.json').then((mod) => mod.default), + 'light-plus': () => import('shiki/themes/light-plus.json').then((mod) => mod.default), + 'material-theme-darker': () => + import('shiki/themes/material-theme-darker.json').then((mod) => mod.default), + 'material-theme-lighter': () => + import('shiki/themes/material-theme-lighter.json').then((mod) => mod.default), + 'material-theme-ocean': () => + import('shiki/themes/material-theme-ocean.json').then((mod) => mod.default), + 'material-theme-palenight': () => + import('shiki/themes/material-theme-palenight.json').then((mod) => mod.default), + 'material-theme': () => import('shiki/themes/material-theme.json').then((mod) => mod.default), + 'min-dark': () => import('shiki/themes/min-dark.json').then((mod) => mod.default), + 'min-light': () => import('shiki/themes/min-light.json').then((mod) => mod.default), + monokai: () => import('shiki/themes/monokai.json').then((mod) => mod.default), + nord: () => import('shiki/themes/nord.json').then((mod) => mod.default), + 'one-dark-pro': () => import('shiki/themes/one-dark-pro.json').then((mod) => mod.default), + poimandres: () => import('shiki/themes/poimandres.json').then((mod) => mod.default), + 'rose-pine-dawn': () => import('shiki/themes/rose-pine-dawn.json').then((mod) => mod.default), + 'rose-pine-moon': () => import('shiki/themes/rose-pine-moon.json').then((mod) => mod.default), + 'rose-pine': () => import('shiki/themes/rose-pine.json').then((mod) => mod.default), + 'slack-dark': () => import('shiki/themes/slack-dark.json').then((mod) => mod.default), + 'slack-ochin': () => import('shiki/themes/slack-ochin.json').then((mod) => mod.default), + 'solarized-dark': () => import('shiki/themes/solarized-dark.json').then((mod) => mod.default), + 'solarized-light': () => import('shiki/themes/solarized-light.json').then((mod) => mod.default), + 'vitesse-dark': () => import('shiki/themes/vitesse-dark.json').then((mod) => mod.default), + 'vitesse-light': () => import('shiki/themes/vitesse-light.json').then((mod) => mod.default), }; diff --git a/packages/astro/content-types.template.d.ts b/packages/astro/content-types.template.d.ts index eb560193d4a7..66e48ca285b0 100644 --- a/packages/astro/content-types.template.d.ts +++ b/packages/astro/content-types.template.d.ts @@ -32,7 +32,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'> ] >; }>; @@ -72,7 +72,7 @@ declare module 'astro:content' { export function getEntryBySlug< C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}), + E extends ValidContentEntrySlug | (string & {}) >( collection: C, // Note that this has to accept a regular string too, for SSR @@ -97,7 +97,7 @@ declare module 'astro:content' { export function getEntry< C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}), + E extends ValidContentEntrySlug | (string & {}) >(entry: { collection: C; slug: E; @@ -106,7 +106,7 @@ declare module 'astro:content' { : Promise | undefined>; export function getEntry< C extends keyof DataEntryMap, - E extends keyof DataEntryMap[C] | (string & {}), + E extends keyof DataEntryMap[C] | (string & {}) >(entry: { collection: C; id: E; @@ -115,7 +115,7 @@ declare module 'astro:content' { : Promise | undefined>; export function getEntry< C extends keyof ContentEntryMap, - E extends ValidContentEntrySlug | (string & {}), + E extends ValidContentEntrySlug | (string & {}) >( collection: C, slug: E @@ -124,7 +124,7 @@ declare module 'astro:content' { : Promise | undefined>; export function getEntry< C extends keyof DataEntryMap, - E extends keyof DataEntryMap[C] | (string & {}), + E extends keyof DataEntryMap[C] | (string & {}) >( collection: C, id: E diff --git a/packages/astro/e2e/custom-client-directives.test.js b/packages/astro/e2e/custom-client-directives.test.js index fec5ef9a1104..e249868aea62 100644 --- a/packages/astro/e2e/custom-client-directives.test.js +++ b/packages/astro/e2e/custom-client-directives.test.js @@ -1,6 +1,6 @@ import { expect } from '@playwright/test'; -import { testFactory, waitForHydrate } from './test-utils.js'; import testAdapter from '../test/test-adapter.js'; +import { testFactory, waitForHydrate } from './test-utils.js'; const test = testFactory({ root: './fixtures/custom-client-directives/', diff --git a/packages/astro/e2e/error-cyclic.test.js b/packages/astro/e2e/error-cyclic.test.js index 32cbc050ac07..84f4d1d1dce3 100644 --- a/packages/astro/e2e/error-cyclic.test.js +++ b/packages/astro/e2e/error-cyclic.test.js @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { testFactory, getErrorOverlayContent } from './test-utils.js'; +import { getErrorOverlayContent, testFactory } from './test-utils.js'; const test = testFactory({ root: './fixtures/error-cyclic/', diff --git a/packages/astro/e2e/error-sass.test.js b/packages/astro/e2e/error-sass.test.js index a4e68f57b797..11862fb86e65 100644 --- a/packages/astro/e2e/error-sass.test.js +++ b/packages/astro/e2e/error-sass.test.js @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { testFactory, getErrorOverlayContent } from './test-utils.js'; +import { getErrorOverlayContent, testFactory } from './test-utils.js'; const test = testFactory({ root: './fixtures/error-sass/', diff --git a/packages/astro/e2e/nested-recursive.test.js b/packages/astro/e2e/nested-recursive.test.js index 262cd67723e9..8271c6557587 100644 --- a/packages/astro/e2e/nested-recursive.test.js +++ b/packages/astro/e2e/nested-recursive.test.js @@ -1,4 +1,4 @@ -import { test as base, expect } from '@playwright/test'; +import { expect, test as base } from '@playwright/test'; import { loadFixture, waitForHydrate } from './test-utils.js'; const test = base.extend({ diff --git a/packages/astro/e2e/test-utils.js b/packages/astro/e2e/test-utils.js index 0768bff81bc8..c2edf4b0b040 100644 --- a/packages/astro/e2e/test-utils.js +++ b/packages/astro/e2e/test-utils.js @@ -1,7 +1,7 @@ -import { expect, test as testBase } from '@playwright/test'; import fs from 'node:fs/promises'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import { expect, test as testBase } from '@playwright/test'; import { loadFixture as baseLoadFixture } from '../test/test-utils.js'; export const isWindows = process.platform === 'win32'; diff --git a/packages/astro/e2e/vue-component.test.js b/packages/astro/e2e/vue-component.test.js index b7371cd1b1f0..114e5135253b 100644 --- a/packages/astro/e2e/vue-component.test.js +++ b/packages/astro/e2e/vue-component.test.js @@ -1,5 +1,5 @@ -import { prepareTestFactory } from './shared-component-tests.js'; import { expect } from '@playwright/test'; +import { prepareTestFactory } from './shared-component-tests.js'; const { test, createTests } = prepareTestFactory({ root: './fixtures/vue-component/' }); const config = { diff --git a/packages/astro/performance/content-benchmark.mjs b/packages/astro/performance/content-benchmark.mjs index 14f9b598e3b3..cebebd5eba2f 100644 --- a/packages/astro/performance/content-benchmark.mjs +++ b/packages/astro/performance/content-benchmark.mjs @@ -1,10 +1,10 @@ /* eslint-disable no-console */ import { fileURLToPath } from 'node:url'; +import { bold, cyan, dim } from 'kleur/colors'; +import yargs from 'yargs-parser'; import { loadFixture } from '../test/test-utils.js'; import { generatePosts } from './scripts/generate-posts.mjs'; -import yargs from 'yargs-parser'; -import { cyan, bold, dim } from 'kleur/colors'; // Skip nonessential remark / rehype plugins for a fair comparison. // This includes heading ID generation, syntax highlighting, GFM, and Smartypants. diff --git a/packages/astro/src/assets/build/generate.ts b/packages/astro/src/assets/build/generate.ts index dfc0d9a0d25f..db1cc4e2240a 100644 --- a/packages/astro/src/assets/build/generate.ts +++ b/packages/astro/src/assets/build/generate.ts @@ -6,7 +6,7 @@ import { isServerLikeOutput } from '../../prerender/utils.js'; import { getConfiguredImageService, isESMImportedImage } from '../internal.js'; import type { LocalImageService } from '../services/service.js'; import type { ImageMetadata, ImageTransform } from '../types.js'; -import { loadRemoteImage, type RemoteCacheEntry } from './remote.js'; +import { type RemoteCacheEntry, loadRemoteImage } from './remote.js'; interface GenerationDataUncached { cached: false; diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index 9d2c9eb0e1d8..c09ecfe7c733 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -1,7 +1,7 @@ import { isRemotePath } from '@astrojs/internal-helpers/path'; import type { AstroConfig, AstroSettings } from '../@types/astro.js'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; -import { isLocalService, type ImageService } from './services/service.js'; +import { type ImageService, isLocalService } from './services/service.js'; import type { GetImageResult, ImageMetadata, diff --git a/packages/astro/src/assets/services/noop.ts b/packages/astro/src/assets/services/noop.ts index d57ffeb2728d..3dbc4fa5e58e 100644 --- a/packages/astro/src/assets/services/noop.ts +++ b/packages/astro/src/assets/services/noop.ts @@ -1,4 +1,4 @@ -import { baseService, type LocalImageService } from './service.js'; +import { type LocalImageService, baseService } from './service.js'; // Empty service used for platforms that neither support Squoosh or Sharp. const noopService: LocalImageService = { diff --git a/packages/astro/src/assets/services/sharp.ts b/packages/astro/src/assets/services/sharp.ts index 0819ffcd13bf..60c97da9d26f 100644 --- a/packages/astro/src/assets/services/sharp.ts +++ b/packages/astro/src/assets/services/sharp.ts @@ -2,10 +2,10 @@ import type { FormatEnum } from 'sharp'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import type { ImageOutputFormat, ImageQualityPreset } from '../types.js'; import { - baseService, - parseQuality, type BaseServiceTransform, type LocalImageService, + baseService, + parseQuality, } from './service.js'; let sharp: typeof import('sharp'); diff --git a/packages/astro/src/assets/services/squoosh.ts b/packages/astro/src/assets/services/squoosh.ts index 4ba78f8d3898..c02bf106451a 100644 --- a/packages/astro/src/assets/services/squoosh.ts +++ b/packages/astro/src/assets/services/squoosh.ts @@ -3,10 +3,10 @@ import type { ImageOutputFormat, ImageQualityPreset } from '../types.js'; import { imageMetadata } from '../utils/metadata.js'; import { - baseService, - parseQuality, type BaseServiceTransform, type LocalImageService, + baseService, + parseQuality, } from './service.js'; import { processBuffer } from './vendor/squoosh/image-pool.js'; import type { Operation } from './vendor/squoosh/image.js'; diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 0bf740d573bc..e50dd9282fb5 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -5,8 +5,8 @@ import type { ImageService } from './services/service.js'; export type ImageQualityPreset = 'low' | 'mid' | 'high' | 'max' | (string & {}); export type ImageQuality = ImageQualityPreset | number; -export type ImageInputFormat = (typeof VALID_INPUT_FORMATS)[number]; -export type ImageOutputFormat = (typeof VALID_OUTPUT_FORMATS)[number] | (string & {}); +export type ImageInputFormat = typeof VALID_INPUT_FORMATS[number]; +export type ImageOutputFormat = typeof VALID_OUTPUT_FORMATS[number] | (string & {}); declare global { // eslint-disable-next-line no-var diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index 62cec7a7193e..ae3c6a64e15b 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -1,10 +1,10 @@ +import fsMod, { existsSync, promises as fs } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import boxen from 'boxen'; import { diffWords } from 'diff'; import { execa } from 'execa'; import { bold, cyan, dim, green, magenta, red, yellow } from 'kleur/colors'; -import fsMod, { existsSync, promises as fs } from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath, pathToFileURL } from 'node:url'; import ora from 'ora'; import preferredPM from 'preferred-pm'; import prompts from 'prompts'; @@ -12,9 +12,9 @@ import type yargs from 'yargs-parser'; import { loadTSConfig, resolveConfigPath, resolveRoot } from '../../core/config/index.js'; import { defaultTSConfig, + type frameworkWithTSSettings, presets, updateTSConfigForFramework, - type frameworkWithTSSettings, } from '../../core/config/tsconfig.js'; import type { Logger } from '../../core/logger/core.js'; import * as msg from '../../core/messages.js'; diff --git a/packages/astro/src/cli/flags.ts b/packages/astro/src/cli/flags.ts index 54177e998585..cbcdb4a30644 100644 --- a/packages/astro/src/cli/flags.ts +++ b/packages/astro/src/cli/flags.ts @@ -1,6 +1,6 @@ import type { Arguments as Flags } from 'yargs-parser'; import type { AstroInlineConfig } from '../@types/astro.js'; -import { Logger, type LogOptions } from '../core/logger/core.js'; +import { type LogOptions, Logger } from '../core/logger/core.js'; import { nodeLogDestination } from '../core/logger/node.js'; export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig { diff --git a/packages/astro/src/cli/install-package.ts b/packages/astro/src/cli/install-package.ts index 689f81e3e879..35e8dd37ccb7 100644 --- a/packages/astro/src/cli/install-package.ts +++ b/packages/astro/src/cli/install-package.ts @@ -1,3 +1,4 @@ +import { createRequire } from 'node:module'; import boxen from 'boxen'; import { execa } from 'execa'; import { bold, cyan, dim, magenta } from 'kleur/colors'; diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts index 7b8654ee7037..4f4447142fbc 100644 --- a/packages/astro/src/content/runtime.ts +++ b/packages/astro/src/content/runtime.ts @@ -3,6 +3,7 @@ import { ZodIssueCode, string as zodString } from 'zod'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { prependForwardSlash } from '../core/path.js'; import { + type AstroComponentFactory, createComponent, createHeadAndContent, renderComponent, @@ -10,7 +11,6 @@ import { renderTemplate, renderUniqueStylesheet, unescapeHTML, - type AstroComponentFactory, } from '../runtime/server/index.js'; import type { ContentLookupMap } from './utils.js'; diff --git a/packages/astro/src/content/server-listeners.ts b/packages/astro/src/content/server-listeners.ts index c5e3da2c4252..015104e8b0f1 100644 --- a/packages/astro/src/content/server-listeners.ts +++ b/packages/astro/src/content/server-listeners.ts @@ -1,14 +1,14 @@ -import { bold, cyan } from 'kleur/colors'; import type fsMod from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import { bold, cyan } from 'kleur/colors'; import type { ViteDevServer } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { loadTSConfig } from '../core/config/tsconfig.js'; import type { Logger } from '../core/logger/core.js'; import { appendForwardSlash } from '../core/path.js'; import { createContentTypesGenerator } from './types-generator.js'; -import { getContentPaths, globalContentConfigObserver, type ContentPaths } from './utils.js'; +import { type ContentPaths, getContentPaths, globalContentConfigObserver } from './utils.js'; interface ContentServerListenerParams { fs: typeof fsMod; diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts index 046b73b1ce95..45a82ae80c6c 100644 --- a/packages/astro/src/content/types-generator.ts +++ b/packages/astro/src/content/types-generator.ts @@ -1,9 +1,9 @@ -import glob from 'fast-glob'; -import { cyan } from 'kleur/colors'; import type fsMod from 'node:fs'; import * as path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; -import { normalizePath, type ViteDevServer } from 'vite'; +import glob from 'fast-glob'; +import { cyan } from 'kleur/colors'; +import { type ViteDevServer, normalizePath } from 'vite'; import type { AstroSettings, ContentEntryType } from '../@types/astro.js'; import { AstroError } from '../core/errors/errors.js'; import { AstroErrorData } from '../core/errors/index.js'; @@ -11,6 +11,9 @@ import type { Logger } from '../core/logger/core.js'; import { isRelativePath } from '../core/path.js'; import { CONTENT_TYPES_FILE, VIRTUAL_MODULE_ID } from './consts.js'; import { + type ContentConfig, + type ContentObservable, + type ContentPaths, getContentEntryIdAndSlug, getContentPaths, getDataEntryExts, @@ -20,9 +23,6 @@ import { getEntrySlug, getEntryType, reloadContentConfigObserver, - type ContentConfig, - type ContentObservable, - type ContentPaths, } from './utils.js'; type ChokidarEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'; diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index 5834c81d82e7..e25a269afb08 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -1,10 +1,10 @@ -import { slug as githubSlug } from 'github-slugger'; -import matter from 'gray-matter'; import fsMod from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import { slug as githubSlug } from 'github-slugger'; +import matter from 'gray-matter'; import type { PluginContext } from 'rollup'; -import { normalizePath, type ViteDevServer } from 'vite'; +import { type ViteDevServer, normalizePath } from 'vite'; import { z } from 'zod'; import type { AstroConfig, @@ -326,7 +326,7 @@ export function parseFrontmatter(fileContents: string) { */ export const globalContentConfigObserver = contentObservable({ status: 'init' }); -export function hasContentFlag(viteId: string, flag: (typeof CONTENT_FLAGS)[number]): boolean { +export function hasContentFlag(viteId: string, flag: typeof CONTENT_FLAGS[number]): boolean { const flags = new URLSearchParams(viteId.split('?')[1] ?? ''); return flags.has(flag); } diff --git a/packages/astro/src/content/vite-plugin-content-assets.ts b/packages/astro/src/content/vite-plugin-content-assets.ts index 5d82a684fd07..7ad261c04751 100644 --- a/packages/astro/src/content/vite-plugin-content-assets.ts +++ b/packages/astro/src/content/vite-plugin-content-assets.ts @@ -3,7 +3,7 @@ import { pathToFileURL } from 'node:url'; import type { Plugin } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js'; -import { getPageDataByViteID, type BuildInternals } from '../core/build/internal.js'; +import { type BuildInternals, getPageDataByViteID } from '../core/build/internal.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js'; import type { StaticBuildOptions } from '../core/build/types.js'; import type { ModuleLoader } from '../core/module-loader/loader.js'; diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts index 4643e0922872..674b06ba3ad3 100644 --- a/packages/astro/src/content/vite-plugin-content-imports.ts +++ b/packages/astro/src/content/vite-plugin-content-imports.ts @@ -1,7 +1,7 @@ -import * as devalue from 'devalue'; import type fsMod from 'node:fs'; import { extname } from 'node:path'; import { pathToFileURL } from 'node:url'; +import * as devalue from 'devalue'; import type { PluginContext } from 'rollup'; import type { Plugin } from 'vite'; import type { @@ -17,6 +17,7 @@ import { AstroErrorData } from '../core/errors/index.js'; import { escapeViteEnvReferences } from '../vite-plugin-utils/index.js'; import { CONTENT_FLAG, DATA_FLAG } from './consts.js'; import { + type ContentConfig, getContentEntryExts, getContentEntryIdAndSlug, getContentPaths, @@ -30,7 +31,6 @@ import { hasContentFlag, parseEntrySlug, reloadContentConfigObserver, - type ContentConfig, } from './utils.js'; function getContentRendererByViteId( diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index d7924973cc24..29f795c48d2f 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -1,7 +1,7 @@ -import glob from 'fast-glob'; import fsMod from 'node:fs'; import { extname } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import glob from 'fast-glob'; import pLimit from 'p-limit'; import type { Plugin } from 'vite'; import type { AstroSettings, ContentEntryType } from '../@types/astro.js'; @@ -10,6 +10,8 @@ import { appendForwardSlash } from '../core/path.js'; import { rootRelativePath } from '../core/util.js'; import { VIRTUAL_MODULE_ID } from './consts.js'; import { + type ContentLookupMap, + type ContentPaths, getContentEntryIdAndSlug, getContentPaths, getDataEntryExts, @@ -19,8 +21,6 @@ import { getEntrySlug, getEntryType, getExtGlob, - type ContentLookupMap, - type ContentPaths, } from './utils.js'; interface AstroContentVirtualModPluginParams { diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index 9cf01f82d2f0..a7333b865ea6 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -16,7 +16,7 @@ import { removeTrailingForwardSlash, } from '../path.js'; import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; -import { createEnvironment, createRenderContext, type RenderContext } from '../render/index.js'; +import { type RenderContext, createEnvironment, createRenderContext } from '../render/index.js'; import { RouteCache } from '../render/route-cache.js'; import { createAssetLink, diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 5dd6af02149c..04fe4e2032ae 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -1,7 +1,7 @@ -import * as colors from 'kleur/colors'; -import { bgGreen, black, cyan, dim, green, magenta } from 'kleur/colors'; import fs from 'node:fs'; import { fileURLToPath } from 'node:url'; +import * as colors from 'kleur/colors'; +import { bgGreen, black, cyan, dim, green, magenta } from 'kleur/colors'; import type { OutputAsset, OutputChunk } from 'rollup'; import type { BufferEncoding } from 'vfile'; import type { @@ -21,7 +21,7 @@ import { generateImage as generateImageInternal, getStaticImageList, } from '../../assets/build/generate.js'; -import { hasPrerenderedPages, type BuildInternals } from '../../core/build/internal.js'; +import { type BuildInternals, hasPrerenderedPages } from '../../core/build/internal.js'; import { isRelativePath, joinPaths, diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index aefea5080d9f..c44432c0f8bc 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -1,7 +1,7 @@ -import * as colors from 'kleur/colors'; import fs from 'node:fs'; import { performance } from 'node:perf_hooks'; import { fileURLToPath } from 'node:url'; +import * as colors from 'kleur/colors'; import type * as vite from 'vite'; import type { AstroConfig, diff --git a/packages/astro/src/core/build/plugins/plugin-css.ts b/packages/astro/src/core/build/plugins/plugin-css.ts index d85dc8e567c1..0d3a170b5b58 100644 --- a/packages/astro/src/core/build/plugins/plugin-css.ts +++ b/packages/astro/src/core/build/plugins/plugin-css.ts @@ -1,7 +1,7 @@ import * as crypto from 'node:crypto'; import * as npath from 'node:path'; import type { GetModuleInfo } from 'rollup'; -import { type ResolvedConfig, type Plugin as VitePlugin } from 'vite'; +import { type Plugin as VitePlugin, type ResolvedConfig } from 'vite'; import { isBuildableCSSRequest } from '../../../vite-plugin-astro-server/util.js'; import type { BuildInternals } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 2d4f41f480b9..494b08ee074f 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -1,16 +1,16 @@ +import fs from 'node:fs'; +import path, { extname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { teardown } from '@astrojs/compiler'; import * as eslexer from 'es-module-lexer'; import glob from 'fast-glob'; import { bgGreen, bgMagenta, black, dim } from 'kleur/colors'; -import fs from 'node:fs'; -import path, { extname } from 'node:path'; -import { fileURLToPath } from 'node:url'; import * as vite from 'vite'; import type { RouteData } from '../../@types/astro.js'; import { + type BuildInternals, createBuildInternals, eachPageData, - type BuildInternals, } from '../../core/build/internal.js'; import { emptyDir, removeEmptyDirs } from '../../core/fs/index.js'; import { appendForwardSlash, prependForwardSlash } from '../../core/path.js'; @@ -23,7 +23,7 @@ import { routeIsRedirect } from '../redirects/index.js'; import { getOutDirWithinCwd } from './common.js'; import { generatePages } from './generate.js'; import { trackPageData } from './internal.js'; -import { createPluginContainer, type AstroBuildPluginContainer } from './plugin.js'; +import { type AstroBuildPluginContainer, createPluginContainer } from './plugin.js'; import { registerAllPlugins } from './plugins/index.js'; import { RESOLVED_SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugins/plugin-manifest.js'; import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js'; diff --git a/packages/astro/src/core/compile/compile.ts b/packages/astro/src/core/compile/compile.ts index 5e1cad1bed34..0b82996eca1a 100644 --- a/packages/astro/src/core/compile/compile.ts +++ b/packages/astro/src/core/compile/compile.ts @@ -2,8 +2,8 @@ import type { TransformResult } from '@astrojs/compiler'; import type { ResolvedConfig } from 'vite'; import type { AstroConfig } from '../../@types/astro.js'; -import { transform } from '@astrojs/compiler'; import { fileURLToPath } from 'node:url'; +import { transform } from '@astrojs/compiler'; import { normalizePath } from 'vite'; import { AggregateError, AstroError, CompilerError } from '../errors/errors.js'; import { AstroErrorData } from '../errors/index.js'; diff --git a/packages/astro/src/core/compile/style.ts b/packages/astro/src/core/compile/style.ts index 176b6b0441bc..68ef6f829d95 100644 --- a/packages/astro/src/core/compile/style.ts +++ b/packages/astro/src/core/compile/style.ts @@ -1,6 +1,6 @@ -import type { TransformOptions } from '@astrojs/compiler'; import fs from 'node:fs'; -import { preprocessCSS, type ResolvedConfig } from 'vite'; +import type { TransformOptions } from '@astrojs/compiler'; +import { type ResolvedConfig, preprocessCSS } from 'vite'; import { AstroErrorData, CSSError, positionAt } from '../errors/index.js'; export function createStylePreprocessor({ diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts index d8fdd9bb095e..a3d575cc7a69 100644 --- a/packages/astro/src/core/config/config.ts +++ b/packages/astro/src/core/config/config.ts @@ -7,10 +7,10 @@ import type { CLIFlags, } from '../../@types/astro.js'; -import * as colors from 'kleur/colors'; import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import * as colors from 'kleur/colors'; import { ZodError } from 'zod'; import { eventConfigError, telemetry } from '../../events/index.js'; import { trackAstroConfigZodError } from '../errors/errors.js'; diff --git a/packages/astro/src/core/config/vite-load.ts b/packages/astro/src/core/config/vite-load.ts index 8ef15d9a2074..e232b56e7cd6 100644 --- a/packages/astro/src/core/config/vite-load.ts +++ b/packages/astro/src/core/config/vite-load.ts @@ -1,6 +1,6 @@ import type fsType from 'node:fs'; import { pathToFileURL } from 'node:url'; -import { createServer, type ViteDevServer } from 'vite'; +import { type ViteDevServer, createServer } from 'vite'; import loadFallbackPlugin from '../../vite-plugin-load-fallback/index.js'; import { debug } from '../logger/core.js'; diff --git a/packages/astro/src/core/endpoint/index.ts b/packages/astro/src/core/endpoint/index.ts index 380e9e345166..2f8aac55c6f9 100644 --- a/packages/astro/src/core/endpoint/index.ts +++ b/packages/astro/src/core/endpoint/index.ts @@ -204,7 +204,9 @@ export async function callEndpoint ? // Try the static route `pathname` ctx.route.pathname ?? // Dynamic routes don't include `pathname`, so synthesize a path for these (e.g. 'src/pages/[slug].svg') - ctx.route.segments.map((s) => s.map((p) => p.content).join('')).join('/') + ctx.route.segments + .map((s) => s.map((p) => p.content).join('')) + .join('/') : // Fallback to pathname of the request ctx.pathname; const mimeType = mime.getType(pathname) || 'text/plain'; diff --git a/packages/astro/src/core/errors/dev/utils.ts b/packages/astro/src/core/errors/dev/utils.ts index fd69b74dbfae..36df06575c48 100644 --- a/packages/astro/src/core/errors/dev/utils.ts +++ b/packages/astro/src/core/errors/dev/utils.ts @@ -1,8 +1,8 @@ -import { escape } from 'html-escaper'; -import { bold, underline } from 'kleur/colors'; import * as fs from 'node:fs'; import { isAbsolute, join } from 'node:path'; import { fileURLToPath } from 'node:url'; +import { escape } from 'html-escaper'; +import { bold, underline } from 'kleur/colors'; import stripAnsi from 'strip-ansi'; import type { ESBuildTransformResult } from 'vite'; import { normalizePath } from 'vite'; @@ -165,7 +165,9 @@ function collectInfoFromStacktrace(error: SSRError & { stack: string }): StackIn error.pluginCode || error.id || // TODO: this could be better, `src` might be something else - stackText.split('\n').find((ln) => ln.includes('src') || ln.includes('node_modules')); + stackText + .split('\n') + .find((ln) => ln.includes('src') || ln.includes('node_modules')); const source = possibleFilePath?.replace(/^[^(]+\(([^)]+).*$/, '$1').replace(/^\s+at\s+/, ''); let file = source?.replace(/(:[0-9]+)/g, ''); diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 1f336e5f81e6..1654c5b35616 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -167,9 +167,7 @@ export const NoMatchingRenderer = { ${ validRenderersCount > 0 - ? `There ${plural ? 'are' : 'is'} ${validRenderersCount} renderer${ - plural ? 's' : '' - } configured in your \`astro.config.mjs\` file, + ? `There ${plural ? 'are' : 'is'} ${validRenderersCount} renderer${plural ? 's' : ''} configured in your \`astro.config.mjs\` file, but ${plural ? 'none were' : 'it was not'} able to server-side render \`${componentName}\`.` : `No valid renderer was found ${ componentExtension diff --git a/packages/astro/src/core/logger/node.ts b/packages/astro/src/core/logger/node.ts index aeef4bd84219..9380b6eef4d8 100644 --- a/packages/astro/src/core/logger/node.ts +++ b/packages/astro/src/core/logger/node.ts @@ -1,7 +1,7 @@ -import debugPackage from 'debug'; -import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors'; import * as readline from 'node:readline'; import { Writable } from 'node:stream'; +import debugPackage from 'debug'; +import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors'; import stringWidth from 'string-width'; import { dateTimeFormat, error, info, warn } from './core.js'; diff --git a/packages/astro/src/events/error.ts b/packages/astro/src/events/error.ts index b3326091dea2..ecb29ef6d4ca 100644 --- a/packages/astro/src/events/error.ts +++ b/packages/astro/src/events/error.ts @@ -101,11 +101,7 @@ function getSafeErrorMessage(message: string | Function): string { .slice(1, -1) .replace( /\${([^}]+)}/gm, - (str, match1) => - `${match1 - .split(/\.?(?=[A-Z])/) - .join('_') - .toUpperCase()}` + (str, match1) => `${match1.split(/\.?(?=[A-Z])/).join('_').toUpperCase()}` ) .replace(/\\`/g, '`'); } diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 92f27787231b..51cd4bbc24f1 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -1,7 +1,7 @@ -import { bold } from 'kleur/colors'; import fs from 'node:fs'; import type { AddressInfo } from 'node:net'; import { fileURLToPath } from 'node:url'; +import { bold } from 'kleur/colors'; import type { InlineConfig, ViteDevServer } from 'vite'; import type { AstroAdapter, diff --git a/packages/astro/src/jsx-runtime/index.ts b/packages/astro/src/jsx-runtime/index.ts index 821e3f3e3636..b82fd97dc340 100644 --- a/packages/astro/src/jsx-runtime/index.ts +++ b/packages/astro/src/jsx-runtime/index.ts @@ -1,4 +1,4 @@ -import { Fragment, markHTMLString, Renderer } from '../runtime/server/index.js'; +import { Fragment, Renderer, markHTMLString } from '../runtime/server/index.js'; const AstroJSX = 'astro:jsx'; const Empty = Symbol('empty'); diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index 81d05987adb8..76fad6869742 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -41,7 +41,7 @@ export type { export { createTransitionScope, renderTransition } from './transition.js'; import { markHTMLString } from './escape.js'; -import { addAttribute, Renderer } from './render/index.js'; +import { Renderer, addAttribute } from './render/index.js'; export function mergeSlots(...slotted: unknown[]) { const slots: Record any> = {}; diff --git a/packages/astro/src/runtime/server/jsx.ts b/packages/astro/src/runtime/server/jsx.ts index d2cb87a6147b..d2aca0e9b37e 100644 --- a/packages/astro/src/runtime/server/jsx.ts +++ b/packages/astro/src/runtime/server/jsx.ts @@ -1,6 +1,6 @@ /* eslint-disable no-console */ import type { SSRResult } from '../../@types/astro.js'; -import { AstroJSX, isVNode, type AstroVNode } from '../../jsx-runtime/index.js'; +import { AstroJSX, type AstroVNode, isVNode } from '../../jsx-runtime/index.js'; import { HTMLString, escapeHTML, diff --git a/packages/astro/src/runtime/server/render/any.ts b/packages/astro/src/runtime/server/render/any.ts index 0b61f919cd21..20de2d7320ce 100644 --- a/packages/astro/src/runtime/server/render/any.ts +++ b/packages/astro/src/runtime/server/render/any.ts @@ -1,6 +1,6 @@ import { escapeHTML, isHTMLString, markHTMLString } from '../escape.js'; import { isAstroComponentInstance, isRenderTemplateResult } from './astro/index.js'; -import { isRenderInstance, type RenderDestination } from './common.js'; +import { type RenderDestination, isRenderInstance } from './common.js'; import { SlotString } from './slot.js'; import { renderToBufferDestination } from './util.js'; diff --git a/packages/astro/src/runtime/server/render/astro/render.ts b/packages/astro/src/runtime/server/render/astro/render.ts index 7091513c75f5..5ef42dfbe5b4 100644 --- a/packages/astro/src/runtime/server/render/astro/render.ts +++ b/packages/astro/src/runtime/server/render/astro/render.ts @@ -1,6 +1,6 @@ import type { RouteData, SSRResult } from '../../../../@types/astro.js'; import { AstroError, AstroErrorData } from '../../../../core/errors/index.js'; -import { chunkToByteArray, chunkToString, encoder, type RenderDestination } from '../common.js'; +import { type RenderDestination, chunkToByteArray, chunkToString, encoder } from '../common.js'; import type { AstroComponentFactory } from './factory.js'; import { isHeadAndContent } from './head-and-content.js'; import { isRenderTemplateResult } from './render-template.js'; diff --git a/packages/astro/src/runtime/server/render/common.ts b/packages/astro/src/runtime/server/render/common.ts index 03e9c830811e..10540746dc01 100644 --- a/packages/astro/src/runtime/server/render/common.ts +++ b/packages/astro/src/runtime/server/render/common.ts @@ -3,14 +3,14 @@ import type { RenderInstruction } from './instruction.js'; import { HTMLBytes, HTMLString, markHTMLString } from '../escape.js'; import { + type PrescriptType, determineIfNeedsHydrationScript, determinesIfNeedsDirectiveScript, getPrescripts, - type PrescriptType, } from '../scripts.js'; import { renderAllHeadContent } from './head.js'; import { isRenderInstruction } from './instruction.js'; -import { isSlotString, type SlotString } from './slot.js'; +import { type SlotString, isSlotString } from './slot.js'; /** * Possible chunk types to be written to the destination, and it'll diff --git a/packages/astro/src/runtime/server/render/slot.ts b/packages/astro/src/runtime/server/render/slot.ts index e887b19d2b41..53e820e5cee2 100644 --- a/packages/astro/src/runtime/server/render/slot.ts +++ b/packages/astro/src/runtime/server/render/slot.ts @@ -4,7 +4,7 @@ import type { RenderInstruction } from './instruction.js'; import { HTMLString, markHTMLString } from '../escape.js'; import { renderChild } from './any.js'; -import { chunkToString, type RenderDestination, type RenderInstance } from './common.js'; +import { type RenderDestination, type RenderInstance, chunkToString } from './common.js'; type RenderTemplateResult = ReturnType; export type ComponentSlots = Record; diff --git a/packages/astro/src/runtime/server/transition.ts b/packages/astro/src/runtime/server/transition.ts index 17eece1d9819..90077099018b 100644 --- a/packages/astro/src/runtime/server/transition.ts +++ b/packages/astro/src/runtime/server/transition.ts @@ -50,7 +50,7 @@ export function renderTransition( if (animations) { for (const [direction, images] of Object.entries(animations) as Entries) { for (const [image, rules] of Object.entries(images) as Entries< - (typeof animations)[typeof direction] + typeof animations[typeof direction] >) { sheet.addAnimationPair(direction, image, rules); } @@ -69,10 +69,7 @@ class ViewTransitionStyleSheet { private modern: string[] = []; private fallback: string[] = []; - constructor( - private scope: string, - private name: string - ) {} + constructor(private scope: string, private name: string) {} toString() { const { scope, name } = this; diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index da2c4b948a96..aeff5b22d673 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -9,7 +9,7 @@ import type { } from '../@types/astro.js'; import { AstroErrorData, isAstroError } from '../core/errors/index.js'; import { loadMiddleware } from '../core/middleware/loadMiddleware.js'; -import { createRenderContext, getParamsAndProps, type SSROptions } from '../core/render/index.js'; +import { type SSROptions, createRenderContext, getParamsAndProps } from '../core/render/index.js'; import { createRequest } from '../core/request.js'; import { matchAllRoutes } from '../core/routing/index.js'; import { isPage, resolveIdToUrl, viteID } from '../core/util.js'; diff --git a/packages/astro/src/vite-plugin-astro/hmr.ts b/packages/astro/src/vite-plugin-astro/hmr.ts index 65186af5e3f8..dea9acae1faa 100644 --- a/packages/astro/src/vite-plugin-astro/hmr.ts +++ b/packages/astro/src/vite-plugin-astro/hmr.ts @@ -2,10 +2,10 @@ import { fileURLToPath } from 'node:url'; import type { HmrContext, ModuleNode } from 'vite'; import type { AstroConfig } from '../@types/astro.js'; import { + type CompileResult, cachedCompilation, invalidateCompilation, isCached, - type CompileResult, } from '../core/compile/index.js'; import type { Logger } from '../core/logger/core.js'; import * as msg from '../core/messages.js'; diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 1649d8069151..0095b32d81af 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -6,9 +6,9 @@ import type { PluginMetadata as AstroPluginMetadata } from './types.js'; import { normalizePath } from 'vite'; import { + type CompileProps, cachedCompilation, getCachedCompileResult, - type CompileProps, } from '../core/compile/index.js'; import { isRelativePath } from '../core/path.js'; import { normalizeFilename } from '../vite-plugin-utils/index.js'; diff --git a/packages/astro/src/vite-plugin-env/index.ts b/packages/astro/src/vite-plugin-env/index.ts index 1958344e595c..fa5e4981a99e 100644 --- a/packages/astro/src/vite-plugin-env/index.ts +++ b/packages/astro/src/vite-plugin-env/index.ts @@ -1,5 +1,5 @@ -import MagicString from 'magic-string'; import { fileURLToPath } from 'node:url'; +import MagicString from 'magic-string'; import type * as vite from 'vite'; import { loadEnv } from 'vite'; import type { AstroConfig, AstroSettings } from '../@types/astro.js'; diff --git a/packages/astro/src/vite-plugin-head/index.ts b/packages/astro/src/vite-plugin-head/index.ts index f8a13f925d33..1832aebe0794 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/src/vite-plugin-inject-env-ts/index.ts b/packages/astro/src/vite-plugin-inject-env-ts/index.ts index d884075ab09e..aebd544291e9 100644 --- a/packages/astro/src/vite-plugin-inject-env-ts/index.ts +++ b/packages/astro/src/vite-plugin-inject-env-ts/index.ts @@ -1,8 +1,8 @@ -import { bold } from 'kleur/colors'; import type fsMod from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { normalizePath, type Plugin } from 'vite'; +import { bold } from 'kleur/colors'; +import { type Plugin, normalizePath } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { getContentPaths, getDotAstroTypeReference } from '../content/index.js'; import { type Logger } from '../core/logger/core.js'; diff --git a/packages/astro/src/vite-plugin-scanner/index.ts b/packages/astro/src/vite-plugin-scanner/index.ts index d48aed203dde..82981cc66cec 100644 --- a/packages/astro/src/vite-plugin-scanner/index.ts +++ b/packages/astro/src/vite-plugin-scanner/index.ts @@ -1,5 +1,5 @@ -import { bold } from 'kleur/colors'; import { extname } from 'node:path'; +import { bold } from 'kleur/colors'; import type { Plugin as VitePlugin } from 'vite'; import { normalizePath } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; diff --git a/packages/astro/src/vite-plugin-scripts/page-ssr.ts b/packages/astro/src/vite-plugin-scripts/page-ssr.ts index 1a02ca13fc16..8687bb8f87e9 100644 --- a/packages/astro/src/vite-plugin-scripts/page-ssr.ts +++ b/packages/astro/src/vite-plugin-scripts/page-ssr.ts @@ -1,5 +1,5 @@ import MagicString from 'magic-string'; -import { normalizePath, type Plugin as VitePlugin } from 'vite'; +import { type Plugin as VitePlugin, normalizePath } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { isPage } from '../core/util.js'; import { PAGE_SSR_SCRIPT_ID } from './index.js'; diff --git a/packages/astro/test/astro-assets.test.js b/packages/astro/test/astro-assets.test.js index 7daa4aaa3daa..e581c2bc47cb 100644 --- a/packages/astro/test/astro-assets.test.js +++ b/packages/astro/test/astro-assets.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import srcsetParse from 'srcset-parse'; +import { loadFixture } from './test-utils.js'; // This package isn't real ESM, so have to coerce it const matchSrcset = srcsetParse.default; diff --git a/packages/astro/test/astro-cookies.test.js b/packages/astro/test/astro-cookies.test.js index 0af8d30b78b4..a40825e2154c 100644 --- a/packages/astro/test/astro-cookies.test.js +++ b/packages/astro/test/astro-cookies.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Astro.cookies', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/astro-envs.test.js b/packages/astro/test/astro-envs.test.js index c923ae065be5..4366cd408186 100644 --- a/packages/astro/test/astro-envs.test.js +++ b/packages/astro/test/astro-envs.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('Environment Variables', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/astro-markdown-plugins.test.js b/packages/astro/test/astro-markdown-plugins.test.js index c545f3c7a148..fe6fa03cc36f 100644 --- a/packages/astro/test/astro-markdown-plugins.test.js +++ b/packages/astro/test/astro-markdown-plugins.test.js @@ -1,7 +1,7 @@ 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'; +import { loadFixture } from './test-utils.js'; const defaultMarkdownConfig = { gfm: true, diff --git a/packages/astro/test/astro-markdown.test.js b/packages/astro/test/astro-markdown.test.js index ca0fcad385b6..4a090a1e393f 100644 --- a/packages/astro/test/astro-markdown.test.js +++ b/packages/astro/test/astro-markdown.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture, fixLineEndings } from './test-utils.js'; +import { fixLineEndings, loadFixture } from './test-utils.js'; const FIXTURE_ROOT = './fixtures/astro-markdown/'; diff --git a/packages/astro/test/astro-not-response.test.js b/packages/astro/test/astro-not-response.test.js index 76c7e5c35bf5..7595e0590627 100644 --- a/packages/astro/test/astro-not-response.test.js +++ b/packages/astro/test/astro-not-response.test.js @@ -1,4 +1,4 @@ -import { expect, assert } from 'chai'; +import { assert, expect } from 'chai'; import { loadFixture } from './test-utils.js'; // Asset bundling diff --git a/packages/astro/test/astro-pages.test.js b/packages/astro/test/astro-pages.test.js index 3d17b521d2ea..5a5e0f4cd000 100644 --- a/packages/astro/test/astro-pages.test.js +++ b/packages/astro/test/astro-pages.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture, isWindows } from './test-utils.js'; +import { isWindows, loadFixture } from './test-utils.js'; describe('Pages', () => { let fixture; diff --git a/packages/astro/test/before-hydration.test.js b/packages/astro/test/before-hydration.test.js index f429c31b35a0..54f659614379 100644 --- a/packages/astro/test/before-hydration.test.js +++ b/packages/astro/test/before-hydration.test.js @@ -1,8 +1,8 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import { preact } from './fixtures/before-hydration/deps.mjs'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Astro Scripts before-hydration', () => { describe('SSG', () => { diff --git a/packages/astro/test/build-assets.test.js b/packages/astro/test/build-assets.test.js index 3d4dacd7b5b0..648125786b40 100644 --- a/packages/astro/test/build-assets.test.js +++ b/packages/astro/test/build-assets.test.js @@ -1,8 +1,8 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import { preact } from './fixtures/before-hydration/deps.mjs'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('build assets (static)', () => { describe('with default configuration', () => { diff --git a/packages/astro/test/cli.test.js b/packages/astro/test/cli.test.js index 82cf7a12dca8..12702cd02934 100644 --- a/packages/astro/test/cli.test.js +++ b/packages/astro/test/cli.test.js @@ -1,11 +1,11 @@ -import { expect } from 'chai'; -import { cli, parseCliDevStart, cliServerLogSetup, loadFixture } from './test-utils.js'; -import stripAnsi from 'strip-ansi'; import { promises as fs, readFileSync } from 'node:fs'; -import { fileURLToPath } from 'node:url'; import { isIPv4 } from 'node:net'; import { join } from 'node:path'; import { Writable } from 'node:stream'; +import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; +import stripAnsi from 'strip-ansi'; +import { cli, cliServerLogSetup, loadFixture, parseCliDevStart } from './test-utils.js'; describe('astro cli', () => { const cliServerLogSetupWithFixture = (flags, cmd) => { diff --git a/packages/astro/test/client-address.test.js b/packages/astro/test/client-address.test.js index 6e78832cef04..24d6638131bb 100644 --- a/packages/astro/test/client-address.test.js +++ b/packages/astro/test/client-address.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; -import testAdapter from './test-adapter.js'; import * as cheerio from 'cheerio'; +import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Astro.clientAddress', () => { describe('SSR', () => { diff --git a/packages/astro/test/config-mode.test.js b/packages/astro/test/config-mode.test.js index 84dafb81f723..072fc0692384 100644 --- a/packages/astro/test/config-mode.test.js +++ b/packages/astro/test/config-mode.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('AstroConfig - config.output', () => { describe(`output: 'server'`, () => { diff --git a/packages/astro/test/content-collections-render.test.js b/packages/astro/test/content-collections-render.test.js index 27eb33b5a6b5..b3105f3ea871 100644 --- a/packages/astro/test/content-collections-render.test.js +++ b/packages/astro/test/content-collections-render.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture, isWindows } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { isWindows, loadFixture } from './test-utils.js'; const describe = isWindows ? global.describe.skip : global.describe; diff --git a/packages/astro/test/content-collections.test.js b/packages/astro/test/content-collections.test.js index e39d7da5e7fc..4867a63c6f01 100644 --- a/packages/astro/test/content-collections.test.js +++ b/packages/astro/test/content-collections.test.js @@ -1,9 +1,9 @@ -import * as devalue from 'devalue'; -import * as cheerio from 'cheerio'; import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; +import * as cheerio from 'cheerio'; +import * as devalue from 'devalue'; import testAdapter from './test-adapter.js'; import { preventNodeBuiltinDependencyPlugin } from './test-plugins.js'; +import { loadFixture } from './test-utils.js'; describe('Content Collections', () => { describe('Query', () => { @@ -181,9 +181,11 @@ describe('Content Collections', () => { for (const slug in blogSlugToContents) { const post = await fixture.readFile(`/posts/${slug}/index.html`); const $ = cheerio.load(post); - expect($(blogSlugToContents[slug].element).text().trim()).to.equal( - blogSlugToContents[slug].content - ); + expect( + $(blogSlugToContents[slug].element) + .text() + .trim() + ).to.equal(blogSlugToContents[slug].content); } }); }); @@ -284,9 +286,11 @@ describe('Content Collections', () => { const response = await app.render(request); const body = await response.text(); const $ = cheerio.load(body); - expect($(blogSlugToContents[slug].element).text().trim()).to.equal( - blogSlugToContents[slug].content - ); + expect( + $(blogSlugToContents[slug].element) + .text() + .trim() + ).to.equal(blogSlugToContents[slug].content); } }); }); diff --git a/packages/astro/test/core-image.test.js b/packages/astro/test/core-image.test.js index 7a0a468225bf..63cd0345683b 100644 --- a/packages/astro/test/core-image.test.js +++ b/packages/astro/test/core-image.test.js @@ -1,7 +1,7 @@ -import { expect } from 'chai'; -import * as cheerio from 'cheerio'; import { basename } from 'node:path'; import { Writable } from 'node:stream'; +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; import { removeDir } from '../dist/core/fs/index.js'; import { Logger } from '../dist/core/logger/core.js'; import testAdapter from './test-adapter.js'; diff --git a/packages/astro/test/css-inline-stylesheets.test.js b/packages/astro/test/css-inline-stylesheets.test.js index bcd895a47161..29964df926f2 100644 --- a/packages/astro/test/css-inline-stylesheets.test.js +++ b/packages/astro/test/css-inline-stylesheets.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Setting inlineStylesheets to never in static output', () => { let fixture; diff --git a/packages/astro/test/css-order.test.js b/packages/astro/test/css-order.test.js index 73b1472127b2..803b2cb1b565 100644 --- a/packages/astro/test/css-order.test.js +++ b/packages/astro/test/css-order.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('CSS production ordering', () => { function getLinks(html) { diff --git a/packages/astro/test/debug-component.test.js b/packages/astro/test/debug-component.test.js index 4ed81ccd0158..f1f4361fe5d3 100644 --- a/packages/astro/test/debug-component.test.js +++ b/packages/astro/test/debug-component.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import os from 'node:os'; +import { expect } from 'chai'; import { loadFixture } from './test-utils.js'; // TODO: fix these tests on macOS diff --git a/packages/astro/test/dont-delete-root.test.js b/packages/astro/test/dont-delete-root.test.js index 5d9814aef2f4..1fda5dd00ee6 100644 --- a/packages/astro/test/dont-delete-root.test.js +++ b/packages/astro/test/dont-delete-root.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import * as fs from 'node:fs'; +import { expect } from 'chai'; import { loadFixture } from './test-utils.js'; describe('outDir set to project root', async () => { diff --git a/packages/astro/test/featuresSupport.test.js b/packages/astro/test/featuresSupport.test.js index fba8da47557d..ee1538c6b80e 100644 --- a/packages/astro/test/featuresSupport.test.js +++ b/packages/astro/test/featuresSupport.test.js @@ -1,6 +1,6 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Adapter', () => { let fixture; diff --git a/packages/astro/test/hoisted-imports.test.js b/packages/astro/test/hoisted-imports.test.js index c5ce98e05038..92eb45cd1138 100644 --- a/packages/astro/test/hoisted-imports.test.js +++ b/packages/astro/test/hoisted-imports.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('Hoisted Imports', () => { let fixture; diff --git a/packages/astro/test/middleware.test.js b/packages/astro/test/middleware.test.js index 9ca4841d4e4e..b8ecdff277f8 100644 --- a/packages/astro/test/middleware.test.js +++ b/packages/astro/test/middleware.test.js @@ -1,9 +1,9 @@ -import { loadFixture } from './test-utils.js'; +import { existsSync, readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; import testAdapter from './test-adapter.js'; -import { fileURLToPath } from 'node:url'; -import { readFileSync, existsSync } from 'node:fs'; +import { loadFixture } from './test-utils.js'; describe('Middleware in DEV mode', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/minification-html.test.js b/packages/astro/test/minification-html.test.js index cd3e70a1dfb1..c42ee195bdca 100644 --- a/packages/astro/test/minification-html.test.js +++ b/packages/astro/test/minification-html.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; const NEW_LINES = /[\r\n]+/gm; diff --git a/packages/astro/test/redirects.test.js b/packages/astro/test/redirects.test.js index 999ab1f0f3ed..3ff5d8b2cfac 100644 --- a/packages/astro/test/redirects.test.js +++ b/packages/astro/test/redirects.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Astro.redirect', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-404-500-pages.test.js b/packages/astro/test/ssr-404-500-pages.test.js index 253f9bc1ca99..78ea2a849f40 100644 --- a/packages/astro/test/ssr-404-500-pages.test.js +++ b/packages/astro/test/ssr-404-500-pages.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; -import testAdapter from './test-adapter.js'; import * as cheerio from 'cheerio'; +import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('404 and 500 pages', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-adapter-build-config.test.js b/packages/astro/test/ssr-adapter-build-config.test.js index d739cee3cd09..9979b193ed6a 100644 --- a/packages/astro/test/ssr-adapter-build-config.test.js +++ b/packages/astro/test/ssr-adapter-build-config.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import { viteID } from '../dist/core/util.js'; +import { loadFixture } from './test-utils.js'; describe('Integration buildConfig hook', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-api-route.test.js b/packages/astro/test/ssr-api-route.test.js index fbaafc82275c..490d428096d6 100644 --- a/packages/astro/test/ssr-api-route.test.js +++ b/packages/astro/test/ssr-api-route.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import net from 'node:net'; +import { expect } from 'chai'; import testAdapter from './test-adapter.js'; import { loadFixture } from './test-utils.js'; diff --git a/packages/astro/test/ssr-assets.test.js b/packages/astro/test/ssr-assets.test.js index 01015f087753..076fa8ce7b7f 100644 --- a/packages/astro/test/ssr-assets.test.js +++ b/packages/astro/test/ssr-assets.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR Assets', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-dynamic.test.js b/packages/astro/test/ssr-dynamic.test.js index 62e67e410d32..7245938d7501 100644 --- a/packages/astro/test/ssr-dynamic.test.js +++ b/packages/astro/test/ssr-dynamic.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Dynamic pages in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-env.test.js b/packages/astro/test/ssr-env.test.js index fb369482dff1..b61dab5c896f 100644 --- a/packages/astro/test/ssr-env.test.js +++ b/packages/astro/test/ssr-env.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR Environment Variables', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-hoisted-script.test.js b/packages/astro/test/ssr-hoisted-script.test.js index e9549151e252..de9258f5a2f3 100644 --- a/packages/astro/test/ssr-hoisted-script.test.js +++ b/packages/astro/test/ssr-hoisted-script.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; async function fetchHTML(fixture, path) { const app = await fixture.loadTestAdapterApp(); diff --git a/packages/astro/test/ssr-large-array.test.js b/packages/astro/test/ssr-large-array.test.js index 0145a2fe4591..4da89fa9ee2e 100644 --- a/packages/astro/test/ssr-large-array.test.js +++ b/packages/astro/test/ssr-large-array.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR with Large Array and client rendering', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-lit.test.js b/packages/astro/test/ssr-lit.test.js index 6615e644402c..279a36153032 100644 --- a/packages/astro/test/ssr-lit.test.js +++ b/packages/astro/test/ssr-lit.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Lit integration in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-locals.test.js b/packages/astro/test/ssr-locals.test.js index 41e5710fbbb8..518c6052508b 100644 --- a/packages/astro/test/ssr-locals.test.js +++ b/packages/astro/test/ssr-locals.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR Astro.locals from server', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-manifest.test.js b/packages/astro/test/ssr-manifest.test.js index b45d6b581d90..a8c91a323e0f 100644 --- a/packages/astro/test/ssr-manifest.test.js +++ b/packages/astro/test/ssr-manifest.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; -import testAdapter from './test-adapter.js'; import * as cheerio from 'cheerio'; +import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('astro:ssr-manifest', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-markdown.test.js b/packages/astro/test/ssr-markdown.test.js index 4f9ae9f940d6..ecb1304f3902 100644 --- a/packages/astro/test/ssr-markdown.test.js +++ b/packages/astro/test/ssr-markdown.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Markdown pages in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-params.test.js b/packages/astro/test/ssr-params.test.js index 343e47cf8705..3ab1e000a4de 100644 --- a/packages/astro/test/ssr-params.test.js +++ b/packages/astro/test/ssr-params.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Astro.params in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-partytown.test.js b/packages/astro/test/ssr-partytown.test.js index 4be8456aa3b5..c3b6d0254a85 100644 --- a/packages/astro/test/ssr-partytown.test.js +++ b/packages/astro/test/ssr-partytown.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Using the Partytown integration in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-prerender.test.js b/packages/astro/test/ssr-prerender.test.js index 567371f0bbaa..c0f26e07f803 100644 --- a/packages/astro/test/ssr-prerender.test.js +++ b/packages/astro/test/ssr-prerender.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR: prerender', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-preview.test.js b/packages/astro/test/ssr-preview.test.js index d4b63ea53361..309292341a65 100644 --- a/packages/astro/test/ssr-preview.test.js +++ b/packages/astro/test/ssr-preview.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR Preview', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-request.test.js b/packages/astro/test/ssr-request.test.js index 7bdce20b557c..e3640d9d8782 100644 --- a/packages/astro/test/ssr-request.test.js +++ b/packages/astro/test/ssr-request.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Using Astro.request in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-response.test.js b/packages/astro/test/ssr-response.test.js index 0be4b86ef86a..c202f5c7c2fe 100644 --- a/packages/astro/test/ssr-response.test.js +++ b/packages/astro/test/ssr-response.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Using Astro.response in SSR', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-scripts.test.js b/packages/astro/test/ssr-scripts.test.js index 241ec894bce5..d87ab73db389 100644 --- a/packages/astro/test/ssr-scripts.test.js +++ b/packages/astro/test/ssr-scripts.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('SSR Hydrated component scripts', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/ssr-split-manifest.test.js b/packages/astro/test/ssr-split-manifest.test.js index 7df104e7616d..11ce96195160 100644 --- a/packages/astro/test/ssr-split-manifest.test.js +++ b/packages/astro/test/ssr-split-manifest.test.js @@ -1,10 +1,10 @@ -import { expect } from 'chai'; -import { loadFixture } from './test-utils.js'; -import testAdapter from './test-adapter.js'; -import * as cheerio from 'cheerio'; -import { fileURLToPath } from 'node:url'; import { existsSync, readFileSync } from 'node:fs'; import { resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('astro:ssr-manifest, split', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/astro/test/static-build-frameworks.test.js b/packages/astro/test/static-build-frameworks.test.js index 08dfdcf2f9d3..a5542335a02c 100644 --- a/packages/astro/test/static-build-frameworks.test.js +++ b/packages/astro/test/static-build-frameworks.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { loadFixture, isWindows } from './test-utils.js'; +import { isWindows, loadFixture } from './test-utils.js'; describe('Static build - frameworks', () => { if (isWindows) { diff --git a/packages/astro/test/static-build.test.js b/packages/astro/test/static-build.test.js index 54701fee1b17..3422534ef54a 100644 --- a/packages/astro/test/static-build.test.js +++ b/packages/astro/test/static-build.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { load as cheerioLoad } from 'cheerio'; -import { loadFixture } from './test-utils.js'; import { Logger } from '../dist/core/logger/core.js'; +import { loadFixture } from './test-utils.js'; function addLeadingSlash(path) { return path.startsWith('/') ? path : '/' + path; diff --git a/packages/astro/test/test-adapter.js b/packages/astro/test/test-adapter.js index 0090b6d9da92..151312c3e4f5 100644 --- a/packages/astro/test/test-adapter.js +++ b/packages/astro/test/test-adapter.js @@ -52,7 +52,11 @@ export default function ( return new Response(data); } - ${provideAddress ? `request[Symbol.for('astro.clientAddress')] = '0.0.0.0';` : ''} + ${ + provideAddress + ? `request[Symbol.for('astro.clientAddress')] = '0.0.0.0';` + : '' + } return super.render(request, routeData, locals); } } diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js index fafd3046cf23..a4bdd0252a16 100644 --- a/packages/astro/test/test-utils.js +++ b/packages/astro/test/test-utils.js @@ -1,19 +1,19 @@ -import { execa } from 'execa'; -import fastGlob from 'fast-glob'; import fs from 'node:fs'; import os from 'node:os'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import { execa } from 'execa'; +import fastGlob from 'fast-glob'; import stripAnsi from 'strip-ansi'; import { check } from '../dist/cli/check/index.js'; -import { dev, preview } from '../dist/core/index.js'; import build from '../dist/core/build/index.js'; -import sync from '../dist/core/sync/index.js'; import { RESOLVED_SPLIT_MODULE_ID } from '../dist/core/build/plugins/plugin-ssr.js'; import { getVirtualModulePageNameFromPath } from '../dist/core/build/plugins/util.js'; import { makeSplitEntryPointFileName } from '../dist/core/build/static-build.js'; import { mergeConfig, resolveConfig } from '../dist/core/config/index.js'; +import { dev, preview } from '../dist/core/index.js'; import { nodeLogDestination } from '../dist/core/logger/node.js'; +import sync from '../dist/core/sync/index.js'; // Disable telemetry when running tests process.env.ASTRO_TELEMETRY_DISABLED = true; diff --git a/packages/astro/test/units/assets/remote-pattern.test.js b/packages/astro/test/units/assets/remote-pattern.test.js index 62a411e3a659..72d8d2b63043 100644 --- a/packages/astro/test/units/assets/remote-pattern.test.js +++ b/packages/astro/test/units/assets/remote-pattern.test.js @@ -1,10 +1,10 @@ import { expect } from 'chai'; import { - matchProtocol, - matchPort, matchHostname, matchPathname, matchPattern, + matchPort, + matchProtocol, } from '../../../dist/assets/utils/remotePattern.js'; describe('astro/src/assets/utils/remotePattern', () => { diff --git a/packages/astro/test/units/compile/invalid-css.test.js b/packages/astro/test/units/compile/invalid-css.test.js index 7a0303437434..03cf1002f899 100644 --- a/packages/astro/test/units/compile/invalid-css.test.js +++ b/packages/astro/test/units/compile/invalid-css.test.js @@ -1,8 +1,8 @@ -import { resolveConfig } from 'vite'; +import { pathToFileURL } from 'node:url'; import { expect } from 'chai'; +import { resolveConfig } from 'vite'; import { cachedCompilation } from '../../../dist/core/compile/index.js'; import { AggregateError } from '../../../dist/core/errors/index.js'; -import { pathToFileURL } from 'node:url'; describe('astro/src/core/compile', () => { describe('Invalid CSS', () => { diff --git a/packages/astro/test/units/config/config-resolve.test.js b/packages/astro/test/units/config/config-resolve.test.js index c3c19da64dc2..72c814740232 100644 --- a/packages/astro/test/units/config/config-resolve.test.js +++ b/packages/astro/test/units/config/config-resolve.test.js @@ -1,6 +1,6 @@ -import { expect } from 'chai'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import { resolveConfig } from '../../../dist/core/config/index.js'; describe('resolveConfig', () => { diff --git a/packages/astro/test/units/config/config-server.test.js b/packages/astro/test/units/config/config-server.test.js index 8a60c53bf1e2..212e5c388ce4 100644 --- a/packages/astro/test/units/config/config-server.test.js +++ b/packages/astro/test/units/config/config-server.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import { flagsToAstroInlineConfig } from '../../../dist/cli/flags.js'; import { resolveConfig } from '../../../dist/core/config/index.js'; diff --git a/packages/astro/test/units/config/config-tsconfig.test.js b/packages/astro/test/units/config/config-tsconfig.test.js index 4b87793a949b..0937d158af92 100644 --- a/packages/astro/test/units/config/config-tsconfig.test.js +++ b/packages/astro/test/units/config/config-tsconfig.test.js @@ -1,8 +1,8 @@ -import { expect } from 'chai'; -import { fileURLToPath } from 'node:url'; -import { loadTSConfig, updateTSConfigForFramework } from '../../../dist/core/config/index.js'; import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import * as tsr from 'tsconfig-resolver'; +import { loadTSConfig, updateTSConfigForFramework } from '../../../dist/core/config/index.js'; const cwd = fileURLToPath(new URL('../../fixtures/tsconfig-handling/', import.meta.url)); diff --git a/packages/astro/test/units/config/config-validate.test.js b/packages/astro/test/units/config/config-validate.test.js index 48088468ae45..61a5a3c7d732 100644 --- a/packages/astro/test/units/config/config-validate.test.js +++ b/packages/astro/test/units/config/config-validate.test.js @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { z } from 'zod'; import stripAnsi from 'strip-ansi'; -import { formatConfigErrorMessage } from '../../../dist/core/messages.js'; +import { z } from 'zod'; import { validateConfig } from '../../../dist/core/config/config.js'; +import { formatConfigErrorMessage } from '../../../dist/core/messages.js'; describe('Config Validation', () => { it('empty user config is valid', async () => { diff --git a/packages/astro/test/units/content-collections/error-map.test.js b/packages/astro/test/units/content-collections/error-map.test.js index 4284ad721308..b4d21afe9a48 100644 --- a/packages/astro/test/units/content-collections/error-map.test.js +++ b/packages/astro/test/units/content-collections/error-map.test.js @@ -1,7 +1,7 @@ -import { z } from '../../../zod.mjs'; +import { expect } from 'chai'; import { errorMap } from '../../../dist/content/index.js'; +import { z } from '../../../zod.mjs'; import { fixLineEndings } from '../../test-utils.js'; -import { expect } from 'chai'; describe('Content Collections - error map', () => { it('Prefixes messages with object key', () => { diff --git a/packages/astro/test/units/content-collections/frontmatter.test.js b/packages/astro/test/units/content-collections/frontmatter.test.js index f06b33710de0..5d68a6a94926 100644 --- a/packages/astro/test/units/content-collections/frontmatter.test.js +++ b/packages/astro/test/units/content-collections/frontmatter.test.js @@ -1,6 +1,6 @@ -import { fileURLToPath } from 'node:url'; import nodeFS from 'node:fs'; import path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { attachContentServerListeners } from '../../../dist/content/index.js'; import { createFs, runInContainer, triggerFSEvent } from '../test-utils.js'; diff --git a/packages/astro/test/units/content-collections/get-entry-info.test.js b/packages/astro/test/units/content-collections/get-entry-info.test.js index 385a915780a6..7b3d56ac752f 100644 --- a/packages/astro/test/units/content-collections/get-entry-info.test.js +++ b/packages/astro/test/units/content-collections/get-entry-info.test.js @@ -1,5 +1,5 @@ -import { getContentEntryIdAndSlug, getEntryCollectionName } from '../../../dist/content/utils.js'; import { expect } from 'chai'; +import { getContentEntryIdAndSlug, getEntryCollectionName } from '../../../dist/content/utils.js'; describe('Content Collections - entry info', () => { const contentDir = new URL('src/content/', import.meta.url); diff --git a/packages/astro/test/units/content-collections/get-entry-type.test.js b/packages/astro/test/units/content-collections/get-entry-type.test.js index a953d0c8fedc..9d5b4ff91b65 100644 --- a/packages/astro/test/units/content-collections/get-entry-type.test.js +++ b/packages/astro/test/units/content-collections/get-entry-type.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import { getEntryType } from '../../../dist/content/utils.js'; const fixtures = [ diff --git a/packages/astro/test/units/dev/base.test.js b/packages/astro/test/units/dev/base.test.js index 041d6bcb52be..b5e9f89bae25 100644 --- a/packages/astro/test/units/dev/base.test.js +++ b/packages/astro/test/units/dev/base.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import { createFs, createRequestAndResponse, runInContainer } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/dev/collections-mixed-content-errors.test.js b/packages/astro/test/units/dev/collections-mixed-content-errors.test.js index a8e282a88163..9d51173ee831 100644 --- a/packages/astro/test/units/dev/collections-mixed-content-errors.test.js +++ b/packages/astro/test/units/dev/collections-mixed-content-errors.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import _sync from '../../../dist/core/sync/index.js'; import { createFsWithFallback } from '../test-utils.js'; diff --git a/packages/astro/test/units/dev/collections-renderentry.test.js b/packages/astro/test/units/dev/collections-renderentry.test.js index 873bb91646c7..3012043c25e2 100644 --- a/packages/astro/test/units/dev/collections-renderentry.test.js +++ b/packages/astro/test/units/dev/collections-renderentry.test.js @@ -1,7 +1,7 @@ -import { expect } from 'chai'; -import * as cheerio from 'cheerio'; import os from 'node:os'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; import { attachContentServerListeners } from '../../../dist/content/server-listeners.js'; import { createFsWithFallback, createRequestAndResponse, runInContainer } from '../test-utils.js'; diff --git a/packages/astro/test/units/dev/dev.test.js b/packages/astro/test/units/dev/dev.test.js index 9762be7ebd32..c11f99a1548d 100644 --- a/packages/astro/test/units/dev/dev.test.js +++ b/packages/astro/test/units/dev/dev.test.js @@ -1,11 +1,11 @@ +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { fileURLToPath } from 'node:url'; import { createFs, createRequestAndResponse, - triggerFSEvent, runInContainer, + triggerFSEvent, } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/dev/head-injection.test.js b/packages/astro/test/units/dev/head-injection.test.js index 9b38feae6267..36b128a3a244 100644 --- a/packages/astro/test/units/dev/head-injection.test.js +++ b/packages/astro/test/units/dev/head-injection.test.js @@ -1,6 +1,6 @@ +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { fileURLToPath } from 'node:url'; import { createFs, createRequestAndResponse, runInContainer } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/dev/hydration.test.js b/packages/astro/test/units/dev/hydration.test.js index ae4cb2d994f1..3382f7d6989f 100644 --- a/packages/astro/test/units/dev/hydration.test.js +++ b/packages/astro/test/units/dev/hydration.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import { createFs, createRequestAndResponse, runInContainer } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/dev/restart.test.js b/packages/astro/test/units/dev/restart.test.js index 1b00d5c6a825..b41c81b47fd3 100644 --- a/packages/astro/test/units/dev/restart.test.js +++ b/packages/astro/test/units/dev/restart.test.js @@ -1,6 +1,6 @@ +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { fileURLToPath } from 'node:url'; import { createContainerWithAutomaticRestart, diff --git a/packages/astro/test/units/dev/styles.test.js b/packages/astro/test/units/dev/styles.test.js index 76b38dd4372b..0e197e5188bd 100644 --- a/packages/astro/test/units/dev/styles.test.js +++ b/packages/astro/test/units/dev/styles.test.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { getStylesForURL } from '../../../dist/vite-plugin-astro-server/css.js'; import { viteID } from '../../../dist/core/util.js'; +import { getStylesForURL } from '../../../dist/vite-plugin-astro-server/css.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/integrations/api.test.js b/packages/astro/test/units/integrations/api.test.js index 0a7d57929c27..0f9418e39761 100644 --- a/packages/astro/test/units/integrations/api.test.js +++ b/packages/astro/test/units/integrations/api.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { runHookBuildSetup } from '../../../dist/integrations/index.js'; import { validateSupportedFeatures } from '../../../dist/integrations/astroFeaturesValidation.js'; +import { runHookBuildSetup } from '../../../dist/integrations/index.js'; import { defaultLogger } from '../test-utils.js'; describe('Integration API', () => { diff --git a/packages/astro/test/units/render/chunk.test.js b/packages/astro/test/units/render/chunk.test.js index b623f662f449..23b478391bc8 100644 --- a/packages/astro/test/units/render/chunk.test.js +++ b/packages/astro/test/units/render/chunk.test.js @@ -1,6 +1,6 @@ +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { fileURLToPath } from 'node:url'; import { createFs, createRequestAndResponse, runInContainer } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/render/components.test.js b/packages/astro/test/units/render/components.test.js index cd27141f94a7..9614e06e9ec8 100644 --- a/packages/astro/test/units/render/components.test.js +++ b/packages/astro/test/units/render/components.test.js @@ -1,6 +1,6 @@ +import { fileURLToPath } from 'node:url'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; -import { fileURLToPath } from 'node:url'; import { createFs, createRequestAndResponse, runInContainer } from '../test-utils.js'; const root = new URL('../../fixtures/alias/', import.meta.url); diff --git a/packages/astro/test/units/render/head.test.js b/packages/astro/test/units/render/head.test.js index d2580e30de5b..9e90419d41db 100644 --- a/packages/astro/test/units/render/head.test.js +++ b/packages/astro/test/units/render/head.test.js @@ -1,17 +1,17 @@ import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import { createRenderContext, tryRenderRoute } from '../../../dist/core/render/index.js'; import { + Fragment, createComponent, + maybeRenderHead, render, renderComponent, - renderSlot, - maybeRenderHead, renderHead, - Fragment, + renderSlot, } from '../../../dist/runtime/server/index.js'; -import { createRenderContext, tryRenderRoute } from '../../../dist/core/render/index.js'; import { createBasicEnvironment } from '../test-utils.js'; -import * as cheerio from 'cheerio'; const createAstroModule = (AstroComponent) => ({ default: AstroComponent }); diff --git a/packages/astro/test/units/render/jsx.test.js b/packages/astro/test/units/render/jsx.test.js index 1464b5b0ce5b..0cfb4f394196 100644 --- a/packages/astro/test/units/render/jsx.test.js +++ b/packages/astro/test/units/render/jsx.test.js @@ -1,17 +1,17 @@ import { expect } from 'chai'; +import { + createRenderContext, + loadRenderer, + tryRenderRoute, +} from '../../../dist/core/render/index.js'; +import { jsx } from '../../../dist/jsx-runtime/index.js'; +import { createAstroJSXComponent, renderer as jsxRenderer } from '../../../dist/jsx/index.js'; import { createComponent, render, renderComponent, renderSlot, } from '../../../dist/runtime/server/index.js'; -import { jsx } from '../../../dist/jsx-runtime/index.js'; -import { - createRenderContext, - tryRenderRoute, - loadRenderer, -} from '../../../dist/core/render/index.js'; -import { createAstroJSXComponent, renderer as jsxRenderer } from '../../../dist/jsx/index.js'; import { createBasicEnvironment } from '../test-utils.js'; const createAstroModule = (AstroComponent) => ({ default: AstroComponent }); diff --git a/packages/astro/test/units/routing/route-matching.test.js b/packages/astro/test/units/routing/route-matching.test.js index 6f4724893c4a..eb77da68e774 100644 --- a/packages/astro/test/units/routing/route-matching.test.js +++ b/packages/astro/test/units/routing/route-matching.test.js @@ -1,19 +1,19 @@ +import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import { createContainer } from '../../../dist/core/dev/container.js'; +import { createViteLoader } from '../../../dist/core/module-loader/vite.js'; +import { createRouteManifest, matchAllRoutes } from '../../../dist/core/routing/index.js'; +import { getSortedPreloadedMatches } from '../../../dist/prerender/routing.js'; +import DevPipeline from '../../../dist/vite-plugin-astro-server/devPipeline.js'; +import { createDevelopmentManifest } from '../../../dist/vite-plugin-astro-server/plugin.js'; +import testAdapter from '../../test-adapter.js'; import { createBasicSettings, createFs, createRequestAndResponse, defaultLogger, } from '../test-utils.js'; -import { createRouteManifest, matchAllRoutes } from '../../../dist/core/routing/index.js'; -import { fileURLToPath } from 'node:url'; -import { createViteLoader } from '../../../dist/core/module-loader/vite.js'; -import { expect } from 'chai'; -import { createContainer } from '../../../dist/core/dev/container.js'; -import * as cheerio from 'cheerio'; -import testAdapter from '../../test-adapter.js'; -import { getSortedPreloadedMatches } from '../../../dist/prerender/routing.js'; -import { createDevelopmentManifest } from '../../../dist/vite-plugin-astro-server/plugin.js'; -import DevPipeline from '../../../dist/vite-plugin-astro-server/devPipeline.js'; const root = new URL('../../fixtures/alias/', import.meta.url); const fileSystem = { diff --git a/packages/astro/test/units/shiki/shiki.test.js b/packages/astro/test/units/shiki/shiki.test.js index d88f3c31e631..38b5380d4494 100644 --- a/packages/astro/test/units/shiki/shiki.test.js +++ b/packages/astro/test/units/shiki/shiki.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; import { createContainer } from '../../../dist/core/dev/index.js'; import { createViteLoader } from '../../../dist/core/module-loader/index.js'; import { createBasicSettings, defaultLogger } from '../test-utils.js'; diff --git a/packages/astro/test/units/test-utils.js b/packages/astro/test/units/test-utils.js index f8d6dce2487b..98d21dd8866c 100644 --- a/packages/astro/test/units/test-utils.js +++ b/packages/astro/test/units/test-utils.js @@ -1,18 +1,18 @@ -import { Volume } from 'memfs'; -import httpMocks from 'node-mocks-http'; import { EventEmitter } from 'node:events'; import realFS from 'node:fs'; import npath from 'node:path'; import { fileURLToPath } from 'node:url'; +import { Volume } from 'memfs'; +import httpMocks from 'node-mocks-http'; import { getDefaultClientDirectives } from '../../dist/core/client-directive/index.js'; -import { nodeLogDestination } from '../../dist/core/logger/node.js'; -import { createEnvironment } from '../../dist/core/render/index.js'; -import { RouteCache } from '../../dist/core/render/route-cache.js'; import { resolveConfig } from '../../dist/core/config/index.js'; import { createBaseSettings } from '../../dist/core/config/settings.js'; import { createContainer } from '../../dist/core/dev/container.js'; -import { unixify } from './correct-path.js'; import { Logger } from '../../dist/core/logger/core.js'; +import { nodeLogDestination } from '../../dist/core/logger/node.js'; +import { createEnvironment } from '../../dist/core/render/index.js'; +import { RouteCache } from '../../dist/core/render/route-cache.js'; +import { unixify } from './correct-path.js'; /** @type {import('../../src/core/logger/core').Logger} */ export const defaultLogger = new Logger({ diff --git a/packages/astro/test/units/vite-plugin-astro-server/request.test.js b/packages/astro/test/units/vite-plugin-astro-server/request.test.js index d3472c56b59b..db7e9b0446f2 100644 --- a/packages/astro/test/units/vite-plugin-astro-server/request.test.js +++ b/packages/astro/test/units/vite-plugin-astro-server/request.test.js @@ -2,7 +2,9 @@ import { expect } from 'chai'; import { createLoader } from '../../../dist/core/module-loader/index.js'; import { createRouteManifest } from '../../../dist/core/routing/index.js'; import { createComponent, render } from '../../../dist/runtime/server/index.js'; +import DevPipeline from '../../../dist/vite-plugin-astro-server/devPipeline.js'; import { createController, handleRequest } from '../../../dist/vite-plugin-astro-server/index.js'; +import { createDevelopmentManifest } from '../../../dist/vite-plugin-astro-server/plugin.js'; import { createAstroModule, createBasicSettings, @@ -10,8 +12,6 @@ import { createRequestAndResponse, defaultLogger, } from '../test-utils.js'; -import { createDevelopmentManifest } from '../../../dist/vite-plugin-astro-server/plugin.js'; -import DevPipeline from '../../../dist/vite-plugin-astro-server/devPipeline.js'; async function createDevPipeline(overrides = {}) { const settings = overrides.settings ?? (await createBasicSettings({ root: '/' })); diff --git a/packages/astro/test/units/vite-plugin-astro/compile.test.js b/packages/astro/test/units/vite-plugin-astro/compile.test.js index 5fa87433eb90..ec29b5ce9ed0 100644 --- a/packages/astro/test/units/vite-plugin-astro/compile.test.js +++ b/packages/astro/test/units/vite-plugin-astro/compile.test.js @@ -1,8 +1,8 @@ +import { pathToFileURL } from 'node:url'; import { expect } from 'chai'; +import { init, parse } from 'es-module-lexer'; import { resolveConfig } from 'vite'; import { cachedFullCompilation } from '../../../dist/vite-plugin-astro/compile.js'; -import { init, parse } from 'es-module-lexer'; -import { pathToFileURL } from 'node:url'; const viteConfig = await resolveConfig({ configFile: false }, 'serve'); diff --git a/packages/astro/tsconfigs/base.json b/packages/astro/tsconfigs/base.json index 5786931959d4..fe579b97233c 100644 --- a/packages/astro/tsconfigs/base.json +++ b/packages/astro/tsconfigs/base.json @@ -1,29 +1,29 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - // Enable top-level await, and other modern ESM features. - "target": "ESNext", - "module": "ESNext", - // Enable node-style module resolution, for things like npm package imports. - "moduleResolution": "Bundler", - // Allow importing TypeScript files using their native extension (.ts(x)). - "allowImportingTsExtensions": true, - // Enable JSON imports. - "resolveJsonModule": true, - // 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 another import of the same file. - "forceConsistentCasingInFileNames": true, - // Properly support importing CJS modules in ESM - "esModuleInterop": true, - // Skip typechecking libraries and .d.ts files - "skipLibCheck": true, - // Allow JavaScript files to be imported - "allowJs": true - } + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + // Enable top-level await, and other modern ESM features. + "target": "ESNext", + "module": "ESNext", + // Enable node-style module resolution, for things like npm package imports. + "moduleResolution": "Bundler", + // Allow importing TypeScript files using their native extension (.ts(x)). + "allowImportingTsExtensions": true, + // Enable JSON imports. + "resolveJsonModule": true, + // 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 another import of the same file. + "forceConsistentCasingInFileNames": true, + // Properly support importing CJS modules in ESM + "esModuleInterop": true, + // Skip typechecking libraries and .d.ts files + "skipLibCheck": true, + // Allow JavaScript files to be imported + "allowJs": true + } } diff --git a/packages/astro/tsconfigs/strict.json b/packages/astro/tsconfigs/strict.json index 3064440a5d41..03fba7703c01 100644 --- a/packages/astro/tsconfigs/strict.json +++ b/packages/astro/tsconfigs/strict.json @@ -1,8 +1,8 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./base.json", - "compilerOptions": { - // Enable strict mode. This enables a few options at a time, see https://www.typescriptlang.org/tsconfig#strict for a list. - "strict": true - } + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./base.json", + "compilerOptions": { + // 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/astro/tsconfigs/strictest.json b/packages/astro/tsconfigs/strictest.json index 36f11635e8d2..846f41eaea5b 100644 --- a/packages/astro/tsconfigs/strictest.json +++ b/packages/astro/tsconfigs/strictest.json @@ -1,26 +1,26 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./strict.json", - "compilerOptions": { - // Report errors for fallthrough cases in switch statements - "noFallthroughCasesInSwitch": true, - // Force functions designed to override their parent class to be specified as `override`. - "noImplicitOverride": true, - // Force functions to specify that they can return `undefined` if a possible code path does not return a value. - "noImplicitReturns": true, - // Report an error when a variable is declared but never used. - "noUnusedLocals": true, - // Report an error when a parameter is declared but never used. - "noUnusedParameters": true, - // Force the usage of the indexed syntax to access fields declared using an index signature. - "noUncheckedIndexedAccess": true, - // Report an error when the value `undefined` is given to an optional property that doesn't specify `undefined` as a valid value. - "exactOptionalPropertyTypes": true, - // Report an error for unreachable code instead of just a warning. - "allowUnreachableCode": false, - // Report an error for unused labels instead of just a warning. - "allowUnusedLabels": false, - // Disallow JavaScript files from being imported - "allowJs": false - } + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./strict.json", + "compilerOptions": { + // Report errors for fallthrough cases in switch statements + "noFallthroughCasesInSwitch": true, + // Force functions designed to override their parent class to be specified as `override`. + "noImplicitOverride": true, + // Force functions to specify that they can return `undefined` if a possible code path does not return a value. + "noImplicitReturns": true, + // Report an error when a variable is declared but never used. + "noUnusedLocals": true, + // Report an error when a parameter is declared but never used. + "noUnusedParameters": true, + // Force the usage of the indexed syntax to access fields declared using an index signature. + "noUncheckedIndexedAccess": true, + // Report an error when the value `undefined` is given to an optional property that doesn't specify `undefined` as a valid value. + "exactOptionalPropertyTypes": true, + // Report an error for unreachable code instead of just a warning. + "allowUnreachableCode": false, + // Report an error for unused labels instead of just a warning. + "allowUnusedLabels": false, + // Disallow JavaScript files from being imported + "allowJs": false + } } diff --git a/packages/create-astro/src/actions/dependencies.ts b/packages/create-astro/src/actions/dependencies.ts index 1e731099c010..59cd535d8e14 100644 --- a/packages/create-astro/src/actions/dependencies.ts +++ b/packages/create-astro/src/actions/dependencies.ts @@ -1,6 +1,6 @@ -import { color } from '@astrojs/cli-kit'; import fs from 'node:fs'; import path from 'node:path'; +import { color } from '@astrojs/cli-kit'; import { error, info, spinner, title } from '../messages.js'; import { shell } from '../shell.js'; import type { Context } from './context.js'; diff --git a/packages/create-astro/src/actions/project-name.ts b/packages/create-astro/src/actions/project-name.ts index 533240efd42d..32603142e316 100644 --- a/packages/create-astro/src/actions/project-name.ts +++ b/packages/create-astro/src/actions/project-name.ts @@ -1,7 +1,7 @@ import type { Context } from './context.js'; -import { color, generateProjectName } from '@astrojs/cli-kit'; import path from 'node:path'; +import { color, generateProjectName } from '@astrojs/cli-kit'; import { info, log, title } from '../messages.js'; import { isEmpty, toValidName } from './shared.js'; diff --git a/packages/create-astro/src/actions/template.ts b/packages/create-astro/src/actions/template.ts index 60a77104f028..6f680109348b 100644 --- a/packages/create-astro/src/actions/template.ts +++ b/packages/create-astro/src/actions/template.ts @@ -1,9 +1,9 @@ import type { Context } from './context.js'; -import { color } from '@astrojs/cli-kit'; -import { downloadTemplate } from 'giget'; import fs from 'node:fs'; import path from 'node:path'; +import { color } from '@astrojs/cli-kit'; +import { downloadTemplate } from 'giget'; import { error, info, spinner, title } from '../messages.js'; export async function template(ctx: Pick) { diff --git a/packages/create-astro/src/actions/typescript.ts b/packages/create-astro/src/actions/typescript.ts index 97ae243032b7..372c59994dc6 100644 --- a/packages/create-astro/src/actions/typescript.ts +++ b/packages/create-astro/src/actions/typescript.ts @@ -1,9 +1,9 @@ import type { Context } from './context.js'; -import { color } from '@astrojs/cli-kit'; import fs from 'node:fs'; import { readFile } from 'node:fs/promises'; import path from 'node:path'; +import { color } from '@astrojs/cli-kit'; import stripJsonComments from 'strip-json-comments'; import { error, info, spinner, title, typescriptByDefault } from '../messages.js'; diff --git a/packages/create-astro/test/git.test.js b/packages/create-astro/test/git.test.js index d05ad5bdc19d..ebcec9ceb38e 100644 --- a/packages/create-astro/test/git.test.js +++ b/packages/create-astro/test/git.test.js @@ -1,6 +1,6 @@ -import { expect } from 'chai'; -import { mkdir, writeFile } from 'node:fs/promises'; import { rmSync } from 'node:fs'; +import { mkdir, writeFile } from 'node:fs/promises'; +import { expect } from 'chai'; import { git } from '../dist/index.js'; import { setup } from './utils.js'; diff --git a/packages/create-astro/test/typescript.test.js b/packages/create-astro/test/typescript.test.js index be89a499d242..e80f35f8caf5 100644 --- a/packages/create-astro/test/typescript.test.js +++ b/packages/create-astro/test/typescript.test.js @@ -3,7 +3,7 @@ import { expect } from 'chai'; import fs from 'node:fs'; import { fileURLToPath } from 'node:url'; -import { typescript, setupTypeScript } from '../dist/index.js'; +import { setupTypeScript, typescript } from '../dist/index.js'; import { setup } from './utils.js'; describe('typescript', () => { diff --git a/packages/create-astro/test/utils.js b/packages/create-astro/test/utils.js index ff5d5dd832af..0149279f6c45 100644 --- a/packages/create-astro/test/utils.js +++ b/packages/create-astro/test/utils.js @@ -1,5 +1,5 @@ -import { setStdout } from '../dist/index.js'; import stripAnsi from 'strip-ansi'; +import { setStdout } from '../dist/index.js'; export function setup() { const ctx = { messages: [] }; diff --git a/packages/integrations/cloudflare/src/server.advanced.ts b/packages/integrations/cloudflare/src/server.advanced.ts index 6e305b1b96cc..a9b42e116900 100644 --- a/packages/integrations/cloudflare/src/server.advanced.ts +++ b/packages/integrations/cloudflare/src/server.advanced.ts @@ -1,4 +1,4 @@ -import type { Request as CFRequest, ExecutionContext } from '@cloudflare/workers-types'; +import type { ExecutionContext, Request as CFRequest } from '@cloudflare/workers-types'; import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import { getProcessEnvProxy, isNode } from './util.js'; diff --git a/packages/integrations/cloudflare/src/server.directory.ts b/packages/integrations/cloudflare/src/server.directory.ts index 48c97392cc03..771417e6a905 100644 --- a/packages/integrations/cloudflare/src/server.directory.ts +++ b/packages/integrations/cloudflare/src/server.directory.ts @@ -1,4 +1,4 @@ -import type { Request as CFRequest, EventContext } from '@cloudflare/workers-types'; +import type { EventContext, Request as CFRequest } from '@cloudflare/workers-types'; import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import { getProcessEnvProxy, isNode } from './util.js'; diff --git a/packages/integrations/cloudflare/test/basics.test.js b/packages/integrations/cloudflare/test/basics.test.js index 726a19fc61d8..2e05f0ec69e1 100644 --- a/packages/integrations/cloudflare/test/basics.test.js +++ b/packages/integrations/cloudflare/test/basics.test.js @@ -1,6 +1,6 @@ -import { loadFixture, runCLI } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; +import { loadFixture, runCLI } from './test-utils.js'; describe('Basic app', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/cloudflare/test/cf.test.js b/packages/integrations/cloudflare/test/cf.test.js index 53b1bbf2c3d8..7b7e51dcfc99 100644 --- a/packages/integrations/cloudflare/test/cf.test.js +++ b/packages/integrations/cloudflare/test/cf.test.js @@ -1,7 +1,7 @@ -import { loadFixture, runCLI } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; import cloudflare from '../dist/index.js'; +import { loadFixture, runCLI } from './test-utils.js'; describe('Wrangler Cloudflare Runtime', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/cloudflare/test/directory.test.js b/packages/integrations/cloudflare/test/directory.test.js index a252b03e9254..7b2541417662 100644 --- a/packages/integrations/cloudflare/test/directory.test.js +++ b/packages/integrations/cloudflare/test/directory.test.js @@ -1,6 +1,6 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import cloudflare from '../dist/index.js'; +import { loadFixture } from './test-utils.js'; /** @type {import('./test-utils').Fixture} */ describe('mode: "directory"', () => { diff --git a/packages/integrations/cloudflare/test/function-per-route.test.js b/packages/integrations/cloudflare/test/function-per-route.test.js index d20b0fa7c3f3..ecb7228d00fe 100644 --- a/packages/integrations/cloudflare/test/function-per-route.test.js +++ b/packages/integrations/cloudflare/test/function-per-route.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; /** @type {import('./test-utils.js').Fixture} */ describe('Cloudflare SSR functionPerRoute', () => { diff --git a/packages/integrations/cloudflare/test/no-output.test.js b/packages/integrations/cloudflare/test/no-output.test.js index af4d9c2b6639..9750624b6595 100644 --- a/packages/integrations/cloudflare/test/no-output.test.js +++ b/packages/integrations/cloudflare/test/no-output.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; describe('Missing output config', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/cloudflare/test/prerender.test.js b/packages/integrations/cloudflare/test/prerender.test.js index 6c2b8c5bb69e..52db4e4c96c1 100644 --- a/packages/integrations/cloudflare/test/prerender.test.js +++ b/packages/integrations/cloudflare/test/prerender.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; describe('Prerendering', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/cloudflare/test/runtime.test.js b/packages/integrations/cloudflare/test/runtime.test.js index 8bb38d7e59da..84d4bcb8f86e 100644 --- a/packages/integrations/cloudflare/test/runtime.test.js +++ b/packages/integrations/cloudflare/test/runtime.test.js @@ -1,7 +1,7 @@ -import { loadFixture, runCLI } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; import cloudflare from '../dist/index.js'; +import { loadFixture, runCLI } from './test-utils.js'; describe('Runtime Locals', () => { /** @type {import('./test-utils.js').Fixture} */ diff --git a/packages/integrations/cloudflare/test/with-solid-js.test.js b/packages/integrations/cloudflare/test/with-solid-js.test.js index c644163b0da7..4fd7f624b91c 100644 --- a/packages/integrations/cloudflare/test/with-solid-js.test.js +++ b/packages/integrations/cloudflare/test/with-solid-js.test.js @@ -1,6 +1,6 @@ -import { loadFixture, runCLI } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; +import { loadFixture, runCLI } from './test-utils.js'; describe('With SolidJS', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts index d1dd6103dd52..efe290806d9e 100644 --- a/packages/integrations/deno/src/index.ts +++ b/packages/integrations/deno/src/index.ts @@ -1,8 +1,8 @@ -import type { AstroAdapter, AstroIntegration } from 'astro'; -import esbuild from 'esbuild'; import * as fs from 'node:fs'; import * as npath from 'node:path'; import { fileURLToPath } from 'node:url'; +import type { AstroAdapter, AstroIntegration } from 'astro'; +import esbuild from 'esbuild'; import type { BuildConfig, Options } from './types'; const SHIM = `globalThis.process = { diff --git a/packages/integrations/deno/src/server.ts b/packages/integrations/deno/src/server.ts index 95c638b65d26..735de7acbfef 100644 --- a/packages/integrations/deno/src/server.ts +++ b/packages/integrations/deno/src/server.ts @@ -4,7 +4,7 @@ import { App } from 'astro/app'; import type { Options } from './types'; // @ts-expect-error -import { fromFileUrl, serveFile, Server } from '@astrojs/deno/__deno_imports.js'; +import { Server, fromFileUrl, serveFile } from '@astrojs/deno/__deno_imports.js'; let _server: Server | undefined = undefined; let _startPromise: Promise | undefined = undefined; diff --git a/packages/integrations/deno/test/basics.test.ts b/packages/integrations/deno/test/basics.test.ts index 043fab2d6c9b..443ab64528f9 100644 --- a/packages/integrations/deno/test/basics.test.ts +++ b/packages/integrations/deno/test/basics.test.ts @@ -1,8 +1,8 @@ +import { assert, assertEquals } from 'https://deno.land/std@0.158.0/testing/asserts.ts'; /* Deno types consider DOM elements nullable */ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { DOMParser } from 'https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts'; -import { assert, assertEquals } from 'https://deno.land/std@0.158.0/testing/asserts.ts'; -import { runBuildAndStartApp, defaultTestPermissions } from './helpers.ts'; +import { defaultTestPermissions, runBuildAndStartApp } from './helpers.ts'; // this needs to be here and not in the specific test case, because // the variables are loaded in the global scope of the built server diff --git a/packages/integrations/deno/test/dynamic-import.test.ts b/packages/integrations/deno/test/dynamic-import.test.ts index aa9d44c6738d..0de606f46b4b 100644 --- a/packages/integrations/deno/test/dynamic-import.test.ts +++ b/packages/integrations/deno/test/dynamic-import.test.ts @@ -1,7 +1,7 @@ +import { assert, assertEquals } from 'https://deno.land/std@0.158.0/testing/asserts.ts'; /* Deno types consider DOM elements nullable */ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { DOMParser } from 'https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts'; -import { assert, assertEquals } from 'https://deno.land/std@0.158.0/testing/asserts.ts'; import { runBuildAndStartAppFromSubprocess } from './helpers.ts'; Deno.test({ diff --git a/packages/integrations/deno/test/helpers.ts b/packages/integrations/deno/test/helpers.ts index ac451d96315b..d0aeb136b832 100644 --- a/packages/integrations/deno/test/helpers.ts +++ b/packages/integrations/deno/test/helpers.ts @@ -1,6 +1,6 @@ import { fromFileUrl } from 'https://deno.land/std@0.110.0/path/mod.ts'; -import { assert } from 'https://deno.land/std@0.158.0/testing/asserts.ts'; import { readableStreamFromReader } from 'https://deno.land/std@0.142.0/streams/conversion.ts'; +import { assert } from 'https://deno.land/std@0.158.0/testing/asserts.ts'; const dir = new URL('./', import.meta.url); const defaultURL = new URL('http://localhost:8085/'); diff --git a/packages/integrations/lit/server-shim.js b/packages/integrations/lit/server-shim.js index ed371f89a32f..7cbee09f40b2 100644 --- a/packages/integrations/lit/server-shim.js +++ b/packages/integrations/lit/server-shim.js @@ -1,4 +1,4 @@ -import { customElements as litCE, HTMLElement as litShimHTMLElement } from '@lit-labs/ssr-dom-shim'; +import { HTMLElement as litShimHTMLElement, customElements as litCE } from '@lit-labs/ssr-dom-shim'; // Something at build time injects document.currentScript = undefined instead of // document.currentScript = null. This causes Sass build to fail because it diff --git a/packages/integrations/lit/server.js b/packages/integrations/lit/server.js index d71ccee47b21..ea94e4714a08 100644 --- a/packages/integrations/lit/server.js +++ b/packages/integrations/lit/server.js @@ -1,6 +1,6 @@ -import './server-shim.js'; import { LitElementRenderer } from '@lit-labs/ssr/lib/lit-element-renderer.js'; import * as parse5 from 'parse5'; +import './server-shim.js'; function isCustomElementTag(name) { return typeof name === 'string' && /-/.test(name); diff --git a/packages/integrations/lit/src/index.ts b/packages/integrations/lit/src/index.ts index de6d5b0f91c3..b5ca8ae38a9a 100644 --- a/packages/integrations/lit/src/index.ts +++ b/packages/integrations/lit/src/index.ts @@ -1,5 +1,5 @@ -import type { AstroIntegration } from 'astro'; import { readFileSync } from 'node:fs'; +import type { AstroIntegration } from 'astro'; function getViteConfiguration() { return { diff --git a/packages/integrations/lit/test/server.test.js b/packages/integrations/lit/test/server.test.js index 557832db5ccb..1582ef893c40 100644 --- a/packages/integrations/lit/test/server.test.js +++ b/packages/integrations/lit/test/server.test.js @@ -1,9 +1,9 @@ import { expect } from 'chai'; +import * as cheerio from 'cheerio'; import { LitElement, html } from 'lit'; // Must come after lit import because @lit/reactive-element defines // globalThis.customElements which the server shim expects to be defined. import server from '../server.js'; -import * as cheerio from 'cheerio'; const { check, renderToStaticMarkup } = server; diff --git a/packages/integrations/markdoc/components/TreeNode.ts b/packages/integrations/markdoc/components/TreeNode.ts index 31976c19d321..e6fe78ee3343 100644 --- a/packages/integrations/markdoc/components/TreeNode.ts +++ b/packages/integrations/markdoc/components/TreeNode.ts @@ -1,17 +1,17 @@ -import type { AstroInstance } from 'astro'; import type { RenderableTreeNode } from '@markdoc/markdoc'; import Markdoc from '@markdoc/markdoc'; +import type { AstroInstance } from 'astro'; import { + HTMLString, createComponent, - renderComponent, + createHeadAndContent, + isHTMLString, render, + renderComponent, renderScriptElement, + renderTemplate, renderUniqueStylesheet, - createHeadAndContent, unescapeHTML, - renderTemplate, - HTMLString, - isHTMLString, } from 'astro/runtime/server/index.js'; export type TreeNode = diff --git a/packages/integrations/markdoc/src/content-entry-type.ts b/packages/integrations/markdoc/src/content-entry-type.ts index f682e114fc8e..72ac0c38d5b9 100644 --- a/packages/integrations/markdoc/src/content-entry-type.ts +++ b/packages/integrations/markdoc/src/content-entry-type.ts @@ -1,11 +1,11 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; import type { Config as MarkdocConfig, Node } from '@markdoc/markdoc'; import Markdoc from '@markdoc/markdoc'; import type { AstroConfig, ContentEntryType } from 'astro'; import { emitESMImage } from 'astro/assets/utils'; 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'; diff --git a/packages/integrations/markdoc/src/extensions/prism.ts b/packages/integrations/markdoc/src/extensions/prism.ts index 5cfd628caaaf..54f98f928dbc 100644 --- a/packages/integrations/markdoc/src/extensions/prism.ts +++ b/packages/integrations/markdoc/src/extensions/prism.ts @@ -1,6 +1,6 @@ import { runHighlighterWithAstro } from '@astrojs/prism/dist/highlighter'; import { unescapeHTML } from 'astro/runtime/server/index.js'; -import { Markdoc, type AstroMarkdocConfig } from '../config.js'; +import { type AstroMarkdocConfig, Markdoc } from '../config.js'; export default function prism(): AstroMarkdocConfig { return { diff --git a/packages/integrations/markdoc/src/index.ts b/packages/integrations/markdoc/src/index.ts index 15a0fa7afc2f..1696b36e8e53 100644 --- a/packages/integrations/markdoc/src/index.ts +++ b/packages/integrations/markdoc/src/index.ts @@ -1,9 +1,9 @@ import type { AstroConfig, AstroIntegration, ContentEntryType, HookParameters } from 'astro'; import { getContentEntryType } from './content-entry-type.js'; import { + type MarkdocConfigResult, SUPPORTED_MARKDOC_CONFIG_FILES, loadMarkdocConfig, - type MarkdocConfigResult, } from './load-config.js'; import type { MarkdocIntegrationOptions } from './options.js'; diff --git a/packages/integrations/markdoc/src/load-config.ts b/packages/integrations/markdoc/src/load-config.ts index 723516ce7bfd..6ae6f5a154d9 100644 --- a/packages/integrations/markdoc/src/load-config.ts +++ b/packages/integrations/markdoc/src/load-config.ts @@ -1,7 +1,7 @@ -import type { AstroConfig } from 'astro'; -import { build as esbuild } from 'esbuild'; import * as fs from 'node:fs'; import { fileURLToPath } from 'node:url'; +import type { AstroConfig } from 'astro'; +import { build as esbuild } from 'esbuild'; import type { AstroMarkdocConfig } from './config.js'; import { MarkdocError } from './utils.js'; diff --git a/packages/integrations/markdoc/test/content-collections.test.js b/packages/integrations/markdoc/test/content-collections.test.js index aad389e0ccd2..610846a06948 100644 --- a/packages/integrations/markdoc/test/content-collections.test.js +++ b/packages/integrations/markdoc/test/content-collections.test.js @@ -1,6 +1,6 @@ -import { parse as parseDevalue } from 'devalue'; import { expect } from 'chai'; -import { loadFixture, fixLineEndings } from '../../../astro/test/test-utils.js'; +import { parse as parseDevalue } from 'devalue'; +import { fixLineEndings, loadFixture } from '../../../astro/test/test-utils.js'; import markdoc from '../dist/index.js'; function formatPost(post) { diff --git a/packages/integrations/markdoc/test/headings.test.js b/packages/integrations/markdoc/test/headings.test.js index 5468e8c6b3d4..3c6e1bd9f512 100644 --- a/packages/integrations/markdoc/test/headings.test.js +++ b/packages/integrations/markdoc/test/headings.test.js @@ -1,5 +1,5 @@ -import { parseHTML } from 'linkedom'; import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; async function getFixture(name) { diff --git a/packages/integrations/markdoc/test/image-assets.test.js b/packages/integrations/markdoc/test/image-assets.test.js index 7339960dd202..1817956a7aff 100644 --- a/packages/integrations/markdoc/test/image-assets.test.js +++ b/packages/integrations/markdoc/test/image-assets.test.js @@ -1,5 +1,5 @@ -import { parseHTML } from 'linkedom'; import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; const root = new URL('./fixtures/image-assets/', import.meta.url); diff --git a/packages/integrations/markdoc/test/propagated-assets.test.js b/packages/integrations/markdoc/test/propagated-assets.test.js index 4326233c1d45..50f0377d6aff 100644 --- a/packages/integrations/markdoc/test/propagated-assets.test.js +++ b/packages/integrations/markdoc/test/propagated-assets.test.js @@ -1,5 +1,5 @@ -import { parseHTML } from 'linkedom'; import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; describe('Markdoc - propagated assets', () => { diff --git a/packages/integrations/markdoc/test/render-html.test.js b/packages/integrations/markdoc/test/render-html.test.js index a0c38ace3127..068790b8614e 100644 --- a/packages/integrations/markdoc/test/render-html.test.js +++ b/packages/integrations/markdoc/test/render-html.test.js @@ -1,5 +1,5 @@ -import { parseHTML } from 'linkedom'; import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; async function getFixture(name) { diff --git a/packages/integrations/markdoc/test/render.test.js b/packages/integrations/markdoc/test/render.test.js index 86ffcb7077ec..ed144181b937 100644 --- a/packages/integrations/markdoc/test/render.test.js +++ b/packages/integrations/markdoc/test/render.test.js @@ -1,5 +1,5 @@ -import { parseHTML } from 'linkedom'; import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; async function getFixture(name) { diff --git a/packages/integrations/markdoc/test/syntax-highlighting.test.js b/packages/integrations/markdoc/test/syntax-highlighting.test.js index 1530e0c825f0..9cab2a10dd54 100644 --- a/packages/integrations/markdoc/test/syntax-highlighting.test.js +++ b/packages/integrations/markdoc/test/syntax-highlighting.test.js @@ -1,10 +1,10 @@ -import { parseHTML } from 'linkedom'; -import { expect } from 'chai'; import Markdoc from '@markdoc/markdoc'; -import shiki from '../dist/extensions/shiki.js'; +import { isHTMLString } from 'astro/runtime/server/index.js'; +import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import prism from '../dist/extensions/prism.js'; +import shiki from '../dist/extensions/shiki.js'; import { setupConfig } from '../dist/runtime.js'; -import { isHTMLString } from 'astro/runtime/server/index.js'; const entry = ` \`\`\`ts diff --git a/packages/integrations/markdoc/test/variables.test.js b/packages/integrations/markdoc/test/variables.test.js index 90d5fe276320..27bd3543eeda 100644 --- a/packages/integrations/markdoc/test/variables.test.js +++ b/packages/integrations/markdoc/test/variables.test.js @@ -1,5 +1,5 @@ -import { parseHTML } from 'linkedom'; import { expect } from 'chai'; +import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; import markdoc from '../dist/index.js'; diff --git a/packages/integrations/mdx/test/css-head-mdx.test.js b/packages/integrations/mdx/test/css-head-mdx.test.js index ed1c6d1d68ce..453b6c8ea7b1 100644 --- a/packages/integrations/mdx/test/css-head-mdx.test.js +++ b/packages/integrations/mdx/test/css-head-mdx.test.js @@ -1,9 +1,9 @@ import mdx from '@astrojs/mdx'; import { expect } from 'chai'; +import * as cheerio from 'cheerio'; import { parseHTML } from 'linkedom'; import { loadFixture } from '../../../astro/test/test-utils.js'; -import * as cheerio from 'cheerio'; describe('Head injection w/ MDX', () => { let fixture; diff --git a/packages/integrations/mdx/test/mdx-get-static-paths.test.js b/packages/integrations/mdx/test/mdx-get-static-paths.test.js index c5a34f7deaf4..e723369affe3 100644 --- a/packages/integrations/mdx/test/mdx-get-static-paths.test.js +++ b/packages/integrations/mdx/test/mdx-get-static-paths.test.js @@ -1,8 +1,8 @@ import mdx from '@astrojs/mdx'; import { expect } from 'chai'; -import { loadFixture } from '../../../astro/test/test-utils.js'; import * as cheerio from 'cheerio'; +import { loadFixture } from '../../../astro/test/test-utils.js'; const FIXTURE_ROOT = new URL('./fixtures/mdx-get-static-paths', import.meta.url); diff --git a/packages/integrations/mdx/test/mdx-math.test.js b/packages/integrations/mdx/test/mdx-math.test.js index f39ea42c8399..7f9b924ddd1f 100644 --- a/packages/integrations/mdx/test/mdx-math.test.js +++ b/packages/integrations/mdx/test/mdx-math.test.js @@ -1,10 +1,10 @@ import mdx from '@astrojs/mdx'; import { expect } from 'chai'; import { parseHTML } from 'linkedom'; -import { loadFixture } from '../../../astro/test/test-utils.js'; -import remarkMath from 'remark-math'; import rehypeMathjaxSvg from 'rehype-mathjax'; import rehypeMathjaxChtml from 'rehype-mathjax/chtml.js'; +import remarkMath from 'remark-math'; +import { loadFixture } from '../../../astro/test/test-utils.js'; const FIXTURE_ROOT = new URL('./fixtures/mdx-math/', import.meta.url); diff --git a/packages/integrations/mdx/test/mdx-plugins.test.js b/packages/integrations/mdx/test/mdx-plugins.test.js index 324e00c9ccd2..362bec230329 100644 --- a/packages/integrations/mdx/test/mdx-plugins.test.js +++ b/packages/integrations/mdx/test/mdx-plugins.test.js @@ -1,10 +1,10 @@ import mdx from '@astrojs/mdx'; import { expect } from 'chai'; +import { visit as estreeVisit } from 'estree-util-visit'; import { parseHTML } from 'linkedom'; -import { loadFixture } from '../../../astro/test/test-utils.js'; import remarkToc from 'remark-toc'; -import { visit as estreeVisit } from 'estree-util-visit'; +import { loadFixture } from '../../../astro/test/test-utils.js'; const FIXTURE_ROOT = new URL('./fixtures/mdx-plugins/', import.meta.url); const FILE = '/with-plugins/index.html'; diff --git a/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js b/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js index 40281cffd1c4..55a7f3c7d4a1 100644 --- a/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js +++ b/packages/integrations/mdx/test/mdx-syntax-highlighting.test.js @@ -2,9 +2,9 @@ import mdx from '@astrojs/mdx'; import { expect } from 'chai'; import { parseHTML } from 'linkedom'; -import { loadFixture } from '../../../astro/test/test-utils.js'; -import shikiTwoslash from 'remark-shiki-twoslash'; import rehypePrettyCode from 'rehype-pretty-code'; +import shikiTwoslash from 'remark-shiki-twoslash'; +import { loadFixture } from '../../../astro/test/test-utils.js'; const FIXTURE_ROOT = new URL('./fixtures/mdx-syntax-hightlighting/', import.meta.url); diff --git a/packages/integrations/netlify/src/integration-functions.ts b/packages/integrations/netlify/src/integration-functions.ts index b8d56ad65df8..06391bd214f4 100644 --- a/packages/integrations/netlify/src/integration-functions.ts +++ b/packages/integrations/netlify/src/integration-functions.ts @@ -1,6 +1,6 @@ -import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro'; import { extname } from 'node:path'; import { fileURLToPath } from 'node:url'; +import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro'; import { generateEdgeMiddleware } from './middleware.js'; import type { Args } from './netlify-functions.js'; import { createRedirects } from './shared.js'; diff --git a/packages/integrations/netlify/src/netlify-functions.ts b/packages/integrations/netlify/src/netlify-functions.ts index 8c051d9f603c..9c9d8ad3a3ed 100644 --- a/packages/integrations/netlify/src/netlify-functions.ts +++ b/packages/integrations/netlify/src/netlify-functions.ts @@ -1,4 +1,4 @@ -import { builder, type Handler } from '@netlify/functions'; +import { type Handler, builder } from '@netlify/functions'; import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import { applyPolyfills } from 'astro/app/node'; diff --git a/packages/integrations/netlify/src/shared.ts b/packages/integrations/netlify/src/shared.ts index 175b9d04f74f..fca3d5f0c03f 100644 --- a/packages/integrations/netlify/src/shared.ts +++ b/packages/integrations/netlify/src/shared.ts @@ -1,9 +1,9 @@ -import { createRedirectsFromAstroRoutes } from '@astrojs/underscore-redirects'; -import type { AstroConfig, RouteData } from 'astro'; -import esbuild from 'esbuild'; import fs from 'node:fs'; import npath from 'node:path'; import { fileURLToPath } from 'node:url'; +import { createRedirectsFromAstroRoutes } from '@astrojs/underscore-redirects'; +import type { AstroConfig, RouteData } from 'astro'; +import esbuild from 'esbuild'; export const DENO_SHIM = `globalThis.process = { argv: [], diff --git a/packages/integrations/netlify/test/functions/base64-response.test.js b/packages/integrations/netlify/test/functions/base64-response.test.js index 6e59bd192210..bad470a8d3ba 100644 --- a/packages/integrations/netlify/test/functions/base64-response.test.js +++ b/packages/integrations/netlify/test/functions/base64-response.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture, testIntegration } from './test-utils.js'; import netlifyAdapter from '../../dist/index.js'; +import { loadFixture, testIntegration } from './test-utils.js'; describe('Base64 Responses', () => { /** @type {import('../../../astro/test/test-utils').Fixture} */ diff --git a/packages/integrations/netlify/test/functions/builders.test.js b/packages/integrations/netlify/test/functions/builders.test.js index d47af92c0d44..c1a3dd668569 100644 --- a/packages/integrations/netlify/test/functions/builders.test.js +++ b/packages/integrations/netlify/test/functions/builders.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture, testIntegration } from './test-utils.js'; import netlifyAdapter from '../../dist/index.js'; +import { loadFixture, testIntegration } from './test-utils.js'; describe('Builders', () => { /** @type {import('../../../astro/test/test-utils').Fixture} */ diff --git a/packages/integrations/netlify/test/functions/cookies.test.js b/packages/integrations/netlify/test/functions/cookies.test.js index f15695235242..e0cd2489c03f 100644 --- a/packages/integrations/netlify/test/functions/cookies.test.js +++ b/packages/integrations/netlify/test/functions/cookies.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture, testIntegration } from './test-utils.js'; import netlifyAdapter from '../../dist/index.js'; +import { loadFixture, testIntegration } from './test-utils.js'; describe('Cookies', () => { /** @type {import('../../../astro/test/test-utils').Fixture} */ diff --git a/packages/integrations/netlify/test/functions/edge-middleware.test.js b/packages/integrations/netlify/test/functions/edge-middleware.test.js index a83720a4d49c..64af2da0696a 100644 --- a/packages/integrations/netlify/test/functions/edge-middleware.test.js +++ b/packages/integrations/netlify/test/functions/edge-middleware.test.js @@ -1,6 +1,6 @@ -import netlifyAdapter from '../../dist/index.js'; -import { testIntegration, loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import netlifyAdapter from '../../dist/index.js'; +import { loadFixture, testIntegration } from './test-utils.js'; describe('Middleware', () => { it('with edge handle file, should successfully build the middleware', async () => { diff --git a/packages/integrations/netlify/test/static/redirects.test.js b/packages/integrations/netlify/test/static/redirects.test.js index ae3ff1eb843c..0c5751eb8148 100644 --- a/packages/integrations/netlify/test/static/redirects.test.js +++ b/packages/integrations/netlify/test/static/redirects.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { loadFixture, testIntegration } from './test-utils.js'; import { netlifyStatic } from '../../dist/index.js'; +import { loadFixture, testIntegration } from './test-utils.js'; describe('SSG - Redirects', () => { /** @type {import('../../../astro/test/test-utils').Fixture} */ diff --git a/packages/integrations/node/src/preview.ts b/packages/integrations/node/src/preview.ts index 70ed5469875b..a34441627dcb 100644 --- a/packages/integrations/node/src/preview.ts +++ b/packages/integrations/node/src/preview.ts @@ -1,7 +1,7 @@ -import type { CreatePreviewServer } from 'astro'; -import { AstroError } from 'astro/errors'; import type http from 'node:http'; import { fileURLToPath } from 'node:url'; +import type { CreatePreviewServer } from 'astro'; +import { AstroError } from 'astro/errors'; import { getNetworkAddress } from './get-network-address.js'; import { createServer } from './http-server.js'; import type { createExports } from './server.js'; diff --git a/packages/integrations/node/src/response-iterator.ts b/packages/integrations/node/src/response-iterator.ts index b79c3a85345b..46c602415f46 100644 --- a/packages/integrations/node/src/response-iterator.ts +++ b/packages/integrations/node/src/response-iterator.ts @@ -4,9 +4,9 @@ * - https://github.com/apollographql/apollo-client/blob/main/src/utilities/common/responseIterator.ts */ -import { AstroError } from 'astro/errors'; import type { ReadableStreamDefaultReadResult } from 'node:stream/web'; import { Readable as NodeReadableStream } from 'stream'; +import { AstroError } from 'astro/errors'; interface NodeStreamIterator { next(): Promise>; @@ -121,7 +121,7 @@ function nodeStreamIterator(stream: NodeReadableStream): AsyncIterableIterato | IteratorResult | PromiseLike> ) => void, - (reason?: any) => void, + (reason?: any) => void ][] = []; function onData(chunk: any) { diff --git a/packages/integrations/node/src/standalone.ts b/packages/integrations/node/src/standalone.ts index abe40ff5cced..b2c83a952cb6 100644 --- a/packages/integrations/node/src/standalone.ts +++ b/packages/integrations/node/src/standalone.ts @@ -1,7 +1,7 @@ -import type { NodeApp } from 'astro/app/node'; import https from 'https'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import type { NodeApp } from 'astro/app/node'; import { getNetworkAddress } from './get-network-address.js'; import { createServer } from './http-server.js'; import middleware from './nodeMiddleware.js'; diff --git a/packages/integrations/node/src/types.ts b/packages/integrations/node/src/types.ts index 85f4f4fbce98..b0bd4a6819c3 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/api-route.test.js b/packages/integrations/node/test/api-route.test.js index c830eee2d6c8..3033227c4772 100644 --- a/packages/integrations/node/test/api-route.test.js +++ b/packages/integrations/node/test/api-route.test.js @@ -1,7 +1,7 @@ -import nodejs from '../dist/index.js'; -import { loadFixture, createRequestAndResponse } from './test-utils.js'; -import { expect } from 'chai'; import crypto from 'node:crypto'; +import { expect } from 'chai'; +import nodejs from '../dist/index.js'; +import { createRequestAndResponse, loadFixture } from './test-utils.js'; describe('API routes', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/node/test/encoded.test.js b/packages/integrations/node/test/encoded.test.js index bbd264777996..e8124079f21e 100644 --- a/packages/integrations/node/test/encoded.test.js +++ b/packages/integrations/node/test/encoded.test.js @@ -1,6 +1,6 @@ -import nodejs from '../dist/index.js'; -import { loadFixture, createRequestAndResponse } from './test-utils.js'; import { expect } from 'chai'; +import nodejs from '../dist/index.js'; +import { createRequestAndResponse, loadFixture } from './test-utils.js'; describe('Encoded Pathname', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/node/test/errors.test.js b/packages/integrations/node/test/errors.test.js index 6bb93023a925..174db3289dd1 100644 --- a/packages/integrations/node/test/errors.test.js +++ b/packages/integrations/node/test/errors.test.js @@ -1,7 +1,7 @@ -import nodejs from '../dist/index.js'; -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; +import nodejs from '../dist/index.js'; +import { loadFixture } from './test-utils.js'; describe('Errors', () => { let fixture; diff --git a/packages/integrations/node/test/headers.test.js.js b/packages/integrations/node/test/headers.test.js.js index 17cfd37013bf..dd71a684448d 100644 --- a/packages/integrations/node/test/headers.test.js.js +++ b/packages/integrations/node/test/headers.test.js.js @@ -1,6 +1,6 @@ -import nodejs from '../dist/index.js'; -import { loadFixture, createRequestAndResponse } from './test-utils.js'; import { expect } from 'chai'; +import nodejs from '../dist/index.js'; +import { createRequestAndResponse, loadFixture } from './test-utils.js'; describe('Node Adapter Headers', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/node/test/locals.test.js b/packages/integrations/node/test/locals.test.js index f7fc6b73f320..ae5a2c0e6b25 100644 --- a/packages/integrations/node/test/locals.test.js +++ b/packages/integrations/node/test/locals.test.js @@ -1,6 +1,6 @@ -import nodejs from '../dist/index.js'; -import { loadFixture, createRequestAndResponse } from './test-utils.js'; import { expect } from 'chai'; +import nodejs from '../dist/index.js'; +import { createRequestAndResponse, loadFixture } from './test-utils.js'; describe('API routes', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/node/test/node-middleware.test.js b/packages/integrations/node/test/node-middleware.test.js index 009f403c21c7..fc5d6b417515 100644 --- a/packages/integrations/node/test/node-middleware.test.js +++ b/packages/integrations/node/test/node-middleware.test.js @@ -1,8 +1,8 @@ -import nodejs from '../dist/index.js'; -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; import express from 'express'; +import nodejs from '../dist/index.js'; +import { loadFixture } from './test-utils.js'; /** * @typedef {import('../../../astro/test/test-utils').Fixture} Fixture diff --git a/packages/integrations/node/test/prerender-404-500.test.js b/packages/integrations/node/test/prerender-404-500.test.js index f8bf0778c756..93a4e3419155 100644 --- a/packages/integrations/node/test/prerender-404-500.test.js +++ b/packages/integrations/node/test/prerender-404-500.test.js @@ -1,7 +1,7 @@ -import nodejs from '../dist/index.js'; -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; +import nodejs from '../dist/index.js'; +import { loadFixture } from './test-utils.js'; /** * @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 65e3b4cb2e78..c9b4c715967b 100644 --- a/packages/integrations/node/test/prerender.test.js +++ b/packages/integrations/node/test/prerender.test.js @@ -1,7 +1,7 @@ -import nodejs from '../dist/index.js'; -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import * as cheerio from 'cheerio'; +import nodejs from '../dist/index.js'; +import { loadFixture } from './test-utils.js'; /** * @typedef {import('../../../astro/test/test-utils').Fixture} Fixture diff --git a/packages/integrations/node/test/test-utils.js b/packages/integrations/node/test/test-utils.js index 70ceaed25803..1f9a254b5786 100644 --- a/packages/integrations/node/test/test-utils.js +++ b/packages/integrations/node/test/test-utils.js @@ -1,5 +1,5 @@ -import httpMocks from 'node-mocks-http'; import { EventEmitter } from 'node:events'; +import httpMocks from 'node-mocks-http'; import { loadFixture as baseLoadFixture } from '../../../astro/test/test-utils.js'; /** diff --git a/packages/integrations/node/test/url-protocol.test.js b/packages/integrations/node/test/url-protocol.test.js index a83cb2a41e12..8b4f3077b065 100644 --- a/packages/integrations/node/test/url-protocol.test.js +++ b/packages/integrations/node/test/url-protocol.test.js @@ -1,5 +1,5 @@ -import { expect } from 'chai'; import { TLSSocket } from 'node:tls'; +import { expect } from 'chai'; import nodejs from '../dist/index.js'; import { createRequestAndResponse, loadFixture } from './test-utils.js'; diff --git a/packages/integrations/node/test/well-known-locations.test.js b/packages/integrations/node/test/well-known-locations.test.js index 31f31bacd008..18cc0b596b8a 100644 --- a/packages/integrations/node/test/well-known-locations.test.js +++ b/packages/integrations/node/test/well-known-locations.test.js @@ -1,6 +1,6 @@ +import { expect } from 'chai'; import nodejs from '../dist/index.js'; import { loadFixture } from './test-utils.js'; -import { expect } from 'chai'; describe('test URIs beginning with a dot', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/partytown/src/index.ts b/packages/integrations/partytown/src/index.ts index 13f7b1118e77..7f2ed79478fb 100644 --- a/packages/integrations/partytown/src/index.ts +++ b/packages/integrations/partytown/src/index.ts @@ -1,11 +1,11 @@ -import type { PartytownConfig } from '@builder.io/partytown/integration'; -import { partytownSnippet } from '@builder.io/partytown/integration'; -import { copyLibFiles, libDirPath } from '@builder.io/partytown/utils'; -import type { AstroIntegration } from 'astro'; import { createRequire } from 'module'; import * as fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; +import type { PartytownConfig } from '@builder.io/partytown/integration'; +import { partytownSnippet } from '@builder.io/partytown/integration'; +import { copyLibFiles, libDirPath } from '@builder.io/partytown/utils'; +import type { AstroIntegration } from 'astro'; import sirv from './sirv.js'; const resolve = createRequire(import.meta.url).resolve; diff --git a/packages/integrations/partytown/src/sirv.ts b/packages/integrations/partytown/src/sirv.ts index 7bba54b66650..3bf107ca0786 100644 --- a/packages/integrations/partytown/src/sirv.ts +++ b/packages/integrations/partytown/src/sirv.ts @@ -32,10 +32,10 @@ import * as fs from 'node:fs'; import { join, normalize, resolve } from 'node:path'; +import { URL } from 'node:url'; // import { totalist } from 'totalist/sync'; // import { parse } from '@polka/url'; import { lookup } from 'mrmime'; -import { URL } from 'node:url'; const noop = () => {}; diff --git a/packages/integrations/prefetch/test/custom-selectors.test.js b/packages/integrations/prefetch/test/custom-selectors.test.js index b680388dfa74..c8d6170fb21f 100644 --- a/packages/integrations/prefetch/test/custom-selectors.test.js +++ b/packages/integrations/prefetch/test/custom-selectors.test.js @@ -1,6 +1,6 @@ import { expect } from '@playwright/test'; -import { testFactory } from './test-utils.js'; import prefetch from '../dist/index.js'; +import { testFactory } from './test-utils.js'; const customSelector = 'a[href="/contact"]'; const customIntentSelector = [ diff --git a/packages/integrations/react/client-v17.js b/packages/integrations/react/client-v17.js index 625dba6bf110..2a9d4d858f7b 100644 --- a/packages/integrations/react/client-v17.js +++ b/packages/integrations/react/client-v17.js @@ -1,22 +1,21 @@ import { createElement } from 'react'; -import { render, hydrate, unmountComponentAtNode } from 'react-dom'; +import { hydrate, render, unmountComponentAtNode } from 'react-dom'; import StaticHtml from './static-html.js'; -export default (element) => - (Component, props, { default: children, ...slotted }, { client }) => { - for (const [key, value] of Object.entries(slotted)) { - props[key] = createElement(StaticHtml, { value, name: key }); - } - const componentEl = createElement( - Component, - props, - children != null ? createElement(StaticHtml, { value: children }) : children - ); +export default (element) => (Component, props, { default: children, ...slotted }, { client }) => { + for (const [key, value] of Object.entries(slotted)) { + props[key] = createElement(StaticHtml, { value, name: key }); + } + const componentEl = createElement( + Component, + props, + children != null ? createElement(StaticHtml, { value: children }) : children + ); - const isHydrate = client !== 'only'; - const bootstrap = isHydrate ? hydrate : render; - bootstrap(componentEl, element); - element.addEventListener('astro:unmount', () => unmountComponentAtNode(element), { - once: true, - }); - }; + const isHydrate = client !== 'only'; + const bootstrap = isHydrate ? hydrate : render; + bootstrap(componentEl, element); + element.addEventListener('astro:unmount', () => unmountComponentAtNode(element), { + once: true, + }); +}; diff --git a/packages/integrations/react/client.js b/packages/integrations/react/client.js index dbd32c0c5a54..779be86ff63d 100644 --- a/packages/integrations/react/client.js +++ b/packages/integrations/react/client.js @@ -10,35 +10,34 @@ function isAlreadyHydrated(element) { } } -export default (element) => - (Component, props, { default: children, ...slotted }, { client }) => { - if (!element.hasAttribute('ssr')) return; - const renderOptions = { - identifierPrefix: element.getAttribute('prefix'), - }; - for (const [key, value] of Object.entries(slotted)) { - props[key] = createElement(StaticHtml, { value, name: key }); - } - const componentEl = createElement( - Component, - props, - children != null ? createElement(StaticHtml, { value: children }) : children - ); - const rootKey = isAlreadyHydrated(element); - // HACK: delete internal react marker for nested components to suppress aggressive warnings - if (rootKey) { - delete element[rootKey]; - } - if (client === 'only') { - return startTransition(() => { - const root = createRoot(element); - root.render(componentEl); - element.addEventListener('astro:unmount', () => root.unmount(), { once: true }); - }); - } - startTransition(() => { - const root = hydrateRoot(element, componentEl, renderOptions); +export default (element) => (Component, props, { default: children, ...slotted }, { client }) => { + if (!element.hasAttribute('ssr')) return; + const renderOptions = { + identifierPrefix: element.getAttribute('prefix'), + }; + for (const [key, value] of Object.entries(slotted)) { + props[key] = createElement(StaticHtml, { value, name: key }); + } + const componentEl = createElement( + Component, + props, + children != null ? createElement(StaticHtml, { value: children }) : children + ); + const rootKey = isAlreadyHydrated(element); + // HACK: delete internal react marker for nested components to suppress aggressive warnings + if (rootKey) { + delete element[rootKey]; + } + if (client === 'only') { + return startTransition(() => { + const root = createRoot(element); root.render(componentEl); element.addEventListener('astro:unmount', () => root.unmount(), { once: true }); }); - }; + } + startTransition(() => { + const root = hydrateRoot(element, componentEl, renderOptions); + root.render(componentEl); + element.addEventListener('astro:unmount', () => root.unmount(), { once: true }); + }); +}; diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js index c2400accb673..a04ff8f9ea16 100644 --- a/packages/integrations/react/server.js +++ b/packages/integrations/react/server.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom/server'; -import StaticHtml from './static-html.js'; import { incrementId } from './context.js'; +import StaticHtml from './static-html.js'; import opts from 'astro:react:opts'; const slotName = (str) => str.trim().replace(/[-_]([a-z])/g, (_, w) => w.toUpperCase()); diff --git a/packages/integrations/react/test/react-component.test.js b/packages/integrations/react/test/react-component.test.js index 43df1d9e4f0e..b87d47784587 100644 --- a/packages/integrations/react/test/react-component.test.js +++ b/packages/integrations/react/test/react-component.test.js @@ -52,7 +52,9 @@ describe('React Components', () => { const islandsWithChildren = $('.with-children'); expect(islandsWithChildren).to.have.lengthOf(2); expect($(islandsWithChildren[0]).html()).to.equal( - $(islandsWithChildren[1]).find('astro-slot').html() + $(islandsWithChildren[1]) + .find('astro-slot') + .html() ); // test 11: Should generate unique React.useId per island diff --git a/packages/integrations/react/vnode-children.js b/packages/integrations/react/vnode-children.js index ea5bc0869ee6..2817be7b8f3b 100644 --- a/packages/integrations/react/vnode-children.js +++ b/packages/integrations/react/vnode-children.js @@ -1,5 +1,5 @@ -import { parse, walkSync, DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'; -import { createElement, Fragment } from 'react'; +import { Fragment, createElement } from 'react'; +import { DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE, parse, walkSync } from 'ultrahtml'; let ids = 0; export default function convert(children) { diff --git a/packages/integrations/sitemap/src/index.ts b/packages/integrations/sitemap/src/index.ts index 2094aa3b193a..9b677a6a36a6 100644 --- a/packages/integrations/sitemap/src/index.ts +++ b/packages/integrations/sitemap/src/index.ts @@ -1,10 +1,10 @@ -import type { AstroConfig, AstroIntegration } from 'astro'; import { fileURLToPath } from 'node:url'; +import type { AstroConfig, AstroIntegration } from 'astro'; import { EnumChangefreq, - simpleSitemapAndIndex, type LinkItem as LinkItemBase, type SitemapItemLoose, + simpleSitemapAndIndex, } from 'sitemap'; import { ZodError } from 'zod'; diff --git a/packages/integrations/sitemap/src/schema.ts b/packages/integrations/sitemap/src/schema.ts index a7682e881a05..09f079d5a407 100644 --- a/packages/integrations/sitemap/src/schema.ts +++ b/packages/integrations/sitemap/src/schema.ts @@ -15,12 +15,9 @@ export const SitemapOptionsSchema = z defaultLocale: localeKeySchema, locales: z.record( localeKeySchema, - z - .string() - .min(2) - .regex(/^[a-zA-Z\-]+$/gm, { - message: 'Only English alphabet symbols and hyphen allowed', - }) + z.string().min(2).regex(/^[a-zA-Z\-]+$/gm, { + message: 'Only English alphabet symbols and hyphen allowed', + }) ), }) .refine((val) => !val || val.locales[val.defaultLocale], { diff --git a/packages/integrations/sitemap/test/filter.test.js b/packages/integrations/sitemap/test/filter.test.js index b2623248170a..df290507f958 100644 --- a/packages/integrations/sitemap/test/filter.test.js +++ b/packages/integrations/sitemap/test/filter.test.js @@ -1,6 +1,6 @@ -import { loadFixture, readXML } from './test-utils.js'; import { expect } from 'chai'; import { sitemap } from './fixtures/static/deps.mjs'; +import { loadFixture, readXML } from './test-utils.js'; describe('Filter support', () => { /** @type {import('./test-utils.js').Fixture} */ diff --git a/packages/integrations/sitemap/test/routes.test.js b/packages/integrations/sitemap/test/routes.test.js index 909580dd9ce5..b49b474e689a 100644 --- a/packages/integrations/sitemap/test/routes.test.js +++ b/packages/integrations/sitemap/test/routes.test.js @@ -1,5 +1,5 @@ -import { loadFixture, readXML } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture, readXML } from './test-utils.js'; describe('routes', () => { /** @type {import('./test-utils.js').Fixture} */ diff --git a/packages/integrations/sitemap/test/ssr.test.js b/packages/integrations/sitemap/test/ssr.test.js index e6f8412d56fc..5fd7c68c32d8 100644 --- a/packages/integrations/sitemap/test/ssr.test.js +++ b/packages/integrations/sitemap/test/ssr.test.js @@ -1,5 +1,5 @@ -import { loadFixture, readXML } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture, readXML } from './test-utils.js'; describe('SSR support', () => { /** @type {import('./test-utils.js').Fixture} */ diff --git a/packages/integrations/sitemap/test/staticPaths.test.js b/packages/integrations/sitemap/test/staticPaths.test.js index d5d95b2d3afd..b1de81845521 100644 --- a/packages/integrations/sitemap/test/staticPaths.test.js +++ b/packages/integrations/sitemap/test/staticPaths.test.js @@ -1,5 +1,5 @@ -import { loadFixture, readXML } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture, readXML } from './test-utils.js'; describe('getStaticPaths support', () => { /** @type {import('./test-utils.js').Fixture} */ diff --git a/packages/integrations/sitemap/test/test-utils.js b/packages/integrations/sitemap/test/test-utils.js index bf101e40503e..74bba6a44d2a 100644 --- a/packages/integrations/sitemap/test/test-utils.js +++ b/packages/integrations/sitemap/test/test-utils.js @@ -1,5 +1,5 @@ -import { loadFixture as baseLoadFixture } from '../../../astro/test/test-utils.js'; import * as xml2js from 'xml2js'; +import { loadFixture as baseLoadFixture } from '../../../astro/test/test-utils.js'; /** * @typedef {import('../../../astro/test/test-utils').Fixture} Fixture diff --git a/packages/integrations/sitemap/test/trailing-slash.test.js b/packages/integrations/sitemap/test/trailing-slash.test.js index a393fb9f12f5..ea6d4f47bcba 100644 --- a/packages/integrations/sitemap/test/trailing-slash.test.js +++ b/packages/integrations/sitemap/test/trailing-slash.test.js @@ -1,5 +1,5 @@ -import { loadFixture, readXML } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture, readXML } from './test-utils.js'; describe('Trailing slash', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/svelte/src/index.ts b/packages/integrations/svelte/src/index.ts index a9d4f37c9ac6..6a1884f85cec 100644 --- a/packages/integrations/svelte/src/index.ts +++ b/packages/integrations/svelte/src/index.ts @@ -1,7 +1,7 @@ +import { fileURLToPath } from 'node:url'; import type { Options } from '@sveltejs/vite-plugin-svelte'; import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte'; import type { AstroIntegration, AstroRenderer } from 'astro'; -import { fileURLToPath } from 'node:url'; import type { UserConfig } from 'vite'; function getRenderer(): AstroRenderer { diff --git a/packages/integrations/vercel/src/lib/redirects.ts b/packages/integrations/vercel/src/lib/redirects.ts index 8613be2ed72d..e609059f696c 100644 --- a/packages/integrations/vercel/src/lib/redirects.ts +++ b/packages/integrations/vercel/src/lib/redirects.ts @@ -1,6 +1,6 @@ +import nodePath from 'node:path'; import { appendForwardSlash } from '@astrojs/internal-helpers/path'; import type { AstroConfig, RouteData, RoutePart } from 'astro'; -import nodePath from 'node:path'; const pathJoin = nodePath.posix.join; diff --git a/packages/integrations/vercel/src/serverless/entrypoint.ts b/packages/integrations/vercel/src/serverless/entrypoint.ts index 7b548dc37bfa..a170ef5d50d9 100644 --- a/packages/integrations/vercel/src/serverless/entrypoint.ts +++ b/packages/integrations/vercel/src/serverless/entrypoint.ts @@ -1,7 +1,7 @@ +import type { IncomingMessage, ServerResponse } from 'node:http'; 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.js'; import { getRequest, setResponse } from './request-transform.js'; diff --git a/packages/integrations/vercel/src/serverless/request-transform.ts b/packages/integrations/vercel/src/serverless/request-transform.ts index 31aa377af6cc..f10d40bf14c7 100644 --- a/packages/integrations/vercel/src/serverless/request-transform.ts +++ b/packages/integrations/vercel/src/serverless/request-transform.ts @@ -1,5 +1,5 @@ -import type { App } from 'astro/app'; import type { IncomingMessage, ServerResponse } from 'node:http'; +import type { App } from 'astro/app'; import { splitCookiesString } from 'set-cookie-parser'; const clientAddressSymbol = Symbol.for('astro.clientAddress'); diff --git a/packages/integrations/vercel/test/no-output.test.js b/packages/integrations/vercel/test/no-output.test.js index 3894ee779a9f..22c054480614 100644 --- a/packages/integrations/vercel/test/no-output.test.js +++ b/packages/integrations/vercel/test/no-output.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; describe('Missing output config', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/vercel/test/split.test.js b/packages/integrations/vercel/test/split.test.js index 3f4e75d1b01e..19e2b2f2cef1 100644 --- a/packages/integrations/vercel/test/split.test.js +++ b/packages/integrations/vercel/test/split.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; describe('build: split', () => { /** @type {import('./test-utils').Fixture} */ diff --git a/packages/integrations/vue/client.js b/packages/integrations/vue/client.js index 8b2a5eede16c..328058efffc9 100644 --- a/packages/integrations/vue/client.js +++ b/packages/integrations/vue/client.js @@ -1,34 +1,33 @@ -import { h, createSSRApp, createApp, Suspense } from 'vue'; -import { setup } from 'virtual:@astrojs/vue/app'; +import { Suspense, createApp, createSSRApp, h } from 'vue'; import StaticHtml from './static-html.js'; +import { setup } from 'virtual:@astrojs/vue/app'; -export default (element) => - async (Component, props, slotted, { client }) => { - delete props['class']; - if (!element.hasAttribute('ssr')) return; +export default (element) => async (Component, props, slotted, { client }) => { + delete props['class']; + if (!element.hasAttribute('ssr')) return; - // Expose name on host component for Vue devtools - const name = Component.name ? `${Component.name} Host` : undefined; - const slots = {}; - for (const [key, value] of Object.entries(slotted)) { - slots[key] = () => h(StaticHtml, { value, name: key === 'default' ? undefined : key }); - } + // Expose name on host component for Vue devtools + const name = Component.name ? `${Component.name} Host` : undefined; + const slots = {}; + for (const [key, value] of Object.entries(slotted)) { + slots[key] = () => h(StaticHtml, { value, name: key === 'default' ? undefined : key }); + } - let content = h(Component, props, slots); - // related to https://github.com/withastro/astro/issues/6549 - // if the component is async, wrap it in a Suspense component - if (isAsync(Component.setup)) { - content = h(Suspense, null, content); - } + let content = h(Component, props, slots); + // related to https://github.com/withastro/astro/issues/6549 + // if the component is async, wrap it in a Suspense component + if (isAsync(Component.setup)) { + content = h(Suspense, null, content); + } - const isHydrate = client !== 'only'; - const boostrap = isHydrate ? createSSRApp : createApp; - const app = boostrap({ name, render: () => content }); - await setup(app); - app.mount(element, isHydrate); + const isHydrate = client !== 'only'; + const boostrap = isHydrate ? createSSRApp : createApp; + const app = boostrap({ name, render: () => content }); + await setup(app); + app.mount(element, isHydrate); - element.addEventListener('astro:unmount', () => app.unmount(), { once: true }); - }; + element.addEventListener('astro:unmount', () => app.unmount(), { once: true }); +}; function isAsync(fn) { const constructor = fn?.constructor; diff --git a/packages/integrations/vue/server.js b/packages/integrations/vue/server.js index 4e06baa5f671..83b4c7655962 100644 --- a/packages/integrations/vue/server.js +++ b/packages/integrations/vue/server.js @@ -1,7 +1,7 @@ -import { h, createSSRApp } from 'vue'; +import { createSSRApp, h } from 'vue'; import { renderToString } from 'vue/server-renderer'; -import { setup } from 'virtual:@astrojs/vue/app'; import StaticHtml from './static-html.js'; +import { setup } from 'virtual:@astrojs/vue/app'; function check(Component) { return !!Component['ssrRender'] || !!Component['__ssrInlineRender']; diff --git a/packages/integrations/vue/static-html.js b/packages/integrations/vue/static-html.js index 885319026077..689b56a7064a 100644 --- a/packages/integrations/vue/static-html.js +++ b/packages/integrations/vue/static-html.js @@ -1,4 +1,4 @@ -import { h, defineComponent } from 'vue'; +import { defineComponent, h } from 'vue'; /** * Astro passes `children` as a string of HTML, so we need diff --git a/packages/integrations/vue/test/app-entrypoint.test.js b/packages/integrations/vue/test/app-entrypoint.test.js index 4f4f389d1b3c..e50f13b14bdb 100644 --- a/packages/integrations/vue/test/app-entrypoint.test.js +++ b/packages/integrations/vue/test/app-entrypoint.test.js @@ -1,6 +1,6 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; import { parseHTML } from 'linkedom'; +import { loadFixture } from './test-utils.js'; describe('App Entrypoint', () => { /** @type {import('./test-utils').Fixture} */ let fixture; diff --git a/packages/markdown/remark/src/frontmatter-injection.ts b/packages/markdown/remark/src/frontmatter-injection.ts index 4828873fd2c1..758001524f3a 100644 --- a/packages/markdown/remark/src/frontmatter-injection.ts +++ b/packages/markdown/remark/src/frontmatter-injection.ts @@ -1,4 +1,4 @@ -import type { VFileData as Data, VFile } from 'vfile'; +import type { VFile, VFileData as Data } from 'vfile'; import type { MarkdownAstroData } from './types.js'; function isValidAstroData(obj: unknown): obj is MarkdownAstroData { diff --git a/packages/markdown/remark/src/load-plugins.ts b/packages/markdown/remark/src/load-plugins.ts index 8229ddff2c1b..556ff38a46ca 100644 --- a/packages/markdown/remark/src/load-plugins.ts +++ b/packages/markdown/remark/src/load-plugins.ts @@ -1,6 +1,6 @@ -import { resolve as importMetaResolve } from 'import-meta-resolve'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; +import { resolve as importMetaResolve } from 'import-meta-resolve'; import type * as unified from 'unified'; const cwdUrlStr = pathToFileURL(path.join(process.cwd(), 'package.json')).toString(); diff --git a/packages/markdown/remark/src/types.ts b/packages/markdown/remark/src/types.ts index bcab97041d46..4bcf68ec892b 100644 --- a/packages/markdown/remark/src/types.ts +++ b/packages/markdown/remark/src/types.ts @@ -1,9 +1,9 @@ import type * as hast from 'hast'; import type * as mdast from 'mdast'; import type { - one as Handler, - all as Handlers, Options as RemarkRehypeOptions, + all as Handlers, + one as Handler, } from 'remark-rehype'; import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki'; import type * as unified from 'unified'; diff --git a/packages/telemetry/src/config.ts b/packages/telemetry/src/config.ts index 6efcb7fe5bdf..45d21e1da26f 100644 --- a/packages/telemetry/src/config.ts +++ b/packages/telemetry/src/config.ts @@ -1,10 +1,10 @@ -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'; import path from 'node:path'; import process from 'node:process'; +import dget from 'dlv'; +// @ts-expect-error `dset` is mispackaged: https://publint.dev/dset@3.1.2 +import { dset } from 'dset'; export interface ConfigOptions { name: string; diff --git a/packages/telemetry/src/index.ts b/packages/telemetry/src/index.ts index e103d2a16373..ba7cea10846f 100644 --- a/packages/telemetry/src/index.ts +++ b/packages/telemetry/src/index.ts @@ -1,11 +1,11 @@ +import { randomBytes } from 'node:crypto'; import { isCI } from 'ci-info'; import debug from 'debug'; -import { randomBytes } from 'node:crypto'; import * as KEY from './config-keys.js'; import { GlobalConfig } from './config.js'; import { post } from './post.js'; -import { getProjectInfo, type ProjectInfo } from './project-info.js'; -import { getSystemInfo, type SystemInfo } from './system-info.js'; +import { type ProjectInfo, getProjectInfo } from './project-info.js'; +import { type SystemInfo, getSystemInfo } from './system-info.js'; export type AstroTelemetryOptions = { astroVersion: string; viteVersion: string }; export type TelemetryEvent = { eventName: string; payload: Record }; diff --git a/packages/telemetry/src/system-info.ts b/packages/telemetry/src/system-info.ts index 08375de7b2f8..3b246d22b1d3 100644 --- a/packages/telemetry/src/system-info.ts +++ b/packages/telemetry/src/system-info.ts @@ -1,7 +1,7 @@ -import { name as ciName, isCI } from 'ci-info'; +import os from 'node:os'; +import { isCI, name as ciName } from 'ci-info'; import isDocker from 'is-docker'; import isWSL from 'is-wsl'; -import os from 'node:os'; /** * Astro Telemetry -- System Info diff --git a/packages/underscore-redirects/src/astro.ts b/packages/underscore-redirects/src/astro.ts index b378eb9559f3..3c8db409e470 100644 --- a/packages/underscore-redirects/src/astro.ts +++ b/packages/underscore-redirects/src/astro.ts @@ -1,5 +1,5 @@ -import type { AstroConfig, RouteData, ValidRedirectStatus } from 'astro'; import { posix } from 'node:path'; +import type { AstroConfig, RouteData, ValidRedirectStatus } from 'astro'; import { Redirects } from './redirects.js'; const pathJoin = posix.join; diff --git a/packages/underscore-redirects/test/astro.test.js b/packages/underscore-redirects/test/astro.test.js index 6b6bbbd8e0b2..8cd2e376b4c4 100644 --- a/packages/underscore-redirects/test/astro.test.js +++ b/packages/underscore-redirects/test/astro.test.js @@ -1,5 +1,5 @@ -import { createRedirectsFromAstroRoutes } from '../dist/index.js'; import { expect } from 'chai'; +import { createRedirectsFromAstroRoutes } from '../dist/index.js'; describe('Astro', () => { const serverConfig = { diff --git a/packages/underscore-redirects/test/print.test.js b/packages/underscore-redirects/test/print.test.js index 2714fa39925c..0d47d6c31bab 100644 --- a/packages/underscore-redirects/test/print.test.js +++ b/packages/underscore-redirects/test/print.test.js @@ -1,5 +1,5 @@ -import { Redirects } from '../dist/index.js'; import { expect } from 'chai'; +import { Redirects } from '../dist/index.js'; describe('Printing', () => { it('Formats long lines in a pretty way', () => { diff --git a/packages/underscore-redirects/test/weight.test.js b/packages/underscore-redirects/test/weight.test.js index ed516f6ced8d..1cbc75989caf 100644 --- a/packages/underscore-redirects/test/weight.test.js +++ b/packages/underscore-redirects/test/weight.test.js @@ -1,5 +1,5 @@ -import { Redirects } from '../dist/index.js'; import { expect } from 'chai'; +import { Redirects } from '../dist/index.js'; describe('Weight', () => { it('Puts higher weighted definitions on top', () => { diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index b516e6b5105f..876a3ca0c8de 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -1,8 +1,8 @@ +import { promises as fs } from 'node:fs'; import { deleteAsync } from 'del'; import esbuild from 'esbuild'; import { copy } from 'esbuild-plugin-copy'; import { dim, green, red, yellow } from 'kleur/colors'; -import { promises as fs } from 'node:fs'; import glob from 'tiny-glob'; import svelte from '../utils/svelte-plugin.js'; import prebuild from './prebuild.js'; diff --git a/scripts/cmd/copy.js b/scripts/cmd/copy.js index 1e64a793dfb5..722722b7c809 100644 --- a/scripts/cmd/copy.js +++ b/scripts/cmd/copy.js @@ -1,7 +1,7 @@ -import arg from 'arg'; -import { globby as glob } from 'globby'; import { promises as fs, readFileSync } from 'node:fs'; import { posix } from 'node:path'; +import arg from 'arg'; +import { globby as glob } from 'globby'; import tar from 'tar'; const { resolve, dirname, sep, join } = posix; diff --git a/scripts/cmd/prebuild.js b/scripts/cmd/prebuild.js index 3e206f25e7bb..df1c166416f7 100644 --- a/scripts/cmd/prebuild.js +++ b/scripts/cmd/prebuild.js @@ -1,8 +1,8 @@ -import esbuild from 'esbuild'; -import { red } from 'kleur/colors'; import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import esbuild from 'esbuild'; +import { red } from 'kleur/colors'; import glob from 'tiny-glob'; function escapeTemplateLiterals(str) { diff --git a/scripts/deps/update-example-versions.js b/scripts/deps/update-example-versions.js index 13018a791996..6c9f8d01d86e 100644 --- a/scripts/deps/update-example-versions.js +++ b/scripts/deps/update-example-versions.js @@ -1,5 +1,5 @@ -import path from 'node:path'; import fs from 'node:fs/promises'; +import path from 'node:path'; import { globby as glob } from 'globby'; /* diff --git a/scripts/notify/index.js b/scripts/notify/index.js index d215e9eed9ff..c92a3bf18215 100755 --- a/scripts/notify/index.js +++ b/scripts/notify/index.js @@ -1,6 +1,6 @@ -import { globby as glob } from 'globby'; -import { fileURLToPath } from 'node:url'; import { readFile } from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; +import { globby as glob } from 'globby'; const { GITHUB_REF = 'main' } = process.env; const baseUrl = new URL(`https://github.com/withastro/astro/blob/${GITHUB_REF}/`); diff --git a/scripts/stats/index.js b/scripts/stats/index.js index eb37aa722028..80df9cd17d18 100644 --- a/scripts/stats/index.js +++ b/scripts/stats/index.js @@ -1,6 +1,6 @@ +import { readFileSync, writeFileSync } from 'node:fs'; // @ts-check import { Octokit } from '@octokit/action'; -import { readFileSync, writeFileSync } from 'node:fs'; const octokit = new Octokit(); const owner = 'snowpackjs'; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 678a223c90a8..f2cdd417701a 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,6 +1,6 @@ { - "compilerOptions": { - "allowJs": true - }, - "extends": "./tsconfig.base.json" + "compilerOptions": { + "allowJs": true + }, + "extends": "./tsconfig.base.json" } diff --git a/turbo.json b/turbo.json index d95246aefa33..b2a69769f9dc 100644 --- a/turbo.json +++ b/turbo.json @@ -1,47 +1,47 @@ { - "$schema": "https://turborepo.org/schema.json", - "pipeline": { - "build": { - "dependsOn": ["^build"], - "inputs": [ - "**/*", - "!test/**/*", - "!e2e/**/*", - "!performance/**/*", - "!.astro/**/*", - "!.cache/**/*", - "!mod.js", - "!mod.js.map" - ], - "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], - "outputMode": "new-only" - }, - "build:ci": { - "dependsOn": ["^build:ci"], - "inputs": [ - "**/*", - "!test/**/*", - "!e2e/**/*", - "!performance/**/*", - "!.astro/**/*", - "!.cache/**/*", - "!mod.js", - "!mod.js.map" - ], - "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], - "outputMode": "new-only" - }, - "dev": { - "cache": false, - "persistent": true - }, - "test": { - "env": ["RUNNER_OS", "NODE_VERSION"], - "outputMode": "new-only" - }, - "test:hosted": { - "outputMode": "new-only", - "cache": false - } - } + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "inputs": [ + "**/*", + "!test/**/*", + "!e2e/**/*", + "!performance/**/*", + "!.astro/**/*", + "!.cache/**/*", + "!mod.js", + "!mod.js.map" + ], + "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], + "outputMode": "new-only" + }, + "build:ci": { + "dependsOn": ["^build:ci"], + "inputs": [ + "**/*", + "!test/**/*", + "!e2e/**/*", + "!performance/**/*", + "!.astro/**/*", + "!.cache/**/*", + "!mod.js", + "!mod.js.map" + ], + "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], + "outputMode": "new-only" + }, + "dev": { + "cache": false, + "persistent": true + }, + "test": { + "env": ["RUNNER_OS", "NODE_VERSION"], + "outputMode": "new-only" + }, + "test:hosted": { + "outputMode": "new-only", + "cache": false + } + } } From a58cc96091046edf1c5bc61732e0013a573cb4b1 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 5 Sep 2023 10:28:45 +0100 Subject: [PATCH 2/6] chore: rebase --- benchmark/bench/render.js | 2 +- package.json | 1 - packages/astro/src/cli/info/index.ts | 4 ++-- .../test/units/routing/route-sanitization.test.js | 10 +++++----- packages/integrations/vercel/src/lib/nft.ts | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/benchmark/bench/render.js b/benchmark/bench/render.js index 49f20f2676ad..373d3c7b496a 100644 --- a/benchmark/bench/render.js +++ b/benchmark/bench/render.js @@ -5,8 +5,8 @@ import { fileURLToPath } from 'node:url'; import { execaCommand } from 'execa'; import { markdownTable } from 'markdown-table'; import { waitUntilBusy } from 'port-authority'; -import { calculateStat, astroBin } from './_util.js'; import { renderFiles } from '../make-project/render-default.js'; +import { astroBin, calculateStat } from './_util.js'; const port = 4322; diff --git a/package.json b/package.json index 8bf7dc459cb9..32beb8579564 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,6 @@ "eslint-plugin-no-only-tests": "^3.1.0", "eslint-plugin-prettier": "^5.0.0", "only-allow": "^1.1.1", - "organize-imports-cli": "^0.10.0", "prettier": "^3.0.3", "prettier-plugin-astro": "^0.12.0", "tiny-glob": "^0.2.9", diff --git a/packages/astro/src/cli/info/index.ts b/packages/astro/src/cli/info/index.ts index 2ee9ffd0d784..c902bd54d43b 100644 --- a/packages/astro/src/cli/info/index.ts +++ b/packages/astro/src/cli/info/index.ts @@ -1,7 +1,7 @@ -/* eslint-disable no-console */ -import * as colors from 'kleur/colors'; import { execSync } from 'node:child_process'; import { arch, platform } from 'node:os'; +/* eslint-disable no-console */ +import * as colors from 'kleur/colors'; import prompts from 'prompts'; import type yargs from 'yargs-parser'; import { resolveConfig } from '../../core/config/index.js'; diff --git a/packages/astro/test/units/routing/route-sanitization.test.js b/packages/astro/test/units/routing/route-sanitization.test.js index 14c9c382962a..189885711778 100644 --- a/packages/astro/test/units/routing/route-sanitization.test.js +++ b/packages/astro/test/units/routing/route-sanitization.test.js @@ -1,14 +1,14 @@ +import { fileURLToPath } from 'node:url'; +import { expect } from 'chai'; +import * as cheerio from 'cheerio'; +import { createContainer } from '../../../dist/core/dev/container.js'; +import testAdapter from '../../test-adapter.js'; import { createBasicSettings, createFs, createRequestAndResponse, defaultLogger, } from '../test-utils.js'; -import { fileURLToPath } from 'node:url'; -import { expect } from 'chai'; -import { createContainer } from '../../../dist/core/dev/container.js'; -import * as cheerio from 'cheerio'; -import testAdapter from '../../test-adapter.js'; const root = new URL('../../fixtures/alias/', import.meta.url); const fileSystem = { diff --git a/packages/integrations/vercel/src/lib/nft.ts b/packages/integrations/vercel/src/lib/nft.ts index 585a45e998dc..b6fe46999a58 100644 --- a/packages/integrations/vercel/src/lib/nft.ts +++ b/packages/integrations/vercel/src/lib/nft.ts @@ -1,6 +1,6 @@ -import type { AstroIntegrationLogger } from 'astro'; -import { relative, relative as relativePath } from 'node:path'; +import { relative as relativePath } from 'node:path'; import { fileURLToPath } from 'node:url'; +import type { AstroIntegrationLogger } from 'astro'; import { copyFilesToFunction } from './fs.js'; export async function copyDependenciesToFunction( From 966bc2ca0ef890d9fa7e1a9cd1a82d49fa0a9973 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 5 Sep 2023 10:45:17 +0100 Subject: [PATCH 3/6] chore: fix build --- packages/integrations/vercel/src/lib/nft.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/vercel/src/lib/nft.ts b/packages/integrations/vercel/src/lib/nft.ts index b6fe46999a58..6daf1255801a 100644 --- a/packages/integrations/vercel/src/lib/nft.ts +++ b/packages/integrations/vercel/src/lib/nft.ts @@ -21,7 +21,7 @@ export async function copyDependenciesToFunction( cache: object ): Promise<{ handler: string }> { const entryPath = fileURLToPath(entry); - logger.info(`Bundling function ${relative(fileURLToPath(outDir), entryPath)}`); + logger.info(`Bundling function ${relativePath(fileURLToPath(outDir), entryPath)}`); // Get root of folder of the system (like C:\ on Windows or / on Linux) let base = entry; From 3fd60556ac79a47c60ea0fff6c27182b1ead59f7 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 5 Sep 2023 10:53:09 +0100 Subject: [PATCH 4/6] chore: fix regressions --- packages/astro/src/cli/install-package.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/astro/src/cli/install-package.ts b/packages/astro/src/cli/install-package.ts index 35e8dd37ccb7..689f81e3e879 100644 --- a/packages/astro/src/cli/install-package.ts +++ b/packages/astro/src/cli/install-package.ts @@ -1,4 +1,3 @@ -import { createRequire } from 'node:module'; import boxen from 'boxen'; import { execa } from 'execa'; import { bold, cyan, dim, magenta } from 'kleur/colors'; From 6a3ce6c738123e098e6ded27e8d41c85857b9077 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Sat, 16 Sep 2023 09:21:40 +0100 Subject: [PATCH 5/6] chore: revert JSON changes with new options --- .changeset/config.json | 20 +- .devcontainer/basics/devcontainer.json | 50 ++--- .devcontainer/blog/devcontainer.json | 50 ++--- .devcontainer/component/devcontainer.json | 30 +-- .devcontainer/deno/devcontainer.json | 50 ++--- .devcontainer/devcontainer.json | 40 ++-- .devcontainer/docs/devcontainer.json | 50 ++--- .../framework-alpine/devcontainer.json | 50 ++--- .devcontainer/framework-lit/devcontainer.json | 50 ++--- .../framework-multiple/devcontainer.json | 50 ++--- .../framework-preact/devcontainer.json | 50 ++--- .../framework-react/devcontainer.json | 50 ++--- .../framework-solid/devcontainer.json | 50 ++--- .../framework-svelte/devcontainer.json | 50 ++--- .devcontainer/framework-vue/devcontainer.json | 50 ++--- .devcontainer/hackernews/devcontainer.json | 50 ++--- .devcontainer/integration/devcontainer.json | 30 +-- .devcontainer/minimal/devcontainer.json | 50 ++--- .../non-html-pages/devcontainer.json | 50 ++--- .devcontainer/portfolio/devcontainer.json | 50 ++--- .devcontainer/ssr/devcontainer.json | 50 ++--- .../with-markdown-plugins/devcontainer.json | 50 ++--- .../with-markdown-shiki/devcontainer.json | 50 ++--- .devcontainer/with-mdx/devcontainer.json | 50 ++--- .../with-nanostores/devcontainer.json | 50 ++--- .../with-tailwindcss/devcontainer.json | 50 ++--- .../with-vite-plugin-pwa/devcontainer.json | 50 ++--- .devcontainer/with-vitest/devcontainer.json | 50 ++--- .eslintrc.cjs | 184 +++++++++--------- .prettierignore | 1 + .vscode/extensions.json | 14 +- .vscode/launch.json | 52 ++--- .vscode/tasks.json | 24 +-- biome.json | 75 +++---- examples/basics/.vscode/extensions.json | 4 +- examples/basics/.vscode/launch.json | 18 +- examples/blog/.vscode/extensions.json | 4 +- examples/blog/.vscode/launch.json | 18 +- examples/deno/.vscode/extensions.json | 4 +- examples/deno/.vscode/launch.json | 18 +- .../framework-alpine/.vscode/extensions.json | 4 +- examples/framework-alpine/.vscode/launch.json | 18 +- .../framework-lit/.vscode/extensions.json | 4 +- examples/framework-lit/.vscode/launch.json | 18 +- .../.vscode/extensions.json | 4 +- .../framework-multiple/.vscode/launch.json | 18 +- .../framework-preact/.vscode/extensions.json | 4 +- examples/framework-preact/.vscode/launch.json | 18 +- .../framework-react/.vscode/extensions.json | 4 +- examples/framework-react/.vscode/launch.json | 18 +- .../framework-solid/.vscode/extensions.json | 4 +- examples/framework-solid/.vscode/launch.json | 18 +- .../framework-svelte/.vscode/extensions.json | 4 +- examples/framework-svelte/.vscode/launch.json | 18 +- .../framework-vue/.vscode/extensions.json | 4 +- examples/framework-vue/.vscode/launch.json | 18 +- examples/hackernews/.vscode/extensions.json | 4 +- examples/hackernews/.vscode/launch.json | 18 +- examples/minimal/.vscode/extensions.json | 4 +- examples/minimal/.vscode/launch.json | 18 +- .../non-html-pages/.vscode/extensions.json | 4 +- examples/non-html-pages/.vscode/launch.json | 18 +- examples/portfolio/.vscode/extensions.json | 4 +- examples/portfolio/.vscode/launch.json | 18 +- examples/ssr/.vscode/extensions.json | 4 +- examples/ssr/.vscode/launch.json | 18 +- examples/ssr/src/models/db.json | 52 ++--- examples/with-markdoc/.vscode/extensions.json | 4 +- examples/with-markdoc/.vscode/launch.json | 18 +- examples/with-mdx/.vscode/extensions.json | 4 +- examples/with-mdx/.vscode/launch.json | 18 +- package.json | 4 +- packages/astro/src/@types/astro.ts | 16 +- packages/astro/src/core/app/common.ts | 2 +- packages/astro/src/core/app/node.ts | 2 +- packages/astro/src/core/app/types.ts | 2 +- .../src/core/build/plugins/plugin-manifest.ts | 4 +- packages/astro/src/core/compile/cache.ts | 2 +- packages/astro/src/core/config/settings.ts | 2 +- packages/astro/src/core/endpoint/dev/index.ts | 2 +- .../src/core/preview/static-preview-server.ts | 2 +- packages/astro/src/core/render/result.ts | 2 +- packages/astro/src/core/sync/index.ts | 4 +- .../src/runtime/server/render/component.ts | 10 +- .../astro/src/runtime/server/render/page.ts | 2 +- packages/astro/src/type-utils.ts | 5 +- .../astro/src/vite-plugin-astro/compile.ts | 4 +- .../src/vite-plugin-config-alias/index.ts | 2 +- .../astro/src/vite-plugin-markdown/index.ts | 8 +- packages/astro/src/vite-plugin-mdx/index.ts | 2 +- packages/astro/src/vite-plugin-utils/index.ts | 2 +- packages/astro/tsconfigs/base.json | 54 ++--- packages/astro/tsconfigs/strict.json | 12 +- packages/astro/tsconfigs/strictest.json | 48 ++--- packages/create-astro/src/actions/context.ts | 2 +- packages/create-astro/src/actions/verify.ts | 2 +- packages/create-astro/src/messages.ts | 4 +- packages/integrations/cloudflare/src/index.ts | 8 +- .../integrations/cloudflare/src/parser.ts | 4 +- packages/integrations/mdx/src/index.ts | 4 +- .../integrations/node/src/nodeMiddleware.ts | 2 +- packages/integrations/preact/src/index.ts | 4 +- packages/integrations/preact/src/server.ts | 2 +- .../vercel/src/serverless/adapter.ts | 16 +- .../integrations/vercel/src/static/adapter.ts | 8 +- .../vercel/test/speed-insights.test.js | 2 +- .../vercel/test/web-analytics.test.js | 2 +- .../markdown/remark/test/autolinking.test.js | 2 +- .../markdown/remark/test/entities.test.js | 2 +- packages/markdown/remark/test/plugins.test.js | 2 +- .../remark/test/remark-collect-images.test.js | 2 +- pnpm-lock.yaml | 154 +++++++-------- prettier.config.js | 2 +- tsconfig.eslint.json | 8 +- turbo.json | 90 ++++----- 115 files changed, 1313 insertions(+), 1320 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index d2ea229c6640..e8ba17558376 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,12 +1,12 @@ { - "$schema": "https://unpkg.com/@changesets/config@1.7.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "withastro/astro" }], - "commit": false, - "linked": [], - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { - "onlyUpdatePeerDependentsWhenOutOfRange": true - } + "$schema": "https://unpkg.com/@changesets/config@1.7.0/schema.json", + "changelog": ["@changesets/changelog-github", { "repo": "withastro/astro" }], + "commit": false, + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true + } } diff --git a/.devcontainer/basics/devcontainer.json b/.devcontainer/basics/devcontainer.json index 755f87bee1e7..bb1707ff063b 100644 --- a/.devcontainer/basics/devcontainer.json +++ b/.devcontainer/basics/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Basics", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Basics", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/basics", + "workspaceFolder": "/workspaces/astro/examples/basics", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/blog/devcontainer.json b/.devcontainer/blog/devcontainer.json index 2a2773053217..d587fead507d 100644 --- a/.devcontainer/blog/devcontainer.json +++ b/.devcontainer/blog/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Blog", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Blog", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/blog", + "workspaceFolder": "/workspaces/astro/examples/blog", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/component/devcontainer.json b/.devcontainer/component/devcontainer.json index 71c56d28d0c2..c2d3e50c3545 100644 --- a/.devcontainer/component/devcontainer.json +++ b/.devcontainer/component/devcontainer.json @@ -1,21 +1,21 @@ { - "name": "Component Template", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Component Template", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/component", + "workspaceFolder": "/workspaces/astro/examples/component", - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "customizations": { - "codespaces": { - "openFiles": ["src/MyComponent.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/MyComponent.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/deno/devcontainer.json b/.devcontainer/deno/devcontainer.json index 041b143e7fa7..05b733527f65 100644 --- a/.devcontainer/deno/devcontainer.json +++ b/.devcontainer/deno/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Deno", - "build": { - "dockerfile": "../examples.deno.Dockerfile" - }, + "name": "Deno", + "build": { + "dockerfile": "../examples.deno.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/deno", + "workspaceFolder": "/workspaces/astro/examples/deno", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 99bb2dfd239c..6b8edf60573c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,27 +1,27 @@ { - "name": "Contribute to Astro", - "build": { - "dockerfile": "Dockerfile" - }, + "name": "Contribute to Astro", + "build": { + "dockerfile": "Dockerfile" + }, - "features": { - "ghcr.io/devcontainers/features/desktop-lite:1": {} - }, + "features": { + "ghcr.io/devcontainers/features/desktop-lite:1": {} + }, - "postCreateCommand": "pnpm install && pnpm run build", + "postCreateCommand": "pnpm install && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Astro tests": "pnpm run test" - }, + "postAttachCommand": { + "Astro tests": "pnpm run test" + }, - "customizations": { - "codespaces": { - "openFiles": ["README.md", "CONTRIBUTING.md"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["README.md", "CONTRIBUTING.md"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/docs/devcontainer.json b/.devcontainer/docs/devcontainer.json index e38058d9f217..a26ff9d8c751 100644 --- a/.devcontainer/docs/devcontainer.json +++ b/.devcontainer/docs/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Docs Site", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Docs Site", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/docs", + "workspaceFolder": "/workspaces/astro/examples/docs", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-alpine/devcontainer.json b/.devcontainer/framework-alpine/devcontainer.json index d309dbf63bfd..1b8f26503d69 100644 --- a/.devcontainer/framework-alpine/devcontainer.json +++ b/.devcontainer/framework-alpine/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Alpine", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Alpine", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-alpine", + "workspaceFolder": "/workspaces/astro/examples/framework-alpine", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-lit/devcontainer.json b/.devcontainer/framework-lit/devcontainer.json index 934fbff06867..4eb1d59791d0 100644 --- a/.devcontainer/framework-lit/devcontainer.json +++ b/.devcontainer/framework-lit/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Lit", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Lit", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-lit", + "workspaceFolder": "/workspaces/astro/examples/framework-lit", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-multiple/devcontainer.json b/.devcontainer/framework-multiple/devcontainer.json index 59719cd95704..660df3e32411 100644 --- a/.devcontainer/framework-multiple/devcontainer.json +++ b/.devcontainer/framework-multiple/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Kitchen Sink (Multiple Frameworks)", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Kitchen Sink (Multiple Frameworks)", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-multiple", + "workspaceFolder": "/workspaces/astro/examples/framework-multiple", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-preact/devcontainer.json b/.devcontainer/framework-preact/devcontainer.json index 47214355c67d..5c71cb6f2d0d 100644 --- a/.devcontainer/framework-preact/devcontainer.json +++ b/.devcontainer/framework-preact/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Preact", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Preact", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-preact", + "workspaceFolder": "/workspaces/astro/examples/framework-preact", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-react/devcontainer.json b/.devcontainer/framework-react/devcontainer.json index 56d89ac99147..f130c26ff3a4 100644 --- a/.devcontainer/framework-react/devcontainer.json +++ b/.devcontainer/framework-react/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "React", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "React", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-react", + "workspaceFolder": "/workspaces/astro/examples/framework-react", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-solid/devcontainer.json b/.devcontainer/framework-solid/devcontainer.json index 2df288194e73..4a3e65ec855a 100644 --- a/.devcontainer/framework-solid/devcontainer.json +++ b/.devcontainer/framework-solid/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Solid", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Solid", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-solid", + "workspaceFolder": "/workspaces/astro/examples/framework-solid", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-svelte/devcontainer.json b/.devcontainer/framework-svelte/devcontainer.json index 7da6c8449d4c..d8db14287d87 100644 --- a/.devcontainer/framework-svelte/devcontainer.json +++ b/.devcontainer/framework-svelte/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Svelte", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Svelte", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-svelte", + "workspaceFolder": "/workspaces/astro/examples/framework-svelte", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/framework-vue/devcontainer.json b/.devcontainer/framework-vue/devcontainer.json index 34bccf6a4830..db9a6287834c 100644 --- a/.devcontainer/framework-vue/devcontainer.json +++ b/.devcontainer/framework-vue/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Vue", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Vue", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/framework-vue", + "workspaceFolder": "/workspaces/astro/examples/framework-vue", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/hackernews/devcontainer.json b/.devcontainer/hackernews/devcontainer.json index 5c24e4958c5b..dc113624d6c1 100644 --- a/.devcontainer/hackernews/devcontainer.json +++ b/.devcontainer/hackernews/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Hackernews", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Hackernews", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/hackernews", + "workspaceFolder": "/workspaces/astro/examples/hackernews", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/[...stories].astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/[...stories].astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/integration/devcontainer.json b/.devcontainer/integration/devcontainer.json index 10f45155f86f..8e6a4df8d852 100644 --- a/.devcontainer/integration/devcontainer.json +++ b/.devcontainer/integration/devcontainer.json @@ -1,21 +1,21 @@ { - "name": "Integration Package", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Integration Package", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/integration", + "workspaceFolder": "/workspaces/astro/examples/integration", - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "customizations": { - "codespaces": { - "openFiles": ["index.ts"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["index.ts"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/minimal/devcontainer.json b/.devcontainer/minimal/devcontainer.json index de48a32a63c2..1756ffd8baaf 100644 --- a/.devcontainer/minimal/devcontainer.json +++ b/.devcontainer/minimal/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Minimal", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Minimal", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/minimal", + "workspaceFolder": "/workspaces/astro/examples/minimal", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/non-html-pages/devcontainer.json b/.devcontainer/non-html-pages/devcontainer.json index 0ff0c2ccca38..b47fae4e9186 100644 --- a/.devcontainer/non-html-pages/devcontainer.json +++ b/.devcontainer/non-html-pages/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Non-HTML Pages", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Non-HTML Pages", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/non-html-pages", + "workspaceFolder": "/workspaces/astro/examples/non-html-pages", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/portfolio/devcontainer.json b/.devcontainer/portfolio/devcontainer.json index 075ccbf672c6..39e283d83b5d 100644 --- a/.devcontainer/portfolio/devcontainer.json +++ b/.devcontainer/portfolio/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Portfolio", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Portfolio", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/portfolio", + "workspaceFolder": "/workspaces/astro/examples/portfolio", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/ssr/devcontainer.json b/.devcontainer/ssr/devcontainer.json index 01ba4f2640a1..2ace9a1dd012 100644 --- a/.devcontainer/ssr/devcontainer.json +++ b/.devcontainer/ssr/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "SSR", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "SSR", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/ssr", + "workspaceFolder": "/workspaces/astro/examples/ssr", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-markdown-plugins/devcontainer.json b/.devcontainer/with-markdown-plugins/devcontainer.json index bbf70fd650b6..21894a77c42b 100644 --- a/.devcontainer/with-markdown-plugins/devcontainer.json +++ b/.devcontainer/with-markdown-plugins/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Markdown with Plugins", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Markdown with Plugins", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins", + "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.md"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.md"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-markdown-shiki/devcontainer.json b/.devcontainer/with-markdown-shiki/devcontainer.json index 19b2325a928c..a3f51750adbf 100644 --- a/.devcontainer/with-markdown-shiki/devcontainer.json +++ b/.devcontainer/with-markdown-shiki/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Markdown with Shiki", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Markdown with Shiki", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki", + "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.md"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.md"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-mdx/devcontainer.json b/.devcontainer/with-mdx/devcontainer.json index 197a30f3c808..13ff67464285 100644 --- a/.devcontainer/with-mdx/devcontainer.json +++ b/.devcontainer/with-mdx/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "MDX", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "MDX", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-mdx", + "workspaceFolder": "/workspaces/astro/examples/with-mdx", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.mdx"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.mdx"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-nanostores/devcontainer.json b/.devcontainer/with-nanostores/devcontainer.json index 6a630600d240..656776b2a049 100644 --- a/.devcontainer/with-nanostores/devcontainer.json +++ b/.devcontainer/with-nanostores/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Nanostores", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Nanostores", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-nanostores", + "workspaceFolder": "/workspaces/astro/examples/with-nanostores", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-tailwindcss/devcontainer.json b/.devcontainer/with-tailwindcss/devcontainer.json index 737989d4b7be..6e7298a6f994 100644 --- a/.devcontainer/with-tailwindcss/devcontainer.json +++ b/.devcontainer/with-tailwindcss/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Tailwind", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Tailwind", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss", + "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-vite-plugin-pwa/devcontainer.json b/.devcontainer/with-vite-plugin-pwa/devcontainer.json index cf2ef2b7be41..d716cded01b6 100644 --- a/.devcontainer/with-vite-plugin-pwa/devcontainer.json +++ b/.devcontainer/with-vite-plugin-pwa/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Vite PWA", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Vite PWA", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa", + "workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.devcontainer/with-vitest/devcontainer.json b/.devcontainer/with-vitest/devcontainer.json index 6879a0c258e1..7931089395da 100644 --- a/.devcontainer/with-vitest/devcontainer.json +++ b/.devcontainer/with-vitest/devcontainer.json @@ -1,34 +1,34 @@ { - "name": "Vitest", - "build": { - "dockerfile": "../examples.Dockerfile" - }, + "name": "Vitest", + "build": { + "dockerfile": "../examples.Dockerfile" + }, - "workspaceFolder": "/workspaces/astro/examples/with-vitest", + "workspaceFolder": "/workspaces/astro/examples/with-vitest", - "portsAttributes": { - "4321": { - "label": "Application", - "onAutoForward": "openPreview" - } - }, + "portsAttributes": { + "4321": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, - "forwardPorts": [4321], + "forwardPorts": [4321], - "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", + "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", - "waitFor": "postCreateCommand", + "waitFor": "postCreateCommand", - "postAttachCommand": { - "Server": "pnpm start --host" - }, + "postAttachCommand": { + "Server": "pnpm start --host" + }, - "customizations": { - "codespaces": { - "openFiles": ["src/pages/index.astro"] - }, - "vscode": { - "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] - } - } + "customizations": { + "codespaces": { + "openFiles": ["src/pages/index.astro"] + }, + "vscode": { + "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] + } + } } diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 750f56aba7ff..2df463d351d6 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,98 +1,98 @@ const { builtinModules } = require('module'); module.exports = { - extends: [ - 'plugin:@typescript-eslint/recommended-type-checked', - 'plugin:@typescript-eslint/stylistic-type-checked', - 'prettier', - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'], - tsconfigRootDir: __dirname, - }, - plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'], - rules: { - // These off/configured-differently-by-default rules fit well for us - '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], - '@typescript-eslint/no-unused-vars': [ - 'error', - { argsIgnorePattern: '^_', ignoreRestSiblings: true }, - ], - 'no-only-tests/no-only-tests': 'error', - '@typescript-eslint/no-shadow': ['error'], - 'no-console': 'warn', + extends: [ + 'plugin:@typescript-eslint/recommended-type-checked', + 'plugin:@typescript-eslint/stylistic-type-checked', + 'prettier', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'], + tsconfigRootDir: __dirname, + }, + plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'], + rules: { + // These off/configured-differently-by-default rules fit well for us + '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_', ignoreRestSiblings: true }, + ], + 'no-only-tests/no-only-tests': 'error', + '@typescript-eslint/no-shadow': ['error'], + 'no-console': 'warn', - // Todo: do we want these? - '@typescript-eslint/array-type': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/class-literal-property-style': 'off', - '@typescript-eslint/consistent-indexed-object-style': 'off', - '@typescript-eslint/consistent-type-definitions': 'off', - '@typescript-eslint/dot-notation': 'off', - '@typescript-eslint/no-base-to-string': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-floating-promises': 'off', - '@typescript-eslint/no-misused-promises': 'off', - '@typescript-eslint/no-redundant-type-constituents': 'off', - '@typescript-eslint/no-this-alias': 'off', - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-return': 'off', - '@typescript-eslint/prefer-nullish-coalescing': 'off', - '@typescript-eslint/prefer-optional-chain': 'off', - '@typescript-eslint/prefer-string-starts-ends-with': 'off', - '@typescript-eslint/require-await': 'off', - '@typescript-eslint/restrict-plus-operands': 'off', - '@typescript-eslint/restrict-template-expressions': 'off', - '@typescript-eslint/sort-type-constituents': 'off', - '@typescript-eslint/unbound-method': 'off', - '@typescript-eslint/no-explicit-any': 'off', + // Todo: do we want these? + '@typescript-eslint/array-type': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/class-literal-property-style': 'off', + '@typescript-eslint/consistent-indexed-object-style': 'off', + '@typescript-eslint/consistent-type-definitions': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/no-base-to-string': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-floating-promises': 'off', + '@typescript-eslint/no-misused-promises': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', + '@typescript-eslint/no-this-alias': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/prefer-nullish-coalescing': 'off', + '@typescript-eslint/prefer-optional-chain': 'off', + '@typescript-eslint/prefer-string-starts-ends-with': 'off', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/sort-type-constituents': 'off', + '@typescript-eslint/unbound-method': 'off', + '@typescript-eslint/no-explicit-any': 'off', - // These rules enabled by the preset configs don't work well for us - '@typescript-eslint/await-thenable': 'off', - 'prefer-const': 'off', - }, - overrides: [ - { - // Ensure Node builtins aren't included in Astro's server runtime - files: ['packages/astro/src/runtime/**/*.ts'], - rules: { - 'no-restricted-imports': [ - 'error', - { - paths: [...builtinModules], - patterns: ['node:*'], - }, - ], - }, - }, - { - files: ['packages/**/test/*.js', 'packages/**/*.js'], - env: { - mocha: true, - }, - globals: { - globalThis: false, // false means read-only - }, - rules: { - 'no-console': 'off', - }, - }, - { - files: ['packages/integrations/**/*.ts'], - rules: { - 'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }], - }, - }, - { - files: ['benchmark/**/*.js'], - rules: { - '@typescript-eslint/no-unused-vars': 'off', - 'no-console': 'off', - }, - }, - ], + // These rules enabled by the preset configs don't work well for us + '@typescript-eslint/await-thenable': 'off', + 'prefer-const': 'off', + }, + overrides: [ + { + // Ensure Node builtins aren't included in Astro's server runtime + files: ['packages/astro/src/runtime/**/*.ts'], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [...builtinModules], + patterns: ['node:*'], + }, + ], + }, + }, + { + files: ['packages/**/test/*.js', 'packages/**/*.js'], + env: { + mocha: true, + }, + globals: { + globalThis: false, // false means read-only + }, + rules: { + 'no-console': 'off', + }, + }, + { + files: ['packages/integrations/**/*.ts'], + rules: { + 'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }], + }, + }, + { + files: ['benchmark/**/*.js'], + rules: { + '@typescript-eslint/no-unused-vars': 'off', + 'no-console': 'off', + }, + }, + ], }; diff --git a/.prettierignore b/.prettierignore index c822e0a50027..f6888a480789 100644 --- a/.prettierignore +++ b/.prettierignore @@ -21,3 +21,4 @@ pnpm-lock.yaml *.mjs *.cjs *.json +*.jsonc diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d10a1ead43f3..d8411afe0257 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,9 @@ { - "recommendations": [ - "astro-build.astro-vscode", - "esbenp.prettier-vscode", - "editorconfig.editorconfig", - "dbaeumer.vscode-eslint" - ], - "unwantedRecommendations": [] + "recommendations": [ + "astro-build.astro-vscode", + "esbenp.prettier-vscode", + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint" + ], + "unwantedRecommendations": [] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 44c94ef5ae2b..b575d4b70649 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,29 +1,29 @@ // A launch configuration that compiles the extension and then opens it inside a new window { - "version": "0.2.0", - "configurations": [ - { - "name": "Launch Client", - "type": "extensionHost", - "request": "launch", - "runtimeExecutable": "${execPath}", - "args": ["--extensionDevelopmentPath=${workspaceRoot}/tools/vscode"], - "outFiles": ["${workspaceRoot}/tools/vscode/dist/**/*.js"] - }, - { - "type": "node", - "request": "attach", - "name": "Attach to Server", - "port": 6040, - "restart": true, - "outFiles": ["${workspaceRoot}/tools/languageserver/dist/**/*.js"], - "skipFiles": ["/**"] - } - ], - "compounds": [ - { - "name": "Launch Extension", - "configurations": ["Launch Client", "Attach to Server"] - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Client", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}/tools/vscode"], + "outFiles": ["${workspaceRoot}/tools/vscode/dist/**/*.js"] + }, + { + "type": "node", + "request": "attach", + "name": "Attach to Server", + "port": 6040, + "restart": true, + "outFiles": ["${workspaceRoot}/tools/languageserver/dist/**/*.js"], + "skipFiles": ["/**"] + } + ], + "compounds": [ + { + "name": "Launch Extension", + "configurations": ["Launch Client", "Attach to Server"] + } + ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 068a3d4af1dd..d81861501054 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,14 +1,14 @@ { - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "build:vscode", - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - } - } - ] + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "build:vscode", + "group": "build", + "presentation": { + "panel": "dedicated", + "reveal": "never" + } + } + ] } diff --git a/biome.json b/biome.json index dc78e1dedc3f..955e347b21f7 100644 --- a/biome.json +++ b/biome.json @@ -1,38 +1,41 @@ { - "$schema": "https://biomejs.dev/schemas/1.0.0/schema.json", - "organizeImports": { - "enabled": true - }, - "files": { - "ignoreUnknown": true, - "ignore": [ - "examples/basics/src/layouts/**", - "examples/with-nanostores/src/layouts/**", - "benchmark/projects/**", - "benchmark/results/**", - "**/dist", - "**/smoke", - "**/node_modules", - "**/fixtures", - "**/vendor", - "**/.vercel" - ] - }, - "linter": { - "enabled": false - }, - "formatter": { - "lineWidth": 100 - }, - "javascript": { - "formatter": { - "quoteStyle": "single", - "trailingComma": "es5" - } - }, - "json": { - "parser": { - "allowComments": true - } - } + "$schema": "https://biomejs.dev/schemas/1.2.1/schema.json", + "organizeImports": { + "enabled": true + }, + "files": { + "ignoreUnknown": true, + "ignore": [ + "examples/basics/src/layouts/**", + "examples/with-nanostores/src/layouts/**", + "benchmark/projects/**", + "benchmark/results/**", + "**/dist", + "**/smoke", + "**/node_modules", + "**/fixtures", + "**/vendor", + "**/.vercel" + ] + }, + "linter": { + "enabled": false + }, + "formatter": { + "lineWidth": 100 + }, + "javascript": { + "formatter": { + "quoteStyle": "single", + "trailingComma": "es5" + } + }, + "json": { + "parser": { + "allowComments": true + }, + "formatter": { + "indentStyle": "space" + } + } } diff --git a/examples/basics/.vscode/extensions.json b/examples/basics/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/basics/.vscode/extensions.json +++ b/examples/basics/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/basics/.vscode/launch.json b/examples/basics/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/basics/.vscode/launch.json +++ b/examples/basics/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/blog/.vscode/extensions.json b/examples/blog/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/blog/.vscode/extensions.json +++ b/examples/blog/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/blog/.vscode/launch.json b/examples/blog/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/blog/.vscode/launch.json +++ b/examples/blog/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/deno/.vscode/extensions.json b/examples/deno/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/deno/.vscode/extensions.json +++ b/examples/deno/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/deno/.vscode/launch.json b/examples/deno/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/deno/.vscode/launch.json +++ b/examples/deno/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-alpine/.vscode/extensions.json b/examples/framework-alpine/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-alpine/.vscode/extensions.json +++ b/examples/framework-alpine/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-alpine/.vscode/launch.json b/examples/framework-alpine/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-alpine/.vscode/launch.json +++ b/examples/framework-alpine/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-lit/.vscode/extensions.json b/examples/framework-lit/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-lit/.vscode/extensions.json +++ b/examples/framework-lit/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-lit/.vscode/launch.json b/examples/framework-lit/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-lit/.vscode/launch.json +++ b/examples/framework-lit/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-multiple/.vscode/extensions.json b/examples/framework-multiple/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-multiple/.vscode/extensions.json +++ b/examples/framework-multiple/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-multiple/.vscode/launch.json b/examples/framework-multiple/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-multiple/.vscode/launch.json +++ b/examples/framework-multiple/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-preact/.vscode/extensions.json b/examples/framework-preact/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-preact/.vscode/extensions.json +++ b/examples/framework-preact/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-preact/.vscode/launch.json b/examples/framework-preact/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-preact/.vscode/launch.json +++ b/examples/framework-preact/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-react/.vscode/extensions.json b/examples/framework-react/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-react/.vscode/extensions.json +++ b/examples/framework-react/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-react/.vscode/launch.json b/examples/framework-react/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-react/.vscode/launch.json +++ b/examples/framework-react/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-solid/.vscode/extensions.json b/examples/framework-solid/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-solid/.vscode/extensions.json +++ b/examples/framework-solid/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-solid/.vscode/launch.json b/examples/framework-solid/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-solid/.vscode/launch.json +++ b/examples/framework-solid/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-svelte/.vscode/extensions.json b/examples/framework-svelte/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-svelte/.vscode/extensions.json +++ b/examples/framework-svelte/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-svelte/.vscode/launch.json b/examples/framework-svelte/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-svelte/.vscode/launch.json +++ b/examples/framework-svelte/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/framework-vue/.vscode/extensions.json b/examples/framework-vue/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/framework-vue/.vscode/extensions.json +++ b/examples/framework-vue/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/framework-vue/.vscode/launch.json b/examples/framework-vue/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/framework-vue/.vscode/launch.json +++ b/examples/framework-vue/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/hackernews/.vscode/extensions.json b/examples/hackernews/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/hackernews/.vscode/extensions.json +++ b/examples/hackernews/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/hackernews/.vscode/launch.json b/examples/hackernews/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/hackernews/.vscode/launch.json +++ b/examples/hackernews/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/minimal/.vscode/extensions.json b/examples/minimal/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/minimal/.vscode/extensions.json +++ b/examples/minimal/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/minimal/.vscode/launch.json b/examples/minimal/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/minimal/.vscode/launch.json +++ b/examples/minimal/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/non-html-pages/.vscode/extensions.json b/examples/non-html-pages/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/non-html-pages/.vscode/extensions.json +++ b/examples/non-html-pages/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/non-html-pages/.vscode/launch.json b/examples/non-html-pages/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/non-html-pages/.vscode/launch.json +++ b/examples/non-html-pages/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/portfolio/.vscode/extensions.json b/examples/portfolio/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/portfolio/.vscode/extensions.json +++ b/examples/portfolio/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/portfolio/.vscode/launch.json b/examples/portfolio/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/portfolio/.vscode/launch.json +++ b/examples/portfolio/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/ssr/.vscode/extensions.json b/examples/ssr/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/ssr/.vscode/extensions.json +++ b/examples/ssr/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/ssr/.vscode/launch.json b/examples/ssr/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/ssr/.vscode/launch.json +++ b/examples/ssr/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/ssr/src/models/db.json b/examples/ssr/src/models/db.json index 6401b1803fcb..76f9e4da3432 100644 --- a/examples/ssr/src/models/db.json +++ b/examples/ssr/src/models/db.json @@ -1,28 +1,28 @@ { - "products": [ - { - "id": 1, - "name": "Cereal", - "price": 3.99, - "image": "/images/products/cereal.jpg" - }, - { - "id": 2, - "name": "Yogurt", - "price": 3.97, - "image": "/images/products/yogurt.jpg" - }, - { - "id": 3, - "name": "Rolled Oats", - "price": 2.89, - "image": "/images/products/oats.jpg" - }, - { - "id": 4, - "name": "Muffins", - "price": 4.39, - "image": "/images/products/muffins.jpg" - } - ] + "products": [ + { + "id": 1, + "name": "Cereal", + "price": 3.99, + "image": "/images/products/cereal.jpg" + }, + { + "id": 2, + "name": "Yogurt", + "price": 3.97, + "image": "/images/products/yogurt.jpg" + }, + { + "id": 3, + "name": "Rolled Oats", + "price": 2.89, + "image": "/images/products/oats.jpg" + }, + { + "id": 4, + "name": "Muffins", + "price": 4.39, + "image": "/images/products/muffins.jpg" + } + ] } diff --git a/examples/with-markdoc/.vscode/extensions.json b/examples/with-markdoc/.vscode/extensions.json index 3a1c9ecdb6a7..22a15055d638 100644 --- a/examples/with-markdoc/.vscode/extensions.json +++ b/examples/with-markdoc/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] } diff --git a/examples/with-markdoc/.vscode/launch.json b/examples/with-markdoc/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/with-markdoc/.vscode/launch.json +++ b/examples/with-markdoc/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/examples/with-mdx/.vscode/extensions.json b/examples/with-mdx/.vscode/extensions.json index 26d70b4090e1..56f043d30eef 100644 --- a/examples/with-mdx/.vscode/extensions.json +++ b/examples/with-mdx/.vscode/extensions.json @@ -1,4 +1,4 @@ { - "recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"], - "unwantedRecommendations": [] + "recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"], + "unwantedRecommendations": [] } diff --git a/examples/with-mdx/.vscode/launch.json b/examples/with-mdx/.vscode/launch.json index 230708db40bb..d6422097621f 100644 --- a/examples/with-mdx/.vscode/launch.json +++ b/examples/with-mdx/.vscode/launch.json @@ -1,11 +1,11 @@ { - "version": "0.2.0", - "configurations": [ - { - "command": "./node_modules/.bin/astro dev", - "name": "Development server", - "request": "launch", - "type": "node-terminal" - } - ] + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] } diff --git a/package.json b/package.json index 32beb8579564..d5f437f2457f 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,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 \"**/*\" --ignore-unknown --cache", - "format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json", + "format:code": "biome check --apply-unsafe ./ && prettier -w \"**/*\" --ignore-unknown --cache", "test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", "test:match": "cd packages/astro && pnpm run test:match", "test:unit": "cd packages/astro && pnpm run test:unit", @@ -78,6 +77,7 @@ }, "devDependencies": { "@astrojs/check": "^0.1.0", + "@biomejs/biome": "1.2.1", "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.2", "@types/node": "^18.17.8", diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 10e15b6ffd74..26b7d271e185 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1,3 +1,5 @@ +import type { OutgoingHttpHeaders } from 'node:http'; +import type { AddressInfo } from 'node:net'; import type { MarkdownHeading, MarkdownMetadata, @@ -8,8 +10,6 @@ import type { ShikiConfig, } from '@astrojs/markdown-remark'; import type * as babel from '@babel/core'; -import type { OutgoingHttpHeaders } from 'node:http'; -import type { AddressInfo } from 'node:net'; import type * as rollup from 'rollup'; import type { TsConfigJson } from 'tsconfig-resolver'; import type * as vite from 'vite'; @@ -148,7 +148,7 @@ export interface CLIFlags { export interface AstroGlobal< Props extends Record = Record, Self = AstroComponentFactory, - Params extends Record = Record, + Params extends Record = Record > extends AstroGlobalPartial, AstroSharedContext { /** @@ -281,7 +281,7 @@ export interface AstroGlobal< } /** Union type of supported markdown file extensions */ -type MarkdowFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number]; +type MarkdowFileExtension = typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS[number]; export interface AstroGlobalPartial { /** @@ -1751,7 +1751,7 @@ export interface Page { export type PaginateFunction = < PaginateData, AdditionalPaginateProps extends Props, - AdditionalPaginateParams extends Params, + AdditionalPaginateParams extends Params >( data: PaginateData[], args?: PaginateOptions @@ -1825,7 +1825,7 @@ export type ValidRedirectStatus = 300 | 301 | 302 | 303 | 304 | 307 | 308; // Shared types between `Astro` global and API context object interface AstroSharedContext< Props extends Record = Record, - RouteParams extends Record = Record, + RouteParams extends Record = Record > { /** * The address (usually IP address) of the user. Used with SSR only. @@ -1864,7 +1864,7 @@ interface AstroSharedContext< export interface APIContext< Props extends Record = Record, - APIParams extends Record = Record, + APIParams extends Record = Record > extends AstroSharedContext { site: URL | undefined; generator: string; @@ -2009,7 +2009,7 @@ export interface SSRLoadedRenderer extends AstroRenderer { export type HookParameters< Hook extends keyof AstroIntegration['hooks'], - Fn = AstroIntegration['hooks'][Hook], + Fn = AstroIntegration['hooks'][Hook] > = Fn extends (...args: any) => any ? Parameters[0] : never; export interface AstroIntegration { diff --git a/packages/astro/src/core/app/common.ts b/packages/astro/src/core/app/common.ts index 5426d77217cc..fc3eaf800b38 100644 --- a/packages/astro/src/core/app/common.ts +++ b/packages/astro/src/core/app/common.ts @@ -1,5 +1,5 @@ import { deserializeRouteData } from '../routing/manifest/serialization.js'; -import type { RouteInfo, SerializedSSRManifest, SSRManifest } from './types.js'; +import type { RouteInfo, SSRManifest, SerializedSSRManifest } from './types.js'; export function deserializeManifest(serializedManifest: SerializedSSRManifest): SSRManifest { const routes: RouteInfo[] = []; diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts index 1df931eca22e..dbb512921d73 100644 --- a/packages/astro/src/core/app/node.ts +++ b/packages/astro/src/core/app/node.ts @@ -1,5 +1,5 @@ import type { RouteData } from '../../@types/astro.js'; -import type { SerializedSSRManifest, SSRManifest } from './types.js'; +import type { SSRManifest, SerializedSSRManifest } from './types.js'; import * as fs from 'node:fs'; import { IncomingMessage } from 'node:http'; diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts index 0050b5d7a008..ea54fb11fb05 100644 --- a/packages/astro/src/core/app/types.ts +++ b/packages/astro/src/core/app/types.ts @@ -1,9 +1,9 @@ import type { RouteData, - SerializedRouteData, SSRComponentMetadata, SSRLoadedRenderer, SSRResult, + SerializedRouteData, } from '../../@types/astro.js'; import type { SinglePageBuiltModule } from '../build/types.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-manifest.ts b/packages/astro/src/core/build/plugins/plugin-manifest.ts index 41ceb282c9d2..d3ac5958bddb 100644 --- a/packages/astro/src/core/build/plugins/plugin-manifest.ts +++ b/packages/astro/src/core/build/plugins/plugin-manifest.ts @@ -1,5 +1,5 @@ -import glob from 'fast-glob'; import { fileURLToPath } from 'node:url'; +import glob from 'fast-glob'; import type { OutputChunk } from 'rollup'; import { type Plugin as VitePlugin } from 'vite'; import { runHookBuildSsr } from '../../../integrations/index.js'; @@ -9,7 +9,7 @@ import { joinPaths, prependForwardSlash } from '../../path.js'; import { serializeRouteData } from '../../routing/index.js'; import { addRollupInput } from '../add-rollup-input.js'; import { getOutFile, getOutFolder } from '../common.js'; -import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js'; +import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin.js'; import type { StaticBuildOptions } from '../types.js'; diff --git a/packages/astro/src/core/compile/cache.ts b/packages/astro/src/core/compile/cache.ts index cdd9ddd5581c..f6d5555e64d4 100644 --- a/packages/astro/src/core/compile/cache.ts +++ b/packages/astro/src/core/compile/cache.ts @@ -1,5 +1,5 @@ import type { AstroConfig } from '../../@types/astro.js'; -import { compile, type CompileProps, type CompileResult } from './compile.js'; +import { type CompileProps, type CompileResult, compile } from './compile.js'; type CompilationCache = Map; diff --git a/packages/astro/src/core/config/settings.ts b/packages/astro/src/core/config/settings.ts index 8b70f6e96017..3af5f6571c71 100644 --- a/packages/astro/src/core/config/settings.ts +++ b/packages/astro/src/core/config/settings.ts @@ -1,6 +1,6 @@ -import yaml from 'js-yaml'; import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; +import yaml from 'js-yaml'; import type { AstroConfig, AstroSettings } from '../../@types/astro.js'; import { getContentPaths } from '../../content/index.js'; import { markdownContentEntryType } from '../../vite-plugin-markdown/content-entry-type.js'; diff --git a/packages/astro/src/core/endpoint/dev/index.ts b/packages/astro/src/core/endpoint/dev/index.ts index 96fe5f3d76b8..3093d416e475 100644 --- a/packages/astro/src/core/endpoint/dev/index.ts +++ b/packages/astro/src/core/endpoint/dev/index.ts @@ -1,5 +1,5 @@ import type { EndpointHandler } from '../../../@types/astro.js'; -import { createRenderContext, type SSROptions } from '../../render/index.js'; +import { type SSROptions, createRenderContext } from '../../render/index.js'; import { callEndpoint } from '../index.js'; export async function call(options: SSROptions) { diff --git a/packages/astro/src/core/preview/static-preview-server.ts b/packages/astro/src/core/preview/static-preview-server.ts index 3cb0e89e8f03..68fdd305adbb 100644 --- a/packages/astro/src/core/preview/static-preview-server.ts +++ b/packages/astro/src/core/preview/static-preview-server.ts @@ -2,7 +2,7 @@ import type http from 'node:http'; import { fileURLToPath } from 'node:url'; import { performance } from 'perf_hooks'; import enableDestroy from 'server-destroy'; -import { preview, type PreviewServer as VitePreviewServer } from 'vite'; +import { type PreviewServer as VitePreviewServer, preview } from 'vite'; import type { AstroSettings } from '../../@types/astro.js'; import type { Logger } from '../logger/core.js'; import * as msg from '../messages.js'; diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts index abfcb5e3e8e9..2102304ff25b 100644 --- a/packages/astro/src/core/render/result.ts +++ b/packages/astro/src/core/render/result.ts @@ -6,7 +6,7 @@ import type { SSRLoadedRenderer, SSRResult, } from '../../@types/astro.js'; -import { renderSlotToString, type ComponentSlots } from '../../runtime/server/index.js'; +import { type ComponentSlots, renderSlotToString } from '../../runtime/server/index.js'; import { renderJSX } from '../../runtime/server/jsx.js'; import { chunkToString } from '../../runtime/server/render/index.js'; import { AstroCookies } from '../cookies/index.js'; diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index 940ff0524664..fed5a43741da 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -1,8 +1,8 @@ -import { dim } from 'kleur/colors'; import fsMod from 'node:fs'; import { performance } from 'node:perf_hooks'; import { fileURLToPath } from 'node:url'; -import { createServer, type HMRPayload } from 'vite'; +import { dim } from 'kleur/colors'; +import { type HMRPayload, createServer } from 'vite'; import type { AstroInlineConfig, AstroSettings } from '../../@types/astro.js'; import { createContentTypesGenerator } from '../../content/index.js'; import { globalContentConfigObserver } from '../../content/utils.js'; diff --git a/packages/astro/src/runtime/server/render/component.ts b/packages/astro/src/runtime/server/render/component.ts index bfb82ceda242..0129a64e7670 100644 --- a/packages/astro/src/runtime/server/render/component.ts +++ b/packages/astro/src/runtime/server/render/component.ts @@ -4,7 +4,7 @@ import type { SSRLoadedRenderer, SSRResult, } from '../../../@types/astro.js'; -import { createRenderInstruction, type RenderInstruction } from './instruction.js'; +import { type RenderInstruction, createRenderInstruction } from './instruction.js'; import { clsx } from 'clsx'; import { AstroError, AstroErrorData } from '../../../core/errors/index.js'; @@ -14,21 +14,21 @@ import { serializeProps } from '../serialize.js'; import { shorthash } from '../shorthash.js'; import { isPromise } from '../util.js'; import { + type AstroComponentFactory, createAstroComponentInstance, isAstroComponentFactory, renderTemplate, - type AstroComponentFactory, } from './astro/index.js'; import { Fragment, - Renderer, - chunkToString, type RenderDestination, type RenderInstance, + Renderer, + chunkToString, } from './common.js'; import { componentIsHTMLElement, renderHTMLElement } from './dom.js'; import { maybeRenderHead } from './head.js'; -import { renderSlotToString, renderSlots, type ComponentSlots } from './slot.js'; +import { type ComponentSlots, renderSlotToString, renderSlots } from './slot.js'; import { formatList, internalSpreadAttributes, renderElement, voidElementNames } from './util.js'; const needsHeadRenderingSymbol = Symbol.for('astro.needsHeadRendering'); diff --git a/packages/astro/src/runtime/server/render/page.ts b/packages/astro/src/runtime/server/render/page.ts index 2f4e87f5fc73..098a1706cc73 100644 --- a/packages/astro/src/runtime/server/render/page.ts +++ b/packages/astro/src/runtime/server/render/page.ts @@ -1,5 +1,5 @@ import type { RouteData, SSRResult } from '../../../@types/astro.js'; -import { renderComponentToString, type NonAstroPageComponent } from './component.js'; +import { type NonAstroPageComponent, renderComponentToString } from './component.js'; import type { AstroComponentFactory } from './index.js'; import { isAstroComponentFactory } from './astro/index.js'; diff --git a/packages/astro/src/type-utils.ts b/packages/astro/src/type-utils.ts index 96970f7c4fb1..f9097938a8d1 100644 --- a/packages/astro/src/type-utils.ts +++ b/packages/astro/src/type-utils.ts @@ -12,9 +12,8 @@ export type WithRequired = T & { [P in K]-?: T[P] }; // Name is pretty self descriptive, but it removes the index signature of an object export type OmitIndexSignature = { - [KeyType in keyof ObjectType as {} extends Record - ? never - : KeyType]: ObjectType[KeyType]; + [KeyType in + keyof ObjectType as {} extends Record ? never : KeyType]: ObjectType[KeyType]; }; // Transform a string into its kebab case equivalent (camelCase -> kebab-case). Useful for CSS-in-JS to CSS. diff --git a/packages/astro/src/vite-plugin-astro/compile.ts b/packages/astro/src/vite-plugin-astro/compile.ts index 768d18d86832..29959862789e 100644 --- a/packages/astro/src/vite-plugin-astro/compile.ts +++ b/packages/astro/src/vite-plugin-astro/compile.ts @@ -1,6 +1,6 @@ -import { transformWithEsbuild, type ESBuildTransformResult } from 'vite'; +import { type ESBuildTransformResult, transformWithEsbuild } from 'vite'; import type { AstroConfig } from '../@types/astro.js'; -import { cachedCompilation, type CompileProps, type CompileResult } from '../core/compile/index.js'; +import { type CompileProps, type CompileResult, cachedCompilation } from '../core/compile/index.js'; import type { Logger } from '../core/logger/core.js'; import { getFileInfo } from '../vite-plugin-utils/index.js'; diff --git a/packages/astro/src/vite-plugin-config-alias/index.ts b/packages/astro/src/vite-plugin-config-alias/index.ts index 8b8535af988c..edbfca3886ad 100644 --- a/packages/astro/src/vite-plugin-config-alias/index.ts +++ b/packages/astro/src/vite-plugin-config-alias/index.ts @@ -1,5 +1,5 @@ import path from 'node:path'; -import { normalizePath, type ResolvedConfig, type Plugin as VitePlugin } from 'vite'; +import { type Plugin as VitePlugin, type ResolvedConfig, normalizePath } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; type Alias = { diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts index 163baab0dd6b..1ae341fc7e93 100644 --- a/packages/astro/src/vite-plugin-markdown/index.ts +++ b/packages/astro/src/vite-plugin-markdown/index.ts @@ -1,12 +1,12 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { - createMarkdownProcessor, InvalidAstroDataError, type MarkdownProcessor, + createMarkdownProcessor, } from '@astrojs/markdown-remark'; import matter from 'gray-matter'; -import fs from 'node:fs'; -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; import type { Plugin } from 'vite'; import { normalizePath } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; diff --git a/packages/astro/src/vite-plugin-mdx/index.ts b/packages/astro/src/vite-plugin-mdx/index.ts index 5e2ce2a98436..94fef27830b9 100644 --- a/packages/astro/src/vite-plugin-mdx/index.ts +++ b/packages/astro/src/vite-plugin-mdx/index.ts @@ -1,5 +1,5 @@ import type { TransformResult } from 'rollup'; -import { transformWithEsbuild, type Plugin, type ResolvedConfig } from 'vite'; +import { type Plugin, type ResolvedConfig, transformWithEsbuild } from 'vite'; import type { AstroRenderer, AstroSettings } from '../@types/astro.js'; import type { Logger } from '../core/logger/core.js'; import type { PluginMetadata } from '../vite-plugin-astro/types.js'; diff --git a/packages/astro/src/vite-plugin-utils/index.ts b/packages/astro/src/vite-plugin-utils/index.ts index 51f0e6cc4c1c..044ef684c6ae 100644 --- a/packages/astro/src/vite-plugin-utils/index.ts +++ b/packages/astro/src/vite-plugin-utils/index.ts @@ -1,5 +1,5 @@ -import ancestor from 'common-ancestor-path'; import { fileURLToPath } from 'node:url'; +import ancestor from 'common-ancestor-path'; import type { AstroConfig } from '../@types/astro.js'; import { appendExtension, diff --git a/packages/astro/tsconfigs/base.json b/packages/astro/tsconfigs/base.json index fe579b97233c..5786931959d4 100644 --- a/packages/astro/tsconfigs/base.json +++ b/packages/astro/tsconfigs/base.json @@ -1,29 +1,29 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - // Enable top-level await, and other modern ESM features. - "target": "ESNext", - "module": "ESNext", - // Enable node-style module resolution, for things like npm package imports. - "moduleResolution": "Bundler", - // Allow importing TypeScript files using their native extension (.ts(x)). - "allowImportingTsExtensions": true, - // Enable JSON imports. - "resolveJsonModule": true, - // 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 another import of the same file. - "forceConsistentCasingInFileNames": true, - // Properly support importing CJS modules in ESM - "esModuleInterop": true, - // Skip typechecking libraries and .d.ts files - "skipLibCheck": true, - // Allow JavaScript files to be imported - "allowJs": true - } + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + // Enable top-level await, and other modern ESM features. + "target": "ESNext", + "module": "ESNext", + // Enable node-style module resolution, for things like npm package imports. + "moduleResolution": "Bundler", + // Allow importing TypeScript files using their native extension (.ts(x)). + "allowImportingTsExtensions": true, + // Enable JSON imports. + "resolveJsonModule": true, + // 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 another import of the same file. + "forceConsistentCasingInFileNames": true, + // Properly support importing CJS modules in ESM + "esModuleInterop": true, + // Skip typechecking libraries and .d.ts files + "skipLibCheck": true, + // Allow JavaScript files to be imported + "allowJs": true + } } diff --git a/packages/astro/tsconfigs/strict.json b/packages/astro/tsconfigs/strict.json index 03fba7703c01..3064440a5d41 100644 --- a/packages/astro/tsconfigs/strict.json +++ b/packages/astro/tsconfigs/strict.json @@ -1,8 +1,8 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./base.json", - "compilerOptions": { - // Enable strict mode. This enables a few options at a time, see https://www.typescriptlang.org/tsconfig#strict for a list. - "strict": true - } + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./base.json", + "compilerOptions": { + // 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/astro/tsconfigs/strictest.json b/packages/astro/tsconfigs/strictest.json index 846f41eaea5b..36f11635e8d2 100644 --- a/packages/astro/tsconfigs/strictest.json +++ b/packages/astro/tsconfigs/strictest.json @@ -1,26 +1,26 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "./strict.json", - "compilerOptions": { - // Report errors for fallthrough cases in switch statements - "noFallthroughCasesInSwitch": true, - // Force functions designed to override their parent class to be specified as `override`. - "noImplicitOverride": true, - // Force functions to specify that they can return `undefined` if a possible code path does not return a value. - "noImplicitReturns": true, - // Report an error when a variable is declared but never used. - "noUnusedLocals": true, - // Report an error when a parameter is declared but never used. - "noUnusedParameters": true, - // Force the usage of the indexed syntax to access fields declared using an index signature. - "noUncheckedIndexedAccess": true, - // Report an error when the value `undefined` is given to an optional property that doesn't specify `undefined` as a valid value. - "exactOptionalPropertyTypes": true, - // Report an error for unreachable code instead of just a warning. - "allowUnreachableCode": false, - // Report an error for unused labels instead of just a warning. - "allowUnusedLabels": false, - // Disallow JavaScript files from being imported - "allowJs": false - } + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./strict.json", + "compilerOptions": { + // Report errors for fallthrough cases in switch statements + "noFallthroughCasesInSwitch": true, + // Force functions designed to override their parent class to be specified as `override`. + "noImplicitOverride": true, + // Force functions to specify that they can return `undefined` if a possible code path does not return a value. + "noImplicitReturns": true, + // Report an error when a variable is declared but never used. + "noUnusedLocals": true, + // Report an error when a parameter is declared but never used. + "noUnusedParameters": true, + // Force the usage of the indexed syntax to access fields declared using an index signature. + "noUncheckedIndexedAccess": true, + // Report an error when the value `undefined` is given to an optional property that doesn't specify `undefined` as a valid value. + "exactOptionalPropertyTypes": true, + // Report an error for unreachable code instead of just a warning. + "allowUnreachableCode": false, + // Report an error for unused labels instead of just a warning. + "allowUnusedLabels": false, + // Disallow JavaScript files from being imported + "allowJs": false + } } diff --git a/packages/create-astro/src/actions/context.ts b/packages/create-astro/src/actions/context.ts index ae720a1b3cd6..a3232ae0174a 100644 --- a/packages/create-astro/src/actions/context.ts +++ b/packages/create-astro/src/actions/context.ts @@ -1,7 +1,7 @@ +import os from 'node:os'; import { prompt } from '@astrojs/cli-kit'; import { random } from '@astrojs/cli-kit/utils'; import arg from 'arg'; -import os from 'node:os'; import { getName, getVersion } from '../messages.js'; diff --git a/packages/create-astro/src/actions/verify.ts b/packages/create-astro/src/actions/verify.ts index ac3eae484ee1..d9e0f3a82e69 100644 --- a/packages/create-astro/src/actions/verify.ts +++ b/packages/create-astro/src/actions/verify.ts @@ -1,7 +1,7 @@ import type { Context } from './context.js'; -import { color } from '@astrojs/cli-kit'; import dns from 'node:dns/promises'; +import { color } from '@astrojs/cli-kit'; import { bannerAbort, error, info, log } from '../messages.js'; import { getTemplateTarget } from './template.js'; diff --git a/packages/create-astro/src/messages.ts b/packages/create-astro/src/messages.ts index 29c551883a74..335a30d66393 100644 --- a/packages/create-astro/src/messages.ts +++ b/packages/create-astro/src/messages.ts @@ -1,7 +1,7 @@ +import { exec } from 'node:child_process'; /* eslint no-console: 'off' */ -import { color, say as houston, label, spinner as load } from '@astrojs/cli-kit'; +import { color, label, say as houston, spinner as load } from '@astrojs/cli-kit'; import { align, sleep } from '@astrojs/cli-kit/utils'; -import { exec } from 'node:child_process'; import stripAnsi from 'strip-ansi'; import { shell } from './shell.js'; diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index b64d986affa2..a1e85c17aa0e 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -1,16 +1,16 @@ import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental'; import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import { sep } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import { createRedirectsFromAstroRoutes } from '@astrojs/underscore-redirects'; import { CacheStorage } from '@miniflare/cache'; import { NoOpLog } from '@miniflare/shared'; import { MemoryStorage } from '@miniflare/storage-memory'; import { AstroError } from 'astro/errors'; import esbuild from 'esbuild'; -import * as fs from 'node:fs'; -import * as os from 'node:os'; -import { sep } from 'node:path'; -import { fileURLToPath, pathToFileURL } from 'node:url'; import glob from 'tiny-glob'; import { getEnvVars } from './parser.js'; diff --git a/packages/integrations/cloudflare/src/parser.ts b/packages/integrations/cloudflare/src/parser.ts index e9a9cdd00a1b..d5b91295c725 100644 --- a/packages/integrations/cloudflare/src/parser.ts +++ b/packages/integrations/cloudflare/src/parser.ts @@ -7,11 +7,11 @@ * TODO: Tackle this file, once their is an decision on the upstream request */ +import * as fs from 'node:fs'; +import { dirname, resolve } from 'node:path'; import TOML from '@iarna/toml'; import dotenv from 'dotenv'; import { findUpSync } from 'find-up'; -import * as fs from 'node:fs'; -import { dirname, resolve } from 'node:path'; function findWranglerToml( referencePath: string = process.cwd(), diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index fd330625e137..ddef19b84eba 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -1,10 +1,10 @@ +import fs from 'node:fs/promises'; +import { fileURLToPath } from 'node:url'; import { markdownConfigDefaults, setVfileFrontmatter } from '@astrojs/markdown-remark'; import type { PluggableList } from '@mdx-js/mdx/lib/core.js'; import type { AstroIntegration, ContentEntryType, HookParameters, SSRError } from 'astro'; import astroJSXRenderer from 'astro/jsx/renderer.js'; import { parse as parseESM } from 'es-module-lexer'; -import fs from 'node:fs/promises'; -import { fileURLToPath } from 'node:url'; import type { Options as RemarkRehypeOptions } from 'remark-rehype'; import { VFile } from 'vfile'; import type { Plugin as VitePlugin } from 'vite'; diff --git a/packages/integrations/node/src/nodeMiddleware.ts b/packages/integrations/node/src/nodeMiddleware.ts index 32b8020dc199..0523d3891a24 100644 --- a/packages/integrations/node/src/nodeMiddleware.ts +++ b/packages/integrations/node/src/nodeMiddleware.ts @@ -1,6 +1,6 @@ -import type { NodeApp } from 'astro/app/node'; import type { ServerResponse } from 'node:http'; import type { Readable } from 'stream'; +import type { NodeApp } from 'astro/app/node'; import { createOutgoingHttpHeaders } from './createOutgoingHttpHeaders.js'; import { responseIterator } from './response-iterator.js'; import type { ErrorHandlerParams, Options, RequestHandlerParams } from './types.js'; diff --git a/packages/integrations/preact/src/index.ts b/packages/integrations/preact/src/index.ts index 85f9bed0f593..a2264a990c4c 100644 --- a/packages/integrations/preact/src/index.ts +++ b/packages/integrations/preact/src/index.ts @@ -1,6 +1,6 @@ -import { preact, type PreactPluginOptions as VitePreactPluginOptions } from '@preact/preset-vite'; -import type { AstroIntegration, AstroRenderer, ViteUserConfig } from 'astro'; import { fileURLToPath } from 'node:url'; +import { type PreactPluginOptions as VitePreactPluginOptions, preact } from '@preact/preset-vite'; +import type { AstroIntegration, AstroRenderer, ViteUserConfig } from 'astro'; const babelCwd = new URL('../', import.meta.url); diff --git a/packages/integrations/preact/src/server.ts b/packages/integrations/preact/src/server.ts index a395433c9bad..5cc2e75dc003 100644 --- a/packages/integrations/preact/src/server.ts +++ b/packages/integrations/preact/src/server.ts @@ -1,5 +1,5 @@ import type { AstroComponentMetadata } from 'astro'; -import { Component as BaseComponent, h, type VNode } from 'preact'; +import { Component as BaseComponent, type VNode, h } from 'preact'; import { render } from 'preact-render-to-string'; import { getContext } from './context.js'; import { restoreSignalsOnProps, serializeSignals } from './signals.js'; diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts index 88887fd3a6c1..1323f3a4a514 100644 --- a/packages/integrations/vercel/src/serverless/adapter.ts +++ b/packages/integrations/vercel/src/serverless/adapter.ts @@ -1,3 +1,5 @@ +import { basename } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import type { AstroAdapter, AstroConfig, @@ -7,24 +9,22 @@ import type { } from 'astro'; import { AstroError } from 'astro/errors'; import glob from 'fast-glob'; -import { basename } from 'node:path'; -import { fileURLToPath, pathToFileURL } from 'node:url'; import { - getAstroImageConfig, - getDefaultImageConfig, type DevImageService, type VercelImageConfig, + getAstroImageConfig, + getDefaultImageConfig, } from '../image/shared.js'; import { getVercelOutput, removeDir, writeJson } from '../lib/fs.js'; import { copyDependenciesToFunction } from '../lib/nft.js'; import { getRedirects } from '../lib/redirects.js'; import { - getSpeedInsightsViteConfig, type VercelSpeedInsightsConfig, + getSpeedInsightsViteConfig, } from '../lib/speed-insights.js'; import { - getInjectableWebAnalyticsContent, type VercelWebAnalyticsConfig, + getInjectableWebAnalyticsContent, } from '../lib/web-analytics.js'; import { generateEdgeMiddleware } from './middleware.js'; @@ -250,9 +250,7 @@ You can set functionPerRoute: false to prevent surpassing the limit.` const getRouteFuncName = (route: RouteData) => route.component.replace('src/pages/', ''); const getFallbackFuncName = (entryFile: URL) => - basename(entryFile.toString()) - .replace('entry.', '') - .replace(/\.mjs$/, ''); + basename(entryFile.toString()).replace('entry.', '').replace(/\.mjs$/, ''); for (const [route, entryFile] of _entryPoints) { const func = route.component.startsWith('src/pages/') diff --git a/packages/integrations/vercel/src/static/adapter.ts b/packages/integrations/vercel/src/static/adapter.ts index df2995c372ad..a6ddcde0f983 100644 --- a/packages/integrations/vercel/src/static/adapter.ts +++ b/packages/integrations/vercel/src/static/adapter.ts @@ -1,21 +1,21 @@ import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro'; import { - getAstroImageConfig, - getDefaultImageConfig, type DevImageService, type VercelImageConfig, + getAstroImageConfig, + getDefaultImageConfig, } from '../image/shared.js'; import { emptyDir, getVercelOutput, writeJson } from '../lib/fs.js'; import { isServerLikeOutput } from '../lib/prerender.js'; import { getRedirects } from '../lib/redirects.js'; import { - getSpeedInsightsViteConfig, type VercelSpeedInsightsConfig, + getSpeedInsightsViteConfig, } from '../lib/speed-insights.js'; import { - getInjectableWebAnalyticsContent, type VercelWebAnalyticsConfig, + getInjectableWebAnalyticsContent, } from '../lib/web-analytics.js'; const PACKAGE_NAME = '@astrojs/vercel/static'; diff --git a/packages/integrations/vercel/test/speed-insights.test.js b/packages/integrations/vercel/test/speed-insights.test.js index 7cf2ae7781a5..9fb09585cbd0 100644 --- a/packages/integrations/vercel/test/speed-insights.test.js +++ b/packages/integrations/vercel/test/speed-insights.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; describe('Vercel Speed Insights', () => { describe('output: server', () => { diff --git a/packages/integrations/vercel/test/web-analytics.test.js b/packages/integrations/vercel/test/web-analytics.test.js index b728fae4caae..11173f661c0e 100644 --- a/packages/integrations/vercel/test/web-analytics.test.js +++ b/packages/integrations/vercel/test/web-analytics.test.js @@ -1,5 +1,5 @@ -import { loadFixture } from './test-utils.js'; import { expect } from 'chai'; +import { loadFixture } from './test-utils.js'; describe('Vercel Web Analytics', () => { describe('output: static', () => { diff --git a/packages/markdown/remark/test/autolinking.test.js b/packages/markdown/remark/test/autolinking.test.js index 79d3ea76790a..631180c99cc3 100644 --- a/packages/markdown/remark/test/autolinking.test.js +++ b/packages/markdown/remark/test/autolinking.test.js @@ -1,5 +1,5 @@ -import { createMarkdownProcessor } from '../dist/index.js'; import chai from 'chai'; +import { createMarkdownProcessor } from '../dist/index.js'; describe('autolinking', () => { describe('plain md', async () => { diff --git a/packages/markdown/remark/test/entities.test.js b/packages/markdown/remark/test/entities.test.js index b2dacb79f7bc..bb138cbf1cda 100644 --- a/packages/markdown/remark/test/entities.test.js +++ b/packages/markdown/remark/test/entities.test.js @@ -1,5 +1,5 @@ -import { createMarkdownProcessor } from '../dist/index.js'; import { expect } from 'chai'; +import { createMarkdownProcessor } from '../dist/index.js'; describe('entities', async () => { const processor = await createMarkdownProcessor(); diff --git a/packages/markdown/remark/test/plugins.test.js b/packages/markdown/remark/test/plugins.test.js index ce2401047210..f26c1b45ecea 100644 --- a/packages/markdown/remark/test/plugins.test.js +++ b/packages/markdown/remark/test/plugins.test.js @@ -1,5 +1,5 @@ -import { createMarkdownProcessor } from '../dist/index.js'; import chai from 'chai'; +import { createMarkdownProcessor } from '../dist/index.js'; import { fileURLToPath } from 'node:url'; diff --git a/packages/markdown/remark/test/remark-collect-images.test.js b/packages/markdown/remark/test/remark-collect-images.test.js index a5533695365f..609250c7e999 100644 --- a/packages/markdown/remark/test/remark-collect-images.test.js +++ b/packages/markdown/remark/test/remark-collect-images.test.js @@ -1,5 +1,5 @@ -import { createMarkdownProcessor } from '../dist/index.js'; import chai from 'chai'; +import { createMarkdownProcessor } from '../dist/index.js'; describe('collect images', async () => { const processor = await createMarkdownProcessor(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e49068992584..cb9911d9c122 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,9 @@ importers: '@astrojs/check': specifier: ^0.1.0 version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6) + '@biomejs/biome': + specifier: 1.2.1 + version: 1.2.1 '@changesets/changelog-github': specifier: ^0.4.8 version: 0.4.8 @@ -54,9 +57,6 @@ importers: only-allow: specifier: ^1.1.1 version: 1.1.1 - organize-imports-cli: - specifier: ^0.10.0 - version: 0.10.0 prettier: specifier: ^3.0.3 version: 3.0.3 @@ -6782,6 +6782,74 @@ packages: '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 + /@biomejs/biome@1.2.1: + resolution: {integrity: sha512-olT0ldjncEQx+mtVLJ1LwJikrDtMYZakJ8dIMYXEoX9t10xjKpeY4OyKBa9Os8/EUHah9YmpYL64hQooza3WrA==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.2.1 + '@biomejs/cli-darwin-x64': 1.2.1 + '@biomejs/cli-linux-arm64': 1.2.1 + '@biomejs/cli-linux-x64': 1.2.1 + '@biomejs/cli-win32-arm64': 1.2.1 + '@biomejs/cli-win32-x64': 1.2.1 + dev: true + + /@biomejs/cli-darwin-arm64@1.2.1: + resolution: {integrity: sha512-lz/Hn/isGnnZqILhnPiwO3Hy4mhGr1APrjXkCBolONyYG67x1OT3l8T5yaNW62GsIEeblabWkwLl/MkoPJJXZQ==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.2.1: + resolution: {integrity: sha512-mWJE2+sPiHJk0kHkuHby9ssTm2WR/R7USwJbbNmy7PM07DZdcciF2XbyLofO2ZGh0QI0LEW59OcjMwYChQnZbA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.2.1: + resolution: {integrity: sha512-M81if0mY66Feq3nsOoNRa+o57k6YecCeH4EX2EqkU/ObqYfVLmWnIvFsgqEZE/e/bguNmqBoAIJaIV26PvyyJg==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.2.1: + resolution: {integrity: sha512-gzTpmpvBmSFu6oeUeFKP8C34WpV91rha4gS+3swAuw5G+C4PosOTpAVPKnElbgl9iS0+stfP73tXARQUXySDPA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.2.1: + resolution: {integrity: sha512-SveEeHYjiXzRZhTE3HyURQ+CyZ3yLeKHUrggH4bSDQ1+b7rgDEF/XIEgMl+/3SWFlc+HdEpgbJWWZQCfSCqxww==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.2.1: + resolution: {integrity: sha512-ooEjE+A6kbQhf0cPNvC8bXje1jk2uKWgJ8S3DgHZRBvr6DlBiUsU8C1ycURdhDiHZ5d6nOI98LFrj3WWR1ODzA==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@builder.io/partytown@0.8.0: resolution: {integrity: sha512-M6H7nSMwW2dHd1/MQ+9J1Jqdw22uhl1nKv90kIiL9G7gjFVqqouQp4qSS1oZclmtW1XjAa4Q5UnbHB4iytmxZA==} hasBin: true @@ -8701,15 +8769,6 @@ packages: engines: {node: '>=10.13.0'} dev: false - /@ts-morph/common@0.20.0: - resolution: {integrity: sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==} - dependencies: - fast-glob: 3.3.1 - minimatch: 7.4.6 - mkdirp: 2.1.6 - path-browserify: 1.0.1 - dev: true - /@types/acorn@4.0.6: resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} dependencies: @@ -9044,14 +9103,6 @@ packages: '@types/node': 18.17.8 dev: true - /@types/strip-bom@3.0.0: - resolution: {integrity: sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==} - dev: true - - /@types/strip-json-comments@0.0.30: - resolution: {integrity: sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==} - dev: true - /@types/trusted-types@2.0.3: resolution: {integrity: sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==} @@ -10465,10 +10516,6 @@ packages: engines: {node: '>=6'} dev: false - /code-block-writer@12.0.0: - resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} - dev: true - /code-red@1.0.4: resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} dependencies: @@ -10535,6 +10582,7 @@ packages: /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + dev: false /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} @@ -11079,16 +11127,6 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: false - /editorconfig@0.15.3: - resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==} - hasBin: true - dependencies: - commander: 2.20.3 - lru-cache: 4.1.5 - semver: 5.7.2 - sigmund: 1.0.1 - dev: true - /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -14230,13 +14268,6 @@ packages: brace-expansion: 2.0.1 dev: false - /minimatch@7.4.6: - resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -14295,12 +14326,6 @@ packages: hasBin: true dev: false - /mkdirp@2.1.6: - resolution: {integrity: sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==} - engines: {node: '>=10'} - hasBin: true - dev: true - /mlly@1.4.0: resolution: {integrity: sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==} dependencies: @@ -14710,16 +14735,6 @@ packages: strip-ansi: 7.1.0 dev: false - /organize-imports-cli@0.10.0: - resolution: {integrity: sha512-cVyNEeiDxX/zA6gdK1QS2rr3TK1VymIkT0LagnAk4f6eE0IC0bo3BeUkMzm3q3GnCJzYC+6lfuMpBE0Cequ7Vg==} - hasBin: true - dependencies: - chalk: 4.1.2 - editorconfig: 0.15.3 - ts-morph: 19.0.0 - tsconfig: 7.0.0 - dev: true - /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -14881,10 +14896,6 @@ packages: tslib: 2.5.3 dev: false - /path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - dev: true - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -16360,10 +16371,6 @@ packages: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: false - /sigmund@1.0.1: - resolution: {integrity: sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==} - dev: true - /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -16734,6 +16741,7 @@ packages: /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} + requiresBuild: true /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -17124,13 +17132,6 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - /ts-morph@19.0.0: - resolution: {integrity: sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==} - dependencies: - '@ts-morph/common': 0.20.0 - code-block-writer: 12.0.0 - dev: true - /tsconfig-resolver@3.0.1: resolution: {integrity: sha512-ZHqlstlQF449v8glscGRXzL6l2dZvASPCdXJRWG4gHEZlUVx2Jtmr+a2zeVG4LCsKhDXKRj5R3h0C/98UcVAQg==} dependencies: @@ -17141,15 +17142,6 @@ packages: strip-bom: 4.0.0 type-fest: 3.0.0 - /tsconfig@7.0.0: - resolution: {integrity: sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==} - dependencies: - '@types/strip-bom': 3.0.0 - '@types/strip-json-comments': 0.0.30 - strip-bom: 3.0.0 - strip-json-comments: 2.0.1 - dev: true - /tslib@2.1.0: resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==} dev: true diff --git a/prettier.config.js b/prettier.config.js index b28486608061..4c9969429196 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -9,7 +9,7 @@ export default { plugins: ['prettier-plugin-astro'], overrides: [ { - files: ['.*', '*.json', '*.md', '*.toml', '*.yml'], + files: ['.*', '*.md', '*.toml', '*.yml'], options: { useTabs: false, }, diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index f2cdd417701a..678a223c90a8 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,6 +1,6 @@ { - "compilerOptions": { - "allowJs": true - }, - "extends": "./tsconfig.base.json" + "compilerOptions": { + "allowJs": true + }, + "extends": "./tsconfig.base.json" } diff --git a/turbo.json b/turbo.json index b2a69769f9dc..d95246aefa33 100644 --- a/turbo.json +++ b/turbo.json @@ -1,47 +1,47 @@ { - "$schema": "https://turborepo.org/schema.json", - "pipeline": { - "build": { - "dependsOn": ["^build"], - "inputs": [ - "**/*", - "!test/**/*", - "!e2e/**/*", - "!performance/**/*", - "!.astro/**/*", - "!.cache/**/*", - "!mod.js", - "!mod.js.map" - ], - "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], - "outputMode": "new-only" - }, - "build:ci": { - "dependsOn": ["^build:ci"], - "inputs": [ - "**/*", - "!test/**/*", - "!e2e/**/*", - "!performance/**/*", - "!.astro/**/*", - "!.cache/**/*", - "!mod.js", - "!mod.js.map" - ], - "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], - "outputMode": "new-only" - }, - "dev": { - "cache": false, - "persistent": true - }, - "test": { - "env": ["RUNNER_OS", "NODE_VERSION"], - "outputMode": "new-only" - }, - "test:hosted": { - "outputMode": "new-only", - "cache": false - } - } + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "inputs": [ + "**/*", + "!test/**/*", + "!e2e/**/*", + "!performance/**/*", + "!.astro/**/*", + "!.cache/**/*", + "!mod.js", + "!mod.js.map" + ], + "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], + "outputMode": "new-only" + }, + "build:ci": { + "dependsOn": ["^build:ci"], + "inputs": [ + "**/*", + "!test/**/*", + "!e2e/**/*", + "!performance/**/*", + "!.astro/**/*", + "!.cache/**/*", + "!mod.js", + "!mod.js.map" + ], + "outputs": ["dist/**/*", "!vendor/**", "mod.js", "mod.js.map"], + "outputMode": "new-only" + }, + "dev": { + "cache": false, + "persistent": true + }, + "test": { + "env": ["RUNNER_OS", "NODE_VERSION"], + "outputMode": "new-only" + }, + "test:hosted": { + "outputMode": "new-only", + "cache": false + } + } } From a09ee5a95c70b8c3bca8b3031830150a690d0759 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Sat, 16 Sep 2023 10:07:03 +0100 Subject: [PATCH 6/6] chore: ignore commit --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 7cc4d8db7381..6a953feb7759 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -4,3 +4,5 @@ 1335797903a57716e9a02b0ffd8ca636b3883c62 # Manually format .astro files in example projects (#3862) 59e8c71786fd1c154904b3fefa7d26d88f4d92d2 +# New formatting using Biome +07613b96bbe7a74179895c8cbe5f364133edd9ee