Skip to content

Commit

Permalink
v1.4.0 (#2647)
Browse files Browse the repository at this point in the history
* feat: rename dev script to start

* chore: improve devtools installer usage (#2600)

* Update babel monorepo

* Update dependency @fortawesome/fontawesome-free to ^5.15.0

* Replace the deprecated NamedModulesPlugin with the optimization.named… (#2614)

* fix: use electron-renderer target as default

* Replace the deprecated NamedModulesPlugin with the optimization.namedModules

Co-authored-by: Amila Welihinda <[email protected]>

* chore: create releases only on master push (#2626)

* chore: create release branches only on master push

* fix: temporarily disable e2e tests

* chore(deps): update babel monorepo

* chore(deps): update dependency @types/jest to ^26.0.15

* chore(deps): update dependency @teamsupercell/typings-for-css-modules-loader to ^2.4.0

* chore(deps): update dependency @types/react-dom to ^16.9.9

* chore: migrate to latest erb eslint config

* chore: update changelog

Co-authored-by: May <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Woonchan Cho <[email protected]>
  • Loading branch information
4 people committed Nov 7, 2020
1 parent fc53901 commit c26f548
Show file tree
Hide file tree
Showing 13 changed files with 723 additions and 582 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: 'erb/typescript',
extends: 'erb',
rules: {
// A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off',
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
push:
branches:
- master

jobs:
publish:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest]

steps:
- name: Check out Git repository
uses: actions/checkout@v1

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14

- name: yarn install
run: |
yarn install
- name: Publish Releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn package-ci
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn package-ci
yarn package
yarn lint
yarn tsc
yarn test
Expand All @@ -38,10 +38,9 @@ jobs:
Xvfb :99 &
disown -ar
echo "::set-env name=DISPLAY:::99"
# TODO: Testcafe e2e are broken because of:
# https://github.com/DevExpress/testcafe/issues/4512
# Tests are currently broken on linux and macos
- if: matrix.os == 'windows-latest'
run: |
yarn test-e2e
# - if: matrix.os == 'windows-latest'
# run: |
# yarn test-e2e
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.4.0

- Migrate to `eslint-config-erb@2`
- Rename `dev` npm script to `start`
- GitHub Actions: only publish GitHub releases when on master branch

# 1.3.1

- Fix sass building bug ([#2540](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2540))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ yarn
Start the app in the `dev` environment. This starts the renderer process in [**hot-module-replacement**](https://webpack.js.org/guides/hmr-react/) mode and starts a webpack dev server that sends hot updates to the renderer process:

```bash
yarn dev
yarn start
```

## Packaging for Production
Expand Down
9 changes: 6 additions & 3 deletions app/main.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ const installExtensions = async () => {
const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'];

return Promise.all(
extensions.map((name) => installer.default(installer[name], forceDownload))
).catch(console.log);
return installer
.default(
extensions.map((name) => installer[name]),
forceDownload
)
.catch(console.log);
};

const createWindow = async () => {
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "electron-react-boilerplate",
"productName": "electron-react-boilerplate",
"version": "1.3.1",
"version": "1.4.0",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"main": "./main.prod.js",
"author": {
Expand Down
5 changes: 4 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

const developmentEnvironments = ['development', 'test'];

const developmentPlugins = [require('react-hot-loader/babel')];
const developmentPlugins = [
require('react-hot-loader/babel'),
require('@babel/plugin-transform-runtime'),
];

const productionPlugins = [
require('babel-plugin-dev-expression'),
Expand Down
6 changes: 4 additions & 2 deletions configs/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ export default {
modules: [path.join(__dirname, '..', 'app'), 'node_modules'],
},

optimization: {
namedModules: true,
},

plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
}),

new webpack.NamedModulesPlugin(),
],
};
5 changes: 4 additions & 1 deletion configs/webpack.config.renderer.prod.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export default merge(baseConfig, {

mode: 'production',

target: process.env.E2E_BUILD || process.env.ERB_SECURE !== 'true' ? 'electron-renderer' : 'electron-preload',
target:
process.env.E2E_BUILD || process.env.ERB_SECURE !== 'true'
? 'electron-renderer'
: 'electron-preload',

entry: [
'core-js',
Expand Down
2 changes: 1 addition & 1 deletion internals/scripts/CheckPortInUse.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ detectPort(port, (err, availablePort) => {
if (port !== String(availablePort)) {
throw new Error(
chalk.whiteBright.bgRed.bold(
`Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 yarn dev`
`Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 yarn start`
)
);
} else {
Expand Down
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"name": "electron-react-boilerplate",
"productName": "ElectronReact",
"version": "1.3.1",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"scripts": {
"build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",
"build-dll": "cross-env NODE_ENV=development webpack --config ./configs/webpack.config.renderer.dev.dll.babel.js --colors",
"build-e2e": "cross-env E2E_BUILD=true yarn build",
"build-main": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.babel.js --colors",
"build-renderer": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors",
"dev": "cross-env START_HOT=1 node -r @babel/register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=1 yarn start-renderer-dev",
"electron-rebuild": "electron-rebuild --parallel --force --types prod,dev,optional --module-dir app",
"lint": "cross-env NODE_ENV=development eslint . --cache --ext .js,.jsx,.ts,.tsx",
"lint-fix": "yarn --silent lint --fix; exit 0",
Expand All @@ -26,7 +24,8 @@
"postlint-styles-fix": "prettier --ignore-path .eslintignore --single-quote --write '**/*.{css,scss}'",
"preinstall": "node ./internals/scripts/CheckYarn.js",
"prestart": "yarn build",
"start": "cross-env NODE_ENV=production electron ./app/main.prod.js",
"start": "cross-env START_HOT=1 node -r @babel/register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=1 yarn start-renderer-dev",
"start:prod": "cross-env NODE_ENV=production electron ./app/main.prod.js",
"start-main-debug": "yarn start-main-dev --inspect=5858 --remote-debugging-port=9223",
"start-main-dev": "cross-env START_HOT=1 NODE_ENV=development electron -r ./internals/scripts/BabelRegister ./app/main.dev.ts",
"start-renderer-dev": "cross-env NODE_ENV=development webpack-dev-server --config configs/webpack.config.renderer.dev.babel.js",
Expand Down Expand Up @@ -170,37 +169,38 @@
},
"devDependencies": {
"@amilajack/testcafe-browser-provider-electron": "^0.0.15-alpha.1",
"@babel/core": "^7.11.5",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-decorators": "^7.10.5",
"@babel/plugin-proposal-do-expressions": "^7.10.4",
"@babel/plugin-proposal-export-default-from": "^7.10.4",
"@babel/plugin-proposal-export-namespace-from": "^7.10.4",
"@babel/plugin-proposal-function-bind": "^7.11.5",
"@babel/plugin-proposal-function-sent": "^7.10.4",
"@babel/plugin-proposal-json-strings": "^7.10.4",
"@babel/plugin-proposal-logical-assignment-operators": "^7.11.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
"@babel/plugin-proposal-numeric-separator": "^7.10.4",
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/plugin-proposal-pipeline-operator": "^7.10.5",
"@babel/plugin-proposal-throw-expressions": "^7.10.4",
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.1",
"@babel/plugin-proposal-do-expressions": "^7.12.1",
"@babel/plugin-proposal-export-default-from": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
"@babel/plugin-proposal-function-bind": "^7.12.1",
"@babel/plugin-proposal-function-sent": "^7.12.1",
"@babel/plugin-proposal-json-strings": "^7.12.1",
"@babel/plugin-proposal-logical-assignment-operators": "^7.12.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"@babel/plugin-proposal-numeric-separator": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/plugin-proposal-pipeline-operator": "^7.12.1",
"@babel/plugin-proposal-throw-expressions": "^7.12.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-react-constant-elements": "^7.10.4",
"@babel/plugin-transform-react-inline-elements": "^7.10.4",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@babel/register": "^7.10.5",
"@teamsupercell/typings-for-css-modules-loader": "^2.2.1",
"@babel/plugin-transform-react-constant-elements": "^7.12.1",
"@babel/plugin-transform-react-inline-elements": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@babel/register": "^7.12.1",
"@teamsupercell/typings-for-css-modules-loader": "^2.4.0",
"@types/enzyme": "^3.10.5",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/history": "^4.7.7",
"@types/jest": "^26.0.10",
"@types/jest": "^26.0.15",
"@types/node": "12",
"@types/react": "^16.9.44",
"@types/react-dom": "^16.9.8",
"@types/react-dom": "^16.9.9",
"@types/react-redux": "^7.1.9",
"@types/react-router": "^5.1.8",
"@types/react-router-dom": "^5.1.5",
Expand Down Expand Up @@ -232,7 +232,7 @@
"eslint": "^7.5.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-airbnb-typescript": "^9.0.0",
"eslint-config-erb": "^1.0.0",
"eslint-config-erb": "^2.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-import-resolver-webpack": "^0.12.2",
"eslint-plugin-compat": "^3.8.0",
Expand Down Expand Up @@ -275,7 +275,7 @@
"webpack-merge": "^5.0.9"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.14.0",
"@fortawesome/fontawesome-free": "^5.15.0",
"@hot-loader/react-dom": "^16.13.0",
"@reduxjs/toolkit": "^1.4.0",
"connected-react-router": "^6.6.1",
Expand Down
Loading

0 comments on commit c26f548

Please sign in to comment.