9 Star 52 Fork 20

yejiang1015 / electron

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

@xeajs/electron

快速开始、渐进式、沉浸式、高可用、可配置、模块化、语义化、一键开发、一键打包。

系统架构

Install


git clone https://github.com/xeajs/electron myapp

跨端

  • exe Windows7、Window10 (x86、x64)
  • app Darwin (Mac Os)
  • deb Linux (Ubuntu)

技术栈

内核

electron                  ==>   客户端运行时
electron-builder          ==>   客户端打包

主进程 - 本地服务服务端

Typescript
node
koa
nedb            ==>   Node嵌入式数据库本地持久化加密
...

渲染进程 - 窗口界面

Typescript
React
React-router
Mobx
axios
antd
dayjs             ==>   日期处理工具轻量级
...

CLI 构建

webpack
babel
babel/preset-typescript
...

CLI 效率、工具

prettier
eslint                    ==>   可配置开关开发环境运行时
tslint                    ==>   可配置开关开发环境运行时子进程基于 tsc -w
husky
lint-staged
...

核心能力

  • 提供持久化到本地磁盘的能力

    • 自动检测/创建磁盘存储目录和文件
    • 开箱即用的数据库环境 nedb Nodejs 嵌入式数据库
    • 开箱即用的持久化配置文件 setting.json, 并在渲染进程基于mobx实时更新
    • 开箱即用的日志收集能力,和日志过期管理 $$.log
    • 开放的扩展能力
  • 提供开箱即用高度可配置的前端工程化打包环境

    • 一键进入开发模式
    • 一键打包构建软件包
    • 自动分配版本打包号 (如:Application Setup Version-BUILD_NUMBER.exe|app|deb
    • 主进程编辑热重启
    • 渲染进程编辑热替换 (热替换可以保留类似表单上次编辑的内容,体验更好)
    • 内置git钩子,钩子触发 eslint 和 tslint,触发周期为 git commit
    • 内置工程化脚本,可高度定制,自定义二次配置
    • 内置代码编译脚本和Typescript编译 (Typescript为主)
  • 内置全局命名空间 $$, 提供全局自定义功能

    • $$.Event 内置发布订阅辅助工具,基于 ts 约束 订阅事件名字
    • $$.log 开箱即用的日志系统
    • $$.** 通用工具函数 查看 typings
  • 业务代码全程使用Typescript编写

  • 工程化相关代码使用 Nodejs、JavaScript 编写

  • 区分前端代码和主进程代码分开编译和引用

  • 内置 vscode 编辑器的项目配置

  • sort-imports vscode 插件提供自动对 import 排序

  • antd组件库 主题配置

  • 基于 React.lazy 和 React.Suspense 实现前端路由懒加载

  • styled-jsx css in js 方案

styled-jsx

错误写法

<style jsx>
  {`
      .app-style {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #fff;
      }
  `}
</style>

正确写法

 <style jsx>{`
    .app-style {
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #fff;
    }
`}</style>

TODO

CHANGELOG

写在最后

  1. 欢迎交流
  2. 欢迎体验
  3. 欢迎 Issues
  4. 感谢 Star
  5. 联系作者
MIT License Copyright (c) 2020 yejiang1015 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.

简介

企业级基于Electron + React + Koa + Typescript 技术栈实现的一套基础架构解决方案、快速开发、一键智能打包、快速交付 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/xieyejiang/electron.git
git@gitee.com:xieyejiang/electron.git
xieyejiang
electron
electron
master

搜索帮助