Skip to content

Commit

Permalink
Merge pull request #234 from sharafdin/sharafdin
Browse files Browse the repository at this point in the history
added JS for Auth Templates
  • Loading branch information
sharafdin authored Mar 2, 2024
2 parents be14831 + 6c3b6a3 commit 6f9aad4
Showing 2 changed files with 31 additions and 40 deletions.
24 changes: 8 additions & 16 deletions packages/yonode/src/lib/repoConditions.js
Original file line number Diff line number Diff line change
@@ -65,60 +65,52 @@ export const repoConditions = () => {
options.orm_type === "Mongoose" &&
options.auth === true:
cloneRepo(projectName, "JS-MongoDB-Mongoose-Auth-Template");
console.log('This Template is Not Available right now!');
break;
case options.language_type === "JavaScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "Prisma" &&
options.auth === true:
// cloneRepo(projectName, "JS-MongoDB-Prisma-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-MongoDB-Prisma-Auth-Template");
break;
case options.language_type === "JavaScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "TypeORM" &&
options.auth === true:
// cloneRepo(projectName, "JS-MongoDB-TypeORM-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-MongoDB-TypeORM-Auth-Template");
break;
// MySQL
case options.language_type === "JavaScript" &&
options.database_type === "MySQL" &&
options.orm_type === "Prisma" &&
options.auth === true:
// cloneRepo(projectName, "JS-MySQL-Prisma-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-MySQL-Prisma-Auth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "MySQL" &&
options.orm_type === "Sequelize" &&
options.auth === true:
// cloneRepo(projectName, "JS-MySQL-Sequelize-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-MySQL-Sequelize-Auth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "MySQL" &&
options.orm_type === "TypeORM" &&
options.auth === true:
// cloneRepo(projectName, "JS-MySQL-TypeORM-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-MySQL-TypeORM-Auth-Template");
// PostgreSQL
case options.language_type === "JavaScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "Prisma" &&
options.auth === true:
// cloneRepo(projectName, "JS-PostgreSQL-Prisma-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-PostgreSQL-Prisma-Auth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "Sequelize" &&
options.auth === true:
// cloneRepo(projectName, "JS-PostgreSQL-Sequelize-Auth-Template");
cloneRepo(projectName, "JS-PostgreSQL-Sequelize-Auth-Template");
console.log('This Template is Not Available right now!');
case options.language_type === "JavaScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "TypeORM" &&
options.auth === true:
// cloneRepo(projectName, "JS-PostgreSQL-TypeORM-Auth-Template");
console.log('This Template is Not Available right now!');
cloneRepo(projectName, "JS-PostgreSQL-TypeORM-Auth-Template");
break;

// TypeScript
47 changes: 23 additions & 24 deletions packages/yonode/src/orm/mongoDB.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import inquirer from 'inquirer'
import { options } from '../index.js';
import { mongodbOrmQuestion } from '../lib/questions.js';
import { authType } from '../lib/prompt/auth.js';
import inquirer from "inquirer";
import { options } from "../index.js";
import { mongodbOrmQuestion } from "../lib/questions.js";
import { authType } from "../lib/prompt/auth.js";

export const mongodbOrm = () => {
inquirer.prompt(
mongodbOrmQuestion
).then(answer => {
if (answer.mongodb_orm === 'Mongoose') {
options.orm_type = answer.mongodb_orm
authType()
} else if (answer.mongodb_orm === 'Prisma') {
options.orm_type = answer.mongodb_orm
authType()
}
else {
options.orm_type = answer.mongodb_orm
authType()
}
inquirer
.prompt(mongodbOrmQuestion)
.then((answer) => {
if (answer.mongodb_orm === "Mongoose") {
options.orm_type = answer.mongodb_orm;
authType();
} else if (answer.mongodb_orm === "Prisma") {
options.orm_type = answer.mongodb_orm;
authType();
} else {
options.orm_type = answer.mongodb_orm;
authType();
}
})
.catch((error) => {
if (error.isTtyError) {
} else {
}
});
}
.catch((error) => {
if (error.isTtyError) {
} else {
}
});
};

0 comments on commit 6f9aad4

Please sign in to comment.