Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Minimal starter kit: monorepo with βš›οΈβ€Š Create-React-App + πŸ‰ Lerna + :electron: Electron

License

Notifications You must be signed in to change notification settings

amaury1093/cra-lerna-electron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

cra-lerna-electron

Minimal starter kit: βš›οΈβ€Šcreate-react-app + πŸ‰ Lerna + :electron: Electron

Getting Started

# Fetch this repo
git clone https://github.com/amaurym/cra-lerna-electron my-app
cd my-app

# Bootstrap the Lerna project, will install all modules
yarn install

Folder structure

The main idea of this starer kit is to separate the Electron and React parts.

.
β”œβ”€β”€ lerna.json                    # Config for Lerna
β”œβ”€β”€ package.json                  # Package.json for the whole repo
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ crale-electron/
β”‚   β”‚   β”œβ”€β”€ electron-builder.json # Config for electron-build
β”‚   β”‚   β”œβ”€β”€ electron-webpack.json # Config for electron-webpack
β”‚   β”‚   β”œβ”€β”€ dist/                 # Binaries bundles by electron-builder
β”‚   β”‚   β”œβ”€β”€ package.json
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ main/             # Your electron app goes here
β”‚   β”‚   β”œβ”€β”€ static/               # Symlinks to ../crale-react/build/ folder
β”‚   β”œβ”€β”€ crale-react
β”‚   β”‚   β”œβ”€β”€ build/                # The built app generated by CRA
β”‚   β”‚   β”œβ”€β”€ package.json
β”‚   β”‚   β”œβ”€β”€ src/                  # Your react app goes here

Available Commands

All these commands should be run from the project root.

Command Description
yarn start Run Electron and React in dev mode, with live reload on file changes. Allows fast iterations.
yarn build Build Electron and React.
yarn electron Build Electron and React, and open Electron with these built files.
yarn package Build Electron and React, and generate binaries with these built files.
yarn lint Check for linting issues in the code.
yarn test Run tests.

For the exhaustive list of available commands, check package.json.

Tooling

Tool Description
create-react-app All tooling needed for React apps.
lerna Manage JavaScript projects with multiple packages.
electron-webpack Scripts and configurations to compile Electron applications using webpack.
electron-builder A complete solution to package and build a ready for distribution Electron app.

License

MIT.

About

Minimal starter kit: monorepo with βš›οΈβ€Š Create-React-App + πŸ‰ Lerna + :electron: Electron

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published