Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
knguyen0125 committed Sep 29, 2018
1 parent 0c7e17e commit e078139
Show file tree
Hide file tree
Showing 25 changed files with 15,840 additions and 2,116 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = {
'no-multi-assign': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'strict': 0,
'lines-between-class-members': 0
'lines-between-class-members': 0,
'linebreak-style': 0,
'class-methods-use-this': 0,
'prefer-arrow-callback': 0
},
settings: {
'import/core-modules': [
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.DS_Store
dist/electron/*
dist/web/*
dist/*/*
build/*
!build/icons
node_modules/
npm-debug.log
npm-debug.log.*
thumbs.db
!.gitkeep
*.log
74 changes: 71 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,79 @@
# Electron Vue Template
# NFC-Electron Reader

Uses Electron-Webpack, Electron Builder, Babel 7 and Vue
Uses Electron-Webpack, Electron Builder, Babel 7 and Vue, internally powered by nfc-pcsc

# Yarn

- Electron Builder recommends using `Yarn` to build. When using Yarn, the lock file is used and guaranteed to download the correct version for the working build. There is no such guarantee for `npm`

- To install `yarn`:

```
npm install -g yarn
```

- Switching to `yarn`: Remove `node_modules/` folder and then run

```
yarn
```

- To build with `yarn`, run:

```
yarn build
```

## Build Process

- To build:

```
npm run build
or
yarn build
```

- Note: Currently, it does not clean previous builds before building. Most of the time it would be fine, but if it does not build, remove all files and folders inside `dist/` and `build/` folders. DO NOT REMOVE `build/icons/` folder.

### Special Note for Windows
- This reader programs rely on node native module, which means it need to be recompiled before it can run. In windows, it can be difficult to set up environment
- See [node-gyp](https://github.com/nodejs/node-gyp) for more details

- In Windows: `node-gyp` and `windows-build-tools` are required. In an ELEVATED PowerShell, run:

```
npm install -g node-gyp windows-build-tools
```

- After install, reboot
- Change directory and run:

```
npm install
npm run rebuild
```

or

```
yarn
yarn build
```

## Brief Explanation
- Main Process: Controls communication with NFC Device.
- Renderer Process: Reader/Writer Interface

- Communication between Main and Renderer process: Via Electron IPC. Read/Write/Write-Readonly permissions as well as messages are set through ipc messages
- Read [ipcRenderer](https://electronjs.org/docs/api/ipc-renderer) and [ipcMain](https://electronjs.org/docs/api/ipc-main)

## Known Issues

### Babel Plugins

Due to how `electron-webpack` creates `babel-loader` for `webpack`, some plugins cannot be configured if installed as devDependencies.

If you wishes to configure Babel plugins, install plugins as dependencies.
If you wishes to configure these Babel plugins, install plugins as dependencies.
Binary file added build/icons/icon.icns
Binary file not shown.
Binary file added build/icons/icon.ico
Binary file not shown.
Binary file added build/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added dist/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions dist/.renderer-index-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html>
<head>
<meta charset="utf-8">

<title>NFC Tools</title>
<script>
require("module").globalPaths.push("/home/kevin/Work/nfc-electron/node_modules")

require("source-map-support/source-map-support.js").install()
</script>

Expand Down
Loading

0 comments on commit e078139

Please sign in to comment.