create-jd-app
Version:
Create modern type safed Solid web application within seconds
36 lines (35 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const getIndexLocation = (ctx) => {
const usingPRPC = ctx.installers.includes("pRPC");
const usingTw = ctx.installers.includes("TailwindCSS");
const usingAuth = ctx.installers.includes("AuthJS");
return createFileHelper(usingPRPC, usingTw, usingAuth, ctx);
};
exports.default = getIndexLocation;
function createFileHelper(usingPRPC, usingTw, usingAuth, ctx) {
const fileName = usingPRPC ? `prpc` : "";
let indexFile = "";
if (usingPRPC && usingTw && usingAuth) {
indexFile = `with-auth-${fileName}-tw.tsx`;
}
else if (usingPRPC && !usingTw && usingAuth) {
indexFile = `with-auth-${fileName}.tsx`;
}
else if (usingPRPC && usingTw) {
indexFile = `with-${fileName}-tw.tsx`;
}
else if (usingPRPC && !usingTw) {
indexFile = `with-${fileName}.tsx`;
}
else if (usingAuth && usingTw) {
indexFile = "with-auth-tw.tsx";
}
else if (!usingPRPC && usingTw) {
indexFile = "with-tw.tsx";
}
else if (usingAuth) {
indexFile = "with-auth.tsx";
}
return indexFile ? `${ctx.templateDir}/index/${indexFile}` : ``;
}