diff --git a/.changeset/famous-seas-press.md b/.changeset/famous-seas-press.md deleted file mode 100644 index 67d32b257797..000000000000 --- a/.changeset/famous-seas-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Expose `ContentConfig` type from `astro:content` diff --git a/.changeset/silver-peaches-pump.md b/.changeset/silver-peaches-pump.md new file mode 100644 index 000000000000..67bdfa4fd3ab --- /dev/null +++ b/.changeset/silver-peaches-pump.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes an issue where using `Response.redirect` in an endpoint led to an error. diff --git a/.changeset/wet-rivers-do.md b/.changeset/wet-rivers-do.md new file mode 100644 index 000000000000..a11d0f7bcb22 --- /dev/null +++ b/.changeset/wet-rivers-do.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes an issue where setting trailingSlash to "never" had no effect on `Astro.url`. diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e2a11d03eae3..c3e825cfc1a8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -16,6 +16,7 @@ module.exports = { plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'], rules: { // These off/configured-differently-by-default rules fit well for us + '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/no-unused-vars': [ 'warn', diff --git a/examples/basics/package.json b/examples/basics/package.json index 16491881c2f6..05408dfedfba 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 398956eb2f05..3999c2c3a5de 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.0", + "@astrojs/mdx": "^2.1.1", "@astrojs/rss": "^4.0.4", "@astrojs/sitemap": "^3.0.5", - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/blog/src/components/HeaderLink.astro b/examples/blog/src/components/HeaderLink.astro index 3dd439be1af6..bb600fb65ac3 100644 --- a/examples/blog/src/components/HeaderLink.astro +++ b/examples/blog/src/components/HeaderLink.astro @@ -6,7 +6,8 @@ type Props = HTMLAttributes<'a'>; const { href, class: className, ...props } = Astro.props; const { pathname } = Astro.url; -const isActive = href === pathname || href === pathname.replace(/\/$/, ''); +const subpath = pathname.match(/[^\/]+/g); +const isActive = href === pathname || href === '/' + subpath?.[0]; --- diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index 5113c8e8d93f..46975d8fbde4 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -11,7 +11,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; -
+

🧑‍🚀 Hello, Astronaut!

diff --git a/examples/component/package.json b/examples/component/package.json index 22d357f43342..cfa2bca2e545 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index 6938d628497f..47981a9c3b65 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.4.0", "@types/alpinejs": "^3.13.5", "alpinejs": "^3.13.3", - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index c655def71bf0..f3dad4e18953 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^4.0.1", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^4.2.6", + "astro": "^4.2.7", "lit": "^2.8.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 22cc6eb450b1..5ced6bbe4e8e 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -16,7 +16,7 @@ "@astrojs/solid-js": "^4.0.1", "@astrojs/svelte": "^5.0.3", "@astrojs/vue": "^4.0.8", - "astro": "^4.2.6", + "astro": "^4.2.7", "preact": "^10.19.2", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index b75f37cd13f2..0b5d0e922224 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.1.0", "@preact/signals": "^1.2.1", - "astro": "^4.2.6", + "astro": "^4.2.7", "preact": "^10.19.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 05cbe425ace9..c5c5349fc53b 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^3.0.9", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^4.2.6", + "astro": "^4.2.7", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 31c640df2413..57615d432d98 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^4.0.1", - "astro": "^4.2.6", + "astro": "^4.2.7", "solid-js": "^1.8.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 063a3fba05c6..be8648b5ecbd 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^5.0.3", - "astro": "^4.2.6", + "astro": "^4.2.7", "svelte": "^4.2.5" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index c33bead18c2b..c0ade974be40 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^4.0.8", - "astro": "^4.2.6", + "astro": "^4.2.7", "vue": "^3.3.8" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 3ac1450dc466..82318fcc6772 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^8.1.0", - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 3d0b5ca6e888..323e38aa5c56 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 02a93ca5d7a7..e46b2e81b4ff 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^8.1.0", - "astro": "^4.2.6", + "astro": "^4.2.7", "html-minifier": "^4.0.0" }, "devDependencies": { diff --git a/examples/minimal/package.json b/examples/minimal/package.json index cb1e411aaa14..a3e8b48f9a3e 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index ab5ef4169b49..f5c905661e4e 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 5eed33b63d31..f227500646c3 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 4fe370fdffa9..c564d52e75c3 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^8.1.0", "@astrojs/svelte": "^5.0.3", - "astro": "^4.2.6", + "astro": "^4.2.7", "svelte": "^4.2.5" } } diff --git a/examples/starlog/package.json b/examples/starlog/package.json index 3c01f0b67530..747aa9fe8b9f 100644 --- a/examples/starlog/package.json +++ b/examples/starlog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.6", + "astro": "^4.2.7", "sass": "^1.69.5", "sharp": "^0.32.6" } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index b38a7e1bbeb4..c94bdb8ce477 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@astrojs/tailwind": "^5.1.0", "@astrojs/node": "^8.1.0", - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 1fb7fe411ddd..8de3d24351da 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.8.3", - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 1de8e52e1289..d49b6bcb9eb3 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/markdown-remark": "^4.2.0", - "astro": "^4.2.6", + "@astrojs/markdown-remark": "^4.2.1", + "astro": "^4.2.7", "hast-util-select": "^6.0.2", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 99d8aa4eafdb..518de35aedb1 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.6" + "astro": "^4.2.7" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 644d7ea532ab..d4df51b3fa13 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.0", + "@astrojs/mdx": "^2.1.1", "@astrojs/preact": "^3.1.0", - "astro": "^4.2.6", + "astro": "^4.2.7", "preact": "^10.19.2" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 498d76e689ef..72caa3a7dd6e 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.1.0", "@nanostores/preact": "^0.5.0", - "astro": "^4.2.6", + "astro": "^4.2.7", "nanostores": "^0.9.5", "preact": "^10.19.2" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 077dca85897a..be8037d3aad7 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.0", + "@astrojs/mdx": "^2.1.1", "@astrojs/tailwind": "^5.1.0", "@types/canvas-confetti": "^1.6.3", - "astro": "^4.2.6", + "astro": "^4.2.7", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.9.1", "postcss": "^8.4.28", diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 3130d8ff1c34..c34ed3fbb685 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^4.2.6", + "astro": "^4.2.7", "vitest": "^1.2.1" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 605e3d0d908e..60ae687550c7 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,18 @@ # astro +## 4.2.7 + +### Patch Changes + +- [#9840](https://github.com/withastro/astro/pull/9840) [`70fdf1a5c660057152c1ca111dcc89ceda5c8840`](https://github.com/withastro/astro/commit/70fdf1a5c660057152c1ca111dcc89ceda5c8840) Thanks [@delucis](https://github.com/delucis)! - Expose `ContentConfig` type from `astro:content` + +- [#9865](https://github.com/withastro/astro/pull/9865) [`00ba9f1947ca9016cd0ee4d8f6048027fab2ab9a`](https://github.com/withastro/astro/commit/00ba9f1947ca9016cd0ee4d8f6048027fab2ab9a) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a bug in `Astro.currentLocale` where the value was incorrectly computed during the build. + +- [#9838](https://github.com/withastro/astro/pull/9838) [`0a06d87a1e2b94be00a954f350c184222fa0594d`](https://github.com/withastro/astro/commit/0a06d87a1e2b94be00a954f350c184222fa0594d) Thanks [@lilnasy](https://github.com/lilnasy)! - Fixes an issue where `astro:i18n` could not be used in framework components. + +- Updated dependencies [[`44c957f893c6bf5f5b7c78301de7b21c5975584d`](https://github.com/withastro/astro/commit/44c957f893c6bf5f5b7c78301de7b21c5975584d)]: + - @astrojs/markdown-remark@4.2.1 + ## 4.2.6 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index e8d64f9ff044..7e6d1f7c8e82 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "4.2.6", + "version": "4.2.7", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/astro/src/assets/services/squoosh.ts b/packages/astro/src/assets/services/squoosh.ts index c9586af10d6c..098b3a669eb6 100644 --- a/packages/astro/src/assets/services/squoosh.ts +++ b/packages/astro/src/assets/services/squoosh.ts @@ -48,6 +48,8 @@ async function getRotationForEXIF( case 7: case 8: return { type: 'rotate', numRotations: 3 }; + default: + return undefined; } } diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index dcc4859f817e..b8cb1949cda8 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -211,6 +211,8 @@ export async function add(names: string[], { flags }: AddOptions) { case UpdateResult.failure: { throw createPrettyError(new Error(`Unable to install dependencies`)); } + case UpdateResult.none: + break; } const rawConfigPath = await resolveConfigPath({ diff --git a/packages/astro/src/core/app/types.ts b/packages/astro/src/core/app/types.ts index b4da7dc6829d..a5b93fb5006a 100644 --- a/packages/astro/src/core/app/types.ts +++ b/packages/astro/src/core/app/types.ts @@ -60,7 +60,7 @@ export type SSRManifest = { export type SSRManifestI18n = { fallback?: Record; - routing?: RoutingStrategies; + routing: RoutingStrategies; locales: Locales; defaultLocale: string; }; diff --git a/packages/astro/src/core/build/generate.ts b/packages/astro/src/core/build/generate.ts index 966d7ad84146..9f3a9076919c 100644 --- a/packages/astro/src/core/build/generate.ts +++ b/packages/astro/src/core/build/generate.ts @@ -5,6 +5,7 @@ import { fileURLToPath } from 'node:url'; import PQueue from 'p-queue'; import type { OutputAsset, OutputChunk } from 'rollup'; import type { + AstroConfig, AstroSettings, ComponentInstance, GetStaticPathsItem, @@ -455,7 +456,8 @@ function getUrlForPath( pathname: string, base: string, origin: string, - format: 'directory' | 'file', + format: AstroConfig['build']['format'], + trailingSlash: AstroConfig['trailingSlash'], routeType: RouteType ): URL { /** @@ -463,7 +465,7 @@ function getUrlForPath( * pathname: /, /foo * base: / */ - const ending = format === 'directory' ? '/' : '.html'; + const ending = format === 'directory' ? (trailingSlash === 'never' ? '' : '/') : '.html'; let buildPathname: string; if (pathname === '/' || pathname === '') { buildPathname = base; @@ -538,6 +540,7 @@ async function generatePath( pipeline.getConfig().base, pipeline.getStaticBuildOptions().origin, pipeline.getConfig().build.format, + pipeline.getConfig().trailingSlash, route.type ); diff --git a/packages/astro/src/core/constants.ts b/packages/astro/src/core/constants.ts index 471614ce3359..af00d655d7c2 100644 --- a/packages/astro/src/core/constants.ts +++ b/packages/astro/src/core/constants.ts @@ -13,3 +13,5 @@ export const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [ // The folder name where to find the middleware export const MIDDLEWARE_PATH_SEGMENT_NAME = 'middleware'; + +export const ROUTE_DATA_SYMBOL = 'astro.routeData'; diff --git a/packages/astro/src/core/render/context.ts b/packages/astro/src/core/render/context.ts index 9b94f4ad2f8f..898e74d8f396 100644 --- a/packages/astro/src/core/render/context.ts +++ b/packages/astro/src/core/render/context.ts @@ -12,8 +12,10 @@ import { AstroError, AstroErrorData } from '../errors/index.js'; import type { Environment } from './environment.js'; import { getParamsAndProps } from './params-and-props.js'; import type { RoutingStrategies } from '../config/schema.js'; +import { ROUTE_DATA_SYMBOL } from '../constants.js'; const clientLocalsSymbol = Symbol.for('astro.locals'); +const routeDataSymbol = Symbol.for(ROUTE_DATA_SYMBOL); /** * The RenderContext represents the parts of rendering that are specific to one request. @@ -243,8 +245,12 @@ export function computeCurrentLocale( routingStrategy: RoutingStrategies | undefined, defaultLocale: string | undefined ): undefined | string { - const requestUrl = new URL(request.url); - for (const segment of requestUrl.pathname.split('/')) { + const routeData: RouteData | undefined = Reflect.get(request, routeDataSymbol); + if (!routeData) { + return defaultLocale; + } + + for (const segment of routeData.route.split('/')) { for (const locale of locales) { if (typeof locale === 'string') { if (normalizeTheLocale(locale) === normalizeTheLocale(segment)) { diff --git a/packages/astro/src/i18n/middleware.ts b/packages/astro/src/i18n/middleware.ts index 1298dcac8154..a7c50dc82d53 100644 --- a/packages/astro/src/i18n/middleware.ts +++ b/packages/astro/src/i18n/middleware.ts @@ -3,8 +3,9 @@ import type { Locales, MiddlewareHandler, RouteData, SSRManifest } from '../@typ import type { PipelineHookFunction } from '../core/pipeline.js'; import { getPathByLocale, normalizeTheLocale } from './index.js'; import { shouldAppendForwardSlash } from '../core/build/util.js'; +import { ROUTE_DATA_SYMBOL } from '../core/constants.js'; -const routeDataSymbol = Symbol.for('astro.routeData'); +const routeDataSymbol = Symbol.for(ROUTE_DATA_SYMBOL); // Checks if the pathname has any locale, exception for the defaultLocale, which is ignored on purpose. function pathnameHasLocale(pathname: string, locales: Locales): boolean { diff --git a/packages/astro/src/i18n/vite-plugin-i18n.ts b/packages/astro/src/i18n/vite-plugin-i18n.ts index 856ce46a7415..2ce015c26521 100644 --- a/packages/astro/src/i18n/vite-plugin-i18n.ts +++ b/packages/astro/src/i18n/vite-plugin-i18n.ts @@ -4,8 +4,6 @@ import { AstroError } from '../core/errors/errors.js'; import { AstroErrorData } from '../core/errors/index.js'; const virtualModuleId = 'astro:i18n'; -const configId = 'astro-internal:i18n-config'; -const resolvedConfigId = `\0${configId}`; type AstroInternationalization = { settings: AstroSettings; @@ -13,8 +11,9 @@ type AstroInternationalization = { export interface I18nInternalConfig extends Pick, - NonNullable, - Pick {} + Pick { + i18n: AstroConfig['i18n']; +} export default function astroInternationalization({ settings, @@ -29,28 +28,19 @@ export default function astroInternationalization({ return { name: 'astro:i18n', enforce: 'pre', - async resolveId(id) { + config(config) { + const i18nConfig: I18nInternalConfig = { base, format, site, trailingSlash, i18n }; + return { + define: { + __ASTRO_INTERNAL_I18N_CONFIG__: JSON.stringify(i18nConfig), + }, + }; + }, + resolveId(id) { if (id === virtualModuleId) { if (i18n === undefined) throw new AstroError(AstroErrorData.i18nNotEnabled); return this.resolve('astro/virtual-modules/i18n.js'); } - if (id === configId) return resolvedConfigId; - }, - load(id) { - if (id === resolvedConfigId) { - const { defaultLocale, locales, routing, fallback } = i18n!; - const config: I18nInternalConfig = { - base, - format, - site, - trailingSlash, - defaultLocale, - locales, - routing, - fallback, - }; - return `export default ${JSON.stringify(config)};`; - } }, }; } diff --git a/packages/astro/src/preferences/index.ts b/packages/astro/src/preferences/index.ts index d758c405b38f..8a19c5d48da7 100644 --- a/packages/astro/src/preferences/index.ts +++ b/packages/astro/src/preferences/index.ts @@ -66,7 +66,10 @@ export function coerce(key: string, value: unknown) { case 'boolean': { if (value === 'true' || value === 1) return true; if (value === 'false' || value === 0) return false; + break; } + default: + throw new Error(`Incorrect value for ${key}`); } return value as any; } diff --git a/packages/astro/src/runtime/client/dev-toolbar/apps/settings.ts b/packages/astro/src/runtime/client/dev-toolbar/apps/settings.ts index d6a2cbde8320..7fa1993090c3 100644 --- a/packages/astro/src/runtime/client/dev-toolbar/apps/settings.ts +++ b/packages/astro/src/runtime/client/dev-toolbar/apps/settings.ts @@ -161,7 +161,10 @@ export default { astroToggle.input.addEventListener('change', setting.changeEvent); astroToggle.input.checked = settings.config[setting.settingKey]; label.append(astroToggle); + break; } + default: + break; } return label; diff --git a/packages/astro/src/runtime/server/endpoint.ts b/packages/astro/src/runtime/server/endpoint.ts index afafb21c7dad..49f00224e61d 100644 --- a/packages/astro/src/runtime/server/endpoint.ts +++ b/packages/astro/src/runtime/server/endpoint.ts @@ -42,6 +42,12 @@ export async function renderEndpoint( const response = await handler.call(mod, context); // Endpoints explicitly returning 404 or 500 response status should // NOT be subject to rerouting to 404.astro or 500.astro. - response.headers.set(REROUTE_DIRECTIVE_HEADER, 'no'); + if (response.status === 404 || response.status === 500) { + // Only `Response.redirect` headers are immutable, therefore a `try..catch` is not necessary. + // Note: `Response.redirect` can only be called with HTTP status codes: 301, 302, 303, 307, 308. + // Source: https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect_static#parameters + response.headers.set(REROUTE_DIRECTIVE_HEADER, 'no'); + } + return response; } diff --git a/packages/astro/src/runtime/server/scripts.ts b/packages/astro/src/runtime/server/scripts.ts index 47cd122f1c05..2ab36862585a 100644 --- a/packages/astro/src/runtime/server/scripts.ts +++ b/packages/astro/src/runtime/server/scripts.ts @@ -42,6 +42,8 @@ export function getPrescripts(result: SSRResult, type: PrescriptType, directive: )};${islandScript}`; case 'directive': return ``; + case null: + break; } return ''; } diff --git a/packages/astro/src/virtual-modules/i18n.ts b/packages/astro/src/virtual-modules/i18n.ts index d9d470431117..aff49a492dc0 100644 --- a/packages/astro/src/virtual-modules/i18n.ts +++ b/packages/astro/src/virtual-modules/i18n.ts @@ -1,10 +1,10 @@ import * as I18nInternals from '../i18n/index.js'; import type { I18nInternalConfig } from '../i18n/vite-plugin-i18n.js'; export { normalizeTheLocale, toCodes, toPaths } from '../i18n/index.js'; + // @ts-expect-error -import config from 'astro-internal:i18n-config'; -const { trailingSlash, format, site, defaultLocale, locales, routing } = - config as I18nInternalConfig; +const { trailingSlash, format, site, i18n } = __ASTRO_INTERNAL_I18N_CONFIG__ as I18nInternalConfig; +const { defaultLocale, locales, routing } = i18n!; const base = import.meta.env.BASE_URL; export type GetLocaleOptions = I18nInternals.GetLocaleOptions; diff --git a/packages/astro/src/vite-plugin-astro/types.ts b/packages/astro/src/vite-plugin-astro/types.ts index 589a0b0b0348..40979293dcbf 100644 --- a/packages/astro/src/vite-plugin-astro/types.ts +++ b/packages/astro/src/vite-plugin-astro/types.ts @@ -1,6 +1,5 @@ import type { HoistedScript, TransformResult } from '@astrojs/compiler'; import type { PropagationHint } from '../@types/astro.js'; -import type { CompileAstroResult } from './compile.js'; export interface PageOptions { prerender?: boolean; diff --git a/packages/astro/test/astro-assets-prefix.test.js b/packages/astro/test/astro-assets-prefix.test.js index ab42439aec61..65613f03acee 100644 --- a/packages/astro/test/astro-assets-prefix.test.js +++ b/packages/astro/test/astro-assets-prefix.test.js @@ -51,8 +51,10 @@ describe('Assets Prefix - Static', () => { it('markdown image src start with assetsPrefix', async () => { const html = await fixture.readFile('/markdown/index.html'); const $ = cheerio.load(html); - const imgAsset = $('img'); - expect(imgAsset.attr('src')).to.match(assetsPrefixRegex); + const imgAssets = $('img'); + imgAssets.each((i, el) => { + expect(el.attribs.src).to.match(assetsPrefixRegex); + }); }); it('content collections image src start with assetsPrefix', async () => { diff --git a/packages/astro/test/astro-get-static-paths.test.js b/packages/astro/test/astro-get-static-paths.test.js index 66aa5b94d042..3e35d6c856ea 100644 --- a/packages/astro/test/astro-get-static-paths.test.js +++ b/packages/astro/test/astro-get-static-paths.test.js @@ -10,6 +10,7 @@ describe('getStaticPaths - build calls', () => { fixture = await loadFixture({ root: './fixtures/astro-get-static-paths/', site: 'https://mysite.dev/', + trailingSlash: 'never', base: '/blog', }); await fixture.build(); @@ -29,7 +30,7 @@ describe('getStaticPaths - build calls', () => { const html = await fixture.readFile('/food/tacos/index.html'); const $ = cheerio.load(html); - expect($('#url').text()).to.equal('/blog/food/tacos/'); + expect($('#url').text()).to.equal('/blog/food/tacos'); }); }); diff --git "a/packages/astro/test/fixtures/astro-assets-prefix/src/assets/\343\203\232\343\203\263\343\202\256\343\203\263.jpg" "b/packages/astro/test/fixtures/astro-assets-prefix/src/assets/\343\203\232\343\203\263\343\202\256\343\203\263.jpg" new file mode 100644 index 000000000000..1a8986ac5092 Binary files /dev/null and "b/packages/astro/test/fixtures/astro-assets-prefix/src/assets/\343\203\232\343\203\263\343\202\256\343\203\263.jpg" differ diff --git a/packages/astro/test/fixtures/astro-assets-prefix/src/pages/markdown.md b/packages/astro/test/fixtures/astro-assets-prefix/src/pages/markdown.md index 20f623657f31..06c4f7fcfdbb 100644 --- a/packages/astro/test/fixtures/astro-assets-prefix/src/pages/markdown.md +++ b/packages/astro/test/fixtures/astro-assets-prefix/src/pages/markdown.md @@ -3,3 +3,5 @@ Relative image has assetsPrefix ![Relative image](../assets/penguin1.jpg) + +![non-UTF-8 file name image](../assets/ペンギン.jpg) diff --git a/packages/astro/test/fixtures/i18n-routing-fallback/src/pages/pt/start.astro b/packages/astro/test/fixtures/i18n-routing-fallback/src/pages/pt/start.astro index 5a4a84c2cf0c..e0ae5bb5fcd5 100644 --- a/packages/astro/test/fixtures/i18n-routing-fallback/src/pages/pt/start.astro +++ b/packages/astro/test/fixtures/i18n-routing-fallback/src/pages/pt/start.astro @@ -1,8 +1,12 @@ +--- +const currentLocale = Astro.currentLocale; +--- + Astro -Oi essa e start +Oi essa e start: {currentLocale} diff --git a/packages/astro/test/i18n-routing.test.js b/packages/astro/test/i18n-routing.test.js index 6cc445c1ceea..da9fdc7c8316 100644 --- a/packages/astro/test/i18n-routing.test.js +++ b/packages/astro/test/i18n-routing.test.js @@ -844,7 +844,7 @@ describe('[SSG] i18n routing', () => { it('should render localised page correctly', async () => { let html = await fixture.readFile('/pt/start/index.html'); let $ = cheerio.load(html); - expect($('body').text()).includes('Oi essa e start'); + expect($('body').text()).includes('Oi essa e start: pt'); html = await fixture.readFile('/pt/blog/1/index.html'); $ = cheerio.load(html); diff --git a/packages/astro/test/units/routing/endpoints.test.js b/packages/astro/test/units/routing/endpoints.test.js new file mode 100644 index 000000000000..fde7a81daddb --- /dev/null +++ b/packages/astro/test/units/routing/endpoints.test.js @@ -0,0 +1,91 @@ +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 testAdapter from '../../test-adapter.js'; + +const root = new URL('../../fixtures/api-routes/', import.meta.url); +const fileSystem = { + '/src/pages/response-redirect.ts': `export const GET = ({ url }) => Response.redirect("https://example.com/destination", 307)`, + '/src/pages/response.ts': `export const GET = ({ url }) => new Response(null, { headers: { Location: "https://example.com/destination" }, status: 307 })`, + '/src/pages/not-found.ts': `export const GET = ({ url }) => new Response('empty', { headers: { "Content-Type": "text/plain" }, status: 404 })`, + '/src/pages/internal-error.ts': `export const GET = ({ url }) => new Response('something went wrong', { headers: { "Content-Type": "text/plain" }, status: 500 })`, +}; + +describe('endpoints', () => { + let container; + let settings; + + before(async () => { + const fs = createFs(fileSystem, root); + settings = await createBasicSettings({ + root: fileURLToPath(root), + output: 'server', + adapter: testAdapter(), + }); + container = await createContainer({ + fs, + settings, + logger: defaultLogger, + }); + }); + + after(async () => { + await container.close(); + }); + + it('should return a redirect response with location header', async () => { + const { req, res, done } = createRequestAndResponse({ + method: 'GET', + url: '/response-redirect', + }); + container.handle(req, res); + await done; + const headers = res.getHeaders(); + expect(headers).to.deep.include({ location: 'https://example.com/destination' }); + expect(headers).not.to.deep.include({ 'x-astro-reroute': 'no' }); + expect(res.statusCode).to.equal(307); + }); + + it('should return a response with location header', async () => { + const { req, res, done } = createRequestAndResponse({ + method: 'GET', + url: '/response', + }); + container.handle(req, res); + await done; + const headers = res.getHeaders(); + expect(headers).to.deep.include({ location: 'https://example.com/destination' }); + expect(headers).not.to.deep.include({ 'x-astro-reroute': 'no' }); + expect(res.statusCode).to.equal(307); + }); + + it('should append reroute header for HTTP status 404', async () => { + const { req, res, done } = createRequestAndResponse({ + method: 'GET', + url: '/not-found', + }); + container.handle(req, res); + await done; + const headers = res.getHeaders(); + expect(headers).to.deep.include({ 'x-astro-reroute': 'no' }); + expect(res.statusCode).to.equal(404); + }); + + it('should append reroute header for HTTP status 500', async () => { + const { req, res, done } = createRequestAndResponse({ + method: 'GET', + url: '/internal-error', + }); + container.handle(req, res); + await done; + const headers = res.getHeaders(); + expect(headers).to.deep.include({ 'x-astro-reroute': 'no' }); + expect(res.statusCode).to.equal(500); + }); +}); diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index 05f9534e2b34..f1da065f650f 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,12 @@ # @astrojs/mdx +## 2.1.1 + +### Patch Changes + +- Updated dependencies [[`44c957f893c6bf5f5b7c78301de7b21c5975584d`](https://github.com/withastro/astro/commit/44c957f893c6bf5f5b7c78301de7b21c5975584d)]: + - @astrojs/markdown-remark@4.2.1 + ## 2.1.0 ### Minor Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index ee2e3394014a..992e721ea8b4 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/mdx", "description": "Add support for MDX pages in your Astro site", - "version": "2.1.0", + "version": "2.1.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/node/test/encoded.test.js b/packages/integrations/node/test/encoded.test.js index 2739fcfb7fb4..15b5654b1f50 100644 --- a/packages/integrations/node/test/encoded.test.js +++ b/packages/integrations/node/test/encoded.test.js @@ -1,5 +1,5 @@ import * as assert from 'node:assert/strict'; -import { describe, it, before, after } from 'node:test'; +import { describe, it, before } from 'node:test'; import nodejs from '../dist/index.js'; import { loadFixture, createRequestAndResponse } from './test-utils.js'; diff --git a/packages/integrations/node/test/headers.test.js b/packages/integrations/node/test/headers.test.js index 6a08dca22d3d..b74af99524b1 100644 --- a/packages/integrations/node/test/headers.test.js +++ b/packages/integrations/node/test/headers.test.js @@ -1,5 +1,5 @@ import * as assert from 'node:assert/strict'; -import { describe, it, before, after } from 'node:test'; +import { describe, it, before } from 'node:test'; import nodejs from '../dist/index.js'; import { loadFixture, createRequestAndResponse } from './test-utils.js'; diff --git a/packages/integrations/node/test/locals.test.js b/packages/integrations/node/test/locals.test.js index e2a531cce072..a310c729d883 100644 --- a/packages/integrations/node/test/locals.test.js +++ b/packages/integrations/node/test/locals.test.js @@ -1,5 +1,5 @@ import * as assert from 'node:assert/strict'; -import { describe, it, before, after } from 'node:test'; +import { describe, it, before } from 'node:test'; import nodejs from '../dist/index.js'; import { loadFixture, createRequestAndResponse } from './test-utils.js'; diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index c07f65963be2..add6641eab9b 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -30,7 +30,7 @@ "build": "astro-scripts build \"src/**/*.ts\" && tsc", "build:ci": "astro-scripts build \"src/**/*.ts\"", "dev": "astro-scripts dev \"src/**/*.ts\"", - "test": "mocha --exit --timeout 20000 test/" + "test": "astro-scripts test \"test/**/*.test.js\"" }, "dependencies": { "autoprefixer": "^10.4.15", @@ -40,8 +40,6 @@ "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*", - "chai": "^4.3.7", - "mocha": "^10.2.0", "tailwindcss": "^3.3.5", "vite": "^5.0.12" }, diff --git a/packages/integrations/tailwind/test/basic.test.js b/packages/integrations/tailwind/test/basic.test.js index e5275c81e9d6..6e544eb8c70d 100644 --- a/packages/integrations/tailwind/test/basic.test.js +++ b/packages/integrations/tailwind/test/basic.test.js @@ -1,4 +1,5 @@ -import { expect } from 'chai'; +import * as assert from 'node:assert/strict'; +import { describe, it, before } from 'node:test'; import { loadFixture } from '../../../astro/test/test-utils.js'; describe('Basic', () => { @@ -25,9 +26,12 @@ describe('Basic', () => { } } - expect(css).to.include('box-sizing:border-box;'); // base css - expect(css).to.include('text-red-500'); // class css - expect(css).to.match(/\.a\[data-astro-cid-.*?\] \.b\[data-astro-cid-.*?\]/); // nesting + assert.equal(css.includes('box-sizing:border-box;'), true); // base css + assert.equal(css.includes('text-red-500'), true); // class css + assert.equal( + new RegExp(/\.a\[data-astro-cid-.*?\] \.b\[data-astro-cid-.*?\]/).test(css), + true + ); // nesting }); }); }); diff --git a/packages/markdown/remark/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md index c71de000f32b..550830e081ce 100644 --- a/packages/markdown/remark/CHANGELOG.md +++ b/packages/markdown/remark/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/markdown-remark +## 4.2.1 + +### Patch Changes + +- [#9866](https://github.com/withastro/astro/pull/9866) [`44c957f893c6bf5f5b7c78301de7b21c5975584d`](https://github.com/withastro/astro/commit/44c957f893c6bf5f5b7c78301de7b21c5975584d) Thanks [@ktym4a](https://github.com/ktym4a)! - Fixes a bug where non-UTF-8 file names are not displayed when using relative paths in markdowns. + ## 4.2.0 ### Minor Changes diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index e38b8e792440..ee081361df04 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/markdown-remark", - "version": "4.2.0", + "version": "4.2.1", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/markdown/remark/src/rehype-images.ts b/packages/markdown/remark/src/rehype-images.ts index 71783ca1a050..01e5aa6d63d5 100644 --- a/packages/markdown/remark/src/rehype-images.ts +++ b/packages/markdown/remark/src/rehype-images.ts @@ -11,6 +11,8 @@ export function rehypeImages() { if (node.tagName !== 'img') return; if (node.properties?.src) { + node.properties.src = decodeURI(node.properties.src); + if (file.data.imagePaths?.has(node.properties.src)) { const { ...props } = node.properties; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e76d8195cf21..3438ca898ba0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,13 +128,13 @@ importers: examples/basics: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/blog: dependencies: '@astrojs/mdx': - specifier: ^2.1.0 + specifier: ^2.1.1 version: link:../../packages/integrations/mdx '@astrojs/rss': specifier: ^4.0.4 @@ -143,13 +143,13 @@ importers: specifier: ^3.0.5 version: link:../../packages/integrations/sitemap astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/framework-alpine: @@ -164,7 +164,7 @@ importers: specifier: ^3.13.3 version: 3.13.3 astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/framework-lit: @@ -176,7 +176,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro lit: specifier: ^2.8.0 @@ -200,7 +200,7 @@ importers: specifier: ^4.0.8 version: link:../../packages/integrations/vue astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -230,7 +230,7 @@ importers: specifier: ^1.2.1 version: 1.2.1(preact@10.19.3) astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -248,7 +248,7 @@ importers: specifier: ^18.2.15 version: 18.2.18 astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -263,7 +263,7 @@ importers: specifier: ^4.0.1 version: link:../../packages/integrations/solid astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro solid-js: specifier: ^1.8.5 @@ -275,7 +275,7 @@ importers: specifier: ^5.0.3 version: link:../../packages/integrations/svelte astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -287,7 +287,7 @@ importers: specifier: ^4.0.8 version: link:../../packages/integrations/vue astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro vue: specifier: ^3.3.8 @@ -299,13 +299,13 @@ importers: specifier: ^8.1.0 version: link:../../packages/integrations/node astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/middleware: @@ -314,7 +314,7 @@ importers: specifier: ^8.1.0 version: link:../../packages/integrations/node astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -327,19 +327,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/ssr: @@ -351,7 +351,7 @@ importers: specifier: ^5.0.3 version: link:../../packages/integrations/svelte astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -360,7 +360,7 @@ importers: examples/starlog: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro sass: specifier: ^1.69.5 @@ -378,7 +378,7 @@ importers: specifier: ^5.1.0 version: link:../../packages/integrations/tailwind astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/with-markdoc: @@ -387,16 +387,16 @@ importers: specifier: ^0.8.3 version: link:../../packages/integrations/markdoc astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/with-markdown-plugins: dependencies: '@astrojs/markdown-remark': - specifier: ^4.2.0 + specifier: ^4.2.1 version: link:../../packages/markdown/remark astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro hast-util-select: specifier: ^6.0.2 @@ -417,19 +417,19 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro examples/with-mdx: dependencies: '@astrojs/mdx': - specifier: ^2.1.0 + specifier: ^2.1.1 version: link:../../packages/integrations/mdx '@astrojs/preact': specifier: ^3.1.0 version: link:../../packages/integrations/preact astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -444,7 +444,7 @@ importers: specifier: ^0.5.0 version: 0.5.0(nanostores@0.9.5)(preact@10.19.3) astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro nanostores: specifier: ^0.9.5 @@ -456,7 +456,7 @@ importers: examples/with-tailwindcss: dependencies: '@astrojs/mdx': - specifier: ^2.1.0 + specifier: ^2.1.1 version: link:../../packages/integrations/mdx '@astrojs/tailwind': specifier: ^5.1.0 @@ -465,7 +465,7 @@ importers: specifier: ^1.6.3 version: 1.6.4 astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -483,7 +483,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^4.2.6 + specifier: ^4.2.7 version: link:../../packages/astro vitest: specifier: ^1.2.1 @@ -4705,12 +4705,6 @@ importers: astro-scripts: specifier: workspace:* version: link:../../../scripts - chai: - specifier: ^4.3.7 - version: 4.3.10 - mocha: - specifier: ^10.2.0 - version: 10.2.0 tailwindcss: specifier: ^3.3.5 version: 3.4.0