Skip to content

Commit

Permalink
revert back commented out features
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Dec 8, 2024
1 parent bc7d7ff commit af15182
Show file tree
Hide file tree
Showing 30 changed files with 397 additions and 392 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"forgetme",
"frontends",
"Geralt",
"giget",
"goroutines",
"Greyjoy",
"Griptape",
Expand Down
4 changes: 2 additions & 2 deletions jsr.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reliverse/cli",
"version": "1.3.2",
"version": "1.3.4",
"author": "blefnk",
"license": "MIT",
"exports": "./dist-jsr/main.ts",
Expand Down Expand Up @@ -35,4 +35,4 @@
"reset.d.ts"
]
}
}
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reliverse/cli",
"version": "1.3.2",
"version": "1.3.4",
"author": "blefnk",
"type": "module",
"description": "A CLI tool that offers a convenient way to bootstrap a new web project and prepare it for work.",
Expand Down Expand Up @@ -67,7 +67,6 @@
"execa": "^9.5.1",
"fast-glob": "^3.3.2",
"fs-extra": "^11.2.0",
"giget": "^1.2.3",
"glob": "^11.0.0",
"magic-regexp": "^0.8.0",
"nanoid": "^5.0.9",
Expand Down
5 changes: 2 additions & 3 deletions src/app/data/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const CONFIG = ".reliverse";
export const verbose = false;

// Debug settings to control verbose logging and temp clone cleanup behavior
Expand Down Expand Up @@ -30,8 +29,6 @@ export const FILE_CONFLICTS = [
// Command-line arguments to check if we are in development mode
const args = process.argv.slice(2);

export const isDev = args.includes("--dev");

export const REPO_FULL_URLS = {
relivatorGithubLink: "https://github.com/blefnk/relivator",
};
Expand All @@ -41,6 +38,8 @@ export const REPO_SHORT_URLS = {
versatorGithubLink: "blefnk/versator",
};

export const MEMORY_FILE = ".reliverse/.reliverse";

// Path settings for important files and directories
export const FILE_PATHS = {
layoutFile: "src/app/layout.tsx", // Path to layout file in the repo
Expand Down
8 changes: 3 additions & 5 deletions src/app/data/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function showStartPrompt() {
titleColor: "inverse",
clearConsole: true,
packageName: "@reliverse/cli",
packageVersion: "1.3.2",
packageVersion: "1.3.4",
// packageName: pkg.name,
// packageVersion: pkg.version,
});
Expand Down Expand Up @@ -312,17 +312,15 @@ export async function showTogglePrompt() {
const result = await togglePrompt({
title: "Do you like @reliverse/relinka library?",
options: ["Yes", "No"],
initial: "Yes",
});

const agree = result === "Yes";
msg({
type: "M_INFO",
title: "Your response:",
content: agree ? "You like it! 🥰" : "You don't like it... 😔",
content: result ? "You like it! 🥰" : "You don't like it... 😔",
});

return agree;
return result;
}

export async function showConfirmPrompt(
Expand Down
76 changes: 43 additions & 33 deletions src/app/menu/01-showReliverseMenu.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,72 @@
import { selectPrompt } from "@reliverse/prompts";
import { relinka } from "@reliverse/relinka";
import { emojify } from "node-emoji";
import pc from "picocolors";

import { readReliverseMemory } from "~/args/memory/impl.js";

import { buildBrandNewThing } from "./02-buildBrandNewThing.js";

// import { installAnyGitRepo } from "./03-installAnyGitRepo.js";
// import { askProjectDetails } from "./04-askProjectDetails.js";
// import { pkg } from "~/utils/pkg.js";
export async function showReliverseMenu(isDev: boolean) {
// TODO: if config contains at least one project, show "Open project" option
// TODO: implement "Edit Reliverse Memory" option (configuration data editor)

// import { installAnyGitRepo } from "./03-installAnyGitRepo";
// import { shadcnComponents } from "~/utils/shadcnComponents";
const memory = await readReliverseMemory();
const username = memory.user?.name;

// export async function showReliverseMenu(program: Command) {
export async function showReliverseMenu() {
// let template = "";
const welcomeBackMessages = [
`Welcome back, ${username}!`,
`It's great to see you again, ${username}!`,
`Nice to see you back, ${username}!`,
`Hey ${username}, welcome back!`,
`Good to have you back, ${username}!`,
`Look who's back - it's ${username}!`,
`${username} has returned! Welcome back!`,
`Welcome back to your dev journey, ${username}!`,
];

// TODO: if config contains at least one project, show "Open project" option
// TODO: implement "Edit Reliverse Memory" option (configuration data editor)
const randomReliverseMenuTitle = [
"What would you like to create today? I'm your all-in-one tool for developing anything!",
"Ready to build something amazing? I'm here to help you develop your next big project!",
"Let's create something special today! I'm your development companion for any kind of project.",
"Looking to start a new project? I've got all the tools you need to build anything!",
"Welcome to your development journey! What would you like to create today?",
"Got an idea? Let's turn it into reality! I'm here to help you build anything you imagine.",
"Time to start building! What kind of project can I help you develop today?",
];

const option = await selectPrompt({
title:
"🤖 What would you like to create today? I'm your all-in-one tool for developing anything!",
title: `🤖 ${
username &&
welcomeBackMessages[
Math.floor(Math.random() * welcomeBackMessages.length)
]
} ${
randomReliverseMenuTitle[
Math.floor(Math.random() * randomReliverseMenuTitle.length)
]
}`,
titleColor: "retroGradient",
options: [
{
label: "Build a brand new thing from scratch",
value: "1",
},
// {
// label: emojify(
// ":toolbox: [Maintenance] Clone and configure any GitHub repo",
// ),
// value: "2",
// disabled: true,
// },
{
label: "Clone and configure any GitHub repo",
hint: "coming soon",
value: "2",
disabled: true,
},
// "4. Add shadcn/ui components to your React/Vue/Svelte project",
// "5. Run code modifications on the existing codebase",
// "6. Update your GitHub clone with the latest changes",
// "7. Add, remove, or replace the Relivator's features",
{ label: pc.italic("Exit"), value: "exit" },
],
// debug: false,
// terminalHeight: 14,
// availableHeight: 10,
// computedMaxItems: 3,
// displayItems: 3,
// startIdx: 0,
// endIdx: 2,
// shouldRenderTopEllipsis: false,
// shouldRenderBottomEllipsis: false,
// linesRendered: 5,
});

if (option === "1") {
await buildBrandNewThing();
await buildBrandNewThing(isDev);
}
// else if (option === "2") {
// // await installAnyGitRepo();
Expand All @@ -75,6 +87,4 @@ export async function showReliverseMenu() {
} else {
relinka.error("Invalid option selected. Exiting.");
}

// return template;
}
104 changes: 96 additions & 8 deletions src/app/menu/02-buildBrandNewThing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ import { REPO_SHORT_URLS } from "~/app/data/constants.js";

import { askProjectDetails } from "./04-askProjectDetails.js";

export async function buildBrandNewThing() {
const randomInitialMessage = [
"Let's build your own brand new digital thing from scratch! After that, you can customize everything however you like. What category describes your project best?",
"Let's bring your vision to life by building something brand new from scratch! Once we're done, you'll have full freedom to customize it however you like. What category describes your project best?",
"Ready to create something amazing? Let's start fresh with a brand new project that you can shape exactly how you want. What category fits your project best?",
"Time to turn your ideas into reality! We'll build something from the ground up that you can fully customize. What category would you say your project falls under?",
"Let's embark on a creative journey and build your project from scratch! You'll have complete freedom to make it your own. What category best describes what you want to create?",
];

export async function buildBrandNewThing(isDev: boolean) {
const endTitle =
"📚 Check the docs to learn more: https://docs.reliverse.org/cli";
const initialMessage =
// "Let's build your own brand new digital thing from scratch! After that, you can customize everything however you like.";
"Let's bring your vision to life by building something brand new from scratch! Once we're done, you'll have full freedom to customize it however you like. What category describes your project best?";
randomInitialMessage[
Math.floor(Math.random() * randomInitialMessage.length)
];

const category = await selectPrompt({
endTitle,
Expand All @@ -21,6 +30,12 @@ export async function buildBrandNewThing() {
value: "development",
hint: "apps, sites, plugins, etc",
},
{
label: "...",
hint: "coming soon",
value: "coming-soon",
disabled: true,
},
// {
// label: "[Coming soon] Design — Video — Music",
// value: "digital",
Expand All @@ -37,16 +52,31 @@ export async function buildBrandNewThing() {
if (category === "development") {
let template = "";

const randomDevProjectTypeTitle = [
"Fantastic! Let me help you craft a solid plan for your new project. Which subcategory best describes what you're working on?",
"Great choice! Now, let's narrow down your development focus. What type of project are you looking to create?",
"Perfect! To help set you up with the right tools, could you tell me more specifically what kind of development project this will be?",
"Excellent! Let's get more specific about your development project. Which of these categories aligns best with your vision?",
];

const devProjectType = await selectPrompt({
endTitle,
title:
"Fantastic! Let me help you craft a solid plan for your new project. Which subcategory best describes what you're working on?",
randomDevProjectTypeTitle[
Math.floor(Math.random() * randomDevProjectTypeTitle.length)
],
options: [
{
label: "Web Development",
value: "website",
hint: "web apps, sites, plugins, and more",
},
{
label: "...",
hint: "coming soon",
value: "coming-soon",
disabled: true,
},
// {
// label: "[Coming soon] Native Development",
// value: "native-dev",
Expand Down Expand Up @@ -98,16 +128,32 @@ export async function buildBrandNewThing() {
// ],
// });

const randomWebsiteSubcategoryTitle = [
"What type of website do you want me to help you build?",
"Great choice! Now, let's narrow down your website focus. What type of website are you looking to create?",
"Excellent! To help set you up with the right tools, could you tell me more specifically what kind of website this will be?",
"Perfect! Let's get more specific about your website. Which of these categories aligns best with your vision?",
];

if (devProjectType === "website") {
const websiteSubcategory = await selectPrompt({
endTitle,
title: "What type of website do you want me to help you build?",
title:
randomWebsiteSubcategoryTitle[
Math.floor(Math.random() * randomWebsiteSubcategoryTitle.length)
],
options: [
{
label: "Web App & Static Site",
value: "web-app",
hint: "Next.js, Vite, Astro, Vue, etc",
},
{
label: "...",
hint: "coming soon",
value: "coming-soon",
disabled: true,
},
// {
// label: "[Coming soon] WordPress",
// value: "wordpress",
Expand All @@ -123,15 +169,31 @@ export async function buildBrandNewThing() {
],
});

const randomFrameworkTitle = [
"Time to make a choice! Which framework would you like to use?",
"Great choice! Now, let's narrow down your framework choice. Which framework aligns best with your vision?",
"Excellent! To help set you up with the right tools, could you tell me more specifically which framework you're interested in?",
"Perfect! Let's get more specific about your framework choice. Which of these options aligns best with your vision?",
];

const framework = await selectPrompt({
endTitle,
title: "Time to make a choice! Which framework would you like to use?",
title:
randomFrameworkTitle[
Math.floor(Math.random() * randomFrameworkTitle.length)
],
options: [
{
label: "Next.js",
value: "nextjs",
hint: "recommended for most projects",
},
{
label: "...",
hint: "coming soon",
value: "coming-soon",
disabled: true,
},
// {
// label: "[Coming soon] Vite",
// value: "vite",
Expand All @@ -153,11 +215,27 @@ export async function buildBrandNewThing() {
],
});

const randomWebsiteCategoryTitle = [
"Let's narrow it down: What category best fits your website?",
"Great choice! Now, let's narrow down your website focus. What category aligns best with your vision?",
"Excellent! To help set you up with the right tools, could you tell me more specifically which category you're interested in?",
"Perfect! Let's get more specific about your website category. Which of these options aligns best with your vision?",
];

const websiteCategory = await selectPrompt({
endTitle,
title: "Let's narrow it down: What category best fits your website?",
title:
randomWebsiteCategoryTitle[
Math.floor(Math.random() * randomWebsiteCategoryTitle.length)
],
options: [
{ label: "E-commerce", value: "e-commerce" },
{
label: "...",
hint: "coming soon",
value: "coming-soon",
disabled: true,
},
// { label: "[Coming soon] Blog", value: "blog", disabled: true },
// {
// label: "[Coming soon] Portfolio",
Expand All @@ -171,11 +249,21 @@ export async function buildBrandNewThing() {
template = REPO_SHORT_URLS.versatorGithubLink;
}

const randomWebsiteDetailsTitle = [
" Your initial plan is all set! Now, let’s add some personal touches. Please share a few details about yourself and the app so I can personalize everything for you.",
" Great choice! Now, let’s add some personal touches. Please share a few details about yourself and the app so I can personalize everything for you.",
" Excellent! To help set you up with the right tools, could you tell me more specifically which details you're interested in?",
" Perfect! Let's get more specific about your website details. Which of these options aligns best with your vision?",
];

await askProjectDetails(
template,
" Your initial plan is all set! Now, let’s add some personal touches. Please share a few details about yourself and the app so I can personalize everything for you.",
randomWebsiteDetailsTitle[
Math.floor(Math.random() * randomWebsiteDetailsTitle.length)
],
"buildBrandNewThing",
true,
isDev,
);
/* END OF WEBSITE CATEGORY */
}
Expand Down
Loading

0 comments on commit af15182

Please sign in to comment.