/**
 * Cloudflare Pages adapter — scaffold.
 *
 * Cloudflare Pages "Direct Upload" requires a blake3-hashed asset manifest + multi-step
 * upload token flow (the wrangler toolchain), which isn't feasible purely server-side
 * without additional native dependencies. Rather than ship a broken deploy, this adapter
 * fails cleanly with guidance. The provider is kept in the enum/registry so it is fully
 * forward-compatible: swap this deploy() for the direct-upload implementation later with
 * no other changes. For Cloudflare today, connect a Git repo in the Cloudflare dashboard,
 * or use Netlify / SFTP.
 */

import { HostingAdapter, DeployInput, DeployResult } from './types';

const UNSUPPORTED =
  'Cloudflare Pages direct upload is not available in this build. Use Netlify, Vercel, GitHub Pages, or SFTP/FTP — or connect a Git repo in the Cloudflare dashboard.';

export const cloudflarePagesAdapter: HostingAdapter = {
  provider: 'cloudflare-pages',

  async validate() {
    return { ok: false, error: UNSUPPORTED };
  },

  async deploy(_input: DeployInput): Promise<DeployResult> {
    throw new Error(UNSUPPORTED);
  },
};
