项目作者: amaurym

项目描述 :
Minimal starter kit: monorepo with ⚛️  Create-React-App + 🐉 Lerna + :electron: Electron
高级语言: TypeScript
项目地址: git://github.com/amaurym/cra-lerna-electron.git
创建时间: 2018-05-27T17:32:57Z
项目社区:https://github.com/amaurym/cra-lerna-electron

开源协议:MIT License

下载


cra-lerna-electron

Minimal starter kit: ⚛️ create-react-app + 🐉 Lerna + :electron: Electron

Getting Started

  1. # Fetch this repo
  2. git clone https://github.com/amaurym/cra-lerna-electron my-app
  3. cd my-app
  4. # Bootstrap the Lerna project, will install all modules
  5. yarn install

Folder structure

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

  1. .
  2. ├── lerna.json # Config for Lerna
  3. ├── package.json # Package.json for the whole repo
  4. ├── packages/
  5. ├── crale-electron/
  6. ├── electron-builder.json # Config for electron-build
  7. ├── electron-webpack.json # Config for electron-webpack
  8. ├── dist/ # Binaries bundles by electron-builder
  9. ├── package.json
  10. ├── src/
  11. ├── main/ # Your electron app goes here
  12. ├── static/ # Symlinks to ../crale-react/build/ folder
  13. ├── crale-react
  14. ├── build/ # The built app generated by CRA
  15. ├── package.json
  16. ├── 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.