Skip to content

Commit

Permalink
Merge branch 'main' into stable-custom-client-directives
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jun 5, 2023
2 parents 23a3a79 + 4c33576 commit 3e083c4
Show file tree
Hide file tree
Showing 227 changed files with 4,175 additions and 1,374 deletions.
33 changes: 33 additions & 0 deletions .changeset/chatty-actors-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
'astro': minor
---

Experimental redirects support

This change adds support for the redirects RFC, currently in stage 3: https://github.com/withastro/roadmap/pull/587

Now you can specify redirects in your Astro config:

```js
import { defineConfig } from 'astro/config';

export defineConfig({
redirects: {
'/blog/old-post': '/blog/new-post'
}
});
```

You can also specify spread routes using the same syntax as in file-based routing:

```js
import { defineConfig } from 'astro/config';

export defineConfig({
redirects: {
'/blog/[...slug]': '/articles/[...slug]'
}
});
```

By default Astro will build HTML files that contain the `<meta http-equiv="refresh">` tag. Adapters can also support redirect routes and create configuration for real HTTP-level redirects in production.
5 changes: 0 additions & 5 deletions .changeset/clever-garlics-doubt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/curvy-hotels-study.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/dirty-singers-enjoy.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/dry-taxis-suffer.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eighty-gifts-cheer.md

This file was deleted.

19 changes: 0 additions & 19 deletions .changeset/eleven-tables-speak.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/eleven-walls-explain.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fifty-months-mix.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/fuzzy-ladybugs-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/cloudflare': minor
---

Support for experimental redirects

This adds support for the redirects RFC in the Cloudflare adapter. No changes are necessary, simply use configured redirects and the adapter will update your `_redirects` file.
7 changes: 7 additions & 0 deletions .changeset/hip-news-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/vercel': minor
---

Support for experimental redirects

This adds support for the redirects RFC in the Vercel adapter. No changes are necessary, simply use configured redirects and the adapter will output the vercel.json file with the configuration values.
5 changes: 5 additions & 0 deletions .changeset/khaki-onions-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix HTML component type causing an error when imported in the editor
5 changes: 5 additions & 0 deletions .changeset/lazy-falcons-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix cookies not being set by middleware
6 changes: 0 additions & 6 deletions .changeset/lazy-zebras-invent.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/moody-coats-develop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/plenty-geese-fold.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/popular-berries-travel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spotty-glasses-return.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/static-slot-css.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/strange-socks-give.md

This file was deleted.

24 changes: 24 additions & 0 deletions .changeset/stupid-pumpkins-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'astro': minor
---

The Inline Stylesheets RFC is now stable!

You can now control how Astro bundles your css with a configuration change:

```ts
export default defineConfig({
...
build: {
inlineStylesheets: "auto"
}
...
})
```

The options:
- `inlineStylesheets: "never"`: This is the behavior you are familiar with. Every stylesheet is external, and added to the page via a `<link>` tag. Default.
- `inlineStylesheets: "auto"`: Small stylesheets are inlined into `<style>` tags and inserted into `<head>`, while larger ones remain external.
- `inlineStylesheets: "always"`: Every style required by the page is inlined.

As always, css files in the `public` folder are not affected.
5 changes: 5 additions & 0 deletions .changeset/tasty-stingrays-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

remove the white space after the doctype according to the property compressHTML
9 changes: 9 additions & 0 deletions .changeset/twenty-suns-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@astrojs/netlify': minor
---

Support for experimental redirects

This adds support for the redirects RFC in the Netlify adapter, including a new `@astrojs/netlify/static` adapter for static sites.

No changes are necessary when using SSR. Simply use configured redirects and the adapter will update your `_redirects` file.
5 changes: 0 additions & 5 deletions .changeset/wise-cars-hear.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/young-flies-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': minor
---

Remove experimental flag for the middleware
93 changes: 45 additions & 48 deletions .github/workflows/check-merge.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
name: Check mergeability

on: pull_request # run on pull request events
on: pull_request

permissions:
# grant write permission on the pull-requests endpoint
pull-requests: write
checks: write
statuses: write

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check if there is already a block on this PR
id: set-blocks
id: blocked
uses: actions/github-script@v6
env:
issue_number: ${{ github.event.number }}
with:
script: |
const url = 'https://api.github.com/repos/' + context.repo.owner + '/' + context.repo.repo + '/pulls/' + context.issue.number + '/reviews';
console.log('reviews URL', url);
const result = await github.request(url);
console.log(result);
const reviews = result.data;
for(const review of reviews) {
if(review.user.id === 41898282 && review.state === 'CHANGES_REQUESTED') {
return 'block';
const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: process.env.issue_number,
});
for (const review of reviews) {
if (review.user.login === 'github-actions[bot]' && review.state === 'CHANGES_REQUESTED') {
return 'true'
}
}
return '';
return 'false'
result-encoding: string

- uses: actions/checkout@v3
if: steps.set-blocks.outputs.blocks == ''
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
if: steps.set-blocks.outputs.blocks == ''
if: steps.blocked.outputs.result != 'true'
with:
files: |
.changeset/**/*.md
- name: Check if any changesets contain minor changes
id: find-blockers
if: steps.set-blocks.outputs.blocks == ''
id: minor
if: steps.blocked.outputs.result != 'true'
run: |
echo "Checking for changesets marked as minor"
echo '::set-output name=found::false'
Expand All @@ -54,38 +59,30 @@ jobs:
done
- name: Add label
if: steps.find-blockers.outputs.found == 'true'
run: |
curl --request POST \
--url https://api.github.com/repos/${{github.repository}}/issues/${{github.event.number}}/labels \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
-d '["semver minor"]'
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
uses: actions/github-script@v6
if: steps.minor.outputs.found == 'true'
env:
issue_number: ${{ github.event.number }}
with:
issue-number: ${{ github.event.number }}
comment-author: 'github-actions[bot]'
script: |
github.rest.issues.addLabels({
issue_number: process.env.issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['semver minor']
});
- name: Send PR review
if: steps.find-blockers.outputs.found == 'true'
uses: peter-evans/create-or-update-comment@v3
continue-on-error: true
- name: Change PR Status
uses: actions/github-script@v6
if: steps.minor.outputs.found == 'true'
env:
issue_number: ${{ github.event.number }}
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
This PR is blocked because it contains a `minor` changeset. A reviewer will merge this at the next release if approved.
edit-mode: replace
- name: Change PR status
if: steps.find-blockers.outputs.found == 'true'
run: |
curl --request POST \
--url https://api.github.com/repos/${{github.repository}}/pulls/${{github.event.number}}/reviews \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
-d '{"event":"REQUEST_CHANGES", body: ""}'
script: |
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: process.env.issue_number,
event: 'REQUEST_CHANGES',
body: 'This PR is blocked because it contains a `minor` changeset. A reviewer will merge this at the next release if approved.'
});
23 changes: 0 additions & 23 deletions .prettierrc.cjs

This file was deleted.

Loading

0 comments on commit 3e083c4

Please sign in to comment.