Files
JsonTool/json-to-class/README.md
2024-09-27 01:15:47 +08:00

90 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p align="center">
<img style="width: 50px;height: 50px;" src="build/img/icon_128x128.png"/>
</p>
<p align="center">
<strong>JsonToClass</strong>
</p>
<p align="center">
帮助 TypeScript 项目为API接口数据自动生成 TypeScript 类型
</p>
<p align="center">
<a href="https://svelte.dev/">
<img src="https://img.shields.io/badge/svelte-v4.0.5-orange" alt="svelte">
</a>
<a href="https://beta.tauri.app/">
<img src="https://img.shields.io/badge/tauri-v2.0.0-brightgreen" alt="tauri">
</a>
<a href="https://www.typescriptlang.org/">
<img src="https://img.shields.io/badge/typescript-v5.0.2-blue" alt="typescript">
</a>
<a href="https://vitejs.dev/">
<img src="https://img.shields.io/badge/vite-v4.4.4-orange" alt="vitejs">
</a>
<a href="https://www.npmjs.com/package/json-class-interface">
<img src="https://img.shields.io/badge/json__class__interface-v1.1.3-brightgreen" alt="json-class-interface">
</a>
</p>
该软件是本人npm 插件 **[json-class-interface](https://www.npmjs.com/package/json-class-interface)** 的桌面端,为了方便使用所以开发!但为了学习新技术点,所以舍弃大而慢占内存的 electron谁还用 electron你用 electron 落伍了...
**`Tauri`谁用谁知道本项目打包后在Macos上可执行`app`才只有`5.5MB``dmg`可视化安装程序`3.1MB``app`还能再次优化到`2MB`
左右!!**
> 使用场景:本软件可以用在任意 TypeScript 项目中!只要你调接口了,需要为接口返回数据编写类型,那么就可以用。同时为了解耦接口数据字段 和 页面 的深度绑定,可以使用本人的另一个插件 [json-mapper-class](https://www.npmjs.com/package/json-mapper-class)
## 技术栈
- **Tauri**: 基于 `Rust` 的全新桌面端开发框架这里使用2.x版本 **注意: 2.x作者还未开发完成坑非常多慎入项目中用 1.x 即可**
- **Rust**: `Mozilla`开发的为了替代`C++`的系统级编程语言,不建议前端轻易尝试学习
- **Svelte**: 更快更高效更简单好用的 `Vue` 框架 替代者 & 竞争者!
- **Vite**: 更好用快速的 **新型前端构建工具**
- **TypeScript**: 基于 `JavaScript` 构建的强类型编程语言
- **monaco-editor**: `vscode` 的代码编辑器
- **json-class-interface**: 本人的`JSON`转换插件,强烈建议搭配我的另外一个插件 [json-mapper-class](https://www.npmjs.com/package/json-mapper-class) 一起使用
- **svelte-spa-router**: `svelte`的第三方路由
- **svelte-ui**: 唯一还能将就用的 `svelte` 第三方UI框架
## 已实现的功能
- [x] 1: `Json` 转换为 `Class`
- [x] 2: `Json` 转换为 `Interface` 接口
- [x] 3: 转换为**类**时候 自动生成 属性装饰器 `property`
- [x] 4: 转换为**类**时候,可以通过**设置**决定是否为 属性装饰器 `property` 开启默认值
- [x] 5: 可选 `Json` 数据中 `Value``null` 的类型
- [x] 6: **自动存储** 生成 的代码 到 **你指定的路径**,并**配置文件名**
- [x] 7: 手动 切换 **白天模式 & 夜间模式**,或是 **跟随操作系统自动切换**
- [x] 8: 开关 **代码行号**
- [x] 9: 开关 **代码小地图**
- [x] 10: 开关 自动粘贴代码 进入**剪贴板**
- [x] 11: 开机自启
- [x] 12: 软件升级
- [x] 13: 启动欢迎页面
## Windows & MacOs & Linux 下载
**下载地址:** [releases](https://gitee.com/bmycode/json-class-desktop/releases)
**文件说明:**
- Windows 版本JsonToClass_x.x.x_x64-setup.exe
- MacOs 版本JsonToClass_x.x.x_x64.dmg
- Linux 版本JsonToClass_x.x.x_amd64.deb
**注意事项:**
1MacOs 端由于没有`Apple`开发者账号无法进行软件签名,所以安装后打开的时候会提示风险,无法打开,具体参考这篇教程:
[https://blog.csdn.net/m0_37482190/article/details/128957808](https://blog.csdn.net/m0_37482190/article/details/128957808)
2**代码更新速度较快,所以 安装包 落后于 最新代码,有能力的推荐自己部署 Rust + Tauri 环境然后对代码进行打包即可!!!**
## 软件展示
![0](build/img/0.png)
![1](build/img/1.png)
![2](build/img/2.png)
![3](build/img/3.png)
![4](build/img/4.png)
![5](build/img/5.png)
![6](build/img/6.png)