Commit 2395eaf8 authored by ali's avatar ali

feat: 整理文件

parent 352d2cfc
Pipeline #47457 failed with stages
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at https://jooy2.com/contact. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
MIT License
Copyright (c) 2022-2023 jooy2 <jooy2.contact@gmail.com> (https://jooy2.com).
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
<div align="center">
![vutron-logo](src/renderer/public/images/vutron-logo.webp)
---
쉽고 빠르게 시작하는 **[Vite](https://vitejs.dev)** + **[Vue 3](https://vuejs.org)** + **[Electron](https://www.electronjs.org)** 템플릿
[![awesome-vite](https://awesome.re/mentioned-badge.svg)](https://github.com/vitejs/awesome-vite) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jooy2/vutron/blob/master/LICENSE) ![Programming Language Usage](https://img.shields.io/github/languages/top/jooy2/vutron) ![github repo size](https://img.shields.io/github/repo-size/jooy2/vutron) ![Stars](https://img.shields.io/github/stars/jooy2/vutron?style=social) ![Commit Count](https://img.shields.io/github/commit-activity/y/jooy2/vutron) ![Line Count](https://img.shields.io/tokei/lines/github/jooy2/vutron) [![Followers](https://img.shields.io/github/followers/jooy2?style=social)](https://github.com/jooy2)
![vutron-logo](.github/resources/vutron-sample.webp)
[English](https://github.com/jooy2/vutron/blob/master/README.md) · **한국어** · [简体中文](https://github.com/jooy2/vutron/blob/master/README.zh-CN.md)
**Vutron** 템플릿은 `Electron`으로 사전 설정 된 크로스 플랫폼 데스크톱 앱입니다. 이 프로젝트는 `Vue 3`을 사용하여 적은 노력으로 빠른 빌드를 가능하게 해줍니다.
</div>
## 사용상의 이점
- ✅ 복잡한 사전 설정 없이도 즉시 빌드할 수 있어 빠른 프로젝트 개발이 가능합니다.
- ✅ 최신 `Vue``Electron` 및 여러 모듈에 대해 신속하게 대응하여 유지 관리되고 있습니다.
- ✅ 레이아웃, 데이터 상태 관리와 같은 다양한 사전 구성에 대해 걱정할 필요가 없습니다.
## 주요 기능
- ⚡️ 핫 리로드 기능을 통한 빠른 개발
- ⚡️ 크로스 플랫폼 개발 및 빌드 지원
- ⚡️ 자동화된 GUI 테스팅 지원
- ⚡️ TypeScript 지원
- ⚡️ 다국어 지원
- ⚡️ 테마 지원 (다크 & 라이트)
- ⚡️ 기본적인 레이아웃 관리
- ⚡️ Pinia 스토어를 활용한 글로벌 상태 관리
- ⚡️ GitHub 커뮤니티와 공식 문서를 통한 프로젝트 기술지원
## [문서 (설치 및 시작하기)](https://vutron.jooy2.com/installation-and-build/getting-started)
자세한 설치 방법이나 기본적인 템플릿 사용 방법에 대한 전체 문서를 참고하려면 다음 문서 페이지를 방문하세요: https://vutron.jooy2.com/installation-and-build/getting-started
## 기여
[GitHub Issue](https://github.com/jooy2/vutron/issues) 페이지를 통해 문제를 보고할 수 있습니다. 또한 자주 사용될 만한 기능이나 버그 수정에 대해 Pull Request를 보내주실 수 있습니다.
## 라이선스
Copyright © 2022-2023 [Jooy2](https://jooy2.com) <[jooy2.contact@gmail.com](mailto:jooy2.contact@gmail.com)> Released under the MIT license.
<div align="center">
![vutron-logo](src/renderer/public/images/vutron-logo.webp)
---
Quick Start Templates for **[Vite](https://vitejs.dev)** + **[Vue 3](https://vuejs.org)** + **[Electron](https://www.electronjs.org)**
[![awesome-vite](https://awesome.re/mentioned-badge.svg)](https://github.com/vitejs/awesome-vite) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jooy2/vutron/blob/master/LICENSE) ![Programming Language Usage](https://img.shields.io/github/languages/top/jooy2/vutron) ![github repo size](https://img.shields.io/github/repo-size/jooy2/vutron) ![Stars](https://img.shields.io/github/stars/jooy2/vutron?style=social) ![Commit Count](https://img.shields.io/github/commit-activity/y/jooy2/vutron) ![Line Count](https://img.shields.io/tokei/lines/github/jooy2/vutron) [![Followers](https://img.shields.io/github/followers/jooy2?style=social)](https://github.com/jooy2)
![vutron-logo](.github/resources/vutron-sample.webp)
**English** · [한국어](https://github.com/jooy2/vutron/blob/master/README.ko-KR.md) · [简体中文](https://github.com/jooy2/vutron/blob/master/README.zh-CN.md)
**Vutron** is a preconfigured template for developing `Electron` cross-platform desktop apps. It uses `Vue 3` and allows you to build a fast development environment with little effort.
</div>
## Advantages of use
- ✅ You can build immediately without any presets, so you can develop quickly.
- ✅ It is being maintained quickly to be compatible with the latest `Vue` and `Electron`, as well as many modules.
- ✅ There is no need to worry about layout and data management by using various additional templates.
## Features
- ⚡️ Rapid development through hot-reload
- ⚡️ Cross-platform development and build support
- ⚡️ Support for automated application testing
- ⚡️ TypeScript support
- ⚡️ Multilingual support
- ⚡️ Support for themes (dark & light)
- ⚡️ Basic layout manager
- ⚡️ Global state management through the Pinia store
- ⚡️ Quick support through the GitHub community and official documentation
## [Documentation (Getting Started)](https://vutron.jooy2.com/installation-and-build/getting-started)
For complete documentation including installation instructions and basic usage, please refer to each item in the link below: https://vutron.jooy2.com/installation-and-build/getting-started
## Contribute
You can report issues on [GitHub Issue](https://github.com/jooy2/vutron/issues). You can also request a pull to fix bugs and add frequently used features.
## License
Copyright © 2022-2023 [Jooy2](https://jooy2.com) <[jooy2.contact@gmail.com](mailto:jooy2.contact@gmail.com)> Released under the MIT license.
# chartIP-Electron
\ No newline at end of file
<div align="center">
![vutron-logo](src/renderer/public/images/vutron-logo.webp)
---
快速启动模板,适用于 **[Vite](https://vitejs.dev)** + **[Vue 3](https://vuejs.org)** + **[Electron](https://www.electronjs.org)**
[![awesome-vite](https://awesome.re/mentioned-badge.svg)](https://github.com/vitejs/awesome-vite) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jooy2/vutron/blob/master/LICENSE) ![编程语言使用情况](https://img.shields.io/github/languages/top/jooy2/vutron) ![github 仓库大小](https://img.shields.io/github/repo-size/jooy2/vutron) ![Stars(点赞数)](https://img.shields.io/github/stars/jooy2/vutron?style=social) ![提交次数](https://img.shields.io/github/commit-activity/y/jooy2/vutron) ![代码行数](https://img.shields.io/tokei/lines/github/jooy2/vutron) [![Followers(关注者数)](https://img.shields.io/github/followers/jooy2?style=social)](https://github.com/jooy2)
![vutron-logo](.github/resources/vutron-sample.webp)
[English](https://github.com/jooy2/vutron/blob/master/README.md) · [한국어](https://github.com/jooy2/vutron/blob/master/README.ko-KR.md) · **简体中文**
**Vutron** 是一个预配置的模板,用于开发 `Electron` 跨平台桌面应用。它使用 `Vue 3`,使您能够轻松构建快速的开发环境。
</div>
## 使用优势
- ✅ 无需任何预设,即可立即构建,快速开发。
- ✅ 快速维护,与最新的 `Vue``Electron` 以及许多模块兼容。
- ✅ 通过使用各种附加模板,无需担心布局和数据管理。
## 特点
- ⚡️ 通过热重载实现快速开发
- ⚡️ 跨平台开发和构建支持
- ⚡️ 支持自动化应用程序测试
- ⚡️ 支持 TypeScript
- ⚡️ 多语言支持
- ⚡️ 支持主题(暗色和亮色)
- ⚡️ 基本布局管理器
- ⚡️ 通过 Pinia 存储进行全局状态管理
- ⚡️ 通过 GitHub 社区和官方文档提供快速支持
## [文档(入门指南)](https://vutron.jooy2.com/installation-and-build/getting-started)
完整的文档,包括安装说明和基本使用方法,请参阅以下链接的每个项目:https://vutron.jooy2.com/installation-and-build/getting-started
## 贡献
您可以在 [GitHub 问题页面](https://github.com/jooy2/vutron/issues) 上报告问题。您还可以请求拉取请求,修复错误并添加常用功能。
## 许可证
版权所有 © 2022-2023 [Jooy2](https://jooy2.com) <[jooy2.contact@gmail.com](mailto:jooy2.contact@gmail.com)>,根据 MIT 许可证发布。
......@@ -2,8 +2,8 @@
const dotenv = require('dotenv')
const baseConfig = {
productName: 'Vutron',
appId: 'com.vutron.vutron',
productName: 'chartIP',
appId: 'com.chartip.chartip',
asar: true,
extends: null,
compression: 'maximum',
......
# Node artifact files
node_modules/
# VitePress files
dist
dist/*
src/.vitepress/.temp
src/.vitepress/.temp/*
src/.vitepress/cache
src/.vitepress/cache/*
This diff is collapsed.
{
"name": "docs",
"version": "1.0.0",
"scripts": {
"dev": "vitepress dev src",
"build": "vitepress build src",
"serve": "vitepress serve src"
},
"author": "jooy2 <jooy2.contact@gmail.com>",
"license": "MIT",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"vitepress": "^1.0.0-rc.24",
"vitepress-sidebar": "^1.18.0",
"vue": "^3.3.7"
}
}
import { generateSidebar } from 'vitepress-sidebar'
import { name, description, repository } from '../../../package.json'
const capitalizeFirst = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1)
export default {
title: capitalizeFirst(name),
description,
outDir: '../dist',
head: [
['link', { rel: 'icon', href: '/logo.png' }],
['link', { rel: 'shortcut icon', href: '/favicon.ico' }]
],
cleanUrls: true,
themeConfig: {
logo: { src: '/icon.png', width: 24, height: 24 },
search: {
provider: 'local'
},
sidebar: generateSidebar({
documentRootPath: 'src',
collapsed: false,
useTitleFromFileHeading: true,
useTitleFromFrontmatter: true,
sortMenusByFrontmatterOrder: true,
hyphenToSpace: true,
capitalizeEachWords: true,
manualSortFileNameByPriority: [
'installation-and-build',
'project-structures',
'electron-how-to'
]
}),
socialLinks: [{ icon: 'github', link: repository.url.replace('.git', '') }]
}
}
# Main vs Renderer Process
A **Vutron** application is divided into code into a Main process and a Renderer process.
**"Main"** is the code of `src/main` and is mainly the process code handled by Electron. **"Renderer"** is the code of `src/renderer`, mainly for front-end rendering process like Vue.
In general, **NodeJS** scripts cannot be run in the renderer process. Examples include modules that contain APIs used by NodeJS, or native modules of **NodeJS** such as `path` or `net`, `os` or `crypto`.
Preload scripts are run before the renderer is loaded. It creates a bridge to the main process to keep the execution of NodeJS scripts in the renderer area separate and isolated for security reasons.
For secure script execution, it is recommended that the main process executes the Node scripts, and the renderer receives the execution results via messaging. This can be implemented via **IPC communication**.
For more information on this, see the following articles: https://www.electronjs.org/docs/latest/tutorial/ipc
### How to run NodeJS on a renderer?
If you want to skip the security issues and use NodeJS scripts in your renderer, you need to set `nodeIntegration` to `true` in your `vite.config.ts` file.
```javascript
rendererPlugin({
nodeIntegration: true
})
```
For more information on this, see the following articles: https://github.com/electron-vite/vite-plugin-electron-renderer
# Preload Script
The preload script in Electron.js is a secure area designed for communication between the main and renderer processes. It is typically used for **[IPC communication](https://www.electronjs.org/docs/latest/tutorial/ipc)**.
For more information, see the following articles https://www.electronjs.org/docs/latest/tutorial/tutorial-preload
For compatibility and security with the latest version of Electron, we do not recommend using the old `electron/remote` module. If you want to utilize system events or Node scripts, it is recommended to do so in the main process, not the renderer.
Vutron's preload script is located in the `src/preload` folder. To create a new IPC communication channel, add the channel name to the following variable to whitelist it for communication.
- `mainAvailChannels`: Send an event from main to renderer. (`window.mainApi.send('channelName'')`)
- `rendererAvailChannels`: Send an event from renderer to main. (`mainWindow.webContents.send('channelName')`)
When sending events from renderer to main, you access the `window.mainApi` object instead of `ipcRenderer.send`. The `mainApi` is the name you set in your Vutron template and can be changed.
Here are the supported functions for mainApi: (To change and modify this, you need to modify `exposeInMainWorld` in `src/preload/index.ts`).
- `send`: Send an event to main.
- `receive`: A listener to receive events sent by main.
- `invoke`: Functions that can send events to main and receive data asynchronously.
---
order: 4
---
# Automated Testing
**Vutron** includes automated testing. The testing framework uses Microsoft's **[Playwright](https://playwright.dev)**.
**Playwright** is optimized for web application testing and has full support for the **Electron** framework. It is simple to install, requires no configuration to start testing immediately, and is cross-platform. You can learn more about **Playwright** here: https://github.com/microsoft/playwright
Only very simple launch and behavioral tests for the template main screen have been implemented in this template. Advanced testing will depend on the scope of your application.
Currently, the test specification file is located in the `tests` directory and the test results file is located in `tests/results`. (The built-in test specification file does not generate a separate results file.)
The Playwright configuration is `playwright.config.ts` in the project root, see the following documentation for more information on this: https://playwright.dev/docs/test-configuration
Once everything is configured, you can run a test with the following command.
```shell
$ npm run test
```
Before running the test, empty the build directory (`dist`) and compile the package for the test.
---
order: 2
---
# Build Configurations
Once the module installation is complete, you can simply build the platform package with the command below.
```shell
# For Windows (.exe, .appx)
$ npm run build:win
# For macOS (.dmg)
$ npm run build:mac
# For Linux (.rpm, .deb, .snap)
$ npm run build:linux
# All platform (.exe, .appx, .dmg, .rpm, .deb, .snap) - see below description
$ npm run build:all
```
The built packages can be found in `release/{version}` location.
For more information, please refer to the following article: https://webpack.electron.build/dependency-management#installing-native-node-modules
## What do I need to do for a multi-platform build?
To create a package for each OS, you must build it on the same OS. For example, a package for macOS must be built on a macOS machine.
However, you can build packages for Windows, macOS, and Linux all at once on one OS. However, this might require some preparation.
**macOS** is recommended if you want to build multiple platforms simultaneously on one platform. Because it can be configured with just a few very simple settings.
You can perform multi-platform builds at once with the following command. Alternatively, you can just do it for the OS you want via the individual build commands above.
```shell
$ npm run build:all
```
`Multipass` configuration may be required for Linux builds. Learn more about `Multipass` through the following link: https://multipass.run
To learn more about multiplatform builds, see the following articles: https://www.electron.build/multi-platform-build
## Reduce bundle size by excluding development files
You can exclude files you don't need at build time by adding a file pattern to the files property of `buildAssets/builder/config.ts`. This will save bundle capacity.
Below is an unnecessary `node_modules` file pattern that can further save bundles. Depending on the project, using the rules below may cause problems, so please review it before using.
```json
[
"!**/.*",
"!**/node_modules/**/{CONTRIBUTORS,CNAME,AUTHOR,TODO,CONTRIBUTING,COPYING,INSTALL,NEWS,PORTING,Makefile,htdocs,CHANGELOG,ChangeLog,changelog,README,Readme,readme,test,sample,example,demo,composer.json,tsconfig.json,jsdoc.json,tslint.json,typings.json,gulpfile,bower.json,package-lock,Gruntfile,CMakeLists,karma.conf,yarn.lock}*",
"!**/node_modules/**/{man,benchmark,node_modules,spec,cmake,browser,vagrant,doxy*,bin,obj,obj.target,example,examples,test,tests,doc,docs,msvc,Xcode,CVS,RCS,SCCS}{,/**/*}",
"!**/node_modules/**/*.{conf,png,pc,coffee,txt,spec.js,ts,js.flow,html,def,jst,xml,ico,in,ac,sln,dsp,dsw,cmd,vcproj,vcxproj,vcxproj.filters,pdb,exp,obj,lib,map,md,sh,gypi,gyp,h,cpp,yml,log,tlog,Makefile,mk,c,cc,rc,xcodeproj,xcconfig,d.ts,yaml,hpp}",
"!**/node_modules/**/node-v*-x64{,/**/*}",
"!**/node_modules/bluebird/js/browser{,/**/*}",
"!**/node_modules/bluebird/js/browser{,/**/*}",
"!**/node_modules/source-map/dist{,/**/*}",
"!**/node_modules/lodash/fp{,/**/*}",
"!**/node_modules/async/!(dist|package.json)",
"!**/node_modules/async/internal{,/**/*}",
"!**/node_modules/ajv/dist{,/**/*}",
"!**/node_modules/ajv/scripts{,/**/*}",
"!**/node_modules/node-pre-gyp/!(lib|package.json)",
"!**/node_modules/node-pre-gyp/lib/!(util|pre-binding.js|node-pre-gyp.js)",
"!**/node_modules/node-pre-gyp/lib/util/!(versioning.js|abi_crosswalk.json)",
"!**/node_modules/source-map-support/browser-source-map-support.js",
"!**/node_modules/json-schema/!(package.json|lib)"
]
```
## Build settings for projects that use Native Node modules
For projects that use the **Native Node Module**, add the following script to your `package.json`: When installing dependencies, `electron-builder` will take care of any modules that require rebuilding.
```json
{
"scripts": {
"postinstall": "electron-builder install-app-deps"
}
}
```
---
order: 1
---
# Getting Started
## Clone project
### Method 1: `npm init` (Recommend)
You can easily clone a repository with just the npm command.
```shell
$ npm init vutron
```
The above method will not create unnecessary documentation and `.github` related files for your project.
### Method 2: Use this template
Click **[Use this template](https://github.com/jooy2/vutron/generate)** to instantly create your own project.
This method creates a repository on GitHub immediately, but you will need to clone the project locally before you can use it.
### Method 3: Clone this repository
Clone this repo using below command. This method is suitable for direct contributions to the Vutron repository.
```shell
$ git clone https://github.com/jooy2/vutron <PROJECT_NAME>
```
## Installation
After cloning the project, run the following command in the terminal:
```shell
# via npm
$ npm i
# via yarn (https://yarnpkg.com)
$ yarn install
# via pnpm (https://pnpm.io)
$ pnpm i
```
## Run in development environment
Applications in the development environment run through **[Vite](https://vitejs.dev)**.
```shell
$ npm run dev
```
If your application doesn't appear after running command line commands, you may need to review if the default port is being used by another app.
Vite uses port `5173` by default.
---
order: 5
---
# Manage Local Documentation
Documents from `Vutron` can be viewed in the local environment through the `VitePress` viewer.
This function works only when the entire project is cloned. If you created the project with `npm init vutron`, the `docs` folder is not included.
## Installation
Everything in the instructions below should be done in the `docs` folder.
```shell
$ cd docs
```
Install the relevant packages using the following commands:
```shell
# via npm
$ npm i
# via yarn (https://yarnpkg.com)
$ yarn install
# via pnpm (https://pnpm.io)
$ pnpm i
```
You can run the local server where the documents are hosted via the command below.
```shell
$ npm run dev
```
---
title: NPM Scripts
order: 3
---
# Npm Scripts
> $ npm run %SCRIPT_NAME%
## General
| Script Name | Description |
| --- | --- |
| `dev` | Start Electron as a development environment |
| `dev:debug` | Start Electron as a development environment (with vite debug) |
| `dev:debug:force` | Start Electron as a development environment (with vite debug + clean vite cache) |
| `build:pre` | Commands commonly run at build time. This script does not need to be run separately. |
| `build` | Build the package for the current operating system. |
| `build:all` | Build a specified package for the entire operating system (Requires cross-platform build configuration) |
| `build:dir` | `electron-builder` directory build |
| `build:mac` | Build preconfigured packages for macOS |
| `build:linux` | Build preconfigured packages for Linux |
| `build:win` | Build preconfigured packages for Windows |
| `lint` | ESLint code inspection. It does not modify the code. |
| `lint:fix` | ESLint code inspection. Use auto-fix to fix your code. |
| `format` | Prettier code inspection. It does not modify the code. |
| `format:fix` | Prettier code inspection. Use auto-fix to fix your code. |
| `test` | Build a package for testing and run tests against the test specification file. |
## For Documentation
Used only for contributing to project documentation. Must be run from the `docs` directory location.
| Script Name | Description |
| ----------- | ------------------------------------------------------------------ |
| `dev` | Start the local document server. (For development) |
| `build` | Build a local document server. Used only for GitHub page builders. |
| `serve` | Start the local document server. |
# Other Projects
## Looking for Electron templates made with React?
Also check out the `Retron` project, which consists of Vite + React + Material-UI + Electron.
https://github.com/jooy2/retron
## (Deprecated) Looking for `Vutron` with Webpack 5 compiler?
By using the Vite compiler, we achieved our goals of reducing project and bundle size, and improving development environment and build speed.
The old **Vutron** using the Webpack 5 compiler has been split into the repositories below and will end support soon.
https://github.com/jooy2/vutron-webpack
---
order: 2
---
# Pre-configured Components
## Web app frameworks
- [Vite](https://vitejs.dev)
- [Electron](https://www.electronjs.org)
- [Electron Builder](https://www.electron.build)
## Development help tools
- [TypeScript](https://www.typescriptlang.org)
- [ESLint](https://eslint.org)
- [Prettier](https://prettier.io)
## Front-end frameworks (Vue)
- [Vue](https://vuejs.org)
- [Vue-i18n](https://kazupon.github.io/vue-i18n)
- [Vue-router](https://router.vuejs.org)
- [Pinia](https://pinia.vuejs.org)
## Design frameworks
- [Vuetify](https://vuetifyjs.com)
## Testing
- [Playwright](https://playwright.dev)
---
order: 1
---
# Project Structure
```
/
├─ .github - GitHub files (only used for Vutron GitHub project contributions)
│ └─ ISSUE_TEMPLATE/
│ └─ resources/ - GitHub resources used for README.md, etc.
│ └─ workflows/ - GitHub workflows definition
│ └─ dependabot.yml
│ └─ FUNDING.yml
├─ .vscode - Common project configuration files used by Visual Studio Code IDE
├─ buildAssets/ - Package resource (icon, logo, etc.) file used for Electron build
│ └─ builder/
│ │ │ └─ config.ts - `electron-builder` dynamic configuration file
│ └─ icons/
├─ dist/ - Output directory used to build the package
├─ docs/ - Project documents (optionally enabled)
│ └─ .vitepress/
│ │ │ └─ config.mts - VitePress configuration file used for document hosting
│ └─ public/ - Root resource directory for VitePress documentation pages
├─ node_modules/
├─ src/
│ ├─ main/ - Main (Electron) process source code
│ │ ├─ utils/ - Main process utilities
│ │ │ └─ Constants.ts - Main global definition
│ │ │ └─ Menus.ts - Main global menu definition
│ │ └─ index.ts - Main process entry point
│ │ └─ IPCs.ts - Main process ipc handlers definition
│ │ └─ MainRunner.ts - Main process main window processing
│ ├─ preload/ - Preload (Electron-Vue communication bridge) process source code
│ │ └─ index.ts
│ ├─ renderer/ - Renderer (Vue) process source code
│ │ ├─ components/ - Vue components collection
│ │ │ └─ layout/ - Layout components
│ │ ├─ locales/ - Vue i18n language resource file
│ │ ├─ plugins/ - Vue plugin definition
│ │ ├─ public/ - Vue static resources
│ │ │ └─ images/
│ │ ├─ router/ - Vue routing definition
│ │ ├─ screens/ - Vue screen component
│ │ │ └─ ErrorScreen.vue - Screen displayed when renderer process and routing errors occur
│ │ │ └─ MainScreen.vue
│ │ │ └─ SecondScreen.vue - Sample screen
│ │ ├─ store/ - Pinia store (Global state management) definition
│ │ ├─ utils/ - Renderer process utilities
│ │ ├─ App.vue - Vue app's root component
│ │ ├─ index.html - Root static index loaded by Electron renderer process
│ └─ └─ main.ts - Renderer process entry point
├─ tests/ - Application test configuration
│ └─ app.spec.ts - Test file specification
├─ .editorconfig - Editor recommended configuration file for IDE
├─ .eslintignore - List of files to be ignored by ESLint
├─ .eslintrc.json - ESLint rule configurations
├─ .gitignore - List of files to not upload to Git
├─ .prettierignore - List of files to disable Prettier file formatting
├─ .prettierrc - Prettier rule configurations
├─ CODE_OF_CONDUCT.md - Files used only on GitHub
├─ LICENSE - Project license file
├─ package.json - NodeJS package configurations
├─ package-lock.json
├─ playwright.config.ts - Playwright test rules configurations
├─ tsconfig.json - TypeScript configurations
├─ tsconfig.node.json - TypeScript configurations
├─ vite.config.ts - Vite compiler build configurations
└─ README.md - Files used only on GitHub
```
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true
},
"include": ["src/.vitepress/config.mts", "package.json"]
}
......@@ -2,17 +2,13 @@
"name": "laipic",
"version": "1.0.0",
"description": "Quick Start Templates for Vite + Vue 3 + Electron",
"homepage": "https://vutron.jooy2.com",
"author": "jooy2 <jooy2.contact@gmail.com>",
"author": "ali <lihuahui@laihua.com>",
"license": "MIT",
"main": "dist/main/index.js",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/jooy2/vutron.git"
},
"bugs": {
"url": "https://github.com/jooy2/vutron/issues"
"url": "git@gitlab.laihua.com:ali/charip-electron.git"
},
"scripts": {
"serve": "cross-env ELECTRON_ENABLE_LOGGING=true vite",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment