Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge next to main #451

Merged
merged 51 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1c5c6b0
Refactor/types (#11715)
Princesseuh Aug 16, 2024
5a9287f
Remove functionPerRoute option (#11714)
matthewp Aug 19, 2024
172fe43
[ci] release (alpha) (#11627)
astrobot-houston Aug 19, 2024
daa13a7
[ci] release (alpha) (#11627)
astrobot-houston Aug 19, 2024
0d758b3
Merge branch 'main' into next
Princesseuh Aug 20, 2024
ca154c7
feat: remove the squoosh image service (#11770)
Princesseuh Aug 20, 2024
70699d6
feat: remove the squoosh image service (#11770)
Princesseuh Aug 20, 2024
d45b9fa
feat(next): make astro:env stable (#11679)
florian-lefebvre Aug 21, 2024
c114431
feat(next): make astro:env stable (#11679)
florian-lefebvre Aug 21, 2024
462eb68
[ci] release (alpha) (#11787)
astrobot-houston Aug 23, 2024
56f8efc
[ci] release (alpha) (#11787)
astrobot-houston Aug 23, 2024
d854d8b
Merge branch 'main' into next
Princesseuh Aug 28, 2024
c05465e
Merge branch 'main' into next
Princesseuh Aug 28, 2024
ab25ae9
Merge branch 'vercel' into next
alexanderniebuhr Aug 29, 2024
ab679e1
Merge branch 'node' into next
alexanderniebuhr Aug 29, 2024
8502e93
chore: update build scripts
alexanderniebuhr Aug 29, 2024
ebc39a8
chore: fix tsconfig path
alexanderniebuhr Aug 29, 2024
e9c56c7
chore: supress linting
alexanderniebuhr Aug 29, 2024
d4fbedc
chore: fix testutils
alexanderniebuhr Aug 29, 2024
ed930dd
chore: next to use astro v5
alexanderniebuhr Aug 29, 2024
e02b54a
chore: fix type errors
alexanderniebuhr Aug 29, 2024
5990499
chore: fixes
alexanderniebuhr Aug 29, 2024
2478d2c
Merge `vercel` and `node` into next #367
alexanderniebuhr Aug 29, 2024
a3eda79
chore: enter pre mode
alexanderniebuhr Aug 29, 2024
600fec0
chore: run changeset on next
alexanderniebuhr Aug 29, 2024
17a7fe5
fix: build errors
alexanderniebuhr Aug 29, 2024
e7881f7
feat: remove hybrid (#375)
Princesseuh Sep 11, 2024
bb725b7
chore(next): astro:env cleanup (#385)
florian-lefebvre Sep 12, 2024
3a49eb7
feat: update adapters supported features to account for new shape for…
Princesseuh Sep 13, 2024
b77f99c
Adapter related changes for IntegrationData (#377)
alexanderniebuhr Sep 16, 2024
b6d8bb1
Merge branch 'main' into next
alexanderniebuhr Sep 17, 2024
bf61d7d
Merge branch 'main' into next
alexanderniebuhr Sep 17, 2024
6e9d891
[ci] format
alexanderniebuhr Sep 17, 2024
319cb1a
chore: fix typo in CHANGELOG
alexanderniebuhr Sep 17, 2024
776a266
feat: enter beta mode (#397)
Princesseuh Sep 17, 2024
87ec8f1
[ci] release (beta) (#368)
github-actions[bot] Sep 17, 2024
7d83f60
Remove vercel speedInsights option (#384)
bluwy Sep 19, 2024
9730bbf
Merge branch 'main' into next
bluwy Oct 1, 2024
3351348
feat(vercel): single entrypoint (#424)
ematipico Oct 25, 2024
e30c046
Merge branch 'main' into next
bluwy Oct 31, 2024
167b369
Update send to v1.1.0
bluwy Oct 31, 2024
f248546
Update esbuild to v0.24.0
bluwy Oct 31, 2024
aed689d
Fix build and types issue
bluwy Oct 31, 2024
ff2e024
[ci] release (beta) (#400)
github-actions[bot] Oct 31, 2024
b725b49
fix(vercel): output build directory (#437)
ematipico Nov 11, 2024
911d197
[ci] release (beta) (#439)
github-actions[bot] Nov 13, 2024
0ba7a39
chore: update Astro peer dep for adapters (#449)
ematipico Nov 28, 2024
21d79c8
Merge branch 'main' into next
ematipico Nov 28, 2024
92eaba8
update lock file
ematipico Nov 28, 2024
b9ca824
chore: fix build
ematipico Nov 28, 2024
683f239
skip cloudflare test
ematipico Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/blue-owls-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@astrojs/cloudflare': major
'@astrojs/netlify': major
---

Removed support for the Squoosh image service. As the underlying library `libsquoosh` is no longer maintained, and the image service sees very little usage we have decided to remove it from Astro.

Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained.

```diff
- import { squooshImageService } from "astro/config";
import { defineConfig } from "astro/config";

export default defineConfig({
- image: {
- service: squooshImageService()
- }
});
```

If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"changelog": ["@changesets/changelog-github", { "repo": "withastro/adapters" }],
"commit": false,
"access": "public",
"baseBranch": "main",
"baseBranch": "next",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed back to main

Suggested change
"baseBranch": "next",
"baseBranch": "main",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but I will do that in another PR using the changeset CLI, it's part of the steps

"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
Expand Down
21 changes: 21 additions & 0 deletions .changeset/early-berries-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@astrojs/cloudflare': major
'@astrojs/netlify': major
---

Deprecates the `functionPerRoute` option

This option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to:

```diff
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';

export default defineConfig({
// ...
output: 'server',
adapter: vercel({
- functionPerRoute: true,
}),
});
```
8 changes: 8 additions & 0 deletions .changeset/eighty-badgers-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@astrojs/cloudflare': major
'@astrojs/netlify': major
'@astrojs/vercel': major
'@astrojs/node': major
---

Updates internal code to works with Astro 5 changes to hybrid rendering. No changes are necessary to your project, apart from using Astro 5
16 changes: 16 additions & 0 deletions .changeset/fast-singers-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@astrojs/vercel': minor
---

Deprecates the entrypoints `@astrojs/vercel/serverless` and `@astrojs/vercel/static`. These will continue to work but are no longer documented and will be removed in a future version. We recommend updating to the `@astrojs/vercel` entrypoint as soon as you are able:

```diff
-import vercel from "@astrojs/vercel/static"
+import vercel from "@astrojs/vercel"
```


```diff
-import vercel from "@astrojs/vercel/serverless"
+import vercel from "@astrojs/vercel"
```
12 changes: 12 additions & 0 deletions .changeset/flat-dolls-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@astrojs/cloudflare': major
'@astrojs/netlify': major
'@astrojs/node': major
'@astrojs/vercel': major
---

Welcome to the Astro 5 beta! This release has no changes from the latest alpha of this package, but it does bring us one step closer to the final, stable release.

Starting from this release, no breaking changes will be introduced unless absolutely necessary.

To learn how to upgrade, check out the [Astro v5.0 upgrade guide in our beta docs site](https://5-0-0-beta.docs.astro.build/en/guides/upgrade-to/v5/).
5 changes: 5 additions & 0 deletions .changeset/olive-jobs-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': major
---

Updates the adapter to use new `IntegrationRouteData` type
25 changes: 25 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"@astrojs/cloudflare": "11.0.4",
"@astrojs/netlify": "5.5.3",
"@astrojs/node": "9.0.0-alpha.1",
"@astrojs/test-utils": "0.0.1",
"@astrojs/vercel": "8.0.0-alpha.1"
},
"changesets": [
"blue-owls-peel",
"early-berries-rush",
"eighty-badgers-change",
"fast-singers-design",
"flat-dolls-nail",
"olive-jobs-press",
"rare-candles-unite",
"silver-lemons-bow",
"sixty-trainers-shout",
"slow-mangos-call",
"sweet-geckos-double",
"yellow-avocados-share"
]
}
7 changes: 7 additions & 0 deletions .changeset/rare-candles-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/cloudflare': major
'@astrojs/netlify': major
'@astrojs/vercel': major
---

Updates esbuild dependency to v0.24.0
5 changes: 5 additions & 0 deletions .changeset/silver-lemons-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': major
---

Removes deprecated `speedInsights` option in favor of Vercel's direct support: https://vercel.com/docs/speed-insights/quickstart
7 changes: 7 additions & 0 deletions .changeset/sixty-trainers-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/netlify': minor
'@astrojs/vercel': minor
'@astrojs/node': minor
---

Cleans up `astro:env` support
5 changes: 5 additions & 0 deletions .changeset/slow-mangos-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Fixes a regression where the `@astrojs/vercel` single entry point for the adapter was causing some regressions in users projects.
8 changes: 8 additions & 0 deletions .changeset/sweet-geckos-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@astrojs/cloudflare': major
'@astrojs/netlify': major
'@astrojs/vercel': major
'@astrojs/node': major
---

Updates internal code for Astro 5 changes. No changes is required to your project, apart from using Astro 5
5 changes: 5 additions & 0 deletions .changeset/yellow-avocados-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/node': major
---

Updates `send` dependency to v1.1.0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package-lock.json
.eslintcache
.pnpm-store
.idea/
**/fixtures/**/.astro

# ignore top-level vscode settings
/.vscode/settings.json
Expand All @@ -20,4 +21,3 @@ package-lock.json

# exclude IntelliJ/WebStorm stuff
.idea

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react-dom",
"@types/react"
],
"allowAny": ["astro"]
"allowAny": ["astro", "vite"]
}
},
"devDependencies": {
Expand All @@ -47,7 +47,7 @@
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@types/node": "^22.10.0",
"esbuild": "^0.21.5",
"esbuild": "^0.24.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-no-only-tests": "^3.3.0",
Expand Down
54 changes: 54 additions & 0 deletions packages/cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# @astrojs/cloudflare

## 12.0.0-beta.1

### Major Changes

- [`f248546`](https://github.com/withastro/adapters/commit/f24854669a2a3da79d8bf1e89b0b54063df0668c) Thanks [@bluwy](https://github.com/bluwy)! - Updates esbuild dependency to v0.24.0

## 12.0.0-beta.0

### Major Changes

- [#367](https://github.com/withastro/adapters/pull/367) [`e02b54a`](https://github.com/withastro/adapters/commit/e02b54ad864ea25cb972f6196496b5aee36a47a3) Thanks [@alexanderniebuhr](https://github.com/alexanderniebuhr)! - Removed support for the Squoosh image service. As the underlying library `libsquoosh` is no longer maintained, and the image service sees very little usage we have decided to remove it from Astro.

Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained.

```diff
- import { squooshImageService } from "astro/config";
import { defineConfig } from "astro/config";

export default defineConfig({
- image: {
- service: squooshImageService()
- }
});
```

If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh

- [#367](https://github.com/withastro/adapters/pull/367) [`e02b54a`](https://github.com/withastro/adapters/commit/e02b54ad864ea25cb972f6196496b5aee36a47a3) Thanks [@alexanderniebuhr](https://github.com/alexanderniebuhr)! - Deprecates the `functionPerRoute` option

This option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to:

```diff
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel/serverless';

export default defineConfig({
// ...
output: 'server',
adapter: vercel({
- functionPerRoute: true,
}),
});
```

- [#375](https://github.com/withastro/adapters/pull/375) [`e7881f7`](https://github.com/withastro/adapters/commit/e7881f7928c6ca62d43c763033f9ed065a907f3b) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates internal code to works with Astro 5 changes to hybrid rendering. No changes are necessary to your project, apart from using Astro 5

- [#397](https://github.com/withastro/adapters/pull/397) [`776a266`](https://github.com/withastro/adapters/commit/776a26670cf483e37ec0e6eba27a0bde09db0146) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Welcome to the Astro 5 beta! This release has no changes from the latest alpha of this package, but it does bring us one step closer to the final, stable release.

Starting from this release, no breaking changes will be introduced unless absolutely necessary.

To learn how to upgrade, check out the [Astro v5.0 upgrade guide in our beta docs site](https://5-0-0-beta.docs.astro.build/en/guides/upgrade-to/v5/).

- [#392](https://github.com/withastro/adapters/pull/392) [`3a49eb7`](https://github.com/withastro/adapters/commit/3a49eb7802c44212ccfab06034b7dc5f2b060e94) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates internal code for Astro 5 changes. No changes is required to your project, apart from using Astro 5

## 11.2.0

### Minor Changes
Expand Down
16 changes: 8 additions & 8 deletions packages/cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@astrojs/cloudflare",
"description": "Deploy your site to Cloudflare Workers/Pages",
"version": "11.2.0",
"version": "12.0.0-beta.1",
"type": "module",
"types": "./dist/index.d.ts",
"author": "withastro",
Expand Down Expand Up @@ -29,29 +29,29 @@
},
"dependencies": {
"@astrojs/internal-helpers": "0.4.1",
"@astrojs/underscore-redirects": "^0.3.4",
"@astrojs/underscore-redirects": "^0.4.0-alpha.0",
"@cloudflare/workers-types": "^4.20241112.0",
"esbuild": "^0.21.5",
"@inox-tools/astro-when": "^0.2.4",
"esbuild": "^0.24.0",
"estree-walker": "^3.0.3",
"magic-string": "^0.30.14",
"miniflare": "^3.20241106.1",
"tiny-glob": "^0.2.9",
"wrangler": "^3.91.0",
"@inox-tools/astro-when": "^0.2.4"
"wrangler": "^3.91.0"
},
"peerDependencies": {
"astro": "^4.10.3"
"astro": "^5.0.0"
},
"devDependencies": {
"@astrojs/test-utils": "workspace:*",
"astro": "^4.16.15",
"astro": "^5.0.0-alpha.15",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"execa": "^8.0.1",
"fast-glob": "^3.3.2",
"rollup": "^4.27.4",
"strip-ansi": "^7.1.0",
"vite": "^5.4.11"
"vite": "6.0.1"
},
"publishConfig": {
"provenance": true
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/src/entrypoints/image-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const service: ExternalImageService = {
}

const imageEndpoint = joinPaths(
// @ts-expect-error - Property 'env' does not exist on type 'ImportMeta'.ts(2339)
// @ts-expect-error Can't recognise import.meta.env
import.meta.env.BASE_URL,
'/cdn-cgi/image',
resizingParams.join(','),
Expand Down
2 changes: 2 additions & 0 deletions packages/cloudflare/src/entrypoints/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const middlewares: Record<When, MiddlewareHandler> = {
[When.DevServer]: (_, next) => next(),
[When.Server]: (_, next) => next(),
[When.Prerender]: (ctx, next) => {
// @ts-expect-error
if (ctx.locals.runtime === undefined) {
// @ts-expect-error
ctx.locals.runtime = {
env: process.env,
};
Expand Down
26 changes: 11 additions & 15 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AstroConfig, AstroIntegration, RouteData } from 'astro';
import type { AstroConfig, AstroIntegration, IntegrationRouteData } from 'astro';
import type { PluginOption } from 'vite';

import { createReadStream } from 'node:fs';
Expand Down Expand Up @@ -75,8 +75,8 @@ function wrapWithSlashes(path: string): string {
function setProcessEnv(config: AstroConfig, env: Record<string, unknown>) {
const getEnv = createGetEnv(env);

if (config.experimental.env?.schema) {
for (const key of Object.keys(config.experimental.env.schema)) {
if (config.env?.schema) {
for (const key of Object.keys(config.env.schema)) {
const value = getEnv(key);
if (value !== undefined) {
process.env[key] = value;
Expand Down Expand Up @@ -137,10 +137,10 @@ export default function createIntegration(args?: Options): AstroIntegration {
order: 'pre',
});
},
'astro:config:done': ({ setAdapter, config }) => {
if (config.output === 'static') {
throw new AstroError(
'[@astrojs/cloudflare] `output: "server"` or `output: "hybrid"` is required to use this adapter. Otherwise, this adapter is not necessary to deploy a static site to Cloudflare.'
'astro:config:done': ({ setAdapter, config, buildOutput, logger }) => {
if (buildOutput === 'static') {
logger.warn(
'[@astrojs/cloudflare] This adapter is intended to be used with server rendered pages, which this project does not contain any of. As such, this adapter is unnecessary.'
);
}

Expand All @@ -151,19 +151,15 @@ export default function createIntegration(args?: Options): AstroIntegration {
serverEntrypoint: '@astrojs/cloudflare/entrypoints/server.js',
exports: ['default'],
adapterFeatures: {
functionPerRoute: false,
edgeMiddleware: false,
buildOutput: 'server',
},
supportedAstroFeatures: {
serverOutput: 'stable',
hybridOutput: 'stable',
staticOutput: 'unsupported',
i18nDomains: 'experimental',
assets: {
supportKind: 'stable',
isSharpCompatible: false,
isSquooshCompatible: false,
},
sharpImageService: 'limited',
envGetSecret: 'experimental',
},
});
Expand Down Expand Up @@ -295,7 +291,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
redirectsExists = false;
}

const redirects: RouteData['segments'][] = [];
const redirects: IntegrationRouteData['segments'][] = [];
if (redirectsExists) {
const rl = createInterface({
input: createReadStream(new URL('./_redirects', _config.outDir)),
Expand Down Expand Up @@ -342,7 +338,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
);
}

const redirectRoutes: [RouteData, string][] = [];
const redirectRoutes: [IntegrationRouteData, string][] = [];
for (const route of routes) {
if (route.type === 'redirect') redirectRoutes.push([route, '']);
}
Expand Down
Loading