CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-sveltejs--adapter-auto

SvelteKit adapter that automatically detects deployment environment and installs appropriate platform-specific adapter

Overall
score

96%

Overview
Eval results
Files

task.mdevals/scenario-4/

Environment-Based Build Adapter Router

A smart build adapter router that detects the deployment environment and automatically delegates to the appropriate platform-specific build adapter.

Capabilities

Environment Detection

The router should detect deployment environments by checking for platform-specific environment variables.

  • When VERCEL environment variable is set, it should detect Vercel as the platform @test
  • When NETLIFY environment variable is set, it should detect Netlify as the platform @test
  • When CF_PAGES environment variable is set, it should detect Cloudflare Pages as the platform @test
  • When no platform-specific environment variables are set, it should return null @test

Adapter Delegation

The router should delegate build operations to the resolved platform-specific adapter by dynamically loading and calling the appropriate adapter module.

  • For Vercel environment, it should load and call @sveltejs/adapter-vercel with the build configuration @test
  • For Netlify environment, it should load and call @sveltejs/adapter-netlify with the build configuration @test
  • It should pass through the return value from the platform-specific adapter @test
  • When no platform is detected, it should throw an error with a helpful message @test

Implementation

@generates

API

/**
 * Creates an environment-based build adapter router that automatically
 * detects the platform and delegates to the appropriate adapter
 * @returns {Object} An adapter object with adapt() method
 */
export default function createAdapter() {
  // Returns an adapter object
}

Dependencies { .dependencies }

@sveltejs/adapter-auto { .dependency }

Provides environment detection and adapter delegation functionality for SvelteKit builds.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-sveltejs--adapter-auto

tile.json