GithubHelp home page GithubHelp logo

liaoshuhua / electron-vite-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuxuxu-ni/electron-vite-template

0.0 0.0 0.0 1.2 MB

electron-vite-template 主进程使用rollup,渲染进程使用 vite 编译的一个electron项目模板,适用于 vue, react 等任何框架. 可以打包成window, liunx, macOS 等系统的安装包,减少项目初期构建工作, 提高工作效率。

License: MIT License

Shell 0.01% JavaScript 96.87% TypeScript 1.89% CSS 0.08% HTML 0.61% Vue 0.54%

electron-vite-template's Introduction

electron-vite-template

Version Documentation License: MIT

electron-vite-template 主进程使用rollup,渲染进程使用 vite 编译的一个electron项目模板,适用于 vue, react 等任何框架. 可以打包成window, liunx, macOS 等系统的安装包,减少项目初期构建工作, 提高工作效率。

Author

👤 xuxuxu-ni

命令说明

启动项目

yarn dev

image.png

默认打包适用于本机操作系统和位数的版本

yarn build

打包win 32位

yarn build:win32

打包mac

yarn build:mac

EE30210A-5465-547E-93EA-4CC0B5F62135.jpg

打包linux

yarn build:linux

image.png

代码检查

yarn lint

Run your unit tests

yarn test:unit

Run your end-to-end tests

yarn test:e2e

代码提交

yarn commit

根据提示进行填写提交信息,此次提交的适用范围模板在.cz-config.js文件scopes属性中针对使用的项目自行修改, commit的时候会校验 commit信息是否规范,校验通过之后会再次校验提交代码是否规范,不规范的代码框架会自动修复,修复不了的会终止提交,并且指出不符合规范的代码所在文件的位置和行数 image.png

版本发布

yarn release

需要发布版本的时候运行该命令会根据git提交历史记录,自动生成CHANGELOG.md文件并在里面记录当前版本说明和更改package.json文件的版本号,只会自动记录提交类型为新功能bug修复的记录,所以git提交说明很重要,并且会打上该版本的tag, 不过并不会推送到远程仓库,需要手动推送tag

根据不同的项目,识别对应项目的代码打对应的包

假如同一个程序,不同的客户有各自特定的需求,如果每个客户都创建一个仓库的话,一百个客户就有一百个仓库不便于管理,也不适合使用 Monorepo, 我们需要把不同的页面和组件单独抽离出来,在进行开发或者打包的时候让框架自动识别去找我们需要的页面和组件. 以项目一,项目二为例,只要在viewscomponents目录下创建对应项目的文件夹,把各自项目的专属代码写在对应的文件夹中就可以了, 然后开发和打包的时候只要更改 src/render/utils/getModules.js文件中import.meta.globimport.meta.globEager参数中目录名成就行可以,例如:import.meta.glob('../views/项目一/*.vue')改成import.meta.glob('../views/项目二/*.vue')(这里不允许字符串拼接,所以不能去读取配置文件只能手动去改),这样开发或者打包会自动的识别对应项目的代码

自动更新

目前使用的文件服务器是minio,配置信息在 package.json文件里publish属性,和src/main/autoUpdater.js文件

electron-vite-template's People

Contributors

xuxuxu-ni avatar

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.