Skip to content

Commit

Permalink
Merge branch '5.0.0-beta' into next/tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre committed Sep 3, 2024
2 parents ae4eb21 + 7d9eba5 commit d22df7b
Show file tree
Hide file tree
Showing 343 changed files with 18,486 additions and 2,860 deletions.
52 changes: 46 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,92 @@ jobs:
name: Generate Reference Docs
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Default options for running with latest Astro code
- SOURCE_BRANCH: main
TARGET_BRANCH: main
LABEL: ci
PR_BRANCH: ci/docgen
PR_TITLE: 'ci: update reference docs'
# Custom options for running with Astro v5 beta code
- SOURCE_BRANCH: next
TARGET_BRANCH: 5.0.0-beta
LABEL: 5.0.0-beta,ci
PR_BRANCH: ci/docgen-beta
PR_TITLE: '[BETA] ci: update reference docs'
steps:
- name: Check out code using Git
uses: actions/checkout@v4
with:
ref: ${{ matrix.TARGET_BRANCH }}

- name: Install Tools & Dependencies
uses: ./.github/actions/install

- name: Run docgen script
run: pnpm run docgen
env:
SOURCE_BRANCH: ${{ matrix.SOURCE_BRANCH }}

- name: Create Pull Request
id: createpr
uses: peter-evans/create-pull-request@v3
with:
branch: ci/docgen
branch: ${{ matrix.PR_BRANCH }}
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
add-paths: src/content/docs/en/reference/*.mdx
commit-message: 'ci: update reference docs'
title: 'ci: update reference docs'
title: ${{ matrix.PR_TITLE }}
body: |
This PR is auto-generated by a nightly GitHub action to update the reference docs from source code in withastro/astro.
labels: ci
labels: ${{ matrix.LABEL }}
base: ${{ matrix.TARGET_BRANCH }}

error:
name: Generate Error Reference Docs
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Default options for running with latest Astro code
- SOURCE_BRANCH: main
TARGET_BRANCH: main
LABEL: ci
PR_BRANCH: ci/docgen-errors
PR_TITLE: 'ci: update error reference docs'
# Custom options for running with Astro v5 beta code
- SOURCE_BRANCH: next
TARGET_BRANCH: 5.0.0-beta
LABEL: 5.0.0-beta,ci
PR_BRANCH: ci/docgen-errors-beta
PR_TITLE: '[BETA] ci: update error reference docs'
steps:
- name: Check out code using Git
uses: actions/checkout@v4
with:
ref: ${{ matrix.TARGET_BRANCH }}

- name: Install Tools & Dependencies
uses: ./.github/actions/install

- name: Run docgen script
run: pnpm run docgen:errors
env:
SOURCE_BRANCH: ${{ matrix.SOURCE_BRANCH }}

- name: Create Pull Request
id: createpr
uses: peter-evans/create-pull-request@v3
with:
branch: ci/docgen-errors
branch: ${{ matrix.PR_BRANCH }}
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
add-paths: src/content/docs/en/reference/*.mdx
commit-message: 'ci: update error reference docs'
title: 'ci: update error reference docs'
title: ${{ matrix.PR_TITLE }}
body: |
This PR is auto-generated by a nightly GitHub action to update the error reference docs from source code in withastro/astro.
labels: ci
labels: ${{ matrix.LABEL }}
base: ${{ matrix.TARGET_BRANCH }}
2 changes: 1 addition & 1 deletion .github/workflows/welcome-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
If they spot any broken links you will see some error messages on this PR.
Don’t hesitate to ask any questions if you’re not sure what these mean!
2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 🥳
2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.
3. One or more of our maintainers will take a look and may ask you to make changes.
We try to be responsive, but don’t worry if this takes a few days.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"src/content/docs/en/reference/errors/*": true,
"src/content/docs/en/reference/configuration-reference.mdx": true,
"src/content/docs/en/reference/error-reference.mdx": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
6 changes: 6 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import starlight from '@astrojs/starlight';
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections';
import { defineConfig, sharpImageService } from 'astro/config';
import { makeLocalesConfig } from './config/locales';
import { makeSidebar } from './config/sidebar';
Expand All @@ -23,6 +24,9 @@ export default defineConfig({
starlight({
title: 'Docs',
customCss: ['./src/styles/custom.css'],
expressiveCode: {
plugins: [pluginCollapsibleSections()],
},
components: {
EditLink: './src/components/starlight/EditLink.astro',
Head: './src/components/starlight/Head.astro',
Expand All @@ -32,9 +36,11 @@ export default defineConfig({
TableOfContents: './src/components/starlight/TableOfContents.astro',
PageSidebar: './src/components/starlight/PageSidebar.astro',
Pagination: './src/components/starlight/Pagination.astro',
Footer: './src/components/starlight/Footer.astro',
SiteTitle: './src/components/starlight/SiteTitle.astro',
Search: './src/components/starlight/Search.astro',
Sidebar: './src/components/starlight/Sidebar.astro',
MobileMenuFooter: './src/components/starlight/MobileMenuFooter.astro',
PageTitle: './src/components/starlight/PageTitle.astro',
},
editLink: {
Expand Down
4 changes: 2 additions & 2 deletions config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type StarlightSidebarConfig = NonNullable<Parameters<typeof starlight>[0]['sideb

/** Generate a Starlight sidebar config object from our existing `nav.ts` files. */
export function makeSidebar(): StarlightSidebarConfig {
let currentSubGroup: Extract<StarlightSidebarConfig[number], { items: any }>;
let currentSubGroup: Extract<StarlightSidebarConfig[number], { items: StarlightSidebarConfig }>;
return navTranslations.en.reduce((sidebar, item) => {
if ('header' in item) {
const newGroup = {
Expand All @@ -33,7 +33,7 @@ export function makeSidebar(): StarlightSidebarConfig {
};
if (item.nested) {
const parentGroup = sidebar.at(-1);
if (parentGroup && 'items' in parentGroup) {
if (parentGroup && typeof parentGroup !== 'string' && 'items' in parentGroup) {
parentGroup.items.push(newGroup);
}
} else {
Expand Down
3 changes: 0 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[build]
command = "NODE_OPTIONS=--max_old_space_size=4096 pnpm netlify:build"

[[plugins]]
package = "./netlify/cache-plugin"
56 changes: 0 additions & 56 deletions netlify/cache-plugin/index.js

This file was deleted.

1 change: 0 additions & 1 deletion netlify/cache-plugin/manifest.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/sitemap": "^3.1.5",
"@astrojs/starlight": "^0.24.4",
"@astrojs/starlight": "^0.26.1",
"@docsearch/js": "^3.5.2",
"@expressive-code/plugin-collapsible-sections": "^0.35.0",
"@fontsource/ibm-plex-mono": "^4.5.10",
"@lunariajs/core": "^0.1.1",
"canvas-confetti": "^1.6.0",
Expand Down
Loading

0 comments on commit d22df7b

Please sign in to comment.