feat(cli): add polar as better-auth plugin (#578)

This commit is contained in:
Aman Varshney
2025-09-16 17:53:44 +05:30
committed by GitHub
parent 3f22373cc3
commit ba3d62b6b9
77 changed files with 1221 additions and 308 deletions

View File

@@ -60,54 +60,54 @@ describe("Database and ORM Combinations", () => {
orm: ORM;
error: string;
}> = [
// MongoDB with Drizzle (not supported)
{
database: "mongodb" as Database,
orm: "drizzle" as ORM,
error: "Drizzle ORM does not support MongoDB",
},
// MongoDB with Drizzle (not supported)
{
database: "mongodb" as Database,
orm: "drizzle" as ORM,
error: "Drizzle ORM does not support MongoDB",
},
// Mongoose with non-MongoDB
{
database: "sqlite" as Database,
orm: "mongoose" as ORM,
error: "Mongoose ORM requires MongoDB database",
},
{
database: "postgres" as Database,
orm: "mongoose" as ORM,
error: "Mongoose ORM requires MongoDB database",
},
{
database: "mysql" as Database,
orm: "mongoose" as ORM,
error: "Mongoose ORM requires MongoDB database",
},
// Mongoose with non-MongoDB
{
database: "sqlite" as Database,
orm: "mongoose" as ORM,
error: "Mongoose ORM requires MongoDB database",
},
{
database: "postgres" as Database,
orm: "mongoose" as ORM,
error: "Mongoose ORM requires MongoDB database",
},
{
database: "mysql" as Database,
orm: "mongoose" as ORM,
error: "Mongoose ORM requires MongoDB database",
},
// Database without ORM
{
database: "sqlite" as Database,
orm: "none" as ORM,
error: "Database selection requires an ORM",
},
{
database: "postgres" as Database,
orm: "none" as ORM,
error: "Database selection requires an ORM",
},
// Database without ORM
{
database: "sqlite" as Database,
orm: "none" as ORM,
error: "Database selection requires an ORM",
},
{
database: "postgres" as Database,
orm: "none" as ORM,
error: "Database selection requires an ORM",
},
// ORM without database
{
database: "none" as Database,
orm: "drizzle" as ORM,
error: "ORM selection requires a database",
},
{
database: "none" as Database,
orm: "prisma" as ORM,
error: "ORM selection requires a database",
},
];
// ORM without database
{
database: "none" as Database,
orm: "drizzle" as ORM,
error: "ORM selection requires a database",
},
{
database: "none" as Database,
orm: "prisma" as ORM,
error: "ORM selection requires a database",
},
];
for (const { database, orm, error } of invalidCombinations) {
it(`should fail with ${database} + ${orm}`, async () => {

View File

@@ -456,16 +456,16 @@ describe("Deployment Configurations", () => {
webDeploy: TestConfig["webDeploy"];
serverDeploy: TestConfig["serverDeploy"];
}> = [
{ webDeploy: "wrangler", serverDeploy: "wrangler" },
{ webDeploy: "wrangler", serverDeploy: "alchemy" },
{ webDeploy: "alchemy", serverDeploy: "wrangler" },
{ webDeploy: "alchemy", serverDeploy: "alchemy" },
{ webDeploy: "wrangler", serverDeploy: "none" },
{ webDeploy: "alchemy", serverDeploy: "none" },
{ webDeploy: "none", serverDeploy: "wrangler" },
{ webDeploy: "none", serverDeploy: "alchemy" },
{ webDeploy: "none", serverDeploy: "none" },
];
{ webDeploy: "wrangler", serverDeploy: "wrangler" },
{ webDeploy: "wrangler", serverDeploy: "alchemy" },
{ webDeploy: "alchemy", serverDeploy: "wrangler" },
{ webDeploy: "alchemy", serverDeploy: "alchemy" },
{ webDeploy: "wrangler", serverDeploy: "none" },
{ webDeploy: "alchemy", serverDeploy: "none" },
{ webDeploy: "none", serverDeploy: "wrangler" },
{ webDeploy: "none", serverDeploy: "alchemy" },
{ webDeploy: "none", serverDeploy: "none" },
];
for (const { webDeploy, serverDeploy } of deployOptions) {
it(`should work with webDeploy: ${webDeploy}, serverDeploy: ${serverDeploy}`, async () => {

View File

@@ -98,19 +98,19 @@ export async function runTRPCTest(config: TestConfig): Promise<TestResult> {
const coreStackDefaults = willUseYesFlag
? {}
: {
frontend: ["tanstack-router"] as Frontend[],
backend: "hono" as Backend,
runtime: "bun" as Runtime,
api: "trpc" as API,
database: "sqlite" as Database,
orm: "drizzle" as ORM,
auth: "none" as Auth,
addons: ["none"] as Addons[],
examples: ["none"] as Examples[],
dbSetup: "none" as DatabaseSetup,
webDeploy: "none" as WebDeploy,
serverDeploy: "none" as ServerDeploy,
};
frontend: ["tanstack-router"] as Frontend[],
backend: "hono" as Backend,
runtime: "bun" as Runtime,
api: "trpc" as API,
database: "sqlite" as Database,
orm: "drizzle" as ORM,
auth: "none" as Auth,
addons: ["none"] as Addons[],
examples: ["none"] as Examples[],
dbSetup: "none" as DatabaseSetup,
webDeploy: "none" as WebDeploy,
serverDeploy: "none" as ServerDeploy,
};
// Build options object - let the CLI handle all validation
const options: CreateInput = {