Skip to content

Commit

Permalink
updated v0.5.0 to v0.6.0 package.json #186
Browse files Browse the repository at this point in the history
  • Loading branch information
sharafdin authored Feb 23, 2024
2 parents 3d07854 + 1c67085 commit ed62d30
Showing 11 changed files with 125 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"uuidv4": "^6.2.13"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"uuidv4": "^6.2.13"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1",
"prisma": "^5.9.1"
}
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"typeorm": "0.3.20"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"uuidv4": "^6.2.13"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1",
"prisma": "^5.9.1"
}
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
"sequelize": "^6.36.0"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
"typeorm": "0.3.20"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"uuidv4": "^6.2.13"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1",
"prisma": "^5.9.1"
}
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"sequelize": "^6.36.0"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"typeorm": "0.3.20"
},
"devDependencies": {
"yonode": "^0.5.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
6 changes: 1 addition & 5 deletions packages/yonode/src/index.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

/**
* Yonode
* A Web Server Framework for Node.js
* The Node.js Toolkit for Rapid Development.
*
* @author Mr Sharafdin <isasharafdin@gmail.com>
*/
@@ -123,12 +123,8 @@ function main() {
inquirer
.prompt(languageType)
.then((answer) => {
if (answer.language_type === 'JavaScript') {
options.language_type = answer.language_type
databaseType()
} else {
console.log('sorry, typescript is not available');
}
})
.catch((error) => {
if (error.isTtyError) {
145 changes: 115 additions & 30 deletions packages/yonode/src/lib/repoConditions.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,119 @@
import { cloneRepo, options, projectName } from "../index.js";

export const repoConditions = () => {
switch (true) {
// JavaScript

switch (true) {
// MongoDB
case options.language_type === 'JavaScript' && options.database_type === 'MongoDB' && options.orm_type === 'Mongoose' && options.auth === false:
cloneRepo(projectName, 'JS-MongoDB-Mongoose-NoAuth-Template');
break;
case options.language_type === 'JavaScript' && options.database_type === 'MongoDB' && options.orm_type === 'Prisma' && options.auth === false:
cloneRepo(projectName, 'JS-MongoDB-Prisma-NoAuth-Template');
break;
case options.language_type === 'JavaScript' && options.database_type === 'MongoDB' && options.orm_type === 'TypeORM' && options.auth === false:
cloneRepo(projectName, 'JS-MongoDB-TypeORM-NoAuth-Template');
break;
// MySQL
case options.language_type === 'JavaScript' && options.database_type === 'MySQL' && options.orm_type === 'Prisma' && options.auth === false:
cloneRepo(projectName, 'JS-MySQL-Prisma-NoAuth-Template');
case options.language_type === 'JavaScript' && options.database_type === 'MySQL' && options.orm_type === 'Sequelize' && options.auth === false:
cloneRepo(projectName, 'JS-MySQL-Sequelize-NoAuth-Template');
case options.language_type === 'JavaScript' && options.database_type === 'MySQL' && options.orm_type === 'TypeORM' && options.auth === false:
cloneRepo(projectName, 'JS-MySQL-TypeORM-NoAuth-Template');
// PostgreSQL
case options.language_type === 'JavaScript' && options.database_type === 'PostgreSQL' && options.orm_type === 'Prisma' && options.auth === false:
cloneRepo(projectName, 'JS-PostgreSQL-Prisma-NoAuth-Template');
case options.language_type === 'JavaScript' && options.database_type === 'PostgreSQL' && options.orm_type === 'Sequelize' && options.auth === false:
cloneRepo(projectName, 'JS-PostgreSQL-Sequelize-NoAuth-Template');
case options.language_type === 'JavaScript' && options.database_type === 'PostgreSQL' && options.orm_type === 'TypeORM' && options.auth === false:
cloneRepo(projectName, 'JS-PostgreSQL-TypeORM-NoAuth-Template');
break;
default:
throw new Error ('unsupported option')
}
}
// MongoDB
case options.language_type === "JavaScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "Mongoose" &&
options.auth === false:
cloneRepo(projectName, "JS-MongoDB-Mongoose-NoAuth-Template");
break;
case options.language_type === "JavaScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "Prisma" &&
options.auth === false:
cloneRepo(projectName, "JS-MongoDB-Prisma-NoAuth-Template");
break;
case options.language_type === "JavaScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "TypeORM" &&
options.auth === false:
cloneRepo(projectName, "JS-MongoDB-TypeORM-NoAuth-Template");
break;
// MySQL
case options.language_type === "JavaScript" &&
options.database_type === "MySQL" &&
options.orm_type === "Prisma" &&
options.auth === false:
cloneRepo(projectName, "JS-MySQL-Prisma-NoAuth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "MySQL" &&
options.orm_type === "Sequelize" &&
options.auth === false:
cloneRepo(projectName, "JS-MySQL-Sequelize-NoAuth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "MySQL" &&
options.orm_type === "TypeORM" &&
options.auth === false:
cloneRepo(projectName, "JS-MySQL-TypeORM-NoAuth-Template");
// PostgreSQL
case options.language_type === "JavaScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "Prisma" &&
options.auth === false:
cloneRepo(projectName, "JS-PostgreSQL-Prisma-NoAuth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "Sequelize" &&
options.auth === false:
cloneRepo(projectName, "JS-PostgreSQL-Sequelize-NoAuth-Template");
case options.language_type === "JavaScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "TypeORM" &&
options.auth === false:
cloneRepo(projectName, "JS-PostgreSQL-TypeORM-NoAuth-Template");
break;

// TypeScript

// MongoDB
case options.language_type === "TypeScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "Mongoose" &&
options.auth === false:
cloneRepo(projectName, "TS-MongoDB-Mongoose-NoAuth-Template");
break;
case options.language_type === "TypeScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "Prisma" &&
options.auth === false:
cloneRepo(projectName, "TS-MongoDB-Prisma-NoAuth-Template");
break;
case options.language_type === "TypeScript" &&
options.database_type === "MongoDB" &&
options.orm_type === "TypeORM" &&
options.auth === false:
cloneRepo(projectName, "TS-MongoDB-TypeORM-NoAuth-Template");
break;
// MySQL
case options.language_type === "TypeScript" &&
options.database_type === "MySQL" &&
options.orm_type === "Prisma" &&
options.auth === false:
cloneRepo(projectName, "TS-MySQL-Prisma-NoAuth-Template");
case options.language_type === "TypeScript" &&
options.database_type === "MySQL" &&
options.orm_type === "Sequelize" &&
options.auth === false:
cloneRepo(projectName, "TS-MySQL-Sequelize-NoAuth-Template");
case options.language_type === "TypeScript" &&
options.database_type === "MySQL" &&
options.orm_type === "TypeORM" &&
options.auth === false:
cloneRepo(projectName, "TS-MySQL-TypeORM-NoAuth-Template");
break;
// PostgreSQL
case options.language_type === "TypeScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "Prisma" &&
options.auth === false:
cloneRepo(projectName, "TS-PostgreSQL-Prisma-NoAuth-Template");
case options.language_type === "TypeScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "Sequelize" &&
options.auth === false:
cloneRepo(projectName, "TS-PostgreSQL-Sequelize-NoAuth-Template");
case options.language_type === "TypeScript" &&
options.database_type === "PostgreSQL" &&
options.orm_type === "TypeORM" &&
options.auth === false:
cloneRepo(projectName, "TS-PostgreSQL-TypeORM-NoAuth-Template");
break;

default:
throw new Error("unsupported option");
}
};

0 comments on commit ed62d30

Please sign in to comment.