Skip to content

Commit

Permalink
Merge branch 'main' into improve-create-astro
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored Jan 2, 2024
2 parents 60ff4e6 + d48ab90 commit 5371bfc
Show file tree
Hide file tree
Showing 228 changed files with 4,658 additions and 5,444 deletions.
8 changes: 8 additions & 0 deletions .changeset/breezy-eyes-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"astro": patch
---

Fixes back navigation to fragment links (e.g. `#about`) in Firefox when using view transitions

Co-authored-by: Florian Lefebvre <69633530+florian-lefebvre@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
5 changes: 0 additions & 5 deletions .changeset/breezy-hairs-yell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/friendly-tables-worry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/modern-humans-think.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/real-bags-hope.md

This file was deleted.

Binary file added .github/assets/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ jobs:
- name: Build autogenerated docs pages from current astro branch
if: ${{ steps.changes.outputs.docs == 'true' }}
run: cd smoke/docs && pnpm docgen && pnpm docgen:errors && pnpm docgen:integrations
run: cd smoke/docs && pnpm docgen && pnpm docgen:errors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SOURCE_REPO: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Build the web you want](.github/assets/banner.png 'Build the web you want')
![Build the web you want](.github/assets/banner.jpg 'Build the web you want')

<p align="center">
<br/>
Expand Down
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.0.6"
"astro": "^4.0.9"
}
}
6 changes: 3 additions & 3 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^2.0.1",
"@astrojs/mdx": "^2.0.3",
"@astrojs/rss": "^4.0.1",
"@astrojs/sitemap": "^3.0.3",
"astro": "^4.0.6"
"@astrojs/sitemap": "^3.0.4",
"astro": "^4.0.9"
}
}
8 changes: 4 additions & 4 deletions examples/blog/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
<h1>🧑‍🚀 Hello, Astronaut!</h1>
<p>
Welcome to the official <a href="https://astro.build/">Astro</a> 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.
template serves as a lightweight, minimally-styled starting point for anyone looking to build
a personal website, blog, or portfolio with Astro.
</p>
<p>
This template comes with a few integrations already configured in your
<code>astro.config.mjs</code> file. You can customize your setup with
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like
Tailwind, React, or Vue to your project.
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
React, or Vue to your project.
</p>
<p>Here are a few ideas on how to get started with the template:</p>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.0.6"
"astro": "^4.0.9"
},
"peerDependencies": {
"astro": "^3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/alpinejs": "^0.3.1",
"@astrojs/alpinejs": "^0.3.2",
"@types/alpinejs": "^3.13.5",
"alpinejs": "^3.13.3",
"astro": "^4.0.6"
"astro": "^4.0.9"
}
}
4 changes: 2 additions & 2 deletions examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/lit": "^4.0.0",
"@astrojs/lit": "^4.0.1",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^4.0.6",
"astro": "^4.0.9",
"lit": "^2.8.0"
}
}
12 changes: 6 additions & 6 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@astrojs/react": "^3.0.7",
"@astrojs/solid-js": "^3.0.2",
"@astrojs/svelte": "^5.0.1",
"@astrojs/vue": "^4.0.4",
"astro": "^4.0.6",
"@astrojs/preact": "^3.0.2",
"@astrojs/react": "^3.0.9",
"@astrojs/solid-js": "^3.0.3",
"@astrojs/svelte": "^5.0.3",
"@astrojs/vue": "^4.0.7",
"astro": "^4.0.9",
"preact": "^10.19.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@astrojs/preact": "^3.0.2",
"@preact/signals": "^1.2.1",
"astro": "^4.0.6",
"astro": "^4.0.9",
"preact": "^10.19.2"
}
}
4 changes: 2 additions & 2 deletions examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^3.0.7",
"@astrojs/react": "^3.0.9",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"astro": "^4.0.6",
"astro": "^4.0.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/solid-js": "^3.0.2",
"astro": "^4.0.6",
"@astrojs/solid-js": "^3.0.3",
"astro": "^4.0.9",
"solid-js": "^1.8.5"
}
}
4 changes: 2 additions & 2 deletions examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/svelte": "^5.0.1",
"astro": "^4.0.6",
"@astrojs/svelte": "^5.0.3",
"astro": "^4.0.9",
"svelte": "^4.2.5"
}
}
4 changes: 2 additions & 2 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vue": "^4.0.4",
"astro": "^4.0.6",
"@astrojs/vue": "^4.0.7",
"astro": "^4.0.9",
"vue": "^3.3.8"
}
}
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^7.0.1",
"astro": "^4.0.6"
"@astrojs/node": "^7.0.4",
"astro": "^4.0.9"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/src/pages/stories/[id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const story = (await fetchAPI(`item/${id}`)) as IStory;
<a href={`/users/${story.user}`}>
{story.user}
</a>
&nbsp;{story.time_ago}
&nbsp;{story.time_ago}
</p>
</header>
<main>
Expand Down
4 changes: 2 additions & 2 deletions examples/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export default function createIntegration(): AstroIntegration {
// See the @astrojs/react integration for an example
// https://github.com/withastro/astro/blob/main/packages/integrations/react/src/index.ts
},
'astro:build:setup': ({ pages, updateConfig }) => {
'astro:build:setup': () => {
// See the @astrojs/lit integration for an example
// https://github.com/withastro/astro/blob/main/packages/integrations/lit/src/index.ts
},
'astro:build:done': ({ dir, routes }) => {
'astro:build:done': () => {
// See the @astrojs/partytown integration for an example
// https://github.com/withastro/astro/blob/main/packages/integrations/partytown/src/index.ts
},
Expand Down
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.0.6"
"astro": "^4.0.9"
},
"peerDependencies": {
"astro": "^3.0.0"
Expand Down
7 changes: 5 additions & 2 deletions examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^7.0.1",
"astro": "^4.0.6",
"@astrojs/node": "^7.0.4",
"astro": "^4.0.9",
"html-minifier": "^4.0.0"
},
"devDependencies": {
"@types/html-minifier": "^4.0.5"
}
}
7 changes: 5 additions & 2 deletions examples/middleware/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import htmlMinifier from 'html-minifier';

const limit = 50;

const loginInfo = {
const loginInfo: {
token: undefined | string;
currentTime: undefined | number;
} = {
token: undefined,
currentTime: undefined,
};

export const minifier = defineMiddleware(async (context, next) => {
export const minifier = defineMiddleware(async (_context, next) => {
const response = await next();
// check if the response is returning some HTML
if (response.headers.get('content-type') === 'text/html') {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.0.6"
"astro": "^4.0.9"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.0.6"
"astro": "^4.0.9"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.0.6"
"astro": "^4.0.9"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]
<div class="menu-header">
<a href="/" class="site-title">
<Icon icon="terminal-window" color="var(--accent-regular)" size="1.6em" gradient />
Jeanine White
Jeanine White
</a>
<menu-button>
<template>
Expand Down
7 changes: 3 additions & 4 deletions examples/portfolio/src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import Hero from '../components/Hero.astro';
<div class="content">
<p>
Lorem ipsum dolor sit amet, <a href="https://astro.build/">Astro</a> makes people happy.
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Proin nibh nisl
condimentum id venenatis a condimentum vitae. Dapibus ultrices in iaculis nunc. Arcu
odio ut sem nulla pharetra diam sit amet. Diam quis enim lobortis scelerisque fermentum
dui faucibus in ornare.
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Proin nibh nisl condimentum
id venenatis a condimentum vitae. Dapibus ultrices in iaculis nunc. Arcu odio ut sem nulla
pharetra diam sit amet. Diam quis enim lobortis scelerisque fermentum dui faucibus in ornare.
</p>
<p>
Arcu dui vivamus arcu felis bibendum ut tristique et egestas. Eget gravida cum sociis
Expand Down
6 changes: 3 additions & 3 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^7.0.1",
"@astrojs/svelte": "^5.0.1",
"astro": "^4.0.6",
"@astrojs/node": "^7.0.4",
"@astrojs/svelte": "^5.0.3",
"astro": "^4.0.9",
"svelte": "^4.2.5"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function get<T>(
});
if (!response.ok) {
// TODO make this better...
return null;
throw new Error('Fetch failed');
}
return cb(response);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/ssr/src/pages/api/cart.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIContext } from 'astro';
import type { APIContext } from 'astro';
import { userCartItems } from '../../models/session';

export function GET({ cookies }: APIContext) {
Expand All @@ -21,7 +21,7 @@ interface AddToCartItem {
export async function POST({ cookies, request }: APIContext) {
const item: AddToCartItem = await request.json();

let userId = cookies.get('user-id').value;
let userId = cookies.get('user-id')?.value;

if (!userCartItems.has(userId)) {
userCartItems.set(userId, new Map());
Expand Down
2 changes: 1 addition & 1 deletion examples/ssr/src/pages/login.form.async.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIContext, APIRoute } from 'astro';
import type { APIContext, APIRoute } from 'astro';

export const POST: APIRoute = ({ cookies }: APIContext) => {
// add a new cookie
Expand Down
2 changes: 1 addition & 1 deletion examples/ssr/src/pages/login.form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIContext } from 'astro';
import type { APIContext } from 'astro';

export function POST({ cookies }: APIContext) {
// add a new cookie
Expand Down
7 changes: 7 additions & 0 deletions examples/starlog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Starlog

## Release notes theme for Astro

![starlog-gh](https://github.com/doodlemarks/starlog/assets/2244813/9c5c2e46-665a-437e-a971-053db4dbff63)

Built with Astro and Sass. Supports both dark and light modes.
6 changes: 6 additions & 0 deletions examples/starlog/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
site: 'https://example.com',
});
Loading

0 comments on commit 5371bfc

Please sign in to comment.