diff --git a/.changeset/afraid-sloths-shake.md b/.changeset/afraid-sloths-shake.md
new file mode 100644
index 000000000000..98c8efb37206
--- /dev/null
+++ b/.changeset/afraid-sloths-shake.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Improves warning logs for invalid content collection configuration
diff --git a/.changeset/config.json b/.changeset/config.json
index 8292fbe07858..030941db2347 100644
--- a/.changeset/config.json
+++ b/.changeset/config.json
@@ -1,10 +1,12 @@
{
- "$schema": "https://unpkg.com/@changesets/config@1.7.0/schema.json",
+ "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "withastro/astro" }],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
- "ignore": ["@example/*", "@test/*"]
+ "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
+ "onlyUpdatePeerDependentsWhenOutOfRange": true
+ }
}
diff --git a/.changeset/pretty-pumpkins-work.md b/.changeset/pretty-pumpkins-work.md
deleted file mode 100644
index 40d19f5cd65d..000000000000
--- a/.changeset/pretty-pumpkins-work.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'astro': patch
----
-
-Fixes an issue that was breaking asset and stylesheet URLs when building for a subpath
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 000000000000..49a76b9a5b3c
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,13 @@
+FROM mcr.microsoft.com/devcontainers/javascript-node:1-18
+
+# Install playwright
+RUN npm install -g @playwright/test
+
+# Install latest pnpm
+RUN npm install -g pnpm
+
+RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+ && curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_$(dpkg --print-architecture).deb -o /tmp/chrome.deb \
+ && apt-get -y install /tmp/chrome.deb
+
+COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
\ No newline at end of file
diff --git a/.devcontainer/basics/devcontainer.json b/.devcontainer/basics/devcontainer.json
new file mode 100644
index 000000000000..bb1707ff063b
--- /dev/null
+++ b/.devcontainer/basics/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Basics",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/basics",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/blog/devcontainer.json b/.devcontainer/blog/devcontainer.json
new file mode 100644
index 000000000000..d587fead507d
--- /dev/null
+++ b/.devcontainer/blog/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Blog",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/blog",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/component/devcontainer.json b/.devcontainer/component/devcontainer.json
new file mode 100644
index 000000000000..c2d3e50c3545
--- /dev/null
+++ b/.devcontainer/component/devcontainer.json
@@ -0,0 +1,21 @@
+{
+ "name": "Component Template",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/component",
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/MyComponent.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000000..6b8edf60573c
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,27 @@
+{
+ "name": "Contribute to Astro",
+ "build": {
+ "dockerfile": "Dockerfile"
+ },
+
+ "features": {
+ "ghcr.io/devcontainers/features/desktop-lite:1": {}
+ },
+
+ "postCreateCommand": "pnpm install && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Astro tests": "pnpm run test"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["README.md", "CONTRIBUTING.md"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/docs/devcontainer.json b/.devcontainer/docs/devcontainer.json
new file mode 100644
index 000000000000..a26ff9d8c751
--- /dev/null
+++ b/.devcontainer/docs/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Docs Site",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/docs",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/example-welcome-message.txt b/.devcontainer/example-welcome-message.txt
new file mode 100644
index 000000000000..72ef4734f5c5
--- /dev/null
+++ b/.devcontainer/example-welcome-message.txt
@@ -0,0 +1,5 @@
+👋 Welcome to "Astro" in GitHub Codespaces!
+
+🛠️ Your environment is fully setup with all the required software.
+
+🚀 The example app should automatically start soon in a new terminal tab.
\ No newline at end of file
diff --git a/.devcontainer/examples.Dockerfile b/.devcontainer/examples.Dockerfile
new file mode 100644
index 000000000000..6ab758c823fd
--- /dev/null
+++ b/.devcontainer/examples.Dockerfile
@@ -0,0 +1,6 @@
+FROM mcr.microsoft.com/devcontainers/javascript-node:1-18
+
+# Install latest pnpm
+RUN npm install -g pnpm
+
+COPY example-welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
\ No newline at end of file
diff --git a/.devcontainer/framework-alpine/devcontainer.json b/.devcontainer/framework-alpine/devcontainer.json
new file mode 100644
index 000000000000..1b8f26503d69
--- /dev/null
+++ b/.devcontainer/framework-alpine/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Alpine",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-alpine",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-lit/devcontainer.json b/.devcontainer/framework-lit/devcontainer.json
new file mode 100644
index 000000000000..4eb1d59791d0
--- /dev/null
+++ b/.devcontainer/framework-lit/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Lit",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-lit",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-multiple/devcontainer.json b/.devcontainer/framework-multiple/devcontainer.json
new file mode 100644
index 000000000000..660df3e32411
--- /dev/null
+++ b/.devcontainer/framework-multiple/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Kitchen Sink (Multiple Frameworks)",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-multiple",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-preact/devcontainer.json b/.devcontainer/framework-preact/devcontainer.json
new file mode 100644
index 000000000000..5c71cb6f2d0d
--- /dev/null
+++ b/.devcontainer/framework-preact/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Preact",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-preact",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-react/devcontainer.json b/.devcontainer/framework-react/devcontainer.json
new file mode 100644
index 000000000000..f130c26ff3a4
--- /dev/null
+++ b/.devcontainer/framework-react/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "React",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-react",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-solid/devcontainer.json b/.devcontainer/framework-solid/devcontainer.json
new file mode 100644
index 000000000000..4a3e65ec855a
--- /dev/null
+++ b/.devcontainer/framework-solid/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Solid",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-solid",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-svelte/devcontainer.json b/.devcontainer/framework-svelte/devcontainer.json
new file mode 100644
index 000000000000..d8db14287d87
--- /dev/null
+++ b/.devcontainer/framework-svelte/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Svelte",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-svelte",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/framework-vue/devcontainer.json b/.devcontainer/framework-vue/devcontainer.json
new file mode 100644
index 000000000000..db9a6287834c
--- /dev/null
+++ b/.devcontainer/framework-vue/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Vue",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/framework-vue",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/hackernews/devcontainer.json b/.devcontainer/hackernews/devcontainer.json
new file mode 100644
index 000000000000..dc113624d6c1
--- /dev/null
+++ b/.devcontainer/hackernews/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Hackernews",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/hackernews",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/[...stories].astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/integration/devcontainer.json b/.devcontainer/integration/devcontainer.json
new file mode 100644
index 000000000000..8e6a4df8d852
--- /dev/null
+++ b/.devcontainer/integration/devcontainer.json
@@ -0,0 +1,21 @@
+{
+ "name": "Integration Package",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/integration",
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["index.ts"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/minimal/devcontainer.json b/.devcontainer/minimal/devcontainer.json
new file mode 100644
index 000000000000..1756ffd8baaf
--- /dev/null
+++ b/.devcontainer/minimal/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Minimal",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/minimal",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/non-html-pages/devcontainer.json b/.devcontainer/non-html-pages/devcontainer.json
new file mode 100644
index 000000000000..b47fae4e9186
--- /dev/null
+++ b/.devcontainer/non-html-pages/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Non-HTML Pages",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/non-html-pages",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/portfolio/devcontainer.json b/.devcontainer/portfolio/devcontainer.json
new file mode 100644
index 000000000000..39e283d83b5d
--- /dev/null
+++ b/.devcontainer/portfolio/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Portfolio",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/portfolio",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/ssr/devcontainer.json b/.devcontainer/ssr/devcontainer.json
new file mode 100644
index 000000000000..2ace9a1dd012
--- /dev/null
+++ b/.devcontainer/ssr/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "SSR",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/ssr",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/welcome-message.txt b/.devcontainer/welcome-message.txt
new file mode 100644
index 000000000000..f2ca4bf31085
--- /dev/null
+++ b/.devcontainer/welcome-message.txt
@@ -0,0 +1,4 @@
+👋 Welcome to Astro!
+
+🛠️ Your environment is fully setup with all required software installed. Tests will
+ be running shortly in a separate terminal tab.
diff --git a/.devcontainer/with-markdown-plugins/devcontainer.json b/.devcontainer/with-markdown-plugins/devcontainer.json
new file mode 100644
index 000000000000..21894a77c42b
--- /dev/null
+++ b/.devcontainer/with-markdown-plugins/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Markdown with Plugins",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.md"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/with-markdown-shiki/devcontainer.json b/.devcontainer/with-markdown-shiki/devcontainer.json
new file mode 100644
index 000000000000..a3f51750adbf
--- /dev/null
+++ b/.devcontainer/with-markdown-shiki/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Markdown with Shiki",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.md"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/with-mdx/devcontainer.json b/.devcontainer/with-mdx/devcontainer.json
new file mode 100644
index 000000000000..13ff67464285
--- /dev/null
+++ b/.devcontainer/with-mdx/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "MDX",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/with-mdx",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.mdx"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/with-nanostores/devcontainer.json b/.devcontainer/with-nanostores/devcontainer.json
new file mode 100644
index 000000000000..656776b2a049
--- /dev/null
+++ b/.devcontainer/with-nanostores/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Nanostores",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/with-nanostores",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/with-tailwindcss/devcontainer.json b/.devcontainer/with-tailwindcss/devcontainer.json
new file mode 100644
index 000000000000..6e7298a6f994
--- /dev/null
+++ b/.devcontainer/with-tailwindcss/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Tailwind",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.devcontainer/with-vitest/devcontainer.json b/.devcontainer/with-vitest/devcontainer.json
new file mode 100644
index 000000000000..7931089395da
--- /dev/null
+++ b/.devcontainer/with-vitest/devcontainer.json
@@ -0,0 +1,34 @@
+{
+ "name": "Vitest",
+ "build": {
+ "dockerfile": "../examples.Dockerfile"
+ },
+
+ "workspaceFolder": "/workspaces/astro/examples/with-vitest",
+
+ "portsAttributes": {
+ "4321": {
+ "label": "Application",
+ "onAutoForward": "openPreview"
+ }
+ },
+
+ "forwardPorts": [4321],
+
+ "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",
+
+ "waitFor": "postCreateCommand",
+
+ "postAttachCommand": {
+ "Server": "pnpm start --host"
+ },
+
+ "customizations": {
+ "codespaces": {
+ "openFiles": ["src/pages/index.astro"]
+ },
+ "vscode": {
+ "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"]
+ }
+ }
+}
diff --git a/.editorconfig b/.editorconfig
index 0bb4ad6ecde1..6c6c428353bd 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,5 +11,5 @@ indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = false
-[{.*,*.md,*.json,*.toml,*.yml,}]
+[{.*,*.md,*.json,*.toml,*.yml,*.json5}]
indent_style = space
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index c2d3e84009d9..000000000000
--- a/.eslintignore
+++ /dev/null
@@ -1,8 +0,0 @@
-**/*.js
-**/*.ts
-!packages/astro/**/*.js
-!packages/astro/**/*.ts
-packages/astro/test/**/*.js
-packages/astro/vendor/vite/**/*
-.github
-.changeset
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
deleted file mode 100644
index d2d00d0816d6..000000000000
--- a/.eslintrc.cjs
+++ /dev/null
@@ -1,21 +0,0 @@
-module.exports = {
- parser: '@typescript-eslint/parser',
- extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
- plugins: ['@typescript-eslint', 'prettier'],
- rules: {
- '@typescript-eslint/ban-ts-comment': 'off',
- '@typescript-eslint/camelcase': 'off',
- '@typescript-eslint/explicit-module-boundary-types': 'off',
- '@typescript-eslint/no-empty-function': 'off',
- '@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-non-null-assertion': 'off',
- '@typescript-eslint/no-unused-vars': 'off',
- '@typescript-eslint/no-use-before-define': 'off',
- '@typescript-eslint/no-var-requires': 'off',
- '@typescript-eslint/no-this-alias': 'off',
- 'no-console': 'warn',
- 'prefer-const': 'off',
- 'no-shadow': 'off',
- '@typescript-eslint/no-shadow': ['error'],
- },
-};
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index 495a5ff2ee36..6c950a14e8ac 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -1,4 +1,10 @@
# Switch to tabs (Use Accessible Indentation #2253)
6ddd7678ffb6598ae6e263706813cb5e94535f02
# prettier config update
-1335797903a57716e9a02b0ffd8ca636b3883c62
\ No newline at end of file
+1335797903a57716e9a02b0ffd8ca636b3883c62
+# Manually format .astro files in example projects (#3862)
+59e8c71786fd1c154904b3fefa7d26d88f4d92d2
+# Change formatting (#10180)
+062623438b5dfd66682a967edc7b7c91bd29e888
+# Update to trailingComma: 'all' (#11640)
+72c7ae9901de927ae8d9d5be63cbaef4f976422c
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
deleted file mode 100644
index d801514c3569..000000000000
--- a/.github/CODEOWNERS
+++ /dev/null
@@ -1 +0,0 @@
-* @snowpackjs/maintainers
diff --git a/.github/ISSUE_TEMPLATE/---01-bug-report.yml b/.github/ISSUE_TEMPLATE/---01-bug-report.yml
index 1b241039a384..9f9bb166dea5 100644
--- a/.github/ISSUE_TEMPLATE/---01-bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/---01-bug-report.yml
@@ -1,6 +1,5 @@
name: "\U0001F41B Bug Report"
description: Report an issue or possible bug
-title: "\U0001F41B BUG:"
labels: []
assignees: []
body:
@@ -11,45 +10,44 @@ body:
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.
✅ I am using the **latest version of Astro** and all plugins.
- ✅ I am using a version of Node that supports ESM (`v14.15.0+`, or `v16.0.0+`)
- - type: input
- attributes:
- label: What version of `astro` are you using?
- placeholder: 0.0.0
- validations:
- required: true
- - type: input
+ ✅ I am using a version of Node that Astro supports (`v18.17.1` or `v20.3.0` or higher.)
+ - type: textarea
+ id: astro-info
attributes:
- label: Are you using an SSR adapter? If so, which one?
- placeholder: None, or Netlify, Vercel, Cloudflare, etc.
+ label: Astro Info
+ description: Run the command `astro info` in your terminal and paste the output here. Please review the data before submitting in case there is any sensitive information you don't want to share.
+ render: block
validations:
required: true
- type: input
+ id: browser
attributes:
- label: What package manager are you using?
- placeholder: npm, yarn, pnpm
- validations:
- required: true
- - type: input
+ label: If this issue only occurs in one browser, which browser is a problem?
+ placeholder: Chrome, Firefox, Safari
+ - type: textarea
+ id: bug-description
attributes:
- label: What operating system are you using?
- placeholder: Mac, Windows, Linux
+ label: Describe the Bug
+ description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
+ id: bug-expectation
attributes:
- label: Describe the Bug
- description: A clear and concise description of what the bug is.
+ label: What's the expected result?
+ description: Describe what you expect to happen.
validations:
required: true
- type: input
+ id: bug-reproduction
attributes:
label: Link to Minimal Reproducible Example
- description: 'Use [astro.new](https://astro.new) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed.'
+ description: 'Use [StackBlitz](https://astro.new/repro) to create a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed. Not sure how to create a minimal example? [Read our guide](https://docs.astro.build/en/guides/troubleshooting/#creating-minimal-reproductions)'
placeholder: 'https://stackblitz.com/abcd1234'
validations:
required: true
- type: checkboxes
+ id: will-pr
attributes:
label: Participation
options:
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index e896bd2f2275..5c5f4e11b8ef 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,14 +1,14 @@
blank_issues_enabled: false
contact_links:
+ - name: 💁 Support
+ url: https://astro.build/chat
+ about: 'This issue tracker is not for support questions. Join us on Discord for assistance!'
- name: 📘 Documentation
url: https://github.com/withastro/docs
about: File an issue or make an improvement to the docs website.
- name: 💡 Ideas for New Features, Improvements and RFCs
- url: https://github.com/withastro/rfcs/discussions
+ url: https://github.com/withastro/roadmap/discussions
about: Propose and discuss future improvements to Astro
- name: 👾 Chat
url: https://astro.build/chat
about: Our Discord server is active, come join us!
- - name: 💁 Support
- url: https://astro.build/chat
- about: 'This issue tracker is not for support questions. Join us on Discord for assistance!'
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index edec77376cb0..59e8413b602e 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -12,6 +12,9 @@
## Docs
-
+
+
+
+
-
\ No newline at end of file
+
diff --git a/.github/assets/banner.jpg b/.github/assets/banner.jpg
new file mode 100644
index 000000000000..e88438780364
Binary files /dev/null and b/.github/assets/banner.jpg differ
diff --git a/.github/assets/banner.png b/.github/assets/banner.png
new file mode 100644
index 000000000000..7696fafb75c0
Binary files /dev/null and b/.github/assets/banner.png differ
diff --git a/.github/assets/deepgram-dark.svg b/.github/assets/deepgram-dark.svg
new file mode 100644
index 000000000000..9b66066ff35b
--- /dev/null
+++ b/.github/assets/deepgram-dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/deepgram.svg b/.github/assets/deepgram.svg
new file mode 100644
index 000000000000..ec55ad3fa41d
--- /dev/null
+++ b/.github/assets/deepgram.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/monogram-dark.svg b/.github/assets/monogram-dark.svg
new file mode 100644
index 000000000000..feccf6fe840a
--- /dev/null
+++ b/.github/assets/monogram-dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/monogram.svg b/.github/assets/monogram.svg
new file mode 100644
index 000000000000..e60aa428e6e6
--- /dev/null
+++ b/.github/assets/monogram.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/netlify-dark.svg b/.github/assets/netlify-dark.svg
index d974206de75e..2fcff1dde7cf 100644
--- a/.github/assets/netlify-dark.svg
+++ b/.github/assets/netlify-dark.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/.github/assets/netlify.svg b/.github/assets/netlify.svg
index 7a068f2445a4..aa07cbcabb4f 100644
--- a/.github/assets/netlify.svg
+++ b/.github/assets/netlify.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/.github/assets/qoddi-dark.png b/.github/assets/qoddi-dark.png
new file mode 100644
index 000000000000..b666799d99d9
Binary files /dev/null and b/.github/assets/qoddi-dark.png differ
diff --git a/.github/assets/qoddi.png b/.github/assets/qoddi.png
new file mode 100644
index 000000000000..e7a1c3c43790
Binary files /dev/null and b/.github/assets/qoddi.png differ
diff --git a/.github/assets/sentry-dark.svg b/.github/assets/sentry-dark.svg
new file mode 100644
index 000000000000..1e09e141b268
--- /dev/null
+++ b/.github/assets/sentry-dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/sentry.svg b/.github/assets/sentry.svg
index a4470b601ecb..56e122e04a3f 100644
--- a/.github/assets/sentry.svg
+++ b/.github/assets/sentry.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/.github/assets/shipshape-dark.svg b/.github/assets/shipshape-dark.svg
new file mode 100644
index 000000000000..038534ec9e37
--- /dev/null
+++ b/.github/assets/shipshape-dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/shipshape.svg b/.github/assets/shipshape.svg
new file mode 100644
index 000000000000..6c2e2ee70f11
--- /dev/null
+++ b/.github/assets/shipshape.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/stackup-dark.svg b/.github/assets/stackup-dark.svg
index 3b8ed2746b8c..b7a45841051c 100644
--- a/.github/assets/stackup-dark.svg
+++ b/.github/assets/stackup-dark.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/.github/assets/stackup.svg b/.github/assets/stackup.svg
index 207f28b2a52f..6faa178f55a3 100644
--- a/.github/assets/stackup.svg
+++ b/.github/assets/stackup.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/.github/assets/storyblok-dark.svg b/.github/assets/storyblok-dark.svg
new file mode 100644
index 000000000000..9df58c4bbb4b
--- /dev/null
+++ b/.github/assets/storyblok-dark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/storyblok.svg b/.github/assets/storyblok.svg
new file mode 100644
index 000000000000..ec77593560e3
--- /dev/null
+++ b/.github/assets/storyblok.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.github/assets/vercel-dark.svg b/.github/assets/vercel-dark.svg
index 31c2d5b88249..1fbf0317d0f1 100644
--- a/.github/assets/vercel-dark.svg
+++ b/.github/assets/vercel-dark.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/.github/assets/vercel.svg b/.github/assets/vercel.svg
index d2b7685c5c09..6711aa56f9a2 100644
--- a/.github/assets/vercel.svg
+++ b/.github/assets/vercel.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/.github/extract-artifacts.sh b/.github/extract-artifacts.sh
deleted file mode 100755
index 03f0d19a1ac8..000000000000
--- a/.github/extract-artifacts.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-cd artifacts
-mkdir -p ../tmp/packages
-mv * ../tmp/packages
-cd ../tmp
-tar -cvzpf artifacts.tar.gz *
-mv artifacts.tar.gz ../artifacts.tar.gz
-cd ..
-tar -xvzpf artifacts.tar.gz
-rm -rf artifacts
-rm -rf tmp
-rm -f artifacts.tar.gz
diff --git a/.github/labeler.yml b/.github/labeler.yml
index e6ec99206025..b0d27800ba97 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -1,40 +1,44 @@
# See https://github.com/actions/labeler
-example:
+'pkg: example':
- examples/**/*
'🚨 action':
- .github/workflows/**
-test:
-- packages/**/*.test.js
-
-core:
+'pkg: astro':
- packages/astro/**
-create-astro:
+'pkg: create-astro':
- packages/create-astro/**
-markdown:
+'pkg: db':
+- packages/integrations/db/**
+
+'feat: markdown':
- packages/markdown/**
-renderer:
+'pkg: integration':
- packages/integrations/**
-framework-lit:
+'pkg: lit':
- packages/integrations/lit/**
-framework-preact:
+'pkg: preact':
- packages/integrations/preact/**
-framework-react:
+'pkg: react':
- packages/integrations/react/**
-framework-solid:
+'pkg: solid':
- packages/integrations/solid/**
-framework-svelte:
+'pkg: svelte':
- packages/integrations/svelte/**
-framework-vue:
+'pkg: vue':
- packages/integrations/vue/**
+
+'docs pr':
+- packages/astro/src/types/public/**
+- packages/astro/src/core/errors/errors-data.ts
diff --git a/.github/renovate.json5 b/.github/renovate.json5
new file mode 100644
index 000000000000..ead596c39574
--- /dev/null
+++ b/.github/renovate.json5
@@ -0,0 +1,35 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:recommended",
+ "schedule:weekly",
+ "group:allNonMajor",
+ ":disablePeerDependencies",
+ "regexManagers:biomeVersions",
+ ],
+ "labels": ["dependencies"],
+ "rangeStrategy": "bump",
+ "postUpdateOptions": ["pnpmDedupe"],
+ "ignorePaths": ["**/node_modules/**"],
+ "ignoreDeps": [
+ // manually bumping deps
+ "@biomejs/biome",
+ "@types/node",
+ "@preact/preset-vite", // v2.8.3 starts to use Vite's esbuild for perf, but this conflicts with the react plugin
+ "astro-embed", // TODO: investigate upgrade (zod import issues with atproto)
+ "drizzle-orm", // TODO: investigate upgrade (has type issues)
+ "sharp",
+
+ // manually bumping workflow actions
+ "actions/labeler",
+
+ // ignore "engines" update
+ "node",
+ "npm",
+ "pnpm",
+
+ // follow vite deps version
+ "postcss-load-config",
+ "esbuild",
+ ],
+}
diff --git a/.github/scripts/announce.mjs b/.github/scripts/announce.mjs
new file mode 100755
index 000000000000..df73040372eb
--- /dev/null
+++ b/.github/scripts/announce.mjs
@@ -0,0 +1,166 @@
+import { readFile } from 'node:fs/promises';
+import { fileURLToPath } from 'node:url';
+import { globby as glob } from 'globby';
+import { setOutput } from './utils.mjs';
+
+const { GITHUB_REF = 'main' } = process.env;
+const baseUrl = new URL(`https://github.com/withastro/astro/blob/${GITHUB_REF}/`);
+
+const emojis = ['🎉', '🥳', '🚀', '🧑', '🎊', '🏆', '✅', '🤩', '🤖', '🙌'];
+const descriptors = [
+ 'new releases',
+ 'hot and fresh updates',
+ 'shiny updates',
+ 'exciting changes',
+ 'package updates',
+ 'awesome updates',
+ 'bug fixes and features',
+ 'updates',
+];
+const verbs = [
+ 'just went out!',
+ 'just launched!',
+ 'now available!',
+ 'in the wild!',
+ 'now live!',
+ 'hit the registry!',
+ 'to share!',
+ 'for you!',
+ 'for y’all! 🤠',
+ 'comin’ your way!',
+ 'comin’ atcha!',
+ 'comin’ in hot!',
+ 'freshly minted on the blockchain! (jk)',
+ '[is] out (now with 100% more reticulated splines!)',
+ '(as seen on TV!)',
+ 'just dropped!',
+ '– artisanally hand-crafted just for you.',
+ '– oh happy day!',
+ '– enjoy!',
+ 'now out. Be the first on your block to download!',
+ 'made with love 💕',
+ '[is] out! Our best [version] yet!',
+ '[is] here. DOWNLOAD! DOWNLOAD! DOWNLOAD!',
+ '... HUZZAH!',
+ '[has] landed!',
+ 'landed! The internet just got a little more fun.',
+ '– from our family to yours.',
+ '– go forth and build!',
+];
+const extraVerbs = [
+ 'new',
+ 'here',
+ 'released',
+ 'freshly made',
+ 'going out',
+ 'hitting the registry',
+ 'available',
+ 'live now',
+ 'hot and fresh',
+ 'for you',
+ "comin' atcha",
+];
+
+function item(items) {
+ return items[Math.floor(Math.random() * items.length)];
+}
+
+const plurals = new Map([
+ ['is', 'are'],
+ ['has', 'have'],
+]);
+
+function pluralize(text) {
+ return text.replace(/(\[([^\]]+)\])/gm, (_, _full, match) =>
+ plurals.has(match) ? plurals.get(match) : `${match}s`,
+ );
+}
+
+function singularlize(text) {
+ return text.replace(/(\[([^\]]+)\])/gm, (_, _full, match) => `${match}`);
+}
+
+const packageMap = new Map();
+async function generatePackageMap() {
+ const packageRoot = new URL('../../packages/', import.meta.url);
+ const packages = await glob(['*/package.json', '*/*/package.json'], {
+ cwd: fileURLToPath(packageRoot),
+ });
+ await Promise.all(
+ packages.map(async (pkg) => {
+ const pkgFile = fileURLToPath(new URL(pkg, packageRoot));
+ const content = await readFile(pkgFile).then((res) => JSON.parse(res.toString()));
+ packageMap.set(content.name, `./packages/${pkg.replace('/package.json', '')}`);
+ }),
+ );
+}
+
+async function generateMessage() {
+ await generatePackageMap();
+ const releases = process.argv.slice(2)[0];
+ const data = JSON.parse(releases);
+ const packages = await Promise.all(
+ data.map(({ name, version }) => {
+ const p = packageMap.get(name);
+ if (!p) {
+ throw new Error(`Unable to find entrypoint for "${name}"!`);
+ }
+ return {
+ name,
+ version,
+ url: new URL(`${p}/CHANGELOG.md#${version.replace(/\./g, '')}`, baseUrl).toString(),
+ };
+ }),
+ );
+
+ const emoji = item(emojis);
+ const descriptor = item(descriptors);
+ const verb = item(verbs);
+
+ let message = '';
+
+ if (packages.length === 1) {
+ const { name, version, url } = packages[0];
+ message += `${emoji} \`${name}@${version}\` ${singularlize(
+ verb,
+ )}\nRead the [release notes →](<${url}>)\n`;
+ } else {
+ message += `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;
+ for (const { name, version, url } of packages) {
+ message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`;
+ }
+ }
+
+ if (message.length < 2000) {
+ return message;
+ } else {
+ const { name, version, url } = packages.find((pkg) => pkg.name === 'astro') ?? packages[0];
+ message = `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;
+ message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`;
+
+ message += `\nAlso ${item(extraVerbs)}:`;
+
+ const remainingPackages = packages.filter((p) => p.name !== name);
+ for (const { name, version, _url } of remainingPackages) {
+ message += `\n• \`${name}@${version}\``;
+ }
+
+ if (message.length < 2000) {
+ return message;
+ } else {
+ message = `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`;
+ message += `• \`${name}@${version}\` Read the [release notes →](<${url}>)\n`;
+
+ message += `\n\nAlso ${item(extraVerbs)}: ${remainingPackages.length} other packages!`;
+ return message;
+ }
+ }
+}
+
+async function run() {
+ const content = await generateMessage();
+ console.info(content);
+ setOutput('DISCORD_MESSAGE', content);
+}
+
+run();
diff --git a/.github/scripts/bundle-size.mjs b/.github/scripts/bundle-size.mjs
new file mode 100644
index 000000000000..76d6b3f29724
--- /dev/null
+++ b/.github/scripts/bundle-size.mjs
@@ -0,0 +1,102 @@
+import { existsSync } from 'node:fs';
+import { build } from 'esbuild';
+
+const CLIENT_RUNTIME_PATH = 'packages/astro/src/runtime/client/';
+
+function formatBytes(bytes, decimals = 2) {
+ if (bytes === 0) return '0 B';
+
+ const k = 1024;
+ const dm = decimals < 0 ? 0 : decimals;
+ const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
+
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
+}
+
+export default async function checkBundleSize({ github, context }) {
+ const PR_NUM = context.payload.pull_request.number;
+ const SHA = context.payload.pull_request.head.sha;
+
+ const { data: files } = await github.rest.pulls.listFiles({
+ ...context.repo,
+ pull_number: PR_NUM,
+ });
+ const clientRuntimeFiles = files.filter((file) => {
+ return file.filename.startsWith(CLIENT_RUNTIME_PATH) && file.status !== 'removed';
+ });
+ if (clientRuntimeFiles.length === 0) return;
+
+ const table = [
+ '| File | Old Size | New Size | Change |',
+ '| ---- | -------- | -------- | ------ |',
+ ];
+ const output = await bundle(clientRuntimeFiles);
+
+ for (let [filename, { oldSize, newSize, sourceFile }] of Object.entries(output)) {
+ filename = ['idle', 'load', 'media', 'only', 'visible'].includes(filename)
+ ? `client:${filename}`
+ : filename;
+ const prefix = newSize - oldSize === 0 ? '' : newSize - oldSize > 0 ? '+ ' : '- ';
+ const change = `${prefix}${formatBytes(newSize - oldSize)}`;
+ table.push(
+ `| [\`${filename}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${context.payload.pull_request.head.ref}/${sourceFile}) | ${formatBytes(oldSize)} | ${formatBytes(newSize)} | ${change} |`,
+ );
+ }
+
+ const { data: comments } = await github.rest.issues.listComments({
+ ...context.repo,
+ issue_number: PR_NUM,
+ });
+ const comment = comments.find(
+ (comment) =>
+ comment.user.login === 'github-actions[bot]' && comment.body.includes('Bundle Size Check'),
+ );
+ const method = comment ? 'updateComment' : 'createComment';
+ const payload = comment ? { comment_id: comment.id } : { issue_number: PR_NUM };
+ await github.rest.issues[method]({
+ ...context.repo,
+ ...payload,
+ body: `### ⚖️ Bundle Size Check
+
+Latest commit: ${SHA}
+
+${table.join('\n')}`,
+ });
+}
+
+async function bundle(files) {
+ const { metafile } = await build({
+ entryPoints: [
+ ...files.map(({ filename }) => filename),
+ ...files.map(({ filename }) => `main/${filename}`).filter((f) => existsSync(f)),
+ ],
+ bundle: true,
+ minify: true,
+ sourcemap: false,
+ target: ['es2018'],
+ outdir: 'out',
+ external: ['astro:*', 'aria-query', 'axobject-query'],
+ metafile: true,
+ });
+
+ return Object.entries(metafile.outputs).reduce((acc, [filename, info]) => {
+ filename = filename.slice('out/'.length);
+ if (filename.startsWith('main/')) {
+ filename = filename.slice('main/'.length).replace(CLIENT_RUNTIME_PATH, '').replace('.js', '');
+ const oldSize = info.bytes;
+ return Object.assign(acc, {
+ [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, { oldSize }),
+ });
+ }
+ filename = filename.replace(CLIENT_RUNTIME_PATH, '').replace('.js', '');
+ const newSize = info.bytes;
+ return Object.assign(acc, {
+ [filename]: Object.assign(acc[filename] ?? { oldSize: 0, newSize: 0 }, {
+ newSize,
+ sourceFile: Object.keys(info.inputs).find((src) => src.endsWith('.ts')),
+ }),
+ });
+ }, {});
+}
diff --git a/.github/scripts/utils.mjs b/.github/scripts/utils.mjs
new file mode 100644
index 000000000000..768302230150
--- /dev/null
+++ b/.github/scripts/utils.mjs
@@ -0,0 +1,53 @@
+import * as crypto from 'node:crypto';
+import * as fs from 'node:fs';
+import * as os from 'node:os';
+
+/** Based on https://github.com/actions/toolkit/blob/4e3b068ce116d28cb840033c02f912100b4592b0/packages/core/src/file-command.ts */
+export function setOutput(key, value) {
+ const filePath = process.env['GITHUB_OUTPUT'] || '';
+ if (filePath) {
+ return issueFileCommand('OUTPUT', prepareKeyValueMessage(key, value));
+ }
+ process.stdout.write(os.EOL);
+}
+
+function issueFileCommand(command, message) {
+ const filePath = process.env[`GITHUB_${command}`];
+ if (!filePath) {
+ throw new Error(`Unable to find environment variable for file command ${command}`);
+ }
+ if (!fs.existsSync(filePath)) {
+ throw new Error(`Missing file at path: ${filePath}`);
+ }
+
+ fs.appendFileSync(filePath, `${toCommandValue(message)}${os.EOL}`, {
+ encoding: 'utf8',
+ });
+}
+
+function prepareKeyValueMessage(key, value) {
+ const delimiter = `gh-delimiter-${crypto.randomUUID()}`;
+ const convertedValue = toCommandValue(value);
+
+ // These should realistically never happen, but just in case someone finds a
+ // way to exploit uuid generation let's not allow keys or values that contain
+ // the delimiter.
+ if (key.includes(delimiter)) {
+ throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
+ }
+
+ if (convertedValue.includes(delimiter)) {
+ throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
+ }
+
+ return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
+}
+
+function toCommandValue(input) {
+ if (input === null || input === undefined) {
+ return '';
+ } else if (typeof input === 'string' || input instanceof String) {
+ return input;
+ }
+ return JSON.stringify(input);
+}
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
new file mode 100644
index 000000000000..85dbb1c948f0
--- /dev/null
+++ b/.github/workflows/benchmark.yml
@@ -0,0 +1,112 @@
+name: Benchmark
+
+on:
+ issue_comment:
+ types: [created]
+ workflow_dispatch:
+
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: true
+
+jobs:
+ benchmark:
+ if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && startsWith(github.event.comment.body, '!bench') }}
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ outputs:
+ PR-BENCH: ${{ steps.benchmark-pr.outputs.BENCH_RESULT }}
+ MAIN-BENCH: ${{ steps.benchmark-main.outputs.BENCH_RESULT }}
+ steps:
+ - name: Check if user has write access
+ uses: lannonbr/repo-permission-check-action@2.0.2
+ with:
+ permission: write
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ # https://github.com/actions/checkout/issues/331#issuecomment-1438220926
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ ref: refs/pull/${{ github.event.issue.number }}/head
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build Packages
+ run: pnpm run build
+
+ - name: Get bench command
+ id: bench-command
+ env:
+ # protects from untrusted user input and command injection
+ COMMENT: ${{ github.event.comment.body }}
+ run: |
+ benchcmd=$(echo "$COMMENT" | grep '!bench' | awk -F ' ' '{print $2}')
+ echo "bench=$benchcmd" >> $GITHUB_OUTPUT
+ shell: bash
+
+ - name: Run benchmark
+ id: benchmark-pr
+ run: |
+ result=$(pnpm run --silent benchmark ${{ steps.bench-command.outputs.bench }})
+ processed=$(node ./benchmark/ci-helper.js "$result")
+ echo "BENCH_RESULT<> $GITHUB_OUTPUT
+ echo "### PR Benchmark" >> $GITHUB_OUTPUT
+ echo "$processed" >> $GITHUB_OUTPUT
+ echo "BENCHEOF" >> $GITHUB_OUTPUT
+ shell: bash
+
+ # main benchmark
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ ref: "main"
+
+ - name: Install
+ run: |
+ pnpm install
+
+ - name: Build Packages
+ run: pnpm run build
+
+ - name: Run benchmark
+ id: benchmark-main
+ run: |
+ result=$(pnpm run --silent benchmark ${{ steps.bench-command.outputs.bench }})
+ processed=$(node ./benchmark/ci-helper.js "$result")
+ echo "BENCH_RESULT<> $GITHUB_OUTPUT
+ echo "### Main Benchmark" >> $GITHUB_OUTPUT
+ echo "$processed" >> $GITHUB_OUTPUT
+ echo "BENCHEOF" >> $GITHUB_OUTPUT
+ shell: bash
+
+ output-benchmark:
+ if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && startsWith(github.event.comment.body, '!bench') }}
+ needs: [benchmark]
+ runs-on: ubuntu-latest
+ permissions:
+ pull-requests: write
+ steps:
+ - name: Comment PR
+ uses: peter-evans/create-or-update-comment@v4
+ continue-on-error: true
+ with:
+ issue-number: ${{ github.event.issue.number }}
+ body: |
+ ${{ needs.benchmark.outputs.PR-BENCH }}
+
+ ${{ needs.benchmark.outputs.MAIN-BENCH }}
+ edit-mode: replace
diff --git a/.github/workflows/check-merge.yml b/.github/workflows/check-merge.yml
new file mode 100644
index 000000000000..a4b4ddb99e5a
--- /dev/null
+++ b/.github/workflows/check-merge.yml
@@ -0,0 +1,96 @@
+name: Check mergeability
+
+on: pull_request_target
+
+permissions:
+ pull-requests: write
+ checks: write
+ statuses: write
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check if there is already a block on this PR
+ id: blocked
+ uses: actions/github-script@v7
+ env:
+ issue_number: ${{ github.event.number }}
+ with:
+ script: |
+ const { data: reviews } = await github.rest.pulls.listReviews({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: process.env.issue_number,
+ });
+
+ for (const review of reviews) {
+ if (review.user.login === 'github-actions[bot]' && review.state === 'CHANGES_REQUESTED') {
+ return 'true'
+ }
+ }
+ return 'false'
+ result-encoding: string
+
+ - uses: actions/checkout@v4
+ if: steps.blocked.outputs.result != 'true'
+ with:
+ repository: ${{ github.event.pull_request.head.repo.full_name }}
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+
+ - name: Get changed files in the .changeset folder
+ id: changed-files
+ uses: tj-actions/changed-files@v45
+ if: steps.blocked.outputs.result != 'true'
+ with:
+ files: |
+ .changeset/**/*.md
+
+ - name: Check if any changesets contain minor or major changes
+ id: check
+ if: steps.blocked.outputs.result != 'true'
+ env:
+ ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
+ run: |
+ echo "Checking for changesets marked as minor or major"
+ echo "found=false" >> $GITHUB_OUTPUT
+
+ regex="[\"']astro[\"']: (minor|major)"
+ for file in ${ALL_CHANGED_FILES}; do
+ if [[ $(cat $file) =~ $regex ]]; then
+ version="${BASH_REMATCH[1]}"
+ echo "version=$version" >> $GITHUB_OUTPUT
+ echo "found=true" >> $GITHUB_OUTPUT
+ echo "$file has a $version release tag"
+ fi
+ done
+
+ - name: Add label
+ uses: actions/github-script@v7
+ if: steps.check.outputs.found == 'true'
+ env:
+ issue_number: ${{ github.event.number }}
+ with:
+ script: |
+ github.rest.issues.addLabels({
+ issue_number: process.env.issue_number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ labels: ['semver: ${{ steps.check.outputs.version }}']
+ });
+
+ - name: Change PR Status
+ uses: actions/github-script@v7
+ if: steps.check.outputs.found == 'true'
+ env:
+ issue_number: ${{ github.event.number }}
+ with:
+ script: |
+ github.rest.pulls.createReview({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: process.env.issue_number,
+ event: 'REQUEST_CHANGES',
+ body: 'This PR is blocked because it contains a `${{ steps.check.outputs.version }}` changeset. A reviewer will merge this at the next release if approved.'
+ });
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
new file mode 100644
index 000000000000..f8c7ceb49d04
--- /dev/null
+++ b/.github/workflows/check.yml
@@ -0,0 +1,52 @@
+name: Examples astro check
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ merge_group:
+ pull_request:
+ paths:
+ - "examples/**"
+ - ".github/workflows/check.yml"
+ - "scripts/smoke/check.js"
+ - "packages/astro/src/types/public/**"
+ - "pnpm-lock.yaml"
+ - "packages/astro/types.d.ts"
+
+env:
+ ASTRO_TELEMETRY_DISABLED: true
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: true
+
+jobs:
+ check:
+ name: astro check
+ runs-on: ubuntu-latest
+ timeout-minutes: 7
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build
+ run: pnpm run build
+
+ - name: Status
+ run: git status
+
+ - name: astro check
+ run: pnpm run test:check-examples
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bb9d6cbd864c..e7bb0eb7b1a4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,92 +1,92 @@
name: CI
on:
+ workflow_dispatch:
push:
branches:
- main
+ merge_group:
pull_request:
paths-ignore:
- - '.vscode/**'
+ - ".vscode/**"
+ - "**/*.md"
+ - ".github/ISSUE_TEMPLATE/**"
-# Automatically cancel in-progress actions on the same branch
+# Automatically cancel older in-progress jobs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true
-
defaults:
run:
shell: bash
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: true
+ ASTRO_TELEMETRY_DISABLED: true
+ # 7 GiB by default on GitHub, setting to 6 GiB
+ # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
+ NODE_OPTIONS: --max-old-space-size=6144
+
jobs:
- # Lint can run in parallel with Build.
- lint:
- name: Lint
- runs-on: ubuntu-latest
+ # Build primes out Turbo build cache and pnpm cache
+ build:
+ name: "Build: ${{ matrix.os }}"
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 3
+ strategy:
+ matrix:
+ OS: [ubuntu-latest, windows-latest]
+ NODE_VERSION: [22]
+ fail-fast: true
steps:
- - name: Check out repository
- uses: actions/checkout@v3
+ # Disable crlf so all OS can share the same Turbo cache
+ # https://github.com/actions/checkout/issues/135
+ - name: Disable git crlf
+ run: git config --global core.autocrlf false
+
+ - name: Checkout
+ uses: actions/checkout@v4
- name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
+ uses: pnpm/action-setup@v3
- - name: Setup Node
- uses: actions/setup-node@v3
+ - name: Setup node@${{ matrix.NODE_VERSION }}
+ uses: actions/setup-node@v4
with:
- node-version: 16
- cache: 'pnpm'
+ node-version: ${{ matrix.NODE_VERSION }}
+ cache: "pnpm"
- name: Install dependencies
run: pnpm install
- - name: Status
- run: git status
-
- # Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
- - name: Lint (External)
- if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
- run: pnpm run lint
+ # Only build in ubuntu as windows can share the build cache.
+ # Also only build in core repo as forks don't have access to the Turbo cache.
+ - name: Build Packages
+ if: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'withastro' }}
+ run: pnpm run build
- # Otherwise, run lint autofixer
- - name: Lint
- if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
- uses: wearerequired/lint-action@v1.11.1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- eslint: true
- eslint_args: --ignore-pattern test --ignore-pattern vendor
- eslint_dir: packages/astro
- eslint_extensions: ts
- prettier: false
- auto_fix: true
- git_name: github-actions[bot]
- git_email: github-actions[bot]@users.noreply.github.com
- commit_message: 'chore(lint): ${linter} fix'
- github_token: ${{ secrets.GITHUB_TOKEN }}
- neutral_check_on_warning: true
-
- # Checks that the formatter runs successfully on all files
- # In the future, we may have this fail PRs on unformatted code
- - name: Format Check
- run: yarn format --list
-
- # Build installs all devDependencies and runs our full build pipeline.
- # We upload all `dist/` artifacts to GitHub, which can be shared by all dependent jobs.
- build:
- name: Build Packages
+ lint:
+ name: Lint
runs-on: ubuntu-latest
+ timeout-minutes: 5
+ needs: build
steps:
+ - name: Disable git crlf
+ run: git config --global core.autocrlf false
+
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
+ uses: pnpm/action-setup@v3
- name: Setup Node
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
- node-version: 16
- cache: 'pnpm'
+ node-version: 22
+ cache: "pnpm"
- name: Install dependencies
run: pnpm install
@@ -94,162 +94,162 @@ jobs:
- name: Build Packages
run: pnpm run build
- - name: Upload Package Artifacts
- uses: actions/upload-artifact@v3
- with:
- name: artifacts
- path: |
- packages/*/dist/**
- packages/*/*/dist/**
- packages/webapi/mod.js
- packages/webapi/mod.js.map
- if-no-files-found: error
-
- # Test depends on Build's output, which allows us to skip any build process!
+ - name: Lint source code
+ run: pnpm run lint:ci
+
+ - name: Lint publish code
+ run: pnpm run publint
+
test:
- name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
+ name: "Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})"
runs-on: ${{ matrix.os }}
- env:
- ASTRO_TELEMETRY_DISABLED: true
+ timeout-minutes: 25
+ needs: build
strategy:
matrix:
- os: [ubuntu-latest]
- node_version: [14, 16]
+ OS: [ubuntu-latest]
+ NODE_VERSION: [18, 20, 22]
include:
+ - os: macos-14
+ NODE_VERSION: 22
- os: windows-latest
- node_version: 16
- - os: macos-latest
- node_version: 16
+ NODE_VERSION: 22
fail-fast: false
- needs:
- - build
+ env:
+ NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
+ - name: Disable git crlf
+ run: git config --global core.autocrlf false
+
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
+ uses: pnpm/action-setup@v3
- - name: Setup node@${{ matrix.node_version }}
- uses: actions/setup-node@v3
+ - name: Setup node@${{ matrix.NODE_VERSION }}
+ uses: actions/setup-node@v4
with:
- node-version: ${{ matrix.node_version }}
- cache: 'pnpm'
-
- - name: Use Deno
- uses: denoland/setup-deno@v1
- with:
- deno-version: v1.19.3
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v3
-
- - name: Extract Artifacts
- run: ./.github/extract-artifacts.sh
+ node-version: ${{ matrix.NODE_VERSION }}
+ cache: "pnpm"
- name: Install dependencies
run: pnpm install
+ - name: Build Packages
+ run: pnpm run build
+
- name: Test
run: pnpm run test
- smoke:
- name: 'Test (Smoke) ${{ matrix.os }}'
+ e2e:
+ name: "Test (E2E): ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})"
runs-on: ${{ matrix.os }}
+ timeout-minutes: 25
+ needs: build
strategy:
matrix:
- os: [windows-latest, ubuntu-latest]
- needs:
- - build
+ OS: [ubuntu-latest, windows-latest]
+ NODE_VERSION: [22]
+ fail-fast: false
+ env:
+ NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- submodules: 'recursive'
+ - name: Disable git crlf
+ run: git config --global core.autocrlf false
- - name: Update submodules
- run: git submodule update --remote
+ - name: Checkout
+ uses: actions/checkout@v4
- name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
+ uses: pnpm/action-setup@v3
- - name: Setup Node
- uses: actions/setup-node@v3
+ - name: Setup node@${{ matrix.NODE_VERSION }}
+ uses: actions/setup-node@v4
with:
- node-version: 14
- cache: 'pnpm'
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v3
-
- - name: Extract Artifacts
- run: ./.github/extract-artifacts.sh
+ node-version: ${{ matrix.NODE_VERSION }}
+ cache: "pnpm"
- name: Install dependencies
- run: pnpm install --no-frozen-lockfile
-
- - name: Test
- run: pnpm run test:smoke
+ run: pnpm install
- - name: Memory Leak Test
- run: |
- node ./scripts/memory/mk.js
- node --expose-gc ./scripts/memory/index.js --ci
+ - name: Build Packages
+ run: pnpm run build
+ - name: Test
+ run: pnpm run test:e2e
- # Changelog can only run _after_ build.
- # We download all `dist/` artifacts from GitHub to skip the build process.
- changelog:
- name: Changelog PR or Release
- if: ${{ (github.ref_name == 'main' || github.head_ref == 'next') && github.repository_owner == 'withastro' }}
- needs: [build]
- runs-on: ubuntu-latest
+ smoke:
+ name: "Test (Smoke): ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})"
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 25
+ needs: build
+ strategy:
+ matrix:
+ OS: [ubuntu-latest, windows-latest]
+ NODE_VERSION: [22]
+ env:
+ NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- - uses: actions/checkout@v3
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Disable git crlf
+ run: git config --global core.autocrlf false
+
+ - name: Checkout
+ uses: actions/checkout@v4
- name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
+ uses: pnpm/action-setup@v3
- - name: Setup Node
- uses: actions/setup-node@v3
+ - name: Setup node@${{ matrix.NODE_VERSION }}
+ uses: actions/setup-node@v4
with:
- node-version: 16
- cache: 'pnpm'
-
- - name: Download Build Artifacts
- uses: actions/download-artifact@v3
+ node-version: ${{ matrix.NODE_VERSION }}
+ cache: "pnpm"
- - name: Extract Artifacts
- run: ./.github/extract-artifacts.sh
+ - name: Checkout docs
+ uses: actions/checkout@v4
+ with:
+ repository: withastro/docs
+ path: smoke/docs
+ # For a commit event on the `next` branch (`ref_name`), use the `5.0.0-beta` branch.
+ # For a pull_request event merging into the `next` branch (`base_ref`), use the `5.0.0-beta` branch.
+ # NOTE: For a pull_request event, the `ref_name` is something like `/merge` than the branch name.
+ # NOTE: Perhaps docs repo should use a consistent `next` branch in the future.
+ ref: ${{ (github.ref_name == 'next' || github.base_ref == 'next') && '5.0.0-beta' || 'main' }}
- name: Install dependencies
- run: pnpm install
+ run: pnpm install --no-frozen-lockfile
- - name: Create Release Pull Request or Publish
- id: changesets
- uses: changesets/action@v1
+ # Reset lockfile changes so that Turbo can reuse the old build cache
+ - name: Reset lockfile changes
+ run: git reset --hard
+
+ - name: Build Packages
+ run: pnpm run build
+
+ - name: Remove docs translations except for English and Korean
+ run: find smoke/docs/src/content/docs ! -name 'en' ! -name 'ko' -type d -mindepth 1 -maxdepth 1 -exec rm -rf {} +
+
+ - name: Check if docs changed
+ id: changes
+ uses: dorny/paths-filter@v3
with:
- # Note: pnpm install after versioning is necessary to refresh lockfile
- version: pnpm run version
- publish: pnpm exec changeset publish
- commit: '[ci] release'
- title: '[ci] release'
+ filters: |
+ docs:
+ - 'packages/integrations/*/README.md'
+ - "packages/astro/src/types/public/**"
+ - 'packages/astro/src/core/errors/errors-data.ts'
+
+ - name: Build autogenerated docs pages from current astro branch
+ if: ${{ steps.changes.outputs.docs == 'true' }}
+ run: cd smoke/docs && pnpm docgen && pnpm docgen:errors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ SOURCE_REPO: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
+ SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }}
- - name: Generate Notification
- id: notification
- if: steps.changesets.outputs.published == 'true'
- run: message=$(node scripts/notify/index.js '${{ steps.changesets.outputs.publishedPackages }}') && echo ::set-output name=message::${message//$'\n'/'%0A'}
-
- - name: Discord Notification
- if: steps.changesets.outputs.published == 'true'
- id: discord-notification
+ - name: Test
+ run: pnpm run test:smoke
env:
- DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
- uses: Ilshidur/action-discord@0.3.2
- with:
- args: ${{ steps.notification.outputs.message }}
+ SKIP_OG: true
+ PUBLIC_TWO_LANG: true
diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml
new file mode 100644
index 000000000000..9d8205cc5390
--- /dev/null
+++ b/.github/workflows/cleanup-cache.yml
@@ -0,0 +1,44 @@
+name: Cleanup cache
+
+on:
+ schedule:
+ - cron: "0 11 * * *"
+ pull_request:
+ types:
+ - closed
+
+jobs:
+ cleanup:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v4
+
+ - name: Cleanup caches older than 5 days
+ if: github.event_name == 'schedule'
+ uses: MyAlbum/purge-cache@v2
+ with:
+ max-age: 432000
+
+ # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
+ - name: Cleanup on PR close
+ if: github.event_name == 'pull_request'
+ run: |
+ gh extension install actions/gh-actions-cache
+
+ REPO=${{ github.repository }}
+ BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
+
+ echo "Fetching list of cache key"
+ cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
+
+ ## Setting this to not fail the workflow while deleting cache keys.
+ set +e
+ echo "Deleting caches..."
+ for cacheKey in $cacheKeysForPR
+ do
+ gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
+ done
+ echo "Done"
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/congrats.yml b/.github/workflows/congrats.yml
new file mode 100644
index 000000000000..4052bdac8776
--- /dev/null
+++ b/.github/workflows/congrats.yml
@@ -0,0 +1,16 @@
+name: Congratsbot
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ congrats:
+ name: congratsbot
+ if: ${{ github.repository_owner == 'withastro' && github.event.head_commit.message != '[ci] format' }}
+ uses: withastro/automation/.github/workflows/congratsbot.yml@main
+ with:
+ EMOJIS: '🎉,🎊,🧑🚀,🥳,🙌,🚀,👏,<:houston_golden:1068575433647456447>,<:astrocoin:894990669515489301>,<:astro_pride:1130501345326157854>'
+ secrets:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
diff --git a/.github/workflows/continuous_benchmark.yml b/.github/workflows/continuous_benchmark.yml
new file mode 100644
index 000000000000..1b382f8dc6fc
--- /dev/null
+++ b/.github/workflows/continuous_benchmark.yml
@@ -0,0 +1,56 @@
+name: Continuous benchmark
+
+on:
+ workflow_dispatch:
+ pull_request:
+ branches:
+ - main
+ paths:
+ - 'packages/astro/src/**/*.ts'
+ - 'benchmark/**'
+ push:
+ branches:
+ - main
+ paths:
+ - 'packages/astro/src/**/*.ts'
+ - 'benchmark/**'
+
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: true
+ CODSPEED: true
+
+jobs:
+ codspeed:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: write
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build
+ run: pnpm run build
+
+ - name: Run the benchmarks
+ uses: CodSpeedHQ/action@513a19673a831f139e8717bf45ead67e47f00044 # v3.2.0
+ timeout-minutes: 30
+ with:
+ working-directory: ./benchmark
+ run: pnpm bench
+ token: ${{ secrets.CODSPEED_TOKEN }}
+
diff --git a/.github/workflows/dispatch-event.yml b/.github/workflows/dispatch-event.yml
new file mode 100644
index 000000000000..0bca088e3d37
--- /dev/null
+++ b/.github/workflows/dispatch-event.yml
@@ -0,0 +1,62 @@
+name: Dispatch event
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ tags:
+ - '!**'
+
+permissions:
+ contents: read
+ actions: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+env:
+ ASTRO_ADAPTERS_REPO: withastro/adapters
+ ASTRO_STARLIGHT_REPO: withastro/starlight
+ ASTRO_PUSH_MAIN_EVENT: astro-push-main-event
+
+jobs:
+ repository-dispatch:
+ name: Repository dispatch
+ if: github.repository_owner == 'withastro'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Dispatch event on push - adapters
+ if: ${{ github.event_name == 'push' }}
+ uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
+ with:
+ token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
+ repository: ${{ env.ASTRO_ADAPTERS_REPO }}
+ event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
+ client-payload: '{"event": ${{ toJson(github.event) }}}'
+ - name: Dispatch event on push - starlight
+ if: ${{ github.event_name == 'push' }}
+ uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
+ with:
+ token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
+ repository: ${{ env.ASTRO_STARLIGHT_REPO }}
+ event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
+ client-payload: '{"event": ${{ toJson(github.event) }}}'
+ # For testing only, the payload is mocked
+ - name: Dispatch event on workflow dispatch - adapters
+ if: ${{ github.event_name == 'workflow_dispatch' }}
+ uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
+ with:
+ token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
+ repository: ${{ env.ASTRO_ADAPTERS_REPO }}
+ event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
+ client-payload: '{"event": {"head_commit": {"id": "${{ env.GITHUB_SHA }}"}}}'
+ - name: Dispatch event on workflow dispatch - starlight
+ if: ${{ github.event_name == 'workflow_dispatch' }}
+ uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
+ with:
+ token: ${{ secrets.ASTRO_REPOSITORY_DISPATCH }}
+ repository: ${{ env.ASTRO_STARLIGHT_REPO }}
+ event-type: ${{ env.ASTRO_PUSH_MAIN_EVENT }}
+ client-payload: '{"event": {"head_commit": {"id": "${{ env.GITHUB_SHA }}"}}}'
diff --git a/.github/workflows/examples-deploy.yml b/.github/workflows/examples-deploy.yml
new file mode 100644
index 000000000000..91ef304f01e6
--- /dev/null
+++ b/.github/workflows/examples-deploy.yml
@@ -0,0 +1,22 @@
+# This workflow runs when changes to examples are pushed to main.
+# It calls a build hook on Netlify that will redeploy preview.astro.new with the latest changes.
+
+name: Redeploy preview.astro.new
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - 'examples/**'
+ workflow_dispatch:
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Send a POST request to Netlify to rebuild preview.astro.new
+ run: 'curl -X POST -d {} ${{ env.BUILD_HOOK }}'
+ env:
+ BUILD_HOOK: ${{ secrets.NETLIFY_PREVIEWS_BUILD_HOOK }}
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 4db389d24e34..9faaa1886608 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -1,31 +1,15 @@
-name: 'Format Code'
+name: Format
on:
+ workflow_dispatch:
push:
branches:
- main
jobs:
- format:
- runs-on: ubuntu-latest
- steps:
- - name: Check out code using Git
- uses: actions/checkout@v3
- with:
- ref: ${{ github.head_ref }}
- - name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: 16
- cache: 'pnpm'
- - name: Install dependencies
- run: pnpm install
- - name: Format code
- run: pnpm run format
- - name: Commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
- with:
- commit_message: '[ci] format'
- branch: ${{ github.head_ref }}
+ prettier:
+ if: github.repository_owner == 'withastro'
+ uses: withastro/automation/.github/workflows/format.yml@main
+ with:
+ command: "format"
+ secrets: inherit
diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml
new file mode 100644
index 000000000000..b0a0e80c7767
--- /dev/null
+++ b/.github/workflows/issue-labeled.yml
@@ -0,0 +1,30 @@
+name: Issue Labeled
+
+on:
+ issues:
+ types: [labeled]
+
+jobs:
+ reply-labeled:
+ if: github.repository == 'withastro/astro'
+ runs-on: ubuntu-latest
+ steps:
+ - name: remove triage
+ if: contains(github.event.label.description, '(priority)') && contains(github.event.issue.labels.*.name, 'needs triage')
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: "remove-labels"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
+ labels: "needs triage"
+
+ - name: needs repro
+ if: github.event.label.name == 'needs repro'
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: "create-comment, remove-labels"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
+ body: |
+ Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new/repro). Issues marked with `needs repro` will be closed if they have no activity within 3 days.
+ labels: "needs triage"
diff --git a/.github/workflows/issue-needs-repro.yml b/.github/workflows/issue-needs-repro.yml
new file mode 100644
index 000000000000..a859d85ad7ed
--- /dev/null
+++ b/.github/workflows/issue-needs-repro.yml
@@ -0,0 +1,18 @@
+name: Close Issues (needs repro)
+
+on:
+ schedule:
+ - cron: "0 0 * * *"
+
+jobs:
+ close-issues:
+ if: github.repository == 'withastro/astro'
+ runs-on: ubuntu-latest
+ steps:
+ - name: needs repro
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: "close-issues"
+ token: ${{ secrets.GITHUB_TOKEN }}
+ labels: "needs repro"
+ inactive-day: 3
diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml
new file mode 100644
index 000000000000..7171a1b9b7bc
--- /dev/null
+++ b/.github/workflows/issue-opened.yml
@@ -0,0 +1,23 @@
+name: Label issues
+on:
+ issues:
+ types:
+ - reopened
+ - opened
+
+jobs:
+ label_issues:
+ runs-on: ubuntu-latest
+ if: github.repository == 'withastro/astro'
+ permissions:
+ issues: write
+ steps:
+ - uses: actions/github-script@v7
+ with:
+ script: |
+ github.rest.issues.addLabels({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ labels: ["needs triage"]
+ })
diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml
deleted file mode 100644
index cc370ea07ebf..000000000000
--- a/.github/workflows/issue.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: Auto Assign Issues to Project
-
-on:
- issues:
- types: [opened]
-
-env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-jobs:
- auto_assign_issues:
- runs-on: ubuntu-latest
- name: Auto-assign new issues to projects
- steps:
- - name: Assign Bugs to the Bug Tracker
- uses: srggrs/assign-one-project-github-action@1.3.1
- if: github.event.action == 'opened' && startsWith(github.event.issue.title, '🐛 BUG:')
- with:
- project: 'https://github.com/withastro/astro/projects/2'
- column_name: 'Needs Triage'
-
- - name: Assign RFCs to the RFC Tracker
- uses: srggrs/assign-one-project-github-action@1.3.1
- if: github.event.action == 'opened' && startsWith(github.event.issue.title, '💡 RFC:')
- with:
- project: 'https://github.com/withastro/astro/projects/3'
- column_name: 'Discussing'
-
- - name: Assign RFCs to the Docs Tracker
- uses: srggrs/assign-one-project-github-action@1.3.1
- if: github.event.action == 'opened' && startsWith(github.event.issue.title, '📘 DOC:')
- with:
- project: 'https://github.com/withastro/astro/projects/5'
- column_name: 'TODO'
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index 02344ecdbb93..000000000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-name: Main Checks
-
-on:
- push:
- branches:
- - main
-
-env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-# Automatically cancel in-progress actions on the same branch
-concurrency:
- group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
- cancel-in-progress: true
-
-jobs:
- congrats:
- name: congratsbot
- if: ${{ github.repository_owner == 'withastro' }}
- runs-on: ubuntu-latest
- steps:
- - id: setup
- env:
- MESSAGE: ${{ github.event.commits[0].message }}
- run: |
- TRIMMED=$(echo "$MESSAGE" | sed '1!d;q')
- echo "::set-output name=COMMIT_MSG::${TRIMMED}"
- - name: Send a Discord notification when a PR is merged
- env:
- DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
- # DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
- uses: Ilshidur/action-discord@0.3.2
- with:
- args: "**Merged!** ${{ github.event.commits[0].author.name }}: [`${{ steps.setup.outputs.COMMIT_MSG }}`]()"
-
- check_for_update:
- name: Check for Updates
- runs-on: ubuntu-latest
- outputs:
- run_job: ${{ steps.check_files.outputs.run_job }}
- steps:
- - uses: actions/checkout@v3
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
-
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: 16
- cache: 'pnpm'
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Check Modified
- run: pnpm exec changeset status --output ./status.json
-
- - name: Check Output
- id: check_files
- run: |
- output=`echo $(cat status.json)`
- if [[ $output = '{ "changesets": [], "releases": [] }' ]]
- then
- echo 'No changeset found'
- echo "::set-output name=run_job::true"
- else
- echo 'changes found, push to latest skipped'
- echo "::set-output name=run_job::false"
- fi
-
- update:
- name: Update the latest branch
- needs: check_for_update
- if: needs.check_for_update.outputs.run_job == 'true'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - name: Push
- uses: ad-m/github-push-action@master
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- branch: latest
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
deleted file mode 100644
index 251f5517e58b..000000000000
--- a/.github/workflows/nightly.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-name: 'Nightly'
-
-on:
- schedule:
- # * is a special character in YAML so you have to quote this string
- - cron: '0 12 * * *'
- workflow_dispatch:
-
-jobs:
- stat:
- if: github.repository_owner == 'withastro'
- runs-on: ubuntu-latest
- steps:
- - name: Check out code using Git
- uses: actions/checkout@v3
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
-
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: 16
- cache: 'pnpm'
-
- - name: Install dependencies
- run: pnpm install
-
- - name: Collect stats
- run: node scripts/stats/index.js
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Commit changes
- uses: stefanzweifel/git-auto-commit-action@v4
- with:
- commit_message: '[ci] collect stats'
- branch: ${{ github.head_ref }}
-
- lockfile:
- if: github.repository_owner == 'withastro'
- runs-on: ubuntu-latest
- steps:
-
- - name: Check out code using Git
- uses: actions/checkout@v3
-
- - name: Setup PNPM
- uses: pnpm/action-setup@v2.2.1
-
- - name: Setup Node
- uses: actions/setup-node@v3
- with:
- node-version: 16
- cache: 'pnpm'
-
- - name: Upgrade recursive
- run: pnpm upgrade --recursive
-
- - name: Create Pull Request
- id: createpr
- uses: peter-evans/create-pull-request@v3
- with:
- branch: ci/lockfile
- token: ${{ secrets.NIGHTLY_PERSONAL_GITHUB_TOKEN }}
- commit-message: '[ci] update lockfile'
- title: '[ci] update lockfile'
- body: >
- This PR is auto-generated by a nightly GitHub action.
- It should automatically be merged if tests pass.
diff --git a/.github/workflows/preview-comment.yml b/.github/workflows/preview-comment.yml
new file mode 100644
index 000000000000..9fb0f48c3983
--- /dev/null
+++ b/.github/workflows/preview-comment.yml
@@ -0,0 +1,26 @@
+name: Add continuous release label
+
+on:
+ issue_comment:
+ types: [created]
+
+permissions:
+ pull-requests: write
+
+jobs:
+ label:
+ if: ${{ github.repository_owner == 'withastro' && startsWith(github.event.comment.body, '!preview') }}
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check if user has write access
+ uses: lannonbr/repo-permission-check-action@2.0.2
+ with:
+ permission: write
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - run: |
+ gh issue edit ${{ github.event.issue.number }} --add-label "pr: preview" --repo ${{ github.repository }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml
new file mode 100644
index 000000000000..bba55c028eaa
--- /dev/null
+++ b/.github/workflows/preview-release.yml
@@ -0,0 +1,60 @@
+name: Preview release
+
+on:
+ pull_request:
+ branches: [main]
+ types: [opened, synchronize, labeled, ready_for_review]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.number }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+ actions: write
+
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: true
+ ASTRO_TELEMETRY_DISABLED: true
+ # 7 GiB by default on GitHub, setting to 6 GiB
+ # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
+ NODE_OPTIONS: --max-old-space-size=6144
+
+jobs:
+ preview:
+ if: |
+ ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && contains(github.event.pull_request.labels.*.name, 'pr: preview') }}
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ id-token: write
+ issues: write
+ pull-requests: write
+ name: Publish preview release
+ timeout-minutes: 5
+ steps:
+ - name: Disable git crlf
+ run: git config --global core.autocrlf false
+
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build Packages
+ run: pnpm run build
+
+ - name: Publish packages
+ run: pnpx pkg-pr-new publish --pnpm './packages/*' './packages/integrations/*'
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000000..738028a744f9
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,75 @@
+name: Release
+
+on:
+ push:
+ branches:
+ - main
+ - "1-legacy"
+ - "2-legacy"
+ - "3-legacy"
+ - "4-legacy"
+
+defaults:
+ run:
+ shell: bash
+
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: true
+
+jobs:
+ changelog:
+ name: Changelog PR or Release
+ if: ${{ github.repository_owner == 'withastro' }}
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ id-token: write
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build Packages
+ run: pnpm run build
+
+ - name: Create Release Pull Request or Publish
+ id: changesets
+ uses: changesets/action@v1
+ with:
+ # Note: pnpm install after versioning is necessary to refresh lockfile
+ version: pnpm run version
+ publish: pnpm exec changeset publish
+ commit: "[ci] release"
+ title: "[ci] release"
+ env:
+ # Needs access to push to main
+ GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
+ # Needs access to publish to npm
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ - name: Generate Announcement
+ id: message
+ if: steps.changesets.outputs.published == 'true'
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+ run: node .github/scripts/announce.mjs '${{ steps.changesets.outputs.publishedPackages }}'
+
+ - name: Send message on Discord
+ if: steps.changesets.outputs.published == 'true'
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+ uses: Ilshidur/action-discord@0.3.2
+ with:
+ args: "${{ steps.message.outputs.DISCORD_MESSAGE }}"
diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml
new file mode 100644
index 000000000000..542f943ac34a
--- /dev/null
+++ b/.github/workflows/scripts.yml
@@ -0,0 +1,52 @@
+name: Scripts
+
+on:
+ workflow_dispatch:
+ pull_request:
+ branches:
+ - "main"
+ paths:
+ - "packages/astro/src/runtime/client/**/*"
+ - "!packages/astro/src/runtime/client/dev-toolbar/**/*"
+
+# Automatically cancel in-progress actions on the same branch
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ bundle:
+ name: Bundle Size
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v4
+
+ - name: Checkout Main into tmp
+ uses: actions/checkout@v4
+ with:
+ ref: main
+ path: main
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Check Bundle Size
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const { default: script } = await import('${{ github.workspace }}/.github/scripts/bundle-size.mjs')
+ await script({ github, context })
diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml
new file mode 100644
index 000000000000..c12834264cc4
--- /dev/null
+++ b/.github/workflows/snapshot-release.yml
@@ -0,0 +1,169 @@
+name: Create a Snapshot Release
+
+on:
+ workflow_dispatch:
+ issue_comment:
+ types: [created]
+
+defaults:
+ run:
+ shell: bash
+
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ FORCE_COLOR: 1
+
+jobs:
+ snapshot-release:
+ name: Create a snapshot release of a pull request
+ if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && (contains(github.event.comment.body, '!preview') || contains(github.event.comment.body, '/preview') || contains(github.event.comment.body, '!snapshot') || contains(github.event.comment.body, '/snapshot')) }}
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ id-token: write
+ issues: write
+ pull-requests: write
+ steps:
+ - name: Check if user has write access
+ uses: lannonbr/repo-permission-check-action@2.0.2
+ with:
+ permission: write
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract the snapshot name from comment body
+ id: getSnapshotName
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const { body } = context.payload.comment;
+ const PREVIEW_RE = /^[!\/](?:preview|snapshot)\s+(\S*)\s*$/gim;
+ const [_, name] = PREVIEW_RE.exec(body) ?? [];
+ if (name) return name;
+
+ const error = 'Invalid command. Expected: "/preview "'
+ github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: error,
+ })
+ core.setFailed(error)
+ result-encoding: string
+
+ - name: resolve pr refs
+ id: refs
+ uses: eficode/resolve-pr-refs@main
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ steps.refs.outputs.head_ref }}
+ fetch-depth: 0
+
+ - name: Extract base branch from .changeset/config.json
+ id: getBaseBranch
+ run: |
+ baseBranch=$(jq -r '.baseBranch' .changeset/config.json)
+ echo "baseBranch=${baseBranch}" >> $GITHUB_OUTPUT
+
+ - run: git fetch origin ${{ steps.getBaseBranch.outputs.baseBranch }}:${{ steps.getBaseBranch.outputs.baseBranch }}
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ registry-url: "https://registry.npmjs.org"
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build Packages
+ run: pnpm run build
+
+ - name: Bump Package Versions
+ id: changesets
+ run: |
+ pnpm exec changeset status --output status.output.json 2>&1
+ # Snapshots don't work in pre mode. See https://github.com/changesets/changesets/issues/1195
+ pnpm exec changeset pre exit || true
+ pnpm exec changeset version --snapshot ${{ steps.getSnapshotName.outputs.result }}
+
+ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
+ echo "status<<$EOF" >> $GITHUB_OUTPUT
+ echo "$(cat status.output.json)" >> $GITHUB_OUTPUT
+ echo "$EOF" >> $GITHUB_OUTPUT
+ env:
+ # Needs access to run the script
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # Disable color
+ FORCE_COLOR: 0
+ NO_COLOR: 1
+
+ - name: Publish Release
+ id: publish
+ run: |
+ GITHUB_ACTIONS=0 pnpm run build > build.output.txt 2>&1
+ pnpm exec changeset publish --tag experimental--${{ steps.getSnapshotName.outputs.result }} > publish.output.txt 2>&1
+
+ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
+
+ echo "build<<$EOF" >> $GITHUB_OUTPUT
+ echo "$(cat build.output.txt)" >> $GITHUB_OUTPUT
+ echo "$EOF" >> $GITHUB_OUTPUT
+ cat build.output.txt
+
+ echo "publish<<$EOF" >> $GITHUB_OUTPUT
+ echo "$(cat publish.output.txt)" >> $GITHUB_OUTPUT
+ echo "$EOF" >> $GITHUB_OUTPUT
+ cat publish.output.txt
+ env:
+ # Needs access to publish to npm
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+ # Disable color
+ FORCE_COLOR: 0
+ NO_COLOR: 1
+
+ - name: Pull Request Notification
+ uses: actions/github-script@v7
+ env:
+ TAG: ${{ steps.getSnapshotName.outputs.result }}
+ STATUS_DATA: ${{ steps.changesets.outputs.status }}
+ BUILD_LOG: ${{ steps.publish.outputs.build }}
+ PUBLISH_LOG: ${{ steps.publish.outputs.publish }}
+ with:
+ script: |
+ let changeset = { releases: [] };
+ try {
+ changeset = JSON.parse(process.env.STATUS_DATA);
+ } catch (e) {}
+ let message = 'Snapshots have been released for the following packages:'
+ for (const release of changeset.releases) {
+ if (release.type === 'none') continue;
+ message += `\n- \`${release.name}@experimental--${process.env.TAG}\``;
+ }
+
+ function details(title, body) {
+ message += '\n';
+ message += `${title}`
+ message += '\n\n```\n';
+ message += body;
+ message += '\n```\n\n';
+ }
+
+ details('Publish Log', process.env.PUBLISH_LOG);
+ details('Build Log', process.env.BUILD_LOG);
+
+ github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: message,
+ })
diff --git a/.github/workflows/sync-examples.yml b/.github/workflows/sync-examples.yml
new file mode 100644
index 000000000000..8603a951e8a9
--- /dev/null
+++ b/.github/workflows/sync-examples.yml
@@ -0,0 +1,88 @@
+name: Sync examples
+
+on:
+ workflow_dispatch:
+ inputs:
+ skip-unchanged-check:
+ type: boolean
+ default: false
+ dry-run:
+ type: boolean
+ default: false
+ push:
+ branches:
+ - main
+
+# Automatically cancel in-progress actions on the same branch
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ # Allow auto-branch-sync-action to git push
+ contents: write
+
+jobs:
+ sync:
+ name: Sync branches
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 2 # fetch 2 to compare with previous commit for changes
+
+ - name: Detect changesets
+ uses: bluwy/detect-changesets-action@v1
+ id: detect
+
+ # We only do sync if there are no changesets, so we don't accidentally allow users
+ # to clone examples that may rely on unreleased code
+
+ - name: Sync from main branch to latest and examples/* branches
+ if: steps.detect.outputs.has-changesets == 'false' && github.ref == 'refs/heads/main'
+ uses: bluwy/auto-branch-sync-action@v1
+ with:
+ map: |
+ / -> latest
+ /examples/* -> examples/*
+ skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
+ dry-run: ${{ inputs.dry-run == true }}
+
+ - name: Check .changeset/pre.json for matching tag
+ if: steps.detect.outputs.has-changesets == 'false' && github.ref == 'refs/heads/next'
+ id: check-pre-mode
+ run: |
+ if [ -f ./.changeset/pre.json ]; then
+ if grep -q '"tag": "alpha"' ./.changeset/pre.json; then
+ echo "alpha=true" >> $GITHUB_OUTPUT
+ elif grep -q '"tag": "beta"' ./.changeset/pre.json; then
+ echo "beta=true" >> $GITHUB_OUTPUT
+ elif grep -q '"tag": "rc"' ./.changeset/pre.json; then
+ echo "rc=true" >> $GITHUB_OUTPUT
+ fi
+ fi
+
+ - name: Sync from next branch to alpha branch
+ if: steps.detect.outputs.has-changesets == 'false' && steps.check-pre-mode.outputs.alpha == 'true'
+ uses: bluwy/auto-branch-sync-action@v1
+ with:
+ map: / -> alpha
+ skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
+ dry-run: ${{ inputs.dry-run == true }}
+
+ - name: Sync from next branch to beta branch
+ if: steps.detect.outputs.has-changesets == 'false' && steps.check-pre-mode.outputs.beta == 'true'
+ uses: bluwy/auto-branch-sync-action@v1
+ with:
+ map: / -> beta
+ skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
+ dry-run: ${{ inputs.dry-run == true }}
+
+ - name: Sync from next branch to rc branch
+ if: steps.detect.outputs.has-changesets == 'false' && steps.check-pre-mode.outputs.rc == 'true'
+ uses: bluwy/auto-branch-sync-action@v1
+ with:
+ map: / -> rc
+ skip-unchanged-check: ${{ inputs.skip-unchanged-check == true }}
+ dry-run: ${{ inputs.dry-run == true }}
diff --git a/.github/workflows/test-hosts.yml b/.github/workflows/test-hosts.yml
new file mode 100644
index 000000000000..546d82e07a4b
--- /dev/null
+++ b/.github/workflows/test-hosts.yml
@@ -0,0 +1,48 @@
+name: Hosted tests
+
+on:
+ schedule:
+ - cron: '0 0 * * 0'
+
+env:
+ ASTRO_TELEMETRY_DISABLED: true
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
+ VERCEL_ORG_ID: ${{ secrets.VERCEL_TEST_ORG_ID }}
+ VERCEL_PROJECT_ID: ${{ secrets.VERCEL_TEST_PROJECT_ID }}
+ VERCEL_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
+ FORCE_COLOR: true
+
+jobs:
+ test:
+ name: Run tests
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Setup PNPM
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build Astro
+ run: pnpm turbo build --filter astro --filter @astrojs/vercel
+
+ - name: Build test project
+ working-directory: ./packages/integrations/vercel/test/hosted/hosted-astro-project
+ run: pnpm run build
+
+ - name: Deploy to Vercel
+ working-directory: ./packages/integrations/vercel/test/hosted/hosted-astro-project
+ run: pnpm dlx vercel --prod --prebuilt
+
+ - name: Test
+ run: pnpm run test:e2e:hosts
diff --git a/.gitignore b/.gitignore
index 30c24d1e9698..d6a28ec1b19a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,21 +1,42 @@
node_modules/
dist/
-.output/
*.tsbuildinfo
.DS_Store
.vercel
+.netlify
_site/
scripts/smoke/*-main/
scripts/memory/project/src/pages/
+benchmark/projects/
+benchmark/results/
+test-results/
*.log
package-lock.json
.turbo/
-
-# ignore top-level vscode settings
-/.vscode/settings.json
+.eslintcache
+.pnpm-store
# do not commit .env files or any files that end with `.env`
*.env
-!packages/astro/vendor/vite/dist
+packages/astro/src/**/*.prebuilt.ts
+packages/astro/src/**/*.prebuilt-dev.ts
+packages/astro/test/units/_temp-fixtures/*
+!packages/astro/test/units/_temp-fixtures/package.json
packages/integrations/**/.netlify/
+
+# exclude IntelliJ/WebStorm stuff
+.idea
+
+# ignore content collection generated files
+packages/**/test/**/fixtures/**/.astro/
+packages/**/test/**/fixtures/**/env.d.ts
+packages/**/e2e/**/fixtures/**/.astro/
+packages/**/e2e/**/fixtures/**/env.d.ts
+examples/**/.astro/
+examples/**/env.d.ts
+
+# make it easy for people to add project-specific Astro settings that they don't
+# want to share with others (see
+# https://github.com/withastro/astro/pull/11759#discussion_r1721444711)
+*.code-workspace
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 28a12af2dd2f..000000000000
--- a/.gitmodules
+++ /dev/null
@@ -1,8 +0,0 @@
-[submodule "smoke/docs"]
- path = smoke/docs
- url = git@github.com:withastro/docs.git
- branch = main
-[submodule "smoke/astro.build"]
- path = smoke/astro.build
- url = git@github.com:withastro/astro.build.git
- branch = main
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile
deleted file mode 100644
index e6dbb0118361..000000000000
--- a/.gitpod.Dockerfile
+++ /dev/null
@@ -1,8 +0,0 @@
-FROM gitpod/workspace-node
-
-# Install latest pnpm
-RUN pnpm i -g pnpm
-
-# Install deno in gitpod
-RUN curl -fsSL https://deno.land/x/install/install.sh | sh
-RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-deno && echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno
diff --git a/.gitpod.yml b/.gitpod.yml
index 97ce81997b5e..367ddf4feee3 100644
--- a/.gitpod.yml
+++ b/.gitpod.yml
@@ -1,9 +1,11 @@
---
-image:
- file: .gitpod.Dockerfile
# Commands to start on workspace startup
tasks:
- - init: |
+ - before: |
+ # Get latest pnpm version, in case the custom docker image was not updated
+ # Until this issue gets resolved - https://github.com/gitpod-io/gitpod/issues/12551
+ curl -fsSL https://get.pnpm.io/install.sh | SHELL=`which bash` bash -
+ init: |
pnpm install
pnpm run build
command: |
@@ -14,7 +16,7 @@ vscode:
- esbenp.prettier-vscode
- dbaeumer.vscode-eslint
ports:
- - port: 3000
+ - port: 4321
onOpen: open-preview
github:
prebuilds:
diff --git a/.gitpod/gitpod-setup.sh b/.gitpod/gitpod-setup.sh
index 883b3b1c97f7..b1ba15d2d84c 100755
--- a/.gitpod/gitpod-setup.sh
+++ b/.gitpod/gitpod-setup.sh
@@ -3,6 +3,9 @@
# Convert context URL to an array
mapfile -t CONTEXT_URL_ITEMS < <(echo "$GITPOD_WORKSPACE_CONTEXT_URL" | tr '/' '\n')
+# Install latest pnpm
+curl -fsSL https://get.pnpm.io/install.sh | SHELL=`which bash` bash -
+
# Check if Gitpod started from a specific example directory in the repository
if [ "${CONTEXT_URL_ITEMS[7]}" = "examples" ]; then
EXAMPLE_PROJECT=${CONTEXT_URL_ITEMS[8]}
@@ -15,9 +18,9 @@ else
fi
# Wait for VSCode to be ready (port 23000)
-gp await-port 23000 > /dev/null 2>&1
+gp ports await 23000 > /dev/null 2>&1
-echo "Loading example project:" $EXAMPLE_PROJECT
+echo "Loading example project: $EXAMPLE_PROJECT"
# Go to the requested example project
cd "$GITPOD_REPO_ROOT"/examples/"$EXAMPLE_PROJECT" || exit
diff --git a/.npmrc b/.npmrc
index 492d2035781f..4912828b6bdd 100644
--- a/.npmrc
+++ b/.npmrc
@@ -2,20 +2,13 @@
prefer-workspace-packages=true
link-workspace-packages=true
save-workspace-protocol=false # This prevents the examples to have the `workspace:` prefix
+auto-install-peers=false
-shamefully-hoist=true
-# TODO: We would like to move to individual opt-in hoisting, but Astro was not originally
-# written with this in mind. In the future, it would be good to hoist individual packages only.
-# public-hoist-pattern[]=autoprefixer
-# public-hoist-pattern[]=astro
-# public-hoist-pattern[]=remark-*
-# public-hoist-pattern[]=rehype-*
-# public-hoist-pattern[]=react
-# public-hoist-pattern[]=react-dom
-# public-hoist-pattern[]=preact
-# public-hoist-pattern[]=preact-render-to-string
-# public-hoist-pattern[]=vue
-# public-hoist-pattern[]=svelte
-# public-hoist-pattern[]=solid-js
-# public-hoist-pattern[]=lit
-# public-hoist-pattern[]=@webcomponents/template-shadowroot
+# Vite's esbuild optimizer has trouble optimizing `@astrojs/lit/client-shim.js`
+# which imports this dependency.
+public-hoist-pattern[]=@webcomponents/template-shadowroot
+# There's a lit dependency duplication somewhere causing multiple Lit versions error.
+public-hoist-pattern[]=*lit*
+# `astro sync` could try to import `@astrojs/db` but could fail due to linked dependencies in the monorepo.
+# We hoist it here so that it can easily resolve `@astrojs/db` without hardcoded handling.
+public-hoist-pattern[]=@astrojs/db
diff --git a/.nvmrc b/.nvmrc
index 31102b28de6a..4a1f488b6c3b 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-14.18.1
+18.17.1
diff --git a/.prettierignore b/.prettierignore
index 7c89fbaf5aef..64e94860fa24 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,23 +1,30 @@
-# To be removed with ".astro" parsing is ready
-# Also, be sure to remove "pluginSearchDirs" from config
-**/*.astro
+# Benchmark artifacts
+benchmark/projects/
+benchmark/results/
# Deep Directories
**/dist
-**/.output
**/smoke
**/node_modules
**/fixtures
**/vendor
**/.vercel
-examples/docs/**/*.md
-examples/blog/**/*.md
+
+# Short-term need to format
+!packages/db/test/fixtures
# Directories
.github
.changeset
# Files
-README.md
-packages/webapi/mod.d.ts
pnpm-lock.yaml
+
+# Formatted by Biome
+**/*.json
+**/*.js
+**/*.ts
+**/*.tsx
+**/*.jsx
+**/*.mjs
+**/*.cjs
diff --git a/.prettierrc.json b/.prettierrc.json
deleted file mode 100644
index b0a1a2a0757f..000000000000
--- a/.prettierrc.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "printWidth": 100,
- "semi": true,
- "singleQuote": true,
- "tabWidth": 2,
- "trailingComma": "es5",
- "useTabs": true,
- "overrides": [
- {
- "files": [".*", "*.json", "*.md", "*.toml", "*.yml"],
- "options": {
- "useTabs": false
- }
- }
- ],
- "pluginSearchDirs": ["./assets"]
-}
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index d8411afe0257..ea69b5c70466 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -3,7 +3,8 @@
"astro-build.astro-vscode",
"esbenp.prettier-vscode",
"editorconfig.editorconfig",
- "dbaeumer.vscode-eslint"
+ "dbaeumer.vscode-eslint",
+ "biomejs.biome"
],
"unwantedRecommendations": []
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000000..97aeabec0f36
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,21 @@
+{
+ "[json]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "[javascript]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "[typescript]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "[javascriptreact]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "[typescriptreact]": {
+ "editor.defaultFormatter": "biomejs.biome"
+ },
+ "editor.codeActionsOnSave": {
+ "quickFix.biome": "explicit",
+ "source.fixAll.biome": "explicit"
+ }
+}
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index 63266fdec162..000000000000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, sex characteristics, gender identity and expression,
-level of experience, education, socio-economic status, nationality, personal
-appearance, race, religion, or sexual identity and orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-- Using welcoming and inclusive language
-- Being respectful of differing viewpoints and experiences
-- Gracefully accepting constructive criticism
-- Focusing on what is best for the community
-- Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-- The use of sexualized language or imagery and unwelcome sexual attention or
- advances
-- Trolling, insulting/derogatory comments, and personal or political attacks
-- Public or private harassment
-- Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-- Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-All complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-See [GOVERNANCE.md](GOVERNANCE.md#Moderation) for instructions on reporting a Code of Conduct violation and a full description of the review process.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
-
-[homepage]: https://www.contributor-covenant.org
-
-For answers to common questions about this code of conduct, see
-https://www.contributor-covenant.org/faq
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9ff3bae3a120..d44be03b8ce3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,22 +2,25 @@
We welcome contributions of any size and skill level. As an open source project, we believe in giving back to our contributors and are happy to help with guidance on PRs, technical writing, and turning any feature idea into a reality.
-> **Tip for new contributors:**
-> Take a look at [https://github.com/firstcontributions/first-contributions](https://github.com/firstcontributions/first-contributions) for helpful information on contributing
+> [!Tip]
+>
+> **For new contributors:** Take a look at [https://github.com/firstcontributions/first-contributions](https://github.com/firstcontributions/first-contributions) for helpful information on contributing
## Quick Guide
-### Prerequisite
+### Prerequisites
```shell
-node: "^14.15.0 || >=16.0.0"
-pnpm: "^7.0.0"
+node: "^>=18.17.1"
+pnpm: "^9.12.1"
# otherwise, your build will fail
```
+We recommend using Corepack, [read PNPM docs](https://pnpm.io/installation#using-corepack).
+
### Setting up your local repo
-Astro uses pnpm workspaces, so you should **always run `pnpm install` from the top-level project directory.** running `pnpm install` in the top-level project root will install dependencies for `astro`, and every package in the repo.
+Astro uses pnpm workspaces, so you should **always run `pnpm install` from the top-level project directory**. Running `pnpm install` in the top-level project root will install dependencies for `astro`, and every package in the repo.
```shell
git clone && cd ...
@@ -31,6 +34,24 @@ In [#2254](https://github.com/withastro/astro/pull/2254) a `.git-blame-ignore-re
git config --local blame.ignoreRevsFile .git-blame-ignore-revs
```
+To automatically handle merge conflicts in `pnpm-lock.yaml`, you should run the following commands locally.
+
+```shell
+pnpm add -g @pnpm/merge-driver
+pnpm dlx npm-merge-driver install --driver-name pnpm-merge-driver --driver "pnpm-merge-driver %A %O %B %P" --files pnpm-lock.yaml
+```
+
+### Using GitHub Codespaces for development
+
+To get started, create a codespace for this repository by clicking this 👇
+
+[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro)
+
+Your new codespace will open in a web-based version of Visual Studio Code. All development dependencies will be preinstalled, and the tests will run automatically ensuring you've got a green base from which to start working.
+
+> [!Note]
+> Dev containers is now an open spec which is supported by [GitHub Codespaces](https://github.com/codespaces) and [other supporting tools](https://containers.dev/supporting).
+
### Development
```shell
@@ -40,11 +61,27 @@ pnpm run dev
pnpm run build
```
+**How can I test my changes while contributing to the repository?**
+
+During the development process, you may want to test your changes to ensure they are working as expected. Here are a few ways to do it:
+
+1. Run any of the examples in the `/examples` folder. They are linked to use the local Astro source code, so you can see the effects of your changes.
+
+ ```shell
+ pnpm --filter @example/minimal run dev
+ ```
+
+2. Write a test and run it. This is useful if you're making a specific fix and want to see if your changes are working as expected.
+
+3. Create a separate project and use your local Astro through [`pnpm link`](https://pnpm.io/cli/link). This is helpful if you're making bigger changes and want to test them in a separate project.
+
+Overall, it's up to personal preference which method to use. For smaller changes, using the examples folder may be sufficient. For larger changes, using a separate project may be more appropriate.
+
#### Debugging Vite
You can debug vite by prefixing any command with `DEBUG` like so:
-```
+```shell
DEBUG=vite:* astro dev # debug everything in Vite
DEBUG=vite:[name] astro dev # debug specific process, e.g. "vite:deps" or "vite:transform"
```
@@ -54,11 +91,97 @@ DEBUG=vite:[name] astro dev # debug specific process, e.g. "vite:deps" or "vit
```shell
# run this in the top-level project root to run all tests
pnpm run test
-# run only a few tests, great for working on a single feature
-# (example - `pnpm run test:match "RSS"` runs `astro-rss.test.js`)
+# run only a few tests in the `astro` package, great for working on a single feature
+# (example - `pnpm run test:match "cli"` runs tests with "cli" in the name)
pnpm run test:match "$STRING_MATCH"
+# run tests on another package
+# (example - `pnpm --filter @astrojs/rss run test` runs `packages/astro-rss/test/rss.test.js`)
+pnpm --filter $STRING_MATCH run test
+```
+
+Most tests use [`mocha`](https://mochajs.org) as the test runner. We're slowly migrating to use [`node:test`](https://nodejs.org/api/test.html) instead through the custom [`astro-scripts test`](./scripts/cmd/test.js) command. For packages that use `node:test`, you can run these commands in their directories:
+
+```shell
+# run all of the package's tests
+pnpm run test
+# run only a few tests in the package
+# (example - `pnpm run test -m "cli"` runs tests with "cli" in the name)
+pnpm run test -m "$STRING_MATCH"
+# run a single test file, you can use `node --test` directly
+node --test ./test/foo.test.js
+```
+
+#### Running a single test
+
+Sometimes you want to run a single test case (`it` or `describe`) or a single test file. You can do so by using Node.js.
+
+To run a single test file, for example `test/astro-basic.test.js`:
+
+```shell
+node --test test/astro-basic.test.js
+```
+
+If you wish to run a single test case, you have to postfix `it` and `describe` functions with `.only`:
+
+```diff
+// test/astro-basic.test.js
+- describe("description", () => {
++ describe.only("description", () => {
+- it("description", () => {
++ it.only("description", () => {})
+})
+```
+
+Then, you have to pass the `--test-only` option to the Node.js:
+
+```shell
+node --test --test-only test/astro-basic.test.js
+```
+
+> [!WARNING]
+>
+> 1. If you have nested `describe`, all of them must postfix with `.only`
+> 2. `--test-only` and `--test` must be placed **before** declaring the path to the file. Failing to do so will test all files
+
+#### Debugging tests in CI
+
+There might be occasions where some tests fail in certain CI runs due to some timeout issue. If this happens, it will be very difficult to understand which file cause the timeout. That's caused by come quirks of the Node.js test runner combined with our architecture.
+
+To understand which file causes the issue, you can modify the `test` script inside the `package.json` by adding the `--parallel` option:
+
+```diff
+{
+- "test": "astro-scripts test \"test/**/*.test.js\"",
++ "test": "astro-scripts test --parallel \"test/**/*.test.js\"",
+}
```
+Save the change and **push it** to your PR. This change will make the test CI slower, but it will allow to see which files causes the timeout. Once you fixed the issue **revert the change and push it**.
+
+#### E2E tests
+
+Certain features, like HMR and client hydration, need end-to-end tests to verify functionality in the dev server. [Playwright](https://playwright.dev/) is used to test against the dev server.
+
+```shell
+# run this in the top-level project root to run all E2E tests
+pnpm run test:e2e
+# run only a few tests, great for working on a single feature
+# (example - `pnpm run test:e2e:match "Tailwind CSS" runs `tailwindcss.test.js`)
+pnpm run test:e2e:match "$STRING_MATCH"
+```
+
+**When should you add E2E tests?**
+
+Any tests for `astro build` output should use the main `mocha` tests rather than E2E - these tests will run faster than having Playwright start the `astro preview` server.
+
+If a test needs to validate what happens on the page after it's loading in the browser, that's a perfect use for E2E dev server tests, i.e. to verify that hot-module reloading works in `astro dev` or that components were client hydrated and are interactive.
+
+#### Creating tests
+
+When creating new tests, it's best to reference other existing test files and replicate the same setup. Some other tips include:
+
+- When re-using a fixture multiple times with different configurations, you should also configure unique `outDir`, `build.client`, and `build.server` values so the build output runtime isn't cached and shared by ESM between test runs.
+
### Other useful commands
```shell
@@ -83,22 +206,82 @@ pnpm exec changeset
### Running benchmarks
-We have benchmarks to keep performance under control. You can run these by running (from the project root):
+We have benchmarks to keep performance under control. They are located in the `benchmarks` directory, and it exposes a CLI you can use to run them.
+
+You can run all available benchmarks sequentially by running (from the project root):
```shell
-pnpm run benchmark --filter astro
+pnpm run benchmark
```
-Which will fail if the performance has regressed by **10%** or more.
-
-To update the times cd into the `packages/astro` folder and run the following:
+To run a specific benchmark only, you can add the name of the benchmark after the command:
```shell
-node test/benchmark/build.bench.js --save
-node test/benchmark/dev.bench.js --save
+pnpm run benchmark memory
+```
+
+Use `pnpm run benchmark --help` to see all available options.
+
+To run these benchmarks in a PR on GitHub instead of using the CLI, you can comment `!bench`. The benchmarks will run on both the PR branch and the `main` branch, and the results will be posted as a new comment.
+
+To run only a specific benchmark on CI, add its name after the command in your comment, for example, `!bench memory`.
+
+## For maintainers
+
+This paragraph provides some guidance to the maintainers of the monorepo. The guidelines explained here aren't necessarily followed by other repositories of the same GitHub organisation.
+
+### Issue triaging workflow
+
+```mermaid
+graph TD;
+ start{Followed issue\ntemplate?}
+ start --NO--> close1[Close and ask to\nfollow template]
+ start --YES--> dupe{Is duplicate?}
+ dupe --YES--> close2[Close and point\nto duplicate]
+ dupe --NO--> repro{Has proper\nreproduction?}
+ repro --NO--> close3[Label: 'needs reproduction'\nbot will auto close if no update\nhas been made in 3 days]
+ repro --YES--> real{Is actually a bug?}
+ real --NO--> maybefeat{Is it a feature request?}
+ maybefeat -- YES --> roadmap[Close the issue.\n Point user to the roadmap.]
+ maybefeat -- NO --> intended{Is the intended\nbehaviour?}
+ intended --YES--> explain[Explain and close\npoint to docs if needed]
+ intended --NO--> open[Add label 'needs discussion'\nRemove 'needs triage' label]
+ real --YES--> real2["1. Remove 'needs triage' label\n2. Add related feature label if\napplicable (e.g. 'feat: ssr')\n3. Add priority and meta labels (see below)"]
+ real2 --> tolabel[Use the framework below to decide the priority of the issue,\nand choose the correct label]
+
```
-Which will update the build and dev benchmarks.
+### Assign priority to bugs
+
+The Astro project has five levels of priority to issues, where `p5` is the highest in priority, and `p1` is the lowest in priority.
+
+- `p5`: the bug impacts the majority of Astro projects, it doesn't have a workaround and makes Astro unusable/unstable.
+
+ Some examples:
+
+ - the dev server crashes;
+ - the build breaks and doesn't complete;
+ - huge regressions in terms of performance;
+
+ Bugs violate the documentation/intended behaviour of the feature, although sometimes the documentation might not cover possible edge cases.
+
+ Usually we **don't** assign this priority to packages that **aren't** `astro`, but that can change.
+
+- `p4`: the bug impacts _many_ Astro projects, it doesn't have a workaround but Astro is still stable/usable.
+- `p3`: any bug that doesn't fall in the `p4` or `p5` category. If the documentation doesn't cover
+ the case reported by the user, it's useful to initiate a discussion via the `"needs discussion"` label. Seek opinions from OP and other maintainers.
+- `p2`: all the bugs that have workarounds.
+- `p1`: very minor bug, that impacts a small amount of users. Sometimes it's an edge case and it's easy to fix. Very useful if you want to assign the fix to a first-time contributor.
+
+> [!IMPORTANT]
+> The priority of a bug isn't set on stone. It can change based on different factors.
+
+Assigning labels isn't always easy and many times the distinction between the different levels of priority is blurry, hence try to follow these guidelines:
+
+- When assigning a `p2`, **always** add a comment that explains the workaround. If a workaround isn't provided, ping the person that assigned the label and ask them to provide one.
+- Astro has **many** features, but there are some that have a larger impact than others: development server, build command, HMR (TBD, we don't have a page that explains expectations of HMR in Astro), **evident** regressions in performance.
+- In case the number of reactions of an issue grows, the number of users affected grows, or a discussion uncovers some insights that weren't clear before, it's OK to change the priority of the issue. The maintainer **should** provide an explanation when assigning a different label.
+ As with any other contribution, triaging is voluntary and best-efforts. We welcome and appreciate all the help you're happy to give (including reading this!) and nothing more. If you are not confident about an issue, you are welcome to leave an issue untriaged for someone who would have more context, or to bring it to their attention.
## Code Structure
@@ -106,12 +289,12 @@ Server-side rendering (SSR) can be complicated. The Astro package (`packages/ast
- `components/`: Built-in components to use in your project (e.g. `import Code from 'astro/components/Code.astro'`)
- `src/`: Astro source
- - `@types/`: TypeScript types. These are centralized to cut down on circular dependencies
+ - `types/`: TypeScript types. These are centralized to cut down on circular dependencies
- `cli/`: Code that powers the `astro` CLI command
- `core/`: Code that executes **in the top-level scope** (in Node). Within, you’ll find code that powers the `astro build` and `astro dev` commands, as well as top-level SSR code.
- `runtime/`: Code that executes **in different scopes** (i.e. not in a pure Node context). You’ll have to think about code differently here.
- `client/`: Code that executes **in the browser.** Astro’s partial hydration code lives here, and only browser-compatible code can be used.
- - `server/`: Code that executes **inside Vite’s SSR.** Though this is a Node environment inside, this will be executed independently from `core/` and may have to be structured differently.
+ - `server/`: Code that executes **inside Vite’s SSR.** Though this is a Node environment inside, this will be executed independently of `core/` and may have to be structured differently.
- `vite-plugin-*/`: Any Vite plugins that Astro needs to run. For the most part, these also execute within Vite similar to `src/runtime/server/`, but it’s also helpful to think about them as independent modules. _Note: at the moment these are internal while they’re in development_
### Thinking about SSR
@@ -124,9 +307,25 @@ There are 3 contexts in which code executes:
Understanding in which environment code runs, and at which stage in the process, can help clarify thinking about what Astro is doing. It also helps with debugging, for instance, if you’re working within `src/core/`, you know that your code isn’t executing within Vite, so you don’t have to debug Vite’s setup. But you will have to debug vite inside `runtime/server/`.
+## Branches
+
+### `main`
+
+Active Astro development happens on the [`main`](https://github.com/withastro/astro/tree/main) branch. `main` always reflects the latest code.
+
+> [!Note]
+> During certain periods, we put `main` into a [**prerelease**](https://github.com/changesets/changesets/blob/main/docs/prereleases.md#prereleases) state. Read more about [Releasing Astro](#releasing-astro).
+
+### `latest`
+
+The **stable** release of Astro can always be found on the [`latest`](https://github.com/withastro/astro/tree/latest) branch. `latest` is automatically updated every time we publish a stable (not prerelease) version of Astro.
+
+By default, `create-astro` and [astro.new](https://astro.new) point to this branch.
+
## Releasing Astro
-_Note: Only [core maintainers (L3+)](https://github.com/withastro/astro/blob/main/GOVERNANCE.md#level-3-l3---core-maintainer) can release new versions of Astro._
+> [!Note]
+> Only [core maintainers (L3+)](https://github.com/withastro/.github/blob/main/GOVERNANCE.md#level-3-l3---core) can release new versions of Astro.
The repo is set up with automatic releases, using the changeset GitHub action & bot.
@@ -136,48 +335,57 @@ To release a new version of Astro, find the `Version Packages` PR, read it over,
Our release tool `changeset` has a feature for releasing "snapshot" releases from a PR or custom branch. These are npm package publishes that live temporarily, so that you can give users a way to test a PR before merging. This can be a great way to get early user feedback while still in the PR review process.
+To run `changeset version` locally, you'll need to create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) and set it as a `GITHUB_TOKEN` environment variable.
+
To release a snapshot, run the following locally:
```shell
-# Note: XXX should be a keyword to identify this release. Ex: `--snapshot routing` & `--tag next--routing`
-
-# 1:
-pnpm exec changeset version --snapshot XXX
-# 2: (Manual) review the diff, and make sure that you're not releasing more than you need to.
+# Notes:
+# - YYY should be a keyword to identify this release. Ex: `--snapshot routing` & `--tag next--routing`
+# - Use npm/npx instead of pnpm, since npm handles registry login, authentication and publishing.
+# - Adding GITHUB_TOKEN in the command adds that token to your bash history. Set a short expiration!
+
+# 1: Tag the new release versions
+GITHUB_TOKEN=XXX npx changeset version --snapshot YYY
+# 2: Review the diff, and make sure that you're not releasing more than you need to.
git checkout -- examples/
-# 3:
-pnpm run release --tag next--XXX
-# 4: (Manual) review the publish, and if you're happy then you can throw out all local changes
+# 3: Release
+npm run release --tag next--YYY
+# 4: If you're satisfied, you can now throw out all local changes
git reset --hard
```
-Full documentation: https://github.com/atlassian/changesets/blob/main/docs/snapshot-releases.md
+By default, every package with a changeset will be released. If you only want to target a smaller subset of packages for release, you can consider clearing out the `.changesets` directory to replace all existing changesets with a single changeset of only the packages that you want to release. Just be sure not to commit or push this to `main`, since it will destroy existing changesets that you will still want to eventually release.
+
+Full documentation: https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md
### Releasing `astro@next` (aka "prerelease mode")
Sometimes, the repo will enter into "prerelease mode". In prerelease mode, our normal release process will publish npm versions under the `next` dist-tag, instead of the default `latest` tag. We do this from time-to-time to test large features before sharing them with the larger Astro audience.
-While in prerelease mode, follow the normal release process to release `astro@next` instead of `astro@latest`. To release `astro@latest` instead, see [Releasing `astro@latest` while in prerelease mode](#user-content-releasing-astrolatest-while-in-prerelease-mode).
+While in prerelease mode, follow the normal release process to release `astro@next` instead of `astro@latest`. To release `astro@latest` instead, see [Releasing `astro@latest` while in prerelease mode](#releasing-astrolatest-while-in-prerelease-mode).
-Full documentation: https://github.com/atlassian/changesets/blob/main/docs/prereleases.md
+Full documentation: https://github.com/changesets/changesets/blob/main/docs/prereleases.md
### Entering prerelease mode
-If you have gotten permission from the core contributors, you can enter into prerelease mode by following the following steps:
+If you have gotten permission from the core contributors, you can enter into prerelease mode with the following steps:
- Run: `pnpm exec changeset pre enter next` in the project root
+- Update `.changeset/config.json` with `"baseBranch": "next"` (for easier changesets creation)
- Create a new PR from the changes created by this command
-- Review, approve, and more the PR to enter prerelease mode.
-- If successful, The "Version Packages" PR (if one exists) will now say "Version Packages (next)".
+- Review, approve, and merge the PR to enter prerelease mode.
+- If successful, The "[ci] release" PR (if one exists) will now say "[ci] release (next)".
### Exiting prerelease mode
-Exiting prerelease mode should happen once an experimental release is ready to go from `npm install astro@next` to `npm install astro`. Only a core contributor run these steps. These steps should be run before
+Exiting prerelease mode should happen once an experimental release is ready to go from `npm install astro@next` to `npm install astro`. Only a core contributor can run these steps:
- Run: `pnpm exec changeset pre exit` in the project root
+- Update `.changeset/config.json` with `"baseBranch": "main"`
- Create a new PR from the changes created by this command.
-- Review, approve, and more the PR to enter prerelease mode.
-- If successful, The "Version Packages (next)" PR (if one exists) will now say "Version Packages".
+- Review, approve, and merge the PR to enter prerelease mode.
+- If successful, The "[ci] release (next)" PR (if one exists) will now say "[ci] release".
### Releasing `astro@latest` while in prerelease mode
diff --git a/FUNDING.md b/FUNDING.md
deleted file mode 100644
index 8a29c9011617..000000000000
--- a/FUNDING.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Astro Project Funding
-
-_Last Updated: 02-09-2022_
-
-## Raising Funds
-
-Astro is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for Astro is not sustainable without proper financial backing. We need your help to achieve this.
-
-Learn more about sponsorship on our [Open Collective.](https://opencollective.com/astrodotbuild).
-
-### Why Open Collective?
-
-- **Full Transparency.** Everyone gets to see where money is coming from and where it's going.
-- **Individual and Corporate Sponsors.** Open Collective makes it easy for both individuals and companies to sponsor open source projects.
-- **Potential Tax Benefits.** Because funds are paid to the Open Source Collective, a 501(c)(6) organization in the U.S., there may be tax benefits for some donors (please check with your accountant).
-- **Automatic Invoicing.** For corporate sponsors, Open Collective automatically generates and sends invoices for tracking purposes.
-- **Open Participation.** Anyone can request reimbursement for funds spent helping the Astro project and Astro can pay out to anyone.
-
-_List borrowed from [ESLint: "Funding ESLint's Future."](https://eslint.org/blog/2019/02/funding-eslint-future)_
-
-## Distributing Funds
-
-100% of money raised is invested back into the community. Every dollar spent **must** support and/or improve Astro in some way.
-
-See all past expenses on our [Open Collective.](https://opencollective.com/astrodotbuild)
-
-Below is a (non-exhaustive) list of how we plan to distribute raised funds:
-
-- **Swag!** Creating stickers, t-shirts, etc. for sponsors and community members.
-- **Improve documentation.**
-- **Improve translations.**
-- **Improve website.**
-- **User research.**
-- **Sponsoring conferences.**
-- **Sponsoring community members to represent Astro at meetups, conferences, etc.**
-- **Dedicated support for GitHub, Discord, Stack Overflow, etc.**
-
-## Eligibility
-
-**Employees of The Astro Technology Company are not eligible to receive funds from Open Collective.** These funds exist solely to serve the larger Astro community.
diff --git a/FUNDING.yml b/FUNDING.yml
deleted file mode 100644
index 7ace19ae2d3a..000000000000
--- a/FUNDING.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# These are supported funding model platforms
-
-github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: astrodotbuild
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/GOVERNANCE.md b/GOVERNANCE.md
deleted file mode 100644
index 0ed5237650a7..000000000000
--- a/GOVERNANCE.md
+++ /dev/null
@@ -1,379 +0,0 @@
-# Governance
-
-This document outlines the governance model for Astro. This includes detailed descriptions of the contributor levels, nomination process, code review process, pull request merge process, and the consequences of Code of Conduct violations.
-
-👉 **All community members must follow the [Code of Conduct (CoC)](CODE_OF_CONDUCT.md).**
-Consequences for CoC violations are detailed in [Moderation](#moderation).
-
-👉 **Want to trigger a vote, nomination, or perform some other action?**
-Scroll down to [Playbook](#governance-playbook).
-
-## Get Involved
-
-**Anything that supports the Astro community is a valuable contribution.** All types of contribution are meaningful, from code to documentation to blog posts. Anyone can become an Astro Contributor (yes, even you!). Our goal is to recognize all contributors to Astro regardless of skill, experience or background.
-
-## Contributor Levels
-
-We recognize different degrees of contribution as **levels**, and most levels can be reached regardless of coding skill or years of experience. The two most important things that we look for in contributors are:
-
-- **Being here** - Everyone's time is valuable, and the fact that you're here and contributing to Astro is amazing! Thank you for being a part of this journey with us.
-- **Being a positive member of our community** - Go above and beyond our Code of Conduct, and commit to healthy communication in pull requests, issue discussions, Discord conversations, and interactions outside of our community (ex: no Twitter bullies allowed :)
-
-Each level unlocks new privileges and responsibilities on Discord and GitHub. Below is a summary of each contributor level:
-
-### Level 1 - Contributor
-
-Have you done something (big or small) to contribute to the health, success, or growth of Astro? Congratulations, you're officially recognized as a contributor to the project!
-
-#### Examples of recognized contributions
-
-- **GitHub:** Submitting a merged pull request
-- **GitHub:** Filing a detailed bug report or RFC
-- **GitHub:** Updating documentation!
-- Helping people on GitHub, Discord, etc.
-- Answering questions on Stack Overflow, Twitter, etc.
-- Blogging, Vlogging, Podcasting, and Livestreaming about Astro
-- This list is incomplete! Similar contributions are also recognized.
-
-#### Privileges
-
-- New role on [Discord](https://astro.build/chat): `@contributor`
-- New name color on Discord: **light blue**.
-- Invitations to contributor-only events, sticker drops, and the occasional swag drop.
-
-#### Responsibilities
-
-This role does not require any extra responsibilities or time commitment. We hope you stick around and keep participating!
-
-If you're interested in reaching the next level and becoming a Maintainer, you can begin to explore some of those responsibilities in the next section.
-
-#### Nomination Process
-
-If you contributed to Astro outside of Discord, you may self-nominate by sending `!contribute` in any Discord channel, accompanied by a link or description of your contribution. You may also gain this role if you are active and helpful on Discord.
-
-### Level 2 (L2) - Maintainer
-
-The **Maintainer** role is available to any contributor who wants to join the team and take part in the long-term maintenance of Astro.
-
-The Maintainer role is critical to the long-term health of Astro. Maintainers act as the first line of defense when it comes to new issues, pull requests and Discord activity. Maintainers are most likely the first people that a user will interact with on Discord or GitHub.
-
-**A Maintainer is not required to write code!** Some Maintainers spend most of their time inside of Discord, maintaining a healthy community there.
-
-**A Maintainer has moderation privileges!** All maintainers are trusted with the ability to help moderate our Discord and GitHub communities for things like spam. There is also a special (optional, opt-in) `@mods` role open to maintainers who are also interested in helping out when a community member reaches out for moderation help.
-
-#### Recognized Contributions
-
-There is no strict minimum number of contributions needed to reach this level, as long as you can show **sustained** involvement over some amount of time (at least a couple of weeks).
-
-- **GitHub:** Submitting non-trivial pull requests and RFCs
-- **GitHub:** Reviewing non-trivial pull requests and RFCs
-- **Discord:** Supporting users in Discord, especially in the #support channel
-- **Discord:** Active participation in RFC calls and other events
-- **GitHub + Discord:** Triaging and confirming user issues
-- This list is incomplete! Similar contributions are also recognized.
-
-#### Privileges
-
-- All privileges of the [Contributor role](#level-1---contributor), plus...
-- Invitation to the `@maintainer` role on [Discord](https://astro.build/chat)
-- Invitation to the `@maintainers` team on GitHub.
-- New name color on Discord: **blue**.
-- Invitation to the private #maintainers channel on Discord.
-- Ability to moderate Discord to remove spam, harmful speech, etc.
-- Ability to join the `@mods` role on Discord (optional, opt-in).
-- Ability to push branches to the repo (No more personal fork needed).
-- Ability to review GitHub PRs.
-- Ability to merge _some_ GitHub PRs.
-- Ability to vote on _some_ initiatives (see [Voting](#voting) below).
-
-#### Responsibilities
-
-- Participate in the project as a team player.
-- Bring a friendly, welcoming voice to the Astro community.
-- Be active on Discord, especially in the #support channel.
-- Triage new issues.
-- Review pull requests.
-- Merge some, non-trivial community pull requests.
-- Merge your own pull requests (once reviewed and approved).
-
-#### Nomination
-
-To be nominated, a nominee is expected to already be performing some of the responsibilities of a Maintainer over the course of at least a couple of weeks.
-
-In some rare cases, this role may be revoked by a project Steward. However, under normal circumstances this role is granted for as long as the contributor wishes to engage with the project.
-
-#### Nomination Process
-
-- You can be nominated by any existing Maintainer (L2 or above).
-- Once nominated, there will be a vote by existing Maintainers (L2 and above).
-- See [vote rules & requirements](#voting) for info on how the vote works.
-
-### Level 3 (L3) - Core Maintainer
-
-**Core Maintainers** are community members who have contributed a significant amount of time and energy to the project through issues, bug fixes, implementing enhancements/features, and engagement with the community. A Core Maintainer is considered a trusted leader within the community.
-
-A Core Maintainer has significant sway in software design decisions. For this reason, coding experience is critical for this role. Core Maintainer is the only level of contributor that does require a significant contribution history on GitHub.
-
-Core maintainers are watchdogs over the code, ensuring code quality, correctness and security. A Core Maintainer helps to set the direction of the project and ensure a healthy future for Astro.
-
-Some contributors will not reach this level, and that's okay! L2 Maintainers still have significant responsibility and privileges in our community.
-
-#### Privileges
-
-- All privileges of the [Maintainer role](#level-2---maintainer), plus...
-- `@core` role on [Discord](https://astro.build/chat)
-- New name color on Discord: **yellow**.
-- Invitation to the private #core channel on Discord.
-- Invitation to the `core` team on GitHub.
-- Ability to merge all GitHub PRs.
-- Ability to vote on all initiatives (see [Voting](#voting) below).
-
-#### Responsibilities
-
-- All of the responsibilities of L2, including...
-- Ownership over specific parts of the project.
-- Maintaining and improving overall architecture.
-- Tracking and ensuring progress of open pull requests.
-- Reviewing and merging larger, non-trivial PRs.
-
-#### Nomination
-
-To be nominated, a nominee is expected to already be performing some of the responsibilities of a Core Maintainer. This could include showing expertise over some larger section of the codebase, championing RFCs through ideation and implementation, reviewing non-trivial PRs and providing critical feedback, or some combination of those responsibilities listed above.
-
-If a Core Maintainer steps away from the project for a significant amount of time, they may be removed as a Core Maintainer (L3 -> L2) until they choose to return.
-
-In some rare cases, this role may be revoked by a project Steward. However, under normal circumstances this role is granted for as long as the contributor wishes to engage with the project.
-
-#### Nomination Process
-
-- You can be nominated by any existing Core Maintainer (L3 or above).
-- Once nominated, there will be a vote by existing Core Maintainers (L3 and above).
-- See [vote rules & requirements](#voting) for info on how the vote works.
-
-### Steward
-
-Steward is an additional privilege bestowed to 1 (or more) Core Maintainers. The role of Steward is mainly an administrative one. Stewards control and maintain sensitive project assets, and act as tiebreakers in the event of disagreements.
-
-In extremely rare cases, a Steward can act unilaterally when they believe it is in the project's best interest and can prove that the issue cannot be resolved through normal governance procedure. The steward must publicly state their reason for unilateral action before taking it.
-
-The project Steward is currently: **@FredKSchott**
-
-#### Responsibilities
-
-- Access to the [@astrodotbuild Twitter account](https://twitter.com/astrodotbuild)
-- Administration privileges on the [astro GitHub org](https://github.com/snowpackjs)
-- Administration privileges on the [astro Discord server](https://astro.build/chat)
-- Publish access to the [`astro` npm package](https://www.npmjs.com/package/astro)
-- Domain registrar and DNS access to `astro.build` and all other domains
-- Administration access to the `astro.build` Vercel account
-- Ability to initiate a [vote](GOVERNANCE.md#voting)
-- Ability to veto [votes](GOVERNANCE.md#voting) and resolve voting deadlocks
-- Define project direction and planning
-- Ability to decide on moderation decisions
-- Access to the `*@astro.build` email address
-
-#### Nomination
-
-- Stewards cannot be self-nominated.
-- Only Core Maintainers are eligible.
-- New stewards will be added based on a unanimous vote by the existing Steward(s).
-- In the event that someone is unreachable then the decision will be deferred.
-
-## Other Roles
-
-### Staff
-
-Staff is a special designation for employees of [The Astro Technology Company](https://astro.build/company) that lives outside of our Governance model. The staff role was designed to help those of us working full-time on Astro to work productively without "skipping the line" and circumventing our governance model entirely.
-
-The staff role was designed to offer instant **visibility** and **trust**, but not instant **authority.**
-
-#### Privileges
-
-All privileges of the [Core Maintainer role](#level-3---core-mainainer), except...
-
-- Instead of gaining Discord contributor roles (`@contributor`, `@maintainer`, `@core`) you will receive a special `@staff` role in Discord and GitHub that grants equivalent visibility and permissions as `@core`.
-- No voting abilities for the first 3 months of staff membership. Then, the role grants equivalent voting permissions as `@core` (see [Voting](#voting) below).
-- Not eligible for additional contributor levels while acting as `@staff`. You can retain all current contributor levels and can request a new nomination upon leaving `@staff` (See [Leaving Staff](#leaving-staff) below). This rule is designed to prevent a team of contributors/maintainers that is overwhelmingly ex-staff members.
-
-#### Responsibilities
-
-Responsibilities will vary. Most often, a staff member will regularly meet the responsibilites of either the [Maintainer (L2)](#level-2---maintainer) or [Core Maintainer (L3)](#level-3---core-mainainer) role.
-
-#### Nomination
-
-There is no nomination process for this role. The project steward is responsible for granting and revoking the `@staff` role.
-
-#### Leaving Staff
-
-When someone leaves the Astro Technology Company, they lose staff privileges and return to their original membership level in our governance structure (whatever level they were at before joining staff).
-
-If that person wishes to continue working on Astro after leaving, they may request a nomination to become an official L2 or L3 contributor. This nomination would follow the normal voting rules & procedure for that role (see [Voting](#voting) below).
-
-# Governance Playbook
-
-## Voting
-
-Certain project decisions (like governance changes and membership nominations) require a vote. Below are the changes that require a vote, and the rules that govern that vote.
-
-The project Steward may initiate a vote for any unlisted project decision. [General Rules](#general-rules) will apply, along with any addition rules provided at the steward's discretion. If this unlisted project decision is expected to be repeated in the future, voting rules should be agreed on and then added to this document.
-
-### General Voting Rules
-
-- Members may abstain from any vote.
-- Members who do not vote within 3 days will automatically abstain.
-- Stewards may reduce the 3 day automatic abstain for urgent decisions.
-- Stewards reserve the right to veto approval with a publicly disclosed reason.
-
-## Voting: Maintainer (L2) Nomination
-
-This process kicks off once a valid nomination has been made. See ["Maintainer - Nomination Process"](#nomination-process) above for more details on nomination.
-
-**Who can vote:** All Maintainers (L2 and above).
-
-1. A vote thread should be created in Discord #maintainers channel (the private channel for all maintainers).
-2. A vote thread can be created by any maintainer, core maintainer, or the Steward.
-3. Once a vote thread is created, existing Maintainers can discuss the nomination in private.
-4. The normal 3 day voting & discussion window begins with the thread creation.
-5. Voting can be done in the thread (visible to other voters) or in a private DM to the project Steward.
-6. Once the vote is complete, the thread is deleted.
-7. The vote must receive an overwhelming majority (70%+) to pass.
-8. **If the vote passes:** the nominee will be made a Maintainer and all privileges will be made available to them.
-9. **If the vote fails:** the project Steward is responsible for informing the nominee with constructive, actionable feedback. (Note: this is not required if the nomination was made in the #core channel, or if the nominee was otherwise not made aware of their nomination).
-
-#### Draft message to send to accepted maintainer, informing them of the decision:
-
-```
-Hey ${NAME}!
-
-**I have some exciting news — you've been given the role of L2 Contributor (aka Maintainer/Moderator) in the Astro community!**
-
-Some background: I nominated you for the role in the (private) #maintainers channel, and the consensus was overwhelmingly positive. Some quotes from the nomination thread that sum up the impact you've already had on the project so far:
-
-- ...
-- ...
-- ...
-
-Thank you for ${1 SENTENCE DESCRIPTION OF CONTRIBUTIONS}. Your impact has definitely been felt and we would be thrilled to have your help building a healthy future for Astro! There is no required time commitment: you can continue to contribute as often or as little as you'd like. This is mainly a chance to recognize your contributions and give you more privileges in Discord and GitHub.
-
-Please let me know if you’re interested in accepting this invitation. If so, we’ll start getting your roles up to date. And if you have any questions, feel free to let me know.
-
-Best,
-${MY_NAME}
-
-*PS: As a reminder, our Governance document describes the following privileges and responsibilities for the **L2 - Maintainer** role: https://github.com/withastro/astro/blob/main/GOVERNANCE.md*
-```
-
-## Voting: Core Maintainer (L3) Nomination
-
-This process kicks off once a valid nomination has been made. See ["Core Maintainer - Nomination Process"](#nomination-process) above for more details on nomination.
-
-**Who can vote:** All Core Maintainers (L3 and above).
-
-1. A vote thread should be created in Discord #core channel (the private channel for core maintainers).
-2. A vote thread can be created by any core maintainer, or the Steward.
-3. Once a vote thread is created, existing Core Maintainers can discuss the nomination in private.
-4. The normal 3 day voting & discussion window begins with the thread creation.
-5. Voting can be done in the thread (visible to other voters) or in a private DM to the project Steward.
-6. Once the vote is complete, the thread is deleted.
-7. The vote must receive an overwhelming majority (70%+) to pass.
-8. **If the vote passes:** the nominee will be made a Core Maintainer and all privileges will be made available to them.
-9. **If the vote fails:** the project Steward is responsible for informing the nominee with constructive, actionable feedback. (Note: this is not required if the nomination was made in the #core channel, or if the nominee was otherwise not made aware of their nomination).
-
-#### Draft message to send to accepted maintainer, informing them of the decision:
-
-```
-Hey $NAME!
-
-I have some exciting news—you’ve been nominated and accepted as a core maintainer of Astro! The core maintainer group held a vote and overwhelmingly agree that you would be a great addition to the team. Congratulations! Thanks for all of your significant contributions to Astro to date and your continued dedication to this project and our community. We would be thrilled to have your help ensuring a healthy future for Astro!
-
-Please let me know if you’re interested in accepting this invitation. If so, we’ll start getting your roles and permissions up to date.
-
-As a reminder, our Governance document describes the following privileges and responsibilities for a **Core Maintainer**:
-
-#### Privileges
-
-$COPY_AND_PASTE_FROM_ABOVE
-
-#### Responsibilities
-
-$COPY_AND_PASTE_FROM_ABOVE
-```
-
-## Voting: Governance Change
-
-A vote is initiated once a pull request to the GOVERNANCE.md file is submitted by a Core Maintainer.
-
-If the pull request submitter is not a Core Maintainer, the PR can be closed by any Maintainer without a vote. However, any Core Maintainer may request a vote on that PR, in which case a vote is initiated.
-
-**Who can vote:** Core Maintainers (L3 and above). All Maintainers are encouraged to discuss and voice their opinion in the pull request discussion. Core Maintainers should take the opinions of others into consideration when voting.
-
-1. The pull request discussion thread is used to discuss the governance change.
-2. The normal 3 day voting & discussion window begins with either the PR creation or the removal of `WIP:` from the PR title if the PR was created as a draft.
-3. Voting can be done in the pull request via a review of either **Approve (For)** or **Change Requested (Against)**.
-4. The vote must receive a simple majority (50%+) to pass.
-5. **If the vote passes:** the PR is merged and the changes take effect immediately.
-6. **If the vote fails:** the PR is closed and no change occurs.
-
-## Voting: RFC Proposals
-
-Astro features are discussed using a model called [Consensus-seeking decision-making](https://en.wikipedia.org/wiki/Consensus-seeking_decision-making). This model attempts to achieve consensus on all significant changes to Astro, but has a fallback voting procedure in place if consensus appears unattainable.
-
-**Who can vote:** All Maintainers (L2 and above).
-
-1. Anyone can submit an RFC to suggest changes to Astro.
-2. A trivial change can be discussed and approved entirely within the RFC GitHub issue, as long as there are no objections from Maintainers or Core Maintainers. This is not considered a formal vote.
-3. A non-trivial, significant change should be discussed within the RFC GitHub issue and approved during an RFC meeting call.
-4. During an RFC meeting, the moderator will attempt to achieve consensus on the RFC proposal.
-5. **If consensus is reached:** the RFC is approved.
-6. **If consensus is not reached:** Maintainers must make all reasonable attempts to resolve issues and reach consensus in GitHub or a follow-up RFC meeting. The process of reaching consensus can take time, and should not be rushed as long as all participants are making a reasonable effort to respond.
-7. **If consensus still cannot be reached:** The project Steward may initiate the first fallback mechanism by limiting the vote to Core Maintainers.
-8. **If consensus still cannot be reached:** The project Steward may initiate a final fallback vote of Core Maintainers, of which an overwhelming majority (80%+) is required to pass.
-9. **If consensus still cannot be reached:** The RFC is closed without approval.
-
-## Moderation
-
-Outlined below is the process for Code of Conduct violation reviews.
-
-### Reporting
-
-Anyone may report a violation. Violations can be reported in the following ways:
-
-- In private, via email to one or more stewards.
-- In private, via direct message to a project steward on Discord.
-- In public, via a GitHub comment (mentioning `@snowpackjs/maintainers`).
-- In public, via the project Discord server (mentioning `staff`).
-
-### Who gets involved?
-
-Each report will be assigned reviewers. These will initially be all project [stewards](#stewards).
-
-In the event of any conflict of interest - ie. stewards who are personally connected to a situation, they must immediately recuse themselves.
-
-At request of the reporter and if deemed appropriate by the reviewers, another neutral third-party may be involved in the review and decision process.
-
-### Review
-
-If a report doesn’t contain enough information, the reviewers will strive to obtain all relevant data before acting.
-
-The reviewers will then review the incident and determine, to the best of their ability:
-
-- What happened.
-- Whether this event constitutes a Code of Conduct violation.
-- Who, if anyone, was involved in the violation.
-- Whether this is an ongoing situation.
-
-The reviewers should aim to have a resolution agreed very rapidly; if not agreed within a week, they will inform the parties of the planned date.
-
-### Resolution
-
-Responses will be determined by the reviewers on the basis of the information gathered and of the potential consequences. It may include:
-
-- taking no further action
-- issuing a reprimand (private or public)
-- asking for an apology (private or public)
-- permanent ban from the GitHub org and Discord server
-- revoked contributor status
-
----
-
-Inspired by [ESLint](https://eslint.org/docs/6.0.0/maintainer-guide/governance), [Rome](https://github.com/rome/tools/blob/main/GOVERNANCE.md) and [Blitz](https://blitzjs.com/docs/maintainers).
diff --git a/LICENSE b/LICENSE
index 1f0bcaa7dcef..b3cd0c0f0e01 100644
--- a/LICENSE
+++ b/LICENSE
@@ -20,7 +20,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-
"""
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
@@ -33,7 +32,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
-
"""
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
diff --git a/README.md b/README.md
index db7591703b2e..f42323a863a4 100644
--- a/README.md
+++ b/README.md
@@ -1,125 +1,107 @@
+![Build the web you want](.github/assets/banner.jpg 'Build the web you want')
+
-
-
+ Astro is a website build tool for the modern web —
powerful developer experience meets lightweight output.
+Astro is free, open source software made possible by these wonderful sponsors.
+
+[❤️ Sponsor Astro! ❤️](https://github.com/withastro/.github/blob/main/FUNDING.md)
+
+
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/blog-multiple-authors/src/pages/about.astro b/examples/blog-multiple-authors/src/pages/about.astro
deleted file mode 100644
index f1097a6f4323..000000000000
--- a/examples/blog-multiple-authors/src/pages/about.astro
+++ /dev/null
@@ -1,70 +0,0 @@
----
-import MainHead from '../components/MainHead.astro';
-import Nav from '../components/Nav.astro';
-
-let title = 'About';
-let description = 'About page of an example blog on Astro';
-let canonicalURL = Astro.canonicalURL;
----
-
-
-
-
-
-
-
-
-
-
-
{title}
-
-
-
-
-
- The book cover and spine above and the images which follow were not part of the original Ormsby translation—they are taken from the 1880 edition of J. W. Clark,
- illustrated by Gustave Doré. Clark in his edition states that, “The English text of ‘Don Quixote’ adopted in this edition is that of Jarvis, with occasional corrections
- from Motteaux.”
-
-
- See in the introduction below John Ormsby’s critique of both the Jarvis and Motteaux translations. It has been elected in the present Project Gutenberg edition to attach
- the famous engravings of Gustave Doré to the Ormsby translation instead of the Jarvis/Motteaux. The detail of many of the Doré engravings can be fully appreciated only by
- utilizing the “Full Size” button to expand them to their original dimensions. Ormsby in his Preface has criticized the fanciful nature of Doré’s illustrations; others
- feel these woodcuts and steel engravings well match Quixote’s dreams.
-
-
-
-
-
diff --git a/examples/blog-multiple-authors/src/pages/authors/[author].astro b/examples/blog-multiple-authors/src/pages/authors/[author].astro
deleted file mode 100644
index bb1bc3aa2a16..000000000000
--- a/examples/blog-multiple-authors/src/pages/authors/[author].astro
+++ /dev/null
@@ -1,72 +0,0 @@
----
-import MainHead from '../../components/MainHead.astro';
-import Nav from '../../components/Nav.astro';
-import PostPreview from '../../components/PostPreview.astro';
-import authorData from '../../data/authors.json';
-
-export async function getStaticPaths() {
- const allPosts = await Astro.glob('../post/*.md');
- let allAuthorsUnique = [...new Set(allPosts.map((p) => p.frontmatter.author))];
- return allAuthorsUnique.map((author) => ({ params: { author }, props: { allPosts } }));
-}
-
-const { allPosts } = Astro.props;
-const title = 'Don’s Blog';
-const description = 'An example blog on Astro';
-
-/** filter posts by author, sort by date */
-const posts = allPosts.filter((post) => post.frontmatter.author === Astro.params.author).sort((a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf());
-const author = authorData[posts[0].frontmatter.author];
----
-
-
-
- {title}
-
-
-
-
-
-
-
-
-
-
-
- {author.name}
-
- {posts.map((post) => )}
-
-
-
diff --git a/examples/blog-multiple-authors/src/pages/index.astro b/examples/blog-multiple-authors/src/pages/index.astro
deleted file mode 100644
index 4e93a932e864..000000000000
--- a/examples/blog-multiple-authors/src/pages/index.astro
+++ /dev/null
@@ -1,41 +0,0 @@
----
-// Component Imports
-import MainHead from '../components/MainHead.astro';
-import Nav from '../components/Nav.astro';
-import PostPreview from '../components/PostPreview.astro';
-import Pagination from '../components/Pagination.astro';
-import authorData from '../data/authors.json';
-
-// Component Script:
-// You can write any JavaScript/TypeScript that you'd like here.
-// It will run during the build, but never in the browser.
-// All variables are available to use in the HTML template below.
-let title = 'Don’s Blog';
-let description = 'An example blog on Astro';
-let canonicalURL = Astro.canonicalURL;
-
-// Data Fetching: List all Markdown posts in the repo.
-let allPosts = await Astro.glob('./post/*.md');
-allPosts.sort((a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf());
-let firstPage = allPosts.slice(0, 2);
-// Full Astro Component Syntax:
-// https://docs.astro.build/core-concepts/astro-components/
----
-
-
-
-
-
-
-
-
-
-
- {allPosts.map((post) => )}
-
-
-
-
-
diff --git a/examples/blog-multiple-authors/src/pages/post/chapter-i.md b/examples/blog-multiple-authors/src/pages/post/chapter-i.md
deleted file mode 100644
index 9a6fa14ead3a..000000000000
--- a/examples/blog-multiple-authors/src/pages/post/chapter-i.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-layout: ../../layouts/post.astro
-title: Chapter I
-tag: movie
-date: 2021-05-17
-image: /images/chapter-01.jpg
-author: don
-description: Which Treats of the Character and Pursuits of the Famous Gentleman Don Quixote of La Mancha
----
-
-In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing. An olla of rather more beef than mutton, a salad on most nights, scraps on Saturdays, lentils on Fridays, and a pigeon or so extra on Sundays, made away with three-quarters of his income. The rest of it went in a doublet of fine cloth and velvet breeches and shoes to match for holidays, while on week-days he made a brave figure in his best homespun. He had in his house a housekeeper past forty, a niece under twenty, and a lad for the field and market-place, who used to saddle the hack as well as handle the bill-hook. The age of this gentleman of ours was bordering on fifty; he was of a hardy habit, spare, gaunt-featured, a very early riser and a great sportsman. They will have it his surname was Quixada or Quesada (for here there is some difference of opinion among the authors who write on the subject), although from reasonable conjectures it seems plain that he was called Quexana. This, however, is of but little importance to our tale; it will be enough not to stray a hair’s breadth from the truth in the telling of it.
-
-You must know, then, that the above-named gentleman whenever he was at leisure (which was mostly all the year round) gave himself up to reading books of chivalry with such ardour and avidity that he almost entirely neglected the pursuit of his field-sports, and even the management of his property; and to such a pitch did his eagerness and infatuation go that he sold many an acre of tillageland to buy books of chivalry to read, and brought home as many of them as he could get. But of all there were none he liked so well as those of the famous Feliciano de Silva’s composition, for their lucidity of style and complicated conceits were as pearls in his sight, particularly when in his reading he came upon courtships and cartels, where he often found passages like “the reason of the unreason with which my reason is afflicted so weakens my reason that with reason I murmur at your beauty;” or again, “the high heavens, that of your divinity divinely fortify you with the stars, render you deserving of the desert your greatness deserves.” Over conceits of this sort the poor gentleman lost his wits, and used to lie awake striving to understand them and worm the meaning out of them; what Aristotle himself could not have made out or extracted had he come to life again for that special purpose. He was not at all easy about the wounds which Don Belianis gave and took, because it seemed to him that, great as were the surgeons who had cured him, he must have had his face and body covered all over with seams and scars. He commended, however, the author’s way of ending his book with the promise of that interminable adventure, and many a time was he tempted to take up his pen and finish it properly as is there proposed, which no doubt he would have done, and made a successful piece of work of it too, had not greater and more absorbing thoughts prevented him.
diff --git a/examples/blog-multiple-authors/src/pages/post/chapter-ii.md b/examples/blog-multiple-authors/src/pages/post/chapter-ii.md
deleted file mode 100644
index eda406b42072..000000000000
--- a/examples/blog-multiple-authors/src/pages/post/chapter-ii.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: ../../layouts/post.astro
-title: Chapter II
-tag: movie
-date: 2021-05-18
-image: /images/chapter-02.jpg
-author: sancho
-description: Which Treats of the First Sally the Ingenious Don Quixote Made From Home
----
-
-These preliminaries settled, he did not care to put off any longer the execution of his design, urged on to it by the thought of all the world was losing by his delay, seeing what wrongs he intended to right, grievances to redress, injustices to repair, abuses to remove, and duties to discharge. So, without giving notice of his intention to anyone, and without anybody seeing him, one morning before the dawning of the day (which was one of the hottest of the month of July) he donned his suit of armour, mounted Rocinante with his patched-up helmet on, braced his buckler, took his lance, and by the back door of the yard sallied forth upon the plain in the highest contentment and satisfaction at seeing with what ease he had made a beginning with his grand purpose. But scarcely did he find himself upon the open plain, when a terrible thought struck him, one all but enough to make him abandon the enterprise at the very outset. It occurred to him that he had not been dubbed a knight, and that according to the law of chivalry he neither could nor ought to bear arms against any knight; and that even if he had been, still he ought, as a novice knight, to wear white armour, without a device upon the shield until by his prowess he had earned one. These reflections made him waver in his purpose, but his craze being stronger than any reasoning, he made up his mind to have himself dubbed a knight by the first one he came across, following the example of others in the same case, as he had read in the books that brought him to this pass. As for white armour, he resolved, on the first opportunity, to scour his until it was whiter than an ermine; and so comforting himself he pursued his way, taking that which his horse chose, for in this he believed lay the essence of adventures.
-
-Thus setting out, our new-fledged adventurer paced along, talking to himself and saying, “Who knows but that in time to come, when the veracious history of my famous deeds is made known, the sage who writes it, when he has to set forth my first sally in the early morning, will do it after this fashion? ‘Scarce had the rubicund Apollo spread o’er the face of the broad spacious earth the golden threads of his bright hair, scarce had the little birds of painted plumage attuned their notes to hail with dulcet and mellifluous harmony the coming of the rosy Dawn, that, deserting the soft couch of her jealous spouse, was appearing to mortals at the gates and balconies of the Manchegan horizon, when the renowned knight Don Quixote of La Mancha, quitting the lazy down, mounted his celebrated steed Rocinante and began to traverse the ancient and famous Campo de Montiel;’” which in fact he was actually traversing. “Happy the age, happy the time,” he continued, “in which shall be made known my deeds of fame, worthy to be moulded in brass, carved in marble, limned in pictures, for a memorial for ever. And thou, O sage magician, whoever thou art, to whom it shall fall to be the chronicler of this wondrous history, forget not, I entreat thee, my good Rocinante, the constant companion of my ways and wanderings.” Presently he broke out again, as if he were love-stricken in earnest, “O Princess Dulcinea, lady of this captive heart, a grievous wrong hast thou done me to drive me forth with scorn, and with inexorable obduracy banish me from the presence of thy beauty. O lady, deign to hold in remembrance this heart, thy vassal, that thus in anguish pines for love of thee.”
-
-So he went on stringing together these and other absurdities, all in the style of those his books had taught him, imitating their language as well as he could; and all the while he rode so slowly and the sun mounted so rapidly and with such fervour that it was enough to melt his brains if he had any. Nearly all day he travelled without anything remarkable happening to him, at which he was in despair, for he was anxious to encounter someone at once upon whom to try the might of his strong arm.
diff --git a/examples/blog-multiple-authors/src/pages/post/chapter-iii.md b/examples/blog-multiple-authors/src/pages/post/chapter-iii.md
deleted file mode 100644
index 0b799bc61493..000000000000
--- a/examples/blog-multiple-authors/src/pages/post/chapter-iii.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-layout: ../../layouts/post.astro
-title: Chapter III
-tag: movie
-date: 2021-05-19
-image: /images/chapter-03.jpg
-author: don
-description: Wheren is Related the Droll Way in which Don Quixote Had Himself Dubbed a Knight
----
-
-Harassed by this reflection, he made haste with his scanty pothouse supper, and having finished it called the landlord, and shutting himself into the stable with him, fell on his knees before him, saying, “From this spot I rise not, valiant knight, until your courtesy grants me the boon I seek, one that will redound to your praise and the benefit of the human race.” The landlord, seeing his guest at his feet and hearing a speech of this kind, stood staring at him in bewilderment, not knowing what to do or say, and entreating him to rise, but all to no purpose until he had agreed to grant the boon demanded of him. “I looked for no less, my lord, from your High Magnificence,” replied Don Quixote, “and I have to tell you that the boon I have asked and your liberality has granted is that you shall dub me knight to-morrow morning, and that to-night I shall watch my arms in the chapel of this your castle; thus to-morrow, as I have said, will be accomplished what I so much desire, enabling me lawfully to roam through all the four quarters of the world seeking adventures on behalf of those in distress, as is the duty of chivalry and of knights-errant like myself, whose ambition is directed to such deeds.”
-
-The landlord, who, as has been mentioned, was something of a wag, and had already some suspicion of his guest’s want of wits, was quite convinced of it on hearing talk of this kind from him, and to make sport for the night he determined to fall in with his humour. So he told him he was quite right in pursuing the object he had in view, and that such a motive was natural and becoming in cavaliers as distinguished as he seemed and his gallant bearing showed him to be; and that he himself in his younger days had followed the same honourable calling, roaming in quest of adventures in various parts of the world, among others the Curing-grounds of Malaga, the Isles of Riaran, the Precinct of Seville, the Little Market of Segovia, the Olivera of Valencia, the Rondilla of Granada, the Strand of San Lucar, the Colt of Cordova, the Taverns of Toledo, and divers other quarters, where he had proved the nimbleness of his feet and the lightness of his fingers, doing many wrongs, cheating many widows, ruining maids and swindling minors, and, in short, bringing himself under the notice of almost every tribunal and court of justice in Spain; until at last he had retired to this castle of his, where he was living upon his property and upon that of others; and where he received all knights-errant of whatever rank or condition they might be, all for the great love he bore them and that they might share their substance with him in return for his benevolence. He told him, moreover, that in this castle of his there was no chapel in which he could watch his armour, as it had been pulled down in order to be rebuilt, but that in a case of necessity it might, he knew, be watched anywhere, and he might watch it that night in a courtyard of the castle, and in the morning, God willing, the requisite ceremonies might be performed so as to have him dubbed a knight, and so thoroughly dubbed that nobody could be more so. He asked if he had any money with him, to which Don Quixote replied that he had not a farthing, as in the histories of knights-errant he had never read of any of them carrying any. On this point the landlord told him he was mistaken; for, though not recorded in the histories, because in the author’s opinion there was no need to mention anything so obvious and necessary as money and clean shirts, it was not to be supposed therefore that they did not carry them, and he might regard it as certain and established that all knights-errant (about whom there were so many full and unimpeachable books) carried well-furnished purses in case of emergency, and likewise carried shirts and a little box of ointment to cure the wounds they received. For in those plains and deserts where they engaged in combat and came out wounded, it was not always that there was someone to cure them, unless indeed they had for a friend some sage magician to succour them at once by fetching through the air upon a cloud some damsel or dwarf with a vial of water of such virtue that by tasting one drop of it they were cured of their hurts and wounds in an instant and left as sound as if they had not received any damage whatever. But in case this should not occur, the knights of old took care to see that their squires were provided with money and other requisites, such as lint and ointments for healing purposes; and when it happened that knights had no squires (which was rarely and seldom the case) they themselves carried everything in cunning saddle-bags that were hardly seen on the horse’s croup, as if it were something else of more importance, because, unless for some such reason, carrying saddle-bags was not very favourably regarded among knights-errant. He therefore advised him (and, as his godson so soon to be, he might even command him) never from that time forth to travel without money and the usual requirements, and he would find the advantage of them when he least expected it.
diff --git a/examples/blog-multiple-authors/src/pages/posts/[...page].astro b/examples/blog-multiple-authors/src/pages/posts/[...page].astro
deleted file mode 100644
index f770aadb286f..000000000000
--- a/examples/blog-multiple-authors/src/pages/posts/[...page].astro
+++ /dev/null
@@ -1,72 +0,0 @@
----
-import MainHead from '../../components/MainHead.astro';
-import Nav from '../../components/Nav.astro';
-import PostPreview from '../../components/PostPreview.astro';
-import Pagination from '../../components/Pagination.astro';
-import authorData from '../../data/authors.json';
-
-export async function getStaticPaths({ paginate, rss }) {
- const allPosts = await Astro.glob('../post/*.md');
- const sortedPosts = allPosts.sort((a, b) => new Date(b.frontmatter.date).valueOf() - new Date(a.frontmatter.date).valueOf());
-
- // Generate an RSS feed from this collection of posts.
- // NOTE: This is disabled by default, since it requires `site` to be set in your "astro.config.mjs" file.
- // rss({
- // title: 'Don’s Blog',
- // description: 'An example blog on Astro',
- // customData: `en-us`,
- // items: sortedPosts.map(item => ({
- // title: item.title,
- // description: item.description,
- // link: item.url,
- // pubDate: item.date,
- // })),
- // });
-
- // Return a paginated collection of paths for all posts
- return paginate(sortedPosts, { pageSize: 1 });
-}
-
-// page
-const title = 'Don’s Blog';
-const description = 'An example blog on Astro';
-const { canonicalURL } = Astro;
-const { page } = Astro.props;
----
-
-
-
- {title}
-
-
-
-
-
-
-
-
-
-
All Posts
- {page.start + 1}–{page.end + 1} of {page.total}
- {page.data.map((post) => )}
-
-
-
-
-
diff --git a/examples/blog-multiple-authors/src/styles/global.css b/examples/blog-multiple-authors/src/styles/global.css
deleted file mode 100644
index 408d2b9de844..000000000000
--- a/examples/blog-multiple-authors/src/styles/global.css
+++ /dev/null
@@ -1,25 +0,0 @@
-body {
- font-family: 'Spectral', serif;
- line-height: 1.4;
-}
-
-p {
- line-height: 2;
-}
-
-a {
- color: crimson;
-}
-
-img {
- max-width: 100%;
- height: auto;
-}
-
-.wrapper {
- max-width: 60rem;
- margin-left: auto;
- margin-right: auto;
- padding-left: 2rem;
- padding-right: 2rem;
-}
diff --git a/examples/blog-multiple-authors/tsconfig.json b/examples/blog-multiple-authors/tsconfig.json
deleted file mode 100644
index 7ac81809afda..000000000000
--- a/examples/blog-multiple-authors/tsconfig.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "compilerOptions": {
- // Enable top-level await, and other modern ESM features.
- "target": "ESNext",
- "module": "ESNext",
- // Enable node-style module resolution, for things like npm package imports.
- "moduleResolution": "node",
- // Enable JSON imports.
- "resolveJsonModule": true,
- // Enable stricter transpilation for better output.
- "isolatedModules": true,
- // Add type definitions for our Vite runtime.
- "types": ["vite/client"]
- }
-}
diff --git a/examples/blog/.codesandbox/Dockerfile b/examples/blog/.codesandbox/Dockerfile
new file mode 100644
index 000000000000..c3b5c81a121d
--- /dev/null
+++ b/examples/blog/.codesandbox/Dockerfile
@@ -0,0 +1 @@
+FROM node:18-bullseye
diff --git a/examples/blog/.gitignore b/examples/blog/.gitignore
index 7329a851d0ac..16d54bb13c8a 100644
--- a/examples/blog/.gitignore
+++ b/examples/blog/.gitignore
@@ -1,6 +1,7 @@
# build output
dist/
-.output/
+# generated types
+.astro/
# dependencies
node_modules/
@@ -18,3 +19,6 @@ pnpm-debug.log*
# macOS-specific files
.DS_Store
+
+# jetbrains setting folder
+.idea/
diff --git a/examples/blog/.npmrc b/examples/blog/.npmrc
deleted file mode 100644
index ef83021af3ec..000000000000
--- a/examples/blog/.npmrc
+++ /dev/null
@@ -1,2 +0,0 @@
-# Expose Astro dependencies for `pnpm` users
-shamefully-hoist=true
diff --git a/examples/blog/.stackblitzrc b/examples/blog/.stackblitzrc
deleted file mode 100644
index 43798ecff844..000000000000
--- a/examples/blog/.stackblitzrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "startCommand": "npm start",
- "env": {
- "ENABLE_CJS_IMPORTS": true
- }
-}
\ No newline at end of file
diff --git a/examples/blog/.vscode/extensions.json b/examples/blog/.vscode/extensions.json
index 22a15055d638..56f043d30eef 100644
--- a/examples/blog/.vscode/extensions.json
+++ b/examples/blog/.vscode/extensions.json
@@ -1,4 +1,4 @@
{
- "recommendations": ["astro-build.astro-vscode"],
+ "recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
"unwantedRecommendations": []
}
diff --git a/examples/blog/README.md b/examples/blog/README.md
index 3036b9a5a980..758716e07c57 100644
--- a/examples/blog/README.md
+++ b/examples/blog/README.md
@@ -1,54 +1,68 @@
# Astro Starter Kit: Blog
-```
-npm init astro -- --template blog
+```sh
+npm create astro@latest -- --template blog
```
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog)
+[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/blog)
+[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/blog/devcontainer.json)
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
+![blog](https://github.com/withastro/astro/assets/2244813/ff10799f-a816-4703-b967-c78997e8323d)
+
Features:
-- ✅ SEO-friendly setup with canonical URLs and OpenGraph data
-- ✅ Full Markdown support
-- ✅ RSS 2.0 generation
-- ✅ Sitemap.xml generation
+- ✅ Minimal styling (make it your own!)
+- ✅ 100/100 Lighthouse performance
+- ✅ SEO-friendly with canonical URLs and OpenGraph data
+- ✅ Sitemap support
+- ✅ RSS Feed support
+- ✅ Markdown & MDX support
## 🚀 Project Structure
Inside of your Astro project, you'll see the following folders and files:
-```
-/
+```text
├── public/
-│ ├── robots.txt
-│ └── favicon.ico
├── src/
-│ ├── components/
-│ │ └── Tour.astro
-│ └── pages/
-│ └── index.astro
-└── package.json
+│ ├── components/
+│ ├── content/
+│ ├── layouts/
+│ └── pages/
+├── astro.config.mjs
+├── README.md
+├── package.json
+└── tsconfig.json
```
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
+The `src/content/` directory contains "collections" of related Markdown and MDX documents. Use `getCollection()` to retrieve posts from `src/content/blog/`, and type-check your frontmatter using an optional schema. See [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) to learn more.
+
Any static assets, like images, can be placed in the `public/` directory.
## 🧞 Commands
All commands are run from the root of the project, from a terminal:
-| Command | Action |
-|:---------------- |:-------------------------------------------- |
-| `npm install` | Installs dependencies |
-| `npm run dev` | Starts local dev server at `localhost:3000` |
-| `npm run build` | Build your production site to `./dist/` |
-| `npm run preview` | Preview your build locally, before deploying |
+| Command | Action |
+| :------------------------ | :----------------------------------------------- |
+| `npm install` | Installs dependencies |
+| `npm run dev` | Starts local dev server at `localhost:4321` |
+| `npm run build` | Build your production site to `./dist/` |
+| `npm run preview` | Preview your build locally, before deploying |
+| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
+| `npm run astro -- --help` | Get help using the Astro CLI |
## 👀 Want to learn more?
-Feel free to check [our documentation](https://github.com/withastro/astro) or jump into our [Discord server](https://astro.build/chat).
+Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
+
+## Credit
+
+This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).
diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs
index 08916b1fea78..d45f3951e1b2 100644
--- a/examples/blog/astro.config.mjs
+++ b/examples/blog/astro.config.mjs
@@ -1,7 +1,10 @@
+// @ts-check
import { defineConfig } from 'astro/config';
-import preact from '@astrojs/preact';
+import mdx from '@astrojs/mdx';
+import sitemap from '@astrojs/sitemap';
// https://astro.build/config
export default defineConfig({
- integrations: [preact()],
+ site: 'https://example.com',
+ integrations: [mdx(), sitemap()],
});
diff --git a/examples/blog/package.json b/examples/blog/package.json
index ae9a0ae32b59..0538835ff8fe 100644
--- a/examples/blog/package.json
+++ b/examples/blog/package.json
@@ -1,18 +1,18 @@
{
"name": "@example/blog",
+ "type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
- "start": "astro dev",
"build": "astro build",
- "preview": "astro preview"
- },
- "devDependencies": {
- "@astrojs/preact": "^0.1.2",
- "astro": "^1.0.0-beta.26"
+ "preview": "astro preview",
+ "astro": "astro"
},
"dependencies": {
- "preact": "^10.7.1"
+ "@astrojs/mdx": "^4.0.3",
+ "@astrojs/rss": "^4.0.10",
+ "@astrojs/sitemap": "^3.2.1",
+ "astro": "^5.1.1"
}
}
diff --git a/examples/blog/public/assets/blog/introducing-astro.jpg b/examples/blog/public/assets/blog/introducing-astro.jpg
deleted file mode 100644
index c58aacf6693e..000000000000
Binary files a/examples/blog/public/assets/blog/introducing-astro.jpg and /dev/null differ
diff --git a/examples/blog/public/blog-placeholder-1.jpg b/examples/blog/public/blog-placeholder-1.jpg
new file mode 100644
index 000000000000..74d4009b5273
Binary files /dev/null and b/examples/blog/public/blog-placeholder-1.jpg differ
diff --git a/examples/blog/public/blog-placeholder-2.jpg b/examples/blog/public/blog-placeholder-2.jpg
new file mode 100644
index 000000000000..c4214b0e639a
Binary files /dev/null and b/examples/blog/public/blog-placeholder-2.jpg differ
diff --git a/examples/blog/public/blog-placeholder-3.jpg b/examples/blog/public/blog-placeholder-3.jpg
new file mode 100644
index 000000000000..fbe2ac0cb0c7
Binary files /dev/null and b/examples/blog/public/blog-placeholder-3.jpg differ
diff --git a/examples/blog/public/blog-placeholder-4.jpg b/examples/blog/public/blog-placeholder-4.jpg
new file mode 100644
index 000000000000..f4fc88e293c2
Binary files /dev/null and b/examples/blog/public/blog-placeholder-4.jpg differ
diff --git a/examples/blog/public/blog-placeholder-5.jpg b/examples/blog/public/blog-placeholder-5.jpg
new file mode 100644
index 000000000000..c5646746c08c
Binary files /dev/null and b/examples/blog/public/blog-placeholder-5.jpg differ
diff --git a/examples/blog/public/blog-placeholder-about.jpg b/examples/blog/public/blog-placeholder-about.jpg
new file mode 100644
index 000000000000..cf5f68532f3e
Binary files /dev/null and b/examples/blog/public/blog-placeholder-about.jpg differ
diff --git a/examples/blog/public/favicon.ico b/examples/blog/public/favicon.ico
deleted file mode 100644
index 578ad458b890..000000000000
Binary files a/examples/blog/public/favicon.ico and /dev/null differ
diff --git a/examples/blog/public/favicon.svg b/examples/blog/public/favicon.svg
new file mode 100644
index 000000000000..f157bd1c5e28
--- /dev/null
+++ b/examples/blog/public/favicon.svg
@@ -0,0 +1,9 @@
+
diff --git a/examples/blog/public/fonts/atkinson-bold.woff b/examples/blog/public/fonts/atkinson-bold.woff
new file mode 100644
index 000000000000..e7f8977eca89
Binary files /dev/null and b/examples/blog/public/fonts/atkinson-bold.woff differ
diff --git a/examples/blog/public/fonts/atkinson-regular.woff b/examples/blog/public/fonts/atkinson-regular.woff
new file mode 100644
index 000000000000..bbe09c5843e5
Binary files /dev/null and b/examples/blog/public/fonts/atkinson-regular.woff differ
diff --git a/examples/blog/public/social.jpg b/examples/blog/public/social.jpg
deleted file mode 100644
index 906c761445ca..000000000000
Binary files a/examples/blog/public/social.jpg and /dev/null differ
diff --git a/examples/blog/public/social.png b/examples/blog/public/social.png
deleted file mode 100644
index 1399856f1f31..000000000000
Binary files a/examples/blog/public/social.png and /dev/null differ
diff --git a/examples/blog/sandbox.config.json b/examples/blog/sandbox.config.json
deleted file mode 100644
index 9178af77d7de..000000000000
--- a/examples/blog/sandbox.config.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "infiniteLoopProtection": true,
- "hardReloadOnChange": false,
- "view": "browser",
- "template": "node",
- "container": {
- "port": 3000,
- "startScript": "start",
- "node": "14"
- }
-}
diff --git a/examples/blog/src/components/Author.astro b/examples/blog/src/components/Author.astro
deleted file mode 100644
index 3b29e0e76761..000000000000
--- a/examples/blog/src/components/Author.astro
+++ /dev/null
@@ -1,18 +0,0 @@
----
-export interface Props {
- name: string;
- href: string;
-}
-
-const { name, href } = Astro.props;
----
-
-
-
-
diff --git a/examples/blog/src/components/Logo.astro b/examples/blog/src/components/Logo.astro
deleted file mode 100644
index a9292753698e..000000000000
--- a/examples/blog/src/components/Logo.astro
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
diff --git a/examples/blog/src/consts.ts b/examples/blog/src/consts.ts
new file mode 100644
index 000000000000..0df8a61f4cf7
--- /dev/null
+++ b/examples/blog/src/consts.ts
@@ -0,0 +1,5 @@
+// Place any global data in this file.
+// You can import this data from anywhere in your site by using the `import` keyword.
+
+export const SITE_TITLE = 'Astro Blog';
+export const SITE_DESCRIPTION = 'Welcome to my website!';
diff --git a/examples/blog/src/content.config.ts b/examples/blog/src/content.config.ts
new file mode 100644
index 000000000000..7d92b1a3bf77
--- /dev/null
+++ b/examples/blog/src/content.config.ts
@@ -0,0 +1,18 @@
+import { glob } from 'astro/loaders';
+import { defineCollection, z } from 'astro:content';
+
+const blog = defineCollection({
+ // Load Markdown and MDX files in the `src/content/blog/` directory.
+ loader: glob({ base: './src/content/blog', pattern: '**/*.{md,mdx}' }),
+ // Type-check frontmatter using a schema
+ schema: z.object({
+ title: z.string(),
+ description: z.string(),
+ // Transform string to Date object
+ pubDate: z.coerce.date(),
+ updatedDate: z.coerce.date().optional(),
+ heroImage: z.string().optional(),
+ }),
+});
+
+export const collections = { blog };
diff --git a/examples/blog/src/content/blog/first-post.md b/examples/blog/src/content/blog/first-post.md
new file mode 100644
index 000000000000..3066715bec1e
--- /dev/null
+++ b/examples/blog/src/content/blog/first-post.md
@@ -0,0 +1,16 @@
+---
+title: 'First post'
+description: 'Lorem ipsum dolor sit amet'
+pubDate: 'Jul 08 2022'
+heroImage: '/blog-placeholder-3.jpg'
+---
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
+
+Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
+
+Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
+
+Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
+
+Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
diff --git a/examples/blog/src/content/blog/markdown-style-guide.md b/examples/blog/src/content/blog/markdown-style-guide.md
new file mode 100644
index 000000000000..fd3de1e882db
--- /dev/null
+++ b/examples/blog/src/content/blog/markdown-style-guide.md
@@ -0,0 +1,214 @@
+---
+title: 'Markdown Style Guide'
+description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.'
+pubDate: 'Jun 19 2024'
+heroImage: '/blog-placeholder-1.jpg'
+---
+
+Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.
+
+## Headings
+
+The following HTML `
`—`
` elements represent six levels of section headings. `
` is the highest section level while `
` is the lowest.
+
+# H1
+
+## H2
+
+### H3
+
+#### H4
+
+##### H5
+
+###### H6
+
+## Paragraph
+
+Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
+
+Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
+
+## Images
+
+### Syntax
+
+```markdown
+![Alt text](./full/or/relative/path/of/image)
+```
+
+### Output
+
+![blog placeholder](/blog-placeholder-about.jpg)
+
+## Blockquotes
+
+The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
+
+### Blockquote without attribution
+
+#### Syntax
+
+```markdown
+> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
+> **Note** that you can use _Markdown syntax_ within a blockquote.
+```
+
+#### Output
+
+> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
+> **Note** that you can use _Markdown syntax_ within a blockquote.
+
+### Blockquote with attribution
+
+#### Syntax
+
+```markdown
+> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1]
+```
+
+#### Output
+
+> Don't communicate by sharing memory, share memory by communicating.
+> — Rob Pike[^1]
+
+[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
+
+## Tables
+
+### Syntax
+
+```markdown
+| Italics | Bold | Code |
+| --------- | -------- | ------ |
+| _italics_ | **bold** | `code` |
+```
+
+### Output
+
+| Italics | Bold | Code |
+| --------- | -------- | ------ |
+| _italics_ | **bold** | `code` |
+
+## Code Blocks
+
+### Syntax
+
+we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntax, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash
+
+````markdown
+```html
+
+
+
+
+ Example HTML5 Document
+
+
+
+
+
+```
+
+## List Types
+
+### Ordered List
+
+#### Syntax
+
+```markdown
+1. First item
+2. Second item
+3. Third item
+```
+
+#### Output
+
+1. First item
+2. Second item
+3. Third item
+
+### Unordered List
+
+#### Syntax
+
+```markdown
+- List item
+- Another item
+- And another item
+```
+
+#### Output
+
+- List item
+- Another item
+- And another item
+
+### Nested list
+
+#### Syntax
+
+```markdown
+- Fruit
+ - Apple
+ - Orange
+ - Banana
+- Dairy
+ - Milk
+ - Cheese
+```
+
+#### Output
+
+- Fruit
+ - Apple
+ - Orange
+ - Banana
+- Dairy
+ - Milk
+ - Cheese
+
+## Other Elements — abbr, sub, sup, kbd, mark
+
+### Syntax
+
+```markdown
+GIF is a bitmap image format.
+
+H2O
+
+Xn + Yn = Zn
+
+Press CTRL + ALT + Delete to end the session.
+
+Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.
+```
+
+### Output
+
+GIF is a bitmap image format.
+
+H2O
+
+Xn + Yn = Zn
+
+Press CTRL + ALT + Delete to end the session.
+
+Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.
diff --git a/examples/blog/src/content/blog/second-post.md b/examples/blog/src/content/blog/second-post.md
new file mode 100644
index 000000000000..f47e0937eb1c
--- /dev/null
+++ b/examples/blog/src/content/blog/second-post.md
@@ -0,0 +1,16 @@
+---
+title: 'Second post'
+description: 'Lorem ipsum dolor sit amet'
+pubDate: 'Jul 15 2022'
+heroImage: '/blog-placeholder-4.jpg'
+---
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
+
+Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
+
+Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
+
+Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
+
+Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
diff --git a/examples/blog/src/content/blog/third-post.md b/examples/blog/src/content/blog/third-post.md
new file mode 100644
index 000000000000..af82f0eff4c8
--- /dev/null
+++ b/examples/blog/src/content/blog/third-post.md
@@ -0,0 +1,16 @@
+---
+title: 'Third post'
+description: 'Lorem ipsum dolor sit amet'
+pubDate: 'Jul 22 2022'
+heroImage: '/blog-placeholder-2.jpg'
+---
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
+
+Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
+
+Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
+
+Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id cursus metus aliquam eleifend mi.
+
+Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
diff --git a/examples/blog/src/content/blog/using-mdx.mdx b/examples/blog/src/content/blog/using-mdx.mdx
new file mode 100644
index 000000000000..81603de4c8da
--- /dev/null
+++ b/examples/blog/src/content/blog/using-mdx.mdx
@@ -0,0 +1,31 @@
+---
+title: 'Using MDX'
+description: 'Lorem ipsum dolor sit amet'
+pubDate: 'Jun 01 2024'
+heroImage: '/blog-placeholder-5.jpg'
+---
+
+This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.
+
+## Why MDX?
+
+MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
+
+If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
+
+## Example
+
+Here is how you import and use a UI component inside of MDX.
+When you open this page in the browser, you should see the clickable button below.
+
+import HeaderLink from '../../components/HeaderLink.astro';
+
+
+ Embedded component in MDX
+
+
+## More Links
+
+- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
+- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
+- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
diff --git a/examples/blog/src/layouts/BlogPost.astro b/examples/blog/src/layouts/BlogPost.astro
index 50e85451121c..e67b2b30f859 100644
--- a/examples/blog/src/layouts/BlogPost.astro
+++ b/examples/blog/src/layouts/BlogPost.astro
@@ -1,25 +1,85 @@
---
+import type { CollectionEntry } from 'astro:content';
import BaseHead from '../components/BaseHead.astro';
-import BlogHeader from '../components/BlogHeader.astro';
-import BlogPost from '../components/BlogPost.astro';
+import Header from '../components/Header.astro';
+import Footer from '../components/Footer.astro';
+import FormattedDate from '../components/FormattedDate.astro';
+type Props = CollectionEntry<'blog'>['data'];
-const { content } = Astro.props;
-const { title, description, publishDate, author, heroImage, permalink, alt } = content;
+const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
---
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+ {heroImage && }
+
+
+
+
+
+ {
+ updatedDate && (
+
+ Last updated on
+
+ )
+ }
+
+
{title}
+
+
+
+
+
+
+
diff --git a/examples/blog/src/pages/about.astro b/examples/blog/src/pages/about.astro
new file mode 100644
index 000000000000..c9d5b0292ee8
--- /dev/null
+++ b/examples/blog/src/pages/about.astro
@@ -0,0 +1,62 @@
+---
+import Layout from '../layouts/BlogPost.astro';
+---
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
+ labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo
+ viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam
+ adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus
+ et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus
+ vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque
+ sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
+
+
+
+ Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non
+ tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non
+ blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna
+ porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis
+ massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc.
+ Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis
+ bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra
+ massa massa ultricies mi.
+
+
+
+ Mollis nunc sed id semper risus in. Convallis a cras semper auctor neque. Diam sit amet nisl
+ suscipit. Lacus viverra vitae congue eu consequat ac felis donec. Egestas integer eget aliquet
+ nibh praesent tristique magna sit amet. Eget magna fermentum iaculis eu non diam. In vitae
+ turpis massa sed elementum. Tristique et egestas quis ipsum suspendisse ultrices. Eget lorem
+ dolor sed viverra ipsum. Vel turpis nunc eget lorem dolor sed viverra. Posuere ac ut consequat
+ semper viverra nam. Laoreet suspendisse interdum consectetur libero id faucibus. Diam phasellus
+ vestibulum lorem sed risus ultricies tristique. Rhoncus dolor purus non enim praesent elementum
+ facilisis. Ultrices tincidunt arcu non sodales neque. Tempus egestas sed sed risus pretium quam
+ vulputate. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus ornare. Fringilla
+ urna porttitor rhoncus dolor purus non. Amet dictum sit amet justo donec enim.
+
+
+
+ Mattis ullamcorper velit sed ullamcorper morbi tincidunt. Tortor posuere ac ut consequat semper
+ viverra. Tellus mauris a diam maecenas sed enim ut sem viverra. Venenatis urna cursus eget nunc
+ scelerisque viverra mauris in. Arcu ac tortor dignissim convallis aenean et tortor at. Curabitur
+ gravida arcu ac tortor dignissim convallis aenean et tortor. Egestas tellus rutrum tellus
+ pellentesque eu. Fusce ut placerat orci nulla pellentesque dignissim enim sit amet. Ut enim
+ blandit volutpat maecenas volutpat blandit aliquam etiam. Id donec ultrices tincidunt arcu. Id
+ cursus metus aliquam eleifend mi.
+
+
+
+ Tempus quam pellentesque nec nam aliquam sem. Risus at ultrices mi tempus imperdiet. Id porta
+ nibh venenatis cras sed felis eget velit. Ipsum a arcu cursus vitae. Facilisis magna etiam
+ tempor orci eu lobortis elementum. Tincidunt dui ut ornare lectus sit. Quisque non tellus orci
+ ac. Blandit libero volutpat sed cras. Nec tincidunt praesent semper feugiat nibh sed pulvinar
+ proin gravida. Egestas integer eget aliquet nibh praesent tristique magna.
+
+
diff --git a/examples/blog/src/pages/blog/[...slug].astro b/examples/blog/src/pages/blog/[...slug].astro
new file mode 100644
index 000000000000..096bd1e828e4
--- /dev/null
+++ b/examples/blog/src/pages/blog/[...slug].astro
@@ -0,0 +1,21 @@
+---
+import { type CollectionEntry, getCollection } from 'astro:content';
+import BlogPost from '../../layouts/BlogPost.astro';
+import { render } from 'astro:content';
+
+export async function getStaticPaths() {
+ const posts = await getCollection('blog');
+ return posts.map((post) => ({
+ params: { slug: post.id },
+ props: post,
+ }));
+}
+type Props = CollectionEntry<'blog'>;
+
+const post = Astro.props;
+const { Content } = await render(post);
+---
+
+
+
+
diff --git a/examples/blog/src/pages/blog/index.astro b/examples/blog/src/pages/blog/index.astro
new file mode 100644
index 000000000000..1d8d02aa5be9
--- /dev/null
+++ b/examples/blog/src/pages/blog/index.astro
@@ -0,0 +1,111 @@
+---
+import BaseHead from '../../components/BaseHead.astro';
+import Header from '../../components/Header.astro';
+import Footer from '../../components/Footer.astro';
+import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts';
+import { getCollection } from 'astro:content';
+import FormattedDate from '../../components/FormattedDate.astro';
+
+const posts = (await getCollection('blog')).sort(
+ (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
+);
+---
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro
index 1e1264533e9c..31269efde09a 100644
--- a/examples/blog/src/pages/index.astro
+++ b/examples/blog/src/pages/index.astro
@@ -1,78 +1,50 @@
---
-// Component Imports
import BaseHead from '../components/BaseHead.astro';
-import BlogHeader from '../components/BlogHeader.astro';
-import BlogPostPreview from '../components/BlogPostPreview.astro';
-
-// Component Script:
-// You can write any JavaScript/TypeScript that you'd like here.
-// It will run during the build, but never in the browser.
-// All variables are available to use in the HTML template below.
-let title = 'Example Blog';
-let description = 'The perfect starter for your perfect blog.';
-let permalink = 'https://example.com/';
-
-// Data Fetching: List all Markdown posts in the repo.
-
-let allPosts = await Astro.glob('./posts/*.md');
-allPosts = allPosts.sort((a, b) => new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf());
-
-// Full Astro Component Syntax:
-// https://docs.astro.build/core-concepts/astro-components/
+import Header from '../components/Header.astro';
+import Footer from '../components/Footer.astro';
+import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
---
+
-
-
-
+
-
-
-
-
-
-
{title}
-
{description}
-
-
- {allPosts.map((p) => )}
-
-
-
+
+
+
🧑🚀 Hello, Astronaut!
+
+ Welcome to the official Astro blog starter template. This
+ template serves as a lightweight, minimally-styled starting point for anyone looking to build
+ a personal website, blog, or portfolio with Astro.
+
+
+ This template comes with a few integrations already configured in your
+ astro.config.mjs file. You can customize your setup with
+ Astro Integrations to add tools like Tailwind,
+ React, or Vue to your project.
+
+
Here are a few ideas on how to get started with the template:
+
+
Edit this page in src/pages/index.astro
+
Edit the site header items in src/components/Header.astro
+
Add your name to the footer in src/components/Footer.astro
+
Check out the included blog posts in src/content/blog/
+
Customize the blog post page layout in src/layouts/BlogPost.astro