-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c9c0399
Showing
38 changed files
with
18,505 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"airbnb", | ||
"eslint:recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"plugin:import/electron", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"prettier/react", | ||
"prettier/@typescript-eslint" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"prettier", | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"global-require": 0, | ||
"import/prefer-default-export": 0, | ||
"import/no-useless-path-segments": 1, | ||
"import/no-unresolved": 0, | ||
"import/no-extraneous-dependencies": 0, | ||
"import/no-named-as-default": 0, | ||
"import/newline-after-import": 1, | ||
"import/no-named-as-default-member": 0, | ||
"import/namespace": 0, | ||
"import/extensions": 0, | ||
"import/named": 0, | ||
"react/jsx-wrap-multilines": [ | ||
2, | ||
{ | ||
"declaration": "parens-new-line", | ||
"assignment": "parens-new-line", | ||
"return": "parens-new-line", | ||
"arrow": "ignore", | ||
"condition": "ignore", | ||
"logical": "ignore", | ||
"prop": "ignore" | ||
} | ||
], | ||
"react/jsx-filename-extension": 0, | ||
"react/jsx-indent": 0, | ||
"react/jsx-boolean-value": 0, | ||
"react/jsx-closing-tag-location": 0, | ||
"react/jsx-closing-bracket-location": [ | ||
2, | ||
{ | ||
"selfClosing": "props-aligned", | ||
"nonEmpty": "after-props" | ||
} | ||
], | ||
"react/prop-types": 0, | ||
"react/button-has-type": 0, | ||
"react/jsx-tag-spacing": [ | ||
2, | ||
{ | ||
"beforeSelfClosing": "always" | ||
} | ||
], | ||
"react/jsx-one-expression-per-line": 0, | ||
"react/jsx-curly-spacing": 0, | ||
"react/no-access-state-in-setstate": 0, | ||
"react/destructuring-assignment": 0, | ||
"react/jsx-no-bind": 0, | ||
"react/require-default-props": 0, | ||
"react/display-name": 0, | ||
"react/jsx-first-prop-new-line": 0, | ||
"react/jsx-props-no-spreading": 0, | ||
"react/static-property-placement": 0, | ||
"react/state-in-constructor": 0, | ||
"@typescript-eslint/no-var-requires": 0, | ||
"@typescript-eslint/indent": 0, | ||
"@typescript-eslint/camelcase": 0, | ||
"@typescript-eslint/explicit-function-return-type": 0, | ||
"@typescript-eslint/no-non-null-assertion": 0, | ||
"@typescript-eslint/no-use-before-define": 0, | ||
"@typescript-eslint/member-delimiter-style": 0, | ||
"@typescript-eslint/no-unused-vars": 0, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/explicit-member-accessibility": 0, | ||
"@typescript-eslint/no-angle-bracket-type-assertion": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
dist/ | ||
release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"printWidth": 100, | ||
"tabWidth": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"program": "${workspaceFolder}/dist/main.js" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018-present R. Franken | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# electron-react-typescript | ||
|
||
### A Boilerplate for an Easy Start with TypeScript, React, and Electron. | ||
|
||
[![React](docs/img/react.png)](https://reactjs.org/) | ||
[![Webpack](docs/img/webpack.png)](https://webpack.js.org/) | ||
[![TypeScript](docs/img/ts.png)](https://www.typescriptlang.org/) | ||
[![Electron](docs/img/electron.png)](https://electronjs.org/) | ||
[![Redux](docs/img/redux.png)](https://redux.js.org/) | ||
[![Jest](docs/img/jest.png)](https://facebook.github.io/jest/) | ||
|
||
[Electron](https://electronjs.org/) application boilerplate based on [React](https://reactjs.org/), [Redux](https://redux.js.org/), and [Webpack](https://webpack.js.org/) for rapid application development using [TypeScript](https://www.typescriptlang.org/). | ||
|
||
## Install | ||
Clone the repository with Git: | ||
|
||
```bash | ||
git clone --depth=1 [email protected]:Robinfr/electron-react-typescript.git <your-project-name> | ||
``` | ||
|
||
And then install the dependencies: | ||
|
||
```bash | ||
cd <your-project-name> | ||
npm install | ||
``` | ||
|
||
## Usage | ||
Both processes have to be started **simultaneously** in different console tabs: | ||
|
||
```bash | ||
npm run start-renderer-dev | ||
npm run start-main-dev | ||
``` | ||
|
||
This will start the application with hot-reload so you can instantly start developing your application. | ||
|
||
You can also run do the following to start both in a single process: | ||
|
||
```bash | ||
npm run start-dev | ||
``` | ||
|
||
## Packaging | ||
We use [Electron builder](https://www.electron.build/) to build and package the application. By default you can run the following to package for your current platform: | ||
|
||
```bash | ||
npm run dist | ||
``` | ||
|
||
This will create a installer for your platform in the `releases` folder. | ||
|
||
You can make builds for specific platforms (or multiple platforms) by using the options found [here](https://www.electron.build/cli). E.g. building for all platforms (Windows, Mac, Linux): | ||
|
||
```bash | ||
npm run dist -- -mwl | ||
``` | ||
|
||
## Husky and Prettier | ||
This project comes with both Husky and Prettier setup to ensure a consistent code style. | ||
|
||
To change the code style, you can change the configuration in `.prettierrc`. | ||
|
||
In case you want to get rid of this, you can removing the following from `package.json`: | ||
|
||
1. Remove `precommit` from the `scripts` section | ||
1. Remove the `lint-staged` section | ||
1. Remove `lint-staged`, `prettier`, `eslint-config-prettier`, and `husky` from the `devDependencies` | ||
|
||
Also remove all mentions of Prettier from the `extends` section in `.eslintrc.json`. | ||
|
||
## About this project | ||
This project was set up from scratch but is heavily influenced by the [Electron React Boilerplate project](https://github.com/chentsulin/electron-react-boilerplate) and [React Redux TypeScript guide](https://github.com/piotrwitek/react-redux-typescript-guide). | ||
|
||
## License | ||
MIT © [R. Franken](https://github.com/Robinfr) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'test-file-stub'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
Oops, something went wrong.