Skip to content

Commit

Permalink
complete migration to @reliverse/prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Nov 27, 2024
1 parent f022a02 commit db3d77f
Show file tree
Hide file tree
Showing 24 changed files with 511 additions and 253 deletions.
79 changes: 49 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,48 @@
# Reliverse
# @reliverse/cli

[npmjs](https://npmjs.com/package/@reliverse/cli), [GitHub](https://github.com/reliverse/cli), [Discord](https://discord.gg/Pb8uKbwpsJ)

![Reliverse Cover Image](./reliverse.webp)
**Reliverse: Open-Source Full-Featured Product Launcher Tool & Assistant**.

## Introduction
![Reliverse Cover Image](./reliverse.webp)

👋 Welcome! This tool can help you easily create new web projects and automatically make advanced codebase modifications, with more features coming soon.
👋 Welcome! This superapp tool can help you easily create new web projects and automatically make advanced codebase modifications, with more features coming soon.

**Reliverse** is a CLI tool designed to streamline the setup of JavaScript, TypeScript, and other types of projects, with a primary focus on Next.js templates, though it is not limited to them.

It allows you to effortlessly bootstrap projects, including the [Relivator Next.js template](https://github.com/blefnk/relivator-nextjs-template) or any other template from GitHub or other Git-based sources. Additionally, Reliverse assists in managing configuration files and resolving potential conflicts between tools like ESLint, Prettier, and Biome.
## Installation

Please make sure you have [Git](https://git-scm.com), [VSCode](https://code.visualstudio.com), and [Node.js LTS](https://nodejs.org/en/download/package-manager) installed first.

Then use one of the following commands to install **Reliverse**:

- With [bun](https://bun.sh): `bun i -g @reliverse/cli`
- With [pnpm](https://pnpm.io/installation#using-corepack): `pnpm add -g @reliverse/cli`
- With [yarn](https://yarnpkg.com): `yarn global add @reliverse/cli`
- With [npm](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager): `npm i -g @reliverse/cli`

## Usage

Once installed, you can use **@reliverse/cli** to create new projects or manage existing ones. Navigate to the root of your desired directory and run:

```bash
reliverse
```

## Updating

```bash
bun rm -g @reliverse/cli
bun i -g @reliverse/cli
# OR bun update --latest -g
# OR use another package manager
```

## Introduction

A single tool to launch a brand new thing from scratch? Yes.

Reliverse allows you to effortlessly bootstrap projects, including the [Relivator Next.js template](https://github.com/blefnk/relivator-nextjs-template) or any other template from GitHub or other Git-based sources. Additionally, Reliverse assists in managing configuration files and resolving potential conflicts between tools like ESLint, Prettier, and Biome.

Reliverse is more than just the easiest way to install Relivator. It’s also the most convenient new way to download any repository from GitHub and automatically prepare it for work. Especially if it’s a project from the JavaScript ecosystem.

Expand All @@ -20,7 +52,7 @@ The mission of this project is not only to help you install templates in seconds

Things are too overwhelming in our world. Let's make everything easier.

**Reliverse CLI allows you:**
**@reliverse/cli allows you:**

1. Install the pre-configured Relivator.
2. Build your own Relivator from scratch.
Expand All @@ -30,7 +62,7 @@ Things are too overwhelming in our world. Let's make everything easier.
6. Update your GitHub clone with the latest changes.
7. Add, remove, or replace the Relivator's features.

**It's a single tool for everything.** At its current stage, Reliverse CLI is a powerful website builder and project bootstrapper, right in your terminal. However, it won’t be only a website builder in the future, it will be a tool for building anything. Even now, you can start from scratch or with a template, setting everything up automatically or customizing it to your exact preferences. With all the tools pre-configured and ready to go, you can build exactly what you envision.
**It's a single tool for everything.** At its current stage, @reliverse/cli is a powerful website builder and project bootstrapper, right in your terminal. However, it won’t be only a website builder in the future, it will be a tool for building anything. Even now, you can start from scratch or with a template, setting everything up automatically or customizing it to your exact preferences. With all the tools pre-configured and ready to go, you can build exactly what you envision.

Remember the feeling of empowerment when you first used a website builder like WordPress? It gave you the freedom to create. But eventually, you hit limits—PageSpeed Insights flagged issues, performance lagged, and the bloated size of your site became hard to ignore.

Expand All @@ -42,28 +74,15 @@ Reliverse is still in its early stages, but it already allows you to bootstrap w

By the way, you might think that a CLI doing so many things would become bloated, like an elephant in the room, but don’t worry—it’s going to be lean. This is the dream of a creator, a dream that must become reality. Everything has to be perfect.

## Installation

You should install [Git](https://git-scm.com), [VSCode](https://code.visualstudio.com), and [Node.js LTS](https://nodejs.org/en/download/package-manager) first. Then use one of the following commands to install **Reliverse**:

- With [bun](https://bun.sh): `bun i -g @reliverse/cli`
- With [pnpm](https://pnpm.io/installation#using-corepack): `pnpm add -g @reliverse/cli`
- With [yarn](https://yarnpkg.com): `yarn global add @reliverse/cli`
- With [npm](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager): `npm i -g @reliverse/cli`

## Usage

Once installed, you can use **Reliverse CLI** to create new projects or manage existing ones. Navigate to the root of your desired directory and run:
See the [Installation](#installation) section for more details.

```bash
reliverse
```
## Collaborate

> **Temporary issue**: It seems that currently if you build and publish a project using bun , then the project does not run with a global installation, so *now wherever README.md says to use `bun`, please use `pnpm` instead*.
Reliverse team is open to partnerships and collaborations. If you are interested in working together, please contact us. Discord: <https://discord.gg/Pb8uKbwpsJ>.

## FAQ

**Bun doesn't install the latest version of Reliverse CLI. What should I do?**
**Bun doesn't install the latest version of @reliverse/cli. What should I do?**

```bash
bun pm cache rm -g
Expand All @@ -72,7 +91,7 @@ bunx reliverse # OR bunx reliverse@latest

**Why you don't use monorepo?**

Our mission is to make web development accessible and understandable for everyone. By everyone, we also mean any tool. Unfortunately, not every web tool works perfectly with monorepo, including Bun, which is critical for us. Strange things can sometimes happen with a monorepo codebase. But it depends on the vision of the project. If there is a real need for monorepo and all the tools work well, we will be free to switch to it. There has already been an attempt to switch to a monorepo structure, the developments were saved and available as a monorepo bootstrap using Reliverse CLI itself.
Our mission is to make web development accessible and understandable for everyone. By everyone, we also mean any tool. Unfortunately, not every web tool works perfectly with monorepo, including Bun, which is critical for us. Strange things can sometimes happen with a monorepo codebase. But it depends on the vision of the project. If there is a real need for monorepo and all the tools work well, we will be free to switch to it. There has already been an attempt to switch to a monorepo structure, the developments were saved and available as a monorepo bootstrap using @reliverse/cli itself.

## Reliverse Addons

Expand All @@ -87,12 +106,12 @@ Reliverse Addons, also called as extensions or plugins, are projects that extend
- **Interactive Setup**: Customize your setup with interactive prompts that let you choose specific file categories to include.
- **Template-Driven Initialization**: Instantly clone and set up templates from GitHub to jumpstart your development.
- **Versatile Functionality**: Not just for templates! Planning to clone a JS library or experiment with new setups? Reliverse can support it all.
- **Enhanced shadcn/ui CLI Integration**: [W.I.P] The Reliverse CLI integrates with the shadcn/ui CLI, enabling seamless addition of components and dependencies to your project. With added features and support for shadcn-vue and shadcn-svelte (community-led ports for Vue and Svelte), you can easily add shadcn/ui components to React, Vue, and Svelte projects. Checkboxes let you select and install multiple components at once. Note: Reliverse and these community-supported ports are not affiliated with @shadcn.
- **Enhanced shadcn/ui CLI Integration**: [W.I.P] The @reliverse/cli integrates with the shadcn/ui CLI, enabling seamless addition of components and dependencies to your project. With added features and support for shadcn-vue and shadcn-svelte (community-led ports for Vue and Svelte), you can easily add shadcn/ui components to React, Vue, and Svelte projects. Checkboxes let you select and install multiple components at once. Note: Reliverse and these community-supported ports are not affiliated with @shadcn.
- **Future Expansion**: While currently optimized for JavaScript and TypeScript projects (e.g., React, Astro, Vue, Svelte), Reliverse is envisioned to grow beyond web development into a comprehensive toolset you’ll love. This is the founder’s vision for Reliverse—to become the single tool for everything.

### Commands

The Reliverse CLI offers a series of interactive prompts to streamline your project setup:
The @reliverse/cli offers a series of interactive prompts to streamline your project setup:

1. **Create a New Project**: Start from scratch or use predefined templates for a quick setup.
2. **Install GitHub Templates**: Easily install any JavaScript or TypeScript project by providing a GitHub repository URL.
Expand All @@ -102,7 +121,7 @@ The Reliverse CLI offers a series of interactive prompts to streamline your proj

### Example Workflow

Here’s an example session of using **Reliverse CLI**:
Here’s an example session of using **@reliverse/cli**:

```bash
$ reliverse
Expand Down Expand Up @@ -135,7 +154,7 @@ When setting up a project, you can choose from the following file categories:

## Conflict Management

**Reliverse CLI** helps you handle configuration conflicts for existing files such as `.eslintrc.cjs` or `prettier.config.js`. It prompts you with options to:
**@reliverse/cli** helps you handle configuration conflicts for existing files such as `.eslintrc.cjs` or `prettier.config.js`. It prompts you with options to:

- **Remove**: Delete the existing file.
- **Rename**: Rename the file (e.g., add `.txt` to disable it).
Expand Down Expand Up @@ -188,7 +207,7 @@ Visit the [Installation](#installation) section and select **Tools Installation*

#### Classical Method

To contribute to **Reliverse CLI**, you can clone the repository and install the dependencies:
To contribute to **@reliverse/cli**, you can clone the repository and install the dependencies:

```bash
git clone https://github.com/reliverse/cli.git
Expand Down
3 changes: 0 additions & 3 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"complexity": {
"noBannedTypes": "off",
"noForEach": "off",
"noUselessFragments": "off",
"noUselessLoneBlockStatements": "off",
"useArrowFunction": "off",
"useFlatMap": "off",
Expand Down Expand Up @@ -92,9 +91,7 @@
"style": {
"useSingleVarDeclarator": "off",
"useExponentiationOperator": "off",
"useTemplate": "off",
"useConst": "off",
"noUnusedTemplateLiteral": "off",
"noInferrableTypes": "off",
"noNonNullAssertion": "off",
"noParameterAssign": "off",
Expand Down
2 changes: 1 addition & 1 deletion build.publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function showHelp() {
relinka.info(`Usage: bun build.publish.ts [options]
Options:
no options Publish to npm registry
no options Publish to NPM registry
--jsr Publish to JSR registry
--dry-run Perform a dry run of the publish process
-h, --help Show help
Expand Down
1 change: 1 addition & 0 deletions bump.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { defineConfig } from "bumpp";
export default defineConfig({
push: false,
commit: false,
tag: false,
});
Binary file modified bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"Doesnt",
"Dont",
"Downey",
"ecommerce",
"emojify",
"envjs",
"eslintcache",
Expand All @@ -64,6 +65,7 @@
"Fireship",
"Focusable",
"forgetme",
"frontends",
"Geralt",
"giget",
"goroutines",
Expand Down Expand Up @@ -136,6 +138,7 @@
"sisteransi",
"Sprache",
"subchoices",
"superapp",
"Targ",
"Targaryen",
"tasuku",
Expand Down
2 changes: 1 addition & 1 deletion jsr.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reliverse/cli",
"version": "1.1.0",
"version": "1.2.3",
"author": "blefnk",
"license": "MIT",
"exports": "./dist-jsr/main.ts",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reliverse/cli",
"version": "1.1.0",
"version": "1.2.3",
"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 @@ -50,8 +50,8 @@
"dependencies": {
"@reliverse/core": "^0.1.0",
"@reliverse/fs": "^0.6.0",
"@reliverse/prompts": "^1.2.4",
"@reliverse/relinka": "^1.2.2",
"@reliverse/prompts": "^1.3.2",
"@reliverse/relinka": "^1.2.3",
"@sinclair/typebox": "^0.34.9",
"c12": "^2.0.1",
"cli-spinners": "^3.2.0",
Expand All @@ -64,7 +64,7 @@
"magic-regexp": "^0.8.0",
"node-emoji": "^2.1.3",
"node-fetch": "^3.3.2",
"nypm": "^0.3.12",
"nypm": "^0.4.0",
"ofetch": "^1.4.1",
"open": "^10.1.0",
"pathe": "^1.1.2",
Expand All @@ -87,9 +87,9 @@
"eslint": "^9.15.0",
"eslint-plugin-perfectionist": "^4.1.2",
"globals": "^15.12.0",
"knip": "^5.38.1",
"knip": "^5.38.2",
"magicast": "^0.3.5",
"putout": "^36.13.1",
"putout": "^36.14.0",
"redrun": "^11.0.5",
"strip-comments": "^2.0.1",
"typescript": "^5.7.2",
Expand Down
66 changes: 34 additions & 32 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import { errorHandler } from "@reliverse/prompts";

import { showReliverseMenu } from "./menu/modules/01-showReliverseMenu.js";
import { askProjectDetails } from "./menu/modules/04-askProjectDetails.js";
import {
askDir,
doSomeFunStuff,
Expand All @@ -20,49 +22,49 @@ import {
showResults,
showSelectPrompt,
showStartPrompt,
showInputPrompt,
showTogglePrompt,
} from "./menu/prompts.js";
import { type UserInput } from "./menu/schema.js";

export default async function main() {
await showStartPrompt();
await showAnykeyPrompt("privacy");
const username = await showInputPrompt();
const dir = await askDir(username);
const age = await showNumberPrompt();
const password = await showPasswordPrompt();
const birthday = await showDatePrompt();
const lang = await showSelectPrompt();
const langs = await showMultiselectPrompt();
const color = await showNumSelectPrompt();
const features = await showNumMultiselectPrompt();
const toggle = await showTogglePrompt();
const spinner = await showConfirmPrompt(username);
const userInput = {
username,
dir,
age,
lang,
color,
password,
birthday,
langs,
features,
spinner,
toggle,
} satisfies UserInput;
await showProgressBar();
await showResults(userInput);
await doSomeFunStuff(userInput);
await showNextStepsPrompt();
await showAnimatedText();
await showAnykeyPrompt("welcome");
await showReliverseMenu();
// const username = await showInputPrompt();
// const dir = await askDir(username);
// const age = await showNumberPrompt();
// const password = await showPasswordPrompt();
// const birthday = await showDatePrompt();
// const lang = await showSelectPrompt();
// const langs = await showMultiselectPrompt();
// const color = await showNumSelectPrompt();
// const features = await showNumMultiselectPrompt();
// const toggle = await showTogglePrompt();
// const spinner = await showConfirmPrompt(username);
// const userInput = {
// username,
// dir,
// age,
// lang,
// color,
// password: "123456",
// birthday: "14.02.1990",
// langs,
// features,
// spinner,
// toggle,
// } satisfies UserInput;
// await showProgressBar();
// await showResults(userInput);
// await doSomeFunStuff(userInput);
// await showNextStepsPrompt();
// await showAnimatedText();
await showEndPrompt();
}

await main().catch((error: Error) =>
errorHandler(
error,
"If this issue is related to Reliverse CLI itself, please\n│ report the details at https://github.com/blefnk/reliverse",
"If this issue is related to @reliverse/cli itself, please\n│ report the details at https://github.com/reliverse/cli",
),
);
24 changes: 0 additions & 24 deletions src/menu/configs.ts

This file was deleted.

Loading

0 comments on commit db3d77f

Please sign in to comment.