Skip to content

Commit

Permalink
Merge branch 'main' into add-multiple-cdn-v2
Browse files Browse the repository at this point in the history
* main: (327 commits)
  [ci] format
  fix(node): listen on 0.0.0.0 if server.host is set to true (withastro#10282)
  [ci] format
  fix(dev): cosider `base` when special-casing `/_image` (withastro#10274)
  [ci] format
  update login flow to support Brave (withastro#10258)
  [ci] format
  improve link command (withastro#10257)
  Updates deprecated Node.js 16 github actions (withastro#10270)
  Fix Vitest check fail again (withastro#10266)
  [ci] format
  Adds auto completion of `astro:` events when adding or removing event listeners on `document` (withastro#10263)
  Update Vite to latest (withastro#10259)
  [ci] release (withastro#10236)
  [ci] format
  fix(i18n): localised index pages are overwritten (withastro#10250)
  fix: change strategy for route caching (withastro#10248)
  Fix TypeScript type definitions for `Code` component (withastro#10251)
  chang changeset (withastro#10253)
  Removes morph animations when setting transition:animate=none (withastro#10247)
  ...
  • Loading branch information
peng committed Mar 1, 2024
2 parents acd1ec9 + df05138 commit 0600b34
Show file tree
Hide file tree
Showing 1,097 changed files with 29,319 additions and 10,598 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-donkeys-knock.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions .changeset/few-worms-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Adds auto completion for `astro:` event names when adding or removing event listeners on `document`.
5 changes: 5 additions & 0 deletions .changeset/smooth-singers-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/node": patch
---

Fixes the `server.host` option to properly listen on all network interfaces when set to `true`
13 changes: 12 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
1335797903a57716e9a02b0ffd8ca636b3883c62
# Manually format .astro files in example projects (#3862)
59e8c71786fd1c154904b3fefa7d26d88f4d92d2
# Change formatting (#10180)
062623438b5dfd66682a967edc7b7c91bd29e888
7 changes: 2 additions & 5 deletions .github/scripts/announce.js → .github/scripts/announce.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/bundle-size.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function bundle(files) {
sourcemap: false,
target: ['es2018'],
outdir: 'out',
external: ['astro:*'],
external: ['astro:*', 'aria-query', 'axobject-query'],
metafile: true,
})

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
shell: bash

# main benchmark
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: "main"
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/check-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/issue-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
Loading

0 comments on commit 0600b34

Please sign in to comment.