Skip to content

Commit

Permalink
Merge pull request #12 from Luzin7/dev
Browse files Browse the repository at this point in the history
v.1.3.1
  • Loading branch information
Luzin7 committed Mar 27, 2024
2 parents b5e4ce8 + 8733555 commit c75e6f5
Show file tree
Hide file tree
Showing 37 changed files with 886 additions and 124 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# confectus

## 1.3.0

### Minor Changes

- Add Frontend configuration and options for the user, update questionnaire and fix minor bugs.

## 1.2.0

### Minor Changes
Expand Down
19 changes: 11 additions & 8 deletions README.md
Expand Up @@ -4,27 +4,27 @@ Welcome to Confectus, your friendly tool for automating development environment

## About

Confectus is a Command Line Interface (CLI) designed to simplify the process of configuring development environments, especially for JavaScript and TypeScript backend projects.
Confectus is a Command Line Interface (CLI) designed to simplify the process of configuring development environments, whether for frontend or backend projects using JavaScript and TypeScript.

### Project Configuration

Confectus simplifies the setup of backend projects with various configuration options:
Confectus simplifies the setup of projects with various configuration options:

#### TypeScript or JavaScript
#### Backend and Frontend Configuration

- When running Confectus, you can choose to set up your backend project using **TypeScript** or **JavaScript**.
- You can set up your project using **TypeScript** or **JavaScript**.

#### Linters Integration

- Confectus allows you to include `ESLint` o `Biome` in your project setup if you prefer linting.
- Confectus allows you to include `ESLint` or `Biome` in your project setup if you prefer linting.

#### VSCode Integration

- If you are using VSCode, Confectus automatically creates a `settings.json` file within the `.vscode` directory of your project. This file includes configurations tailored for a seamless development experience within VSCode.

#### Git Integration

- Confectus automatically generates a `.gitignore` file tailored for Node.js and TypeScript/JavaScript projects, ensuring that unnecessary files are excluded from version control.
- Confectus automatically generates a `.gitignore` and `README.md` file tailored for Node.js and TypeScript/JavaScript projects, ensuring that unnecessary files are excluded from version control.

#### Package Manager Compatibility

Expand All @@ -36,12 +36,13 @@ Confectus simplifies the setup of backend projects with various configuration op

#### Testing Options

- Confectus introduces testing options, allowing you to test your setup and configurations for a smoother development process.
- Confectus introduces testing options for backend projects, allowing you to test your setup and configurations for a smoother development process.

## Key Features

- **Simple Configuration:** Confectus makes setting up your development environment an easy and effective task.
- **Cross-Platform Compatibility:** Confectus supports both Linux and Windows environments, making it even more user-friendly.
- **Fullstack:** Confectus helps you in both Frontend and Backend environments, making it even more useful.

## Installation

Expand All @@ -51,6 +52,8 @@ To get started, ensure you have Node.js installed. Then, use the following comma
npm install -g confectus #recommended
```

Confectus is designed not to necessarily be a dependency on your project. Just run the command, select what you want to configure, and you're free!

## How to use Confectus

After installation, you can use Confectus as follows:
Expand All @@ -75,4 +78,4 @@ If you encounter issues, bugs, or want to contribute to Confectus development, f

#

Thank you for using Confectus!
Thank you for using Confectus!
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"author": "Luan Victor de Souza Dutra",
"main": "./dist/main.js",
"version": "1.2.0",
"version": "1.3.0",
"license": "MIT",
"keywords": [
"JavaScript",
Expand Down
8 changes: 6 additions & 2 deletions src/infra/cli/questions/index.ts
@@ -1,3 +1,7 @@
import { questions } from "./questions";
import {
backendQuestions,
frontendQuestions,
wichStackQuestion,
} from "./questions";

export default questions;
export { backendQuestions, frontendQuestions, wichStackQuestion };
60 changes: 57 additions & 3 deletions src/infra/cli/questions/questions.ts
@@ -1,7 +1,16 @@
import { QuestionProps } from "@/types/question";
import chalk from "chalk";

export const questions: QuestionProps[] = [
export const wichStackQuestion: QuestionProps[] = [
{
name: "stack",
type: "list",
message: "Which stack do you will use?",
choices: ["Frontend", "Backend"],
},
];

export const backendQuestions: QuestionProps[] = [
{
name: "wichManager",
type: "list",
Expand All @@ -13,8 +22,8 @@ export const questions: QuestionProps[] = [
{
name: "hasPackageJson",
type: "list",
message: `📦 Have you already initialized your project with a ${chalk.whiteBright.underline(
"init command",
message: `📦 Have you already created your ${chalk.whiteBright.underline(
"package.json",
)}?`,
choices: ["No", "Yes"],
},
Expand Down Expand Up @@ -63,3 +72,48 @@ export const questions: QuestionProps[] = [
choices: ["Yes", "No"],
},
];

export const frontendQuestions: QuestionProps[] = [
{
name: "hasPackageJson",
type: "list",
message: `📦 Have you already created your ${chalk.whiteBright.underline(
"package.json",
)}?`,
choices: ["No", "Yes"],
},
{
name: "wichManager",
type: "list",
message: `🛠️ Which ${chalk.bold.underline(
"package manager",
)} do want to use?`,
choices: ["NPM", "Yarn", "Bun", "PNPM"],
},
{
name: "wichLanguage",
type: "list",
message: `🪛 Wich ${chalk.cyan("language")} do you want to use?`,
choices: ["Javascript", "Typescript"],
},
{
name: "wichLinter",
type: "list",
message: `🧹 Do you want to add ${chalk.blue("linter")} to lint your code?`,
choices: ["Eslint", "Biome", "No"],
},
{
name: "isVscode",
type: "list",
message: `💻 Do you want to create a ${chalk.blueBright(
".vscode",
)} folder?`,
choices: ["Yes", "No"],
},
{
name: "wichStack",
type: "list",
message: "🛠️ Which stack are you using?",
choices: ["React", "Next.js", "Vue.js"],
},
];
@@ -1,6 +1,9 @@
import { SettingsProps } from "@/types/setting";

export abstract class DepedenciesInstallerRepository {
abstract install(
managerInstallCommand: string,
dependency: string,
stackChoiced: SettingsProps,
): Promise<void>;
}
@@ -1,8 +1,8 @@
import { SettingsProps } from "@/types/setting";
import { exec } from "child_process";
import { promisify } from "util";
import { InstallationDependecyError } from "../../errors/InstallationDependecyError";
import { InstallationDevelopmentDependecyError } from "../../errors/InstallationDevelopmentDependecyError";
import { dependeciesSetup } from "../../setups";
import { DepedenciesInstallerRepository } from "../contracts/DepedenciesInstallerRepository";

export class DepedenciesInstallerRepositoryImplementations
Expand All @@ -11,9 +11,10 @@ export class DepedenciesInstallerRepositoryImplementations
async install(
managerInstallCommand: string,
dependency: string,
stackChoiced: SettingsProps,
): Promise<void> {
const { dependencies, devDependencies } =
dependeciesSetup[dependency.toLowerCase()] ?? {};
stackChoiced[dependency.toLowerCase()] ?? {};

function installCommand(deps: string, dev: boolean) {
const isDevelopment = process.env.NODE_ENV === "development";
Expand Down

0 comments on commit c75e6f5

Please sign in to comment.