Code Monkey home page Code Monkey logo

template-electron-vuex-vuetify's Introduction

template-electron-vuex-vuetify

build_status Coverage Status github license github issues github last commit github repo size Gitter Gitter

Overview

This template should help get you started developing Electron app using Vue 3, Vite, Vuex and Vuetify, and friends.

Main Window

Run Setup

# clone the project
git clone https://github.com/governance-foundation/template-electron-vuex-vuetify.git

# enter the project directory
cd template-electron-vuex-vuetify

# install dependency
npm install

# develop
npm run electron:dev

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

NOTE: this does not work yet, feel free to contribute.

npm run test:unit

Run End-to-End Tests with Cypress

npm run build
npm run test:e2e # or `npm run test:e2e:ci` for headless testing

Lint with ESLint

npm run lint

Electron Dev

Run development server and electron UI.

npm run electron:dev

Build Electron Dist

Compile installable Electron packages.

npm run app:build

Add Githooks

npx simple-git-hooks

Customize configuration

Pipelines

Following pipleines exist for compiling code as its commited

  • Build Branche (build.yml) - Build and Test all branches and create releases.

Releasing

When you want to create a new release, follow these steps:

  1. Update the project version npm verison 2022.03.24 this will update the package.json and relevant commit.
  2. If commit was not created, commit and sign that change (git commit -s -a -m "chore: release 2022.02.20")
  3. Tag and sign your commit (git tag -s -a 2022.02.20 -m "2022.02.20"). Make sure your tag name's format is {YYYY}.{MM}.{DD}. Your workflow will use this tag to detect when to create a release
  4. Push your changes to GitHub (git push && git push --tags)

Pull Request

When committing code please ensure that you add your commits to dedicated feature branch, name your branch feature/#<issue id>-name-of-issue. When creating a PR please add default reviewers to your PR. Set title of your PR as #<issue id> Title of issue. When interacting with reviews on your PR please resolve conversartions that you have fixed, and re-request reviews after you have pushed updates to your branch.

App Generation

To generate this app from sratch run the following:

Part 1 - Automated

  • Install Vue globally - npm install -g @vue/cli
  • Create Vue App vue create template-electron-vuex-vuetify
    • Please pick a preset:
      • Manually select features
    • Features (All Yes)
    • Babel
      • TypeScript
      • Progressive Web App (PWA) Support
      • Router
      • Vuex
      • CSS Pre-processors
      • Linter / Formatter
      • Unit Testing
      • E2E Testing
    • Use class-style component syntax?
      • Yes
    • Use Babel alongside TypeScript?
      • Yes
    • Use history mode for router?
      • Yes
    • Pick a CSS pre-processor:
      • Sass/SCSS (with dart-sass)
    • Pick a linter / formatter config:
      • ESLint + Prettier
  • Pick additional lint features: * Lint on save
    • Pick a unit testing solution:
      • Jest
    • Pick an E2E testing solution: Cypress
    • Where do you prefer placing config:
      • In dedicated config files
  • Add Vuetify UI framework vue add vuetify
    • use Default

Part 2 - Manual steps

  • Remove Jest, will be replaced by Vitest
    • remove test folder
    • remove dependencies
npm remove @types/jest jest ts-jest @vue/vue3-jest @vue/cli-plugin-unit-jest babel-jest @vue/cli-plugin-babel
  • Create Vite template for copying Vite config

    • create blank vite-vue app npm create vite@latest my-vue-app -- --template vue
    • copy accross folders cypress and .vscode
    • copy acresss all the conig files
  • Add Electron, Vitest and Vite

npm install vitest vue-tsc jsdom start-server-and-test @types/jsdom @types/node @vue/tsconfig @rushstack/eslint-patch @vitejs/plugin-vue concurrently cross-env electron electron-builder wait-on @types/electron-devtools-installer vite --save-dev

template-electron-vuex-vuetify's People

Contributors

ankitvats avatar dependabot[bot] avatar rahul139-stack avatar wildone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

template-electron-vuex-vuetify's Issues

I'm not available to run a builded file

Hi, Fist I tried to build the file with:

npm run app:build

and I had this problem

ENOENT. spawn /usr/bin/python

So I updated

"electron-builder": "^23.0.3"

In the package.json. After that finally I was available to compile but now looks like the files are not running on electron, but I unpackaged the assar app to check that the files were packaged and In fact everything is the but's not working?

I'm using OSX 12.4 M1 Max but I also tried on Windows without success.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.