From ecdcc2213ba83f5b830274271cc4c6a797340bb2 Mon Sep 17 00:00:00 2001 From: Jon Vivian <2586037+4leite@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:17:37 +1200 Subject: [PATCH] Fix disable custom send in development (#176) --- .changeset/shiny-llamas-work.md | 5 +++++ packages/create-oberon-app/plugins/send/custom.ts | 2 ++ packages/create-oberon-app/plugins/send/resend.ts | 7 ++++++- packages/create-oberon-app/plugins/send/sendgrid.ts | 7 ++++++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .changeset/shiny-llamas-work.md diff --git a/.changeset/shiny-llamas-work.md b/.changeset/shiny-llamas-work.md new file mode 100644 index 00000000..9c2144ce --- /dev/null +++ b/.changeset/shiny-llamas-work.md @@ -0,0 +1,5 @@ +--- +"create-oberon-app": patch +--- + +Fix default disable custom plugins in development diff --git a/packages/create-oberon-app/plugins/send/custom.ts b/packages/create-oberon-app/plugins/send/custom.ts index 1d790aae..e064326e 100644 --- a/packages/create-oberon-app/plugins/send/custom.ts +++ b/packages/create-oberon-app/plugins/send/custom.ts @@ -1,6 +1,7 @@ import "server-cli-only" import { + USE_DEVELOPMENT_SEND_PLUGIN, notImplemented, type OberonPlugin, type OberonSendAdapter, @@ -11,6 +12,7 @@ const SEND_SECRET = process.env.SEND_SECRET export const plugin: OberonPlugin = () => ({ name: "Custom Send Plugin", + disabled: USE_DEVELOPMENT_SEND_PLUGIN, adapter: { sendVerificationRequest: async ({ email, diff --git a/packages/create-oberon-app/plugins/send/resend.ts b/packages/create-oberon-app/plugins/send/resend.ts index 545cc84b..6a2e42ac 100644 --- a/packages/create-oberon-app/plugins/send/resend.ts +++ b/packages/create-oberon-app/plugins/send/resend.ts @@ -1,13 +1,18 @@ import "server-cli-only" import { Resend } from "resend" -import type { OberonPlugin, OberonSendAdapter } from "@oberoncms/core" +import { + USE_DEVELOPMENT_SEND_PLUGIN, + type OberonPlugin, + type OberonSendAdapter, +} from "@oberoncms/core" const EMAIL_FROM = process.env.EMAIL_FROM const RESEND_SECRET = process.env.RESEND_SECRET || process.env.SEND_SECRET export const plugin: OberonPlugin = () => ({ name: "Resend", + disabled: USE_DEVELOPMENT_SEND_PLUGIN, adapter: { sendVerificationRequest: async ({ email, diff --git a/packages/create-oberon-app/plugins/send/sendgrid.ts b/packages/create-oberon-app/plugins/send/sendgrid.ts index b4451962..cf9746b6 100644 --- a/packages/create-oberon-app/plugins/send/sendgrid.ts +++ b/packages/create-oberon-app/plugins/send/sendgrid.ts @@ -1,13 +1,18 @@ import "server-cli-only" import sgMail from "@sendgrid/mail" -import type { OberonPlugin, OberonSendAdapter } from "@oberoncms/core" +import { + USE_DEVELOPMENT_SEND_PLUGIN, + type OberonPlugin, + type OberonSendAdapter, +} from "@oberoncms/core" const EMAIL_FROM = process.env.EMAIL_FROM const SENDGRID_API_KEY = process.env.SENDGRID_API_KEY || process.env.SEND_SECRET export const plugin: OberonPlugin = () => ({ name: "Sendgrid", + disabled: USE_DEVELOPMENT_SEND_PLUGIN, adapter: { sendVerificationRequest: async ({ email,