eletract
v1.0.0
Published
A command-line tool to quickly set up a React + Electron project with automatic configuration.
Downloads
3
Maintainers
Readme
eletract
📦 Installation
Install Eletract globally using npm:
npm install -g eletractYou can create a new project using:
npx eletract projectnameTo create a TypeScript project:
npx eletract projectname --template typescript🚀 Features
Instant React + Electron App Setup:
Create a fully working React + Electron project with just one command.Supports TypeScript and JavaScript:
Choose between JavaScript or TypeScript for your project.Electron Integration:
Automatically sets up Electron with your React app, including scripts to launch it.Dev Scripts Ready to Use:
Run your project with a single command (npm run dev) that starts React and Electron together.Auto-Generated Project Structure:
The created project follows best practices and includes a workingelectron.jsentry file.
🎯 Usage
Once installed, run:
npx eletract <project-name>Example:
npx eletract my-electron-appTo create a TypeScript project:
npx eletract my-electron-app --template typescriptThen navigate into the project directory and start the development environment:
cd my-electron-app
npm run devThis command will launch both the React development server and Electron.
🛠 Commands
eletract --help
Displays help information with all available commands and options.
eletract <project-name>
Creates a new React + Electron project inside a folder with the specified name.
eletract <project-name> --template typescript
Creates a new project using TypeScript instead of JavaScript.
📂 Project Structure
After running eletract, your project will have the following structure:
my-electron-app/
├── node_modules/
├── public/
├── src/
│ ├── App.tsx (or App.js for JavaScript projects)
│ ├── index.tsx (or index.js for JavaScript projects)
│ ├── styles.css
├── electron/
│ ├── electron.js (Main Electron process)
├── package.json
├── tsconfig.json (only for TypeScript projects)
├── README.md⚙️ Configuration
Your package.json will be automatically configured with the following scripts:
"scripts": {
"start": "react-scripts start",
"electron": "electron .",
"dev": "concurrently \"npm start\" \"wait-on http://localhost:3000 && npm run electron\""
}This allows you to:
- Start the React development server:
npm start - Start Electron separately:
npm run electron - Run both together:
npm run dev
🤝 Contributing
We welcome contributions! If you'd like to improve Eletract, please fork the repository and submit a pull request. Before submitting, ensure that your changes follow the coding and documentation standards.
- Fork the repository
- Create a new branch for your feature or bug fix
- Implement your changes and ensure tests are passing
- Open a pull request with a description of your changes
📜 License
This project is licensed under the MIT License.
👤 Author
Developed by Tommaso Bertocchi (alias JustSouichi).
