Skip to content

Commit 5c50876

Browse files
committed
Finalise Docs for v2.0.0
- Updated README. - Updated CHANGELOG to reflect the newest changes in README.
1 parent 3c75c22 commit 5c50876

File tree

2 files changed

+73
-22
lines changed

2 files changed

+73
-22
lines changed

CHANGELOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9-
## 2.0.0 - 2018-02-03
10-
v2.0.0 is a major release that refactored the most part of the boilerplate.
9+
## 2.0.0 - 2018-02-04
10+
v2.0.0 is a major release that most part of the boilerplate has been rewritten.
1111

1212
### Added
1313
- ESLint for code checking on Javascript files.
@@ -21,17 +21,17 @@ v2.0.0 is a major release that refactored the most part of the boilerplate.
2121
file and pack into Webpack's bundled package for production.
2222
- Build commands `build:mac` & `build:win` to package & build the installer of
2323
your Electron app for macOS & Windows using `electron-builder`.
24-
- _`asar` archiving is disabled by default for Windows build as some code
25-
will not work properly if it's on (saying based on experience). Users can
26-
turn it back on by removing `asar: false` in `build` section of
27-
`package.json`._
24+
- README section "Building the installer for your Electron app" & sub-section
25+
"Extra options".
2826

2927
### Changed
3028
- Refactored Webpack config file to have `mainConfig` & `rendererConfig`
3129
cleaned up, and set mode by environment variable.
3230
- `.gitignore` to ignore folder `out/` which will be auto-generated during the
3331
build process.
34-
- README to refactor the changes made in `v2.0.0`.
32+
- README section "How does it work?" is now renamed to "Getting started" &
33+
completed the documentation of this section.
34+
- README section "Folder structure" to reflect the changes in `v2.0.0`.
3535

3636
### Fixed
3737
- CSS files fail to inject into views issue by setting Webpack to use

README.md

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# **Electron-React-TypeScript-Webpack-Boilerplate**
2-
1+
# Electron-React-TypeScript-Webpack-Boilerplate
32
Pre-configured Electron.js + React.js + TypeScript boilerplate with
43
Webpack v4 & linters config predefined.
54

6-
This boilerplate works on Mac, Windows, and Linux.
7-
If something doesn't work, please [file and issue](https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/issues/new).
5+
This boilerplate currently works on macOS and Windows. If something doesn't
6+
work, please [file and issue](https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/issues/new).
87

9-
## **How Does It Work?**
10-
```
8+
## Getting started
9+
```bash
1110
// execute
1211
git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
1312
```
1413

15-
```
14+
```json
1615
// edit the following fields in package.json for your own project
1716
{
1817
"name": {your-project-name},
@@ -22,19 +21,71 @@ git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
2221
"appId": {your-app-id},
2322
"productName": {your-product-name},
2423
"buildVersion": {whatever-you-like}
25-
}
24+
},
2625
"author": {who's-the-author?},
27-
"license": {if-you-don't-want-to-use-MIT}
26+
"license": {if-you-don't-want-to-use-MIT},
2827
"repository": {type-and-link-of-your-repo},
2928
"keywords": {keywords-of-your-project},
3029
"bugs": {issue-page-of-your-repo},
3130
"homepage": {homepage-of-your-repo}
3231
}
3332
```
3433

35-
Then execute `npm run dev` to start develop your app.
34+
Then install all the `node_modules` needed by executing the following command:
35+
```bash
36+
cd {folder-containing-the-cloned-boilerplate}
37+
npm run install
38+
```
39+
40+
Finally execute the following command to start Webpack in development mode and
41+
watch the changes on source files.
42+
```bash
43+
npm run dev
44+
```
45+
46+
## Building the installer for your Electron app
47+
The boilerplate is currently configured to package & build the installer of
48+
your app for macOS & Windows using `electron-builder`.
49+
50+
For macOS, execute:
51+
```bash
52+
npm run build:mac
53+
```
54+
55+
For Windows, execute:
56+
```bash
57+
npm run build:win
58+
```
59+
_** `asar` archiving is disabled by default in Windows build as it can cause
60+
errors while running the installed Electron app based on pervious experiences,
61+
whereas the macOS build with `asar` enabled works just fine. You can turn it
62+
back on by removing line 23 (`"asar": false`) in `package.json`. **_
63+
64+
### Extra options
65+
The build scripts are pre-configured to build 64 bit installers since 64 bit
66+
should be the standard for a modern applications. 32 bit builds are still
67+
possible by changing the build scripts in `package.json` as below:
68+
```json
69+
// from
70+
"scripts": {
71+
...
72+
"build:win": "electron-builder build --win --x64",
73+
"build:mac": "electron-builder build --mac --x64"
74+
},
3675

37-
## **Folder structure**
76+
// to
77+
"scripts": {
78+
...
79+
"build:win": "electron-builder build --win --ia32",
80+
"build:mac": "electron-builder build --mac --ia32"
81+
},
82+
```
83+
84+
Builds for Linux, armv71, and arm64 can also be configured by modifying the
85+
build scripts in `package.json`, but those aren't tested yet. For details,
86+
please refer to [documents of `electron-builder`](https://www.electron.build/cli).
87+
88+
## Folder structure
3889
```
3990
electron-react-typescript-base-proj/
4091
| - dist/ //- Generated by Webpack automatically
@@ -44,13 +95,14 @@ electron-react-typescript-base-proj/
4495
| | - index.html
4596
| | - style.css
4697
| - src/
47-
| | - main/ //- Electron / backend modules
98+
| | - main/ //- Backend modules for the Electron app
4899
| | | - main.ts //- Entry point of 'electron-main'
49100
| | - models/
50-
| | - renderer/ //- React / frontend components
101+
| | - renderer/ //- Frontend React components for the Electron app
51102
| | | - renderer.tsx //- Entry point of 'electron-renderer'
52103
| | - utils/ //- Common utilities
53104
| - test/ //- Unit tests
105+
| - .eslintrc //- ESLint config
54106
| - .gitignore
55107
| - package-lock.json
56108
| - package.json
@@ -59,7 +111,6 @@ electron-react-typescript-base-proj/
59111
| - webpack.config.js //- Webpack config
60112
```
61113

62-
## **License**
63-
114+
## License
64115
Electron React TypeScript Webpack Boilerplate is open source software
65116
[licensed as MIT](LICENSE).

0 commit comments

Comments
 (0)