Skip to content

πŸ‡ White Rabbit automates project setup by offering an interactive CLI tool that initializes JavaScript projects with TypeScript support.

License

Notifications You must be signed in to change notification settings

Romain-Portanguen/white_rabbit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Unleash code magic, effortlessly optimize and deploy.

license last-commit repo-top-language repo-language-count

Developed with the software and tools below.

JavaScript YAML Jest TypeScript tsnode JSON


Table of Contents

πŸ“ Overview

White Rabbit automates project setup by offering an interactive CLI tool that initializes JavaScript projects with TypeScript support. It manages dependencies, sets up Git repositories, and configures popular tools like ESLint, Prettier, and Jest. By dynamically handling project types such as React, Vue.js, Node.js and Angular, White Rabbit streamlines application building and execution, enhancing developer productivity.


🧩 Features

Feature Description
βš™οΈ Architecture White Rabbit project features a modular architecture with interfaces for core functionalities like dependency management, Git initialization, and application building. It utilizes TypeScript for type safety and enhanced structure. CLI Manager orchestrates various modules for streamlined application creation.
πŸ”© Code Quality The codebase maintains high code quality standards with TypeScript for strict typing, consistent naming conventions, and clean architecture patterns. Jest testing framework ensures robust test coverage, enhancing code reliability and maintainability. ESLint and Prettier configurations enforce consistent code formatting and style guidelines.
πŸ“„ Documentation The project provides comprehensive documentation, including type declarations for core modules, CLI operations, and utilities. README.md offers project overview, installation instructions, and usage guidelines. Inline comments and type annotations enhance code readability and maintainability.
πŸ”Œ Integrations Key integrations include Jest for testing, Inquirer for interactive prompts, chalk for colored output, and execa for shell command execution. External dependencies like cli-table3 and ora enhance CLI functionality and user experience. Modular design facilitates seamless integration of new features and tools.
🧩 Modularity White Rabbit emphasizes modularity and reusability with interfaces defining core functionalities. Dependencies are managed dynamically based on project type, enhancing flexibility and extensibility. Modules like dependency-installer and git-initializer encapsulate specific tasks, promoting code reusability and maintainability.
πŸ§ͺ Testing The project utilizes Jest along with TypeScript to ensure comprehensive test coverage. Mocks and spies are employed for testing CLI Manager functionalities, ensuring reliable testing outcomes. Testing Library configurations enhance testing capabilities, supporting efficient unit and integration testing.
⚑️ Performance White Rabbit focuses on efficiency with tools like UglifyJS for code minification and optimization. The project's streamlined architecture and use of TypeScript contribute to improved performance and resource utilization. Dynamic dependency installation and Git setup enhance project initialization speed.
πŸ›‘οΈ Security Security measures include robust typing with TypeScript, preventing common runtime errors and vulnerabilities. Git initializer ensures proper setup of version control, enhancing code security and collaboration. Strict ESLint rules and standardized code formatting promote secure coding practices.
πŸ“¦ Dependencies Key dependencies include Jest for testing, Inquirer for CLI interaction, chalk for colored output, and execa for command execution. TypeScript, ts-node, and ts-jest support the projects TypeScript ecosystem. yaml and glob aid in configuration and file handling tasks.

πŸ—‚οΈ Repository Structure

└── white_rabbit/
    β”œβ”€β”€ .github
    β”‚   └── FUNDING.yml
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ README.md
    β”œβ”€β”€ add-js-extensions.js
    β”œβ”€β”€ jest.config.ts
    β”œβ”€β”€ minify.mjs
    β”œβ”€β”€ package-lock.json
    β”œβ”€β”€ package.json
    β”œβ”€β”€ src
    β”‚   β”œβ”€β”€ @types
    β”‚   β”œβ”€β”€ __tests__
    β”‚   β”œβ”€β”€ cli
    β”‚   β”œβ”€β”€ core
    β”‚   β”œβ”€β”€ index.ts
    β”‚   β”œβ”€β”€ public
    β”‚   └── utils
    └── tsconfig.json

πŸ“¦ Modules

.
File Summary
minify.mjs Initiates minification process using UglifyJS for all JavaScript files in the dist directory. Finds, minifies, renames, and deletes files, ensuring efficient handling of JavaScript resources for the project.
add-js-extensions.js Automates adding.js extensions to ES module imports in the dist directory to ensure proper module resolution for JavaScript files within the White Rabbit repository.
package-lock.json The code in minify.mjs is responsible for optimizing and reducing the size of JavaScript files within the white_rabbit repository. By minimizing the code, it enhances the overall performance and efficiency of the software. This file plays a crucial role in ensuring that the final output of the repositorys JavaScript codebase is streamlined and optimized for execution.
package.json Enables rapid project initialization via the White Rabbit CLI tool. It manages project setup intelligently, leveraging TypeScript and Node.js. Key features include interactive prompts, project type selection, and efficient code minification.
tsconfig.json Enables TypeScript compilation and resolution, optimizing the projects structure. It specifies ESNext target, node module resolution, and plugins for transforming JavaScript files, ensuring strict typing and consistent naming conventions while including relevant source directories for processing.
jest.config.ts Configures Jest testing environment for TypeScript files, excluding specified paths. Specifies file extensions, root directories, and transformation rules. Defines global settings for TypeScript compilation.
.github
File Summary
FUNDING.yml Defines funding options for the project, linking to platforms like GitHub Sponsors, Patreon, and Open Collective. Enables financial support via various channels to sustain project development and growth.
src
File Summary
index.ts Initiates CLI Manager, facilitating interactive questioning and software creation. Orchestrates Dependency Installer, Configurer, Git Initializer, and Package Manager Checker to streamline application building and execution.
[email protected]
File Summary
package-manager-checker.d.ts Defines interface for checking availability of package managers and confirming if they are available. Crucial for managing package installations across different environments within the white_rabbit repository.
dependency-installer.d.ts Defines interface for installing dependencies using specified package manager and project directory.
git-initializer.d.ts InitializeGitRepository() and createGitignoreFile(), crucial for setting up and customizing Git repositories within the core module of the white_rabbit project.
dependency-configurer.d.ts Defines DependencyConfigurerInterface to manage project dependencies dynamically based on language, enhancing modularity and flexibility in dependency handling within the repositorys architecture.
application-builder.d.ts Defines interface for application builder to construct application based on user answers.
[email protected]
File Summary
command-executor.d.ts Defines CommandExecutorInterface for executing commands with options like current working directory and stream I/O.
logger.d.ts Defines a LoggerInterface for logging messages and printing ASCII art. Essential for enforcing logging standards across the projects utilities and maintaining a consistent user experience.
file-system.d.ts Defines FileSystemInterface with methods for file manipulation, access, and directory handling. Crucial for interacting with the file system in White Rabbits architecture for core functionality operations.
[email protected]
File Summary
question-manager.d.ts Defines QuestionManagerInterface interface for asking questions, importing Answers interface. Facilitates interaction with the CLI question manager within the white_rabbit repositorys architecture.
[email protected]
File Summary
inquirer-autocomplete-prompt.d.ts Defines type declaration for inquirer-autocomplete-prompt module, facilitating structured interaction within the parent repository.
answers.d.ts Defines Inquirer extension for Autocomplete questions, augmenting the QuestionMap interface. Specifies answer structure for project setup choices like project name, language & testing tools. Enhances user input experience during project initialization within the White Rabbit repository.
src.core
File Summary
dependency-configurer.ts Implements a class to configure Tailwind CSS dependencies dynamically in a project directory. Handles setting up Tailwind configuration files and generating necessary CSS content. Key for enhancing project styling without manual setup.
git-initializer.ts Initializing repos and creating.gitignore files. It utilizes external interfaces for executing commands and file system interactions, supporting the core functionality of setting up Git repositories in the project directory.
package-manager-checker.ts Detects available package managers and checks their availability for use in the project, ensuring seamless integration with supported managers-pnpm, yarn, and npm. Offering a fallback mechanism by prioritizing alternative managers if the preferred one is unavailable.
dependency-installer.ts Enables seamless installation of project dependencies with various package managers. Validates package manager availability, constructs install commands dynamically, and provides real-time installation feedback using a spinner. A crucial component for managing project dependencies effectively within the repositorys architecture.
application-builder.ts Builds projects, initializes tools, handles dependencies, configures linting, formatting, and testing tools, sets up Git, and changes project directories based on user input for various project types like Angular and Node.js in the repositorys core architecture.
src.core.project-initializer
File Summary
react-initializer.ts Generates React projects with TypeScript support, leveraging the command executor interface for setup.
vuejs-initializer.ts Creates a Vue.js project with TypeScript support, handling project initialization, dependencies installation, and configuration setup. The function ensures seamless Vue.js project creation and properly configures TypeScript support for enhanced development capabilities within the repositorys architecture.
nodejs-initializer.ts Initiates Node.js project setup, handling package.json creation, installing dependencies, and configuring ESLint, Prettier, Jest, Mocha, and Testing Library. Ensures smooth project initialization, logging success or failure, forking on user input.
angular-initializer.ts Initialize and run Angular projects with CLI commands. Handles project directory creation and Angular setup. Facilitates smooth project initialization with logging and error handling. Centralizes CLI commands execution for efficient project setup.
index.ts Enables dynamic creation of React, Angular, Node.js, and Vue.js projects with specified tools and dependencies based on user input. Abstraction layer for project initialization logic in the core architecture.
src.utils
File Summary
dependencies.ts Extracts dependencies based on project types like React, Vue.js, or Node.js from a map, aiding in managing necessary libraries for different project frameworks.
file-system.ts Implements filesystem operations for writing, appending, creating directories, checking access, reading directories, and getting file stats within the white_rabbit repositorys architecture.
command-executor.ts Implements a CommandExecutor class handling execution of shell commands using execa. Facilitates executing commands with customizable options like current working directory and standard input/output handling for efficient command line operations within the white_rabbit repositorys architecture.
summary.ts Prints a summary of project details using a color-formatted table. Allows visualizing key selections such as project name, type, language, dependencies, tools, and Git initialization status. Facilitates easy grasp of project setup information for better organization and planning within the repository architecture.
Logger.ts Employs a colorful Logger to produce ASCII art and custom log messages based on the given severity level. Enhances readability by using chalk.
path-suggestions.ts Generates directory suggestions based on input, filtering out certain directories. Conducts error logging for file system operations. Main features include resolving paths, reading directory contents, and handling errors gracefully.
src.utils.configurations
File Summary
mocha-config.ts Generates and updates Mocha configuration and test files based on project type, enhancing test capabilities and script commands in the repository.
jest-config.ts Generates Jest configuration based on project type, updates setup files for React, Vue.js, or Node.js projects, and enhances package.json with Jest test script.
testing-library-config.ts Generates Jest configurations based on project type, Vue.js-specific setup if applicable, adds jest-dom to testing environment, and updates package.json for Jest script, enhancing testing capabilities in the White Rabbit repository.
prettier-config.ts Generates Prettier configuration file for project directory, defining formatting rules.
eslint-config.ts Generates ESLint configuration file with preset rules for React and TypeScript projects. Dynamically creates.eslintrc.json in the specified project directory based on recommended ESLint and Prettier configurations to enforce code quality standards.
src.cli
File Summary
cli-manager.ts Orchestrates question prompts and application building, handling success and error logging. Implements a colorful log feature and ASCII art for a personalized welcome message.
src.cli.questions
File Summary
question-manager.ts Manages user prompts for project configuration, based on answers guides actions. Supports customization and decision-making during setup, with error handling.
common-questions.ts Generates common questions for project setup based on project type, providing options for dependencies, linting tools, formatting tools, testing tools, and initializing a git repository. Supports customization for different project types, excluding Angular.
initial-questions.ts Inquire project name, destination path, project type, language, and package manager choices. Utilize filesystem interface for directory suggestions and conditional prompts based on project type selection.
src.__tests__.cli
File Summary
cli-manager.test.ts Printing welcome message, building application based on user confirmation, handling installation errors. Uses mocks for dependencies and spies on logger methods during test execution.

πŸš€ Getting Started

System Requirements:

  • TypeScript: version x.y.z

βš™οΈ Installation

From source

  1. Clone the white_rabbit repository:
$ git clone https://github.com/Romain-Portanguen/white_rabbit
  1. Change to the project directory:
$ cd white_rabbit
  1. Install the dependencies:
$ npm install

πŸ€– Usage

From source

Run white_rabbit using the command below:

$ npm run build && npm start

πŸ§ͺ Tests

Run the test suite using the command below:

$ npm run test

🀝 Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.

  2. Clone Locally: Clone the forked repository to your local machine using a git client.

    git clone https://github.com/Romain-Portanguen/white_rabbit
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.

    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.

  5. Commit Your Changes: Commit with a clear message describing your updates.

    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.

    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.

  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!

Contributor Graph


πŸŽ— License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


About

πŸ‡ White Rabbit automates project setup by offering an interactive CLI tool that initializes JavaScript projects with TypeScript support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages