summaryrefslogtreecommitdiff
path: root/packages/astro
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro')
-rw-r--r--packages/astro/CHANGELOG.md65
-rw-r--r--packages/astro/client.d.ts3
-rw-r--r--packages/astro/package.json2
-rw-r--r--packages/astro/performance/content-benchmark.mjs8
-rw-r--r--packages/astro/src/core/build/plugins/plugin-css.ts4
-rw-r--r--packages/astro/src/core/config/tsconfig.ts16
-rw-r--r--packages/astro/src/core/dev/dev.ts1
-rw-r--r--packages/astro/src/core/errors/utils.ts5
-rw-r--r--packages/astro/src/core/logger/core.ts8
-rw-r--r--packages/astro/src/core/messages.ts1
-rw-r--r--packages/astro/src/core/render/route-cache.ts5
-rw-r--r--packages/astro/src/runtime/server/render/common.ts4
-rw-r--r--packages/astro/src/runtime/server/transition.ts4
-rw-r--r--packages/astro/src/transitions/router.ts4
14 files changed, 95 insertions, 35 deletions
diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md
index 08eb25405..598a18177 100644
--- a/packages/astro/CHANGELOG.md
+++ b/packages/astro/CHANGELOG.md
@@ -1,5 +1,70 @@
# astro
+## 4.0.0-beta.0
+
+### Major Changes
+
+- [#9138](https://github.com/withastro/astro/pull/9138) [`abf601233`](https://github.com/withastro/astro/commit/abf601233f8188d118a8cb063c777478d8d9f1a3) Thanks [@bluwy](https://github.com/bluwy)! - Updates the unified, remark, and rehype dependencies to latest. Make sure to update your custom remark and rehype plugins as well to be compatible with the latest versions.
+
+ **Potentially breaking change:** The default value of `markdown.remarkRehype.footnoteBackLabel` is changed from `"Back to content"` to `"Back to reference 1"`. See the `mdast-util-to-hast` [commit](https://github.com/syntax-tree/mdast-util-to-hast/commit/56c88e45690be138fad9f0bf367b939d09816863) for more information.
+
+- [#9181](https://github.com/withastro/astro/pull/9181) [`cdabf6ef0`](https://github.com/withastro/astro/commit/cdabf6ef02be7220fd2b6bdcef924ceca089381e) Thanks [@bluwy](https://github.com/bluwy)! - Removes support for returning simple objects from endpoints (deprecated since Astro 3.0). You should return a `Response` instead.
+
+ `ResponseWithEncoding` is also removed. You can refactor the code to return a response with an array buffer instead, which is encoding agnostic.
+
+ The types for middlewares have also been revised. To type a middleware function, you should now use `MiddlewareHandler` instead of `MiddlewareResponseHandler`. If you used `defineMiddleware()` to type the function, no changes are needed.
+
+- [#9122](https://github.com/withastro/astro/pull/9122) [`1c48ed286`](https://github.com/withastro/astro/commit/1c48ed286538ab9e354eca4e4dcd7c6385c96721) Thanks [@bluwy](https://github.com/bluwy)! - Adds Vite 5 support. There are no breaking changes from Astro. Check the [Vite migration guide](https://vitejs.dev/guide/migration.html) for details of the breaking changes from Vite instead.
+
+- [#9196](https://github.com/withastro/astro/pull/9196) [`37697a2c5`](https://github.com/withastro/astro/commit/37697a2c5511572dc29c0a4ea46f90c2f62be8e6) Thanks [@bluwy](https://github.com/bluwy)! - Removes support for Shiki custom language's `path` property. The language JSON file should be imported and passed to the option instead.
+
+ ```diff
+ // astro.config.js
+ + import customLang from './custom.tmLanguage.json'
+
+ export default defineConfig({
+ markdown: {
+ shikiConfig: {
+ langs: [
+ - { path: './custom.tmLanguage.json' },
+ + customLang,
+ ],
+ },
+ },
+ })
+ ```
+
+- [#9168](https://github.com/withastro/astro/pull/9168) [`153a5abb9`](https://github.com/withastro/astro/commit/153a5abb905042ac68b712514dc9ec387d3e6b17) Thanks [@bluwy](https://github.com/bluwy)! - Removes deprecated features from Astro 3.0
+
+ - Adapters are now required to pass `supportedAstroFeatures` to specify a list of features they support.
+ - The `build.split` and `build.excludeMiddleware` options are removed. Use `functionPerRoute` and `edgeMiddleware` from adapters instead.
+ - The `markdown.drafts` option and draft feature is removed. Use content collections instead.
+ - Lowercase endpoint names are no longer supported. Use uppercase endpoint names instead.
+ - `getHeaders()` exported from markdown files is removed. Use `getHeadings()` instead.
+
+### Minor Changes
+
+- [#9105](https://github.com/withastro/astro/pull/9105) [`6201bbe96`](https://github.com/withastro/astro/commit/6201bbe96c2a083fb201e4a43a9bd88499821a3e) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Update CLI logging experience
+
+- [#9161](https://github.com/withastro/astro/pull/9161) [`bd0c2e9ae`](https://github.com/withastro/astro/commit/bd0c2e9ae3389a9d3085050c1e8134ae98dff299) Thanks [@bluwy](https://github.com/bluwy)! - Renames the `entryPoint` property of the `injectRoute` integrations API to `entrypoint` for consistency. A warning will be shown prompting you to update your code when using the old name.
+
+### Patch Changes
+
+- [#9149](https://github.com/withastro/astro/pull/9149) [`0fe3a7ed5`](https://github.com/withastro/astro/commit/0fe3a7ed5d7bb1a9fce1623e84ba14104b51223c) Thanks [@bluwy](https://github.com/bluwy)! - Removes vendored Vite's `importMeta.d.ts` file in favour of Vite 5's new `vite/types/import-meta.d.ts` export
+
+- [#9150](https://github.com/withastro/astro/pull/9150) [`710be505c`](https://github.com/withastro/astro/commit/710be505c9ddf416e77a75343d8cae9c497d72c6) Thanks [@bluwy](https://github.com/bluwy)! - Refactors virtual modules exports. This should not break your project unless you import Astro's internal modules, including:
+
+ - `astro/middleware/namespace`
+ - `astro/transitions`
+ - `astro/transitions/router`
+ - `astro/transitions/events`
+ - `astro/transitions/types`
+ - `astro/prefetch`
+ - `astro/i18n`
+
+- Updated dependencies [[`abf601233`](https://github.com/withastro/astro/commit/abf601233f8188d118a8cb063c777478d8d9f1a3), [`addb57c8e`](https://github.com/withastro/astro/commit/addb57c8e80b7b67ec61224666f3a1db5c44410c), [`c7953645e`](https://github.com/withastro/astro/commit/c7953645eeaaf9e87c6db4494b0023d2c1878ff0)]:
+ - @astrojs/markdown-remark@4.0.0-beta.0
+
## 3.6.1
### Patch Changes
diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts
index 7cec06066..c3a7652ec 100644
--- a/packages/astro/client.d.ts
+++ b/packages/astro/client.d.ts
@@ -126,7 +126,8 @@ declare module 'astro:transitions/client' {
export type Fallback = import('./dist/virtual-modules/transitions-types.js').Fallback;
export type Direction = import('./dist/virtual-modules/transitions-types.ts').Direction;
- export type NavigationTypeString = import('./dist/virtual-modules/transitions-types.js').NavigationTypeString;
+ export type NavigationTypeString =
+ import('./dist/virtual-modules/transitions-types.js').NavigationTypeString;
export type Options = import('./dist/virtual-modules/transitions-types.js').Options;
type EventModule = typeof import('./dist/virtual-modules/transitions-events.js');
diff --git a/packages/astro/package.json b/packages/astro/package.json
index 87558862d..3fd299e2a 100644
--- a/packages/astro/package.json
+++ b/packages/astro/package.json
@@ -1,6 +1,6 @@
{
"name": "astro",
- "version": "3.6.1",
+ "version": "4.0.0-beta.0",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
diff --git a/packages/astro/performance/content-benchmark.mjs b/packages/astro/performance/content-benchmark.mjs
index 14f9b598e..c2d1d6918 100644
--- a/packages/astro/performance/content-benchmark.mjs
+++ b/packages/astro/performance/content-benchmark.mjs
@@ -44,14 +44,14 @@ async function benchmark({ fixtures, templates, numPosts }) {
const test = Array.isArray(flags.test)
? flags.test
: typeof flags.test === 'string'
- ? [flags.test]
- : ['simple', 'with-astro-components', 'with-react-components'];
+ ? [flags.test]
+ : ['simple', 'with-astro-components', 'with-react-components'];
const formats = Array.isArray(flags.format)
? flags.format
: typeof flags.format === 'string'
- ? [flags.format]
- : ['md', 'mdx', 'mdoc'];
+ ? [flags.format]
+ : ['md', 'mdx', 'mdoc'];
const numPosts = flags.numPosts || 1000;
diff --git a/packages/astro/src/core/build/plugins/plugin-css.ts b/packages/astro/src/core/build/plugins/plugin-css.ts
index f8611898f..318a1fee5 100644
--- a/packages/astro/src/core/build/plugins/plugin-css.ts
+++ b/packages/astro/src/core/build/plugins/plugin-css.ts
@@ -223,8 +223,8 @@ function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[] {
inlineConfig === 'always'
? true
: inlineConfig === 'never'
- ? false
- : assetSize <= assetsInlineLimit;
+ ? false
+ : assetSize <= assetsInlineLimit;
// there should be a single js object for each stylesheet,
// allowing the single reference to be shared and checked for duplicates
diff --git a/packages/astro/src/core/config/tsconfig.ts b/packages/astro/src/core/config/tsconfig.ts
index db4b1392f..3375be9c8 100644
--- a/packages/astro/src/core/config/tsconfig.ts
+++ b/packages/astro/src/core/config/tsconfig.ts
@@ -162,14 +162,14 @@ export type StripEnums<T extends Record<string, any>> = {
[K in keyof T]: T[K] extends boolean
? T[K]
: T[K] extends string
- ? T[K]
- : T[K] extends object
- ? T[K]
- : T[K] extends Array<any>
- ? T[K]
- : T[K] extends undefined
- ? undefined
- : any;
+ ? T[K]
+ : T[K] extends object
+ ? T[K]
+ : T[K] extends Array<any>
+ ? T[K]
+ : T[K] extends undefined
+ ? undefined
+ : any;
};
export interface TSConfig {
diff --git a/packages/astro/src/core/dev/dev.ts b/packages/astro/src/core/dev/dev.ts
index f8db6647e..980b93463 100644
--- a/packages/astro/src/core/dev/dev.ts
+++ b/packages/astro/src/core/dev/dev.ts
@@ -43,7 +43,6 @@ export default async function dev(inlineConfig: AstroInlineConfig): Promise<DevS
base: restart.container.settings.config.base,
})
);
-
const currentVersion = process.env.PACKAGE_VERSION ?? '0.0.0';
if (currentVersion.includes('-')) {
diff --git a/packages/astro/src/core/errors/utils.ts b/packages/astro/src/core/errors/utils.ts
index 300787dd3..ef0a10b4f 100644
--- a/packages/astro/src/core/errors/utils.ts
+++ b/packages/astro/src/core/errors/utils.ts
@@ -93,9 +93,8 @@ export function createSafeError(err: any): Error {
} else {
const error = new Error(JSON.stringify(err));
- (
- error as SSRError
- ).hint = `To get as much information as possible from your errors, make sure to throw Error objects instead of \`${typeof err}\`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error for more information.`;
+ (error as SSRError).hint =
+ `To get as much information as possible from your errors, make sure to throw Error objects instead of \`${typeof err}\`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error for more information.`;
return error;
}
diff --git a/packages/astro/src/core/logger/core.ts b/packages/astro/src/core/logger/core.ts
index 5d617a1a2..2c26a55a0 100644
--- a/packages/astro/src/core/logger/core.ts
+++ b/packages/astro/src/core/logger/core.ts
@@ -8,10 +8,10 @@ export interface LogWritable<T> {
export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'; // same as Pino
/**
- * Defined logger labels. Add more as needed, but keep them high-level & reusable,
- * rather than specific to a single command, function, use, etc. The label will be
+ * Defined logger labels. Add more as needed, but keep them high-level & reusable,
+ * rather than specific to a single command, function, use, etc. The label will be
* shown in the log message to the user, so it should be relevant.
- */
+ */
export type LoggerLabel =
| 'add'
| 'build'
@@ -122,7 +122,7 @@ function padStr(str: string, len: number) {
}
/**
- * Get the prefix for a log message.
+ * Get the prefix for a log message.
* This includes the timestamp, log level, and label all properly formatted
* with colors. This is shared across different loggers, so it's defined here.
*/
diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts
index 7c1d663c5..21c57ef6b 100644
--- a/packages/astro/src/core/messages.ts
+++ b/packages/astro/src/core/messages.ts
@@ -187,7 +187,6 @@ export function formatConfigErrorMessage(err: ZodError) {
)}`;
}
-
export function formatErrorMessage(err: ErrorWithMetadata, args: string[] = []): string {
const isOurError = AstroError.is(err) || CompilerError.is(err) || AstroUserError.is(err);
diff --git a/packages/astro/src/core/render/route-cache.ts b/packages/astro/src/core/render/route-cache.ts
index 322326957..8aca230f4 100644
--- a/packages/astro/src/core/render/route-cache.ts
+++ b/packages/astro/src/core/render/route-cache.ts
@@ -107,10 +107,7 @@ export class RouteCache {
// Warn here so that an unexpected double-call of getStaticPaths()
// isn't invisible and developer can track down the issue.
if (this.mode === 'production' && this.cache[route.component]?.staticPaths) {
- this.logger.warn(
- null,
- `Internal Warning: route cache overwritten. (${route.component})`
- );
+ this.logger.warn(null, `Internal Warning: route cache overwritten. (${route.component})`);
}
this.cache[route.component] = entry;
}
diff --git a/packages/astro/src/runtime/server/render/common.ts b/packages/astro/src/runtime/server/render/common.ts
index e5a5d5e86..4087ef1a7 100644
--- a/packages/astro/src/runtime/server/render/common.ts
+++ b/packages/astro/src/runtime/server/render/common.ts
@@ -67,8 +67,8 @@ function stringifyChunk(
let prescriptType: PrescriptType = needsHydrationScript
? 'both'
: needsDirectiveScript
- ? 'directive'
- : null;
+ ? 'directive'
+ : null;
if (prescriptType) {
let prescripts = getPrescripts(result, prescriptType, hydration.directive);
return markHTMLString(prescripts);
diff --git a/packages/astro/src/runtime/server/transition.ts b/packages/astro/src/runtime/server/transition.ts
index d38a0eac6..0fed017df 100644
--- a/packages/astro/src/runtime/server/transition.ts
+++ b/packages/astro/src/runtime/server/transition.ts
@@ -145,8 +145,8 @@ class ViewTransitionStyleSheet {
direction === 'backwards'
? `[data-astro-transition=back]`
: direction === 'forwards'
- ? ''
- : `[data-astro-transition=${direction}]`;
+ ? ''
+ : `[data-astro-transition=${direction}]`;
this.addRule('modern', `${prefix}::view-transition-${image}(${name}) { ${animation} }`);
this.addRule(
'fallback',
diff --git a/packages/astro/src/transitions/router.ts b/packages/astro/src/transitions/router.ts
index 6ff0efc01..92d8bb4a2 100644
--- a/packages/astro/src/transitions/router.ts
+++ b/packages/astro/src/transitions/router.ts
@@ -426,8 +426,8 @@ async function transition(
const navigationType = historyState
? 'traverse'
: options.history === 'replace'
- ? 'replace'
- : 'push';
+ ? 'replace'
+ : 'push';
if (samePage(from, to) && !options.formData /* not yet: && to.hash*/) {
if (navigationType !== 'traverse') {