NWJS_Hour_Tracking/README.md

90 lines
3.3 KiB
Markdown
Raw Normal View History

2019-07-07 14:05:28 -06:00
# nw-vue-cli-example
2019-07-08 07:32:03 -06:00
2019-10-29 11:04:16 -06:00
[![Build Status](https://travis-ci.org/nwutils/nw-vue-cli-example.svg?branch=master)](https://travis-ci.org/nwutils/nw-vue-cli-example)
2019-10-29 11:12:00 -06:00
NW.js + Vue-CLI 4 example
2019-07-08 07:32:03 -06:00
![A screenshot of the default app running on Windows](screenshot.png)
2019-07-10 07:23:48 -06:00
* NW.js
2019-10-29 11:12:00 -06:00
* Vue-CLI 4
2019-11-07 06:36:21 -07:00
* Vue 2.6
2019-10-29 11:12:00 -06:00
* Vue-DevTools (latest)
2019-07-08 07:32:03 -06:00
* Babel
* ESLint
2019-12-26 21:37:29 -07:00
* Vue Linting
* A11Y Linting
* Jest Linting
2019-09-17 04:22:06 -06:00
* Jest (100% test coverage)
2019-07-08 07:32:03 -06:00
2019-11-07 06:36:21 -07:00
*Why not include Vue-Router or Vuex?*
2019-12-26 21:37:29 -07:00
Those are both very easily added from the Vue-CLI. There is also no custom styling libraries (Bulma, Bootstrap, etc), or meta-languages (Sass, TS, Pug, etc), or component libraries (Vuetify, Inkline, etc). This repo is meant to be the "go to" option for building all desktop apps with Vue. So it avoids pushing any particular choices on to you. With the exception of testing being set up for Jest, and Linting being set up to ensure minumum quality of this boilerplate repo itself. Both of which can be easily modified, ignored, or removed.
2019-11-07 06:36:21 -07:00
2019-07-08 07:32:03 -06:00
## Running Locally for development
1. `npm install`
1. `npm start`
2019-12-26 21:37:29 -07:00
1. Once Webpack finishes starting up your app will appear in a window
2019-07-08 07:32:03 -06:00
## Building for distribution
1. `npm run build:clean` will delete your `./dist` and `./dist-vue` folders
1. `npm run build:vue` will build just your Vue app for distribution (`./dist-vue`)
1. `npm run build:nw` will build just your NW.js app (`./dist`)
1. `npm run build` is your all-in-one command. It will clean out the old dist folders and build your Vue and NW.js app
# **IMPORTANT NOTE ABOUT BUILDS!!!**
2019-11-07 06:36:21 -07:00
They take a long time. If you do `npm run build` expect it to take 10-30 minutes. This can be adjusted by changing the build params in the `package.json`. The more platforms and build types, the longer it takes. You can also remove the `--concurrent` from the `build:nw` script to see a status of what has been completed. This will allow individual pieces to finish faster, but the entire build will take longer.
2019-07-08 07:32:03 -06:00
## Automated quality enforcment
1. **Linting:** `npm run lint` - Uses rules in `./eslint.json`
1. **Unit tests:** `npm run test:unit` - [Jest](https://jestjs.io).
1. **End-to-end:** `npm run test:e2e` - Accepting PR to make tests run in NW.js. - [Nightwatch](https://nightwatchjs.org).
### Customize configuration
2019-07-10 07:23:48 -06:00
Want Vue-Router? Vuex? Use the Vue-CLI to add them:
* [Vue-CLI documentation](https://cli.vuejs.org/config).
2019-08-26 09:10:12 -06:00
2019-09-16 07:09:45 -06:00
2019-08-26 09:10:12 -06:00
* * *
2019-09-16 07:09:45 -06:00
2019-11-07 06:36:21 -07:00
## Updating Vue-DevTools
To update your version of Vue-DevTools run `npm run update:vue-devtools`.
This will download the source code for the latest version of Vue-DevTools and do a custom build for NW.js. This ensures you always have the latest version.
* * *
2019-08-26 09:10:12 -06:00
## Alternatives
* [nwjs-vue](https://github.com/elegantweb/nwjs-vue) - Uses Vue-CLI 2
* [vue-desktop-basic](https://github.com/TheJaredWilcurt/vue-desktop-basic) - Does not use a build system at all, all `.vue` files run directly in the browser context
2019-09-16 07:09:45 -06:00
* * *
## Maintainence of this repo
This is not for those *using* this repo, but for those *maintaining* it.
1. When updating the version of NW.js devDependency, also update these:
2019-11-07 06:42:26 -07:00
* `tests/unit/setup.js`
* `tests/unit/components/__snapshots__/HelloWorld.test.js.snap`
* `.browserslistrc`
2019-09-16 07:09:45 -06:00
1. Run `npm run regression` after updating dependencies or other major changes to verify builds still work correctly