diff --git a/.changeset/curvy-donkeys-knock.md b/.changeset/curvy-donkeys-knock.md new file mode 100644 index 000000000000..0197a800e052 --- /dev/null +++ b/.changeset/curvy-donkeys-knock.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes a regression introduced in v4.4.5 where image optimization did not work in dev mode when a base was configured. diff --git a/.changeset/few-worms-rush.md b/.changeset/few-worms-rush.md new file mode 100644 index 000000000000..3ca708f94865 --- /dev/null +++ b/.changeset/few-worms-rush.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Adds auto completion for `astro:` event names when adding or removing event listeners on `document`. diff --git a/.changeset/smooth-singers-kiss.md b/.changeset/smooth-singers-kiss.md new file mode 100644 index 000000000000..56d1ea893af4 --- /dev/null +++ b/.changeset/smooth-singers-kiss.md @@ -0,0 +1,5 @@ +--- +"@astrojs/node": patch +--- + +Fixes the `server.host` option to properly listen on all network interfaces when set to `true` diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e2a11d03eae3..552033711b0c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -7,15 +7,17 @@ module.exports = { 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:@typescript-eslint/stylistic-type-checked', 'prettier', + 'plugin:regexp/recommended', ], parser: '@typescript-eslint/parser', parserOptions: { project: ['./packages/*/tsconfig.json', './tsconfig.eslint.json'], tsconfigRootDir: __dirname, }, - plugins: ['@typescript-eslint', 'prettier', 'no-only-tests'], + plugins: ['@typescript-eslint', 'prettier', 'no-only-tests', 'regexp'], rules: { // These off/configured-differently-by-default rules fit well for us + '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/no-unused-vars': [ 'warn', @@ -71,6 +73,9 @@ module.exports = { // These rules enabled by the preset configs don't work well for us '@typescript-eslint/await-thenable': 'off', 'prefer-const': 'off', + + // In some cases, using explicit letter-casing is more performant than the `i` flag + 'regexp/use-ignore-case': 'off', }, overrides: [ { @@ -117,6 +122,12 @@ module.exports = { 'no-console': 'off', }, }, + { + files: ['packages/db/**/cli/**/*.ts'], + rules: { + 'no-console': 'off', + }, + }, { files: ['packages/astro/src/core/errors/errors-data.ts'], rules: { diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 7cc4d8db7381..4e1332d659ba 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -4,3 +4,5 @@ 1335797903a57716e9a02b0ffd8ca636b3883c62 # Manually format .astro files in example projects (#3862) 59e8c71786fd1c154904b3fefa7d26d88f4d92d2 +# Change formatting (#10180) +062623438b5dfd66682a967edc7b7c91bd29e888 diff --git a/.github/scripts/announce.js b/.github/scripts/announce.mjs similarity index 96% rename from .github/scripts/announce.js rename to .github/scripts/announce.mjs index 6ac4c2d3bacd..346e0f112b6f 100755 --- a/.github/scripts/announce.js +++ b/.github/scripts/announce.mjs @@ -132,7 +132,7 @@ async function generateMessage() { } if (message.length < 2000) { - console.log(message); + return message; } else { const { name, version, url } = packages.find((pkg) => pkg.name === 'astro') ?? packages[0]; message = `${emoji} Some ${descriptor} ${pluralize(verb)}\n\n`; @@ -158,11 +158,8 @@ async function generateMessage() { } async function run() { - if (!process.env.DISCORD_WEBHOOK) { - console.error('No DISCORD_WEBHOOK variable detected!'); - process.exit(1); - } const content = await generateMessage(); + console.log(content); setOutput('DISCORD_MESSAGE', content); } diff --git a/.github/scripts/bundle-size.mjs b/.github/scripts/bundle-size.mjs index f1c9ceab02b1..690d6e9284c4 100644 --- a/.github/scripts/bundle-size.mjs +++ b/.github/scripts/bundle-size.mjs @@ -68,7 +68,7 @@ async function bundle(files) { sourcemap: false, target: ['es2018'], outdir: 'out', - external: ['astro:*'], + external: ['astro:*', 'aria-query', 'axobject-query'], metafile: true, }) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 49d56655330a..44537f1338a7 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -21,18 +21,18 @@ jobs: MAIN-BENCH: ${{ steps.benchmark-main.outputs.BENCH_RESULT }} steps: # https://github.com/actions/checkout/issues/331#issuecomment-1438220926 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false ref: refs/pull/${{ github.event.issue.number }}/head - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: 18 cache: "pnpm" - name: Install dependencies @@ -63,7 +63,7 @@ jobs: shell: bash # main benchmark - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false ref: "main" @@ -94,7 +94,7 @@ jobs: pull-requests: write steps: - name: Comment PR - uses: peter-evans/create-or-update-comment@v2 + uses: peter-evans/create-or-update-comment@v4 continue-on-error: true with: issue-number: ${{ github.event.issue.number }} diff --git a/.github/workflows/check-merge.yml b/.github/workflows/check-merge.yml index 2a561154185c..0951081ed5e1 100644 --- a/.github/workflows/check-merge.yml +++ b/.github/workflows/check-merge.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Check if there is already a block on this PR id: blocked - uses: actions/github-script@v6 + uses: actions/github-script@v7 env: issue_number: ${{ github.event.number }} with: @@ -32,14 +32,14 @@ jobs: return 'false' result-encoding: string - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: steps.blocked.outputs.result != 'true' with: fetch-depth: 0 - name: Get changed files in the .changeset folder id: changed-files - uses: tj-actions/changed-files@v35 + uses: tj-actions/changed-files@v42 if: steps.blocked.outputs.result != 'true' with: files: | @@ -63,7 +63,7 @@ jobs: done - name: Add label - uses: actions/github-script@v6 + uses: actions/github-script@v7 if: steps.check.outputs.found == 'true' env: issue_number: ${{ github.event.number }} @@ -77,7 +77,7 @@ jobs: }); - name: Change PR Status - uses: actions/github-script@v6 + uses: actions/github-script@v7 if: steps.check.outputs.found == 'true' env: issue_number: ${{ github.event.number }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 268c577ce525..736db549c466 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -26,13 +26,13 @@ jobs: timeout-minutes: 7 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 339f03594e6e..7e7ee094b8e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,13 +47,13 @@ jobs: 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 + uses: pnpm/action-setup@v3 - name: Setup node@${{ matrix.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.NODE_VERSION }} cache: "pnpm" @@ -77,13 +77,13 @@ jobs: 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 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" @@ -97,9 +97,6 @@ jobs: - name: Lint run: pnpm run lint - - name: Format Check - run: pnpm run format --check - test: name: "Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})" runs-on: ${{ matrix.os }} @@ -110,7 +107,7 @@ jobs: OS: [ubuntu-latest] NODE_VERSION: [18, 20.5.1] include: - - os: macos-latest + - os: macos-14 NODE_VERSION: 18 - os: windows-latest NODE_VERSION: 18.17.1 @@ -122,13 +119,13 @@ jobs: 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 + uses: pnpm/action-setup@v3 - name: Setup node@${{ matrix.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.NODE_VERSION }} cache: "pnpm" @@ -159,13 +156,13 @@ jobs: 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 + uses: pnpm/action-setup@v3 - name: Setup node@${{ matrix.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.NODE_VERSION }} cache: "pnpm" @@ -195,19 +192,19 @@ jobs: 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 + uses: pnpm/action-setup@v3 - name: Setup node@${{ matrix.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.NODE_VERSION }} cache: "pnpm" - name: Checkout docs - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: withastro/docs path: smoke/docs @@ -227,7 +224,7 @@ jobs: - name: Check if docs changed id: changes - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v3 with: filters: | docs: diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml index cf03bbfee584..9d8205cc5390 100644 --- a/.github/workflows/cleanup-cache.yml +++ b/.github/workflows/cleanup-cache.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cleanup caches older than 5 days if: github.event_name == 'schedule' diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 6b1b0e4ad8bf..9faaa1886608 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -11,5 +11,5 @@ jobs: if: github.repository_owner == 'withastro' uses: withastro/automation/.github/workflows/format.yml@main with: - command: "format:ci" + command: "format" secrets: inherit diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml index 005d372085b3..7171a1b9b7bc 100644 --- a/.github/workflows/issue-opened.yml +++ b/.github/workflows/issue-opened.yml @@ -12,7 +12,7 @@ jobs: permissions: issues: write steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: script: | github.rest.issues.addLabels({ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e2fd8af4b0d..cb2cdd59d2a7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,13 +30,13 @@ jobs: outputs: run_job: ${{ steps.check_files.outputs.run_job }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" @@ -66,7 +66,7 @@ jobs: if: needs.check_for_update.outputs.run_job == 'true' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68a1c971764d..eb5cd362e54b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,13 +27,13 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" @@ -65,7 +65,7 @@ jobs: 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: diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index a22ec467bcbd..df934876abd3 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -7,6 +7,7 @@ on: - "main" paths: - "packages/astro/src/runtime/client/**/*" + - "!packages/astro/src/runtime/client/dev-toolbar/**/*" # Automatically cancel in-progress actions on the same branch concurrency: @@ -23,19 +24,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Checkout Main into tmp - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: main path: main - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 cache: "pnpm" @@ -44,7 +45,7 @@ jobs: run: pnpm install - name: Check Bundle Size - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const { default: script } = await import('${{ github.workspace }}/.github/scripts/bundle-size.mjs') diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml index b5cc835610b2..88eadac31432 100644 --- a/.github/workflows/snapshot-release.yml +++ b/.github/workflows/snapshot-release.yml @@ -19,8 +19,8 @@ jobs: 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 + permissions: + contents: read id-token: write issues: write pull-requests: write @@ -34,7 +34,7 @@ jobs: - name: Extract the snapshot name from comment body id: getSnapshotName - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const { body } = context.payload.comment; @@ -58,7 +58,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ steps.refs.outputs.head_ref }} fetch-depth: 0 @@ -66,10 +66,10 @@ jobs: - run: git fetch origin main:main - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 registry-url: "https://registry.npmjs.org" @@ -124,7 +124,7 @@ jobs: NO_COLOR: 1 - name: Pull Request Notification - uses: actions/github-script@v6 + uses: actions/github-script@v7 env: TAG: ${{ steps.getSnapshotName.outputs.result }} STATUS_DATA: ${{ steps.changesets.outputs.status }} diff --git a/.github/workflows/test-hosts.yml b/.github/workflows/test-hosts.yml index c60d80e31118..e26e250d232b 100644 --- a/.github/workflows/test-hosts.yml +++ b/.github/workflows/test-hosts.yml @@ -2,7 +2,7 @@ name: Hosted tests on: schedule: - - cron: '0 0 * * 0' + - cron: '0 0 * * 0' env: ASTRO_TELEMETRY_DISABLED: true @@ -19,33 +19,30 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PNPM - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - cache: "pnpm" + cache: 'pnpm' - name: Install dependencies run: pnpm install - + - name: Build Astro - run: pnpm turbo build --filter astro --filter @astrojs/vercel + 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 - + run: pnpm run build + - name: Deploy to Vercel working-directory: ./packages/integrations/vercel/test/hosted/hosted-astro-project - run: - pnpm dlx vercel --prod --prebuilt + run: pnpm dlx vercel --prod --prebuilt - name: Test - run: - pnpm run test:e2e:hosts + run: pnpm run test:e2e:hosts diff --git a/.gitignore b/.gitignore index da6e08ed057f..82c2ac20d516 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ package-lock.json *.env packages/astro/src/**/*.prebuilt.ts +packages/astro/src/**/*.prebuilt-dev.ts !packages/astro/vendor/vite/dist packages/integrations/**/.netlify/ diff --git a/.prettierignore b/.prettierignore index af84e34338c1..0703752ee5d7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,6 +10,9 @@ benchmark/results/ **/vendor **/.vercel +# Short-term need to format +!packages/db/test/fixtures + # Directories .github .changeset diff --git a/benchmark/bench/render.js b/benchmark/bench/render.js index ac733bdeaa61..20c9abb0f3a3 100644 --- a/benchmark/bench/render.js +++ b/benchmark/bench/render.js @@ -6,7 +6,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { waitUntilBusy } from 'port-authority'; import { calculateStat, astroBin } from './_util.js'; -import { renderFiles } from '../make-project/render-default.js'; +import { renderPages } from '../make-project/render-default.js'; const port = 4322; @@ -57,7 +57,7 @@ export async function run(projectDir, outputFile) { async function benchmarkRenderTime() { /** @type {Record} */ const result = {}; - for (const fileName of Object.keys(renderFiles)) { + for (const fileName of renderPages) { // Render each file 100 times and push to an array for (let i = 0; i < 100; i++) { const pathname = '/' + fileName.slice(0, -path.extname(fileName).length); diff --git a/benchmark/make-project/render-default.js b/benchmark/make-project/render-default.js index 3a01dcc47993..f42340fd3b64 100644 --- a/benchmark/make-project/render-default.js +++ b/benchmark/make-project/render-default.js @@ -3,31 +3,68 @@ import { loremIpsumHtml, loremIpsumMd } from './_util.js'; // Map of files to be generated and tested for rendering. // Ideally each content should be similar for comparison. -export const renderFiles = { - 'astro.astro': `\ +const renderFiles = { + 'components/ListItem.astro': `\ --- +const { className, item, attrs } = Astro.props; +const nested = item !== 0; +--- +
  • + + {item} + +
  • + `, + 'components/Sublist.astro': `\ +--- +import ListItem from '../components/ListItem.astro'; +const { items } = Astro.props; const className = "text-red-500"; const style = { color: "red" }; -const items = Array.from({ length: 1000 }, (_, i) => i); --- - + + `, + 'pages/astro.astro': `\ +--- +const className = "text-red-500"; +const style = { color: "red" }; +const items = Array.from({ length: 10000 }, (_, i) => ({i})); +--- My Site

    List

    - + ${Array.from({ length: 1000 }) .map(() => `

    ${loremIpsumHtml}

    `) .join('\n')} `, - 'md.md': `\ + 'pages/md.md': `\ # List ${Array.from({ length: 1000 }, (_, i) => i) @@ -38,7 +75,7 @@ ${Array.from({ length: 1000 }) .map(() => loremIpsumMd) .join('\n\n')} `, - 'mdx.mdx': `\ + 'pages/mdx.mdx': `\ export const className = "text-red-500"; export const style = { color: "red" }; export const items = Array.from({ length: 1000 }, (_, i) => i); @@ -57,16 +94,24 @@ ${Array.from({ length: 1000 }) `, }; +export const renderPages = []; +for (const file of Object.keys(renderFiles)) { + if (file.startsWith('pages/')) { + renderPages.push(file.replace('pages/', '')); + } +} + /** * @param {URL} projectDir */ export async function run(projectDir) { await fs.rm(projectDir, { recursive: true, force: true }); await fs.mkdir(new URL('./src/pages', projectDir), { recursive: true }); + await fs.mkdir(new URL('./src/components', projectDir), { recursive: true }); await Promise.all( Object.entries(renderFiles).map(([name, content]) => { - return fs.writeFile(new URL(`./src/pages/${name}`, projectDir), content, 'utf-8'); + return fs.writeFile(new URL(`./src/${name}`, projectDir), content, 'utf-8'); }) ); diff --git a/benchmark/packages/timer/src/preview.ts b/benchmark/packages/timer/src/preview.ts index 4ee43ebd0e9e..aa503c11bf57 100644 --- a/benchmark/packages/timer/src/preview.ts +++ b/benchmark/packages/timer/src/preview.ts @@ -1,5 +1,5 @@ -import type { CreatePreviewServer } from 'astro'; import { createServer } from 'node:http'; +import type { CreatePreviewServer } from 'astro'; import enableDestroy from 'server-destroy'; const preview: CreatePreviewServer = async function ({ serverEntrypoint, host, port }) { diff --git a/benchmark/packages/timer/src/server.ts b/benchmark/packages/timer/src/server.ts index d33e65c00ab8..9905a627b755 100644 --- a/benchmark/packages/timer/src/server.ts +++ b/benchmark/packages/timer/src/server.ts @@ -1,6 +1,6 @@ +import type { IncomingMessage, ServerResponse } from 'node:http'; import type { SSRManifest } from 'astro'; import { NodeApp, applyPolyfills } from 'astro/app/node'; -import type { IncomingMessage, ServerResponse } from 'node:http'; applyPolyfills(); diff --git a/biome.json b/biome.json new file mode 100644 index 000000000000..e3cd21509b6b --- /dev/null +++ b/biome.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "files": { + "include": ["test/**", "e2e/**", "packages/**"], + "ignore": ["vendor", "dist/**"] + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": false + }, + "formatter": { + "enabled": false + } +} diff --git a/examples/basics/package.json b/examples/basics/package.json index 6d4f97825b1d..86f892f41087 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.4" + "astro": "^4.4.6" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 8a988f43cdf5..c51c8592d4bc 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.0", - "@astrojs/rss": "^4.0.3", - "@astrojs/sitemap": "^3.0.5", - "astro": "^4.2.4" + "@astrojs/mdx": "^2.1.1", + "@astrojs/rss": "^4.0.5", + "@astrojs/sitemap": "^3.1.1", + "astro": "^4.4.6" } } diff --git a/examples/blog/src/components/HeaderLink.astro b/examples/blog/src/components/HeaderLink.astro index 3dd439be1af6..bb600fb65ac3 100644 --- a/examples/blog/src/components/HeaderLink.astro +++ b/examples/blog/src/components/HeaderLink.astro @@ -6,7 +6,8 @@ type Props = HTMLAttributes<'a'>; const { href, class: className, ...props } = Astro.props; const { pathname } = Astro.url; -const isActive = href === pathname || href === pathname.replace(/\/$/, ''); +const subpath = pathname.match(/[^\/]+/g); +const isActive = href === pathname || href === '/' + subpath?.[0]; --- diff --git a/examples/blog/src/content/blog/second-post.md b/examples/blog/src/content/blog/second-post.md index 19a910598e9f..f47e0937eb1c 100644 --- a/examples/blog/src/content/blog/second-post.md +++ b/examples/blog/src/content/blog/second-post.md @@ -1,7 +1,7 @@ --- title: 'Second post' description: 'Lorem ipsum dolor sit amet' -pubDate: 'Jul 22 2022' +pubDate: 'Jul 15 2022' heroImage: '/blog-placeholder-4.jpg' --- diff --git a/examples/blog/src/content/blog/third-post.md b/examples/blog/src/content/blog/third-post.md index 463cd253d181..af82f0eff4c8 100644 --- a/examples/blog/src/content/blog/third-post.md +++ b/examples/blog/src/content/blog/third-post.md @@ -1,7 +1,7 @@ --- title: 'Third post' description: 'Lorem ipsum dolor sit amet' -pubDate: 'Jul 15 2022' +pubDate: 'Jul 22 2022' heroImage: '/blog-placeholder-2.jpg' --- diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index 5113c8e8d93f..46975d8fbde4 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -11,7 +11,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; -
    +

    🧑‍🚀 Hello, Astronaut!

    diff --git a/examples/component/package.json b/examples/component/package.json index 8ce637d589c0..1cdb6b33662d 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,9 +15,9 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.2.4" + "astro": "^4.4.6" }, "peerDependencies": { - "astro": "^3.0.0" + "astro": "^4.0.0" } } diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index d6dba38a7987..b203a9e4167f 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/alpinejs": "^0.3.2", + "@astrojs/alpinejs": "^0.4.0", "@types/alpinejs": "^3.13.5", "alpinejs": "^3.13.3", - "astro": "^4.2.4" + "astro": "^4.4.6" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index 57a0cb109a66..6d8d7ff1291a 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^4.0.1", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^4.2.4", - "lit": "^2.8.0" + "astro": "^4.4.6", + "lit": "^3.1.2" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index aed44ca9455c..65bb39f7d3e8 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -11,12 +11,12 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^3.1.0", - "@astrojs/react": "^3.0.9", + "@astrojs/preact": "^3.1.1", + "@astrojs/react": "^3.0.10", "@astrojs/solid-js": "^4.0.1", - "@astrojs/svelte": "^5.0.3", + "@astrojs/svelte": "^5.2.0", "@astrojs/vue": "^4.0.8", - "astro": "^4.2.4", + "astro": "^4.4.6", "preact": "^10.19.2", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index 4ddaa990a776..5f61f5790fc4 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^3.1.0", + "@astrojs/preact": "^3.1.1", "@preact/signals": "^1.2.1", - "astro": "^4.2.4", + "astro": "^4.4.6", "preact": "^10.19.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index f03359a0d716..ad2b47014a5f 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^3.0.9", + "@astrojs/react": "^3.0.10", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^4.2.4", + "astro": "^4.4.6", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index df5af1cd1498..f4a1cd063707 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^4.0.1", - "astro": "^4.2.4", + "astro": "^4.4.6", "solid-js": "^1.8.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index f2c35fd7c494..c4b7e3b43332 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/svelte": "^5.0.3", - "astro": "^4.2.4", + "@astrojs/svelte": "^5.2.0", + "astro": "^4.4.6", "svelte": "^4.2.5" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 5ff5b2cefb5e..5864c5a006a1 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^4.0.8", - "astro": "^4.2.4", + "astro": "^4.4.6", "vue": "^3.3.8" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index b07972e13286..3560057d1e79 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/node": "^8.0.0", - "astro": "^4.2.4" + "@astrojs/node": "^8.2.1", + "astro": "^4.4.6" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 8403688f72b3..bd2cd6879db1 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,9 +15,9 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.2.4" + "astro": "^4.4.6" }, "peerDependencies": { - "astro": "^3.0.0" + "astro": "^4.0.0" } } diff --git a/examples/middleware/package.json b/examples/middleware/package.json index dfc479a1aeb2..9ee9f9fa601b 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -12,8 +12,8 @@ "server": "node dist/server/entry.mjs" }, "dependencies": { - "@astrojs/node": "^8.0.0", - "astro": "^4.2.4", + "@astrojs/node": "^8.2.1", + "astro": "^4.4.6", "html-minifier": "^4.0.0" }, "devDependencies": { diff --git a/examples/minimal/package.json b/examples/minimal/package.json index bf67cd4aebb7..85580d9cd383 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.4" + "astro": "^4.4.6" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 57c4a3a0dc41..f00fb4b5b97a 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.4" + "astro": "^4.4.6" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 24a8771d305e..e52d98f04c54 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.4" + "astro": "^4.4.6" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 2b37fc9ea9d9..592fc7077b67 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -12,9 +12,9 @@ "server": "node dist/server/entry.mjs" }, "dependencies": { - "@astrojs/node": "^8.0.0", - "@astrojs/svelte": "^5.0.3", - "astro": "^4.2.4", + "@astrojs/node": "^8.2.1", + "@astrojs/svelte": "^5.2.0", + "astro": "^4.4.6", "svelte": "^4.2.5" } } diff --git a/examples/starlog/package.json b/examples/starlog/package.json index cc877fb2bc79..83df3e1f30c6 100644 --- a/examples/starlog/package.json +++ b/examples/starlog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.2.4", + "astro": "^4.4.6", "sass": "^1.69.5", "sharp": "^0.32.6" } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index 39b0101b0f8b..a50877a080aa 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "@astrojs/tailwind": "^5.1.0", - "@astrojs/node": "^8.0.0", - "astro": "^4.2.4" + "@astrojs/node": "^8.2.1", + "astro": "^4.4.6" } } diff --git a/examples/view-transitions/src/components/Nav.astro b/examples/view-transitions/src/components/Nav.astro index 1fc229160d4a..4d11be24e6ca 100644 --- a/examples/view-transitions/src/components/Nav.astro +++ b/examples/view-transitions/src/components/Nav.astro @@ -1,7 +1,5 @@