create-jd-app
Version:
Create modern type safed Solid web application within seconds
76 lines (75 loc) • 2.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const packages_1 = require("../../helpers/packages");
const config = (ctx) => {
const usePrisma = ctx.installers.includes("Prisma");
const normal = [
"@auth/core",
"@solid-mediakit/auth",
];
if (usePrisma) {
normal.push("@auth/prisma-adapter");
}
return {
pkgs: (0, packages_1.withPackages)({
normal,
}),
files: [
{
path: `${__dirname}/files/${usePrisma ? "prisma-" : ""}config.txt`,
to: `${ctx.userDir}/src/server/auth.ts`,
},
{
path: `${__dirname}/files/handler.txt`,
to: `${ctx.userDir}/src/routes/api/auth/[...solidauth].ts`,
},
{
path: `${__dirname}/files/middleware.txt`,
to: `${ctx.userDir}/src/middleware.ts`,
},
!ctx.installers.includes("pRPC")
? {
path: `${__dirname}/files/app.txt`,
to: `${ctx.userDir}/src/app.tsx`,
}
: undefined,
],
env: [
{
key: "DISCORD_ID",
type: "string()",
kind: "server",
},
{
key: "DISCORD_SECRET",
type: "string()",
kind: "server",
},
{
key: "AUTH_SECRET",
type: "string()",
defaulValue: "b198e07a64406260b98f06e21c457b84",
kind: "server",
},
{
key: "AUTH_TRUST_HOST",
type: "string().optional()",
kind: "server",
defaulValue: "true",
},
{
key: "AUTH_URL",
defaulValue: "http://localhost:3000",
type: "string().optional()",
kind: "server",
},
{
key: "VITE_AUTH_PATH",
defaulValue: "/api/auth",
type: "string().optional()",
kind: "client",
},
],
};
};
exports.default = config;