Skip to content

Commit d94639c

Browse files
fix(cli): add payment compatibilty validation
1 parent ef1d949 commit d94639c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

apps/cli/src/utils/config-validation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,13 @@ export function validateFullConfig(
473473
config.database,
474474
config.frontend ?? [],
475475
);
476+
477+
validatePaymentsCompatibility(
478+
config.payments,
479+
config.auth,
480+
config.backend,
481+
config.frontend ?? [],
482+
);
476483
}
477484

478485
export function validateConfigForProgrammaticUse(

apps/cli/test/integration.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,28 @@ describe("Integration Tests - Real World Scenarios", () => {
419419
);
420420
});
421421

422+
it("should fail with payments incompatibility", async () => {
423+
const result = await runTRPCTest({
424+
projectName: "polar-no-auth-fail",
425+
backend: "hono",
426+
runtime: "bun",
427+
database: "none",
428+
orm: "none",
429+
auth: "none",
430+
payments: "polar",
431+
api: "trpc",
432+
frontend: ["tanstack-router"],
433+
addons: ["turborepo"],
434+
examples: ["none"],
435+
dbSetup: "none",
436+
webDeploy: "none",
437+
serverDeploy: "none",
438+
expectError: true,
439+
});
440+
441+
expectError(result, "Polar payments requires Better Auth");
442+
});
443+
422444
it("should fail with deployment constraint violation", async () => {
423445
const result = await runTRPCTest({
424446
projectName: "web-deploy-no-frontend-fail",

0 commit comments

Comments
 (0)