Skip to content
Build cross platform desktop apps with electron, typescript, react and much more powerful tools with scalable configurations.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
generators/app
.editorconfig Clean repo Apr 4, 2019
.gitignore
.prettierrc Add .prettierrc Apr 10, 2019
LICENSE Clean repo Apr 4, 2019
README.md Update README Apr 24, 2019
package.json 1.1.3 May 6, 2019
yarn.lock

README.md

Yo electron-typescript-react

David npm npm NPM

(electron-typescript-react-boilerplate)

Build cross platform desktop apps with electron, typescript, react and much more powerful tools with scalable configurations.

generator-electron-typescript-react use Create React App (CRA) as basic, built on the top of it.

Install the Generator

npm i -g yo generator-electron-typescript-react

Run

yo electron-typescript-react

Getting Started

After yo electron-typescript-react, you will see:

---------------------------------------------------

     _-----_     ╭──────────────────────────╮
    |       |    │      Welcome to the      │
    |--(o)--|    │ electron-typescript-reac │
   `---------´   │       t generator!       │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

---------------------------------------------------

? Type your app's name (etr-app)

Set your app's name and type Enter:

---------------------------------------------------

     _-----_     ╭──────────────────────────╮
    |       |    │      Welcome to the      │
    |--(o)--|    │ electron-typescript-reac │
   `---------´   │       t generator!       │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

---------------------------------------------------

? Type your app's name test
? Select a framework to use or not (Use arrow keys)
❯ redux
  mobx
  none

Select a framework, in this example, select redux and type Enter:

If select none, the generator won't change the origin files generated by CRA.

---------------------------------------------------

     _-----_     ╭──────────────────────────╮
    |       |    │      Welcome to the      │
    |--(o)--|    │ electron-typescript-reac │
   `---------´   │       t generator!       │
    ( _´U`_ )    ╰──────────────────────────╯
    /___A___\   /
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

---------------------------------------------------

? Type your app's name test
? Select a framework to use or not redux
? Auto install dependencies by generator? (Y/n)

Tell generator whether to install dependencies, if not, you have to run npm i or yarn after generator finished. In this example, type Enter as Yes.

Then you have to apply overwriting by hand after Create React App finished:

Creating a new React app in /Users/g1eny0ung/demo/test.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

...

---------------------------------------------------
🚀 Running generator...
---------------------------------------------------

...

You need to confirm some overwriting.

 conflict test/src/App.tsx
? Overwrite test/src/App.tsx? (ynaxdH)

Type y and Enter, if you don't want to confirm it many times, type a to overwrite all.

Then waiting dependencies installed.

At last, generator will run git commit to apply all changes:

---------------------------------------------------
Running git commit by generator.
---------------------------------------------------

[master ...] Enhanced by electron-typescript-react generator
...

---------------------------------------------------
All Done. Enjoy coding.~ 🎉🎉
---------------------------------------------------

Use it

If you won't use it with electron, just run:

// npm start
yarn start

All operations are as same as Create React App.

Otherwise, after run yarn start, open a new terminal window, run:

// npm run start:electron
yarn start:electron

All Done Done.~ Enjoy coding.~ 🎉🎉

Release

chmod +x build.sh
./build.sh

Frameworks

Current, generator-electron-typescript-react has these frameworks:

How to contribute

Pull a request or open an issue to describe your changes or problems

License

MIT © g1eny0ung

You can’t perform that action at this time.