买服务器上雨云

说明
node.js > v18
yarn
依赖管理工具MIT License
Copyright (c) 2023 Hiram-Wong
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.
[1] 安装 node.js version18 以上 + yarn 包安装管理工具
[2] 克隆项目
git clone https://github.com/Hiram-Wong/ZyPlayer.git
[3] 进入项目
cd ZyPlayer/
[4] 打开项目<此处使用命令行快捷打开vscode>
code .
[5] 修改代码
[6] 安装依赖包
yarn
[7] 全局安装electron-vite框架
yarn add electron-vite -D
[8] 打包编译发布
yarn build:win[mac/linux]
.npmrc
启用了淘宝镜像, 部分依赖可能404, 需切换到npm官方镜像.npmrc
文件electron_mirror
和electron_builder_binaries_mirror
字段electron-builder.yml
文件electronDownload
字段"electron": "~22.3.27"
4.x
1.0.0-rc.12
"puppeteer-core": "~21.3.8", "puppeteer-in-electron": "^3.0.5"
"npm": "7.24.2"
之后的不再支持调用npm
命令monaco-editor
无法粘贴 win.webContents.paste()
, 该方案监听ctrl+v
会导致普通输入框重复粘贴, 建议监听其他快捷键则正常(改编使用者习惯)editor.addAction
或editor.onKeyDown
监听键盘按下事件, 该方案需手动写逻辑, 仅编辑器主体粘贴生效"monaco-editor": "^0.45.0"
及以下版本, 参考issueElectron
配置nodeIntegration: true
和contextIsolation: false
会导致粘贴失效, 配置参数取反child_process
说明 windows
换行符为\r\n
, mac
和linux
为\n
windows
执行结果乱码, 需chcp 65001
设置编码, 如获取目录数据chcp 65001 | dir
(|
的作用为执行dir
继承chcp 65001
的utf-8
编码)"electron-builder": "^25.1.8"
之后的编译器存在打包后child_process
启动失败问题FileSystemAccessAPI
受浏览器沙箱限制, 无法访问系统目录Electron
提供的dialog
方法配合fs
进行操作[1] 创建有关功能的问题,如新组件。
[2] 将 repo 分支到自己的账户。
[3] 克隆你的分叉。
[4] 在 main 基础上创建一个新分支,如果要添加新组件,分支名称格式应为 component-[组件名称]。(例如 component-steps),而提交信息的格式应为 [组件名称]:关于提交的信息。
[5] 确保运行 yarn build:win[mac/linux] 会输出正确的文件。
[6] 在创建 PR 之前进行重置,以保持提交历史清晰。(合并请求至分支 main)
[7] 提供一些关于 PR 的说明。