Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disable custom send in development #176

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shiny-llamas-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-oberon-app": patch
---

Fix default disable custom plugins in development
2 changes: 2 additions & 0 deletions packages/create-oberon-app/plugins/send/custom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "server-cli-only"

import {
USE_DEVELOPMENT_SEND_PLUGIN,
notImplemented,
type OberonPlugin,
type OberonSendAdapter,
Expand All @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion packages/create-oberon-app/plugins/send/resend.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
7 changes: 6 additions & 1 deletion packages/create-oberon-app/plugins/send/sendgrid.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down