From 2e87886f985d9fbc6920bf86e02784ae7a52cf32 Mon Sep 17 00:00:00 2001 From: Maxime Pauvert Date: Fri, 1 Mar 2024 12:41:41 +0100 Subject: [PATCH] chore: remove lagon --- src/options.ts | 1 - src/presets/index.ts | 1 - src/presets/lagon.ts | 71 -------------------------------------------- 3 files changed, 73 deletions(-) delete mode 100644 src/presets/lagon.ts diff --git a/src/options.ts b/src/options.ts index b02720412d..4198e5b2b2 100644 --- a/src/options.ts +++ b/src/options.ts @@ -546,7 +546,6 @@ function _resolveExportConditions( "browser", "workerd", "edge-light", - "lagon", "netlify", "edge-routine", "deno" diff --git a/src/presets/index.ts b/src/presets/index.ts index bf6fd9affb..f6568f6ed8 100644 --- a/src/presets/index.ts +++ b/src/presets/index.ts @@ -28,7 +28,6 @@ export { vercel, vercelEdge, vercelStatic } from "./vercel"; export { cleavr } from "./cleavr"; export { layer0 } from "./layer0"; export { flightControl } from "./flightcontrol"; -export { lagon } from "./lagon"; export { koyeb } from "./koyeb"; export { iis, iisHandler, iisNode } from "./iis"; export { _static as static } from "./static"; diff --git a/src/presets/lagon.ts b/src/presets/lagon.ts deleted file mode 100644 index aa677845fb..0000000000 --- a/src/presets/lagon.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { PackageJson } from "pkg-types"; -import { resolve, relative } from "pathe"; -import { defineNitroPreset } from "../preset"; -import { writeFile } from "../utils"; - -/** - * Both function_id and organization_id fields are required but only used when deploying the function - * Ref: https://github.com/lagonapp/lagon/blob/06093d051898d7603f356b9cae5e3f14078d480a/crates/cli/src/utils/deployments.rs#L34 - */ -export interface LagonFunctionConfig { - function_id: string; - organization_id: string; - index: string; - client?: string; - assets?: string; -} - -export const lagon = defineNitroPreset({ - extends: "base-worker", - entry: "#internal/nitro/entries/lagon", - exportConditions: ["lagon"], - commands: { - preview: "npm run dev --prefix ./", - deploy: "npm run deploy --prefix ./", - }, - rollupConfig: { - output: { - entryFileNames: "index.mjs", - format: "esm", - }, - }, - - hooks: { - async compiled(nitro) { - // Write Lagon config - const root = nitro.options.output.dir; - const indexPath = relative( - root, - resolve(nitro.options.output.serverDir, "index.mjs") - ); - const assetsDir = relative(root, nitro.options.output.publicDir); - - await writeFile( - resolve(root, ".lagon", "config.json"), - JSON.stringify({ - function_id: "", - organization_id: "", - index: indexPath, - client: null, - assets: assetsDir, - }) - ); - - // Write package.json for deployment - await writeFile( - resolve(nitro.options.output.dir, "package.json"), - JSON.stringify( - { - private: true, - scripts: { - dev: "npx -p esbuild -p @lagon/cli lagon dev", - deploy: "npx -p esbuild -p @lagon/cli lagon deploy", - }, - }, - null, - 2 - ) - ); - }, - }, -});