第一版
This commit is contained in:
parent
71d8cbe9a8
commit
c231a5743b
@ -1 +0,0 @@
|
||||
Subproject commit ee5cc4c1414070ab7ecfe569f49d4ebb046fee5e
|
||||
11
lingtropy-client/.editorconfig
Normal file
11
lingtropy-client/.editorconfig
Normal file
@ -0,0 +1,11 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
max_line_length = 100
|
||||
trim_trailing_whitespace = true
|
||||
9
lingtropy-client/.eslintignore
Normal file
9
lingtropy-client/.eslintignore
Normal file
@ -0,0 +1,9 @@
|
||||
node_modules/
|
||||
buildAssets/icons/
|
||||
dist/
|
||||
release/
|
||||
docs/
|
||||
|
||||
.idea/
|
||||
.vscode/
|
||||
.github/
|
||||
31
lingtropy-client/.eslintrc.json
Normal file
31
lingtropy-client/.eslintrc.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "vue-eslint-parser",
|
||||
"parserOptions": {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2022,
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": ["standard", "plugin:vue/vue3-recommended", "prettier"],
|
||||
"globals": {
|
||||
"__static": true
|
||||
},
|
||||
"plugins": ["vue"],
|
||||
"rules": {
|
||||
"arrow-parens": 0,
|
||||
"generator-star-spacing": 0,
|
||||
"no-case-declarations": 0,
|
||||
"array-callback-return": 0,
|
||||
"no-trailing-spaces": 1,
|
||||
"no-control-regex": 0,
|
||||
"no-useless-constructor": 0,
|
||||
"node/no-deprecated-api": 0
|
||||
}
|
||||
}
|
||||
65
lingtropy-client/.gitignore
vendored
Normal file
65
lingtropy-client/.gitignore
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
# .gitignore for Node.js Projects
|
||||
# ---------- Start of common ignore files
|
||||
|
||||
# Node artifact files
|
||||
node_modules/
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# JetBrains IDEs
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
# Visual Studio Code IDE
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
|
||||
# Generated by MacOS
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Generated by Windows
|
||||
Thumbs.db
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Applications
|
||||
*.app
|
||||
*.pkg
|
||||
*.dmg
|
||||
*.exe
|
||||
*.war
|
||||
*.deb
|
||||
|
||||
# Large media files
|
||||
*.mp4
|
||||
*.tiff
|
||||
*.avi
|
||||
*.flv
|
||||
*.mov
|
||||
*.wmv
|
||||
|
||||
# ---------- End of common ignore files
|
||||
|
||||
# Project Files
|
||||
dist/
|
||||
release/
|
||||
tests/results/
|
||||
npm-debug.log
|
||||
npm-debug.log.*
|
||||
vite-plugin-electron.log
|
||||
12
lingtropy-client/.prettierignore
Normal file
12
lingtropy-client/.prettierignore
Normal file
@ -0,0 +1,12 @@
|
||||
# Lock files
|
||||
*-lock.json
|
||||
|
||||
# IDEs
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
# Project files
|
||||
.github/
|
||||
buildAssets/icons/
|
||||
dist/
|
||||
release/
|
||||
17
lingtropy-client/.prettierrc
Normal file
17
lingtropy-client/.prettierrc
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"vueIndentScriptAndStyle": false,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": true,
|
||||
"bracketSameLine": false,
|
||||
"jsxSingleQuote": false,
|
||||
"arrowParens": "always",
|
||||
"insertPragma": false,
|
||||
"requirePragma": false,
|
||||
"proseWrap": "never",
|
||||
"htmlWhitespaceSensitivity": "strict",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
5
lingtropy-client/.vscode/extensions.json
vendored
Normal file
5
lingtropy-client/.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"Vue.volar"
|
||||
]
|
||||
}
|
||||
32
lingtropy-client/.vscode/launch.json
vendored
Normal file
32
lingtropy-client/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Debug Run",
|
||||
"configurations": [
|
||||
"Debug App"
|
||||
],
|
||||
"presentation": {
|
||||
"hidden": false,
|
||||
"group": "",
|
||||
"order": 1
|
||||
},
|
||||
"stopAll": true
|
||||
}
|
||||
],
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug App",
|
||||
"request": "launch",
|
||||
"type": "node",
|
||||
"timeout": 60000,
|
||||
"runtimeArgs": [
|
||||
"run-script",
|
||||
"dev"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"runtimeExecutable": "npm",
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
21
lingtropy-client/.vscode/settings.json
vendored
Normal file
21
lingtropy-client/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"workbench.settings.useSplitJSON": true,
|
||||
"eslint.codeActionsOnSave.rules": null,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"eslint.validate": [
|
||||
"javascript"
|
||||
],
|
||||
"eslint.workingDirectories": [
|
||||
{
|
||||
"mode": "auto"
|
||||
}
|
||||
],
|
||||
"emmet.syntaxProfiles": {},
|
||||
"files.autoSave": "afterDelay",
|
||||
"editor.wordWrap": "on",
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.tabSize": 2
|
||||
}
|
||||
79
lingtropy-client/CODE_OF_CONDUCT.md
Normal file
79
lingtropy-client/CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,79 @@
|
||||
# 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://cdget.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.
|
||||
70
lingtropy-client/CONTRIBUTING.md
Normal file
70
lingtropy-client/CONTRIBUTING.md
Normal file
@ -0,0 +1,70 @@
|
||||
# Contributing to Project
|
||||
|
||||
Thank you for contributing to the project. Your contributions will help us take the project to the next level.
|
||||
|
||||
This project adheres to the Contributor Covenant code of conduct. Your contribution implies that you have read and agree to this policy. Any behavior that undermines the quality of the project community, including this policy, will be warned or restricted by the maintainers.
|
||||
|
||||
## Issues
|
||||
|
||||
Issues can be created on the following page: https://github.com/jooy2/vutron/issues
|
||||
|
||||
Alternatively, you can email the package maintainer. However, we prefer to track progress via GitHub Issues.
|
||||
|
||||
When creating an issue, keep the following in mind:
|
||||
|
||||
- Please specify the correct category selection based on the format of the issue (e.g., bug report, feature request).
|
||||
- Check to see if there are duplicate issues.
|
||||
- Describe in detail what is happening and what needs to be fixed. You may need additional materials such as images or video.
|
||||
- Use appropriate keyword titles to make it easy for others to search and understand.
|
||||
- Please use English in all content.
|
||||
- You may need to describe the environment in which the issue occurs.
|
||||
|
||||
## How to contribute (Pull Requests)
|
||||
|
||||
### Write the code you want to change
|
||||
|
||||
Here's the process for contributing to the project:
|
||||
|
||||
1. Clone the project (or rebase to the latest commit in the main branch)
|
||||
2. Install the package (if the package manager exists)
|
||||
3. Setting up lint or code formatter in the IDE (if your project includes a linter) and installing the relevant plugins. Some projects may use specific commands to check rules and perform formatting after module installation and before committing.
|
||||
4. Write the code that needs to be fixed
|
||||
5. Update the documentation (if it exists) or create a new one. If your project supports multilingual documentation, update the documentation for all languages. You can fill in the content in your own language and not translate it.
|
||||
6. Add or modify tests as needed (if test code exists). You should also verify that existing tests pass.
|
||||
|
||||
### Write a commit message
|
||||
|
||||
While we don't have strict restrictions on commit messages, we recommend that you follow the recommendations below whenever possible:
|
||||
|
||||
- Write in English.
|
||||
- Use the ` symbol to name functions, variables, or folders and files.
|
||||
- Use a format like `xxx: message (fixes #1)`. The content in parentheses is optional.
|
||||
- The message includes a summary of what was modified.
|
||||
- It's a good idea to separate multiple modifications into their own commit messages.
|
||||
|
||||
It is recommended that you include a tag at the beginning of the commit message. Between the tag and the message, use `: ` between the tag and the message.
|
||||
|
||||
tags conform to the ["Udacity Git Commit Message Style Guide"](https://udacity.github.io/git-styleguide). However, you are welcome to use tags not listed here for additional situations.
|
||||
|
||||
- `feat`: A new feature
|
||||
- `fix`: A bug fix
|
||||
- `docs`: Changes to documentation
|
||||
- `style`: Formatting, missing semicolons, etc.; no code change
|
||||
- `refactor`: Refactoring production code
|
||||
- `test`: Adding tests, refactoring test; no production code change
|
||||
- `chore`: Updating build tasks, package manager configs, etc.; no production code change
|
||||
|
||||
Informal tags:
|
||||
|
||||
- `package`: Modifications to package settings, modules, or GitHub projects
|
||||
- `typo`: Fix typos
|
||||
|
||||
### Create a pull request
|
||||
|
||||
When creating a pull request, keep the following in mind:
|
||||
|
||||
- Include a specific description of what the modification is, why it needs to be made, and how it works.
|
||||
- Check to see if there are duplicate pull requests.
|
||||
- Please use English in all content.
|
||||
|
||||
Typically, a project maintainer will review and test your code before merging it into the project. This process can take some time, and they may ask you for further edits or clarifications in the comments.
|
||||
21
lingtropy-client/LICENSE
Normal file
21
lingtropy-client/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022-2025 CDGet <jooy2.contact@gmail.com> (https://cdget.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
|
||||
31
lingtropy-client/README.md
Normal file
31
lingtropy-client/README.md
Normal file
@ -0,0 +1,31 @@
|
||||
## 在windows平台构建
|
||||
|
||||
1. 安装依赖:
|
||||
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
2. 构建:
|
||||
|
||||
```
|
||||
yarn run build:win
|
||||
```
|
||||
|
||||
## 开发环境运行
|
||||
|
||||
```
|
||||
yarn run dev
|
||||
```
|
||||
|
||||
## 构建配置文件
|
||||
|
||||
```
|
||||
./buildAssets/builder/config.js
|
||||
```
|
||||
|
||||
## 包信息
|
||||
|
||||
```
|
||||
./package.json
|
||||
```
|
||||
21
lingtropy-client/SECURITY.md
Normal file
21
lingtropy-client/SECURITY.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
To report a security vulnerability, create an issue on GitHub on the "Open a draft security advisory " page on GitHub: https://github.com/jooy2/vutron/security/advisories/new
|
||||
|
||||
Also, send private instructions in advance via maintainer email. Do not submit vulnerability-related content as a general issue.
|
||||
|
||||
## Security compliance
|
||||
|
||||
Project maintainers are quickly addressing reported security vulnerabilities in the project and providing relevant patches.
|
||||
|
||||
We report these to the relevant users and handle the correspondence to prevent the issue from recurring.
|
||||
|
||||
## Security recommendations
|
||||
|
||||
We recommend that users of project sources use the latest version, which addresses possible security vulnerabilities.
|
||||
|
||||
## Contact
|
||||
|
||||
- Administrator: jooy2.contact@gmail.com
|
||||
118
lingtropy-client/buildAssets/builder/config.js
Normal file
118
lingtropy-client/buildAssets/builder/config.js
Normal file
@ -0,0 +1,118 @@
|
||||
/* eslint-disable no-template-curly-in-string */
|
||||
const dotenv = require('dotenv')
|
||||
const packageJson = require('../../package.json')
|
||||
|
||||
const baseConfig = {
|
||||
productName: packageJson.name,
|
||||
appId: packageJson.appId,
|
||||
asar: true,
|
||||
extends: null,
|
||||
compression: 'maximum',
|
||||
artifactName: '${productName} ${version}_${arch}.${ext}',
|
||||
directories: {
|
||||
output: './release/${version}'
|
||||
},
|
||||
mac: {
|
||||
bundleVersion: '1.0',
|
||||
hardenedRuntime: true,
|
||||
gatekeeperAssess: false,
|
||||
notarize: false,
|
||||
icon: 'buildAssets/icons/icon.icns',
|
||||
type: 'distribution',
|
||||
target: [
|
||||
{
|
||||
target: 'dmg',
|
||||
arch: ['x64', 'arm64', 'universal']
|
||||
}
|
||||
]
|
||||
},
|
||||
dmg: {
|
||||
contents: [
|
||||
{
|
||||
x: 410,
|
||||
y: 150,
|
||||
type: 'link',
|
||||
path: '/Applications'
|
||||
},
|
||||
{
|
||||
x: 130,
|
||||
y: 150,
|
||||
type: 'file'
|
||||
}
|
||||
],
|
||||
sign: false
|
||||
},
|
||||
win: {
|
||||
icon: 'buildAssets/icons/icon.ico',
|
||||
target: [
|
||||
// {
|
||||
// target: 'appx',
|
||||
// arch: 'x64'
|
||||
// },
|
||||
// {
|
||||
// target: 'zip',
|
||||
// arch: 'x64'
|
||||
// },
|
||||
// {
|
||||
// target: 'portable',
|
||||
// arch: 'x64'
|
||||
// },
|
||||
{
|
||||
target: 'nsis',
|
||||
arch: 'x64'
|
||||
}
|
||||
]
|
||||
},
|
||||
portable: {
|
||||
artifactName: '${productName} ${version}_${arch} Portable.${ext}'
|
||||
},
|
||||
nsis: {
|
||||
oneClick: true
|
||||
},
|
||||
linux: {
|
||||
executableName: packageJson.name.toLowerCase(),
|
||||
icon: 'buildAssets/icons',
|
||||
category: 'Utility',
|
||||
target: [
|
||||
{
|
||||
target: 'snap',
|
||||
arch: 'x64'
|
||||
},
|
||||
{
|
||||
target: 'deb',
|
||||
arch: 'x64'
|
||||
},
|
||||
{
|
||||
target: 'rpm',
|
||||
arch: 'x64'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
dotenv.config()
|
||||
|
||||
baseConfig.copyright = `ⓒ ${new Date().getFullYear()} $\{author}`
|
||||
baseConfig.files = [
|
||||
/* A list of files not to be included in the build. */
|
||||
/*
|
||||
(Required) The files and folders listed below should not be included in the build.
|
||||
*/
|
||||
'dist/**/*',
|
||||
'!dist/main/index.dev.js',
|
||||
'!docs/**/*',
|
||||
'!tests/**/*',
|
||||
'!release/**/*'
|
||||
]
|
||||
|
||||
// TODO: Notarize for macOS
|
||||
baseConfig.mac.identity = null
|
||||
/* if (process.env.MAC_NOTARIZE === 'true') {
|
||||
baseConfig.afterSign = './buildAssets/builder/notarize.ts'
|
||||
} else {
|
||||
baseConfig.mac.identity = null
|
||||
} */
|
||||
|
||||
module.exports = {
|
||||
...baseConfig
|
||||
}
|
||||
BIN
lingtropy-client/buildAssets/icons/icon.icns
Normal file
BIN
lingtropy-client/buildAssets/icons/icon.icns
Normal file
Binary file not shown.
BIN
lingtropy-client/buildAssets/icons/icon.ico
Normal file
BIN
lingtropy-client/buildAssets/icons/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
BIN
lingtropy-client/buildAssets/icons/icon.png
Normal file
BIN
lingtropy-client/buildAssets/icons/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
lingtropy-client/buildAssets/icons/icon16.png
Normal file
BIN
lingtropy-client/buildAssets/icons/icon16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
10
lingtropy-client/docs/.gitignore
vendored
Normal file
10
lingtropy-client/docs/.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
# Node artifact files
|
||||
node_modules/
|
||||
|
||||
# VitePress files
|
||||
dist
|
||||
dist/*
|
||||
src/.vitepress/.temp
|
||||
src/.vitepress/.temp/*
|
||||
src/.vitepress/cache
|
||||
src/.vitepress/cache/*
|
||||
2896
lingtropy-client/docs/package-lock.json
generated
Normal file
2896
lingtropy-client/docs/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
lingtropy-client/docs/package.json
Normal file
21
lingtropy-client/docs/package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "vutron-docs",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vitepress dev src",
|
||||
"build": "vitepress build src",
|
||||
"serve": "vitepress serve src"
|
||||
},
|
||||
"author": "CDGet <jooy2.contact@gmail.com>",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"vitepress": "^1.5.0",
|
||||
"vitepress-i18n": "^1.3.1",
|
||||
"vitepress-sidebar": "^1.30.2",
|
||||
"vue": "^3.5.13"
|
||||
}
|
||||
}
|
||||
100
lingtropy-client/docs/src/.vitepress/config.mts
Normal file
100
lingtropy-client/docs/src/.vitepress/config.mts
Normal file
@ -0,0 +1,100 @@
|
||||
import { withSidebar } from 'vitepress-sidebar'
|
||||
import { name, repository, homepage } from '../../../package.json'
|
||||
import { defineConfig, UserConfig } from 'vitepress'
|
||||
import { withI18n } from 'vitepress-i18n'
|
||||
import type { VitePressSidebarOptions } from 'vitepress-sidebar/types'
|
||||
import type { VitePressI18nOptions } from 'vitepress-i18n/types'
|
||||
|
||||
const capitalizeFirst = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1)
|
||||
const supportLocales = ['en', 'ko', 'zhHans']
|
||||
const defaultLocale: string = supportLocales[0]
|
||||
|
||||
const vitePressI18nConfigs: VitePressI18nOptions = {
|
||||
locales: supportLocales,
|
||||
rootLocale: defaultLocale,
|
||||
searchProvider: 'local',
|
||||
description: {
|
||||
en: '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.',
|
||||
ko: 'Vutron은 Electron 크로스 플랫폼 데스크톱 앱 개발을 위해 미리 구성된 템플릿입니다. Vue 3을 사용하며 적은 노력으로 빠른 개발 환경을 구축할 수 있습니다.',
|
||||
zhHans:
|
||||
'Vutron 是用于开发 Electron 跨平台桌面应用程序的预配置模板。它使用 Vue 3,可让您轻松构建快速开发环境。'
|
||||
},
|
||||
themeConfig: {
|
||||
en: {
|
||||
nav: [
|
||||
{
|
||||
text: 'Getting Started',
|
||||
link: '/installation-and-build/getting-started'
|
||||
}
|
||||
]
|
||||
},
|
||||
ko: {
|
||||
nav: [
|
||||
{
|
||||
text: '시작하기',
|
||||
link: '/ko/installation-and-build/getting-started'
|
||||
}
|
||||
]
|
||||
},
|
||||
zhHans: {
|
||||
nav: [
|
||||
{
|
||||
text: '入门',
|
||||
link: '/zhHans/installation-and-build/getting-started'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const vitePressSidebarConfigs: VitePressSidebarOptions = [
|
||||
...supportLocales.map((lang) => {
|
||||
return {
|
||||
collapsed: false,
|
||||
useTitleFromFileHeading: true,
|
||||
useTitleFromFrontmatter: true,
|
||||
useFolderTitleFromIndexFile: true,
|
||||
sortMenusByFrontmatterOrder: true,
|
||||
hyphenToSpace: true,
|
||||
capitalizeEachWords: true,
|
||||
manualSortFileNameByPriority: [
|
||||
'introduction.md',
|
||||
'installation-and-build',
|
||||
'project-structures',
|
||||
'electron-how-to'
|
||||
],
|
||||
documentRootPath: `/src/${lang}`,
|
||||
resolvePath: defaultLocale === lang ? '/' : `/${lang}/`,
|
||||
...(defaultLocale === lang ? {} : { basePath: `/${lang}/` })
|
||||
}
|
||||
})
|
||||
]
|
||||
|
||||
const vitePressConfigs: UserConfig = {
|
||||
title: capitalizeFirst(name),
|
||||
lastUpdated: true,
|
||||
outDir: '../dist',
|
||||
head: [
|
||||
['link', { rel: 'icon', href: '/logo.png' }],
|
||||
['link', { rel: 'shortcut icon', href: '/favicon.ico' }]
|
||||
],
|
||||
cleanUrls: true,
|
||||
metaChunk: true,
|
||||
rewrites: {
|
||||
'en/:rest*': ':rest*'
|
||||
},
|
||||
sitemap: {
|
||||
hostname: homepage
|
||||
},
|
||||
themeConfig: {
|
||||
logo: { src: '/icon.png', width: 24, height: 24 },
|
||||
editLink: {
|
||||
pattern: 'https://github.com/jooy2/vutron/edit/main/docs/src/:path'
|
||||
},
|
||||
socialLinks: [{ icon: 'github', link: repository.url.replace('.git', '') }]
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig(
|
||||
withSidebar(withI18n(vitePressConfigs, vitePressI18nConfigs), vitePressSidebarConfigs)
|
||||
)
|
||||
1
lingtropy-client/docs/src/en/electron-how-to/index.md
Normal file
1
lingtropy-client/docs/src/en/electron-how-to/index.md
Normal file
@ -0,0 +1 @@
|
||||
# Electron How-to
|
||||
@ -0,0 +1,25 @@
|
||||
# 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, **Node.js** scripts cannot be run in the renderer process. Examples include modules that contain APIs used by Node.js, or native modules of **Node.js** 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 Node.js 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 Node.js on a renderer?
|
||||
|
||||
If you want to skip the security issues and use Node.js 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
|
||||
@ -0,0 +1,24 @@
|
||||
# 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:
|
||||
|
||||
- `send`: Send an event to main.
|
||||
- `on`: A listener to receive events sent by main.
|
||||
- `once`: A listener to receive events sent by main. (Handle only one call)
|
||||
- `off`: Remove an event listener
|
||||
- `invoke`: Functions that can send events to main and receive data asynchronously.
|
||||
|
||||
To change and modify this, you need to modify `exposeInMainWorld` in `src/preload/index.ts`.
|
||||
32
lingtropy-client/docs/src/en/index.md
Normal file
32
lingtropy-client/docs/src/en/index.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
title: Vutron
|
||||
titleTemplate: Quick Start Templates for Vite + Vue 3 + Electron
|
||||
|
||||
hero:
|
||||
name: Vutron
|
||||
text: Quick Start Templates for Vite + Vue 3 + Electron
|
||||
tagline: <strong>Vutron</strong> 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.
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Getting Started
|
||||
link: /installation-and-build/getting-started
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/jooy2/vutron
|
||||
image:
|
||||
src: /icon.png
|
||||
alt: Vue
|
||||
|
||||
features:
|
||||
- icon: <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.03628 7.87818C4.75336 5.83955 6.15592 3.95466 8.16899 3.66815L33.6838 0.0367403C35.6969 -0.24977 37.5581 1.1706 37.841 3.20923L42.9637 40.1218C43.2466 42.1604 41.8441 44.0453 39.831 44.3319L14.3162 47.9633C12.3031 48.2498 10.4419 46.8294 10.159 44.7908L5.03628 7.87818Z" fill="url(#paint0_linear_1287_1214)"/><path d="M6.85877 7.6188C6.71731 6.59948 7.41859 5.65703 8.42512 5.51378L33.9399 1.88237C34.9465 1.73911 35.8771 2.4493 36.0186 3.46861L41.1412 40.3812C41.2827 41.4005 40.5814 42.343 39.5749 42.4862L14.0601 46.1176C13.0535 46.2609 12.1229 45.5507 11.9814 44.5314L6.85877 7.6188Z" fill="white"/><path d="M33.1857 14.9195L25.8505 34.1576C25.6991 34.5547 25.1763 34.63 24.9177 34.2919L12.3343 17.8339C12.0526 17.4655 12.3217 16.9339 12.7806 16.9524L22.9053 17.3607C22.9698 17.3633 23.0344 17.3541 23.0956 17.3337L32.5088 14.1992C32.9431 14.0546 33.3503 14.4878 33.1857 14.9195Z" fill="url(#paint1_linear_1287_1214)"/><path d="M27.0251 12.5756L19.9352 15.0427C19.8187 15.0832 19.7444 15.1986 19.7546 15.3231L20.3916 23.063C20.4066 23.2453 20.5904 23.3628 20.7588 23.2977L22.7226 22.5392C22.9064 22.4682 23.1021 22.6138 23.0905 22.8128L22.9102 25.8903C22.8982 26.0974 23.1093 26.2436 23.295 26.1567L24.4948 25.5953C24.6808 25.5084 24.892 25.6549 24.8795 25.8624L24.5855 30.6979C24.5671 31.0004 24.9759 31.1067 25.1013 30.8321L25.185 30.6487L29.4298 17.8014C29.5008 17.5863 29.2968 17.3809 29.0847 17.454L27.0519 18.1547C26.8609 18.2205 26.6675 18.0586 26.6954 17.8561L27.3823 12.8739C27.4103 12.6712 27.2163 12.5091 27.0251 12.5756Z" fill="url(#paint2_linear_1287_1214)"/><defs><linearGradient id="paint0_linear_1287_1214" x1="6.48163" y1="1.9759" x2="39.05" y2="48.2064" gradientUnits="userSpaceOnUse"><stop stop-color="#49C7FF"/><stop offset="1" stop-color="#BD36FF"/></linearGradient><linearGradient id="paint1_linear_1287_1214" x1="11.8848" y1="16.4266" x2="26.7246" y2="31.4177" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="paint2_linear_1287_1214" x1="21.8138" y1="13.7046" x2="26.2464" y2="28.8069" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset="0.0833333" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs></svg>
|
||||
title: Powerful web application development templates
|
||||
details: Vutron supports cross-platform, multi-language, layouts and theme, and style frameworks.
|
||||
- icon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="160px" height="160px"><path fill="#424e5c" d="M4.5 6.5H75.5V73.5H4.5z"/><path fill="#afc5d8" d="M75,7v66H5V7H75 M76,6H4v68h72V6L76,6z"/><path fill="#afc5d8" d="M4 6H76V18H4z"/><path fill="#bae0bd" d="M25.6 43H54.400000000000006V45H25.6z" transform="rotate(-69.666 39.998 43.999)"/><path fill="#bae0bd" d="M27.9 54.4L16 44 27.9 33.6 29.2 35.1 19 44 29.2 52.9zM52.2 54.5L50.9 53 61 44.1 50.9 35.1 52.2 33.6 64 44.1z"/></svg>
|
||||
title: Rapid development through hot-reload
|
||||
details: Reduce initial project setup time with maximum feature support for developers.
|
||||
- icon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64px" height="64px"><circle cx="16" cy="17" r="5" fill="#ed0049"/><path fill="#ed0049" d="M23,31H9v0c0-3.866,3.134-7,7-7h0C19.866,24,23,27.134,23,31L23,31z"/><path fill="#0f518c" d="M19,4c0-1.657-1.343-3-3-3s-3,1.343-3,3c0,0.885,0.391,1.672,1,2.222V10h4V6.222 C18.609,5.672,19,4.885,19,4z"/><path fill="#0f518c" d="M7.061,8.318c-1.171-1.171-3.071-1.171-4.243,0s-1.171,3.071,0,4.243 c0.626,0.626,1.459,0.906,2.278,0.864l2.672,2.672l2.828-2.828l-2.672-2.672C7.967,9.777,7.686,8.944,7.061,8.318z"/><path fill="#0f518c" d="M24.879,8.318c1.171-1.171,3.071-1.171,4.243,0s1.171,3.071,0,4.243 c-0.626,0.626-1.459,0.906-2.278,0.864l-2.672,2.672l-2.828-2.828l2.672-2.672C23.972,9.777,24.253,8.944,24.879,8.318z"/><path fill="#0f518c" d="M24.879,27.218c1.171,1.171,3.071,1.171,4.243,0c1.171-1.171,1.171-3.071,0-4.243 c-0.626-0.626-1.459-0.906-2.278-0.864l-2.672-2.672l-2.828,2.828l2.672,2.672C23.972,25.759,24.253,26.592,24.879,27.218z"/><g><path fill="#0f518c" d="M7.061,27.218c-1.171,1.171-3.071,1.171-4.243,0c-1.171-1.171-1.171-3.071,0-4.243 c0.626-0.626,1.459-0.906,2.278-0.864l2.672-2.672l2.828,2.828L7.925,24.94C7.967,25.759,7.686,26.592,7.061,27.218z"/></g></svg>
|
||||
title: Reliable maintenance support
|
||||
details: There are many real-world use cases, and we have fast technical support.
|
||||
---
|
||||
@ -0,0 +1,23 @@
|
||||
---
|
||||
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.
|
||||
@ -0,0 +1,84 @@
|
||||
---
|
||||
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://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"
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -0,0 +1,58 @@
|
||||
---
|
||||
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.
|
||||
@ -0,0 +1 @@
|
||||
# Installation and Build
|
||||
@ -0,0 +1,36 @@
|
||||
---
|
||||
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
|
||||
```
|
||||
@ -0,0 +1,39 @@
|
||||
---
|
||||
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. |
|
||||
| `test:linux` | Build a package for testing and run tests against the test specification file. (for linux ci only) |
|
||||
|
||||
## 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. |
|
||||
21
lingtropy-client/docs/src/en/introduction.md
Normal file
21
lingtropy-client/docs/src/en/introduction.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Introduction
|
||||
|
||||
**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.
|
||||
|
||||
## 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
|
||||
15
lingtropy-client/docs/src/en/other-projects.md
Normal file
15
lingtropy-client/docs/src/en/other-projects.md
Normal file
@ -0,0 +1,15 @@
|
||||
# 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
|
||||
1
lingtropy-client/docs/src/en/project-structures/index.md
Normal file
1
lingtropy-client/docs/src/en/project-structures/index.md
Normal file
@ -0,0 +1 @@
|
||||
# Project Structures
|
||||
@ -0,0 +1,32 @@
|
||||
---
|
||||
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)
|
||||
@ -0,0 +1,73 @@
|
||||
---
|
||||
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
|
||||
│ ├─ results/ - Where to save PlayWright test result files and screenshots
|
||||
│ ├─ specs/ - PlayWright test spec file
|
||||
│ ├─ fixtures.ts - Test common execution API
|
||||
│ └─ testUtil.ts - Test utilities
|
||||
├─ .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 - Node.js package configurations
|
||||
├─ package-lock.json
|
||||
├─ playwright.config.ts - Playwright test rules configurations
|
||||
├─ tsconfig.json - TypeScript configurations
|
||||
├─ tsconfig.node.json - TypeScript configurations
|
||||
├─ vite.config.mts - Vite compiler build configurations
|
||||
└─ README.md - Files used only on GitHub
|
||||
```
|
||||
1
lingtropy-client/docs/src/ko/electron-how-to/index.md
Normal file
1
lingtropy-client/docs/src/ko/electron-how-to/index.md
Normal file
@ -0,0 +1 @@
|
||||
# Electron 개요
|
||||
@ -0,0 +1,25 @@
|
||||
# 메인과 렌더러 프로세스
|
||||
|
||||
**Vutron** 애플리케이션은 메인(Main) 프로세스와 렌더러(Renderer) 프로세스로 코드가 나뉩니다.
|
||||
|
||||
**Main**은 `src/main`의 코드로 주로 Electron이 처리하는 프로세스 코드입니다. **렌더러**는 `src/renderer`의 코드로 주로 Vue와 같은 프론트엔드 렌더링 프로세스를 위한 코드입니다.
|
||||
|
||||
일반적으로 **Node.js** 스크립트는 렌더러 프로세스에서 실행할 수 없습니다. 예를 들어 Node.js에서 사용하는 API를 포함하는 모듈이나 `path` 또는 `net`, `os` 또는 `crypto`와 같은 **Node.js**의 네이티브 모듈이 있습니다.
|
||||
|
||||
사전 로드 스크립트는 렌더러가 로드되기 전에 실행됩니다. 이는 보안상의 이유로 렌더러 영역에서 Node.js 스크립트의 실행을 분리하고 격리하기 위해 메인 프로세스에 대한 브릿지를 생성합니다.
|
||||
|
||||
안전한 스크립트 실행을 위해 메인 프로세스에서 노드 스크립트를 실행하고 렌더러는 메시징을 통해 실행 결과를 수신하는 것이 좋습니다. 이는 **IPC 통신**을 통해 구현할 수 있습니다.
|
||||
|
||||
이에 대한 자세한 내용은 다음 문서를 참조하세요: https://www.electronjs.org/docs/latest/tutorial/ipc
|
||||
|
||||
### 렌더러에서 Node.js를 실행하는 방법은 무엇인가요?
|
||||
|
||||
보안 문제를 건너뛰고 렌더러에서 Node.js 스크립트를 사용하려면 `vite.config.ts` 파일에서 `nodeIntegration`을 `true`로 설정해야 합니다.
|
||||
|
||||
```javascript
|
||||
rendererPlugin({
|
||||
nodeIntegration: true
|
||||
})
|
||||
```
|
||||
|
||||
이에 대한 자세한 내용은 다음 문서를 참조하세요: https://github.com/electron-vite/vite-plugin-electron-renderer
|
||||
@ -0,0 +1,24 @@
|
||||
# 프리로드 스크립트
|
||||
|
||||
Electron.js의 프리로드 스크립트는 메인 프로세스와 렌더러 프로세스 간의 통신을 위해 설계된 보안 영역입니다. 일반적으로 **[IPC 통신](https://www.electronjs.org/docs/latest/tutorial/ipc)**에 사용됩니다.
|
||||
|
||||
자세한 내용은 다음 문서를 참고하세요: https://www.electronjs.org/docs/latest/tutorial/tutorial-preload
|
||||
|
||||
최신 버전의 Electron과의 호환성 및 보안을 위해 이전 버전의 `electron/remote` 모듈은 사용하지 않는 것이 좋습니다. 시스템 이벤트나 노드 스크립트를 활용하려면 렌더러가 아닌 메인 프로세스에서 사용하는 것이 좋습니다.
|
||||
|
||||
Vutron의 프리로드 스크립트는 `src/preload` 폴더에 있습니다. 새 IPC 통신 채널을 생성하려면 다음 변수에 채널 이름을 추가하여 통신을 허용하도록 화이트리스트에 추가합니다.
|
||||
|
||||
- `mainAvailChannels`: 메인에서 렌더러로 이벤트를 전송합니다. (`window.mainApi.send('channelName')`)
|
||||
- `rendererAvailChannels`: 렌더러에서 메인으로 이벤트를 전송합니다. (`mainWindow.webContents.send('channelName')`)
|
||||
|
||||
렌더러에서 메인으로 이벤트를 전송할 때는 `ipcRenderer.send` 대신 `window.mainApi` 객체에 액세스합니다. `mainApi`는 Vutron 템플릿에서 설정한 이름이며 변경할 수 있습니다.
|
||||
|
||||
다음은 mainApi에서 지원되는 함수입니다:
|
||||
|
||||
- `send`: 메인으로 이벤트를 보냅니다.
|
||||
- `on`: 메인에서 보낸 이벤트를 수신할 리스너입니다.
|
||||
- `once`: 메인에서 보낸 이벤트를 수신할 리스너입니다. (하나의 호출만 처리)
|
||||
- `off`: 이벤트 리스너를 제거합니다.
|
||||
- `invoke`: 메인에 이벤트를 보내고 비동기적으로 데이터를 수신할 수 있는 함수입니다.
|
||||
|
||||
이를 변경하고 수정하려면 `src/preload/index.ts`에서 `exposeInMainWorld`를 수정해야 합니다.
|
||||
32
lingtropy-client/docs/src/ko/index.md
Normal file
32
lingtropy-client/docs/src/ko/index.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
title: Vutron
|
||||
titleTemplate: Vite + Vue 3 + Electron용 빠른 시작 템플릿
|
||||
|
||||
hero:
|
||||
name: Vutron
|
||||
text: Vite + Vue 3 + Electron용 빠른 시작 템플릿
|
||||
tagline: <strong>Vutron</strong>은 Electron 크로스 플랫폼 데스크톱 앱 개발을 위해 미리 구성된 템플릿입니다. Vue 3을 사용하며 적은 노력으로 빠른 개발 환경을 구축할 수 있습니다.
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 시작하기
|
||||
link: /ko/installation-and-build/getting-started
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/jooy2/vutron
|
||||
image:
|
||||
src: /icon.png
|
||||
alt: Vue
|
||||
|
||||
features:
|
||||
- icon: <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.03628 7.87818C4.75336 5.83955 6.15592 3.95466 8.16899 3.66815L33.6838 0.0367403C35.6969 -0.24977 37.5581 1.1706 37.841 3.20923L42.9637 40.1218C43.2466 42.1604 41.8441 44.0453 39.831 44.3319L14.3162 47.9633C12.3031 48.2498 10.4419 46.8294 10.159 44.7908L5.03628 7.87818Z" fill="url(#paint0_linear_1287_1214)"/><path d="M6.85877 7.6188C6.71731 6.59948 7.41859 5.65703 8.42512 5.51378L33.9399 1.88237C34.9465 1.73911 35.8771 2.4493 36.0186 3.46861L41.1412 40.3812C41.2827 41.4005 40.5814 42.343 39.5749 42.4862L14.0601 46.1176C13.0535 46.2609 12.1229 45.5507 11.9814 44.5314L6.85877 7.6188Z" fill="white"/><path d="M33.1857 14.9195L25.8505 34.1576C25.6991 34.5547 25.1763 34.63 24.9177 34.2919L12.3343 17.8339C12.0526 17.4655 12.3217 16.9339 12.7806 16.9524L22.9053 17.3607C22.9698 17.3633 23.0344 17.3541 23.0956 17.3337L32.5088 14.1992C32.9431 14.0546 33.3503 14.4878 33.1857 14.9195Z" fill="url(#paint1_linear_1287_1214)"/><path d="M27.0251 12.5756L19.9352 15.0427C19.8187 15.0832 19.7444 15.1986 19.7546 15.3231L20.3916 23.063C20.4066 23.2453 20.5904 23.3628 20.7588 23.2977L22.7226 22.5392C22.9064 22.4682 23.1021 22.6138 23.0905 22.8128L22.9102 25.8903C22.8982 26.0974 23.1093 26.2436 23.295 26.1567L24.4948 25.5953C24.6808 25.5084 24.892 25.6549 24.8795 25.8624L24.5855 30.6979C24.5671 31.0004 24.9759 31.1067 25.1013 30.8321L25.185 30.6487L29.4298 17.8014C29.5008 17.5863 29.2968 17.3809 29.0847 17.454L27.0519 18.1547C26.8609 18.2205 26.6675 18.0586 26.6954 17.8561L27.3823 12.8739C27.4103 12.6712 27.2163 12.5091 27.0251 12.5756Z" fill="url(#paint2_linear_1287_1214)"/><defs><linearGradient id="paint0_linear_1287_1214" x1="6.48163" y1="1.9759" x2="39.05" y2="48.2064" gradientUnits="userSpaceOnUse"><stop stop-color="#49C7FF"/><stop offset="1" stop-color="#BD36FF"/></linearGradient><linearGradient id="paint1_linear_1287_1214" x1="11.8848" y1="16.4266" x2="26.7246" y2="31.4177" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="paint2_linear_1287_1214" x1="21.8138" y1="13.7046" x2="26.2464" y2="28.8069" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset="0.0833333" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs></svg>
|
||||
title: 강력한 웹 애플리케이션 개발 템플릿
|
||||
details: Vutron은 크로스 플랫폼, 다국어, 레이아웃 및 테마, 스타일 프레임워크를 지원합니다.
|
||||
- icon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="160px" height="160px"><path fill="#424e5c" d="M4.5 6.5H75.5V73.5H4.5z"/><path fill="#afc5d8" d="M75,7v66H5V7H75 M76,6H4v68h72V6L76,6z"/><path fill="#afc5d8" d="M4 6H76V18H4z"/><path fill="#bae0bd" d="M25.6 43H54.400000000000006V45H25.6z" transform="rotate(-69.666 39.998 43.999)"/><path fill="#bae0bd" d="M27.9 54.4L16 44 27.9 33.6 29.2 35.1 19 44 29.2 52.9zM52.2 54.5L50.9 53 61 44.1 50.9 35.1 52.2 33.6 64 44.1z"/></svg>
|
||||
title: 핫 리로드를 통한 빠른 개발
|
||||
details: 개발자를 위한 최대 기능 지원으로 초기 프로젝트 설정 시간을 단축하세요.
|
||||
- icon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64px" height="64px"><circle cx="16" cy="17" r="5" fill="#ed0049"/><path fill="#ed0049" d="M23,31H9v0c0-3.866,3.134-7,7-7h0C19.866,24,23,27.134,23,31L23,31z"/><path fill="#0f518c" d="M19,4c0-1.657-1.343-3-3-3s-3,1.343-3,3c0,0.885,0.391,1.672,1,2.222V10h4V6.222 C18.609,5.672,19,4.885,19,4z"/><path fill="#0f518c" d="M7.061,8.318c-1.171-1.171-3.071-1.171-4.243,0s-1.171,3.071,0,4.243 c0.626,0.626,1.459,0.906,2.278,0.864l2.672,2.672l2.828-2.828l-2.672-2.672C7.967,9.777,7.686,8.944,7.061,8.318z"/><path fill="#0f518c" d="M24.879,8.318c1.171-1.171,3.071-1.171,4.243,0s1.171,3.071,0,4.243 c-0.626,0.626-1.459,0.906-2.278,0.864l-2.672,2.672l-2.828-2.828l2.672-2.672C23.972,9.777,24.253,8.944,24.879,8.318z"/><path fill="#0f518c" d="M24.879,27.218c1.171,1.171,3.071,1.171,4.243,0c1.171-1.171,1.171-3.071,0-4.243 c-0.626-0.626-1.459-0.906-2.278-0.864l-2.672-2.672l-2.828,2.828l2.672,2.672C23.972,25.759,24.253,26.592,24.879,27.218z"/><g><path fill="#0f518c" d="M7.061,27.218c-1.171,1.171-3.071,1.171-4.243,0c-1.171-1.171-1.171-3.071,0-4.243 c0.626-0.626,1.459-0.906,2.278-0.864l2.672-2.672l2.828,2.828L7.925,24.94C7.967,25.759,7.686,26.592,7.061,27.218z"/></g></svg>
|
||||
title: 안정적인 유지 관리 지원
|
||||
details: 실제 사용 사례도 많고 기술 지원도 신속하게 제공합니다.
|
||||
---
|
||||
@ -0,0 +1,23 @@
|
||||
---
|
||||
order: 4
|
||||
---
|
||||
|
||||
# 자동화 테스트
|
||||
|
||||
**Vutron**에는 자동화된 테스트가 포함되어 있습니다. 테스트 프레임워크는 Microsoft의 **[Playwright](https://playwright.dev)** 모듈을 사용합니다.
|
||||
|
||||
**Playwright**는 웹 애플리케이션 테스트에 최적화되어 있으며 **Electron** 프레임워크를 완벽하게 지원합니다. 설치가 간단하고, 별도의 설정 없이 바로 테스트를 시작할 수 있으며, 크로스 플랫폼을 지원합니다. 여기에서 **Playwright**에 대해 자세히 알아보세요: https://github.com/microsoft/playwright
|
||||
|
||||
이 템플릿에는 템플릿 메인 화면에 대한 매우 간단한 실행 및 동작 테스트만 구현되어 있습니다. 고급 테스트는 애플리케이션의 범위에 따라 달라집니다.
|
||||
|
||||
현재 테스트 사양 파일은 `tests` 디렉터리에, 테스트 결과 파일은 `tests/results`에 있습니다. (기본 제공 테스트 사양 파일은 별도의 결과 파일을 생성하지 않습니다.)
|
||||
|
||||
Playwright 설정은 프로젝트 루트에 있는 `playwright.config.ts`이며, 이에 대한 자세한 내용은 다음 문서를 참조하세요: https://playwright.dev/docs/test-configuration
|
||||
|
||||
모든 구성이 완료되면 다음 명령어로 테스트를 실행할 수 있습니다.
|
||||
|
||||
```shell
|
||||
$ npm run test
|
||||
```
|
||||
|
||||
테스트를 실행하기 전에 빌드 디렉터리(`dist`)를 비우고 테스트용 패키지를 컴파일합니다.
|
||||
@ -0,0 +1,84 @@
|
||||
---
|
||||
order: 2
|
||||
---
|
||||
|
||||
# 빌드 구성
|
||||
|
||||
모듈 설치가 완료되면 아래 명령어를 사용하여 플랫폼 패키지를 간단하게 빌드할 수 있습니다.
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
빌드된 패키지는 `release/{version}` 위치에서 찾을 수 있습니다.
|
||||
|
||||
자세한 내용은 다음 문서를 참조하세요: https://webpack.electron.build/dependency-management#installing-native-node-modules
|
||||
|
||||
## 멀티플랫폼 빌드를 하려면 어떻게 해야 하나요?
|
||||
|
||||
각 OS에 대한 패키지를 만들려면 동일한 OS에서 빌드해야 합니다. 예를 들어 macOS용 패키지는 macOS 컴퓨터에서 빌드해야 합니다.
|
||||
|
||||
하지만 하나의 OS에서 Windows, macOS, Linux용 패키지를 한 번에 빌드할 수 있습니다. 하지만 이를 위해서는 약간의 준비가 필요할 수 있습니다.
|
||||
|
||||
하나의 플랫폼에서 여러 플랫폼을 동시에 구축하려는 경우 **macOS**를 권장합니다. 몇 가지 간단한 설정만으로 구성할 수 있기 때문입니다.
|
||||
|
||||
다음 명령어를 사용하여 한 번에 여러 플랫폼 빌드를 수행할 수 있습니다. 또는 위의 개별 빌드 명령어를 통해 원하는 OS에 대해서만 빌드를 수행할 수도 있습니다.
|
||||
|
||||
```shell
|
||||
$ npm run build:all
|
||||
```
|
||||
|
||||
Linux 빌드에는 `multipass` 구성이 필요할 수 있습니다. 다음 링크를 통해 `multipass`에 대해 자세히 알아보세요: https://multipass.run
|
||||
|
||||
멀티플랫폼 빌드에 대해 자세히 알아보려면 다음 문서를 참조하세요: https://electron.build/multi-platform-build
|
||||
|
||||
## 개발 파일을 제외하여 번들 크기 줄이기
|
||||
|
||||
빌드 시점에 필요하지 않은 파일은 `buildAssets/builder/config.ts`의 파일 속성에 파일 패턴을 추가하여 제외할 수 있습니다. 이렇게 하면 번들 용량을 절약할 수 있습니다.
|
||||
|
||||
아래는 불필요한 `node_modules` 파일 패턴으로 번들을 추가로 절약할 수 있는 예시입니다. 프로젝트에 따라 아래 규칙을 사용하면 문제가 발생할 수 있으므로 사용 전에 검토하시기 바랍니다.
|
||||
|
||||
```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)"
|
||||
]
|
||||
```
|
||||
|
||||
## 네이티브 노드 모듈을 사용하는 프로젝트의 빌드 설정
|
||||
|
||||
**네이티브 노드 모듈**을 사용하는 프로젝트의 경우, `package.json`에 다음 스크립트를 추가하세요: 종속성을 설치할 때 `electron-builder`가 리빌드가 필요한 모듈을 처리합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"postinstall": "electron-builder install-app-deps"
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -0,0 +1,58 @@
|
||||
---
|
||||
order: 1
|
||||
---
|
||||
|
||||
# 시작하기
|
||||
|
||||
## 프로젝트 복제하기
|
||||
|
||||
### 방법 1: `npm init` (권장)
|
||||
|
||||
npm 명령만으로 리포지토리를 쉽게 복제할 수 있습니다.
|
||||
|
||||
```shell
|
||||
$ npm init vutron
|
||||
```
|
||||
|
||||
위의 방법은 프로젝트에 불필요한 문서와 '.github' 관련 파일을 만들지 않습니다.
|
||||
|
||||
### 방법 2: 템플릿 사용
|
||||
|
||||
**[이 템플릿 사용](https://github.com/jooy2/vutron/generate)** 버튼을 클릭하면 나만의 프로젝트를 즉시 만들 수 있습니다.
|
||||
|
||||
이 방법을 사용하면 GitHub에 리포지토리가 즉시 생성되지만 프로젝트를 로컬에 복제해야 사용할 수 있습니다.
|
||||
|
||||
### 방법 3: 리포지토리 복제
|
||||
|
||||
아래 명령어를 사용하여 이 리포지토리를 복제합니다. 이 방법은 Vutron 리포지토리에 직접 기여하는 경우에 적합합니다.
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/jooy2/vutron <PROJECT_NAME>
|
||||
```
|
||||
|
||||
## 설치하기
|
||||
|
||||
프로젝트를 복제한 후 터미널에서 다음 명령을 실행합니다:
|
||||
|
||||
```shell
|
||||
# via npm
|
||||
$ npm i
|
||||
|
||||
# via yarn (https://yarnpkg.com)
|
||||
$ yarn install
|
||||
|
||||
# via pnpm (https://pnpm.io)
|
||||
$ pnpm i
|
||||
```
|
||||
|
||||
## 개발 환경에서 실행
|
||||
|
||||
개발 환경의 애플리케이션은 **[Vite](https://vitejs.dev)** 환경에서 실행됩니다.
|
||||
|
||||
```shell
|
||||
$ npm run dev
|
||||
```
|
||||
|
||||
명령줄 명령을 실행한 후에도 애플리케이션이 나타나지 않는다면 다른 앱에서 기본 포트를 사용하고 있는지 확인해야 할 수 있습니다.
|
||||
|
||||
Vite는 기본적으로 포트 `5173`을 사용합니다.
|
||||
@ -0,0 +1 @@
|
||||
# 설치 그리고 빌드
|
||||
@ -0,0 +1,36 @@
|
||||
---
|
||||
order: 5
|
||||
---
|
||||
|
||||
# 로컬 문서 관리
|
||||
|
||||
`Vutron`의 문서는 `VitePress` 뷰어를 통해 로컬 환경에서 볼 수 있습니다.
|
||||
|
||||
이 함수는 전체 프로젝트가 복제된 경우에만 작동합니다. `npm init vutron`으로 프로젝트를 생성한 경우 `docs` 폴더는 포함되지 않습니다.
|
||||
|
||||
## Installation
|
||||
|
||||
아래 지침의 모든 작업은 `docs` 폴더에서 수행해야 합니다.
|
||||
|
||||
```shell
|
||||
$ cd docs
|
||||
```
|
||||
|
||||
다음 명령을 사용하여 관련 패키지를 설치합니다:
|
||||
|
||||
```shell
|
||||
# via npm
|
||||
$ npm i
|
||||
|
||||
# via yarn (https://yarnpkg.com)
|
||||
$ yarn install
|
||||
|
||||
# via pnpm (https://pnpm.io)
|
||||
$ pnpm i
|
||||
```
|
||||
|
||||
아래 명령을 통해 문서가 호스팅되는 로컬 서버를 실행할 수 있습니다.
|
||||
|
||||
```shell
|
||||
$ npm run dev
|
||||
```
|
||||
@ -0,0 +1,39 @@
|
||||
---
|
||||
title: NPM Scripts
|
||||
order: 3
|
||||
---
|
||||
|
||||
# Npm 스크립트
|
||||
|
||||
> $ npm run %SCRIPT_NAME%
|
||||
|
||||
## 일반
|
||||
|
||||
| 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. |
|
||||
| `test:linux` | Build a package for testing and run tests against the test specification file. (for linux ci only) |
|
||||
|
||||
## 문서용
|
||||
|
||||
프로젝트 문서에 기여하는 경우에만 사용됩니다. `docs` 디렉토리 위치에서 실행해야 합니다.
|
||||
|
||||
| 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. |
|
||||
21
lingtropy-client/docs/src/ko/introduction.md
Normal file
21
lingtropy-client/docs/src/ko/introduction.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Introduction
|
||||
|
||||
**Vutron** 템플릿은 `Electron`으로 사전 설정 된 크로스 플랫폼 데스크톱 앱입니다. 이 프로젝트는 `Vue 3`을 사용하여 적은 노력으로 빠른 빌드를 가능하게 해줍니다.
|
||||
|
||||
## 사용상의 이점
|
||||
|
||||
- ✅ 복잡한 사전 설정 없이도 즉시 빌드할 수 있어 빠른 프로젝트 개발이 가능합니다.
|
||||
- ✅ 최신 `Vue`와 `Electron` 및 여러 모듈에 대해 신속하게 대응하여 유지 관리되고 있습니다.
|
||||
- ✅ 레이아웃, 데이터 상태 관리와 같은 다양한 사전 구성에 대해 걱정할 필요가 없습니다.
|
||||
|
||||
## 주요 기능
|
||||
|
||||
- ⚡️ 핫 리로드 기능을 통한 빠른 개발
|
||||
- ⚡️ 크로스 플랫폼 개발 및 빌드 지원
|
||||
- ⚡️ 자동화된 GUI 테스팅 지원
|
||||
- ⚡️ TypeScript 지원
|
||||
- ⚡️ 다국어 지원
|
||||
- ⚡️ 테마 지원 (다크 & 라이트)
|
||||
- ⚡️ 기본적인 레이아웃 관리
|
||||
- ⚡️ Pinia 스토어를 활용한 글로벌 상태 관리
|
||||
- ⚡️ GitHub 커뮤니티와 공식 문서를 통한 프로젝트 기술지원
|
||||
15
lingtropy-client/docs/src/ko/other-projects.md
Normal file
15
lingtropy-client/docs/src/ko/other-projects.md
Normal file
@ -0,0 +1,15 @@
|
||||
# 기타 프로젝트
|
||||
|
||||
## React로 만든 Electron 템플릿을 찾고 계신가요?
|
||||
|
||||
Vite + React + Material-UI + Electron으로 구성된 'Retron' 프로젝트도 확인해 보세요.
|
||||
|
||||
https://github.com/jooy2/retron
|
||||
|
||||
## (사용 중단) Webpack 5 컴파일러로 `Vutron`을 찾고 계신가요?
|
||||
|
||||
Vite 컴파일러를 사용하여 프로젝트 및 번들 크기를 줄이고 개발 환경과 빌드 속도를 개선한다는 목표를 달성했습니다.
|
||||
|
||||
Webpack 5 컴파일러를 사용하는 기존 **Vutron**은 아래 리포지토리로 분리되었으며 곧 지원이 종료될 예정입니다.
|
||||
|
||||
https://github.com/jooy2/vutron-webpack
|
||||
1
lingtropy-client/docs/src/ko/project-structures/index.md
Normal file
1
lingtropy-client/docs/src/ko/project-structures/index.md
Normal file
@ -0,0 +1 @@
|
||||
# 프로젝트 구조
|
||||
@ -0,0 +1,32 @@
|
||||
---
|
||||
order: 2
|
||||
---
|
||||
|
||||
# 사전 구성된 구성 요소
|
||||
|
||||
## 웹 앱 프레임워크
|
||||
|
||||
- [Vite](https://vitejs.dev)
|
||||
- [Electron](https://www.electronjs.org)
|
||||
- [Electron Builder](https://www.electron.build)
|
||||
|
||||
## 개발 도움말 도구
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org)
|
||||
- [ESLint](https://eslint.org)
|
||||
- [Prettier](https://prettier.io)
|
||||
|
||||
## 프론트엔드 프레임워크 (Vue)
|
||||
|
||||
- [Vue](https://vuejs.org)
|
||||
- [Vue-i18n](https://kazupon.github.io/vue-i18n)
|
||||
- [Vue-router](https://router.vuejs.org)
|
||||
- [Pinia](https://pinia.vuejs.org)
|
||||
|
||||
## 디자인 프레임워크
|
||||
|
||||
- [Vuetify](https://vuetifyjs.com)
|
||||
|
||||
## 테스트
|
||||
|
||||
- [Playwright](https://playwright.dev)
|
||||
@ -0,0 +1,73 @@
|
||||
---
|
||||
order: 1
|
||||
---
|
||||
|
||||
# 프로젝트 구조
|
||||
|
||||
```
|
||||
/
|
||||
├─ .github - GitHub 파일들 (Vutron 프로젝트 기여에만 사용)
|
||||
│ └─ ISSUE_TEMPLATE/
|
||||
│ └─ resources/ - README.md 등에 사용되는 GitHub 리소스
|
||||
│ └─ workflows/ - GitHub 워크플로우 정의
|
||||
│ └─ dependabot.yml
|
||||
│ └─ FUNDING.yml
|
||||
├─ .vscode - Visual Studio Code IDE에서 사용하는 일반적인 프로젝트 구성 파일
|
||||
├─ buildAssets/ - Electron 빌드에 사용되는 패키지 리소스(아이콘, 로고 등) 파일
|
||||
│ └─ builder/
|
||||
│ │ │ └─ config.ts - `electron-builder` 동적 구성 파일
|
||||
│ └─ icons/
|
||||
├─ dist/ - 패키지 빌드에 사용되는 출력 디렉토리
|
||||
├─ docs/ - 프로젝트 문서(선택적으로 활성화)
|
||||
│ └─ .vitepress/
|
||||
│ │ │ └─ config.mts - 문서 호스팅에 사용되는 VitePress 구성 파일
|
||||
│ └─ public/ - VitePress 문서 페이지의 루트 리소스 디렉토리
|
||||
├─ node_modules/
|
||||
├─ src/
|
||||
│ ├─ main/ - 메인(Electron) 프로세스 소스 코드
|
||||
│ │ ├─ utils/ - 메인 프로세스 유틸리티
|
||||
│ │ │ └─ Constants.ts - 메인 글로벌 정의
|
||||
│ │ │ └─ Menus.ts - 메인 글로벌 메뉴 정의
|
||||
│ │ └─ index.ts - 메인 프로세스 진입점
|
||||
│ │ └─ IPCs.ts - 메인 프로세스 IPC 핸들러 정의
|
||||
│ │ └─ MainRunner.ts - 메인 프로세스 메인 윈도우 프로세스
|
||||
│ ├─ preload/ - 프리로드 (Electron-Vue 커뮤니케이션 브릿지) 프로세스
|
||||
│ │ └─ index.ts
|
||||
│ ├─ renderer/ - 렌더러 (Vue) 프로세스 소스 코드
|
||||
│ │ ├─ components/ - Vue 컴포넌트 콜렉션
|
||||
│ │ │ └─ layout/ - 레이아웃 컴포넌트
|
||||
│ │ ├─ locales/ - Vue i18n 언어 리소스 파일
|
||||
│ │ ├─ plugins/ - Vue 플러그인 정의
|
||||
│ │ ├─ public/ - Vue 정적 리소스
|
||||
│ │ │ └─ images/
|
||||
│ │ ├─ router/ - Vue 라우팅 정의
|
||||
│ │ ├─ screens/ - Vue 화면 컴포넌트
|
||||
│ │ │ └─ ErrorScreen.vue - 렌더링 프로세스 및 라우팅 오류 발생 시 표시되는 화면
|
||||
│ │ │ └─ MainScreen.vue
|
||||
│ │ │ └─ SecondScreen.vue - 샘플 화면
|
||||
│ │ ├─ store/ - Pinia 스토어 (글로벌 상태 관리) 정의
|
||||
│ │ ├─ utils/ - 렌더러 프로세스 유틸리티
|
||||
│ │ ├─ App.vue - Vue 앱 루트 컴포넌트
|
||||
│ │ ├─ index.html - Electron 렌더러 프로세스에 의해 로드된 루트 정적 인덱스
|
||||
│ └─ └─ main.ts - 렌더러 프로세스 엔트리 포인트Renderer process entry point
|
||||
├─ tests/ - 애플리케이션 테스트 구성
|
||||
│ ├─ results/ - PlayWright 테스트 결과 파일 및 스크린샷 저장 위치
|
||||
│ ├─ specs/ - PlayWright 테스트 사양 파일
|
||||
│ ├─ fixtures.ts - 공통 실행 API 테스트
|
||||
│ └─ testUtil.ts - 테스트 유틸리티
|
||||
├─ .editorconfig - IDE용 에디터 권장 구성 파일
|
||||
├─ .eslintignore - ESLint에서 무시할 파일 목록
|
||||
├─ .eslintrc.json - ESLint 규칙 구성
|
||||
├─ .gitignore - Git에 업로드하지 않을 파일 목록
|
||||
├─ .prettierignore - Prettier 파일 서식을 비활성화할 파일 목록
|
||||
├─ .prettierrc - Prettier 규칙 설정
|
||||
├─ CODE_OF_CONDUCT.md - GitHub에서만 사용되는 파일
|
||||
├─ LICENSE - 프로젝트 라이선스 파일
|
||||
├─ package.json - Node.js 패키지 구성
|
||||
├─ package-lock.json
|
||||
├─ playwright.config.ts - Playwright 테스트 규칙 구성
|
||||
├─ tsconfig.json - TypeScript 설정
|
||||
├─ tsconfig.node.json - TypeScript 설정
|
||||
├─ vite.config.mts - Vite 컴파일러 빌드 설정
|
||||
└─ README.md - GitHub에서만 사용되는 파일
|
||||
```
|
||||
BIN
lingtropy-client/docs/src/public/favicon.ico
Normal file
BIN
lingtropy-client/docs/src/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
BIN
lingtropy-client/docs/src/public/icon.png
Normal file
BIN
lingtropy-client/docs/src/public/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@ -0,0 +1 @@
|
||||
# Electron 操作方法
|
||||
@ -0,0 +1,25 @@
|
||||
# 主流程与渲染器流程
|
||||
|
||||
一个**Vutron**应用程序被分为代码,分为主进程和渲染器进程。
|
||||
|
||||
**“主”**是`src/main`的代码,主要是由Electron处理的进程代码。**“渲染器”**是`src/renderer`的代码,主要用于前端渲染过程,如Vue。
|
||||
|
||||
一般来说,**Node.js**脚本无法在渲染器进程中运行。例如,包含Node.js使用的API的模块,或**Node.js**的本机模块,如`path`或`net`、`os`或`crypto`。
|
||||
|
||||
预加载脚本在渲染器加载之前运行。它为主进程创建了一个桥梁,出于安全考虑,将Node.js脚本的执行与渲染器区域分开并隔离。
|
||||
|
||||
为了安全执行脚本,建议主进程执行Node脚本,渲染器通过消息传递接收执行结果。这可以通过**IPC通信**来实现。
|
||||
|
||||
欲了解更多信息,请参阅以下文章: https://www.electronjs.org/docs/latest/tutorial/ipc
|
||||
|
||||
### 如何在渲染器上运行Node.js?
|
||||
|
||||
如果您想跳过安全问题并在渲染器中使用 Node.js 脚本,需要在 `vite.config.ts` 文件中将 `nodeIntegration` 设置为 `true`。
|
||||
|
||||
```javascript
|
||||
rendererPlugin({
|
||||
nodeIntegration: true
|
||||
})
|
||||
```
|
||||
|
||||
欲了解更多信息,请参阅以下文章: https://github.com/electron-vite/vite-plugin-electron-renderer
|
||||
@ -0,0 +1,24 @@
|
||||
# 预加载脚本
|
||||
|
||||
Electron.js中的预加载脚本是一个安全区域,用于主进程和渲染器进程之间的通信。它通常用于 **[IPC通信](https://www.electronjs.org/docs/latest/tutorial/ipc)**。
|
||||
|
||||
更多信息,请参阅以下文章: https://www.electronjs.org/docs/latest/tutorial/tutorial-preload
|
||||
|
||||
为了与最新版本的Electron兼容并确保安全,我们不建议使用旧的`electron/remote`模块。如果您想使用系统事件或Node脚本,建议在主进程中使用,而不是在渲染器中。
|
||||
|
||||
Vutron的预加载脚本位于`src/preload`文件夹中。要创建新的IPC通信通道,请将通道名称添加到以下变量中,将其列入通信白名单。
|
||||
|
||||
- `mainAvailChannels`: 从主程序发送事件到渲染程序。 (`window.mainApi.send('channelName')`)
|
||||
- `rendererAvailChannels`: 将事件从渲染器发送到主程序。 (`mainWindow.webContents.send('channelName')`)
|
||||
|
||||
当从渲染器向主程序发送事件时,应访问`window.mainApi`对象,而不是`ipcRenderer.send`。`mainApi`是您在自己的Vutron模板中设置的名称,可以更改。
|
||||
|
||||
以下是mainApi支持的功能:
|
||||
|
||||
- `send`: 将活动发送至主页面。
|
||||
- `on`: 一个接收主发送事件的听众。
|
||||
- `once`: 接听主叫方发送的事件。(仅处理一个呼叫)
|
||||
- `off`: 移除事件监听器
|
||||
- `invoke`: 可异步发送事件和接收数据的功能。
|
||||
|
||||
要更改和修改此设置,您需要修改 `src/preload/index.ts` 中的 `exposeInMainWorld`。
|
||||
32
lingtropy-client/docs/src/zhHans/index.md
Normal file
32
lingtropy-client/docs/src/zhHans/index.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
title: Vutron
|
||||
titleTemplate: Vite + Vue 3 + Electron 快速入门模板
|
||||
|
||||
hero:
|
||||
name: Vutron
|
||||
text: Vite + Vue 3 + Electron 快速入门模板
|
||||
tagline: <strong>Vutron</strong>是一个用于开发 "Electron" 跨平台桌面应用程序的预配置模板。它使用 "Vue 3",可让您轻松构建快速开发环境。
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 入门
|
||||
link: /zhHans/installation-and-build/getting-started
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/jooy2/vutron
|
||||
image:
|
||||
src: /icon.png
|
||||
alt: Vue
|
||||
|
||||
features:
|
||||
- icon: <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.03628 7.87818C4.75336 5.83955 6.15592 3.95466 8.16899 3.66815L33.6838 0.0367403C35.6969 -0.24977 37.5581 1.1706 37.841 3.20923L42.9637 40.1218C43.2466 42.1604 41.8441 44.0453 39.831 44.3319L14.3162 47.9633C12.3031 48.2498 10.4419 46.8294 10.159 44.7908L5.03628 7.87818Z" fill="url(#paint0_linear_1287_1214)"/><path d="M6.85877 7.6188C6.71731 6.59948 7.41859 5.65703 8.42512 5.51378L33.9399 1.88237C34.9465 1.73911 35.8771 2.4493 36.0186 3.46861L41.1412 40.3812C41.2827 41.4005 40.5814 42.343 39.5749 42.4862L14.0601 46.1176C13.0535 46.2609 12.1229 45.5507 11.9814 44.5314L6.85877 7.6188Z" fill="white"/><path d="M33.1857 14.9195L25.8505 34.1576C25.6991 34.5547 25.1763 34.63 24.9177 34.2919L12.3343 17.8339C12.0526 17.4655 12.3217 16.9339 12.7806 16.9524L22.9053 17.3607C22.9698 17.3633 23.0344 17.3541 23.0956 17.3337L32.5088 14.1992C32.9431 14.0546 33.3503 14.4878 33.1857 14.9195Z" fill="url(#paint1_linear_1287_1214)"/><path d="M27.0251 12.5756L19.9352 15.0427C19.8187 15.0832 19.7444 15.1986 19.7546 15.3231L20.3916 23.063C20.4066 23.2453 20.5904 23.3628 20.7588 23.2977L22.7226 22.5392C22.9064 22.4682 23.1021 22.6138 23.0905 22.8128L22.9102 25.8903C22.8982 26.0974 23.1093 26.2436 23.295 26.1567L24.4948 25.5953C24.6808 25.5084 24.892 25.6549 24.8795 25.8624L24.5855 30.6979C24.5671 31.0004 24.9759 31.1067 25.1013 30.8321L25.185 30.6487L29.4298 17.8014C29.5008 17.5863 29.2968 17.3809 29.0847 17.454L27.0519 18.1547C26.8609 18.2205 26.6675 18.0586 26.6954 17.8561L27.3823 12.8739C27.4103 12.6712 27.2163 12.5091 27.0251 12.5756Z" fill="url(#paint2_linear_1287_1214)"/><defs><linearGradient id="paint0_linear_1287_1214" x1="6.48163" y1="1.9759" x2="39.05" y2="48.2064" gradientUnits="userSpaceOnUse"><stop stop-color="#49C7FF"/><stop offset="1" stop-color="#BD36FF"/></linearGradient><linearGradient id="paint1_linear_1287_1214" x1="11.8848" y1="16.4266" x2="26.7246" y2="31.4177" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="paint2_linear_1287_1214" x1="21.8138" y1="13.7046" x2="26.2464" y2="28.8069" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset="0.0833333" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs></svg>
|
||||
title: 功能强大的网络应用程序开发模板
|
||||
details: Vutron 支持跨平台、多语言、布局和主题以及风格框架。
|
||||
- icon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="160px" height="160px"><path fill="#424e5c" d="M4.5 6.5H75.5V73.5H4.5z"/><path fill="#afc5d8" d="M75,7v66H5V7H75 M76,6H4v68h72V6L76,6z"/><path fill="#afc5d8" d="M4 6H76V18H4z"/><path fill="#bae0bd" d="M25.6 43H54.400000000000006V45H25.6z" transform="rotate(-69.666 39.998 43.999)"/><path fill="#bae0bd" d="M27.9 54.4L16 44 27.9 33.6 29.2 35.1 19 44 29.2 52.9zM52.2 54.5L50.9 53 61 44.1 50.9 35.1 52.2 33.6 64 44.1z"/></svg>
|
||||
title: 通过热加载实现快速开发
|
||||
details: 为开发人员提供最大程度的功能支持,缩短项目初始设置时间。
|
||||
- icon: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="64px" height="64px"><circle cx="16" cy="17" r="5" fill="#ed0049"/><path fill="#ed0049" d="M23,31H9v0c0-3.866,3.134-7,7-7h0C19.866,24,23,27.134,23,31L23,31z"/><path fill="#0f518c" d="M19,4c0-1.657-1.343-3-3-3s-3,1.343-3,3c0,0.885,0.391,1.672,1,2.222V10h4V6.222 C18.609,5.672,19,4.885,19,4z"/><path fill="#0f518c" d="M7.061,8.318c-1.171-1.171-3.071-1.171-4.243,0s-1.171,3.071,0,4.243 c0.626,0.626,1.459,0.906,2.278,0.864l2.672,2.672l2.828-2.828l-2.672-2.672C7.967,9.777,7.686,8.944,7.061,8.318z"/><path fill="#0f518c" d="M24.879,8.318c1.171-1.171,3.071-1.171,4.243,0s1.171,3.071,0,4.243 c-0.626,0.626-1.459,0.906-2.278,0.864l-2.672,2.672l-2.828-2.828l2.672-2.672C23.972,9.777,24.253,8.944,24.879,8.318z"/><path fill="#0f518c" d="M24.879,27.218c1.171,1.171,3.071,1.171,4.243,0c1.171-1.171,1.171-3.071,0-4.243 c-0.626-0.626-1.459-0.906-2.278-0.864l-2.672-2.672l-2.828,2.828l2.672,2.672C23.972,25.759,24.253,26.592,24.879,27.218z"/><g><path fill="#0f518c" d="M7.061,27.218c-1.171,1.171-3.071,1.171-4.243,0c-1.171-1.171-1.171-3.071,0-4.243 c0.626-0.626,1.459-0.906,2.278-0.864l2.672-2.672l2.828,2.828L7.925,24.94C7.967,25.759,7.686,26.592,7.061,27.218z"/></g></svg>
|
||||
title: 可靠的维护支持
|
||||
details: 我们有许多实际的使用案例,而且我们拥有快速的技术支持。
|
||||
---
|
||||
@ -0,0 +1,23 @@
|
||||
---
|
||||
order: 4
|
||||
---
|
||||
|
||||
# 自动测试
|
||||
|
||||
**Vutron**包括自动测试。测试框架使用微软的\*\*[Playwright](https://playwright.dev)。
|
||||
|
||||
**Playwright**针对网络应用测试进行了优化,并完全支持**Electron**框架。它易于安装,无需配置即可立即开始测试,并且是跨平台的。您可以在此处了解有关**Playwright**的更多信息:https://github.com/microsoft/playwright
|
||||
|
||||
此模板仅对模板主屏幕进行了非常简单的启动和行为测试。高级测试取决于您的应用程序范围。
|
||||
|
||||
目前,测试规范文件位于`tests`目录中,测试结果文件位于`tests/results`中。(内置测试规范文件不会生成单独的结果文件。)
|
||||
|
||||
Playwright配置文件位于项目根目录下的playwright.config.ts,更多信息请参阅以下文档:https://playwright.dev/docs/test-configuration
|
||||
|
||||
完成所有配置后,您可以使用以下命令进行测试。
|
||||
|
||||
```shell
|
||||
$ npm run test
|
||||
```
|
||||
|
||||
在运行测试之前,请清空构建目录(`dist`)并编译测试包。
|
||||
@ -0,0 +1,84 @@
|
||||
---
|
||||
order: 2
|
||||
---
|
||||
|
||||
# 构建配置
|
||||
|
||||
模块安装完成后,只需执行以下命令即可构建平台软件包。
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
已构建的软件包可在 `release/{version}` 位置找到。
|
||||
|
||||
如需了解更多信息,请参阅以下文章: https://webpack.electron.build/dependency-management#installing-native-node-modules
|
||||
|
||||
## 多平台构建需要做些什么?
|
||||
|
||||
要为每个操作系统创建软件包,必须在相同的操作系统上构建。例如,macOS 的软件包必须在 macOS 机器上构建。
|
||||
|
||||
不过,你可以在一个操作系统上同时为 Windows、macOS 和 Linux 构建软件包。不过,这可能需要一些准备工作。
|
||||
|
||||
如果想在一个平台上同时构建多个平台,建议使用**macOS**。因为只需几个非常简单的设置就能对其进行配置。
|
||||
|
||||
您可以使用以下命令同时执行多平台构建。或者,你也可以通过上面的单独构建命令,只针对你想要的操作系统进行构建。
|
||||
|
||||
```shell
|
||||
$ npm run build:all
|
||||
```
|
||||
|
||||
Linux 构建可能需要 "Multipass" 配置。通过以下链接了解有关 `Multipass` 的更多信息: https://multipass.run
|
||||
|
||||
要了解有关多平台构建的更多信息,请参阅以下文章: https://electron.build/multi-platform-build
|
||||
|
||||
## 通过排除开发文件减少软件包大小
|
||||
|
||||
您可以通过在 `buildAssets/builder/config.ts` 的 files 属性中添加文件模式,在构建时排除不需要的文件。这将节省捆绑包的容量。
|
||||
|
||||
下面是一个不必要的 `node_modules` 文件模式,可以进一步节省捆绑包。根据项目情况,使用下面的规则可能会导致问题,因此请在使用前进行审查。
|
||||
|
||||
```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)"
|
||||
]
|
||||
```
|
||||
|
||||
## 使用本地 Node 模块的项目的构建设置
|
||||
|
||||
对于使用 **Native Node Module**的项目,请将以下脚本添加到您的 `package.json`: 安装依赖项时,`electron-builder` 会处理任何需要重建的模块。
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"postinstall": "electron-builder install-app-deps"
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -0,0 +1,58 @@
|
||||
---
|
||||
order: 1
|
||||
---
|
||||
|
||||
# 入门
|
||||
|
||||
## 克隆项目
|
||||
|
||||
### 方法 1: `npm init` (推荐)
|
||||
|
||||
只需使用 npm 命令,就能轻松克隆一个版本库。
|
||||
|
||||
```shell
|
||||
$ npm init vutron
|
||||
```
|
||||
|
||||
上述方法不会为项目创建不必要的文档和`.github`相关文件。
|
||||
|
||||
### 方法 2: 使用此模板
|
||||
|
||||
点击 **[使用此模板](https://github.com/jooy2/vutron/generate)**,立即创建自己的项目。
|
||||
|
||||
此方法可立即在 GitHub 上创建一个仓库,但在使用之前,您需要在本地克隆该项目。
|
||||
|
||||
### 方法 3: 克隆该版本库
|
||||
|
||||
使用以下命令克隆该 repo。此方法适用于直接向 Vutron 代码库投稿。
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/jooy2/vutron <PROJECT_NAME>
|
||||
```
|
||||
|
||||
## 安装
|
||||
|
||||
克隆项目后,在终端运行以下命令:
|
||||
|
||||
```shell
|
||||
# via npm
|
||||
$ npm i
|
||||
|
||||
# via yarn (https://yarnpkg.com)
|
||||
$ yarn install
|
||||
|
||||
# via pnpm (https://pnpm.io)
|
||||
$ pnpm i
|
||||
```
|
||||
|
||||
## 在开发环境中运行
|
||||
|
||||
开发环境中的应用程序通过 **[Vite](https://vitejs.dev)** 运行。
|
||||
|
||||
```shell
|
||||
$ npm run dev
|
||||
```
|
||||
|
||||
如果运行命令行命令后应用程序没有出现,您可能需要检查默认端口是否被其他应用程序使用。
|
||||
|
||||
Vite 默认使用端口 `5173`。
|
||||
@ -0,0 +1 @@
|
||||
# 安装和构建
|
||||
@ -0,0 +1,36 @@
|
||||
---
|
||||
order: 5
|
||||
---
|
||||
|
||||
# 管理本地文档
|
||||
|
||||
Vutron 中的文档可以通过 VitePress 查看器在本地环境中查看。
|
||||
|
||||
此功能仅在克隆整个项目时可用。如果您使用 npm init vutron 创建项目,则不会包含 docs 文件夹。
|
||||
|
||||
## 安装
|
||||
|
||||
以下说明中的所有操作均应在"文档"文件夹中完成。
|
||||
|
||||
```shell
|
||||
$ cd docs
|
||||
```
|
||||
|
||||
使用以下命令安装相关软件包:
|
||||
|
||||
```shell
|
||||
# via npm
|
||||
$ npm i
|
||||
|
||||
# via yarn (https://yarnpkg.com)
|
||||
$ yarn install
|
||||
|
||||
# via pnpm (https://pnpm.io)
|
||||
$ pnpm i
|
||||
```
|
||||
|
||||
您可以通过以下命令运行托管文档的本地服务器。
|
||||
|
||||
```shell
|
||||
$ npm run dev
|
||||
```
|
||||
@ -0,0 +1,39 @@
|
||||
---
|
||||
title: NPM Scripts
|
||||
order: 3
|
||||
---
|
||||
|
||||
# Npm 脚本
|
||||
|
||||
> $ npm run %SCRIPT_NAME%
|
||||
|
||||
## 一般情况
|
||||
|
||||
| 脚本名称 | 说明 |
|
||||
| ----------------- | ---------------------------------------------------------- |
|
||||
| `dev` | 启动电子作为开发环境 |
|
||||
| `dev:debug` | 将 Electron 作为开发环境启动(使用 vite debug) |
|
||||
| `dev:debug:force` | 以Electron作为开发环境启动(使用vite调试+清理vite缓存) |
|
||||
| `build:pre` | 通常在编译时运行的命令。此脚本无需单独运行。 |
|
||||
| `build` | 为当前操作系统打包。 |
|
||||
| `build:all` | 为整个操作系统构建指定软件包(需要跨平台构建配置) |
|
||||
| `build:dir` | `electron-builder`目录构建 |
|
||||
| `build:mac` | 为macOS构建预配置软件包 |
|
||||
| `build:linux` | 为Linux构建预配置软件包 |
|
||||
| `build:win` | 为Windows构建预配置软件包 |
|
||||
| `lint` | ESLint代码检查。它不会修改代码。 |
|
||||
| `lint:fix` | ESLint代码检查。使用自动修复功能修复代码。 |
|
||||
| `format` | 更漂亮的代码检查。它不会修改代码。 |
|
||||
| `format:fix` | 更漂亮的代码检查。使用自动修复功能修复代码。 |
|
||||
| `test` | 根据测试规范文件构建测试包并运行测试。 |
|
||||
| `test:linux` | 根据测试规范文件构建测试包并运行测试。(仅适用于linux ci) |
|
||||
|
||||
## 文档
|
||||
|
||||
仅用于为项目文档提供素材。必须从“文档”目录位置运行。
|
||||
|
||||
| Script Name | Description |
|
||||
| ----------- | ---------------------------------------------- |
|
||||
| `dev` | 启动本地文档服务器。(开发中) |
|
||||
| `build` | 构建本地文档服务器。仅用于 GitHub 页面构建器。 |
|
||||
| `serve` | 启动本地文档服务器。 |
|
||||
21
lingtropy-client/docs/src/zhHans/introduction.md
Normal file
21
lingtropy-client/docs/src/zhHans/introduction.md
Normal file
@ -0,0 +1,21 @@
|
||||
# 导言
|
||||
|
||||
**Vutron** 是一个预配置的模板,用于开发 `Electron` 跨平台桌面应用。它使用 `Vue 3`,使您能够轻松构建快速的开发环境。
|
||||
|
||||
## 使用优势
|
||||
|
||||
- ✅ 无需任何预设,即可立即构建,快速开发。
|
||||
- ✅ 快速维护,与最新的 `Vue` 和 `Electron` 以及许多模块兼容。
|
||||
- ✅ 通过使用各种附加模板,无需担心布局和数据管理。
|
||||
|
||||
## 特点
|
||||
|
||||
- ⚡️ 通过热重载实现快速开发
|
||||
- ⚡️ 跨平台开发和构建支持
|
||||
- ⚡️ 支持自动化应用程序测试
|
||||
- ⚡️ 支持 TypeScript
|
||||
- ⚡️ 多语言支持
|
||||
- ⚡️ 支持主题(暗色和亮色)
|
||||
- ⚡️ 基本布局管理器
|
||||
- ⚡️ 通过 Pinia 存储进行全局状态管理
|
||||
- ⚡️ 通过 GitHub 社区和官方文档提供快速支持
|
||||
15
lingtropy-client/docs/src/zhHans/other-projects.md
Normal file
15
lingtropy-client/docs/src/zhHans/other-projects.md
Normal file
@ -0,0 +1,15 @@
|
||||
# 其他项目
|
||||
|
||||
## 寻找使用 React 制作的 Electron 模板?
|
||||
|
||||
还可以查看由 Vite + React + Material-UI + Electron 组成的 "Retron" 项目。
|
||||
|
||||
https://github.com/jooy2/retron
|
||||
|
||||
## (已废弃)在寻找使用 Webpack 5 编译器的 `Vutron`?
|
||||
|
||||
通过使用 Vite 编译器,我们实现了减少项目和软件包大小、改善开发环境和提高构建速度的目标。
|
||||
|
||||
使用 Webpack 5 编译器的旧版**Vutron**已被分割到以下软件源中,并将很快结束支持。
|
||||
|
||||
https://github.com/jooy2/vutron-webpack
|
||||
@ -0,0 +1 @@
|
||||
# 项目结构
|
||||
@ -0,0 +1,32 @@
|
||||
---
|
||||
order: 2
|
||||
---
|
||||
|
||||
# 预配置组件
|
||||
|
||||
## 网络应用框架
|
||||
|
||||
- [Vite](https://vitejs.dev)
|
||||
- [Electron](https://www.electronjs.org)
|
||||
- [Electron Builder](https://www.electron.build)
|
||||
|
||||
## 开发帮助工具
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org)
|
||||
- [ESLint](https://eslint.org)
|
||||
- [Prettier](https://prettier.io)
|
||||
|
||||
## 前端框架(Vue)
|
||||
|
||||
- [Vue](https://vuejs.org)
|
||||
- [Vue-i18n](https://kazupon.github.io/vue-i18n)
|
||||
- [Vue-router](https://router.vuejs.org)
|
||||
- [Pinia](https://pinia.vuejs.org)
|
||||
|
||||
## 设计框架
|
||||
|
||||
- [Vuetify](https://vuetifyjs.com)
|
||||
|
||||
## 测试
|
||||
|
||||
- [Playwright](https://playwright.dev)
|
||||
@ -0,0 +1,73 @@
|
||||
---
|
||||
order: 1
|
||||
---
|
||||
|
||||
# 项目结构
|
||||
|
||||
```
|
||||
/
|
||||
├─ .github - GitHub文件(仅用于Vutron GitHub项目贡献)
|
||||
│ └─ ISSUE_TEMPLATE/
|
||||
│ └─ resources/ - 用于自述文件(README.md)等的GitHub资源。
|
||||
│ └─ workflows/ - GitHub工作流程定义
|
||||
│ └─ dependabot.yml
|
||||
│ └─ FUNDING.yml
|
||||
├─ .vscode - Visual Studio Code IDE使用的通用项目配置文件
|
||||
├─ buildAssets/ - 用于Electron构建的资源包(图标、徽标等)文件
|
||||
│ └─ builder/
|
||||
│ │ │ └─ config.ts - `electron-builder`动态配置文件
|
||||
│ └─ icons/
|
||||
├─ dist/ - 用于生成软件包的输出目录
|
||||
├─ docs/ - 项目文件(可选)
|
||||
│ └─ .vitepress/
|
||||
│ │ │ └─ config.mts - 用于文档托管的VitePress配置文件
|
||||
│ └─ public/ - VitePress文档页面的根目录
|
||||
├─ node_modules/
|
||||
├─ src/
|
||||
│ ├─ main/ - 主(电子)处理源代码
|
||||
│ │ ├─ utils/ - 主要工艺设备
|
||||
│ │ │ └─ Constants.ts - 全球主要定义
|
||||
│ │ │ └─ Menus.ts - 全球主菜单定义
|
||||
│ │ └─ index.ts - 主要流程入口
|
||||
│ │ └─ IPCs.ts - 主要流程 ipc 处理程序定义
|
||||
│ │ └─ MainRunner.ts - 主流程主窗口处理
|
||||
│ ├─ preload/ - 预加载(Electron-Vue通信桥)过程源代码
|
||||
│ │ └─ index.ts
|
||||
│ ├─ renderer/ - 渲染器(Vue)处理源代码
|
||||
│ │ ├─ components/ - Vue组件集合
|
||||
│ │ │ └─ layout/ - 布局组件
|
||||
│ │ ├─ locales/ - Vue i18n 语言资源文件
|
||||
│ │ ├─ plugins/ - Vue插件定义
|
||||
│ │ ├─ public/ - 静态资源视图
|
||||
│ │ │ └─ images/
|
||||
│ │ ├─ router/ - 视图路由定义
|
||||
│ │ ├─ screens/ - 屏幕组件
|
||||
│ │ │ └─ ErrorScreen.vue - 当渲染程序出现错误时,屏幕上会显示错误信息
|
||||
│ │ │ └─ MainScreen.vue
|
||||
│ │ │ └─ SecondScreen.vue - 屏幕截图
|
||||
│ │ ├─ store/ - Pinia商店(全球状态管理)定义
|
||||
│ │ ├─ utils/ - 渲染器进程实用程序
|
||||
│ │ ├─ App.vue - Vue应用程序的根组件
|
||||
│ │ ├─ index.html - 由电子渲染器进程加载的根静态索引
|
||||
│ └─ └─ main.ts - 渲染器进程入口点
|
||||
├─ tests/ - 应用程序测试配置
|
||||
│ ├─ results/ - PlayWright测试结果文件和屏幕截图的保存位置
|
||||
│ ├─ specs/ - PlayWright测试规格文件
|
||||
│ ├─ fixtures.ts - 测试公共执行API
|
||||
│ └─ testUtil.ts - 测试实用程序
|
||||
├─ .editorconfig - 编辑器推荐的IDE配置文件
|
||||
├─ .eslintignore - ESLint忽略的文件列表
|
||||
├─ .eslintrc.json - ESLint规则配置
|
||||
├─ .gitignore - 不上传到Git的文件列表
|
||||
├─ .prettierignore - 要禁用的文件列表 更美观的文件格式
|
||||
├─ .prettierrc - 更漂亮的规则配置
|
||||
├─ CODE_OF_CONDUCT.md - 仅在GitHub上使用的文件
|
||||
├─ LICENSE - 项目许可证文件
|
||||
├─ package.json - Node.js 包配置
|
||||
├─ package-lock.json
|
||||
├─ playwright.config.ts - 编剧测试规则配置
|
||||
├─ tsconfig.json - TypeScript配置
|
||||
├─ tsconfig.node.json - TypeScript配置
|
||||
├─ vite.config.mts - Vite编译器构建配置
|
||||
└─ README.md - 仅在GitHub上使用的文件
|
||||
```
|
||||
10
lingtropy-client/docs/tsconfig.json
Normal file
10
lingtropy-client/docs/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["src/.vitepress/config.mts", "package.json"]
|
||||
}
|
||||
11578
lingtropy-client/package-lock.json
generated
Normal file
11578
lingtropy-client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
89
lingtropy-client/package.json
Normal file
89
lingtropy-client/package.json
Normal file
@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "lingtropy",
|
||||
"appId": "com.lingnite.lingtropy",
|
||||
"version": "1.0.0",
|
||||
"description": "文案助手",
|
||||
"homepage": "https://vutron.cdget.com",
|
||||
"author": "沈阳泠启网络科技有限公司",
|
||||
"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"
|
||||
},
|
||||
"debug": {
|
||||
"env": {
|
||||
"VITE_DEV_SERVER_URL": "http://localhost:5173"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev:debug": "vite -d",
|
||||
"dev:debug:force": "vite -d --force",
|
||||
"build": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js",
|
||||
"build:pre": "npm run format:fix && vue-tsc --noEmit && vite build",
|
||||
"build:all": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js -wml",
|
||||
"build:dir": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js --dir",
|
||||
"build:mac": "npm run build:pre && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --config=buildAssets/builder/config.js --mac",
|
||||
"build:linux": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js --linux",
|
||||
"build:win": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js --windows",
|
||||
"lint": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter src",
|
||||
"lint:fix": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
|
||||
"format": "prettier .",
|
||||
"format:fix": "prettier . --write",
|
||||
"test": "npm run build:pre && playwright test",
|
||||
"test:linux": "npm run build:pre && xvfb-run --auto-servernum --server-args='-screen 0, 1280x960x24' -- playwright test"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdi/font": "^7.4.47",
|
||||
"lingtropy": "file:",
|
||||
"pinia": "^3.0.1",
|
||||
"vue": "^3.5.13",
|
||||
"vue-i18n": "^11.1.1",
|
||||
"vue-router": "^4.5.0",
|
||||
"vuetify": "^3.7.14",
|
||||
"vutron": "file:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@typescript-eslint/eslint-plugin": "7.16.1",
|
||||
"@typescript-eslint/parser": "7.16.1",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"dotenv": "^16.4.7",
|
||||
"electron": "^34.3.0",
|
||||
"electron-builder": "^25.1.8",
|
||||
"electron-extension-installer": "^1.2.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-config-standard": "17.1.0",
|
||||
"eslint-friendly-formatter": "4.0.1",
|
||||
"eslint-plugin-import": "2.30.0",
|
||||
"eslint-plugin-n": "16.6.2",
|
||||
"eslint-plugin-promise": "6.4.0",
|
||||
"eslint-plugin-vue": "9.28.0",
|
||||
"playwright": "^1.50.1",
|
||||
"prettier": "^3.5.2",
|
||||
"tree-kill": "^1.2.2",
|
||||
"typescript": "5.7.3",
|
||||
"vite": "^6.2.0",
|
||||
"vite-plugin-electron": "^0.29.0",
|
||||
"vite-plugin-electron-renderer": "^0.14.6",
|
||||
"vite-plugin-eslint": "1.8.1",
|
||||
"vite-plugin-vuetify": "^2.1.0",
|
||||
"vue-eslint-parser": "9.4.3",
|
||||
"vue-tsc": "^2.2.4"
|
||||
},
|
||||
"overrides": {
|
||||
"vite-plugin-electron": {
|
||||
"electron": "$electron"
|
||||
}
|
||||
}
|
||||
}
|
||||
11
lingtropy-client/playwright.config.ts
Normal file
11
lingtropy-client/playwright.config.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { defineConfig } from '@playwright/test'
|
||||
|
||||
export default defineConfig({
|
||||
outputDir: 'tests/results',
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
timeout: 60000,
|
||||
expect: {
|
||||
timeout: 10000
|
||||
}
|
||||
})
|
||||
34
lingtropy-client/src/main/IPCs.ts
Normal file
34
lingtropy-client/src/main/IPCs.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { ipcMain, shell, IpcMainEvent, dialog } from 'electron'
|
||||
import Constants from './utils/Constants'
|
||||
|
||||
/*
|
||||
* IPC Communications
|
||||
* */
|
||||
export default class IPCs {
|
||||
static initialize(): void {
|
||||
// Get application version
|
||||
ipcMain.handle('msgRequestGetVersion', () => {
|
||||
return Constants.APP_VERSION
|
||||
})
|
||||
|
||||
// Open url via web browser
|
||||
ipcMain.on('msgOpenExternalLink', async (event: IpcMainEvent, url: string) => {
|
||||
await shell.openExternal(url)
|
||||
})
|
||||
|
||||
// Open file
|
||||
ipcMain.handle('msgOpenFile', async (event: IpcMainEvent, filter: string) => {
|
||||
const filters = []
|
||||
if (filter === 'text') {
|
||||
filters.push({ name: 'Text', extensions: ['txt', 'json'] })
|
||||
} else if (filter === 'zip') {
|
||||
filters.push({ name: 'Zip', extensions: ['zip'] })
|
||||
}
|
||||
const dialogResult = await dialog.showOpenDialog({
|
||||
properties: ['openFile'],
|
||||
filters
|
||||
})
|
||||
return dialogResult
|
||||
})
|
||||
}
|
||||
}
|
||||
155
lingtropy-client/src/main/MainRunner.ts
Normal file
155
lingtropy-client/src/main/MainRunner.ts
Normal file
@ -0,0 +1,155 @@
|
||||
import {
|
||||
app,
|
||||
BrowserWindow,
|
||||
RenderProcessGoneDetails,
|
||||
BrowserWindowConstructorOptions
|
||||
} from 'electron'
|
||||
import Constants, { TrayOptions } from './utils/Constants'
|
||||
import IPCs from './IPCs'
|
||||
import { createTray, hideWindow, showWindow } from './tray.ts'
|
||||
|
||||
const options = {
|
||||
width: Constants.IS_DEV_ENV ? 1500 : 1200,
|
||||
height: 650,
|
||||
tray: {
|
||||
// all optional values from DEFAULT_TRAY_OPTIONS can de defined here
|
||||
enabled: true,
|
||||
menu: false, // true, to use a tray menu ; false to toggle visibility on click on tray icon
|
||||
trayWindow: false // true, to use a tray floating window attached to top try icon
|
||||
}
|
||||
}
|
||||
|
||||
const exitApp = (mainWindow: BrowserWindow): void => {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.hide()
|
||||
}
|
||||
mainWindow.destroy()
|
||||
app.exit()
|
||||
}
|
||||
|
||||
export const createMainWindow = async (): Promise<BrowserWindow> => {
|
||||
let opt: BrowserWindowConstructorOptions = {
|
||||
title: Constants.APP_NAME,
|
||||
show: false,
|
||||
width: options.width,
|
||||
height: options.height,
|
||||
useContentSize: true,
|
||||
webPreferences: Constants.DEFAULT_WEB_PREFERENCES,
|
||||
frame: true
|
||||
}
|
||||
const trayOptions: TrayOptions = options.tray?.enabled
|
||||
? {
|
||||
...Constants.DEFAULT_TRAY_OPTIONS,
|
||||
...options.tray
|
||||
}
|
||||
: {
|
||||
...Constants.DEFAULT_TRAY_OPTIONS,
|
||||
enabled: false
|
||||
}
|
||||
|
||||
// trayWindow requires tray.enabled=true
|
||||
if (trayOptions.enabled && trayOptions.trayWindow) {
|
||||
opt = {
|
||||
...opt,
|
||||
width: options.width,
|
||||
height: options.height,
|
||||
maxWidth: options.width,
|
||||
maxHeight: options.height,
|
||||
show: false,
|
||||
frame: false,
|
||||
fullscreenable: false,
|
||||
hiddenInMissionControl: true,
|
||||
resizable: false,
|
||||
transparent: true,
|
||||
alwaysOnTop: true,
|
||||
webPreferences: {
|
||||
...Constants.DEFAULT_WEB_PREFERENCES,
|
||||
backgroundThrottling: false
|
||||
}
|
||||
}
|
||||
}
|
||||
const mainWindow = new BrowserWindow(opt)
|
||||
|
||||
mainWindow.setMenu(null)
|
||||
|
||||
mainWindow.on('close', (event: Event): void => {
|
||||
event.preventDefault()
|
||||
exitApp(mainWindow)
|
||||
})
|
||||
|
||||
mainWindow.webContents.on('did-frame-finish-load', (): void => {
|
||||
if (Constants.IS_DEV_ENV && Constants.IS_DEVTOOLS) {
|
||||
mainWindow.webContents.openDevTools()
|
||||
}
|
||||
})
|
||||
|
||||
if (trayOptions.enabled) {
|
||||
createTray(mainWindow, trayOptions)
|
||||
}
|
||||
|
||||
if (trayOptions.enabled && trayOptions.trayWindow) {
|
||||
hideWindow(mainWindow)
|
||||
if (trayOptions.showAtStartup) {
|
||||
showWindow(mainWindow)
|
||||
}
|
||||
} else {
|
||||
mainWindow.once('ready-to-show', (): void => {
|
||||
mainWindow.setAlwaysOnTop(true)
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
mainWindow.setAlwaysOnTop(false)
|
||||
})
|
||||
}
|
||||
|
||||
// Initialize IPC Communication
|
||||
IPCs.initialize()
|
||||
|
||||
if (Constants.IS_DEV_ENV) {
|
||||
await mainWindow.loadURL(Constants.APP_INDEX_URL_DEV)
|
||||
} else {
|
||||
await mainWindow.loadFile(Constants.APP_INDEX_URL_PROD)
|
||||
}
|
||||
|
||||
return mainWindow
|
||||
}
|
||||
|
||||
export const createErrorWindow = async (
|
||||
errorWindow: BrowserWindow,
|
||||
mainWindow: BrowserWindow,
|
||||
details?: RenderProcessGoneDetails
|
||||
): Promise<BrowserWindow> => {
|
||||
if (!Constants.IS_DEV_ENV) {
|
||||
mainWindow?.hide()
|
||||
}
|
||||
|
||||
errorWindow = new BrowserWindow({
|
||||
title: Constants.APP_NAME,
|
||||
show: false,
|
||||
resizable: Constants.IS_DEV_ENV,
|
||||
webPreferences: Constants.DEFAULT_WEB_PREFERENCES
|
||||
})
|
||||
|
||||
errorWindow.setMenu(null)
|
||||
|
||||
if (Constants.IS_DEV_ENV) {
|
||||
await errorWindow.loadURL(`${Constants.APP_INDEX_URL_DEV}#/error`)
|
||||
} else {
|
||||
await errorWindow.loadFile(Constants.APP_INDEX_URL_PROD, { hash: 'error' })
|
||||
}
|
||||
|
||||
errorWindow.on('ready-to-show', (): void => {
|
||||
if (!Constants.IS_DEV_ENV && mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.destroy()
|
||||
}
|
||||
errorWindow.show()
|
||||
errorWindow.focus()
|
||||
})
|
||||
|
||||
errorWindow.webContents.on('did-frame-finish-load', (): void => {
|
||||
if (Constants.IS_DEV_ENV) {
|
||||
errorWindow.webContents.openDevTools()
|
||||
}
|
||||
})
|
||||
|
||||
return errorWindow
|
||||
}
|
||||
10
lingtropy-client/src/main/index.dev.ts
Normal file
10
lingtropy-client/src/main/index.dev.ts
Normal file
@ -0,0 +1,10 @@
|
||||
// Warning: This file is only used in the development environment
|
||||
// and is removed at build time.
|
||||
// Do not edit the file unless necessary.
|
||||
import { installExtension, VUEJS_DEVTOOLS } from 'electron-extension-installer'
|
||||
|
||||
installExtension(VUEJS_DEVTOOLS, {
|
||||
loadExtensionOptions: {
|
||||
allowFileAccess: true
|
||||
}
|
||||
})
|
||||
48
lingtropy-client/src/main/index.ts
Normal file
48
lingtropy-client/src/main/index.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { app, WebContents, RenderProcessGoneDetails } from 'electron'
|
||||
import Constants from './utils/Constants'
|
||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||
|
||||
let mainWindow
|
||||
let errorWindow
|
||||
|
||||
app.on('ready', async () => {
|
||||
if (Constants.IS_DEV_ENV) {
|
||||
import('./index.dev')
|
||||
}
|
||||
|
||||
// Disable special menus on macOS by uncommenting the following, if necessary
|
||||
/*
|
||||
if (Constants.IS_MAC) {
|
||||
systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true)
|
||||
systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', true)
|
||||
}
|
||||
*/
|
||||
|
||||
mainWindow = await createMainWindow()
|
||||
})
|
||||
|
||||
app.on('activate', async () => {
|
||||
if (!mainWindow) {
|
||||
mainWindow = await createMainWindow()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
mainWindow = null
|
||||
errorWindow = null
|
||||
|
||||
if (!Constants.IS_MAC) {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on(
|
||||
'render-process-gone',
|
||||
(event: Event, webContents: WebContents, details: RenderProcessGoneDetails) => {
|
||||
errorWindow = createErrorWindow(errorWindow, mainWindow, details)
|
||||
}
|
||||
)
|
||||
|
||||
process.on('uncaughtException', () => {
|
||||
errorWindow = createErrorWindow(errorWindow, mainWindow)
|
||||
})
|
||||
114
lingtropy-client/src/main/tray.ts
Normal file
114
lingtropy-client/src/main/tray.ts
Normal file
@ -0,0 +1,114 @@
|
||||
import { app, screen, Menu, Tray, BrowserWindow } from 'electron'
|
||||
import Constants from './utils/Constants.ts'
|
||||
import { debounce } from './utils/Util.ts'
|
||||
let tray
|
||||
let trayOptions
|
||||
const path = require('path')
|
||||
export function createTray(window: BrowserWindow, options) {
|
||||
trayOptions = options || Constants.DEFAULT_TRAY_OPTIONS
|
||||
// menu or trayWindow, you need to choose
|
||||
if (trayOptions.trayWindow) {
|
||||
trayOptions.menu = false
|
||||
}
|
||||
|
||||
const iconPath = path.join(app.getAppPath(), 'buildAssets/icons/icon16.png')
|
||||
try {
|
||||
tray = new Tray(iconPath)
|
||||
} catch (error) {
|
||||
console.error('Error creating tray:', error)
|
||||
return null
|
||||
}
|
||||
tray.setToolTip(trayOptions.tooltip)
|
||||
if (trayOptions.menu) {
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: 'Show App',
|
||||
click: () => {
|
||||
showWindow(window)
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Hide App',
|
||||
click: () => {
|
||||
hideWindow(window)
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Exit',
|
||||
click: () => {
|
||||
app.quit()
|
||||
}
|
||||
}
|
||||
])
|
||||
// tray icon only with classic window
|
||||
tray.setContextMenu(contextMenu)
|
||||
} else {
|
||||
// handle click on tray icon
|
||||
tray.on('right-click', function (event) {
|
||||
debounce(() => toggleWindow(window))
|
||||
})
|
||||
tray.on('click', function (event) {
|
||||
debounce(() => toggleWindow(window))
|
||||
})
|
||||
// no menu for tray window
|
||||
window.setMenu(null)
|
||||
tray.setContextMenu(null)
|
||||
}
|
||||
// align at startup
|
||||
alignWindow(window)
|
||||
return tray
|
||||
}
|
||||
|
||||
export function hideWindow(window: BrowserWindow) {
|
||||
window.hide()
|
||||
// if (!trayOptions.trayWindow) return;
|
||||
// hide window when click elsewhere on screen
|
||||
window.on('blur', () => {
|
||||
// dont close if devtools
|
||||
if (!window.webContents.isDevToolsOpened()) {
|
||||
window.hide()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function toggleWindow(window: BrowserWindow) {
|
||||
if (window.isVisible()) {
|
||||
hideWindow(window)
|
||||
} else {
|
||||
showWindow(window)
|
||||
}
|
||||
}
|
||||
|
||||
export function showWindow(window: BrowserWindow) {
|
||||
window.show()
|
||||
alignWindow(window)
|
||||
}
|
||||
|
||||
export function alignWindow(window: BrowserWindow) {
|
||||
if (!trayOptions.trayWindow) return
|
||||
|
||||
const b = window.getBounds()
|
||||
const position = calculateWindowPosition(b)
|
||||
window.setBounds({
|
||||
width: b.width,
|
||||
height: b.height,
|
||||
x: position.x,
|
||||
y: position.y
|
||||
})
|
||||
}
|
||||
|
||||
function calculateWindowPosition(b) {
|
||||
const margin = trayOptions.margin
|
||||
const screenBounds = screen.getPrimaryDisplay().size
|
||||
const trayBounds = tray.getBounds()
|
||||
const bottom = trayBounds.y > screenBounds.height / 2
|
||||
const x = Math.floor(trayBounds.x - b.width / 2 - margin.x + trayBounds.width / 2)
|
||||
const y = bottom
|
||||
? Math.floor(trayBounds.y - b.height - margin.y + trayBounds.height / 2)
|
||||
: Math.floor(trayBounds.y + margin.y + trayBounds.height / 2)
|
||||
// constraint into screen
|
||||
return {
|
||||
x: Math.max(0, Math.min(screenBounds.width - b.width, x)),
|
||||
y: Math.max(0, Math.min(screenBounds.height - b.height, y))
|
||||
}
|
||||
}
|
||||
48
lingtropy-client/src/main/utils/Constants.ts
Normal file
48
lingtropy-client/src/main/utils/Constants.ts
Normal file
@ -0,0 +1,48 @@
|
||||
import { join, dirname } from 'path'
|
||||
import { name, version, debug } from '../../../package.json'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
export interface TrayOptions {
|
||||
enabled: boolean
|
||||
trayWindow: boolean
|
||||
menu: boolean
|
||||
tooltip: string
|
||||
margin: { x: number; y: number }
|
||||
showAtStartup: boolean
|
||||
}
|
||||
|
||||
export default class Constants {
|
||||
// Display app name (uppercase first letter)
|
||||
static APP_NAME = name.charAt(0).toUpperCase() + name.slice(1)
|
||||
|
||||
static APP_VERSION = version
|
||||
|
||||
static IS_DEV_ENV = process.env.NODE_ENV === 'development'
|
||||
|
||||
// To show devtools at startup. It requires IS_DEV_ENV=true.
|
||||
// Note: For debugging purpose, window won't be closed if click elsewhere, if devtools is open.
|
||||
static IS_DEVTOOLS = true
|
||||
|
||||
static IS_MAC = process.platform === 'darwin'
|
||||
|
||||
static DEFAULT_WEB_PREFERENCES = {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
enableRemoteModule: false,
|
||||
preload: join(__dirname, '../preload/index.js')
|
||||
}
|
||||
|
||||
static DEFAULT_TRAY_OPTIONS: TrayOptions = {
|
||||
enabled: false,
|
||||
trayWindow: false,
|
||||
menu: false,
|
||||
tooltip: 'Vutron App',
|
||||
margin: { x: 0, y: 0 },
|
||||
showAtStartup: false
|
||||
}
|
||||
|
||||
static APP_INDEX_URL_DEV = `${debug.env.VITE_DEV_SERVER_URL}/index.html`
|
||||
static APP_INDEX_URL_PROD = join(__dirname, '../index.html')
|
||||
}
|
||||
12
lingtropy-client/src/main/utils/Util.ts
Normal file
12
lingtropy-client/src/main/utils/Util.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export function debounce(func, timeout = 200) {
|
||||
let timer
|
||||
return (function (...args) {
|
||||
if (!timer) {
|
||||
func.apply(this, args)
|
||||
}
|
||||
clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
timer = undefined
|
||||
}, timeout)
|
||||
})()
|
||||
}
|
||||
50
lingtropy-client/src/preload/index.ts
Normal file
50
lingtropy-client/src/preload/index.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron'
|
||||
|
||||
// Whitelist of valid channels used for IPC communication (Send message from Renderer to Main)
|
||||
const mainAvailChannels: string[] = ['msgRequestGetVersion', 'msgOpenExternalLink', 'msgOpenFile']
|
||||
const rendererAvailChannels: string[] = []
|
||||
|
||||
contextBridge.exposeInMainWorld('mainApi', {
|
||||
send: (channel: string, ...data: any[]): void => {
|
||||
if (mainAvailChannels.includes(channel)) {
|
||||
ipcRenderer.send.apply(null, [channel, ...data])
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log({ type: 'send', channel, request: data })
|
||||
}
|
||||
} else {
|
||||
throw new Error(`Unknown ipc channel name: ${channel}`)
|
||||
}
|
||||
},
|
||||
on: (channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): void => {
|
||||
if (rendererAvailChannels.includes(channel)) {
|
||||
ipcRenderer.on(channel, listener)
|
||||
} else {
|
||||
throw new Error(`Unknown ipc channel name: ${channel}`)
|
||||
}
|
||||
},
|
||||
once: (channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): void => {
|
||||
if (rendererAvailChannels.includes(channel)) {
|
||||
ipcRenderer.once(channel, listener)
|
||||
} else {
|
||||
throw new Error(`Unknown ipc channel name: ${channel}`)
|
||||
}
|
||||
},
|
||||
off: (channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): void => {
|
||||
if (rendererAvailChannels.includes(channel)) {
|
||||
ipcRenderer.off(channel, listener)
|
||||
} else {
|
||||
throw new Error(`Unknown ipc channel name: ${channel}`)
|
||||
}
|
||||
},
|
||||
invoke: async (channel: string, ...data: any[]): Promise<any> => {
|
||||
if (mainAvailChannels.includes(channel)) {
|
||||
const result = await ipcRenderer.invoke.apply(null, [channel, ...data])
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log({ type: 'invoke', channel, request: data, result })
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
throw new Error(`Unknown ipc channel name: ${channel}`)
|
||||
}
|
||||
})
|
||||
25
lingtropy-client/src/renderer/App.vue
Normal file
25
lingtropy-client/src/renderer/App.vue
Normal file
@ -0,0 +1,25 @@
|
||||
<script setup lang="tsx">
|
||||
import { DefaultLayout } from '@/renderer/components/layout'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<DefaultLayout>
|
||||
<router-view />
|
||||
</DefaultLayout>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
html {
|
||||
overflow-y: auto !important;
|
||||
user-select: none;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
/* Do not force capitalization of button text */
|
||||
.v-btn {
|
||||
text-transform: unset !important;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,12 @@
|
||||
<script setup lang="tsx"></script>
|
||||
|
||||
<template>
|
||||
<v-app>
|
||||
<v-layout>
|
||||
<!-- <HeaderLayout /> -->
|
||||
<v-main>
|
||||
<slot />
|
||||
</v-main>
|
||||
</v-layout>
|
||||
</v-app>
|
||||
</template>
|
||||
@ -0,0 +1,46 @@
|
||||
<script setup lang="tsx">
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const route: any = useRoute()
|
||||
const titleKey: string = (route?.meta?.titleKey || 'title.main') as string
|
||||
|
||||
const handleRoute = (path: string): void => {
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
const isCurrentRoute = (path: string): boolean => {
|
||||
return path === route.path
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<v-app-bar color="primary" density="compact">
|
||||
<v-app-bar-title>{{ $t(titleKey) }}</v-app-bar-title>
|
||||
<template #append>
|
||||
<v-btn
|
||||
prepend-icon="mdi-home"
|
||||
variant="text"
|
||||
:class="{ active: isCurrentRoute('/') }"
|
||||
@click="handleRoute('/')"
|
||||
>
|
||||
{{ $t('title.main') }}
|
||||
</v-btn>
|
||||
<v-btn
|
||||
prepend-icon="mdi-fit-to-screen-outline"
|
||||
variant="text"
|
||||
:class="{ active: isCurrentRoute('/second') }"
|
||||
@click="handleRoute('/second')"
|
||||
>
|
||||
{{ $t('title.second') }}
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-app-bar>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-btn {
|
||||
opacity: 0.4;
|
||||
}
|
||||
.active {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
</style>
|
||||
4
lingtropy-client/src/renderer/components/layout/index.ts
Normal file
4
lingtropy-client/src/renderer/components/layout/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import DefaultLayout from '@/renderer/components/layout/DefaultLayout.vue'
|
||||
import HeaderLayout from '@/renderer/components/layout/HeaderLayout.vue'
|
||||
|
||||
export { DefaultLayout, HeaderLayout }
|
||||
10
lingtropy-client/src/renderer/index.html
Normal file
10
lingtropy-client/src/renderer/index.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
<script type="module" src="./main.ts"></script>
|
||||
</html>
|
||||
21
lingtropy-client/src/renderer/locales/de.json
Normal file
21
lingtropy-client/src/renderer/locales/de.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Hallo Vutron! Alles ist bereit.",
|
||||
"welcome-desc": "Sie können jetzt plattformübergreifende Webanwendungen schreiben. Sehen Sie Ihre Änderungen in Echtzeit und erstellen Sie mit einem einzigen Befehl auf mehreren Plattformen. Wenn Sie damit noch nicht vertraut sind, können Sie Hilfe von der Dokumentationsseite unten erhalten oder vorgefertigten Beispielcode ausführen.",
|
||||
"second-desc": "Auf den zweiten Bildschirm verschoben! Hier gibt es keine!",
|
||||
"selected-file": "Ausgewählte Datei: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "Hauptbildschirm",
|
||||
"second": "Zweiter Bildschirm",
|
||||
"error": "Ein Fehler ist aufgetreten"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Thema wechseln",
|
||||
"change-language": "Sprache ändern",
|
||||
"increase-count": "Zählerstand um 1 erhöhen",
|
||||
"documentation": "dokumentieren",
|
||||
"github": "Quellcode",
|
||||
"open-file": "Öffnen Sie eine Textdatei"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/en.json
Normal file
21
lingtropy-client/src/renderer/locales/en.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Hello Vutron! Everything is ready.",
|
||||
"welcome-desc": "You can now write cross-platform web applications. See changes in real time and build to multiple platforms with one command. If you're not already familiar with it, you can get help from the documentation page below, or run some pre-written example code.",
|
||||
"second-desc": "You have moved to the second screen! There is nothing here!",
|
||||
"selected-file": "Selected file: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "Main Screen",
|
||||
"second": "Second Screen",
|
||||
"error": "Unknown Error"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Change Theme",
|
||||
"change-language": "Change Language",
|
||||
"increase-count": "Count 1 increment",
|
||||
"documentation": "Documentation",
|
||||
"github": "Source Code",
|
||||
"open-file": "Open a text file"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/es.json
Normal file
21
lingtropy-client/src/renderer/locales/es.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Hola Vutron! Todo está listo.",
|
||||
"welcome-desc": "Ahora puede escribir aplicaciones web multiplataforma. Vea sus cambios en tiempo real y cree en múltiples plataformas con un solo comando. Si aún no está familiarizado con él, puede obtener ayuda en la página de documentación a continuación o ejecutar un código de ejemplo preescrito.",
|
||||
"second-desc": "¡Se ha movido a la segunda pantalla! ¡Aquí no hay nada!",
|
||||
"selected-file": "Archivo seleccionado: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "Pantalla Principal",
|
||||
"second": "Segunda Pantalla",
|
||||
"error": "Se produjo un error"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Cambiar de Tema",
|
||||
"change-language": "Cambiar Idioma",
|
||||
"increase-count": "Aumentar la cuenta en 1",
|
||||
"documentation": "Documentación",
|
||||
"github": "Código Fuente",
|
||||
"open-file": "Abrir un archivo de texto"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/fr.json
Normal file
21
lingtropy-client/src/renderer/locales/fr.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Bonjour Vutron ! Tout est prêt.",
|
||||
"welcome-desc": "Vous pouvez maintenant écrire des applications Web multiplateformes. Visualisez vos modifications en temps réel et créez sur plusieurs plates-formes avec une seule commande. Si vous ne le connaissez pas encore, vous pouvez obtenir de l'aide sur la page de documentation ci-dessous ou exécuter un exemple de code pré-écrit.",
|
||||
"second-desc": "Déplacé vers le deuxième écran! Il n'y en a pas ici !",
|
||||
"selected-file": "Fichier sélectionné: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "écran principal",
|
||||
"second": "Deuxième écran",
|
||||
"error": "Erreur est survenue"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Change le thème",
|
||||
"change-language": "Changer de langue",
|
||||
"increase-count": "Augmenter le nombre de 1",
|
||||
"documentation": "Document",
|
||||
"github": "Code source",
|
||||
"open-file": "Ouvrir un fichier texte"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/ja.json
Normal file
21
lingtropy-client/src/renderer/locales/ja.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "こんにちはVutron! すべての準備が完了しました。",
|
||||
"welcome-desc": "これで、クロスプラットフォームのWebアプリケーションを作成できます。 変更内容をリアルタイムで確認し、一度のコマンドで複数のプラットフォームにビルドします。 まだ慣れていない場合は、以下のドキュメントページでヘルプを入手するか、事前に作成されたサンプルコードを実行してみてください。",
|
||||
"second-desc": "2番目の画面に移動しました! ここには何もありません!",
|
||||
"selected-file": "選択したファイル: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "メイン画面",
|
||||
"second": "2番目の画面",
|
||||
"error": "エラー発生"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "テーマの変更",
|
||||
"change-language": "言語の変更",
|
||||
"increase-count": "カウント1増加",
|
||||
"documentation": "文書",
|
||||
"github": "ソースコード",
|
||||
"open-file": "テキストファイルを開く"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/ko.json
Normal file
21
lingtropy-client/src/renderer/locales/ko.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "안녕 Vutron! 모든 준비를 마쳤습니다.",
|
||||
"welcome-desc": "이제 크로스플랫폼 웹 애플리케이션을 작성할 수 있습니다. 변경사항을 실시간으로 확인하고 한 번의 명령으로 여러 플랫폼으로 빌드하세요. 아직 익숙하지 않다면, 아래 문서 페이지에서 도움을 받아보거나 사전에 작성된 예제 코드를 실행해볼 수 있습니다.",
|
||||
"second-desc": "두번째 화면으로 이동하였습니다! 여기는 아무 것도 없습니다!",
|
||||
"selected-file": "선택한 파일: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "메인 화면",
|
||||
"second": "두번째 화면",
|
||||
"error": "에러 발생"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "테마 변경",
|
||||
"change-language": "언어 변경",
|
||||
"increase-count": "카운트 1 증가",
|
||||
"documentation": "문서",
|
||||
"github": "소스코드",
|
||||
"open-file": "텍스트 파일 열기"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/nl.json
Normal file
21
lingtropy-client/src/renderer/locales/nl.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Hallo Vutron! Alles is klaar.",
|
||||
"welcome-desc": "U kunt nu platformonafhankelijke webapplicaties schrijven. Bekijk wijzigingen in realtime en bouw met één opdracht naar meerdere platforms. Als u hiermee nog niet bekend bent, kunt u hulp krijgen via de onderstaande documentatiepagina, of een vooraf geschreven voorbeeldcode uitvoeren.",
|
||||
"second-desc": "U bent naar het tweede scherm gegaan! Hier is niks!",
|
||||
"selected-file": "Geselecteerde bestand: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "Hoofdscherm",
|
||||
"second": "Tweede scherm",
|
||||
"error": "Onbekende Error"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Thema veranderen",
|
||||
"change-language": "Taal wijzigen",
|
||||
"increase-count": "Één stap optellen",
|
||||
"documentation": "Documentatie",
|
||||
"github": "Broncode",
|
||||
"open-file": "Open een bestand"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/pt.json
Normal file
21
lingtropy-client/src/renderer/locales/pt.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Olá Vutron! Tudo está pronto.",
|
||||
"welcome-desc": "Agora você pode escrever aplicativos da Web de plataforma cruzada. Veja suas alterações em tempo real e crie para várias plataformas com um único comando. Se ainda não estiver familiarizado com ele, você pode obter ajuda na página de documentação abaixo ou executar algum código de exemplo pré-escrito.",
|
||||
"second-desc": "Movido para a segunda tela! Não há nenhum aqui!",
|
||||
"selected-file": "Arquivo selecionado: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "Tela principal",
|
||||
"second": "Segunda tela",
|
||||
"error": "Erro desconhecido"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Mudar Tema",
|
||||
"change-language": "Mudar Idioma",
|
||||
"increase-count": "Aumentar a contagem em 1",
|
||||
"documentation": "Documento",
|
||||
"github": "Código fonte",
|
||||
"open-file": "Abra um arquivo de texto"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/ru.json
Normal file
21
lingtropy-client/src/renderer/locales/ru.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "Привет Vutron! Все готово.",
|
||||
"welcome-desc": "Теперь вы можете писать кроссплатформенные веб-приложения. Просматривайте свои изменения в режиме реального времени и выполняйте сборку для нескольких платформ с помощью одной команды. Если вы еще не знакомы с ним, вы можете получить помощь на странице документации ниже или запустить предварительно написанный пример кода.",
|
||||
"second-desc": "Перенесено на второй экран! Здесь их нет!",
|
||||
"selected-file": "Выбранный файл: {filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "Главный экран",
|
||||
"second": "Второй экран",
|
||||
"error": "Неизвестная ошибка"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "Поменять тему",
|
||||
"change-language": "Изменить язык",
|
||||
"increase-count": "Увеличить количество на 1",
|
||||
"documentation": "Документ",
|
||||
"github": "Исходный код",
|
||||
"open-file": "Открыть текстовый файл"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/zh-hans.json
Normal file
21
lingtropy-client/src/renderer/locales/zh-hans.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "你好武特龙! 一切都准备好了。",
|
||||
"welcome-desc": "您现在可以编写跨平台的 Web 应用程序。 实时查看更改并使用一个命令构建到多个平台。 如果您还不熟悉它,可以从下面的文档页面获得帮助,或者运行一些预先编写的示例代码。",
|
||||
"second-desc": "您已移至第二个屏幕! 这里什么都没有!",
|
||||
"selected-file": "选定的文件:{filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "主屏幕",
|
||||
"second": "第二屏",
|
||||
"error": "未知错误"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "改变主题",
|
||||
"change-language": "改变语言",
|
||||
"increase-count": "计数 1 个增量",
|
||||
"documentation": "文档",
|
||||
"github": "源代码",
|
||||
"open-file": "打开文本文件"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/locales/zh-hant.json
Normal file
21
lingtropy-client/src/renderer/locales/zh-hant.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"desc": {
|
||||
"welcome-title": "你好武特龍! 一切都準備好了。",
|
||||
"welcome-desc": "您現在可以編寫跨平台的 Web 應用程序。 實時查看更改並使用一個命令構建到多個平台。 如果您還不熟悉它,可以從下面的文檔頁面獲得幫助,或者運行一些預先編寫的示例代碼。",
|
||||
"second-desc": "您已移至第二個屏幕! 這裡什麼都沒有!",
|
||||
"selected-file": "選定的文件:{filePath}."
|
||||
},
|
||||
"title": {
|
||||
"main": "主屏幕",
|
||||
"second": "第二屏",
|
||||
"error": "未知錯誤"
|
||||
},
|
||||
"menu": {
|
||||
"change-theme": "改變主題",
|
||||
"change-language": "改變語言",
|
||||
"increase-count": "計數 1 個增量",
|
||||
"documentation": "文檔",
|
||||
"github": "源代碼",
|
||||
"open-file": "開啟文字文件"
|
||||
}
|
||||
}
|
||||
21
lingtropy-client/src/renderer/main.ts
Normal file
21
lingtropy-client/src/renderer/main.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
|
||||
import App from '@/renderer/App.vue'
|
||||
import router from '@/renderer/router'
|
||||
import vuetify from '@/renderer/plugins/vuetify'
|
||||
import i18n from '@/renderer/plugins/i18n'
|
||||
|
||||
// Add API key defined in contextBridge to window object type
|
||||
declare global {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
interface Window {
|
||||
mainApi?: any
|
||||
}
|
||||
}
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(vuetify).use(i18n).use(router).use(createPinia())
|
||||
|
||||
app.mount('#app')
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user