Skip to content

Commit 611e138

Browse files
committed
Merge branch 'release/3.0.0'
2 parents 1a853ca + 69a93b3 commit 611e138

11 files changed

+6215
-5400
lines changed

.eslintrc

+58-21
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,73 @@
11
{
2+
"root": true,
23
"env": {
34
"browser": true,
45
"node": true
56
},
6-
"extends": "airbnb",
7+
"extends": [
8+
"airbnb",
9+
"airbnb/hooks"
10+
],
711
"rules": {
8-
"no-unused-vars": "warn",
9-
"max-len": [
10-
"error",
11-
{
12-
"ignoreUrls": true
13-
}
14-
],
1512
"import/no-extraneous-dependencies": [
1613
"error",
1714
{
1815
"devDependencies": [
19-
"webpack.*.js",
20-
"test/**/*.js"
16+
"**/webpack.*",
17+
"test/**/*"
2118
]
2219
}
2320
],
24-
"sort-imports": 2,
25-
"import/prefer-default-export": 0,
26-
"import/no-default-export": 2,
27-
"import/no-named-default": 0,
28-
"react/jsx-no-bind": false
21+
"max-len": [
22+
"warn",
23+
{
24+
"ignoreUrls": true
25+
}
26+
],
27+
"sort-imports": "warn"
2928
},
30-
"plugins": [
31-
"import"
32-
],
3329
"settings": {
34-
"import/resolver": "webpack"
35-
}
36-
}
30+
"import/resolver": {
31+
"node": {
32+
"extensions": [
33+
".js",
34+
".jsx",
35+
".ts",
36+
".tsx"
37+
]
38+
},
39+
"webpack": {
40+
"config": "./webpack.config.js"
41+
}
42+
}
43+
},
44+
"overrides": [
45+
{
46+
"files": [
47+
"**/*.ts",
48+
"**/*.tsx"
49+
],
50+
"parser": "@typescript-eslint/parser",
51+
"parserOptions": {
52+
"project": "./tsconfig.json"
53+
},
54+
"plugins": [
55+
"@typescript-eslint"
56+
],
57+
"extends": [
58+
"plugin:@typescript-eslint/eslint-recommended",
59+
"plugin:@typescript-eslint/recommended",
60+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
61+
],
62+
"rules": {
63+
// This rule is already covered by the TypeScript compiler.
64+
"import/default": "off",
65+
// This rule is already covered by the TypeScript compiler.
66+
"import/no-unresolved": "off",
67+
"no-use-before-define": "off",
68+
"@typescript-eslint/no-use-before-define": "warn",
69+
"react/jsx-filename-extension": "off"
70+
}
71+
}
72+
]
73+
}

.github/FUNDING.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [iamWing]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: ['https://paypal.me/iamWing0w0']

CHANGELOG.md

+72-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,75 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [3.0.0] - 2020-12-26
10+
### Added
11+
- NPM packages `react-router` & `react-router-dom` to package dependencies.
12+
- NPM package `eslint-plugin-react-hooks` to `devDependencies` as required by
13+
the updated version of `eslint-config-airbnb`.
14+
- NPM package `copy-webpack-plugin` to `devDependencies` as replacement of
15+
`copy-pkg-json-webpack-plugin`.
16+
- NPM packages `@typescript-eslint/eslint-plugin` & `@typescript-eslint/parser`
17+
to `devDependencies` for using ESLint to lint TypeScript.
18+
19+
### Changed
20+
- __Project is now being developed based on Node.js `v14 (LTS)`.__
21+
- Minor version upgrades on package dependencies:
22+
- `eslint-import-resolver-webpack` - `0.11.1` -> `0.13.0`
23+
- `eslint-plugin-import` - `2.18.2` -> `2.22.1`
24+
- `eslint-plugin-jsx-a11y` - `6.2.3` -> `6.4.1`
25+
- `eslint-plugin-react` - `7.17.0` -> ``7.21.5`
26+
- `lodash` - `4.17.15` -> `4.17.20`
27+
- Major version upgrades on package dependencies:
28+
- `react` & `react-dom` - `16.12.0` -> `17.0.1`
29+
- `cross-env` - `5.2.1` -> `7.0.3`
30+
- `css-loader` - `1.0.1` -> `5.0.1`
31+
- `electron` - `3.1.13` -> `11.1.1`
32+
- `electron-builder` - `20.44.4` -> `22.9.1`
33+
- `eslint` - `5.16.0` -> `7.16.0`
34+
- `eslint-config-airbnb` - `17.1.1` -> `18.2.1`
35+
- `file-loader` - `2.0.0` -> `6.2.0`
36+
- `html-webpack-plugin` - `3.2.0` -> `4.5.0`
37+
- `mocha` - `5.2.0` -> `8.2.1`
38+
- `rimraf` - `2.7.1` -> `3.0.2`
39+
- `source-map-loader` - `0.2.4` -> `2.0.0`
40+
- `spectron` - `5.0.0` -> `13.0.0`
41+
- `style-loader` - `0.23.1` -> `2.0.0`
42+
- `ts-loader` - `5.4.5` -> `8.0.12`
43+
- `ts-node` - `7.0.1` -> `9.1.1`
44+
- `typescript` - `3.7.2` - > `4.1.3`
45+
- `webpack` - `4.41.2` -> `5.11.0`
46+
- `webpack-cli` - `3.3.10` -> `4.3.0`
47+
- Moved `@types` packages from `dependencies` to `devDependencies` as those
48+
have no need to be included in production builds.
49+
- Commands of NPM scripts `dev` & `prod` to make them work with Webpack 5.
50+
- Migrated to ESLint from TSLint.
51+
- Updated prefix of internal paths from `@` to `_` to avoid confusions with
52+
scoped NPM packages.
53+
- Indentation for `.ts` files is now set as `2` spaces instead of `4`.
54+
- `electron-builder` settings:
55+
- `win`:
56+
- Enabled `asar`. _(turn it off if the executable built doesn't work)_
57+
- Disabled one click installer.
58+
- Allowed custom installation directory in the installer built.
59+
- `mac`:
60+
- Changed build target back to `dmg`.
61+
- `buildVersion` is now being used as build number instead of just another
62+
parameter for semantic version number.
63+
- Updated section `Known issues` in `README`.
64+
65+
### Fixed
66+
- ESLint errors/warnings on `main.ts` & `renderer.tsx`.
67+
- `electron-builder` fails to build `dmg` on `macOS` (issue
68+
[electron-builder #3990])by upgrading the package version to `> 21.2.0`.
69+
70+
### Removed
71+
- NPM package `copy-pkg-json-webpack-plugin` as it doesn't work with Webpack 5
72+
and seems not very well maintained.
73+
- NPM packages `acorn` & `ajv` from `devDependencies` as they're not being used
74+
in this boilerplate.
75+
- NPM packages `tslint` & `tslint-microsoft-contrib` as TSLint is now
76+
deprecated.
77+
978
## [2.0.2] - 2019-12-02
1079
`v2.0.2` is a minor hotfix release fixed the documentation error and build
1180
error on `macOS Catalina(10.15+)`.
@@ -87,8 +156,10 @@ issue.
87156
isn't based on this boilerplate.
88157
- Separated Webpack config files for `development` & `production` mode.
89158

90-
[Unreleased]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/compare/v2.0.2...HEAD
159+
[Unreleased]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/compare/v3.0.0...HEAD
91160
[2.0.1]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/compare/v2.0.0...v2.0.1
92161
[2.0.2]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/compare/v2.0.1...v2.0.2
162+
[3.0.0]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/compare/v2.0.2...v3.0.0
93163

94164
[Issue #2]: https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/issues/2
165+
[electron-builder #3990]: https://github.com/electron-userland/electron-builder/issues/3990

README.md

+36-21
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Electron-React-TypeScript-Webpack-Boilerplate
22
Pre-configured Electron.js + React.js + TypeScript boilerplate with
3-
Webpack v4 & linters config predefined.
3+
Webpack v5 & linters config predefined.
44

55
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).
6+
work, please [file an issue](https://github.com/Devtography/electron-react-typescript-webpack-boilerplate/issues/new).
77

88
## Getting started
99
```sh
@@ -20,7 +20,7 @@ git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
2020
"build": {
2121
"appId": your-app-id,
2222
"productName": your-product-name,
23-
"buildVersion": whatever-you-like
23+
"buildVersion": your-build-number
2424
},
2525
"author": who's-the-author?,
2626
"license": if-you-don't-want-to-use-MIT,
@@ -34,7 +34,7 @@ git clone https://github.com/iamWing/electron-react-typescript-base-proj.git
3434
Then install all the `node_modules` needed by executing the following command:
3535
```sh
3636
cd folder-containing-the-cloned-boilerplate
37-
npm install
37+
npm install --also-dev
3838
```
3939

4040
Finally execute the following command to start Webpack in development mode and
@@ -55,17 +55,19 @@ your app for macOS & Windows using `electron-builder`.
5555

5656
For macOS, execute:
5757
```sh
58+
npm run prod
5859
npm run build:mac
5960
```
6061

6162
For Windows, execute:
6263
```sh
64+
npm run prod
6365
npm run build:win
6466
```
65-
_** `asar` archiving is disabled by default in Windows build as it can cause
66-
errors while running the installed Electron app based on pervious experiences,
67-
whereas the macOS build with `asar` enabled works just fine. You can turn it
68-
back on by removing line 23 (`"asar": false`) in `package.json`. **_
67+
_**`asar` archiving may cause errors while running the installed Electron app
68+
based on pervious experiences, whereas the macOS build with `asar` enabled
69+
works just fine. You can turn it off by changing `asar` to `false` in
70+
`package.json` line 26.**_
6971

7072
### Extra options
7173
The build scripts are pre-configured to build 64 bit installers since 64 bit
@@ -93,17 +95,22 @@ build scripts in `package.json`, but those aren't tested yet. For details,
9395
please refer to [documents of `electron-builder`](https://www.electron.build/cli).
9496

9597
## Known issues
96-
97-
- `dmg` build action on `macOS Catalina (10.15)` fails due to Apple ditches
98-
support for 32-bit apps from `10.15` onwards (Don't worry, you are still
99-
building 64-bit apps, just some dependencies of the builder are still 32-bit).
100-
Further details retailed to this issue can be found
101-
[here](https://github.com/electron-userland/electron-builder/issues/3990).
102-
Application installer built on `macOS` is now set to build `pkg` file
103-
instead of `dmg` as a workaround in the current version. The issue can be
104-
fixed by applying a major version upgrade of `electron-builder` to `21.2.0+`
105-
but it hasn't been tested on this boilerplate yet. This issue is planned to
106-
be addressed alongside with major version upgrades on other dependencies.
98+
1. As Apple introduced the [notarization requirements] with the public release
99+
of `macOS 10.14.5`, apps built for `macOS` are now needed to be signed with
100+
a valid Developer ID certificate and let Apple notarizes it for you. This
101+
boilerplate doesn't include the notarization setup as of the `3.0.0` release,
102+
but up until now, you should still be able to run your Electron app by
103+
allowing your app to be opened in `System Preferences -> Security & Privacy
104+
-> General` without notarizing it for still (tested on `macOS 11.1`).
105+
106+
If you want to notarization your app using this boilerplate before those
107+
settings are included in the future updates, you can try follow the guides on
108+
issue [electron-builder #3870].
109+
110+
2. [`[email protected]`] added Apple Silicon and universal binary
111+
supports, but it's still a pre-release instead of a stable one so the one
112+
included in this boilerplate is still staying on `22.9.1` which doesn't
113+
support building the universal binary yet.
107114

108115
## Folder structure
109116
```
@@ -127,14 +134,22 @@ electron-react-typescript-base-proj/
127134
| - package-lock.json
128135
| - package.json
129136
| - tsconfig.json //- TypeScript config
130-
| - tslint.json //- TSLint config
131137
| - webpack.config.js //- Webpack config
132138
```
133139

134140
## Author
135-
136141
[Wing Chau](https://github.com/iamWing) [@Devtography](https://github.com/Devtography)
137142

143+
## Donation
144+
I do this open source work for free in my free time. If you'd like me to invest
145+
more time on it, please consider give me some [donations]. Any donation is
146+
gonna be a great motivation for me.
147+
138148
## License
139149
Electron React TypeScript Webpack Boilerplate is open source software
140150
[licensed as MIT](LICENSE).
151+
152+
[notarization requirements]: https://developer.apple.com/news/?id=04102019a
153+
[electron-builder #3870]: https://github.com/electron-userland/electron-builder/issues/3870
154+
[`[email protected]`]: https://github.com/electron-userland/electron-builder/releases/tag/v22.10.4
155+
[donations]: https://github.com/sponsors/iamWing

0 commit comments

Comments
 (0)