Skip to content

Commit

Permalink
Merge branch 'main' into fix-server-island-static
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Jan 16, 2025
2 parents b0888ed + df90e6d commit dd1239a
Show file tree
Hide file tree
Showing 70 changed files with 468 additions and 209 deletions.
7 changes: 0 additions & 7 deletions .changeset/cyan-panthers-count.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/heavy-fireants-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a bug that caused references to be incorrectly reported as invalid
5 changes: 5 additions & 0 deletions .changeset/kind-horses-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a bug in dev where files would stop being watched if the Astro config file was edited
5 changes: 5 additions & 0 deletions .changeset/large-cherries-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a bug where the content layer would use an outdated version of the Astro config if it was edited in dev
5 changes: 0 additions & 5 deletions .changeset/nasty-pandas-unite.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/purple-swans-argue.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/strong-games-travel.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/twenty-cherries-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a bug that caused the dev server to return an error if requesting "//"
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
4 changes: 2 additions & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.0.5",
"@astrojs/mdx": "^4.0.6",
"@astrojs/rss": "^4.0.11",
"@astrojs/sitemap": "^3.2.1",
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.1.6"
"astro": "^5.1.7"
},
"peerDependencies": {
"astro": "^4.0.0 || ^5.0.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"test": "vitest run"
},
"dependencies": {
"@astrojs/react": "^4.1.4",
"astro": "^5.1.6",
"@astrojs/react": "^4.1.5",
"astro": "^5.1.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^3.0.0-beta.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"@astrojs/alpinejs": "^0.4.1",
"@types/alpinejs": "^3.13.11",
"alpinejs": "^3.14.8",
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
10 changes: 5 additions & 5 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^4.0.1",
"@astrojs/react": "^4.1.4",
"@astrojs/solid-js": "^5.0.2",
"@astrojs/preact": "^4.0.2",
"@astrojs/react": "^4.1.5",
"@astrojs/solid-js": "^5.0.3",
"@astrojs/svelte": "^7.0.3",
"@astrojs/vue": "^5.0.4",
"@astrojs/vue": "^5.0.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"astro": "^5.1.6",
"astro": "^5.1.7",
"preact": "^10.25.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^4.0.1",
"@astrojs/preact": "^4.0.2",
"@preact/signals": "^2.0.1",
"astro": "^5.1.6",
"astro": "^5.1.7",
"preact": "^10.25.4"
}
}
4 changes: 2 additions & 2 deletions examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^4.1.4",
"@astrojs/react": "^4.1.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"astro": "^5.1.6",
"astro": "^5.1.7",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/solid-js": "^5.0.2",
"astro": "^5.1.6",
"@astrojs/solid-js": "^5.0.3",
"astro": "^5.1.7",
"solid-js": "^1.9.4"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@astrojs/svelte": "^7.0.3",
"astro": "^5.1.6",
"astro": "^5.1.7",
"svelte": "^5.17.3"
}
}
4 changes: 2 additions & 2 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vue": "^5.0.4",
"astro": "^5.1.6",
"@astrojs/vue": "^5.0.5",
"astro": "^5.1.7",
"vue": "^3.5.13"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},
"dependencies": {
"@astrojs/node": "^9.0.0",
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.1.6"
"astro": "^5.1.7"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/node": "^9.0.0",
"@astrojs/svelte": "^7.0.3",
"astro": "^5.1.6",
"astro": "^5.1.7",
"svelte": "^5.17.3"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.1.6",
"astro": "^5.1.7",
"sass": "^1.83.1",
"sharp": "^0.33.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"devDependencies": {
"@types/node": "^18.17.8",
"astro": "^5.1.6"
"astro": "^5.1.7"
}
}
4 changes: 2 additions & 2 deletions examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/markdoc": "^0.12.5",
"astro": "^5.1.6"
"@astrojs/markdoc": "^0.12.6",
"astro": "^5.1.7"
}
}
6 changes: 3 additions & 3 deletions examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.0.5",
"@astrojs/preact": "^4.0.1",
"astro": "^5.1.6",
"@astrojs/mdx": "^4.0.6",
"@astrojs/preact": "^4.0.2",
"astro": "^5.1.7",
"preact": "^10.25.4"
}
}
4 changes: 2 additions & 2 deletions examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^4.0.1",
"@astrojs/preact": "^4.0.2",
"@nanostores/preact": "^0.5.2",
"astro": "^5.1.6",
"astro": "^5.1.7",
"nanostores": "^0.11.3",
"preact": "^10.25.4"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.0.5",
"@astrojs/mdx": "^4.0.6",
"@astrojs/tailwind": "^5.1.4",
"@types/canvas-confetti": "^1.9.0",
"astro": "^5.1.6",
"astro": "^5.1.7",
"autoprefixer": "^10.4.20",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.49",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^5.1.6",
"astro": "^5.1.7",
"vitest": "^3.0.0-beta.4"
}
}
13 changes: 13 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# astro

## 5.1.7

### Patch Changes

- [#12361](https://github.com/withastro/astro/pull/12361) [`3d89e62`](https://github.com/withastro/astro/commit/3d89e6282235a8da45d9ddfe02bcf7ec78056941) Thanks [@LunaticMuch](https://github.com/LunaticMuch)! - Upgrades the `esbuild` version to match `vite`

- [#12980](https://github.com/withastro/astro/pull/12980) [`1a026af`](https://github.com/withastro/astro/commit/1a026afb427cd4b472c8f1174a08f10086f4fb89) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where setting the status of a page to `404` in development would show the default 404 page (or custom one if provided) instead of using the current page

- [#12182](https://github.com/withastro/astro/pull/12182) [`c30070b`](https://github.com/withastro/astro/commit/c30070b9271e4c494e7cbf3a1c45515782034911) Thanks [@braden-w](https://github.com/braden-w)! - Improves matching of 404 and 500 routes

- Updated dependencies [[`3d89e62`](https://github.com/withastro/astro/commit/3d89e6282235a8da45d9ddfe02bcf7ec78056941)]:
- @astrojs/markdown-remark@6.0.2

## 5.1.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "5.1.6",
"version": "5.1.7",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down
14 changes: 12 additions & 2 deletions packages/astro/src/content/content-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
globalContentConfigObserver,
safeStringify,
} from './utils.js';
import { type WrappedWatcher, createWatcherWrapper } from './watcher.js';

export interface ContentLayerOptions {
store: MutableDataStore;
Expand All @@ -34,7 +35,7 @@ export class ContentLayer {
#logger: Logger;
#store: MutableDataStore;
#settings: AstroSettings;
#watcher?: FSWatcher;
#watcher?: WrappedWatcher;
#lastConfigDigest?: string;
#unsubscribe?: () => void;

Expand All @@ -49,7 +50,9 @@ export class ContentLayer {
this.#logger = logger;
this.#store = store;
this.#settings = settings;
this.#watcher = watcher;
if (watcher) {
this.#watcher = createWatcherWrapper(watcher);
}
this.#queue = new PQueue({ concurrency: 1 });
}

Expand Down Expand Up @@ -79,6 +82,7 @@ export class ContentLayer {
dispose() {
this.#queue.clear();
this.#unsubscribe?.();
this.#watcher?.removeAllTrackedListeners();
}

async #getGenerateDigest() {
Expand Down Expand Up @@ -213,6 +217,12 @@ export class ContentLayer {
if (astroConfigDigest) {
await this.#store.metaStore().set('astro-config-digest', astroConfigDigest);
}

if (!options?.loaders?.length) {
// Remove all listeners before syncing, as they will be re-added by the loaders, but not if this is a selective sync
this.#watcher?.removeAllTrackedListeners();
}

await Promise.all(
Object.entries(contentConfig.config.collections).map(async ([name, collection]) => {
if (collection.type !== CONTENT_LAYER_TYPE) {
Expand Down
2 changes: 2 additions & 0 deletions packages/astro/src/content/loaders/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export function file(fileName: string, options?: FileOptions): Loader {

await syncData(filePath, context);

watcher?.add(filePath);

watcher?.on('change', async (changedPath) => {
if (changedPath === filePath) {
logger.info(`Reloading data from ${fileName}`);
Expand Down
2 changes: 2 additions & 0 deletions packages/astro/src/content/loaders/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ export function glob(globOptions: GlobOptions): Loader {
return;
}

watcher.add(filePath);

const matchesGlob = (entry: string) =>
!entry.startsWith('../') && micromatch.isMatch(entry, globOptions.pattern);

Expand Down
Loading

0 comments on commit dd1239a

Please sign in to comment.