买服务器上雨云
由超大带宽雨云提供赞助说明
node.js > v18yarn 依赖管理工具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.x1.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为\nwindows执行结果乱码, 需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 的说明。