Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/withastro/astro into 11821-…
Browse files Browse the repository at this point in the history
…inferSize-error-local-image
  • Loading branch information
DerTimonius committed Oct 12, 2024
2 parents fe23ea2 + bbc72a1 commit 2253d35
Show file tree
Hide file tree
Showing 880 changed files with 14,842 additions and 110,187 deletions.
5 changes: 0 additions & 5 deletions .changeset/eight-rice-tap.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-papayas-rhyme.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fuzzy-falcons-tan.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/good-adults-punch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nasty-ladybugs-whisper.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/odd-otters-look.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/perfect-socks-dress.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thirty-bikes-peel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tiny-suns-sit.md

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
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/[email protected]
with:
permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/actions/checkout/issues/331#issuecomment-1438220926
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Get changed files in the .changeset folder
id: changed-files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
if: steps.blocked.outputs.result != 'true'
with:
files: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
run: pnpm run build

- name: Lint
run: pnpm run lint
run: pnpm run lint:ci

test:
name: "Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})"
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/congrats.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions .github/workflows/dispatch-event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
jobs:
repository-dispatch:
name: Repository dispatch
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
steps:
- name: Dispatch event on push - adapters
Expand Down
77 changes: 0 additions & 77 deletions .github/workflows/main.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/preview-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check if user has write access
uses: lannonbr/[email protected]
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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
issues: write
pull-requests: write
steps:
- name: "Check if user has write access"
uses: "lannonbr/[email protected]"
- name: Check if user has write access
uses: lannonbr/[email protected]
with:
permission: "write"
permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/sync-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Sync examples

on:
workflow_dispatch:
inputs:
skip-unchanged-check:
type: boolean
default: false
dry-run:
type: boolean
default: false
push:
branches:
- main
- next

# 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 }}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"quickFix.biome": true,
"source.fixAll.biome": true
"quickFix.biome": "explicit",
"source.fixAll.biome": "explicit"
}
}
13 changes: 7 additions & 6 deletions benchmark/bench/cli-startup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url';
import { execaCommand } from 'execa';
import { exec } from 'tinyexec';
import { markdownTable } from 'markdown-table';
import { astroBin, calculateStat } from './_util.js';

Expand All @@ -14,11 +14,11 @@ export async function run(projectDir, outputFile) {
const root = fileURLToPath(projectDir);

console.log('Benchmarking `astro --help`...');
const helpStat = await benchmarkCommand(`node ${astroBin} --help`, root);
const helpStat = await benchmarkCommand('node', [astroBin, '--help'], root);
console.log('Done');

console.log('Benchmarking `astro info`...');
const infoStat = await benchmarkCommand(`node ${astroBin} info`, root);
console.log('Benchmarking `astro preferences list`...');
const infoStat = await benchmarkCommand('node', [astroBin, 'preferences', 'list'], root);
console.log('Done');

console.log('Result preview:');
Expand All @@ -35,16 +35,17 @@ export async function run(projectDir, outputFile) {

/**
* @param {string} command
* @param {string[]} args
* @param {string} root
* @returns {Promise<import('./_util.js').Stat>}
*/
async function benchmarkCommand(command, root) {
async function benchmarkCommand(command, args, root) {
/** @type {number[]} */
const durations = [];

for (let i = 0; i < 10; i++) {
const start = performance.now();
await execaCommand(command, { cwd: root });
await exec(command, args, { nodeOptions: { cwd: root } });
durations.push(performance.now() - start);
}

Expand Down
14 changes: 8 additions & 6 deletions benchmark/bench/memory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execaCommand } from 'execa';
import { exec } from 'tinyexec';
import { markdownTable } from 'markdown-table';
import fs from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
Expand All @@ -18,11 +18,13 @@ export async function run(projectDir, outputFile) {
const outputFilePath = fileURLToPath(outputFile);

console.log('Building and benchmarking...');
await execaCommand(`node --expose-gc --max_old_space_size=10000 ${astroBin} build --silent`, {
cwd: root,
stdio: 'inherit',
env: {
ASTRO_TIMER_PATH: outputFilePath,
await exec('node', ['--expose-gc', '--max_old_space_size=10000', astroBin, 'build'], {
nodeOptions: {
cwd: root,
stdio: 'inherit',
env: {
ASTRO_TIMER_PATH: outputFilePath,
},
},
});

Expand Down
Loading

0 comments on commit 2253d35

Please sign in to comment.