1.0.0 • Published 5 months ago

eletract v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

eletract

License: MIT GitHub issues GitHub stars Downloads


šŸ“¦ Installation

Install Eletract globally using npm:

npm install -g eletract

You can create a new project using:

npx eletract projectname

To 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 working electron.js entry file.


šŸŽÆ Usage

Once installed, run:

npx eletract <project-name>

Example:

npx eletract my-electron-app

To create a TypeScript project:

npx eletract my-electron-app --template typescript

Then navigate into the project directory and start the development environment:

cd my-electron-app
npm run dev

This 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.

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Implement your changes and ensure tests are passing
  4. 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).