diff options
author | 2024-09-11 14:26:50 +0200 | |
---|---|---|
committer | 2024-09-11 14:26:50 +0200 | |
commit | c4d2f17aba5b352573e6ac182803ec5d763c8c87 (patch) | |
tree | 2ee2e33e316bb3e2bffa93facd6cda27a361752d /packages/integrations/cloudflare/src | |
parent | 8d4c5276f39ab4391d064740c9c2f2666d494663 (diff) | |
download | astro-c4d2f17aba5b352573e6ac182803ec5d763c8c87.tar.gz astro-c4d2f17aba5b352573e6ac182803ec5d763c8c87.tar.zst astro-c4d2f17aba5b352573e6ac182803ec5d763c8c87.zip |
feat: remove hybrid (#375)
* feat: remove hybrid
* fix: udpate with new API
* fix: update for latest next changes
* fix: more test-utils fix
* fix: build
* fix: build
* fix: tests
* fix: netlify
* fix: astro env
* fix: use types from AStro
* chore: changeset
Diffstat (limited to 'packages/integrations/cloudflare/src')
-rw-r--r-- | packages/integrations/cloudflare/src/index.ts | 9 | ||||
-rw-r--r-- | packages/integrations/cloudflare/src/utils/image-config.ts | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index c4a42cd94..695af8671 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -141,10 +141,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.' ); } @@ -156,6 +156,7 @@ export default function createIntegration(args?: Options): AstroIntegration { exports: ['default'], adapterFeatures: { edgeMiddleware: false, + buildOutput: 'server', }, supportedAstroFeatures: { serverOutput: 'stable', diff --git a/packages/integrations/cloudflare/src/utils/image-config.ts b/packages/integrations/cloudflare/src/utils/image-config.ts index b191be366..21d9ec733 100644 --- a/packages/integrations/cloudflare/src/utils/image-config.ts +++ b/packages/integrations/cloudflare/src/utils/image-config.ts @@ -1,10 +1,10 @@ -import type { AstroConfig, AstroIntegrationLogger } from 'astro'; +import type { AstroConfig, AstroIntegrationLogger, HookParameters } from 'astro'; import { passthroughImageService, sharpImageService } from 'astro/config'; export function setImageConfig( service: string, config: AstroConfig['image'], - command: 'dev' | 'build' | 'preview', + command: HookParameters<'astro:config:setup'>['command'], logger: AstroIntegrationLogger ) { switch (service) { |