mirror of
https://github.com/withastro/astro.git
synced 2025-03-17 23:11:29 -05:00
Merge branch 'main' into next
This commit is contained in:
commit
63b4ab95b9
64 changed files with 1139 additions and 1050 deletions
README.mdpnpm-lock.yaml
benchmark
examples
packages
astro-prism
astro
CHANGELOG.mdclient.d.tspackage.json
e2e/fixtures
actions-blog
client-only
error-sass
errors
hmr
multiple-frameworks
nested-in-preact
nested-in-react
nested-in-solid
nested-in-svelte
nested-in-vue
nested-recursive
solid-circular
solid-component
solid-recurse
view-transitions
performance/fixtures
src
actions/runtime
cli
core
integrations
types/public
templates
test
actions.test.jsconfig-vite.test.js
fixtures
astro-slots-nested
jsx
large-array
postcss
react-and-solid
slots-solid
solid-component
ssr-prerender-chunks
third-party-astro
create-astro
db
integrations
alpinejs
mdx
preact
react
solid
vue
web-vitals
markdown/remark
|
@ -10,7 +10,8 @@
|
|||
|
||||
<div align="center">
|
||||
|
||||
[](https://github.com/withastro/astro/actions/workflows/ci.yml)
|
||||
[](https://github.com/withastro/astro/actions/workflows/ci.yml)
|
||||
[](https://github.com/withastro/astro/actions/workflows/ci.yml)
|
||||
[](https://github.com/withastro/astro/blob/main/LICENSE)
|
||||
[](https://badge.fury.io/js/astro)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"@benchmark/timer": "workspace:*",
|
||||
"astro": "workspace:*",
|
||||
"autocannon": "^7.15.0",
|
||||
"markdown-table": "^3.0.3",
|
||||
"markdown-table": "^3.0.4",
|
||||
"mri": "^1.2.0",
|
||||
"port-authority": "^2.0.1",
|
||||
"pretty-bytes": "^6.1.1",
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
"@astrojs/react": "^3.6.2",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"vitest": "^2.1.3"
|
||||
"vitest": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
"@astrojs/solid-js": "^4.4.2",
|
||||
"@astrojs/svelte": "^6.0.0-beta.1",
|
||||
"@astrojs/vue": "^5.0.0-beta.0",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "^5.0.0-beta.5",
|
||||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/react": "^3.6.2",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "^5.0.0-beta.5",
|
||||
"react": "^18.3.1",
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"prismjs": "^1.29.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/prismjs": "1.26.4",
|
||||
"@types/prismjs": "1.26.5",
|
||||
"astro-scripts": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
@ -1062,6 +1062,24 @@
|
|||
- Updated dependencies [[`83a2a64`](https://github.com/withastro/astro/commit/83a2a648418ad30f4eb781d1c1b5f2d8a8ac846e)]:
|
||||
- @astrojs/markdown-remark@6.0.0-alpha.0
|
||||
|
||||
## 4.16.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#12338](https://github.com/withastro/astro/pull/12338) [`9ca89b3`](https://github.com/withastro/astro/commit/9ca89b3e13d47e146989cfabb916d6599d140f03) Thanks [@situ2001](https://github.com/situ2001)! - Resets `NODE_ENV` to ensure install command run in dev mode
|
||||
|
||||
- [#12286](https://github.com/withastro/astro/pull/12286) [`9d6bcdb`](https://github.com/withastro/astro/commit/9d6bcdb88fcb9df0c5c70e2b591bcf962ce55f63) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where a warning for experimental `astro:env` support would be shown when using an adapter but not actually using `astro:env`
|
||||
|
||||
- [#12342](https://github.com/withastro/astro/pull/12342) [`ffc836b`](https://github.com/withastro/astro/commit/ffc836bac0cdea684ea91f958ac8298d4ee4b07d) Thanks [@liruifengv](https://github.com/liruifengv)! - Fixes a typo in the command name of the CLI
|
||||
|
||||
- [#12301](https://github.com/withastro/astro/pull/12301) [`0cfc69d`](https://github.com/withastro/astro/commit/0cfc69d499815d4e1f1dc37cf32653195586087a) Thanks [@apatel369](https://github.com/apatel369)! - Fixes an issue with action handler context by passing the correct context (`ActionAPIContext`).
|
||||
|
||||
- [#12312](https://github.com/withastro/astro/pull/12312) [`5642ef9`](https://github.com/withastro/astro/commit/5642ef9029890fc29793c160321f78f62cdaafcb) Thanks [@koyopro](https://github.com/koyopro)! - Fixes an issue where using `getViteConfig()` returns incorrect and duplicate configuration
|
||||
|
||||
- [#12245](https://github.com/withastro/astro/pull/12245) [`1d4f6a4`](https://github.com/withastro/astro/commit/1d4f6a4989bc1cfd7109b1bff41503f115660e02) Thanks [@bmenant](https://github.com/bmenant)! - Add `components` property to MDXInstance type definition (RenderResult and module import)
|
||||
|
||||
- [#12340](https://github.com/withastro/astro/pull/12340) [`94eaeea`](https://github.com/withastro/astro/commit/94eaeea1c437402ffc44103126b355adab4b8a01) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where Astro actions didn't work when `base` was different from `/`
|
||||
|
||||
## 4.16.7
|
||||
|
||||
### Patch Changes
|
||||
|
|
1
packages/astro/client.d.ts
vendored
1
packages/astro/client.d.ts
vendored
|
@ -283,6 +283,7 @@ declare module '*.mdx' {
|
|||
export const url: MDX['url'];
|
||||
export const getHeadings: MDX['getHeadings'];
|
||||
export const Content: MDX['Content'];
|
||||
export const components: MDX['components'];
|
||||
|
||||
const load: MDX['default'];
|
||||
export default load;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@astrojs/db": "workspace:*",
|
||||
"@astrojs/node": "^8.3.4",
|
||||
"@astrojs/react": "workspace:*",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"private": true,
|
||||
"dependencies": {
|
||||
"astro": "workspace:*",
|
||||
"sass": "^1.80.3"
|
||||
"sass": "^1.80.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"sass": "^1.80.3",
|
||||
"solid-js": "^1.9.2",
|
||||
"sass": "^1.80.4",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"private": true,
|
||||
"devDependencies": {
|
||||
"astro": "workspace:*",
|
||||
"sass": "^1.80.3"
|
||||
"sass": "^1.80.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
},
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
"astro": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"@astrojs/mdx": "workspace:*",
|
||||
"@astrojs/solid-js": "workspace:*",
|
||||
"astro": "workspace:*",
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
"astro": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
"react-dom": "^18.3.1",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12",
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,9 +122,9 @@
|
|||
"@astrojs/markdown-remark": "workspace:*",
|
||||
"@astrojs/telemetry": "workspace:*",
|
||||
"@oslojs/encoding": "^1.1.0",
|
||||
"@rollup/pluginutils": "^5.1.2",
|
||||
"@rollup/pluginutils": "^5.1.3",
|
||||
"@types/cookie": "^0.6.0",
|
||||
"acorn": "^8.13.0",
|
||||
"acorn": "^8.14.0",
|
||||
"aria-query": "^5.3.2",
|
||||
"axobject-query": "^4.1.0",
|
||||
"boxen": "8.0.1",
|
||||
|
@ -160,7 +160,7 @@
|
|||
"prompts": "^2.4.2",
|
||||
"rehype": "^13.0.2",
|
||||
"semver": "^7.6.3",
|
||||
"shiki": "^1.22.0",
|
||||
"shiki": "^1.22.2",
|
||||
"tinyexec": "^0.3.1",
|
||||
"tsconfck": "^3.1.4",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
|
@ -172,7 +172,7 @@
|
|||
"yargs-parser": "^21.1.1",
|
||||
"yocto-spinner": "^0.1.0",
|
||||
"zod": "^3.23.8",
|
||||
"zod-to-json-schema": "^3.23.3",
|
||||
"zod-to-json-schema": "^3.23.5",
|
||||
"zod-to-ts": "^1.2.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
|
@ -180,7 +180,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/check": "^0.9.4",
|
||||
"@playwright/test": "^1.48.1",
|
||||
"@playwright/test": "^1.48.2",
|
||||
"@types/aria-query": "^5.0.4",
|
||||
"@types/common-ancestor-path": "^1.0.2",
|
||||
"@types/cssesc": "^3.0.2",
|
||||
|
@ -209,8 +209,8 @@
|
|||
"rehype-slug": "^6.0.0",
|
||||
"rehype-toc": "^3.0.2",
|
||||
"remark-code-titles": "^0.1.2",
|
||||
"rollup": "^4.24.0",
|
||||
"sass": "^1.80.3",
|
||||
"rollup": "^4.24.2",
|
||||
"sass": "^1.80.4",
|
||||
"undici": "^6.20.1",
|
||||
"unified": "^11.0.5",
|
||||
"vitest": "^2.1.1"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/react": "workspace:*",
|
||||
"@performance/utils": "workspace:*",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"@astrojs/markdoc": "workspace:*",
|
||||
"@astrojs/react": "workspace:*",
|
||||
"@performance/utils": "workspace:*",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"@astrojs/mdx": "workspace:*",
|
||||
"@astrojs/react": "workspace:*",
|
||||
"@performance/utils": "workspace:*",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
|
|
|
@ -106,7 +106,8 @@ async function handlePost({
|
|||
if (contentType && hasContentType(contentType, formContentTypes)) {
|
||||
formData = await request.clone().formData();
|
||||
}
|
||||
const action = baseAction.bind(context);
|
||||
const { getActionResult, callAction, props, redirect, ...actionAPIContext } = context;
|
||||
const action = baseAction.bind(actionAPIContext);
|
||||
const actionResult = await action(formData);
|
||||
|
||||
if (context.url.searchParams.get(ACTION_QUERY_PARAMS.actionRedirect) === 'false') {
|
||||
|
|
|
@ -27,7 +27,8 @@ export const POST: APIRoute = async (context) => {
|
|||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415
|
||||
return new Response(null, { status: 415 });
|
||||
}
|
||||
const action = baseAction.bind(context);
|
||||
const { getActionResult, callAction, props, redirect, ...actionAPIContext } = context;
|
||||
const action = baseAction.bind(actionAPIContext);
|
||||
const result = await action(args);
|
||||
const serialized = serializeActionResult(result);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export async function getAction(
|
|||
path: string,
|
||||
): Promise<ActionClient<unknown, ActionAccept, ZodType>> {
|
||||
const pathKeys = path
|
||||
.replace('/_actions/', '')
|
||||
.replace(/^.*\/_actions\//, '')
|
||||
.split('.')
|
||||
.map((key) => decodeURIComponent(key));
|
||||
// @ts-expect-error virtual module
|
||||
|
|
|
@ -84,7 +84,7 @@ function resolveCommand(flags: yargs.Arguments): CLICommand {
|
|||
'db',
|
||||
'info',
|
||||
'login',
|
||||
'loutout',
|
||||
'logout',
|
||||
'link',
|
||||
'init',
|
||||
]);
|
||||
|
|
|
@ -144,7 +144,13 @@ async function installPackage(
|
|||
await exec(
|
||||
installCommand.pm,
|
||||
[installCommand.command, ...installCommand.flags, ...installCommand.dependencies],
|
||||
{ nodeOptions: { cwd: cwd } },
|
||||
{
|
||||
nodeOptions: {
|
||||
cwd,
|
||||
// reset NODE_ENV to ensure install command run in dev mode
|
||||
env: { NODE_ENV: undefined },
|
||||
},
|
||||
},
|
||||
);
|
||||
spinner.success();
|
||||
|
||||
|
|
|
@ -490,8 +490,8 @@ export const PageNumberParamNotFound = {
|
|||
* @docs
|
||||
* @see
|
||||
* - [Images](https://docs.astro.build/en/guides/images/)
|
||||
* - [Image component](https://docs.astro.build/en/guides/images/#image--astroassets)
|
||||
* - [Image component#alt](https://docs.astro.build/en/guides/images/#alt-required)
|
||||
* - [Image component](https://docs.astro.build/en/reference/modules/astro-assets/#image-)
|
||||
* - [Image component#alt](https://docs.astro.build/en/reference/modules/astro-assets/#alt-required)
|
||||
* @description
|
||||
* The `alt` property allows you to provide descriptive alt text to users of screen readers and other assistive technologies. In order to ensure your images are accessible, the `Image` component requires that an `alt` be specified.
|
||||
*
|
||||
|
@ -525,9 +525,9 @@ export const InvalidImageService = {
|
|||
* Missing width and height attributes for `IMAGE_URL`. When using remote images, both dimensions are required in order to avoid cumulative layout shift (CLS).
|
||||
* @see
|
||||
* - [Images](https://docs.astro.build/en/guides/images/)
|
||||
* - [Image component#width-and-height-required](https://docs.astro.build/en/guides/images/#width-and-height-required-for-images-in-public)
|
||||
* - [Image component#width-and-height-required](https://docs.astro.build/en/reference/modules/astro-assets/#width-and-height-required-for-images-in-public)
|
||||
* @description
|
||||
* For remote images, `width` and `height` cannot automatically be inferred from the original file. To avoid cumulative layout shift (CLS), either specify these two properties, or set [`inferSize`](https://docs.astro.build/en/guides/images/#infersize) to `true` to fetch a remote image's original dimensions.
|
||||
* For remote images, `width` and `height` cannot automatically be inferred from the original file. To avoid cumulative layout shift (CLS), either specify these two properties, or set [`inferSize`](https://docs.astro.build/en/reference/modules/astro-assets/#infersize) to `true` to fetch a remote image's original dimensions.
|
||||
*
|
||||
* If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets).
|
||||
*/
|
||||
|
@ -980,7 +980,6 @@ export const InvalidDynamicRoute = {
|
|||
* @docs
|
||||
* @see
|
||||
* - [Default Image Service](https://docs.astro.build/en/guides/images/#default-image-service)
|
||||
* - [Image Component](https://docs.astro.build/en/guides/images/#image--astroassets)
|
||||
* - [Image Services API](https://docs.astro.build/en/reference/image-service-reference/)
|
||||
* @description
|
||||
* Sharp is the default image service used for `astro:assets`. When using a [strict package manager](https://pnpm.io/pnpm-vs-npm#npms-flat-tree) like pnpm, Sharp must be installed manually into your project in order to use image processing.
|
||||
|
|
|
@ -21,9 +21,8 @@ export function vitePluginMiddleware({ settings }: { settings: AstroSettings }):
|
|||
|
||||
return {
|
||||
name: '@astro/plugin-middleware',
|
||||
config(opts, { command }) {
|
||||
config(_, { command }) {
|
||||
isCommandBuild = command === 'build';
|
||||
return opts;
|
||||
},
|
||||
async resolveId(id) {
|
||||
if (id === MIDDLEWARE_MODULE_ID) {
|
||||
|
|
|
@ -75,6 +75,12 @@ export function validateSupportedFeatures(
|
|||
return settings.config?.output === 'server' && !settings.config?.site;
|
||||
},
|
||||
);
|
||||
if (adapterFeatures?.functionPerRoute) {
|
||||
logger.error(
|
||||
'config',
|
||||
'The Astro feature `i18nDomains` is incompatible with the Adapter feature `functionPerRoute`',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
validationResult.envGetSecret = validateSupportKind(
|
||||
|
|
|
@ -27,10 +27,10 @@ export interface MarkdownInstance<T extends Record<string, any>> {
|
|||
default: AstroComponentFactory;
|
||||
}
|
||||
|
||||
export type MDXInstance<T extends Record<string, any>> = Omit<
|
||||
MarkdownInstance<T>,
|
||||
'rawContent' | 'compiledContent'
|
||||
>;
|
||||
export interface MDXInstance<T extends Record<string, any>>
|
||||
extends Omit<MarkdownInstance<T>, 'rawContent' | 'compiledContent'> {
|
||||
components: Record<string, AstroComponentFactory> | undefined;
|
||||
}
|
||||
|
||||
export interface MarkdownLayoutProps<T extends Record<string, any>> {
|
||||
frontmatter: {
|
||||
|
@ -44,10 +44,10 @@ export interface MarkdownLayoutProps<T extends Record<string, any>> {
|
|||
compiledContent: MarkdownInstance<T>['compiledContent'];
|
||||
}
|
||||
|
||||
export type MDXLayoutProps<T extends Record<string, any>> = Omit<
|
||||
MarkdownLayoutProps<T>,
|
||||
'rawContent' | 'compiledContent'
|
||||
>;
|
||||
export interface MDXLayoutProps<T extends Record<string, any>>
|
||||
extends Omit<MarkdownLayoutProps<T>, 'rawContent' | 'compiledContent'> {
|
||||
components: MDXInstance<T>['components'];
|
||||
}
|
||||
|
||||
export type ContentEntryModule = {
|
||||
id: string;
|
||||
|
|
|
@ -92,7 +92,7 @@ async function handleAction(param, path, context) {
|
|||
headers.set('Content-Length', '0');
|
||||
}
|
||||
}
|
||||
const rawResult = await fetch(`/_actions/${path}`, {
|
||||
const rawResult = await fetch(`${import.meta.env.BASE_URL.replace(/\/$/, '')}/_actions/${path}`, {
|
||||
method: 'POST',
|
||||
body,
|
||||
headers,
|
||||
|
|
|
@ -466,6 +466,30 @@ describe('Astro Actions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('Base path should be used', async () => {
|
||||
const fixture = await loadFixture({
|
||||
root: './fixtures/actions/',
|
||||
adapter: testAdapter(),
|
||||
base: '/base',
|
||||
});
|
||||
const devServer = await fixture.startDevServer();
|
||||
const formData = new FormData();
|
||||
formData.append('channel', 'bholmesdev');
|
||||
formData.append('comment', 'Hello, World!');
|
||||
const res = await fixture.fetch('/base/_actions/comment', {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
});
|
||||
|
||||
assert.equal(res.ok, true);
|
||||
assert.equal(res.headers.get('Content-Type'), 'application/json+devalue');
|
||||
|
||||
const data = devalue.parse(await res.text());
|
||||
assert.equal(data.channel, 'bholmesdev');
|
||||
assert.equal(data.comment, 'Hello, World!');
|
||||
await devServer.stop();
|
||||
});
|
||||
|
||||
/**
|
||||
* Follow an expected redirect response.
|
||||
*
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import { before, describe, it } from 'node:test';
|
||||
import * as cheerio from 'cheerio';
|
||||
import { resolveConfig } from 'vite';
|
||||
import { getViteConfig } from '../dist/config/index.js';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
|
||||
describe('Vite Config', async () => {
|
||||
|
@ -21,3 +23,14 @@ describe('Vite Config', async () => {
|
|||
assert.match($('link').attr('href'), /\/assets\/testing-[a-z\d]+\.css/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getViteConfig', () => {
|
||||
it('Does not change the default config.', async () => {
|
||||
const command = 'serve';
|
||||
const mode = 'test';
|
||||
const configFn = getViteConfig({});
|
||||
const config = await configFn({ command, mode });
|
||||
const resolvedConfig = await resolveConfig(config, command, mode);
|
||||
assert.deepStrictEqual(resolvedConfig.resolve.conditions, ['astro']);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
"dependencies": {
|
||||
"@astrojs/solid-js": "workspace:*",
|
||||
"astro": "workspace:*",
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
"astro": "workspace:*",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"postcss": "^8.4.47",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"svelte": "^4.2.19",
|
||||
"vue": "^3.5.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"postcss-preset-env": "^10.0.7"
|
||||
"postcss-preset-env": "^10.0.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
"astro": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"@astrojs/mdx": "workspace:*",
|
||||
"@astrojs/solid-js": "workspace:*",
|
||||
"astro": "workspace:*",
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
"@solidjs/router": "^0.14.10",
|
||||
"@test/solid-jsx-component": "file:./deps/solid-jsx-component",
|
||||
"astro": "workspace:*",
|
||||
"solid-js": "^1.9.2"
|
||||
"solid-js": "^1.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/react": "workspace:*",
|
||||
"@test/ssr-prerender-chunks-test-adapter": "link:./deps/test-adapter",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"private": true,
|
||||
"dependencies": {
|
||||
"astro": "workspace:*",
|
||||
"astro-embed": "^0.7.4"
|
||||
"astro-embed": "^0.8.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
"//b": "DEPENDENCIES IS FOR UNBUNDLED PACKAGES",
|
||||
"dependencies": {
|
||||
"@astrojs/cli-kit": "^0.4.1",
|
||||
"@bluwy/giget-core": "^0.1.0"
|
||||
"@bluwy/giget-core": "^0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"arg": "^5.0.2",
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
"drizzle-orm": "^0.31.2",
|
||||
"github-slugger": "^2.0.0",
|
||||
"kleur": "^4.1.5",
|
||||
"nanoid": "^5.0.7",
|
||||
"nanoid": "^5.0.8",
|
||||
"open": "^10.1.0",
|
||||
"prompts": "^2.4.2",
|
||||
"yargs-parser": "^21.1.1",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"@astrojs/db": "workspace:*",
|
||||
"@astrojs/node": "^8.3.4",
|
||||
"@astrojs/react": "^3.6.2",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"open-props": "^1.7.7",
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
"alpinejs": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "1.48.1",
|
||||
"@playwright/test": "1.48.2",
|
||||
"astro": "workspace:*",
|
||||
"astro-scripts": "workspace:*",
|
||||
"vite": "6.0.0-beta.2"
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
- astro@5.0.0-alpha.0
|
||||
- @astrojs/markdown-remark@6.0.0-alpha.0
|
||||
|
||||
## 3.1.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#12245](https://github.com/withastro/astro/pull/12245) [`1d4f6a4`](https://github.com/withastro/astro/commit/1d4f6a4989bc1cfd7109b1bff41503f115660e02) Thanks [@bmenant](https://github.com/bmenant)! - Add `components` property to MDXInstance type definition (RenderResult and module import)
|
||||
|
||||
## 3.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/markdown-remark": "workspace:*",
|
||||
"@mdx-js/mdx": "^3.1.0",
|
||||
"acorn": "^8.13.0",
|
||||
"acorn": "^8.14.0",
|
||||
"es-module-lexer": "^1.5.4",
|
||||
"estree-util-visit": "^2.0.0",
|
||||
"hast-util-to-html": "^9.0.3",
|
||||
|
@ -68,7 +68,7 @@
|
|||
"remark-rehype": "^11.1.1",
|
||||
"remark-shiki-twoslash": "^3.1.3",
|
||||
"remark-toc": "^9.0.0",
|
||||
"shiki": "^1.22.0",
|
||||
"shiki": "^1.22.2",
|
||||
"unified": "^11.0.5",
|
||||
"vite": "6.0.0-beta.2"
|
||||
},
|
||||
|
|
|
@ -4,6 +4,7 @@ declare module 'astro:content' {
|
|||
Content: import('astro').MarkdownInstance<{}>['Content'];
|
||||
headings: import('astro').MarkdownHeading[];
|
||||
remarkPluginFrontmatter: Record<string, any>;
|
||||
components: import('astro').MDXInstance<{}>['components'];
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
"dev": "astro-scripts dev \"src/**/*.ts\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/plugin-transform-react-jsx": "^7.25.7",
|
||||
"@babel/plugin-transform-react-jsx-development": "^7.25.7",
|
||||
"@babel/plugin-transform-react-jsx": "^7.25.9",
|
||||
"@babel/plugin-transform-react-jsx-development": "^7.25.9",
|
||||
"@preact/preset-vite": "2.8.2",
|
||||
"@preact/signals": "^1.3.0",
|
||||
"babel-plugin-transform-hook-names": "^1.0.2",
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
"ultrahtml": "^1.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "workspace:*",
|
||||
"astro-scripts": "workspace:*",
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
"devDependencies": {
|
||||
"astro": "workspace:*",
|
||||
"astro-scripts": "workspace:*",
|
||||
"solid-js": "^1.9.2",
|
||||
"solid-js": "^1.9.3",
|
||||
"vite": "6.0.0-beta.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
"@vitejs/plugin-vue": "^5.1.4",
|
||||
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
||||
"@vue/compiler-sfc": "^3.5.12",
|
||||
"vite-plugin-vue-devtools": "^7.5.2"
|
||||
"vite-plugin-vue-devtools": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "workspace:*",
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
"test": "astro-scripts test --timeout 50000 \"test/**/*.test.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"web-vitals": "^4.2.3"
|
||||
"web-vitals": "^4.2.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@astrojs/db": "^0.14.0-beta.1"
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"remark-parse": "^11.0.0",
|
||||
"remark-rehype": "^11.1.1",
|
||||
"remark-smartypants": "^3.0.2",
|
||||
"shiki": "^1.22.0",
|
||||
"shiki": "^1.22.2",
|
||||
"unified": "^11.0.5",
|
||||
"unist-util-remove-position": "^5.0.0",
|
||||
"unist-util-visit": "^5.0.0",
|
||||
|
|
1953
pnpm-lock.yaml
generated
1953
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue