chore: remove features and update adapters

This commit is contained in:
Emanuele Stoppa 2023-07-26 13:40:40 +01:00
parent dd54199d7c
commit 8d9f9a49f4
9 changed files with 33 additions and 46 deletions

View file

@ -1675,14 +1675,6 @@ export type AstroAdapterFeatureMap = {
* The adapter is able to serve SSR pages
*/
serverOutput?: SupportsKind;
/**
* Support for emitting a SSR file per page
*/
functionPerPage?: SupportsKind;
/**
* Support when `build.ecludeMiddleware` is enabled.
*/
edgeMiddleware?: SupportsKind;
/**
* The adapter can emit static assets
*/

View file

@ -239,9 +239,7 @@ export async function runHookConfigDone({
const ALL_UNSUPPORTED: Required<AstroAdapterFeatureMap> = {
serverOutput: UNSUPPORTED,
staticOutput: UNSUPPORTED,
edgeMiddleware: UNSUPPORTED,
hybridOutput: UNSUPPORTED,
functionPerPage: UNSUPPORTED,
assets: { supportKind: UNSUPPORTED },
};
@ -263,29 +261,13 @@ export function validateSupportedFeatures(
logging: LogOptions
): ValidationResult {
const {
functionPerPage = UNSUPPORTED,
edgeMiddleware = UNSUPPORTED,
assets,
serverOutput = UNSUPPORTED,
staticOutput = UNSUPPORTED,
hybridOutput = UNSUPPORTED,
} = featureMap;
const validationResult: ValidationResult = {};
validationResult.functionPerPage = validateSupportKind(
functionPerPage,
adapterName,
logging,
'functionPerPage',
() => config?.build?.split === true && config?.output === 'server'
);
validationResult.edgeMiddleware = validateSupportKind(
edgeMiddleware,
adapterName,
logging,
'edgeMiddleware',
() => config?.build?.excludeMiddleware === true
);
validationResult.staticOutput = validateSupportKind(
staticOutput,
adapterName,

View file

@ -72,8 +72,6 @@ export default function (
serverEntrypoint: '@my-ssr',
exports: ['manifest', 'createApp'],
supportedFeatures: {
edgeMiddleware: 'Stable',
functionPerPage: 'Stable',
assets: {
supportKind: 'Stable',
isNodeCompatible: true,

View file

@ -25,12 +25,13 @@ export function getAdapter(isModeDirectory: boolean): AstroAdapter {
serverEntrypoint: '@astrojs/cloudflare/server.directory.js',
exports: ['onRequest', 'manifest'],
supportedFeatures: {
functionPerPage: 'Experimental',
edgeMiddleware: 'Unsupported',
hybridOutput: 'Stable',
staticOutput: 'Unsupported',
serverOutput: 'Stable',
assets: 'Unsupported',
assets: {
supportKind: 'Unsupported',
isNodeCompatible: false,
},
},
}
: {
@ -38,12 +39,13 @@ export function getAdapter(isModeDirectory: boolean): AstroAdapter {
serverEntrypoint: '@astrojs/cloudflare/server.advanced.js',
exports: ['default'],
supportedFeatures: {
functionPerPage: 'Experimental',
edgeMiddleware: 'Unsupported',
hybridOutput: 'Stable',
staticOutput: 'Unsupported',
serverOutput: 'Stable',
assets: 'Unsupported',
assets: {
supportKind: 'Unsupported',
isNodeCompatible: false,
},
},
};
}

View file

@ -90,12 +90,13 @@ export function getAdapter(args?: Options): AstroAdapter {
args: args ?? {},
exports: ['stop', 'handle', 'start', 'running'],
supportedFeatures: {
functionPerPage: 'Unsupported',
edgeMiddleware: 'Unsupported',
hybridOutput: 'Stable',
staticOutput: 'Stable',
serverOutput: 'Stable',
assets: 'Unsupported',
assets: {
supportKind: 'Unsupported',
isNodeCompatible: false,
},
},
};
}

View file

@ -11,6 +11,15 @@ export function getAdapter(): AstroAdapter {
name: '@astrojs/netlify/edge-functions',
serverEntrypoint: '@astrojs/netlify/netlify-edge-functions.js',
exports: ['default'],
supportedFeatures: {
hybridOutput: 'Stable',
staticOutput: 'Stable',
serverOutput: 'Stable',
assets: {
supportKind: 'Unsupported',
isNodeCompatible: false,
},
},
};
}

View file

@ -15,12 +15,13 @@ export function getAdapter(args: Args = {}): AstroAdapter {
exports: ['handler'],
args,
supportedFeatures: {
functionPerPage: 'Experimental',
edgeMiddleware: 'Experimental',
hybridOutput: 'Stable',
staticOutput: 'Stable',
serverOutput: 'Stable',
assets: 'Unsupported',
assets: {
supportKind: 'Stable',
isNodeCompatible: true,
},
},
};
}

View file

@ -9,12 +9,13 @@ export function getAdapter(options: Options): AstroAdapter {
exports: ['handler', 'startServer'],
args: options,
supportedFeatures: {
functionPerPage: 'Stable',
edgeMiddleware: 'Stable',
hybridOutput: 'Stable',
staticOutput: 'Stable',
serverOutput: 'Stable',
assets: 'Experimental',
assets: {
supportKind: 'Stable',
isNodeCompatible: true,
},
},
};
}

View file

@ -35,12 +35,13 @@ function getAdapter(): AstroAdapter {
serverEntrypoint: `${PACKAGE_NAME}/entrypoint`,
exports: ['default'],
supportedFeatures: {
functionPerPage: 'Experimental',
edgeMiddleware: 'Experimental',
hybridOutput: 'Stable',
staticOutput: 'Stable',
serverOutput: 'Stable',
assets: 'Stable',
assets: {
supportKind: 'Unsupported',
isNodeCompatible: false,
},
},
};
}