Skip to content

Commit

Permalink
Merge branch 'main' into calc-istty
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored Oct 23, 2023
2 parents 8a334fe + 99b683a commit b039565
Show file tree
Hide file tree
Showing 104 changed files with 916 additions and 239 deletions.
5 changes: 0 additions & 5 deletions .changeset/fresh-lizards-whisper.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/funny-deers-report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/heavy-lies-cover.md

This file was deleted.

14 changes: 14 additions & 0 deletions .changeset/lazy-actors-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@astrojs/vercel': minor
---

You can now configure how long your functions can run before timing out.

```diff
export default defineConfig({
output: "server",
adapter: vercel({
+ maxDuration: 60
}),
});
```
5 changes: 5 additions & 0 deletions .changeset/ninety-onions-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': minor
---

Automatically installs the required dependencies to run the astro check command when the user indicates they plan to write TypeScript.
5 changes: 5 additions & 0 deletions .changeset/silent-goats-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes CSS modules ordering by rendering styles before links
5 changes: 0 additions & 5 deletions .changeset/small-beers-laugh.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thin-flies-notice.md

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
// These off/configured-differently-by-default rules fit well for us
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/no-unused-vars': [
'error',
'warn',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'no-only-tests/no-only-tests': 'error',
Expand Down
3 changes: 0 additions & 3 deletions .github/CODEOWNERS

This file was deleted.

6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@

'pkg: vue':
- packages/integrations/vue/**

'docs pr':
- README.md
- packages/astro/src/@types/astro.ts
- packages/astro/src/core/errors/errors-data.ts
- .changeset/*.md
82 changes: 67 additions & 15 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ defaults:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
FORCE_COLOR: true
FORCE_COLOR: 1

jobs:
snapshot-release:
name: Create a snapshot release of a pull request
if: ${{ github.repository_owner == 'withastro' && github.event.issue.pull_request && startsWith(github.event.comment.body, '!preview') }}
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
Expand All @@ -37,14 +37,19 @@ jobs:
uses: actions/github-script@v6
with:
script: |
const splitComment = context.payload.comment.body.split(' ');
splitComment.length !== 2 && (github.rest.issues.createComment({
const { body } = context.payload.comment;
const PREVIEW_RE = /^[!\/](?:preview|snapshot)\s+(\S*)\s*$/gim;
const [_, name] = PREVIEW_RE.exec(body) ?? [];
if (name) return name;
const error = 'Invalid command. Expected: "/preview <snapshot-name>"'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Invalid comment format. Expected: "!preview <one-word-snapshot-name>"',
}) || core.setFailed('Invalid comment format. Expected: "!preview <one-word-snapshot-name>"'));
return splitComment[1].trim();
body: error,
})
core.setFailed(error)
result-encoding: string

- name: resolve pr refs
Expand All @@ -56,6 +61,9 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ steps.refs.outputs.head_ref }}
fetch-depth: 0

- run: git fetch origin main:main

- name: Setup PNPM
uses: pnpm/action-setup@v2
Expand All @@ -76,34 +84,78 @@ jobs:
- name: Bump Package Versions
id: changesets
run: |
pnpm exec changeset version --snapshot ${{ steps.getSnapshotName.outputs.result }} > changesets.output.txt 2>&1
echo ::set-output name=result::`cat changesets.output.txt`
pnpm exec changeset status --output status.output.json 2>&1
pnpm exec changeset version --snapshot ${{ steps.getSnapshotName.outputs.result }}
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "status<<$EOF" >> $GITHUB_OUTPUT
echo "$(cat status.output.json)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
env:
# Needs access to run the script
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Disable color
FORCE_COLOR: 0
NO_COLOR: 1

- name: Publish Release
id: publish
run: |
pnpm run release --tag next--${{ steps.getSnapshotName.outputs.result }} > publish.output.txt 2>&1
echo "Release complete"
GITHUB_ACTIONS=0 pnpm run build > build.output.txt 2>&1
pnpm exec changeset publish --tag experimental--${{ steps.getSnapshotName.outputs.result }} > publish.output.txt 2>&1
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "build<<$EOF" >> $GITHUB_OUTPUT
echo "$(cat build.output.txt)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
cat build.output.txt
echo "publish<<$EOF" >> $GITHUB_OUTPUT
echo "$(cat publish.output.txt)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
cat publish.output.txt
echo ::set-output name=result::`cat publish.output.txt`
env:
# Needs access to publish to npm
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Disable color
FORCE_COLOR: 0
NO_COLOR: 1

- name: Pull Request Notification
uses: actions/github-script@v6
env:
MESSAGE: ${{ steps.publish.outputs.result }}
TAG: ${{ steps.getSnapshotName.outputs.result }}
STATUS_DATA: ${{ steps.changesets.outputs.status }}
BUILD_LOG: ${{ steps.publish.outputs.build }}
PUBLISH_LOG: ${{ steps.publish.outputs.publish }}
with:
script: |
console.log(process.env.MESSAGE);
let changeset = { releases: [] };
try {
changeset = JSON.parse(process.env.STATUS_DATA);
} catch (e) {}
let message = 'Snapshots have been released for the following packages:'
for (const release of changeset.releases) {
if (release.type === 'none') continue;
message += `\n- \`${release.name}@experimental--${process.env.TAG}\``;
}
function details(title, body) {
message += '\n';
message += `<details><summary><strong>${title}</strong></summary>`
message += '\n\n```\n';
message += body;
message += '\n```\n\n</details>';
}
details('Publish Log', process.env.PUBLISH_LOG);
details('Build Log', process.env.BUILD_LOG);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '```\n' + process.env.MESSAGE + '\n```',
body: message,
})
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
4 changes: 2 additions & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/mdx": "^1.1.2",
"@astrojs/rss": "^3.0.0",
"@astrojs/sitemap": "^3.0.1",
"astro": "^3.3.1"
"@astrojs/sitemap": "^3.0.2",
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^3.3.1"
"astro": "^3.3.3"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.3.1",
"@types/alpinejs": "^3.7.2",
"alpinejs": "^3.12.3",
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/lit": "^3.0.2",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^3.3.1",
"astro": "^3.3.3",
"lit": "^2.8.0"
}
}
4 changes: 2 additions & 2 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@astrojs/react": "^3.0.3",
"@astrojs/solid-js": "^3.0.2",
"@astrojs/svelte": "^4.0.3",
"@astrojs/vue": "^3.0.1",
"astro": "^3.3.1",
"@astrojs/vue": "^3.0.2",
"astro": "^3.3.3",
"preact": "^10.17.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.0.1",
"@preact/signals": "^1.2.1",
"astro": "^3.3.1",
"astro": "^3.3.3",
"preact": "^10.17.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/react": "^3.0.3",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"astro": "^3.3.1",
"astro": "^3.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^3.0.2",
"astro": "^3.3.1",
"astro": "^3.3.3",
"solid-js": "^1.7.11"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^4.0.3",
"astro": "^3.3.1",
"astro": "^3.3.3",
"svelte": "^4.2.0"
}
}
4 changes: 2 additions & 2 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vue": "^3.0.1",
"astro": "^3.3.1",
"@astrojs/vue": "^3.0.2",
"astro": "^3.3.3",
"vue": "^3.3.4"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^6.0.3",
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^3.3.1"
"astro": "^3.3.3"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^6.0.3",
"astro": "^3.3.1",
"astro": "^3.3.3",
"html-minifier": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/node": "^6.0.3",
"@astrojs/svelte": "^4.0.3",
"astro": "^3.3.1",
"astro": "^3.3.3",
"svelte": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/view-transitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"devDependencies": {
"@astrojs/tailwind": "^5.0.2",
"@astrojs/node": "^6.0.3",
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.6.0",
"astro": "^3.3.1"
"astro": "^3.3.3"
}
}
Loading

0 comments on commit b039565

Please sign in to comment.