From a6c76e0b4c107f8e9242c365b6666542c1fe1bd8 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:27:00 +0530 Subject: [PATCH 01/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index ed4ee03..6453987 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,11 @@ const fs = require('fs-extra'); const path = require('path'); const argv = require('yargs').argv; +const type = process.argv[2]; +const name = process.argv[3]; + + + const source = argv.source || path.join(__dirname, 'LoginSignUp'); const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); From 24fb4631b71671c020c295f4286fa9bcc4adc561 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:27:29 +0530 Subject: [PATCH 02/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6453987..41d0397 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,11 @@ const argv = require('yargs').argv; const type = process.argv[2]; const name = process.argv[3]; - +if (!type || !name) { + console.error('Please provide Valied Command'); + process.exit(1); +} + const source = argv.source || path.join(__dirname, 'LoginSignUp'); const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); From ccdacc74df8ad315daff9cdedf55a903f4e05436 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:27:41 +0530 Subject: [PATCH 03/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 41d0397..16be0ad 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,7 @@ if (!type || !name) { process.exit(1); } +if () const source = argv.source || path.join(__dirname, 'LoginSignUp'); const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); From 275fad591f3667dfef4db38a5d9117a637d4c6c4 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:28:33 +0530 Subject: [PATCH 04/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 16be0ad..e1e734e 100644 --- a/index.js +++ b/index.js @@ -9,8 +9,14 @@ if (!type || !name) { console.error('Please provide Valied Command'); process.exit(1); } - -if () +let fileContent; +let filePath; + +if (type === 'controller') { + +} + +console.log(`${type.charAt(0).toUpperCase() + type.slice(1)} ${name} created at ${filePath}`); const source = argv.source || path.join(__dirname, 'LoginSignUp'); const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); From 91674ed7b20196bae1282d404d29371916b833ac Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:29:33 +0530 Subject: [PATCH 05/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e1e734e..ebfd361 100644 --- a/index.js +++ b/index.js @@ -12,14 +12,15 @@ if (!type || !name) { let fileContent; let filePath; -if (type === 'controller') { +if (type === 'loginSignUp') { + const source = argv.source || path.join(__dirname, 'LoginSignUp'); + const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); + } console.log(`${type.charAt(0).toUpperCase() + type.slice(1)} ${name} created at ${filePath}`); -const source = argv.source || path.join(__dirname, 'LoginSignUp'); -const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); const sourceApp = argv.source || path.join(__dirname, 'App'); const destinationApp = argv.destination || path.join(process.cwd(), 'src/'); From 84a6a4e0d9ce231a9c824e69241366d5fc815f04 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:31:08 +0530 Subject: [PATCH 06/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index ebfd361..99fcc9f 100644 --- a/index.js +++ b/index.js @@ -16,10 +16,18 @@ if (type === 'loginSignUp') { const source = argv.source || path.join(__dirname, 'LoginSignUp'); const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); - + try { + await fs.copy(source, destination); + await fs.copy(sourceApp, destinationApp); + await fs.copy(sourcePR, destinationPR); + await fs.copy(sourceDash, destinationDash); + console.log('The Login and SignUp templete Successfully Createed'); + } catch (err) { + console.error('Error copying folder:', err); + } } -console.log(`${type.charAt(0).toUpperCase() + type.slice(1)} ${name} created at ${filePath}`); +console.log(`${type} created at ${filePath}`); const sourceApp = argv.source || path.join(__dirname, 'App'); @@ -41,17 +49,7 @@ const sourceBackendMysqlNoMVC = argv.source || path.join(__dirname, 'BackEndMysq const destinationBackendMysqlNoMVC = argv.destination || path.join(process.cwd(), '../'); -async function RunReactLoginSignIn() { - try { - await fs.copy(source, destination); - await fs.copy(sourceApp, destinationApp); - await fs.copy(sourcePR, destinationPR); - await fs.copy(sourceDash, destinationDash); - console.log('The Login and SignUp templete Successfully Createed'); - } catch (err) { - console.error('Error copying folder:', err); - } -} + From 2a98a381603fbc95dd2f2d9de4d913983ec55f80 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:32:07 +0530 Subject: [PATCH 07/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 72 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/index.js b/index.js index 99fcc9f..db5f00e 100644 --- a/index.js +++ b/index.js @@ -30,52 +30,52 @@ if (type === 'loginSignUp') { console.log(`${type} created at ${filePath}`); -const sourceApp = argv.source || path.join(__dirname, 'App'); -const destinationApp = argv.destination || path.join(process.cwd(), 'src/'); +// const sourceApp = argv.source || path.join(__dirname, 'App'); +// const destinationApp = argv.destination || path.join(process.cwd(), 'src/'); -const sourceTW = argv.source || path.join(__dirname, 'LoginSignUpTW'); -const destinationTW = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUpTW'); +// const sourceTW = argv.source || path.join(__dirname, 'LoginSignUpTW'); +// const destinationTW = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUpTW'); -const sourceAppTW = argv.source || path.join(__dirname, 'AppTW'); -const destinationAppTW = argv.destination || path.join(process.cwd(), 'src/'); +// const sourceAppTW = argv.source || path.join(__dirname, 'AppTW'); +// const destinationAppTW = argv.destination || path.join(process.cwd(), 'src/'); -const sourcePR = argv.source || path.join(__dirname, 'PrivateRoute'); -const destinationPR = argv.destination || path.join(process.cwd(), 'src/components/PrivateRoute'); +// const sourcePR = argv.source || path.join(__dirname, 'PrivateRoute'); +// const destinationPR = argv.destination || path.join(process.cwd(), 'src/components/PrivateRoute'); -const sourceDash = argv.source || path.join(__dirname, 'Dashboard'); -const destinationDash = argv.destination || path.join(process.cwd(), 'src/components/Dashboard'); +// const sourceDash = argv.source || path.join(__dirname, 'Dashboard'); +// const destinationDash = argv.destination || path.join(process.cwd(), 'src/components/Dashboard'); -const sourceBackendMysqlNoMVC = argv.source || path.join(__dirname, 'BackEndMysqlNoMVC'); -const destinationBackendMysqlNoMVC = argv.destination || path.join(process.cwd(), '../'); +// const sourceBackendMysqlNoMVC = argv.source || path.join(__dirname, 'BackEndMysqlNoMVC'); +// const destinationBackendMysqlNoMVC = argv.destination || path.join(process.cwd(), '../'); -async function RunReactLoginSignInTW() { - try { - await fs.copy(sourceTW, destinationTW); - await fs.copy(sourceAppTW, destinationAppTW); - await fs.copy(sourcePR, destinationPR); - await fs.copy(sourceDash, destinationDash); - console.log('The Login and SignUp templete Successfully Createed'); - } catch (err) { - console.error('Error copying folder:', err); - } -} +// async function RunReactLoginSignInTW() { +// try { +// await fs.copy(sourceTW, destinationTW); +// await fs.copy(sourceAppTW, destinationAppTW); +// await fs.copy(sourcePR, destinationPR); +// await fs.copy(sourceDash, destinationDash); +// console.log('The Login and SignUp templete Successfully Createed'); +// } catch (err) { +// console.error('Error copying folder:', err); +// } +// } -async function RunBackendMysqlNoMVC() { - try { - await fs.copy(sourceBackendMysqlNoMVC, destinationBackendMysqlNoMVC); - console.log('Backend Development Enviroment Created Successful'); - } catch (err) { - console.error('Error copying folder:', err); - } -} +// async function RunBackendMysqlNoMVC() { +// try { +// await fs.copy(sourceBackendMysqlNoMVC, destinationBackendMysqlNoMVC); +// console.log('Backend Development Enviroment Created Successful'); +// } catch (err) { +// console.error('Error copying folder:', err); +// } +// } -module.exports = { - RunReactLoginSignIn, - RunReactLoginSignInTW, - RunBackendMysqlNoMVC -} \ No newline at end of file +// module.exports = { +// RunReactLoginSignIn, +// RunReactLoginSignInTW, +// RunBackendMysqlNoMVC +// } \ No newline at end of file From 0798e88f4314dd6e795a4d1648db91f49900d785 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:33:23 +0530 Subject: [PATCH 08/12] Update package.json Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7563ad5..a368ca8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "login-signup-react", - "version": "3.0.0", + "version": "4.0.0", "description": "Login and SignUp for ReactJS", "main": "index.js", "bin": { From 1083d409c47941055bf1d45e6a671a2ea01eefd7 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:36:03 +0530 Subject: [PATCH 09/12] Update index.js Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.js b/index.js index db5f00e..634f14a 100644 --- a/index.js +++ b/index.js @@ -18,9 +18,6 @@ if (type === 'loginSignUp') { try { await fs.copy(source, destination); - await fs.copy(sourceApp, destinationApp); - await fs.copy(sourcePR, destinationPR); - await fs.copy(sourceDash, destinationDash); console.log('The Login and SignUp templete Successfully Createed'); } catch (err) { console.error('Error copying folder:', err); From 0627e2b7310e6c7e08ede280eaf2f50b99f62e78 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:41:32 +0530 Subject: [PATCH 10/12] Update package.json Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a368ca8..0dbe47d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Login and SignUp for ReactJS", "main": "index.js", "bin": { - "login-signup-react": "index.js" + "create": "index.js" }, "repository": { "type": "git", From ec57468c4b6b40962b87386c0ec36dea2a5b1b77 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:51:21 +0530 Subject: [PATCH 11/12] Update Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 18 +++++++++++------- package.json | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 634f14a..ae8415b 100644 --- a/index.js +++ b/index.js @@ -16,15 +16,19 @@ if (type === 'loginSignUp') { const source = argv.source || path.join(__dirname, 'LoginSignUp'); const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); - try { - await fs.copy(source, destination); - console.log('The Login and SignUp templete Successfully Createed'); - } catch (err) { - console.error('Error copying folder:', err); - } + async function RunReactLoginSignIn() { + try { + await fs.copy(source, destination); + console.log('The Login and SignUp templete Successfully Createed'); + } catch (err) { + console.error('Error copying folder:', err); + } + } + + module.exports = RunReactLoginSignIn } -console.log(`${type} created at ${filePath}`); +// console.log(`${type.charAt(0).toUpperCase() + type.slice(1)} ${name} created at ${filePath}`); // const sourceApp = argv.source || path.join(__dirname, 'App'); diff --git a/package.json b/package.json index 0dbe47d..ac93d1f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Login and SignUp for ReactJS", "main": "index.js", "bin": { - "create": "index.js" + "create": "./index.js" }, "repository": { "type": "git", From 28e81e05b4c5b27d48f9098656e7bbe8c3a2e753 Mon Sep 17 00:00:00 2001 From: JehanKandy <138636749+BackendExpert@users.noreply.github.com> Date: Wed, 19 Jun 2024 08:03:43 +0530 Subject: [PATCH 12/12] Update Co-Authored-By: JehanKandy Co-Authored-By: Anupa Gamage <125038143+Anupa1998@users.noreply.github.com> --- index.js | 114 ++++++++++++++++++++++++------------------------------- 1 file changed, 49 insertions(+), 65 deletions(-) diff --git a/index.js b/index.js index ae8415b..ed4ee03 100644 --- a/index.js +++ b/index.js @@ -2,81 +2,65 @@ const fs = require('fs-extra'); const path = require('path'); const argv = require('yargs').argv; -const type = process.argv[2]; -const name = process.argv[3]; +const source = argv.source || path.join(__dirname, 'LoginSignUp'); +const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); -if (!type || !name) { - console.error('Please provide Valied Command'); - process.exit(1); -} -let fileContent; -let filePath; - -if (type === 'loginSignUp') { - const source = argv.source || path.join(__dirname, 'LoginSignUp'); - const destination = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUp'); - - async function RunReactLoginSignIn() { - try { - await fs.copy(source, destination); - console.log('The Login and SignUp templete Successfully Createed'); - } catch (err) { - console.error('Error copying folder:', err); - } - } - - module.exports = RunReactLoginSignIn -} - -// console.log(`${type.charAt(0).toUpperCase() + type.slice(1)} ${name} created at ${filePath}`); - - -// const sourceApp = argv.source || path.join(__dirname, 'App'); -// const destinationApp = argv.destination || path.join(process.cwd(), 'src/'); +const sourceApp = argv.source || path.join(__dirname, 'App'); +const destinationApp = argv.destination || path.join(process.cwd(), 'src/'); -// const sourceTW = argv.source || path.join(__dirname, 'LoginSignUpTW'); -// const destinationTW = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUpTW'); +const sourceTW = argv.source || path.join(__dirname, 'LoginSignUpTW'); +const destinationTW = argv.destination || path.join(process.cwd(), 'src/components/LoginSignUpTW'); -// const sourceAppTW = argv.source || path.join(__dirname, 'AppTW'); -// const destinationAppTW = argv.destination || path.join(process.cwd(), 'src/'); +const sourceAppTW = argv.source || path.join(__dirname, 'AppTW'); +const destinationAppTW = argv.destination || path.join(process.cwd(), 'src/'); -// const sourcePR = argv.source || path.join(__dirname, 'PrivateRoute'); -// const destinationPR = argv.destination || path.join(process.cwd(), 'src/components/PrivateRoute'); +const sourcePR = argv.source || path.join(__dirname, 'PrivateRoute'); +const destinationPR = argv.destination || path.join(process.cwd(), 'src/components/PrivateRoute'); -// const sourceDash = argv.source || path.join(__dirname, 'Dashboard'); -// const destinationDash = argv.destination || path.join(process.cwd(), 'src/components/Dashboard'); - -// const sourceBackendMysqlNoMVC = argv.source || path.join(__dirname, 'BackEndMysqlNoMVC'); -// const destinationBackendMysqlNoMVC = argv.destination || path.join(process.cwd(), '../'); +const sourceDash = argv.source || path.join(__dirname, 'Dashboard'); +const destinationDash = argv.destination || path.join(process.cwd(), 'src/components/Dashboard'); +const sourceBackendMysqlNoMVC = argv.source || path.join(__dirname, 'BackEndMysqlNoMVC'); +const destinationBackendMysqlNoMVC = argv.destination || path.join(process.cwd(), '../'); +async function RunReactLoginSignIn() { + try { + await fs.copy(source, destination); + await fs.copy(sourceApp, destinationApp); + await fs.copy(sourcePR, destinationPR); + await fs.copy(sourceDash, destinationDash); + console.log('The Login and SignUp templete Successfully Createed'); + } catch (err) { + console.error('Error copying folder:', err); + } +} -// async function RunReactLoginSignInTW() { -// try { -// await fs.copy(sourceTW, destinationTW); -// await fs.copy(sourceAppTW, destinationAppTW); -// await fs.copy(sourcePR, destinationPR); -// await fs.copy(sourceDash, destinationDash); -// console.log('The Login and SignUp templete Successfully Createed'); -// } catch (err) { -// console.error('Error copying folder:', err); -// } -// } +async function RunReactLoginSignInTW() { + try { + await fs.copy(sourceTW, destinationTW); + await fs.copy(sourceAppTW, destinationAppTW); + await fs.copy(sourcePR, destinationPR); + await fs.copy(sourceDash, destinationDash); + console.log('The Login and SignUp templete Successfully Createed'); + } catch (err) { + console.error('Error copying folder:', err); + } +} -// async function RunBackendMysqlNoMVC() { -// try { -// await fs.copy(sourceBackendMysqlNoMVC, destinationBackendMysqlNoMVC); -// console.log('Backend Development Enviroment Created Successful'); -// } catch (err) { -// console.error('Error copying folder:', err); -// } -// } +async function RunBackendMysqlNoMVC() { + try { + await fs.copy(sourceBackendMysqlNoMVC, destinationBackendMysqlNoMVC); + console.log('Backend Development Enviroment Created Successful'); + } catch (err) { + console.error('Error copying folder:', err); + } +} -// module.exports = { -// RunReactLoginSignIn, -// RunReactLoginSignInTW, -// RunBackendMysqlNoMVC -// } \ No newline at end of file +module.exports = { + RunReactLoginSignIn, + RunReactLoginSignInTW, + RunBackendMysqlNoMVC +} \ No newline at end of file