From e0d09d2a79ac28053414e36c1dca0c019b343ec1 Mon Sep 17 00:00:00 2001 From: chikeluba Date: Thu, 30 Nov 2023 11:26:21 +0100 Subject: [PATCH] add plain html with css and javascript --- cli.js | 9 ++++++--- index.html | 16 ++++++++++++++++ index.js | 8 ++++++++ src/utils/create-frontend-project.js | 19 ++++++++++++++++--- src/utils/prompts.js | 2 +- .../frontend/html-css-javascript/index.html | 16 ++++++++++++++++ .../frontend/html-css-javascript/index.js | 8 ++++++++ .../html-css-javascript/public/startease.svg | 19 +++++++++++++++++++ .../frontend/html-css-javascript/style.css | 3 +++ 9 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 index.html create mode 100644 index.js create mode 100644 templates/frontend/html-css-javascript/index.html create mode 100644 templates/frontend/html-css-javascript/index.js create mode 100644 templates/frontend/html-css-javascript/public/startease.svg create mode 100644 templates/frontend/html-css-javascript/style.css diff --git a/cli.js b/cli.js index 0183bb0..8d6acff 100755 --- a/cli.js +++ b/cli.js @@ -55,9 +55,12 @@ async function startProject() { */ if (projectStack === "frontend") { framework = await promptFrontendFramework(); - language = await promptFrontendLanguage(); - - await createFrontendProject(projectName, framework, language); + console.log("testing:", framework); + if (framework !== "noframework") { + language = await promptFrontendLanguage(); + return await createFrontendProject(projectName, framework, language); + } + await createFrontendProject(projectName, framework); } else if (projectStack === "backend") { framework = await promptBackendFramework(); diff --git a/index.html b/index.html new file mode 100644 index 0000000..c9d472f --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + StartEase + Html + + + +

Hello From StartEase

+ + + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..ee4bc5e --- /dev/null +++ b/index.js @@ -0,0 +1,8 @@ +/** + * Project generated with startease - https://startease.vercel.app + * @link https://startease.vercel.app + */ + + +console.log("Welcome to the new project created with startease"); +console.log("Project generated with startease - @ https://startease.vercel.app"); \ No newline at end of file diff --git a/src/utils/create-frontend-project.js b/src/utils/create-frontend-project.js index 62c7fae..dd683dc 100644 --- a/src/utils/create-frontend-project.js +++ b/src/utils/create-frontend-project.js @@ -52,9 +52,22 @@ export async function createFrontendProject(projectName, framework, language) { // success message stages.push({ - message: `Frontend - ReactJS project with ${ - language.charAt(0).toUpperCase() + language.slice(1) - } created successfully! : ${destinationPath}`, + message: `Frontend - ReactJS project with ${language.charAt(0).toUpperCase() + language.slice(1) + } created successfully! : ${destinationPath}`, + duration: 1000, + }); + + await startSpinner(); + } + else if (framework === "noframework") { + copyFile( + getTemplateDir(`frontend/html-css-javascript`), + destinationPath, + ); + + // success message + stages.push({ + message: `Frontend - plain html with css and javascript created successfully! : ${destinationPath}`, duration: 1000, }); diff --git a/src/utils/prompts.js b/src/utils/prompts.js index 2d039fc..7eedd99 100644 --- a/src/utils/prompts.js +++ b/src/utils/prompts.js @@ -31,7 +31,7 @@ export async function promptFrontendFramework() { type: "list", name: "framework", message: "Choose a framework:", - choices: ["ReactJs"], + choices: ["ReactJs", "NoFramework"], }, ]); diff --git a/templates/frontend/html-css-javascript/index.html b/templates/frontend/html-css-javascript/index.html new file mode 100644 index 0000000..c9d472f --- /dev/null +++ b/templates/frontend/html-css-javascript/index.html @@ -0,0 +1,16 @@ + + + + + + + + StartEase + Html + + + +

Hello From StartEase

+ + + + \ No newline at end of file diff --git a/templates/frontend/html-css-javascript/index.js b/templates/frontend/html-css-javascript/index.js new file mode 100644 index 0000000..ee4bc5e --- /dev/null +++ b/templates/frontend/html-css-javascript/index.js @@ -0,0 +1,8 @@ +/** + * Project generated with startease - https://startease.vercel.app + * @link https://startease.vercel.app + */ + + +console.log("Welcome to the new project created with startease"); +console.log("Project generated with startease - @ https://startease.vercel.app"); \ No newline at end of file diff --git a/templates/frontend/html-css-javascript/public/startease.svg b/templates/frontend/html-css-javascript/public/startease.svg new file mode 100644 index 0000000..333ab93 --- /dev/null +++ b/templates/frontend/html-css-javascript/public/startease.svg @@ -0,0 +1,19 @@ + + + + + + + diff --git a/templates/frontend/html-css-javascript/style.css b/templates/frontend/html-css-javascript/style.css new file mode 100644 index 0000000..cea1516 --- /dev/null +++ b/templates/frontend/html-css-javascript/style.css @@ -0,0 +1,3 @@ +/* + Project generated with startease - https: //startease.vercel.app +*/ \ No newline at end of file