commit 8be1fcce6b34ce61a4c3e374e431df9d45dfca75 Author: 编码猿 Date: Fri Sep 27 01:15:47 2024 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..403adbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.pydio b/.pydio new file mode 100644 index 0000000..58e6d74 --- /dev/null +++ b/.pydio @@ -0,0 +1 @@ +3a4371c0-fadd-476c-bd00-1adcf8f35262 \ No newline at end of file diff --git a/json-class-interface/.gitignore b/json-class-interface/.gitignore new file mode 100644 index 0000000..50c6ab0 --- /dev/null +++ b/json-class-interface/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +package-lock.json +笔记.txt +example.ts +src/ \ No newline at end of file diff --git a/json-class-interface/.pydio b/json-class-interface/.pydio new file mode 100644 index 0000000..c550b63 --- /dev/null +++ b/json-class-interface/.pydio @@ -0,0 +1 @@ +f259e807-500b-424f-88db-2342f1ebdc6d \ No newline at end of file diff --git a/json-class-interface/.workflow/.pydio b/json-class-interface/.workflow/.pydio new file mode 100644 index 0000000..da605e6 --- /dev/null +++ b/json-class-interface/.workflow/.pydio @@ -0,0 +1 @@ +d50b1a8c-81e3-4365-928b-1e5b39528942 \ No newline at end of file diff --git a/json-class-interface/.workflow/branch-pipeline.yml b/json-class-interface/.workflow/branch-pipeline.yml new file mode 100644 index 0000000..1128d8a --- /dev/null +++ b/json-class-interface/.workflow/branch-pipeline.yml @@ -0,0 +1,51 @@ +version: '1.0' +name: branch-pipeline +displayName: BranchPipeline +stages: + - stage: + name: compile + displayName: 编译 + steps: + - step: build@nodejs + name: build_nodejs + displayName: Nodejs 构建 + # 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本 + nodeVersion: 14.16.0 + # 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】 + commands: + - npm install && rm -rf ./dist && npm run build + # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 + artifacts: + # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 + - name: BUILD_ARTIFACT + # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径 + path: + - ./dist + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + # 上游构建任务定义的产物名,默认BUILD_ARTIFACT + dependArtifact: BUILD_ARTIFACT + # 上传到制品库时的制品命名,默认output + artifactName: output + dependsOn: build_nodejs + - stage: + name: release + displayName: 发布 + steps: + - step: publish@release_artifacts + name: publish_release_artifacts + displayName: '发布' + # 上游上传制品任务的产出 + dependArtifact: output + # 发布制品版本号 + version: '1.0.0.0' + # 是否开启版本号自增,默认开启 + autoIncrement: true +triggers: + push: + branches: + exclude: + - master + include: + - .* diff --git a/json-class-interface/.workflow/master-pipeline.yml b/json-class-interface/.workflow/master-pipeline.yml new file mode 100644 index 0000000..8faf2bc --- /dev/null +++ b/json-class-interface/.workflow/master-pipeline.yml @@ -0,0 +1,49 @@ +version: '1.0' +name: master-pipeline +displayName: MasterPipeline +stages: + - stage: + name: compile + displayName: 编译 + steps: + - step: build@nodejs + name: build_nodejs + displayName: Nodejs 构建 + # 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本 + nodeVersion: 14.16.0 + # 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】 + commands: + - npm install && rm -rf ./dist && npm run build + # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 + artifacts: + # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 + - name: BUILD_ARTIFACT + # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径 + path: + - ./dist + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + # 上游构建任务定义的产物名,默认BUILD_ARTIFACT + dependArtifact: BUILD_ARTIFACT + # 上传到制品库时的制品命名,默认output + artifactName: output + dependsOn: build_nodejs + - stage: + name: release + displayName: 发布 + steps: + - step: publish@release_artifacts + name: publish_release_artifacts + displayName: '发布' + # 上游上传制品任务的产出 + dependArtifact: output + # 发布制品版本号 + version: '1.0.0.0' + # 是否开启版本号自增,默认开启 + autoIncrement: true +triggers: + push: + branches: + include: + - master diff --git a/json-class-interface/.workflow/pr-pipeline.yml b/json-class-interface/.workflow/pr-pipeline.yml new file mode 100644 index 0000000..1a05dd0 --- /dev/null +++ b/json-class-interface/.workflow/pr-pipeline.yml @@ -0,0 +1,36 @@ +version: '1.0' +name: pr-pipeline +displayName: PRPipeline +stages: + - stage: + name: compile + displayName: 编译 + steps: + - step: build@nodejs + name: build_nodejs + displayName: Nodejs 构建 + # 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本 + nodeVersion: 14.16.0 + # 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】 + commands: + - npm install && rm -rf ./dist && npm run build + # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 + artifacts: + # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 + - name: BUILD_ARTIFACT + # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径 + path: + - ./dist + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + # 上游构建任务定义的产物名,默认BUILD_ARTIFACT + dependArtifact: BUILD_ARTIFACT + # 上传到制品库时的制品命名,默认output + artifactName: output + dependsOn: build_nodejs +triggers: + pr: + branches: + include: + - master diff --git a/json-class-interface/README.md b/json-class-interface/README.md new file mode 100644 index 0000000..b384fc2 --- /dev/null +++ b/json-class-interface/README.md @@ -0,0 +1,200 @@ +# JsonToClassOrInterface + +## 状态 + +持续开发中... + +- 【完成】~~1: 将开发桌面端软件 和 web网页 进而 方便作为 独立的 工具来使用。~~ +- 【完成】~~2: 增加功能,将生成的 Interface 和 class 自动生成 xxx.ts 文件,并保存到你给的项目路径中,方便开发者将本插件和项目请求进行深度集成~~ + +**基于本插件,自己开发的支持MAC,Linux,Windows 的桌面端项目地址:** +> [https://gitee.com/bmycode/json-class-desktop](https://gitee.com/bmycode/json-class-desktop) + +## 前言 +顾名思义,这是一个把前端接口的`json`数据转化为 `typescript` 的`Interface`或`Class`的插件。 + +当你在用`typescript`开发项目,你是否烦恼过后端接口给我们一坨`json`数据的时候,我们需要为数据 **手动编写大量** 的`Interface`或`Class`,来为请求中间层的方法标注返回类型,然后才能在页面中使用并获得优雅的类型提示 + +**手动写...很麻烦的,为何不 根据 json 数据自动生成???!!!** + +受到 [flutter](https://flutter.dev/) 的 [json to dart](https://javiercbk.github.io/json_to_dart/) 启发,进而开发本插件。 + + +## 注意 + +**本插件只能将json自动生成为 `Interface` 或 `Class`,避免我们手动编写的繁杂过程,但并不能实现类似 flutter json_serializable 将 json数据和类进行映射(序列化)的功能!!** + + +如果你想实现全套 json_serializable 的功能,可以在调用 `toClass` 方法的时候将参数 `needProperty` 开启并设置为`true`(参数说明看下面)。 + +这时候将生成 `json-mapper-class` 插件所需要的 **序列化代码** + +--- + +至于为什么需要 `json-mapper-class` 这个插件,相信开发过`flutter`的你应该很清楚,不清楚去看官网说的说明: + +> [https://docs.flutter.dev/data-and-backend/serialization/json](https://docs.flutter.dev/data-and-backend/serialization/json) + +--- + +如果你需要使用`json和类映射`,那么要在项目里下载引入本插件才能使用,插件地址: + +> [json-mapper-class](https://www.npmjs.com/package/json-mapper-class) + +--- + +可能你会疑惑甚至一脸懵逼,我知道你很急,但是你先别着急,看说明你思考下就明白了: + +插件有两个: +- json-class-interface +- json-mapper-class + +它们之间的使用关系举例说明如下: + + - 假设 http://www.xxx.com/newsInfo 接口返回了 **新闻详情数据** + - 这时我们 使用插件 `json-class-interface` 将接口返回数据转为 类(needProperty参数需要开启),然后将 插件返回的代码复制保存到 xxx.ts 中。 + - 最后 使用插件 `json-mapper-class` 将上一步的类和接口json传入,本插件会自动序列化json存储到类中,**请求中间层方法返回数据类型和页面上直接 使用 类 即可** + + **当然你也可以把这两个插件和你的项目进行深度的集成,让它们更加`自动化`,`无感`,`便捷`,`高效`。** + +## 安装 + +> npm i --save json-class-interface + +## 使用案例 + +```typescript +import { toClass, toInterface } from "json-class-interface"; + +// Json 数据 +let json1 = { + status: 200, + message: "请求成功", + result_list: [ + { + id: 1, + name: "新闻1", + tags_arr: [ + { + tags_id: 1, + tags_title: '标签标题1' + }, + { + tags_id: 1, + tags_title: '标签标题1' + } + ] + }, + { + id: 2, + name: "新闻2", + tags_arr: [ + { + tags_id: 1, + tags_title: '标签标题2' + }, + { + tags_id: 1, + tags_title: '标签标题2' + } + ] + }, + ] +} + +// 1 转换为 Class + +// JsonToClass: 第一层类的名称,随便自定义 +let type: string = toClass("JsonToClass", json1) +console.log(type); + +// json转换为class的结果输出: +// export class TagsArr { +// tags_id!: number; +// tags_title!: string; +// } + +// export class ResultList { +// id!: number; +// name!: string; +// tags_arr!: TagsArr[]; +// } + +// export class JsonToClass { +// status!: number; +// message!: string; +// result_list!: ResultList[]; +// } + + +// 2 转化为 Interface + +let Interface: string = toInterface("JsonToInterface", json1) +console.log(Interface); + +// json转换为Interface的结果输出: +// export interface TagsArr { +// tags_id: number; +// tags_title: string; +// } + +// export interface ResultList { +// id: number; +// name: string; +// tags_arr: TagsArr[]; +// } + +// export interface JsonToInterface { +// status: number; +// message: string; +// result_list: ResultList[]; +// } +``` + +# 方法 + + +将 `json` 数据转化为 `class` + +## toClass(className: string = "JsonToClass", rawJson: JosnType | string, options: ToClassOptions = {}): string + +--- + +将 `json` 数据转化为 `interface`,本方法的效果 和 `toClass` 参数 `interfaceModel: true` 效果一样。为了方便使用,故提供`toInterface`方法 + +## toInterface(className: string = "JsonToInterface", rawJson: JosnType | string, options: ToClassOptions = {}): string + +--- + +方法参数说明: + +| 名称 | 类型 | 默认值 | +| :-----:| :----: | :----: | +| className | string | JsonToClass 或 JsonToInterface | +| rawJson | JosnType 或 string | 不为空 | +| options | ToClassOptions | {} | + + +**JosnType 类型如下:** +``` +export type JosnType = { [key: string]: any }; +``` + +**ToClassOptions 类型如下:** +``` +export interface ToClassOptions { + nullAlias?: string; + needProperty?: boolean; + needPropertyValue?: boolean; + interfaceModel?: boolean +} +``` + +| 名称 | 类型 | 默认值 | 说明 | +| :----:| :----:|:----:|:----:| +| nullAlias | string | "string" | 如果对象值为null,转化为 class 或 interface 时候,给这个对象key个默认类型 | +| needProperty | boolean | false | 是否需要生成Property装饰器,用到插件 json-mapper-class 才需要开启 | +| needPropertyValue | boolean| false | 是否需要生成Property装饰器的默认值,用到插件 json-mapper-class 才需要开启| +| interfaceModel | boolean| false | 是否需要生成 interface 模式 | + + diff --git a/json-class-interface/dist/.pydio b/json-class-interface/dist/.pydio new file mode 100644 index 0000000..02a12ef --- /dev/null +++ b/json-class-interface/dist/.pydio @@ -0,0 +1 @@ +9b3befbc-a965-48c7-ae4b-8602394b74c8 \ No newline at end of file diff --git a/json-class-interface/dist/file.d.ts b/json-class-interface/dist/file.d.ts new file mode 100644 index 0000000..b9b5b7f --- /dev/null +++ b/json-class-interface/dist/file.d.ts @@ -0,0 +1,2 @@ +import { PathLike } from "fs"; +export declare const configFilePath: (path: PathLike) => void; diff --git a/json-class-interface/dist/file.js b/json-class-interface/dist/file.js new file mode 100644 index 0000000..b898b9c --- /dev/null +++ b/json-class-interface/dist/file.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.configFilePath = void 0; +const fs_1 = require("fs"); +const store_1 = require("./store"); +const configFilePath = (path) => { + store_1.config.saveTypeFilePath = path; + console.log("config.saveTypeFilePath: ", store_1.config.saveTypeFilePath); + (0, fs_1.writeFileSync)(store_1.config.saveTypeFilePath, "testetststststststst"); +}; +exports.configFilePath = configFilePath; diff --git a/json-class-interface/dist/index.d.ts b/json-class-interface/dist/index.d.ts new file mode 100644 index 0000000..d4d97da --- /dev/null +++ b/json-class-interface/dist/index.d.ts @@ -0,0 +1,3 @@ +export * from './toClass'; +export * from './toInterface'; +export * from './file'; diff --git a/json-class-interface/dist/index.js b/json-class-interface/dist/index.js new file mode 100644 index 0000000..165addc --- /dev/null +++ b/json-class-interface/dist/index.js @@ -0,0 +1,15 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./toClass"), exports); +__exportStar(require("./toInterface"), exports); +__exportStar(require("./file"), exports); diff --git a/json-class-interface/dist/store.d.ts b/json-class-interface/dist/store.d.ts new file mode 100644 index 0000000..054b69c --- /dev/null +++ b/json-class-interface/dist/store.d.ts @@ -0,0 +1,2 @@ +import { Config } from "./typing"; +export declare const config: Config; diff --git a/json-class-interface/dist/store.js b/json-class-interface/dist/store.js new file mode 100644 index 0000000..80c9f13 --- /dev/null +++ b/json-class-interface/dist/store.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.config = void 0; +exports.config = { + saveTypeFilePath: "" +}; diff --git a/json-class-interface/dist/toClass.d.ts b/json-class-interface/dist/toClass.d.ts new file mode 100644 index 0000000..644df6e --- /dev/null +++ b/json-class-interface/dist/toClass.d.ts @@ -0,0 +1,2 @@ +import { JosnType, ToClassOptions } from "./typing"; +export declare const toClass: (className: string, rawJson: JosnType | string, options?: ToClassOptions, repeat?: boolean) => string; diff --git a/json-class-interface/dist/toClass.js b/json-class-interface/dist/toClass.js new file mode 100644 index 0000000..f93ffe5 --- /dev/null +++ b/json-class-interface/dist/toClass.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toClass = void 0; +const utils_1 = require("./utils"); +let TextResult = ""; +const toClass = (className = "JsonToClass", rawJson, options = {}, repeat = false) => { + typeof (rawJson) === "string" ? rawJson = JSON.parse(rawJson) : null; + (0, utils_1.isArray)(rawJson) ? rawJson = rawJson[0] : null; + if (!repeat) { + TextResult = ""; + } + let classText = (0, utils_1.stripIndent) ` + ${(0, utils_1.setInterfaceModel)(options)} ${className} { + ${Object.keys(rawJson).map(key => { + let ArrayInsideNotObject = false; + if ((0, utils_1.isObjectOrArray)(rawJson[key])) { + if ((0, utils_1.isArray)(rawJson[key]) && (0, utils_1.isObject)(rawJson[key][0])) { + (0, exports.toClass)((0, utils_1.firstLetterCap)(key), rawJson[key], options, true); + } + if ((0, utils_1.isObject)(rawJson[key])) { + ArrayInsideNotObject = false; + (0, exports.toClass)((0, utils_1.firstLetterCap)(key), rawJson[key], options, true); + } + } + return `${(0, utils_1.setDefaultNeedPropertyValue)(options, key) == null ? '' : (0, utils_1.setDefaultNeedPropertyValue)(options, key)} + ${(0, utils_1.setKeyNotNull)(options, key)}: ${ArrayInsideNotObject + ? `${typeof rawJson[key][0]}[]` + : (0, utils_1.isObjectOrArray)(rawJson[key]) + ? `${(0, utils_1.firstLetterCap)(key)}${(0, utils_1.isArray)(rawJson[key]) ? '[]' : ''}` + : (0, utils_1.isNull)(rawJson[key]) ? (0, utils_1.setDefaultNull)(options) : typeof rawJson[key]}; + `; + })} + } + `; + TextResult += `${classText} \n\n`; + return TextResult; +}; +exports.toClass = toClass; diff --git a/json-class-interface/dist/toInterface.d.ts b/json-class-interface/dist/toInterface.d.ts new file mode 100644 index 0000000..178eee2 --- /dev/null +++ b/json-class-interface/dist/toInterface.d.ts @@ -0,0 +1,2 @@ +import { JosnType, ToClassOptions } from "./typing"; +export declare const toInterface: (className: string, rawJson: JosnType | string, options?: ToClassOptions) => string; diff --git a/json-class-interface/dist/toInterface.js b/json-class-interface/dist/toInterface.js new file mode 100644 index 0000000..ed79462 --- /dev/null +++ b/json-class-interface/dist/toInterface.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toInterface = void 0; +const toClass_1 = require("./toClass"); +const toInterface = (className = "JsonToInterface", rawJson, options = {}) => { + options.interfaceModel = true; + return (0, toClass_1.toClass)(className, rawJson, options); +}; +exports.toInterface = toInterface; diff --git a/json-class-interface/dist/typing.d.ts b/json-class-interface/dist/typing.d.ts new file mode 100644 index 0000000..d411291 --- /dev/null +++ b/json-class-interface/dist/typing.d.ts @@ -0,0 +1,14 @@ +/// +import { PathLike } from "fs"; +export declare type JosnType = { + [key: string]: any; +}; +export declare type Config = { + saveTypeFilePath: PathLike; +}; +export interface ToClassOptions { + nullAlias?: string; + needProperty?: boolean; + needPropertyValue?: boolean; + interfaceModel?: boolean; +} diff --git a/json-class-interface/dist/typing.js b/json-class-interface/dist/typing.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/json-class-interface/dist/typing.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/json-class-interface/dist/utils.d.ts b/json-class-interface/dist/utils.d.ts new file mode 100644 index 0000000..fcb7cb8 --- /dev/null +++ b/json-class-interface/dist/utils.d.ts @@ -0,0 +1,13 @@ +import { ToClassOptions } from "./typing"; +export declare const isNull: (val: any) => boolean; +export declare const isUndefined: (val: any) => boolean; +export declare const isNullOrUndefined: (val: any) => boolean; +export declare const isArray: (val: any) => boolean; +export declare const isObject: (val: any) => boolean; +export declare const isObjectOrArray: (val: any) => boolean; +export declare const firstLetterCap: (val: string) => string; +export declare const setDefaultNull: (options: ToClassOptions) => string; +export declare const setDefaultNeedPropertyValue: (options: ToClassOptions, key: string) => string; +export declare const setInterfaceModel: (options: ToClassOptions) => "export interface" | "export class"; +export declare const setKeyNotNull: (options: ToClassOptions, key: string) => string; +export declare const stripIndent: (template: TemplateStringsArray, ...expressions: any[]) => string; diff --git a/json-class-interface/dist/utils.js b/json-class-interface/dist/utils.js new file mode 100644 index 0000000..e43ecfc --- /dev/null +++ b/json-class-interface/dist/utils.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stripIndent = exports.setKeyNotNull = exports.setInterfaceModel = exports.setDefaultNeedPropertyValue = exports.setDefaultNull = exports.firstLetterCap = exports.isObjectOrArray = exports.isObject = exports.isArray = exports.isNullOrUndefined = exports.isUndefined = exports.isNull = void 0; +const isNull = (val) => val === null; +exports.isNull = isNull; +const isUndefined = (val) => val === undefined; +exports.isUndefined = isUndefined; +const isNullOrUndefined = (val) => (0, exports.isNull)(val) || (0, exports.isUndefined)(val); +exports.isNullOrUndefined = isNullOrUndefined; +const isArray = (val) => Array.isArray(val); +exports.isArray = isArray; +const isObject = (val) => (0, exports.isNull)(val) ? false : val.constructor === Object; +exports.isObject = isObject; +const isObjectOrArray = (val) => (0, exports.isObject)(val) || (0, exports.isArray)(val); +exports.isObjectOrArray = isObjectOrArray; +const firstLetterCap = (val) => { + let splitArr = val.split("_"); + return splitArr.map(v => v.charAt(0).toUpperCase() + v.slice(1)).join(""); +}; +exports.firstLetterCap = firstLetterCap; +const setDefaultNull = (options) => options?.nullAlias ? options?.nullAlias : "string"; +exports.setDefaultNull = setDefaultNull; +const setDefaultNeedPropertyValue = (options, key) => { + options.needProperty = options.needProperty || false; + return options?.needProperty + ? options?.interfaceModel + ? null + : options?.needPropertyValue + ? `\t\n@property("${key}")` + : `@property()` + : null; +}; +exports.setDefaultNeedPropertyValue = setDefaultNeedPropertyValue; +const setInterfaceModel = (options) => options?.interfaceModel ? 'export interface' : `export class`; +exports.setInterfaceModel = setInterfaceModel; +const setKeyNotNull = (options, key) => `${key}${options?.interfaceModel ? '' : '!'}`; +exports.setKeyNotNull = setKeyNotNull; +const stripIndent = (template, ...expressions) => { + let result = template.reduce((prev, next, i) => { + let expression = expressions[i - 1]; + if ((0, exports.isArray)(expression)) { + expression = expression.join(''); + } + return prev + expression + next; + }); + const match = result.match(/^[^\S\n]*(?=\S)/gm); + const indent = match && Math.min(...match.map(el => el.length)); + if (indent) { + const regexp = new RegExp(`^.{${indent}}`, 'gm'); + result = result.replace(regexp, ''); + } + result = result.replace(/^[^\S\n]+/gm, ' '); + result = result.trim(); + return result; +}; +exports.stripIndent = stripIndent; diff --git a/json-class-interface/package.json b/json-class-interface/package.json new file mode 100644 index 0000000..24dfbc3 --- /dev/null +++ b/json-class-interface/package.json @@ -0,0 +1,21 @@ +{ + "name": "json-class-interface", + "version": "1.1.7", + "description": "将json数据自动转换为class或interface", + "main": "dist/index.js", + "scripts": { + "dev": "clear && ts-node example.ts", + "build": "tsc -w", + "publish": "npm publish", + "git": "git add -A && git commit -m '提交' && git pull && git push ", + "push": "npm run git && npm run publish " + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.7.2", + "tslib": "^2.6.2", + "typescript": "^5.2.2" + } +} diff --git a/json-class-interface/tsconfig.json b/json-class-interface/tsconfig.json new file mode 100644 index 0000000..ab1b9b9 --- /dev/null +++ b/json-class-interface/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "resolveJsonModule": true, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "esModuleInterop": true, + "sourceMap": false, + "noImplicitAny": false, + "removeComments": true, + "declaration": true, + "outDir": "./dist", + "lib": [ "es6", "DOM" ] + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/json-mapper-class/.gitignore b/json-mapper-class/.gitignore new file mode 100644 index 0000000..dcbe49e --- /dev/null +++ b/json-mapper-class/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +test.ts +src/ \ No newline at end of file diff --git a/json-mapper-class/.pydio b/json-mapper-class/.pydio new file mode 100644 index 0000000..4cddd3a --- /dev/null +++ b/json-mapper-class/.pydio @@ -0,0 +1 @@ +8df5a678-3cf4-4606-9f91-a723a276c56c \ No newline at end of file diff --git a/json-mapper-class/README.md b/json-mapper-class/README.md new file mode 100644 index 0000000..283d941 --- /dev/null +++ b/json-mapper-class/README.md @@ -0,0 +1,489 @@ +# json-mapper-class + +`json-mapper-class` 是类似flutter Json序列化的 **web前端 优雅 解决方案**,用来将接口 json 数据映射到 class 的工具,之后在我们的`TypeScript`项目中,可以通过 **类来为接口返回数据标注类型**,通过修改类属性达到不需要后端修改接口数据字段的情况下,前端来任意定义接口返回字段的效果,解决了实际项目中接口数据与页面深度耦合的过程,并提供其逆过程。 + +`json-mapper-class` 是一个独立的插件,可以与任何的 `TypeScript` 项目进行深度的集成(最好是class语法),同时提供了众多的装饰器,让你更加**优雅**的去编写 `TypeScript`,请仔细阅读文档。 + +同时为了方便 `json-mapper-class` 的方法 `toClass` 第二个参数的生成,也是为了避免手动编写`json-mapper-class` **标准类 模版代码** 的过程,本人开发第二个插件简化了过程,插件地址(请自信阅读文档): + +> [json-class-interface](https://www.npmjs.com/package/json-class-interface) + + +下面是一个案例: + +```ts +import { property, toClass } from 'json-mapper-class'; + +class UserModel { + @property('i') + id: number; + + @property() + name: string; +} + +const userRaw = { + i: 1234, + name: 'name', +}; + +// 使用 toClass 将 json 转换成 class +const userModel = toClass(userRaw, UserModel); +// 你将获得如下数据 +{ + id: 1234, + name: 'name', +} +``` + + +# 如何安装 + +```bash +npm i json-mapper-class --save +``` + +# 使用例子 + +## 聚合对象或数组 + +如果你想转换一个聚合对象,需要提供目标类。如果该对象的某个属性值是数组,则会递归该数组的所有元素(不管层级有多深),自动转换为目标类的实例。 + +列子: + +```ts +class NestedModel { + @property('e', UserModel) + employees: UserModel[]; + + @typed(UserModel) + @property('u') + user: UserModel; +} + +const model = toClass( + { + e: [ + { i: 1, n: 'n1' }, + { i: 2, n: 'n2' }, + ], + u: { + i: 1, + n: 'name', + } + }, + NestedModel, +); +// you will get like this +{ + employees: [ + { id: 1, name: 'n1' }, + { id: 2, name: 'n2' }, + ], + user: { + id: 1, + name: 'name' + } +} + +const model = toPlain( + { + employees: [ + { id: 1, name: 'n1' }, + { id: 2, name: 'n2' }, + ], + user: { + id: 1, + name: 'name' + } + }, + NestedModel, +); +// you will get like this +{ + e: [ + { i: 1, n: 'n1' }, + { i: 2, n: 'n2' }, + ], + u: { + i: 1, + n: 'name' + } +} +``` + +## 其他数据类型转换 + +```ts +import * as moment from 'moment'; + +export class EduModel { + @property('i') + id: number; + + @property('crt') + @deserialize(value => moment(value).format('YYYY-MM-DD HH:mm:ss')) + createTime: string; +} +``` + +## 依赖于其他属性值 + +```ts +class EmailModel { + @property('s') + site: string; + + @property('e') + @deserialize((value, _instance, origin) => `${value}@${origin.s}`) + email: string; +} +``` + +# 方法 + +## toClass(raw, clazzType, options?) / toClasses(raws, clazzType, options?) + +将一个 json 对象映射成一个类实例 + +- `raw` / `raws` `>` 一个 josn 对象或者 json 对象数据 +- `clazzType` `` 类的构造函数 +- `options?` `` 配置 + - `ignoreDeserializer` `` 当设置为 true 时,不会调用使用 @deserialize 装饰器配置的方法 + - `ignoreBeforeDeserializer` `` 当设置为 true 时,不会调用使用 @beforeDeserialize 装饰器配置的方法 + - `distinguishNullAndUndefined` `` 当设置为 true 时,区分 null 和 undefined + +示例: + +```ts +const userRaw = { + i: 1234, + name: 'name', +}; +const userRaws = [ + { + i: 1000, + name: 'name1', + }, + { + i: 2000, + name: 'name2', + }, +]; +const userModel = toClass(userRaw, UserModel); +const userModels = toClasses(userRaws, UserModel); +``` + +## toPlain(instance, clazzType, options?) / toPlains(instances, clazzType, options?) + +将一个类实例或者 json 对象映射成另外一个 json 对象 + +- `instance` / `instances` `>` 一个 json 或类实例,或者一个json或类实例组成的数组 +- `clazzType` `` Constructor of the target class +- `options?` `` 类的构造函数 + - `ignoreSerializer` `` 当设置为 true 时,不会调用使用 @serialize 装饰器配置的方法 + - `ignoreAfterSerializer` `` 当设置为 true 时,不会调用使用 @afterSerialize 装饰器配置的方法 + - `distinguishNullAndUndefined` `` 当设置为 true 时,区分 null 和 undefined + +示例: + +```ts +const userModel = { + id: 1234, + name: 'name', +}; +const userModels = [ + { + id: 1000, + name: 'name1', + }, + { + id: 2000, + name: 'name2', + }, +]; +const userRaw = toPlain(userModel, UserModel); +const userRaws = toPlains(userModels, UserModel); +``` + +# 属性装饰器 + +调用不同的方法时,这些装饰器的执行顺序: + +- `toClass/toClasses`: beforeDeserializer => typed(映射成一个类实例) => deserializer +- `toPlain/toPlains`: serializer => typed(映射成一个对象) => afterSerializer + +## property(originalKey?, clazzType?, optional = false) + +将一个 key 映射到另外一个 key,如 `n => name` + +- `originalKey` `` 被映射的数据 key, 如果不传则默认同名 +- `clazzType` `` 自动将该属性的值映射到一个类实例,相当于调用了 `toClass` 方法 +- `optional` `` 是否可选 + +示例: + +```ts +class PropertyModel { + @property('i') + id: number; + + @property() + name: string; + + @property('u', UserModel) + user: UserModel; + + @property('t', null, true) + timeStamp: number; +} + +const model = toClass({ i: 234, name: 'property', u: { i: 123, n: 'name' } }, PropertyModel); +// 你将获得如下数据 +{ + id: 234, + name: 'property', + user: { + id: 123, + name: 'name' + } +} +``` + +## typed(clazzType) + +设置一个目标类的构造器,相当于 property 装饰器的第二个参数 + +- `clazzType` `` 自动将该属性的值映射到一个类实例,相当于调用了 `toClass` 方法 + +示例: + +```ts +// 与此设置一致 @property('n', UserModel) +class TypedModel { + @typed(UserModel) + @property('u') + user: UserModel; +} + +const model = toClass({ u: { i: 123, n: 'name' } }, TypedModel); +// 你将获得如下数据 +{ + user: { + id: 123, + name: 'name' + } +} +``` + +## optional() + +设置一个属性为可选,相当于 property 装饰器的第三个参数 + +示例: + +```ts +// 与此设置一致 @property('n', null, true) +class OptionalModel { + @optional() + @property('n') + name: string; +} + +const model = toClass({}, OptionalModel); +// 你将获得如下数据 +{ +} + +const model = toClass({ n: 'name' }, OptionalModel); +// 你将获得如下数据 +{ + name: 'name'; +} +``` + +## defaultVal(val) + +给当前属性设置默认值 + +- `val` `` 要设置的默认值 + +示例: + +```ts +class DefaultValModel { + @defaultVal(0) + @property('i') + id: number; +} + +const model = toClass({}, DefaultValModel); +// 你将获得如下数据 +{ + id: 0; +} + +const raw = toPLain({}, DefaultValModel); +// 你将获得如下数据 +{ + i: 0; +} +``` + +## serializeTarget() + +当调 `toPlain` 进行序列化时,用使用当前数据作为基准 + +示例: + +```ts +class SerializeTargetModel { + @serializeTarget() + @property('n') + name: string; + + @property('n') + nick: string; +} + +const raw = toPlain( + { + name: 'name', + nick: 'nick', + }, + SerializeTargetModel, +); + +// 你将获得如下数据 +{ + n: 'name'; +} +``` + +## beforeDeserialize(beforeDeserializer, disallowIgnoreBeforeDeserializer = false) + +在 `@typed` 调用之前调用 + +- `beforeDeserializer` `<(value: any, instance: any, origin: any) => any>` + - `value` `` 该属性在原始对象中的值 + - `instance` `` 类实例(未完成解析) + - `origin` `` 原始对象 +- `disallowIgnoreBeforeDeserializer` `` 默认为 false,如果设置为 true,则当调用 `toClass` 时,将强制调用 `@beforeDeserialize` 配置的方法 + +示例: + +```ts +class BeforeDeserializeModel { + @beforeDeserialize((value: any) => JSON.parse(value)) + @property('m') + mail: object; +} + +toClass( + { + m: '{"id":123}', + }, + BeforeDeserializeModel, +); + +// 你将获得如下数据 +{ + mail: { id: 123 }, +}; +``` + +## deserialize(deserializer, disallowIgnoreDeserializer =false) + +将原始对象序列化成自定义的数组格式,仅在调用 `toClass/toClasses` 时可用 + +- `deserializer` `(value: any, instance: any, origin: any) => any` + - `value` `` 该属性的值经过 `@beforeDeserialize` 和 `@typed` 调用后的结果 + - `instance` `` 类实例(未完成解析) + - `origin` `` A raw object +- `disallowIgnoreDeserializer` `` 默认为 false,如果设置为 true,则当调用 `toClass` 时,将强制调用 `@deserialize` 配置的方法 + +示例: + +```ts +class DeserializeModel { + @deserialize((value: string) => `${value}@xxx.com`) + @property('m') + mail: string; +} + +toClass( + { + m: 'mail', + }, + DeserializeModel, +); + +// 你将获得如下数据 +{ + mail: 'mail@xxx.com', +}; +``` + +## serialize(serializer, disallowIgnoreSerializer = false) + +自定义属性值的序列化方式,仅当调用 `toPlain/toPlains` 时可用 + +- `serializer` `(value: any, instance: any, origin: any) => any` + - `value` `` 该属性在类实例中的值 + - `instance` `` 当前类实例 + - `origin` `` 一个json对象(未完成序列化) +- `disallowIgnoreSerializer` `` 默认为 false,如果设置为 true,则当调用 `toClass` 时,将强制调用 `@serialize` 配置的方法 + +Example: + +```ts +class SerializeModel { + @serialize((mail: string) => mail.replace('@xxx.com', '')) + @property('e') + mail: string; +} + +toPlain( + { + mail: 'mail@xxx.com', + }, + SerializeModel, +); + +// 你将获得如下数据 +{ + e: 'mail@xxx.com', +} +``` + +## afterSerialize(afterSerializer, disallowIgnoreAfterSerializer = false) + +Convert a key/value in instance to a target form data, it happened after serializer only + +- `afterSerializer` `(value: any, instance: any, origin: any) => any` + - `value` `` 该属性的值经过 `@serializer` 和 `@typed` 调用后的结果 + - `instance` `` 当前类实例 + - `origin` `` 一个json对象(未完成序列化) +- `disallowIgnoreAfterSerializer` `` 默认为 false,如果设置为 true,则当调用 `toClass` 时,将强制调用 `@afterSerialize` 配置的方法 + +示例: + +```ts +class AfterSerializeModel { + @afterSerialize((mail: string) => JSON.stringify(mail)) + @property('e') + mail: string; +} + +toPlain( + { + mail: { id: 1000 }, + }, + SerializeModel, +); + +// 你将获得如下数据 +{ + e: '{"id":1000}', +}; +``` \ No newline at end of file diff --git a/json-mapper-class/dist/.pydio b/json-mapper-class/dist/.pydio new file mode 100644 index 0000000..6eb09d5 --- /dev/null +++ b/json-mapper-class/dist/.pydio @@ -0,0 +1 @@ +391e708b-cc22-49c3-8788-a0be45dd3948 \ No newline at end of file diff --git a/json-mapper-class/dist/decorators.d.ts b/json-mapper-class/dist/decorators.d.ts new file mode 100644 index 0000000..fc81843 --- /dev/null +++ b/json-mapper-class/dist/decorators.d.ts @@ -0,0 +1,10 @@ +import { StoreItemType } from './typing'; +export declare function serialize(serializer: StoreItemType['serializer'], disallowIgnore?: boolean): (target: any, propertyKey: string) => void; +export declare function deserialize(deserializer: StoreItemType['deserializer'], disallowIgnore?: boolean): (target: any, propertyKey: string) => void; +export declare function beforeDeserialize(beforeDeserializer: StoreItemType['beforeDeserializer'], disallowIgnore?: boolean): (target: any, propertyKey: string) => void; +export declare function afterSerialize(afterSerializer: StoreItemType['afterSerializer'], disallowIgnore?: boolean): (target: any, propertyKey: string) => void; +export declare function serializeTarget(): (target: any, propertyKey: string) => void; +export declare function property(originalKey?: string, targetClass?: StoreItemType['targetClass'], isOptional?: boolean): (target: any, propertyKey: string) => void; +export declare function typed(targetClass: StoreItemType['targetClass']): (target: any, propertyKey: string) => void; +export declare function optional(): (target: any, propertyKey: string) => void; +export declare function defaultVal(value: any): (target: any, propertyKey: string) => void; diff --git a/json-mapper-class/dist/decorators.js b/json-mapper-class/dist/decorators.js new file mode 100644 index 0000000..2281b61 --- /dev/null +++ b/json-mapper-class/dist/decorators.js @@ -0,0 +1,96 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultVal = exports.optional = exports.typed = exports.property = exports.serializeTarget = exports.afterSerialize = exports.beforeDeserialize = exports.deserialize = exports.serialize = void 0; +const store_1 = require("./store"); +function serialize(serializer, disallowIgnore = false) { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + serializer, + disallowIgnoreSerializer: disallowIgnore, + }); + }; +} +exports.serialize = serialize; +function deserialize(deserializer, disallowIgnore = false) { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + deserializer, + disallowIgnoreDeserializer: disallowIgnore, + }); + }; +} +exports.deserialize = deserialize; +function beforeDeserialize(beforeDeserializer, disallowIgnore = false) { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + beforeDeserializer, + disallowIgnoreBeforeDeserializer: disallowIgnore, + }); + }; +} +exports.beforeDeserialize = beforeDeserialize; +function afterSerialize(afterSerializer, disallowIgnore = false) { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + afterSerializer, + disallowIgnoreAfterSerializer: disallowIgnore, + }); + }; +} +exports.afterSerialize = afterSerialize; +function serializeTarget() { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + serializeTarget: true, + }); + }; +} +exports.serializeTarget = serializeTarget; +function property(originalKey, targetClass, isOptional = false) { + return (target, propertyKey) => { + const config = { + originalKey: originalKey || propertyKey, + key: propertyKey, + }; + if (targetClass) { + config.targetClass = targetClass.prototype.constructor; + } + if (isOptional) { + config.optional = isOptional; + } + store_1.setStore(target, config); + }; +} +exports.property = property; +function typed(targetClass) { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + targetClass, + }); + }; +} +exports.typed = typed; +function optional() { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + optional: true, + }); + }; +} +exports.optional = optional; +function defaultVal(value) { + return (target, propertyKey) => { + store_1.setStore(target, { + key: propertyKey, + default: value, + }); + }; +} +exports.defaultVal = defaultVal; diff --git a/json-mapper-class/dist/decorators.js.map b/json-mapper-class/dist/decorators.js.map new file mode 100644 index 0000000..809dc6a --- /dev/null +++ b/json-mapper-class/dist/decorators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAGnC,SAAgB,SAAS,CAAC,UAAuC,EAAE,cAAc,GAAG,KAAK;IACvF,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,UAAU;YACV,wBAAwB,EAAE,cAAc;SACzC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AARD,8BAQC;AAED,SAAgB,WAAW,CAAC,YAA2C,EAAE,cAAc,GAAG,KAAK;IAC7F,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,YAAY;YACZ,0BAA0B,EAAE,cAAc;SAC3C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AARD,kCAQC;AAED,SAAgB,iBAAiB,CAAC,kBAAuD,EAAE,cAAc,GAAG,KAAK;IAC/G,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,kBAAkB;YAClB,gCAAgC,EAAE,cAAc;SACjD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AARD,8CAQC;AAED,SAAgB,cAAc,CAAC,eAAiD,EAAE,cAAc,GAAG,KAAK;IACtG,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,eAAe;YACf,6BAA6B,EAAE,cAAc;SAC9C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AARD,wCAQC;AAED,SAAgB,eAAe;IAC7B,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAPD,0CAOC;AAED,SAAgB,QAAQ,CAAC,WAAoB,EAAE,WAA0C,EAAE,UAAU,GAAG,KAAK;IAC3G,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAqB;YAC/B,WAAW,EAAE,WAAW,IAAI,WAAW;YACvC,GAAG,EAAE,WAAW;SACjB,CAAC;QACF,IAAI,WAAW,EAAE;YACf,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC;SACxD;QACD,IAAI,UAAU,EAAE;YACd,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC9B;QACD,gBAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC;AACJ,CAAC;AAdD,4BAcC;AAED,SAAgB,KAAK,CAAC,WAAyC;IAC7D,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,WAAW;SACZ,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAPD,sBAOC;AAED,SAAgB,QAAQ;IACtB,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAPD,4BAOC;AAED,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,gBAAQ,CAAC,MAAM,EAAE;YACf,GAAG,EAAE,WAAW;YAChB,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAPD,gCAOC"} \ No newline at end of file diff --git a/json-mapper-class/dist/index.d.ts b/json-mapper-class/dist/index.d.ts new file mode 100644 index 0000000..8dfb4b4 --- /dev/null +++ b/json-mapper-class/dist/index.d.ts @@ -0,0 +1,4 @@ +export * from './to-class'; +export * from './to-plain'; +export * from './decorators'; +export * from './typing'; diff --git a/json-mapper-class/dist/index.js b/json-mapper-class/dist/index.js new file mode 100644 index 0000000..44547ac --- /dev/null +++ b/json-mapper-class/dist/index.js @@ -0,0 +1,16 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./to-class"), exports); +__exportStar(require("./to-plain"), exports); +__exportStar(require("./decorators"), exports); +__exportStar(require("./typing"), exports); diff --git a/json-mapper-class/dist/index.js.map b/json-mapper-class/dist/index.js.map new file mode 100644 index 0000000..70aacad --- /dev/null +++ b/json-mapper-class/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA2B;AAC3B,6CAA2B;AAC3B,+CAA6B;AAC7B,2CAAyB"} \ No newline at end of file diff --git a/json-mapper-class/dist/store.d.ts b/json-mapper-class/dist/store.d.ts new file mode 100644 index 0000000..7c8836a --- /dev/null +++ b/json-mapper-class/dist/store.d.ts @@ -0,0 +1,6 @@ +import { StoreItemOptions, StoreItemType } from './typing'; +declare const store: Map>; +export declare const originalKeyStores: Map>; +export declare const keyStores: Map>; +export declare const setStore: (target: Function, options: StoreItemOptions) => void; +export default store; diff --git a/json-mapper-class/dist/store.js b/json-mapper-class/dist/store.js new file mode 100644 index 0000000..2295eaa --- /dev/null +++ b/json-mapper-class/dist/store.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setStore = exports.keyStores = exports.originalKeyStores = void 0; +const store = new Map(); +exports.originalKeyStores = new Map(); +exports.keyStores = new Map(); +exports.setStore = (target, options) => { + const { key, ...rest } = options; + const storeKey = target.constructor; + const targetStore = store.has(storeKey) ? store.get(storeKey) : new Map(); + let value = targetStore.has(key) ? targetStore.get(key) : {}; + value = { + ...value, + ...rest, + }; + targetStore.set(key, value); + store.set(storeKey, targetStore); +}; +exports.default = store; diff --git a/json-mapper-class/dist/store.js.map b/json-mapper-class/dist/store.js.map new file mode 100644 index 0000000..d7046b4 --- /dev/null +++ b/json-mapper-class/dist/store.js.map @@ -0,0 +1 @@ +{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":";;;AAEA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAwC,CAAC;AAEjD,QAAA,iBAAiB,GAAG,IAAI,GAAG,EAA6C,CAAC;AACzE,QAAA,SAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;AAE5D,QAAA,QAAQ,GAAG,CAAC,MAAgB,EAAE,OAAyB,EAAE,EAAE;IACtE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACjC,oCAAoC;IACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;IACpC,sDAAsD;IACtD,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAyB,CAAC;IAEjG,iEAAiE;IACjE,IAAI,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,KAAK,GAAG;QACN,GAAG,KAAK;QACR,GAAG,IAAI;KACR,CAAC;IAEF,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5B,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/json-mapper-class/dist/to-class.d.ts b/json-mapper-class/dist/to-class.d.ts new file mode 100644 index 0000000..230b5bc --- /dev/null +++ b/json-mapper-class/dist/to-class.d.ts @@ -0,0 +1,4 @@ +import { JosnType, BasicClass, ToClassOptions } from './typing'; +export declare const arrayItemToClass: (arrayVal: any[], Clazz: BasicClass, options: ToClassOptions) => any; +export declare const toClasses: (rawJson: JosnType[], Clazz: BasicClass, options?: ToClassOptions) => T[]; +export declare const toClass: (rawJson: JosnType, Clazz: BasicClass, options?: ToClassOptions) => T; diff --git a/json-mapper-class/dist/to-class.js b/json-mapper-class/dist/to-class.js new file mode 100644 index 0000000..31a4d07 --- /dev/null +++ b/json-mapper-class/dist/to-class.js @@ -0,0 +1,61 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toClass = exports.toClasses = exports.arrayItemToClass = void 0; +const isarray_1 = __importDefault(require("isarray")); +const utils_1 = require("./utils"); +exports.arrayItemToClass = (arrayVal, Clazz, options) => { + return arrayVal.map((v) => isarray_1.default(v) ? exports.arrayItemToClass(v, Clazz, options) : objectToClass(v, Clazz, options)); +}; +const objectToClass = (jsonObj, Clazz, options) => { + const instance = new Clazz(); + const originalKeyStore = utils_1.getOriginalKeyStore(Clazz); + originalKeyStore.forEach((propertiesOptions, originalKey) => { + const originalValue = jsonObj[originalKey]; + propertiesOptions.forEach((storeItemoptions) => { + const { key, beforeDeserializer, deserializer, targetClass, optional } = storeItemoptions; + const disallowIgnoreDeserializer = storeItemoptions.disallowIgnoreDeserializer || !options.ignoreDeserializer; + const disallowIgnoreBeforeDeserializer = storeItemoptions.disallowIgnoreBeforeDeserializer || !options.ignoreBeforeDeserializer; + const isValueNotExist = options.distinguishNullAndUndefined ? utils_1.isUndefined : utils_1.isNullOrUndefined; + let value = originalValue; + if (isValueNotExist(value)) { + if (!isValueNotExist(storeItemoptions.default)) { + instance[key] = storeItemoptions.default; + return; + } + if (!optional) { + throw new Error(`Can't map '${originalKey}' to ${Clazz.name}.${key}, property '${originalKey}' not found`); + } + return; + } + value = + beforeDeserializer && disallowIgnoreBeforeDeserializer + ? beforeDeserializer(value, instance, jsonObj, options) + : value; + if (value && targetClass) { + if (isarray_1.default(value)) { + value = exports.arrayItemToClass(value, targetClass, options); + } + else { + value = exports.toClass(value, targetClass, options); + } + } + instance[key] = + deserializer && disallowIgnoreDeserializer ? deserializer(value, instance, jsonObj, options) : value; + }); + }); + return instance; +}; +exports.toClasses = (rawJson, Clazz, options = {}) => { + if (!isarray_1.default(rawJson)) { + throw new Error(`rawJson ${rawJson} must be an array`); + } + const { constructor } = Clazz.prototype; + return rawJson.map((item) => objectToClass(item, constructor, options)); +}; +exports.toClass = (rawJson, Clazz, options = {}) => { + const { constructor } = Clazz.prototype; + return objectToClass(rawJson, constructor, options); +}; diff --git a/json-mapper-class/dist/to-class.js.map b/json-mapper-class/dist/to-class.js.map new file mode 100644 index 0000000..acb2691 --- /dev/null +++ b/json-mapper-class/dist/to-class.js.map @@ -0,0 +1 @@ +{"version":3,"file":"to-class.js","sourceRoot":"","sources":["../src/to-class.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,mCAA8E;AAGjE,QAAA,gBAAgB,GAAG,CAAI,QAAe,EAAE,KAAoB,EAAE,OAAuB,EAAO,EAAE;IACzG,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;IAC7B,mEAAmE;IACnE,iBAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CACpF,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,CAAI,OAA4B,EAAE,KAAoB,EAAE,OAAuB,EAAK,EAAE;IAC1G,MAAM,QAAQ,GAAQ,IAAI,KAAK,EAAE,CAAC;IAClC,MAAM,gBAAgB,GAAG,2BAAmB,CAAC,KAAK,CAAC,CAAC;IACpD,gBAAgB,CAAC,OAAO,CAAC,CAAC,iBAAqC,EAAE,WAAW,EAAE,EAAE;QAC9E,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QAC3C,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAkC,EAAE,EAAE;YAC/D,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;YAE1F,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,0BAA0B,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAC9G,MAAM,gCAAgC,GACpC,gBAAgB,CAAC,gCAAgC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC;YAEzF,MAAM,eAAe,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC,mBAAW,CAAC,CAAC,CAAC,yBAAiB,CAAC;YAC9F,IAAI,KAAK,GAAG,aAAa,CAAC;YAC1B,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE;gBAC1B,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE;oBAC9C,QAAQ,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;oBACzC,OAAO;iBACR;gBACD,IAAI,CAAC,QAAQ,EAAE;oBACb,MAAM,IAAI,KAAK,CAAC,cAAc,WAAW,QAAQ,KAAK,CAAC,IAAI,IAAI,GAAG,eAAe,WAAW,aAAa,CAAC,CAAC;iBAC5G;gBACD,OAAO;aACR;YACD,KAAK;gBACH,kBAAkB,IAAI,gCAAgC;oBACpD,CAAC,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC;oBACvD,CAAC,CAAC,KAAK,CAAC;YACZ,IAAI,KAAK,IAAI,WAAW,EAAE;gBACxB,IAAI,iBAAO,CAAC,KAAK,CAAC,EAAE;oBAClB,KAAK,GAAG,wBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;iBACvD;qBAAM;oBACL,mEAAmE;oBACnE,KAAK,GAAG,eAAO,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;iBAC9C;aACF;YACD,QAAQ,CAAC,GAAG,CAAC;gBACX,YAAY,IAAI,0BAA0B,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACzG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEW,QAAA,SAAS,GAAG,CAAI,OAAmB,EAAE,KAAoB,EAAE,UAA0B,EAAE,EAAO,EAAE;IAC3G,IAAI,CAAC,iBAAO,CAAC,OAAO,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,mBAAmB,CAAC,CAAC;KACxD;IACD,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,aAAa,CAAI,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AACrF,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,CAAI,OAAiB,EAAE,KAAoB,EAAE,UAA0B,EAAE,EAAK,EAAE;IACrG,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;IACxC,OAAO,aAAa,CAAI,OAAiB,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC,CAAC"} \ No newline at end of file diff --git a/json-mapper-class/dist/to-plain.d.ts b/json-mapper-class/dist/to-plain.d.ts new file mode 100644 index 0000000..8660033 --- /dev/null +++ b/json-mapper-class/dist/to-plain.d.ts @@ -0,0 +1,4 @@ +import { JosnType, BasicClass, ToPlainOptions } from './typing'; +export declare const arrayItemToObject: (arrayVal: any[], Clazz: BasicClass, options: ToPlainOptions) => any; +export declare const toPlains: (instances: (JosnType | T)[], Clazz: BasicClass, options?: ToPlainOptions) => any[]; +export declare const toPlain: (instance: JosnType | T, Clazz: BasicClass, options?: ToPlainOptions) => any; diff --git a/json-mapper-class/dist/to-plain.js b/json-mapper-class/dist/to-plain.js new file mode 100644 index 0000000..d3db724 --- /dev/null +++ b/json-mapper-class/dist/to-plain.js @@ -0,0 +1,49 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toPlain = exports.toPlains = exports.arrayItemToObject = void 0; +const isarray_1 = __importDefault(require("isarray")); +const utils_1 = require("./utils"); +exports.arrayItemToObject = (arrayVal, Clazz, options) => { + return arrayVal.map((v) => isarray_1.default(v) ? exports.arrayItemToObject(v, Clazz, options) : classToObject(v, Clazz, options)); +}; +const classToObject = (instance, Clazz, options) => { + const obj = {}; + const keyStore = utils_1.getKeyStore(Clazz); + keyStore.forEach((propertiesOption, key) => { + const isValueNotExist = options.distinguishNullAndUndefined ? utils_1.isUndefined : utils_1.isNullOrUndefined; + const instanceValue = isValueNotExist(instance[key]) ? propertiesOption.default : instance[key]; + const { originalKey, afterSerializer, serializer, targetClass, optional } = propertiesOption; + const disallowIgnoreSerializer = propertiesOption.disallowIgnoreSerializer || !options.ignoreSerializer; + const disallowIgnoreAfterSerializer = propertiesOption.disallowIgnoreAfterSerializer || !options.ignoreAfterSerializer; + if (isValueNotExist(instanceValue)) { + if (!optional) { + throw new Error(`Property '${Clazz.name}.${key}' not found`); + } + return; + } + let value = serializer && disallowIgnoreSerializer ? serializer(instanceValue, instance, obj, options) : instanceValue; + if (value && targetClass) { + if (isarray_1.default(value)) { + value = exports.arrayItemToObject(value, targetClass, options); + } + else { + value = exports.toPlain(value, targetClass, options); + } + } + obj[originalKey] = + afterSerializer && disallowIgnoreAfterSerializer ? afterSerializer(value, instance, obj, options) : value; + }); + return obj; +}; +exports.toPlains = (instances, Clazz, options = {}) => { + if (!isarray_1.default(instances)) { + throw new Error(`${Clazz} instances must be an array`); + } + return instances.map((item) => classToObject(item, Clazz, options)); +}; +exports.toPlain = (instance, Clazz, options = {}) => { + return classToObject(instance, Clazz, options); +}; diff --git a/json-mapper-class/dist/to-plain.js.map b/json-mapper-class/dist/to-plain.js.map new file mode 100644 index 0000000..9362aae --- /dev/null +++ b/json-mapper-class/dist/to-plain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"to-plain.js","sourceRoot":"","sources":["../src/to-plain.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,mCAAsE;AAGzD,QAAA,iBAAiB,GAAG,CAAI,QAAe,EAAE,KAAoB,EAAE,OAAuB,EAAO,EAAE;IAC1G,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;IAC7B,mEAAmE;IACnE,iBAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,yBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CACrF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAI,QAAkB,EAAE,KAAoB,EAAE,OAAuB,EAAY,EAAE;IACvG,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,mBAAW,CAAC,KAAK,CAAC,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,CAAC,gBAA+B,EAAE,GAAmB,EAAE,EAAE;QACxE,MAAM,eAAe,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC,mBAAW,CAAC,CAAC,CAAC,yBAAiB,CAAC;QAC9F,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAChG,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;QAC7F,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,wBAAwB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACxG,MAAM,6BAA6B,GACjC,gBAAgB,CAAC,6BAA6B,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAEnF,IAAI,eAAe,CAAC,aAAa,CAAC,EAAE;YAClC,IAAI,CAAC,QAAQ,EAAE;gBACb,MAAM,IAAI,KAAK,CAAC,aAAa,KAAK,CAAC,IAAI,IAAI,GAAG,aAAa,CAAC,CAAC;aAC9D;YACD,OAAO;SACR;QACD,IAAI,KAAK,GACP,UAAU,IAAI,wBAAwB,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAC7G,IAAI,KAAK,IAAI,WAAW,EAAE;YACxB,IAAI,iBAAO,CAAC,KAAK,CAAC,EAAE;gBAClB,KAAK,GAAG,yBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;aACxD;iBAAM;gBACL,mEAAmE;gBACnE,KAAK,GAAG,eAAO,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;aAC9C;SACF;QACD,GAAG,CAAC,WAAW,CAAC;YACd,eAAe,IAAI,6BAA6B,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9G,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEW,QAAA,QAAQ,GAAG,CAAI,SAA2B,EAAE,KAAoB,EAAE,UAA0B,EAAE,EAAS,EAAE;IACpH,IAAI,CAAC,iBAAO,CAAC,SAAS,CAAC,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,6BAA6B,CAAC,CAAC;KACxD;IACD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,IAAc,EAAE,EAAE,CAAC,aAAa,CAAI,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACnF,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,CAAI,QAAsB,EAAE,KAAoB,EAAE,UAA0B,EAAE,EAAO,EAAE;IAC5G,OAAO,aAAa,CAAI,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC,CAAC"} \ No newline at end of file diff --git a/json-mapper-class/dist/typing.d.ts b/json-mapper-class/dist/typing.d.ts new file mode 100644 index 0000000..3dab485 --- /dev/null +++ b/json-mapper-class/dist/typing.d.ts @@ -0,0 +1,35 @@ +export declare type StoreItemType = { + originalKey?: string; + targetClass?: BasicClass; + serializer?: (value: any, instance: any, origin: any, options: ToPlainOptions) => any; + disallowIgnoreSerializer?: boolean; + afterSerializer?: (value: any, instance: any, origin: any, options: ToPlainOptions) => any; + disallowIgnoreAfterSerializer?: boolean; + deserializer?: (value: any, instance: any, origin: any, options: ToClassOptions) => any; + disallowIgnoreDeserializer?: boolean; + beforeDeserializer?: (value: any, instance: any, origin: any, options: ToClassOptions) => any; + disallowIgnoreBeforeDeserializer?: boolean; + default?: any; + autoTypeDetection?: boolean; + optional?: boolean; + serializeTarget?: boolean; +}; +export declare type StoreItemOptions = StoreItemType & { + key: string; +}; +export declare type BasicClass = { + new (...args: any[]): T; +}; +export declare type JosnType = { + [key: string]: any; +}; +export interface ToClassOptions { + ignoreDeserializer?: boolean; + ignoreBeforeDeserializer?: boolean; + distinguishNullAndUndefined?: boolean; +} +export interface ToPlainOptions { + ignoreSerializer?: boolean; + ignoreAfterSerializer?: boolean; + distinguishNullAndUndefined?: boolean; +} diff --git a/json-mapper-class/dist/typing.js b/json-mapper-class/dist/typing.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/json-mapper-class/dist/typing.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/json-mapper-class/dist/typing.js.map b/json-mapper-class/dist/typing.js.map new file mode 100644 index 0000000..3d0cb5a --- /dev/null +++ b/json-mapper-class/dist/typing.js.map @@ -0,0 +1 @@ +{"version":3,"file":"typing.js","sourceRoot":"","sources":["../src/typing.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/json-mapper-class/dist/utils.d.ts b/json-mapper-class/dist/utils.d.ts new file mode 100644 index 0000000..789a373 --- /dev/null +++ b/json-mapper-class/dist/utils.d.ts @@ -0,0 +1,6 @@ +import { StoreItemOptions, StoreItemType, BasicClass } from './typing'; +export declare const isNull: (val: any) => boolean; +export declare const isUndefined: (val: any) => boolean; +export declare const isNullOrUndefined: (val: any) => boolean; +export declare const getOriginalKeyStore: (Clazz: BasicClass) => Map; +export declare const getKeyStore: (Clazz: BasicClass) => Map; diff --git a/json-mapper-class/dist/utils.js b/json-mapper-class/dist/utils.js new file mode 100644 index 0000000..6aed6c6 --- /dev/null +++ b/json-mapper-class/dist/utils.js @@ -0,0 +1,82 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getKeyStore = exports.getOriginalKeyStore = exports.isNullOrUndefined = exports.isUndefined = exports.isNull = void 0; +const store_1 = __importStar(require("./store")); +exports.isNull = (val) => val === null; +exports.isUndefined = (val) => val === undefined; +exports.isNullOrUndefined = (val) => exports.isNull(val) || exports.isUndefined(val); +exports.getOriginalKeyStore = (Clazz) => { + let curLayer = Clazz; + const cacheOriginalKeyStore = store_1.originalKeyStores.get(curLayer); + if (cacheOriginalKeyStore) { + return cacheOriginalKeyStore; + } + const originalKeyStore = new Map(); + while (curLayer.name && curLayer.prototype) { + const { constructor } = curLayer.prototype; + const targetStore = store_1.default.get(constructor); + if (targetStore) { + targetStore.forEach((storeItem, key) => { + const item = { + key, + ...storeItem, + }; + if (!originalKeyStore.has(storeItem.originalKey)) { + originalKeyStore.set(storeItem.originalKey, [item]); + } + else { + const exists = originalKeyStore.get(storeItem.originalKey); + if (!exists.find((exist) => exist.key === key)) { + originalKeyStore.set(storeItem.originalKey, [...originalKeyStore.get(storeItem.originalKey), item]); + } + } + }); + } + curLayer = Object.getPrototypeOf(constructor); + } + store_1.originalKeyStores.set(Clazz, originalKeyStore); + return originalKeyStore; +}; +exports.getKeyStore = (Clazz) => { + const cacheKeyStore = store_1.keyStores.get(Clazz); + if (cacheKeyStore) { + return cacheKeyStore; + } + const keyStore = new Map(); + const originalKeyStore = exports.getOriginalKeyStore(Clazz); + originalKeyStore.forEach(storeItems => { + const [firstStoreItem] = storeItems; + if (storeItems.length === 1) { + keyStore.set(firstStoreItem.key, firstStoreItem); + } + else { + const hasStoreItems = storeItems.filter(storeItem => storeItem.serializeTarget); + if (hasStoreItems.length !== 1) { + throw new Error(`Only one of keys(${storeItems.map(storeItem => storeItem.key).join(', ')}) in ${Clazz.name} can contain a serializeTarget when use toPlain`); + } + const hasStoreItem = hasStoreItems[0]; + keyStore.set(hasStoreItem.key, hasStoreItem); + } + }); + store_1.keyStores.set(Clazz, keyStore); + return keyStore; +}; diff --git a/json-mapper-class/dist/utils.js.map b/json-mapper-class/dist/utils.js.map new file mode 100644 index 0000000..8dd9f4d --- /dev/null +++ b/json-mapper-class/dist/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,iDAA8D;AAEjD,QAAA,MAAM,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC;AAEpC,QAAA,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC;AAE9C,QAAA,iBAAiB,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,cAAM,CAAC,GAAG,CAAC,IAAI,mBAAW,CAAC,GAAG,CAAC,CAAC;AAElE,QAAA,mBAAmB,GAAG,CAAI,KAAoB,EAAE,EAAE;IAC7D,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,MAAM,qBAAqB,GAAG,yBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE9D,iEAAiE;IAEjE,IAAI,qBAAqB,EAAE;QACzB,OAAO,qBAAqB,CAAC;KAC9B;IACD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA8B,CAAC;IAC/D,OAAO,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,SAAS,EAAE;QAC1C,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC;QAC3C,MAAM,WAAW,GAAG,eAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC3C,6CAA6C;QAE7C,IAAI,WAAW,EAAE;YACf,WAAW,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE;gBACrC,MAAM,IAAI,GAAG;oBACX,GAAG;oBACH,GAAG,SAAS;iBACb,CAAC;gBAEF,+BAA+B;gBAE/B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;oBAChD,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;iBACrD;qBAAM;oBACL,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE;wBAChE,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;qBACrG;iBACF;YACH,CAAC,CAAC,CAAC;SACJ;QACD,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;KAC/C;IACD,yBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAC/C,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEW,QAAA,WAAW,GAAG,CAAI,KAAoB,EAAE,EAAE;IACrD,MAAM,aAAa,GAAG,iBAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,aAAa,EAAE;QACjB,OAAO,aAAa,CAAC;KACtB;IACD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;IAClD,MAAM,gBAAgB,GAAG,2BAAmB,CAAC,KAAK,CAAC,CAAC;IACpD,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACpC,MAAM,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3B,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SAClD;aAAM;YACL,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;YAChF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,KAAK,CACb,oBAAoB,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QACvE,KAAK,CAAC,IACR,iDAAiD,CAClD,CAAC;aACH;YACD,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;YACtC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;SAC9C;IACH,CAAC,CAAC,CAAC;IACH,iBAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"} \ No newline at end of file diff --git a/json-mapper-class/package.json b/json-mapper-class/package.json new file mode 100644 index 0000000..bb24148 --- /dev/null +++ b/json-mapper-class/package.json @@ -0,0 +1,27 @@ +{ + "name": "json-mapper-class", + "version": "1.0.2", + "description": "Json Mapper To Class", + "main": "dist/index.js", + "scripts": { + "build": "tsc", + "dev": "ts-node test.ts", + "publish": "npm publish" + }, + "keywords": [ + "class", + "json", + "mapper", + "typescript" + ], + "dependencies": { + "isarray": "^2.0.5" + }, + "devDependencies": { + "@types/isarray": "^2.0.0", + "@types/node": "^12.12.50", + "moment": "^2.27.0", + "ts-node": "^8.10.2", + "typescript": "^3.9.7" + } +} diff --git a/json-mapper-class/tsconfig.json b/json-mapper-class/tsconfig.json new file mode 100644 index 0000000..7292066 --- /dev/null +++ b/json-mapper-class/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "resolveJsonModule": true, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "esModuleInterop": true, + "sourceMap": false, + "noImplicitAny": true, + "removeComments": true, + "declaration": true, + "outDir": "./dist", + "lib": ["es6"] + }, + "include": ["src"], + "exclude": ["node_modules"] +} diff --git a/json-to-class/.gitignore b/json-to-class/.gitignore new file mode 100644 index 0000000..6dbcf5e --- /dev/null +++ b/json-to-class/.gitignore @@ -0,0 +1,29 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* +test.json +笔记.txt +package-lock.json +stats.html + +src-tauri/target/* +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/json-to-class/.pydio b/json-to-class/.pydio new file mode 100644 index 0000000..1d03767 --- /dev/null +++ b/json-to-class/.pydio @@ -0,0 +1 @@ +2b79c44f-8eec-46bb-8888-ea29805a9038 \ No newline at end of file diff --git a/json-to-class/README.md b/json-to-class/README.md new file mode 100644 index 0000000..8654af7 --- /dev/null +++ b/json-to-class/README.md @@ -0,0 +1,89 @@ +

+ +

+

+ JsonToClass +

+ +

+ 帮助 TypeScript 项目,为API接口数据自动生成 TypeScript 类型 +

+

+ + svelte + + + tauri + + + typescript + + + vitejs + + + json-class-interface + +

+ + +该软件是本人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 + +**注意事项:** + +1:MacOs 端由于没有`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) diff --git a/json-to-class/build/.pydio b/json-to-class/build/.pydio new file mode 100644 index 0000000..83831e9 --- /dev/null +++ b/json-to-class/build/.pydio @@ -0,0 +1 @@ +4408a16a-b5c1-47d5-9698-a27572ed5880 \ No newline at end of file diff --git a/json-to-class/build/JsonToClass.icns b/json-to-class/build/JsonToClass.icns new file mode 100644 index 0000000..1009760 Binary files /dev/null and b/json-to-class/build/JsonToClass.icns differ diff --git a/json-to-class/build/JsonToClass.iconset/.pydio b/json-to-class/build/JsonToClass.iconset/.pydio new file mode 100644 index 0000000..abb397c --- /dev/null +++ b/json-to-class/build/JsonToClass.iconset/.pydio @@ -0,0 +1 @@ +785daa35-f2c9-409b-ac24-288dc7e2af46 \ No newline at end of file diff --git a/json-to-class/build/JsonToClass.iconset/icon_128x128.png b/json-to-class/build/JsonToClass.iconset/icon_128x128.png new file mode 100644 index 0000000..1d36f4b Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_128x128.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_128x128@2x.png b/json-to-class/build/JsonToClass.iconset/icon_128x128@2x.png new file mode 100644 index 0000000..4543142 Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_128x128@2x.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_16x16.png b/json-to-class/build/JsonToClass.iconset/icon_16x16.png new file mode 100644 index 0000000..ab48bc9 Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_16x16.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_16x16@2x.png b/json-to-class/build/JsonToClass.iconset/icon_16x16@2x.png new file mode 100644 index 0000000..8f6f830 Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_16x16@2x.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_256x256.png b/json-to-class/build/JsonToClass.iconset/icon_256x256.png new file mode 100644 index 0000000..4543142 Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_256x256.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_256x256@2x.png b/json-to-class/build/JsonToClass.iconset/icon_256x256@2x.png new file mode 100644 index 0000000..5d9bc8c Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_256x256@2x.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_32x32.png b/json-to-class/build/JsonToClass.iconset/icon_32x32.png new file mode 100644 index 0000000..8f6f830 Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_32x32.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_32x32@2x.png b/json-to-class/build/JsonToClass.iconset/icon_32x32@2x.png new file mode 100644 index 0000000..3ddfd8f Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_32x32@2x.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_512x512.png b/json-to-class/build/JsonToClass.iconset/icon_512x512.png new file mode 100644 index 0000000..5d9bc8c Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_512x512.png differ diff --git a/json-to-class/build/JsonToClass.iconset/icon_512x512@2x.png b/json-to-class/build/JsonToClass.iconset/icon_512x512@2x.png new file mode 100644 index 0000000..5d9bc8c Binary files /dev/null and b/json-to-class/build/JsonToClass.iconset/icon_512x512@2x.png differ diff --git a/json-to-class/build/JsonToClass.png b/json-to-class/build/JsonToClass.png new file mode 100644 index 0000000..11b7354 Binary files /dev/null and b/json-to-class/build/JsonToClass.png differ diff --git a/json-to-class/build/icns.sh b/json-to-class/build/icns.sh new file mode 100755 index 0000000..bb50c16 --- /dev/null +++ b/json-to-class/build/icns.sh @@ -0,0 +1,13 @@ +#!/bin/bash +sips -z 16 16 JsonToClass.png --out JsonToClass.iconset/icon_16x16.png +sips -z 32 32 JsonToClass.png --out JsonToClass.iconset/icon_16x16@2x.png +sips -z 32 32 JsonToClass.png --out JsonToClass.iconset/icon_32x32.png +sips -z 64 64 JsonToClass.png --out JsonToClass.iconset/icon_32x32@2x.png +sips -z 128 128 JsonToClass.png --out JsonToClass.iconset/icon_128x128.png +sips -z 256 256 JsonToClass.png --out JsonToClass.iconset/icon_128x128@2x.png +sips -z 256 256 JsonToClass.png --out JsonToClass.iconset/icon_256x256.png +sips -z 512 512 JsonToClass.png --out JsonToClass.iconset/icon_256x256@2x.png +sips -z 512 512 JsonToClass.png --out JsonToClass.iconset/icon_512x512.png +sips -z 512 512 JsonToClass.png --out JsonToClass.iconset/icon_512x512@2x.png + +iconutil -c icns JsonToClass.iconset -o JsonToClass.icns \ No newline at end of file diff --git a/json-to-class/build/img/.pydio b/json-to-class/build/img/.pydio new file mode 100644 index 0000000..dd7d3ad --- /dev/null +++ b/json-to-class/build/img/.pydio @@ -0,0 +1 @@ +ee0f13d5-2393-42c0-9f2c-b24b7071070f \ No newline at end of file diff --git a/json-to-class/build/img/0.png b/json-to-class/build/img/0.png new file mode 100644 index 0000000..a875be6 Binary files /dev/null and b/json-to-class/build/img/0.png differ diff --git a/json-to-class/build/img/1.png b/json-to-class/build/img/1.png new file mode 100644 index 0000000..69c560c Binary files /dev/null and b/json-to-class/build/img/1.png differ diff --git a/json-to-class/build/img/2.png b/json-to-class/build/img/2.png new file mode 100644 index 0000000..cb55429 Binary files /dev/null and b/json-to-class/build/img/2.png differ diff --git a/json-to-class/build/img/3.png b/json-to-class/build/img/3.png new file mode 100644 index 0000000..8d214f1 Binary files /dev/null and b/json-to-class/build/img/3.png differ diff --git a/json-to-class/build/img/4.png b/json-to-class/build/img/4.png new file mode 100644 index 0000000..c31f73b Binary files /dev/null and b/json-to-class/build/img/4.png differ diff --git a/json-to-class/build/img/5.png b/json-to-class/build/img/5.png new file mode 100644 index 0000000..cfcef0b Binary files /dev/null and b/json-to-class/build/img/5.png differ diff --git a/json-to-class/build/img/6.png b/json-to-class/build/img/6.png new file mode 100644 index 0000000..850ca5a Binary files /dev/null and b/json-to-class/build/img/6.png differ diff --git a/json-to-class/build/img/icon_128x128.png b/json-to-class/build/img/icon_128x128.png new file mode 100644 index 0000000..1d36f4b Binary files /dev/null and b/json-to-class/build/img/icon_128x128.png differ diff --git a/json-to-class/index.html b/json-to-class/index.html new file mode 100644 index 0000000..cec86d0 --- /dev/null +++ b/json-to-class/index.html @@ -0,0 +1,14 @@ + + + + + + + + + + +
+ + + diff --git a/json-to-class/package.json b/json-to-class/package.json new file mode 100644 index 0000000..ebf1d54 --- /dev/null +++ b/json-to-class/package.json @@ -0,0 +1,47 @@ +{ + "name": "json-to-class", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-check --tsconfig ./tsconfig.json", + "tauri-dev": "tauri dev", + "tauri-build": "tauri build", + "tauri": "tauri" + }, + "dependencies": { + "@svelteuidev/composables": "^0.15.3", + "@svelteuidev/core": "^0.15.3", + "@tauri-apps/api": "^2.0.0-alpha.11", + "@tauri-apps/plugin-autostart": "^2.0.0-alpha.3", + "@tauri-apps/plugin-clipboard-manager": "^2.0.0-alpha.3", + "@tauri-apps/plugin-dialog": "^2.0.0-alpha.3", + "@tauri-apps/plugin-fs": "^2.0.0-alpha.3", + "@tauri-apps/plugin-notification": "^2.0.0-alpha.3", + "@tauri-apps/plugin-shell": "^2.0.0-alpha.3", + "@tauri-apps/plugin-window": "^2.0.0-alpha.1", + "json-class-interface": "^1.1.7", + "monaco-editor": "^0.43.0", + "svelte-spa-router": "^3.3.0" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^2.4.2", + "@tauri-apps/cli": "^2.0.0-rc.3", + "@tsconfig/svelte": "^5.0.0", + "@types/node": "^20.9.0", + "internal-ip": "^7.0.0", + "less": "^4.2.0", + "reflect-metadata": "^0.1.13", + "rollup-plugin-visualizer": "^5.9.2", + "svelte": "^4.0.5", + "svelte-check": "^3.4.6", + "svelte-preprocess-less": "^0.4.0", + "tslib": "^2.6.0", + "typescript": "^5.0.2", + "vite": "^4.4.4", + "vite-plugin-monaco-editor": "^1.1.0" + } +} diff --git a/json-to-class/public/.pydio b/json-to-class/public/.pydio new file mode 100644 index 0000000..645d96b --- /dev/null +++ b/json-to-class/public/.pydio @@ -0,0 +1 @@ +217a9024-c835-4293-9269-e7be2a8dd55f \ No newline at end of file diff --git a/json-to-class/public/iconfont/.pydio b/json-to-class/public/iconfont/.pydio new file mode 100644 index 0000000..5654587 --- /dev/null +++ b/json-to-class/public/iconfont/.pydio @@ -0,0 +1 @@ +9b4a28d6-e012-4f66-bc67-f102e825d19a \ No newline at end of file diff --git a/json-to-class/public/iconfont/iconfont.css b/json-to-class/public/iconfont/iconfont.css new file mode 100644 index 0000000..f1f291e --- /dev/null +++ b/json-to-class/public/iconfont/iconfont.css @@ -0,0 +1,91 @@ +@font-face { + font-family: "iconfont"; /* Project id 4318577 */ + src: url('./iconfont.woff2?t=1700074221843') format('woff2'), + url('./iconfont.woff?t=1700074221843') format('woff'), + url('./iconfont.ttf?t=1700074221843') format('truetype'); +} + +.iconfont { + font-family: "iconfont", serif !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.json-guanyu:before { + content: "\e60b"; +} + +.json-cuowutishi-copy:before { + content: "\e7a2"; +} + +.json-wenjianjia:before { + content: "\e67c"; +} + +.json-sucai:before { + content: "\e603"; +} + +.json-open-folder:before { + content: "\e677"; +} + +.json-json:before { + content: "\e7bd"; +} + +.json-cunchuqia:before { + content: "\e638"; +} + +.json-cunchu:before { + content: "\e602"; +} + +.json-gengduo:before { + content: "\ec1c"; +} + +.json-shezhi:before { + content: "\e628"; +} + +.json-gengduo1:before { + content: "\e63f"; +} + +.json-shezhi2:before { + content: "\e6a9"; +} + +.json-shezhi-xitongshezhi:before { + content: "\e600"; +} + +.json-moon:before { + content: "\e6c2"; +} + +.json-wo:before { + content: "\e60f"; +} + +.json-wodewo:before { + content: "\e6df"; +} + +.json-31shezhi:before { + content: "\e601"; +} + +.json-shezhi1:before { + content: "\e8b7"; +} + +.json-taiyang:before { + content: "\e709"; +} + diff --git a/json-to-class/public/iconfont/iconfont.ttf b/json-to-class/public/iconfont/iconfont.ttf new file mode 100644 index 0000000..2c4a540 Binary files /dev/null and b/json-to-class/public/iconfont/iconfont.ttf differ diff --git a/json-to-class/public/iconfont/iconfont.woff b/json-to-class/public/iconfont/iconfont.woff new file mode 100644 index 0000000..72dd92b Binary files /dev/null and b/json-to-class/public/iconfont/iconfont.woff differ diff --git a/json-to-class/public/iconfont/iconfont.woff2 b/json-to-class/public/iconfont/iconfont.woff2 new file mode 100644 index 0000000..1075012 Binary files /dev/null and b/json-to-class/public/iconfont/iconfont.woff2 differ diff --git a/json-to-class/public/img/.pydio b/json-to-class/public/img/.pydio new file mode 100644 index 0000000..364664b --- /dev/null +++ b/json-to-class/public/img/.pydio @@ -0,0 +1 @@ +7809e461-c368-4067-ae5e-0f0fdcd86be9 \ No newline at end of file diff --git a/json-to-class/public/img/JsonToClass.png b/json-to-class/public/img/JsonToClass.png new file mode 100644 index 0000000..11b7354 Binary files /dev/null and b/json-to-class/public/img/JsonToClass.png differ diff --git a/json-to-class/public/img/auto.png b/json-to-class/public/img/auto.png new file mode 100644 index 0000000..5c6a345 Binary files /dev/null and b/json-to-class/public/img/auto.png differ diff --git a/json-to-class/public/img/dark.png b/json-to-class/public/img/dark.png new file mode 100644 index 0000000..54045a6 Binary files /dev/null and b/json-to-class/public/img/dark.png differ diff --git a/json-to-class/public/img/light.png b/json-to-class/public/img/light.png new file mode 100644 index 0000000..f58500b Binary files /dev/null and b/json-to-class/public/img/light.png differ diff --git a/json-to-class/public/splashscreen.html b/json-to-class/public/splashscreen.html new file mode 100644 index 0000000..382d564 --- /dev/null +++ b/json-to-class/public/splashscreen.html @@ -0,0 +1,159 @@ + + + + + + + Title + + + +
+ +

Json To Class

+

帮助您更快编码

+ +
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/json-to-class/src-tauri/.gitignore b/json-to-class/src-tauri/.gitignore new file mode 100644 index 0000000..f4dfb82 --- /dev/null +++ b/json-to-class/src-tauri/.gitignore @@ -0,0 +1,4 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ + diff --git a/json-to-class/src-tauri/.pydio b/json-to-class/src-tauri/.pydio new file mode 100644 index 0000000..52f2d94 --- /dev/null +++ b/json-to-class/src-tauri/.pydio @@ -0,0 +1 @@ +66a6e945-2049-4334-8fa1-a7f788930e3e \ No newline at end of file diff --git a/json-to-class/src-tauri/Cargo.lock b/json-to-class/src-tauri/Cargo.lock new file mode 100644 index 0000000..99305b2 --- /dev/null +++ b/json-to-class/src-tauri/Cargo.lock @@ -0,0 +1,5061 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "arboard" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac57f2b058a76363e357c056e4f74f1945bf734d37b8b3ef49066c4787dde0fc" +dependencies = [ + "clipboard-win", + "core-graphics 0.22.3", + "image", + "log", + "objc", + "objc-foundation", + "objc_id", + "parking_lot", + "thiserror", + "winapi", + "x11rb", +] + +[[package]] +name = "async-broadcast" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +dependencies = [ + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37875bd9915b7d67c2f117ea2c30a0989874d0b2cb694fe25403c85763c0c9e" +dependencies = [ + "concurrent-queue", + "event-listener 3.1.0", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" +dependencies = [ + "async-lock 2.8.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 1.13.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" +dependencies = [ + "async-lock 3.1.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.0.1", + "parking", + "polling 3.3.0", + "rustix 0.38.24", + "slab", + "tracing", + "waker-fn", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb2ab2aa8a746e221ab826c73f48bc6ba41be6763f0855cb249eb6d154cf1d7" +dependencies = [ + "event-listener 3.1.0", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.24", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.2.0", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.24", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-task" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" + +[[package]] +name = "async-trait" +version = "0.1.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "atk" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" +dependencies = [ + "atk-sys", + "glib 0.18.3", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" +dependencies = [ + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "auto-launch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5904a4d734f0235edf29aab320a14899f3e090446e594ff96508a6215f76f89c" +dependencies = [ + "dirs", + "thiserror", + "winreg 0.10.1", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel", + "async-lock 3.1.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.0.1", + "piper", + "tracing", +] + +[[package]] +name = "brotli" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "cairo-rs" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33613627f0dea6a731b0605101fad59ba4f193a52c96c4687728d822605a8a1" +dependencies = [ + "bitflags 2.4.1", + "cairo-sys-rs", + "glib 0.18.3", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" +dependencies = [ + "glib-sys 0.18.1", + "libc", + "system-deps", +] + +[[package]] +name = "cargo_toml" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" +dependencies = [ + "serde", + "toml 0.8.8", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-targets 0.48.5", +] + +[[package]] +name = "clipboard-win" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +dependencies = [ + "error-code", + "str-buf", + "winapi", +] + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics 0.22.3", + "foreign-types 0.3.2", + "libc", + "objc", +] + +[[package]] +name = "cocoa" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics 0.23.1", + "foreign-types 0.5.0", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation", + "core-graphics-types", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types 0.5.0", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.39", +] + +[[package]] +name = "ctor" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" +dependencies = [ + "quote", + "syn 2.0.39", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.39", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dtoa-short" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "embed-resource" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +dependencies = [ + "cc", + "rustc_version", + "toml 0.8.8", + "vswhom", + "winreg 0.51.0", +] + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enumflags2" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "error-code" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" +dependencies = [ + "libc", + "str-buf", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" +dependencies = [ + "event-listener 3.1.0", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fdeflate" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset 0.9.0", + "rustc_version", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures-channel" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" + +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "futures-sink" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" + +[[package]] +name = "futures-task" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" + +[[package]] +name = "futures-util" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib 0.18.3", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446f32b74d22c33b7b258d4af4ffde53c2bf96ca2e29abdf1a785fe59bd6c82c" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib 0.18.3", + "libc", + "once_cell", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" +dependencies = [ + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkwayland-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90fbf5c033c65d93792192a49a8efb5bb1e640c419682a58bb96f5ae77f3d4a" +dependencies = [ + "gdk-sys", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee8f00f4ee46cad2939b8990f5c70c94ff882c3028f3cc5abf950fa4ab53043" +dependencies = [ + "gdk-sys", + "glib-sys 0.18.1", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "gio" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d809baf02bdf1b5ef4ad3bf60dd9d4977149db4612b7bbb58e56aef168193b" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys 0.18.1", + "glib 0.18.3", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229" +dependencies = [ + "glib-sys 0.16.3", + "gobject-sys 0.16.3", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "gio-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" +dependencies = [ + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16aa2475c9debed5a32832cb5ff2af5a3f9e1ab9e69df58eaadc1ab2004d6eba" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys 0.16.3", + "glib-macros 0.16.8", + "glib-sys 0.16.3", + "gobject-sys 0.16.3", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6" +dependencies = [ + "bitflags 2.4.1", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys 0.18.1", + "glib-macros 0.18.3", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1a9325847aa46f1e96ffea37611b9d51fc4827e67f79e7de502a297560a67b" +dependencies = [ + "anyhow", + "heck", + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "glib-macros" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72793962ceece3863c2965d7f10c8786323b17c7adea75a515809fa20ab799a5" +dependencies = [ + "heck", + "proc-macro-crate 2.0.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "glib-sys" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glib-sys" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gobject-sys" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" +dependencies = [ + "glib-sys 0.16.3", + "libc", + "system-deps", +] + +[[package]] +name = "gobject-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" +dependencies = [ + "glib-sys 0.18.1", + "libc", + "system-deps", +] + +[[package]] +name = "gtk" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" +dependencies = [ + "atk", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib 0.18.3", + "gtk-sys", + "gtk3-macros", + "libc", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "h2" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "html5ever" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.9", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.9", + "pin-project-lite", + "socket2 0.4.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ico" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-rational", + "num-traits", + "png", + "tiff", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.2", + "serde", +] + +[[package]] +name = "infer" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" +dependencies = [ + "cfb", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "javascriptcore-rs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" +dependencies = [ + "bitflags 1.3.2", + "glib 0.18.3", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" +dependencies = [ + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" + +[[package]] +name = "js-sys" +version = "0.3.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "treediff", +] + +[[package]] +name = "json-to-calss" +version = "1.0.2" +dependencies = [ + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-autostart", + "tauri-plugin-clipboard-manager", + "tauri-plugin-dialog", + "tauri-plugin-fs", + "tauri-plugin-notification", + "tauri-plugin-shell", + "tauri-plugin-window", + "window-vibrancy", +] + +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.4.1", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kuchikiki" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" +dependencies = [ + "cssparser", + "html5ever", + "indexmap 1.9.3", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libappindicator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" +dependencies = [ + "glib 0.18.3", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall", +] + +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "mac-notification-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51fca4d74ff9dbaac16a01b924bc3693fa2bba0862c2c633abc73f9a8ea21f64" +dependencies = [ + "cc", + "dirs-next", + "objc-foundation", + "objc_id", + "time", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +dependencies = [ + "log", + "phf 0.10.1", + "phf_codegen 0.10.0", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "muda" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9767ce3b12d2928f17ff4f91b29e7e872a8594033d82bf00e56017cc23bb8410" +dependencies = [ + "cocoa 0.25.0", + "crossbeam-channel", + "gtk", + "keyboard-types", + "objc", + "once_cell", + "png", + "thiserror", + "windows-sys 0.48.0", +] + +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags 1.3.2", + "jni-sys", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.4.1+23.1.7779620" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "notify-rust" +version = "4.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "827c5edfa80235ded4ab3fe8e9dc619b4f866ef16fe9b1c6b8a7f8692c0f2226" +dependencies = [ + "log", + "mac-notification-sys", + "serde", + "tauri-winrt-notification", + "zbus", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "open" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a083c0c7e5e4a8ec4176346cf61f67ac674e8bfb059d9226e1c54a96b377c12" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pango" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" +dependencies = [ + "gio", + "glib 0.18.3", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" +dependencies = [ + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_shared 0.10.0", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros 0.11.2", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "plist" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" +dependencies = [ + "base64", + "indexmap 2.1.0", + "line-wrap", + "quick-xml 0.31.0", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.24", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", +] + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom 0.2.11", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "winreg 0.50.0", +] + +[[package]] +name = "rfd" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9e7b57df6e8472152674607f6cc68aa14a748a3157a857a94f516e11aeacc2" +dependencies = [ + "block", + "dispatch", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "gtk-sys", + "js-sys", + "log", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys 0.4.11", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + +[[package]] +name = "serde" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.192" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa 1.0.9", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.9", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.1.0", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_child" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "soup3" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" +dependencies = [ + "futures-channel", + "gio", + "glib 0.18.3", + "libc", + "soup3-sys", +] + +[[package]] +name = "soup3-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" +dependencies = [ + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" +dependencies = [ + "loom", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "str-buf" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "swift-rs" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bbdb58577b6301f8d17ae2561f32002a5bae056d444e0f69e611e504a276204" +dependencies = [ + "base64", + "serde", + "serde_json", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "system-deps" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 0.8.8", + "version-compare", +] + +[[package]] +name = "tao" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f130523fee9820ad78141d443e6cef75043acade79107bc483872bc183928c0f" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "cc", + "cocoa 0.24.1", + "core-foundation", + "core-graphics 0.22.3", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkwayland-sys", + "gdkx11-sys", + "gio", + "glib 0.18.3", + "glib-sys 0.18.1", + "gtk", + "image", + "instant", + "jni", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc", + "once_cell", + "parking_lot", + "png", + "raw-window-handle", + "scopeguard", + "serde", + "tao-macros", + "unicode-segmentation", + "url", + "uuid", + "windows 0.51.1", + "windows-implement", + "x11-dl", + "zbus", +] + +[[package]] +name = "tao-macros" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec114582505d158b669b136e6851f85840c109819d77c42bb7c0709f727d18c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "target-lexicon" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" + +[[package]] +name = "tauri" +version = "2.0.0-alpha.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "892f45e7f10c9481488633f506496eeb3c69034c17fc71d5562d1e87b5442f78" +dependencies = [ + "anyhow", + "bytes", + "cocoa 0.25.0", + "dirs-next", + "embed_plist", + "futures-util", + "getrandom 0.2.11", + "glob", + "gtk", + "heck", + "http", + "jni", + "libc", + "log", + "mime", + "muda", + "objc", + "once_cell", + "percent-encoding", + "raw-window-handle", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "state", + "swift-rs", + "tauri-build", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "thiserror", + "tokio", + "tray-icon", + "url", + "webkit2gtk", + "webview2-com", + "window-vibrancy", + "windows 0.51.1", +] + +[[package]] +name = "tauri-build" +version = "2.0.0-alpha.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5f06f1cbb5507f4de803f8e1fab01c71cb9515297a90d3adba4fa6c06a194c" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs-next", + "heck", + "json-patch", + "plist", + "semver", + "serde", + "serde_json", + "swift-rs", + "tauri-utils", + "tauri-winres", + "walkdir", +] + +[[package]] +name = "tauri-codegen" +version = "2.0.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28094b389b0981aba46eeba7dcda6216c23fdf7288b2e0414e69fbc55aa55676" +dependencies = [ + "base64", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "sha2", + "tauri-utils", + "thiserror", + "time", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "2.0.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1df582259285a81324d4d38846433bfd3c0440c7a268f730acb7c29350f25cf" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin-autostart" +version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b246638b441c98e926957ec9857b37a5e406a2e8ac64b91e800a33f31aa979" +dependencies = [ + "auto-launch", + "log", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-clipboard-manager" +version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b0d35ce3272fd3bdf35bec44c2c3fd8377bb2e3dd89b3e783f5246b5610ffe8" +dependencies = [ + "arboard", + "log", + "serde", + "serde_json", + "tauri", + "tauri-build", + "thiserror", +] + +[[package]] +name = "tauri-plugin-dialog" +version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba998ef0f268e5a5fbc36629f71dc2f4e069812a89eaa1e7a826084ffd6abc2a" +dependencies = [ + "glib 0.16.9", + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tauri-plugin-fs", + "thiserror", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d163d4478343c26b90b3573980f02c717af5ea482c8d04c64e84a6dadcfc02" +dependencies = [ + "anyhow", + "glob", + "serde", + "tauri", + "thiserror", + "uuid", +] + +[[package]] +name = "tauri-plugin-notification" +version = "2.0.0-alpha.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b7d3138700a1073dce4fbc2eab0399315acd1c0c9fefd5007991344c210517" +dependencies = [ + "log", + "notify-rust", + "rand 0.8.5", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-build", + "thiserror", + "time", + "url", +] + +[[package]] +name = "tauri-plugin-shell" +version = "2.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "108ab7284ea9034f588dd6bf74db1cb783c4bee33c7ab0ebe1065723ba990e37" +dependencies = [ + "encoding_rs", + "log", + "open", + "os_pipe", + "regex", + "serde", + "serde_json", + "shared_child", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-window" +version = "2.0.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "646c4d192ac58631b56059b5a3b26b254b42dcae91a455a818a22687bb841c39" +dependencies = [ + "serde", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-runtime" +version = "1.0.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46889d91efc090ac4031c7c423c30c5280d6984cb071b729b748d643aa3df40" +dependencies = [ + "gtk", + "http", + "jni", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "url", + "windows 0.51.1", +] + +[[package]] +name = "tauri-runtime-wry" +version = "1.0.0-alpha.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b083797e147019c318db883a51868014751b578ba0d1ef3aadd34199a3bbcf61" +dependencies = [ + "cocoa 0.24.1", + "gtk", + "http", + "jni", + "percent-encoding", + "raw-window-handle", + "tauri-runtime", + "tauri-utils", + "webkit2gtk", + "webview2-com", + "windows 0.51.1", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "2.0.0-alpha.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e138783ca404416a4afe34f22f804d533c28fb73f87870f365c6ecdcee6c23" +dependencies = [ + "brotli", + "ctor", + "dunce", + "glob", + "heck", + "html5ever", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.2", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "serde_with", + "thiserror", + "url", + "walkdir", + "windows 0.51.1", +] + +[[package]] +name = "tauri-winres" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" +dependencies = [ + "embed-resource", + "toml 0.7.8", +] + +[[package]] +name = "tauri-winrt-notification" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006851c9ccefa3c38a7646b8cec804bb429def3da10497bfa977179869c3e8e2" +dependencies = [ + "quick-xml 0.30.0", + "windows 0.51.1", +] + +[[package]] +name = "tempfile" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +dependencies = [ + "cfg-if", + "fastrand 2.0.1", + "redox_syscall", + "rustix 0.38.24", + "windows-sys 0.48.0", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + +[[package]] +name = "thiserror" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiff" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "time" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +dependencies = [ + "deranged", + "itoa 1.0.9", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "tray-icon" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7dce8a4b6d7a566ca78fa43f37efc7a3ec427480828d35fe3474c4f0c75396" +dependencies = [ + "cocoa 0.25.0", + "core-graphics 0.23.1", + "crossbeam-channel", + "dirs-next", + "libappindicator", + "muda", + "objc", + "once_cell", + "png", + "thiserror", + "windows-sys 0.48.0", +] + +[[package]] +name = "treediff" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" +dependencies = [ + "serde_json", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uds_windows" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +dependencies = [ + "tempfile", + "winapi", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +dependencies = [ + "getrandom 0.2.11", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.39", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" + +[[package]] +name = "wasm-streams" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys 0.18.1", + "glib 0.18.3", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup3", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-sys", + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pkg-config", + "soup3-sys", + "system-deps", +] + +[[package]] +name = "webview2-com" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15556ff1d1d6bc850dbb362762bae86069773dd30177c90d3bfa917080dc73" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.51.1", + "windows-core", + "windows-implement", + "windows-interface", +] + +[[package]] +name = "webview2-com-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "webview2-com-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3775bb005c3170497ec411b36005708b57ad486bfa3d23864c92f5973858ce8d" +dependencies = [ + "thiserror", + "windows 0.51.1", + "windows-core", +] + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "window-vibrancy" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af6abc2b9c56bd95887825a1ce56cde49a2a97c07e28db465d541f5098a2656c" +dependencies = [ + "cocoa 0.25.0", + "objc", + "raw-window-handle", + "windows-sys 0.52.0", + "windows-version", +] + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-implement", + "windows-interface", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-implement" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2b158efec5af20d8846836622f50a87e6556b9153a42772fa047f773c0e555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "windows-interface" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0546e63e1ce64c04403d2311fa0e3ab5ae3a367bd524b4a38d8d8d18c70cfa76" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows-version" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "winreg" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wry" +version = "0.34.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f1e29660f22d8eec141f41f59b7fef231e4113c370c89b90ae3a0db8dec1927" +dependencies = [ + "base64", + "block", + "cocoa 0.25.0", + "core-graphics 0.23.1", + "crossbeam-channel", + "dunce", + "gtk", + "html5ever", + "http", + "javascriptcore-rs", + "kuchikiki", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "sha2", + "soup3", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.51.1", + "windows-implement", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507" +dependencies = [ + "gethostname", + "nix 0.24.3", + "winapi", + "winapi-wsapoll", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67" +dependencies = [ + "nix 0.24.3", +] + +[[package]] +name = "xdg-home" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +dependencies = [ + "nix 0.26.4", + "winapi", +] + +[[package]] +name = "zbus" +version = "3.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "byteorder", + "derivative", + "enumflags2", + "event-listener 2.5.3", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.26.4", + "once_cell", + "ordered-stream", + "rand 0.8.5", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "winapi", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "3.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/json-to-class/src-tauri/Cargo.toml b/json-to-class/src-tauri/Cargo.toml new file mode 100644 index 0000000..2079567 --- /dev/null +++ b/json-to-class/src-tauri/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "json-to-calss" +version = "1.0.2" +description = "json转换为类或接口的桌面端工具" +authors = ["bmy"] +license = "" +repository = "" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +name = "tauri_app_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { version = "2.0.0-alpha.11", features = [] } + +[dependencies] +# devtools +tauri = { version = "2.0.0-alpha.17", features = ["macos-private-api"] } +# 窗口 +tauri-plugin-window = "2.0.0-alpha.2" +# shell 命令行 +tauri-plugin-shell = "2.0.0-alpha.4" +# 开机自启 +tauri-plugin-autostart = "2.0.0-alpha.4" +# 通知 +tauri-plugin-notification = "2.0.0-alpha.5" +# fs 文件系统 +tauri-plugin-fs = "2.0.0-alpha.4" +# 剪切板插件 +tauri-plugin-clipboard-manager = "2.0.0-alpha.4" +# dialog +tauri-plugin-dialog = "2.0.0-alpha.4" + +serde_json = "1.0" +window-vibrancy = "0.4.3" + +[profile.release] +panic = "abort" # Strip expensive panic clean-up logic +codegen-units = 1 # Compile crates one after another so the compiler can optimize better +lto = true # Enables link to optimizations +opt-level = "s" # Optimize for binary size +strip = true # Remove debug symbols + +[features] +# this feature is used for production builds or when `devPath` points to the filesystem +# DO NOT REMOVE!! +custom-protocol = ["tauri/custom-protocol"] diff --git a/json-to-class/src-tauri/build.rs b/json-to-class/src-tauri/build.rs new file mode 100644 index 0000000..d860e1e --- /dev/null +++ b/json-to-class/src-tauri/build.rs @@ -0,0 +1,3 @@ +fn main() { + tauri_build::build() +} diff --git a/json-to-class/src-tauri/icons/.pydio b/json-to-class/src-tauri/icons/.pydio new file mode 100644 index 0000000..73a83af --- /dev/null +++ b/json-to-class/src-tauri/icons/.pydio @@ -0,0 +1 @@ +f9e7ed09-d338-436e-855a-9f6dc62c18fd \ No newline at end of file diff --git a/json-to-class/src-tauri/icons/128x128.png b/json-to-class/src-tauri/icons/128x128.png new file mode 100644 index 0000000..1d36f4b Binary files /dev/null and b/json-to-class/src-tauri/icons/128x128.png differ diff --git a/json-to-class/src-tauri/icons/128x128@2x.png b/json-to-class/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..4543142 Binary files /dev/null and b/json-to-class/src-tauri/icons/128x128@2x.png differ diff --git a/json-to-class/src-tauri/icons/32x32.png b/json-to-class/src-tauri/icons/32x32.png new file mode 100644 index 0000000..3ddfd8f Binary files /dev/null and b/json-to-class/src-tauri/icons/32x32.png differ diff --git a/json-to-class/src-tauri/icons/JsonToClass.icns b/json-to-class/src-tauri/icons/JsonToClass.icns new file mode 100644 index 0000000..1009760 Binary files /dev/null and b/json-to-class/src-tauri/icons/JsonToClass.icns differ diff --git a/json-to-class/src-tauri/icons/JsonToClass.ico b/json-to-class/src-tauri/icons/JsonToClass.ico new file mode 100644 index 0000000..d2da817 Binary files /dev/null and b/json-to-class/src-tauri/icons/JsonToClass.ico differ diff --git a/json-to-class/src-tauri/src/.pydio b/json-to-class/src-tauri/src/.pydio new file mode 100644 index 0000000..18cbaff --- /dev/null +++ b/json-to-class/src-tauri/src/.pydio @@ -0,0 +1 @@ +91c2e4ee-c16f-45aa-8b97-593e9240f4fe \ No newline at end of file diff --git a/json-to-class/src-tauri/src/lib.rs b/json-to-class/src-tauri/src/lib.rs new file mode 100644 index 0000000..8fa4e4f --- /dev/null +++ b/json-to-class/src-tauri/src/lib.rs @@ -0,0 +1,76 @@ +use tauri_plugin_autostart::MacosLauncher; +use std::io::Write; +use tauri::{ Manager }; +use window_vibrancy::{apply_blur, apply_vibrancy, apply_acrylic, apply_mica, NSVisualEffectMaterial}; + +#[tauri::command] +fn greet(name: &str) -> String { + format!("Hello, {}! You've been greeted from Rust!", name) +} + +// 帮助前端 将 文件保存到本地,不使用 tauri 的原因是其 fs 模块的 +// 文件的访问权限控制无法实现此功能 +#[tauri::command] +fn created_file(name: &str, content: &str) -> String { + let mut file = std::fs::File::create(name).expect("create file error"); + file.write_all(content.as_bytes()).expect("write file error"); + format!("ok") +} + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .setup(|app| + { + let splashscreen_window = app.get_window("splashscreen").unwrap(); + let main_window = app.get_window("main").unwrap(); + + #[cfg(target_os = "macos")] + apply_vibrancy(&main_window, NSVisualEffectMaterial::HudWindow, None, None) + .expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS"); + + #[cfg(target_os = "windows")] + apply_blur(&main_window, Some((5, 5, 5, 0))) + .expect("Unsupported platform! 'apply_blur' is only supported on Windows"); + + + tauri::async_runtime::spawn(async move { + std::thread::sleep(std::time::Duration::from_secs(2)); + splashscreen_window.close().unwrap(); + main_window.show().unwrap(); + + + +// main_window.open_devtools() + }); + + Ok(()) + }) +// .on_window_event(|event| { +// let handle = event.window().app_handle(); +// let label = event.window().label(); +// match event.event() { +// WindowEvent::Focused(focused) => { +// println!("WindowEvent::Focused ==> {:?} {:?}", focused, label); +// if *focused { +// #[cfg(target_os = "macos")] +// match menu::setup_menu(handle, &label) { +// Ok(()) => {} +// Err(err) => println!("Failed to setup menu, {:?}", err), +// } +// } +// } +// _ => {} +// } +// }) + .plugin(tauri_plugin_clipboard_manager::init()) + .plugin(tauri_plugin_window::init()) + .plugin(tauri_plugin_fs::init()) + .plugin(tauri_plugin_shell::init()) + .plugin(tauri_plugin_notification::init()) + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]))) + .invoke_handler(tauri::generate_handler![greet, created_file ]) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/json-to-class/src-tauri/src/main.rs b/json-to-class/src-tauri/src/main.rs new file mode 100644 index 0000000..2abccd9 --- /dev/null +++ b/json-to-class/src-tauri/src/main.rs @@ -0,0 +1,6 @@ +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + tauri_app_lib::run() +} diff --git a/json-to-class/src-tauri/src/menu.rs b/json-to-class/src-tauri/src/menu.rs new file mode 100644 index 0000000..d35b71d --- /dev/null +++ b/json-to-class/src-tauri/src/menu.rs @@ -0,0 +1,64 @@ +use tauri::{ + menu::{ + CheckMenuItemBuilder, MenuBuilder, MenuItemBuilder, PredefinedMenuItem, + SubmenuBuilder, + }, + AppHandle, +}; + +pub fn setup_menu( + handle: &AppHandle, + label: &str, +) -> Result<(), Box> { + let pkg_info = handle.package_info(); + let app_name = &pkg_info.name.clone(); + + let app_menu = SubmenuBuilder::new(handle, app_name).quit().build()?; + let ab_menu = SubmenuBuilder::new(handle, "关于作者") + .items(&[ + &PredefinedMenuItem::about(handle, Some("关于"), None), + ]).build()?; + + let native_menu = SubmenuBuilder::new(handle, "NativeMenu") + .items(&[ + &PredefinedMenuItem::about(handle, Some("关于"), None), + &PredefinedMenuItem::services(handle, Some("服务")), + &PredefinedMenuItem::hide(handle, Some("隐藏")), + &PredefinedMenuItem::hide_others(handle, Some("隐藏其他")), + &PredefinedMenuItem::show_all(handle, Some("显示全部")), + &PredefinedMenuItem::quit(handle, Some("退出")), + &PredefinedMenuItem::close_window(handle, Some("关闭窗口")), + &PredefinedMenuItem::undo(handle, Some("撤销")), + &PredefinedMenuItem::redo(handle, Some("重做")), + &PredefinedMenuItem::cut(handle, Some("剪切")), + &PredefinedMenuItem::copy(handle, Some("拷贝")), + &PredefinedMenuItem::paste(handle, Some("粘贴")), + &PredefinedMenuItem::select_all(handle, Some("全选")), + &PredefinedMenuItem::fullscreen(handle, Some("切换全屏")), + &PredefinedMenuItem::minimize(handle, Some("最小化")), + &PredefinedMenuItem::maximize(handle, Some("最大化")), + ]) + .build()?; + + // only for "win_1" + let custom_menu = SubmenuBuilder::new(handle, "Test") + .item(&MenuItemBuilder::with_id("toggle", "Toggle").build(handle)) + .item(&CheckMenuItemBuilder::new("Mark").build(handle)) + .build()?; + + let mut menus = MenuBuilder::new(handle) + .item(&app_menu) + .item(&custom_menu) + .item(&native_menu); + + if label == "win1" { + menus = menus.item(&custom_menu); + } + + handle.set_menu(menus.build()?)?; + handle.on_menu_event(move |handle, event| { + println!("event id: {:?}", event.id); + }); + + Ok(()) +} \ No newline at end of file diff --git a/json-to-class/src-tauri/tauri.conf.json b/json-to-class/src-tauri/tauri.conf.json new file mode 100644 index 0000000..5d934b9 --- /dev/null +++ b/json-to-class/src-tauri/tauri.conf.json @@ -0,0 +1,105 @@ +{ + "build": { + "beforeDevCommand": "npm run dev", + "beforeBuildCommand": "npm run build", + "devPath": "http://localhost:1420", + "distDir": "../dist", + "withGlobalTauri": true + }, + "package": { + "productName": "JsonToClass", + "version": "1.0.2" + }, + "tauri": { + "macOSPrivateApi": true, + "bundle": { + "active": true, + "targets": [ + "app", + "dmg", + "nsis", + "msi", + "deb" + ], + "windows": { + "webviewInstallMode": { + "type": "embedBootstrapper" + } + }, + "deb": {}, + "identifier": "com.bmy.json.to.class", + "publisher": "bmy", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/JsonToClass.icns", + "icons/JsonToClass.ico" + ] + }, + "security": { + "csp": null + }, + "windows": [ + { + "label": "main", + "hiddenTitle": true, + "fullscreen": false, + "resizable": true, + "center": true, + "width": 1200, + "height": 900, + "minWidth": 1000, + "minHeight": 800, + "titleBarStyle": "Overlay", + "visible": false, + "transparent": true, + "title": "" + }, + { + "title": "JsonToClass - 为API接口数据自动生成 TypeScript 类型", + "width": 300, + "height": 400, + "center": true, + "titleBarStyle": "Overlay", + "resizable": false, + "hiddenTitle": true, + "url": "splashscreen.html", + "label": "splashscreen" + } + ] + }, + "plugins": { + "os": { + "all": true + }, + "app": { + "all": true + }, + "shell": { + "open": true + }, + "fs": { + "createDir": true, + "exists": true, + "writeTextFile": true, + "readTextFile": true, + "scope": [ + "$HOME/.jsontoclass/*", + "$HOME/.jsontoclass", + "$HOME/*" + ] + }, + "window": { + "all": false, + "close": true, + "hide": true, + "show": true, + "maximize": true, + "minimize": true, + "unmaximize": true, + "unminimize": true, + "startDragging": true + } + } +} diff --git a/json-to-class/src/.pydio b/json-to-class/src/.pydio new file mode 100644 index 0000000..0e237a4 --- /dev/null +++ b/json-to-class/src/.pydio @@ -0,0 +1 @@ +d1da14d5-0645-40a6-b16b-c49b9e0a1670 \ No newline at end of file diff --git a/json-to-class/src/App.svelte b/json-to-class/src/App.svelte new file mode 100644 index 0000000..7f17a7c --- /dev/null +++ b/json-to-class/src/App.svelte @@ -0,0 +1,33 @@ + + + + +
+ + + +
+ + diff --git a/json-to-class/src/assets/.pydio b/json-to-class/src/assets/.pydio new file mode 100644 index 0000000..35a1f36 --- /dev/null +++ b/json-to-class/src/assets/.pydio @@ -0,0 +1 @@ +436db918-fc61-410f-afaa-513f3a7ba3e1 \ No newline at end of file diff --git a/json-to-class/src/assets/less/.pydio b/json-to-class/src/assets/less/.pydio new file mode 100644 index 0000000..3ef355e --- /dev/null +++ b/json-to-class/src/assets/less/.pydio @@ -0,0 +1 @@ +95bda494-978b-4aeb-b551-cd3a8dc3e99c \ No newline at end of file diff --git a/json-to-class/src/assets/less/_.less b/json-to-class/src/assets/less/_.less new file mode 100644 index 0000000..40bcb57 --- /dev/null +++ b/json-to-class/src/assets/less/_.less @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +@import "vars.less"; +@import "mixins.less"; \ No newline at end of file diff --git a/json-to-class/src/assets/less/clear.less b/json-to-class/src/assets/less/clear.less new file mode 100644 index 0000000..32bbf20 --- /dev/null +++ b/json-to-class/src/assets/less/clear.less @@ -0,0 +1,410 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + + + + body { + transition: all 0.5s; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + background-color: transparent; + //box-shadow: 0 2px 5px 1px rgb(54 53 53 / 30%); + } + + + html { + line-height: 1; + -webkit-text-size-adjust: 100%; + } + + /* Sections + ========================================================================== */ + + /** + * Remove the margin in all browsers. + */ + + body, + ul, + li, + p, + h1, + h2, + h3, + h4, + h5, + h6 { + margin: 0; + padding: 0; + list-style: none; + } + + ::-webkit-scrollbar { + width: 0; + height: 0; + } + + .content { + margin-top: 1rem; + } + + /** + * Render the `main` element consistently in IE. + */ + + main { + display: block; + } + + /** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + + h1 { + font-size: 2em; + margin: 0.67em 0; + } + + /* Grouping content + ========================================================================== */ + + /** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + + hr { + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ + } + + /** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + + pre { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ + } + + /* Text-level semantics + ========================================================================== */ + + /** + * Remove the gray background on active links in IE 10. + */ + + a { + background-color: transparent; + text-decoration: none; + color: #000; + } + + /** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + + abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ + } + + /** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + + b, + strong { + font-weight: bolder; + } + + /** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + + code, + kbd, + samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ + } + + /** + * Add the correct font size in all browsers. + */ + + small { + font-size: 80%; + } + + /** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + /* Embedded content + ========================================================================== */ + + /** + * Remove the border on images inside links in IE 10. + */ + + img { + border-style: none; + width: 100%; + } + + /* Forms + ========================================================================== */ + + /** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + + button, + input, + optgroup, + select, + textarea { + font-family: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + line-height: 1.15; + /* 1 */ + margin: 0; + /* 2 */ + } + + /** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + + button, + input { + /* 1 */ + overflow: visible; + } + + /** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + + button, + select { + /* 1 */ + text-transform: none; + } + + /** + * Correct the inability to style clickable types in iOS and Safari. + */ + + button, + [type="button"], + [type="reset"], + [type="submit"] { + -webkit-appearance: button; + } + + /** + * Remove the inner border and padding in Firefox. + */ + + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; + } + + /** + * Restore the focus styles unset by the previous rule. + */ + + button:-moz-focusring, + [type="button"]:-moz-focusring, + [type="reset"]:-moz-focusring, + [type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; + } + + /** + * Correct the padding in Firefox. + */ + + fieldset { + padding: 0.35em 0.75em 0.625em; + } + + /** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + + legend { + box-sizing: border-box; + /* 1 */ + color: inherit; + /* 2 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + white-space: normal; + /* 1 */ + } + + /** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + + progress { + vertical-align: baseline; + } + + /** + * Remove the default vertical scrollbar in IE 10+. + */ + + textarea { + overflow: auto; + } + + /** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + + [type="checkbox"], + [type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ + } + + /** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + + [type="number"]::-webkit-inner-spin-button, + [type="number"]::-webkit-outer-spin-button { + height: auto; + } + + /** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + + [type="search"] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ + } + + /** + * Remove the inner padding in Chrome and Safari on macOS. + */ + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; + } + + /** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + + ::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ + } + + /* Interactive + ========================================================================== */ + + /* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + + details { + display: block; + } + + /* + * Add the correct display in all browsers. + */ + + summary { + display: list-item; + } + + /* Misc + ========================================================================== */ + + /** + * Add the correct display in IE 10+. + */ + + template { + display: none; + } + + /** + * Add the correct display in IE 10. + */ + + [hidden] { + display: none; + } \ No newline at end of file diff --git a/json-to-class/src/assets/less/mixins.less b/json-to-class/src/assets/less/mixins.less new file mode 100644 index 0000000..6db66d0 --- /dev/null +++ b/json-to-class/src/assets/less/mixins.less @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +@import "vars"; +.line (@position: left) { + border-@{position}: 1px solid @background; +} + +.padding(@top: 0px, @right: 0px, @bottom: 0px, @left: 0px) { + padding: @top @right @bottom @left; + box-sizing: border-box; +} + +.clearfix() { + + &:after, + &:before { + content: " "; + display: table; + } + + &:after { + clear: both; + } +} + + + + +// No Scrollbar +.no-scrollbar() { + &::-webkit-scrollbar { + display: none !important; + width: 0 !important; + height: 0 !important; + -webkit-appearance: none; + opacity: 0 !important; + } +} + + +.ellipsis() { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + word-wrap: break-word; +} + +.flex(@align: center, @justify: center) { + display: flex; + align-items: @align; + justify-content: @justify; +} + +//超出显示省略号 +.ellipsis() { + overflow: hidden; //超出的文本隐藏 + text-overflow: ellipsis; //溢出用省略号显示 + white-space: nowrap; //溢出不换行 +} \ No newline at end of file diff --git a/json-to-class/src/assets/less/reset.less b/json-to-class/src/assets/less/reset.less new file mode 100644 index 0000000..f9fbfe4 --- /dev/null +++ b/json-to-class/src/assets/less/reset.less @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + diff --git a/json-to-class/src/assets/less/vars.less b/json-to-class/src/assets/less/vars.less new file mode 100644 index 0000000..1665785 --- /dev/null +++ b/json-to-class/src/assets/less/vars.less @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +@background: var(--background, #d5d0d0); +@color: var(--color, #000); +@activeBackgroundColor: var(--activeBackgroundColor, #fff); + + diff --git a/json-to-class/src/component/.pydio b/json-to-class/src/component/.pydio new file mode 100644 index 0000000..f6f2d3a --- /dev/null +++ b/json-to-class/src/component/.pydio @@ -0,0 +1 @@ +04b3a9f6-9b82-42fb-bec3-fe3f1e287f07 \ No newline at end of file diff --git a/json-to-class/src/component/about.svelte b/json-to-class/src/component/about.svelte new file mode 100644 index 0000000..9c0479b --- /dev/null +++ b/json-to-class/src/component/about.svelte @@ -0,0 +1,111 @@ + + + + + +
+ + + + +
+

名称:{appName}

+

+ 版本:v{appVersion} + + 检查更新 + +

+

Tauri:v{TauriVersion} beta

+

源码:https://gitee.com/bmycode/json-class-desktop

+
+
+

作者:Bmy

+

邮箱:2271608011@qq.com

+

Github:https://github.com/helpcode

+

Gitee:https://gitee.com/bmycode

+
+
+ + +
+
+ + \ No newline at end of file diff --git a/json-to-class/src/component/basis.svelte b/json-to-class/src/component/basis.svelte new file mode 100644 index 0000000..88bcfbb --- /dev/null +++ b/json-to-class/src/component/basis.svelte @@ -0,0 +1,90 @@ + + + + +
+ + { + $themeConfig.JsonType = Number(JsonTypeSelect) + JsonDatabase.writeJson($themeConfig) + }}/> + + { + $themeConfig.needProperty = Number(needPropertySelect) + JsonDatabase.writeJson($themeConfig) + }}/> + + { + $themeConfig.needPropertyValue = Number(needPropertyValueSelect) + JsonDatabase.writeJson($themeConfig) + }}/> + + { + $themeConfig.nullAlias = NullAliasSelect + JsonDatabase.writeJson($themeConfig) + }} + description="如果JOSN中某对象的值为 null,转化为 class 或 interface 时候,给这个对象key个默认类型" + /> + + +
+ + \ No newline at end of file diff --git a/json-to-class/src/component/edit.svelte b/json-to-class/src/component/edit.svelte new file mode 100644 index 0000000..5227d64 --- /dev/null +++ b/json-to-class/src/component/edit.svelte @@ -0,0 +1,157 @@ + + + + +
+
+
+
+ + \ No newline at end of file diff --git a/json-to-class/src/component/layout.svelte b/json-to-class/src/component/layout.svelte new file mode 100644 index 0000000..abeac73 --- /dev/null +++ b/json-to-class/src/component/layout.svelte @@ -0,0 +1,44 @@ + + + + +
{text}
+
+ +
+ + \ No newline at end of file diff --git a/json-to-class/src/component/other.svelte b/json-to-class/src/component/other.svelte new file mode 100644 index 0000000..3dfb5b6 --- /dev/null +++ b/json-to-class/src/component/other.svelte @@ -0,0 +1,182 @@ + + + + +
+ + +
+
主题设置:
+
    + {#each ThemeList as {label, value, src}, i} +
  • + SelectChangeTheme(i)} + src={src} + alt={label}> +

    {label}

    +
  • + {/each} +
+
+ + { + monaco.editor + $themeConfig.lineNumbers = LineNumbersSelect + JsonDatabase.writeJson($themeConfig) + updateEdit() + }}/> + + { + $themeConfig.minimap = Number(MinimapSelect) + JsonDatabase.writeJson($themeConfig) + updateEdit() + }}/> + + { + $themeConfig.autoClipboard = Number(AutoClipboardSelect) + JsonDatabase.writeJson($themeConfig) + updateEdit() + }}/> + + + { + let isStart = Number(AutoLoginStartSelect) + isStart ? AutoStart.EnableAutoStart() : AutoStart.DisableAutoStart() + $themeConfig.autoLoginStart = isStart + JsonDatabase.writeJson($themeConfig) + }}/> +
+
+ + \ No newline at end of file diff --git a/json-to-class/src/component/storage.svelte b/json-to-class/src/component/storage.svelte new file mode 100644 index 0000000..2e23d62 --- /dev/null +++ b/json-to-class/src/component/storage.svelte @@ -0,0 +1,73 @@ + + + + +
+ + + { + $themeConfig.autoSave = Number(AutoSaveSelect) + JsonDatabase.writeJson($themeConfig) + }}/> + + { + $themeConfig.savePath = SavePathSelect + JsonDatabase.writeJson($themeConfig) + }}> + + + { + $themeConfig.saveFileName = SaveFileNameSelect + JsonDatabase.writeJson($themeConfig) + }}> + + + + +
+ + \ No newline at end of file diff --git a/json-to-class/src/config/.pydio b/json-to-class/src/config/.pydio new file mode 100644 index 0000000..5d0ad3f --- /dev/null +++ b/json-to-class/src/config/.pydio @@ -0,0 +1 @@ +93bb09be-1437-4b96-bb91-75f4f49fada3 \ No newline at end of file diff --git a/json-to-class/src/config/index.ts b/json-to-class/src/config/index.ts new file mode 100644 index 0000000..fdb854a --- /dev/null +++ b/json-to-class/src/config/index.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import { Window } from '@tauri-apps/plugin-window'; +import { editor } from "monaco-editor"; + +export interface themeType { + background: string; + color: string; + activeBackgroundColor: string; +} + +interface configType { + giteeApi: { + releasesUrl: string; + starUser: string + }; + JsonDom: editor.IStandaloneCodeEditor | null; + ClassOrInterface: editor.IStandaloneCodeEditor | null; + light: themeType; + dark: themeType; + appWindow: Window, + os: Window, + offOrOnList: (ags?: number) => Record[] +} + +const config: configType = { + giteeApi: { + releasesUrl: "https://gitee.com/api/v5/repos/bmycode/json-class-desktop/releases/latest", + starUser: "https://gitee.com/api/v5/repos/bmycode/json-class-desktop/stargazers?page=1&per_page=20" + }, + JsonDom: null, + ClassOrInterface: null, + // @ts-ignore + appWindow: window.__TAURI__.window.getCurrent(), + os: window.__TAURI__.os, + light: { + // background: "#d5d0d0", + background: "rgba(213, 208, 208, 0.6)", + color: "#000", + activeBackgroundColor: "#fff" + }, + dark: { + // background: "#252526", + background: "rgba(0, 0, 0, 0.6)", + color: "#bdbdbd", + activeBackgroundColor: "#1e1e1e" + }, + offOrOnList: (type: number = 0) => { + switch (type) { + case 0: + return [ + { label: "开启", value: "1" }, + { label: "关闭", value: "0" } + ] + case 1: + return [ + { label: "class", value: "0" }, + { label: "interface", value: "1" } + ] + case 2: + return [ + { label: "开启", value: "on" }, + { label: "关闭", value: "off" } + ] + } + return [] + } +} + +export default config \ No newline at end of file diff --git a/json-to-class/src/global.d.ts b/json-to-class/src/global.d.ts new file mode 100644 index 0000000..54fe040 --- /dev/null +++ b/json-to-class/src/global.d.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ +import { Window as PluginWindow } from "@tauri-apps/plugin-window"; +declare module "*.jpg"; +declare module "*.png"; +declare module "*.woff2"; +declare module "*.woff"; +declare module "*.ttf"; +declare module "*.scss" { + const content: Record; + export default content; +} + +declare module "*.svg"; + +type Platform = + | 'linux' + | 'darwin' + | 'ios' + | 'freebsd' + | 'dragonfly' + | 'netbsd' + | 'openbsd' + | 'solaris' + | 'android' + | 'win32' + +declare interface Window { + __TAURI__: { + app: { + getVersion(): Promise; + getName(): Promise; + getTauriVersion(): Promise; + }, + window: { + getCurrent(): PluginWindow; + }, + writeText(text: string): Promise; + invoke(command: string, payload?: Record): Promise; + dialog: { + save(options?: Record): Promise; + }; + fs: { + writeBinaryFile(path: string, data: Uint8Array): Promise; + }; + notification:{ + requestPermission(): Promise; + isPermissionGranted(): Promise; + sendNotification(options: string | Options): void; + }; + os: { + platform(): Promise; + } + }; +} + + diff --git a/json-to-class/src/http/.pydio b/json-to-class/src/http/.pydio new file mode 100644 index 0000000..60bb55d --- /dev/null +++ b/json-to-class/src/http/.pydio @@ -0,0 +1 @@ +b77cc2cc-7867-4666-92af-0cab7a368ad2 \ No newline at end of file diff --git a/json-to-class/src/http/index.ts b/json-to-class/src/http/index.ts new file mode 100644 index 0000000..2125baa --- /dev/null +++ b/json-to-class/src/http/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +class Http { + public async get(url: string) { + const response = await fetch(url, { + method: "GET", + }); + return await response.json() + } +} + +export default new Http \ No newline at end of file diff --git a/json-to-class/src/main.ts b/json-to-class/src/main.ts new file mode 100644 index 0000000..11ba366 --- /dev/null +++ b/json-to-class/src/main.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ +import "reflect-metadata"; +import App from './App.svelte' +import './assets/less/clear.less' +import DataBase from "@/utils/JsonDatabase"; + +const app = new App({ + target: document.querySelector("#app"), +}) + +await DataBase.CreatedJsonDataBase() + +export default app diff --git a/json-to-class/src/pages/.pydio b/json-to-class/src/pages/.pydio new file mode 100644 index 0000000..5466eef --- /dev/null +++ b/json-to-class/src/pages/.pydio @@ -0,0 +1 @@ +c2159091-b0fb-432d-9c80-ce002a05e245 \ No newline at end of file diff --git a/json-to-class/src/pages/home/.pydio b/json-to-class/src/pages/home/.pydio new file mode 100644 index 0000000..df7e71d --- /dev/null +++ b/json-to-class/src/pages/home/.pydio @@ -0,0 +1 @@ +38117c2b-95c0-4847-8483-a55c44769d40 \ No newline at end of file diff --git a/json-to-class/src/pages/home/home.less b/json-to-class/src/pages/home/home.less new file mode 100644 index 0000000..de33527 --- /dev/null +++ b/json-to-class/src/pages/home/home.less @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +@import "../../assets/less/_.less"; +.home { + width: 100%; + height: 100vh; + display: flex; + .aside { + width: 70px; + background: @background; + .padding(35px,15px,25px,15px); + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + i { + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + font-size: 25px; + color: @color; + cursor: pointer; + font-weight: lighter; + border-radius: 6px ; + transition: all 0.5s; + &:hover { + background: @activeBackgroundColor; + color: @color; + } + } + + .aside_top { + display: flex; + flex-direction: column; + i { + margin-bottom: 25px; + } + .json-shezhi { + font-size: 20px; + } + + .active { + background: @activeBackgroundColor; + color: @color; + } + } + .aside_bottom { + font-size: 25px; + } + } + .container { + flex: 1; + display: flex; + flex-direction: column; + .drag { + width: 100%; + height: 35px; + background: @activeBackgroundColor; + } + .main { + display: flex; + flex: 1; + background: @activeBackgroundColor; + + .left-drag { + width: 26px; + height: 100%; + } + + .wrap { + flex: 1; + } + } + } +} + +:global(.svelteui-Group-root) { + margin-top: 14px; + row-gap: 10px; +} +:global(.svelteui-InputWrapper-root) { + margin-bottom: 25px; +} +:global(.svelteui-Input-root) { + width: 350px; +} +:global(.svelteui-InputWrapper-label, .svelteui-Radio-label) { + color: @color !important; + user-select: none; +} \ No newline at end of file diff --git a/json-to-class/src/pages/home/home.svelte b/json-to-class/src/pages/home/home.svelte new file mode 100644 index 0000000..eb52fd4 --- /dev/null +++ b/json-to-class/src/pages/home/home.svelte @@ -0,0 +1,69 @@ + + + + +
+
+
+ {#each menu as {icon, component, title}, i} + { index = i }} + class:active={i === index} + class="iconfont {icon}"> + + {/each} +
+ + +
+
+
+
+ {#each menu as {icon, component, title}, i} +
+ +
+ {/each} +
+
+
+
+ + \ No newline at end of file diff --git a/json-to-class/src/router/.pydio b/json-to-class/src/router/.pydio new file mode 100644 index 0000000..f0c8d5d --- /dev/null +++ b/json-to-class/src/router/.pydio @@ -0,0 +1 @@ +29f0b147-7c12-4045-b6da-4750f16f1545 \ No newline at end of file diff --git a/json-to-class/src/router/index.ts b/json-to-class/src/router/index.ts new file mode 100644 index 0000000..457bab4 --- /dev/null +++ b/json-to-class/src/router/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import { wrap } from 'svelte-spa-router/wrap' + +export default { + '/': wrap({ + asyncComponent: () => import('../pages/home/home.svelte') + }) +} \ No newline at end of file diff --git a/json-to-class/src/serve/.pydio b/json-to-class/src/serve/.pydio new file mode 100644 index 0000000..730dd47 --- /dev/null +++ b/json-to-class/src/serve/.pydio @@ -0,0 +1 @@ +2ec43f43-e6a7-4c3d-bf42-4b3a9bb88951 \ No newline at end of file diff --git a/json-to-class/src/serve/gitee.ts b/json-to-class/src/serve/gitee.ts new file mode 100644 index 0000000..881db4f --- /dev/null +++ b/json-to-class/src/serve/gitee.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ +import Http from "@/http"; +import config from "@/config"; +import type { ReleasesLatestType } from "@/serve/types/ReleasesLatestType"; + +class Gitee { + + public async ReleasesLatest(): Promise { + return await Http.get(config.giteeApi.releasesUrl) + } + + + /** + * + * @param curV 新版本号 + * @param reqV 当前应用的版本号 + */ + public compare(curV: string, reqV: string): boolean { + if (curV && reqV) { + //将两个版本号拆成数字 + let arr1 = curV.split('.'), + arr2 = reqV.split('.'); + let minLength = Math.min(arr1.length, arr2.length), + position = 0, + diff = 0; + //依次比较版本号每一位大小,当对比得出结果后跳出循环(后文有简单介绍) + while (position < minLength && ((diff = parseInt(arr1[position]) - parseInt(arr2[position])) == 0)) { + position++; + } + diff = (diff != 0) ? diff : (arr1.length - arr2.length); + //若curV大于reqV,则返回true + return diff > 0; + } else { + //输入为空 + return false; + } + } +} + +export default new Gitee \ No newline at end of file diff --git a/json-to-class/src/serve/types/.pydio b/json-to-class/src/serve/types/.pydio new file mode 100644 index 0000000..4830de8 --- /dev/null +++ b/json-to-class/src/serve/types/.pydio @@ -0,0 +1 @@ +f6adc4f0-1d33-49e7-a5af-c42808f3978a \ No newline at end of file diff --git a/json-to-class/src/serve/types/ReleasesLatestType.ts b/json-to-class/src/serve/types/ReleasesLatestType.ts new file mode 100644 index 0000000..01c08f0 --- /dev/null +++ b/json-to-class/src/serve/types/ReleasesLatestType.ts @@ -0,0 +1,68 @@ +export interface Author { + + id: number; + + login: string; + + name: string; + + avatar_url: string; + + url: string; + + html_url: string; + + remark: string; + + followers_url: string; + + following_url: string; + + gists_url: string; + + starred_url: string; + + subscriptions_url: string; + + organizations_url: string; + + repos_url: string; + + events_url: string; + + received_events_url: string; + + type: string; + +} + +export interface Assets { + + browser_download_url: string; + + name: string; + +} + +export interface ReleasesLatestType { + + id: number; + + tag_name: string; + + target_commitish: string; + + prerelease: boolean; + + name: string; + + body: string; + + author: Author; + + created_at: string; + + assets: Assets[]; + +} + diff --git a/json-to-class/src/stores/.pydio b/json-to-class/src/stores/.pydio new file mode 100644 index 0000000..01ed47e --- /dev/null +++ b/json-to-class/src/stores/.pydio @@ -0,0 +1 @@ +871ad8b8-3e2f-42e2-b451-26732fceddcd \ No newline at end of file diff --git a/json-to-class/src/stores/ThemeStore.ts b/json-to-class/src/stores/ThemeStore.ts new file mode 100644 index 0000000..463b8f5 --- /dev/null +++ b/json-to-class/src/stores/ThemeStore.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import { writable } from 'svelte/store'; +import JsonDatabase from '@/utils/JsonDatabase'; + +// 获取本地所有主题 +export const themeConfig = writable(await JsonDatabase.readJson()); \ No newline at end of file diff --git a/json-to-class/src/utils/.pydio b/json-to-class/src/utils/.pydio new file mode 100644 index 0000000..e618f6f --- /dev/null +++ b/json-to-class/src/utils/.pydio @@ -0,0 +1 @@ +9d3f3f75-17d1-4359-87d1-0d936e220b6b \ No newline at end of file diff --git a/json-to-class/src/utils/AutoStart.ts b/json-to-class/src/utils/AutoStart.ts new file mode 100644 index 0000000..a3f22dc --- /dev/null +++ b/json-to-class/src/utils/AutoStart.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart"; +import Notification from "./Notification"; + +export default class AutoStart { + + /** + * 注册开机自启 + */ + public static async EnableAutoStart() { + if (!await isEnabled()) { + await enable(); + await Notification.send({ title: '恭喜', body: '已注册开机自启' }) + } + } + + /** + * 禁用开机自启 + */ + public static async DisableAutoStart() { + await disable(); + await Notification.send({ title: '恭喜', body: '已关闭开机自启' }) + } + +} \ No newline at end of file diff --git a/json-to-class/src/utils/ChangeTheme.ts b/json-to-class/src/utils/ChangeTheme.ts new file mode 100644 index 0000000..8eb0ab5 --- /dev/null +++ b/json-to-class/src/utils/ChangeTheme.ts @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import config, { type themeType } from "@/config"; +import * as monaco from "monaco-editor"; +import JsonDatabase, { type DbConfig, type themeValueType } from "@/utils/JsonDatabase"; +import { themeConfig } from '@/stores/ThemeStore'; +import { get } from 'svelte/store'; + + +class ChangeTheme { + constructor() { + this.onThemeChanged().then() + } + + public changeStyle(obj: themeType) { + let key: keyof themeType; + for (key in obj) { + (document.querySelector("body")) + .style.setProperty(`--${ key }`, obj[key]); + } + } + + public setTheme(themeName: themeValueType) { + const themeConfig = config[themeName]; + this.changeStyle(themeConfig); + } + + public async setThemeRunCode(conf: DbConfig, type?: string) { + const code = async () => { + this.setTheme(conf.theme) + monaco.editor.setTheme( + conf.theme == 'light' ? 'vs' : 'vs-dark' + ) + await JsonDatabase.writeJson(conf); + } + + // 启动时候等待1秒,等 编辑器 配置完成,再设置编辑器主题,否则 会设置失效 + type == "app" + ? setTimeout(async () => await code(), 1000) + : await code() + } + + public async onThemeChanged() { + await config.appWindow.onThemeChanged(async ({ payload: theme }) => { + let conf = get(themeConfig) + if (conf.autoThemeSystem) { + conf.theme = theme + conf.autoThemeSystem = 1 + await this.setThemeRunCode(conf) + // update 更新,通知 App.svelte 的订阅,用于更新 ui框架 的 主题模式 + themeConfig.update(v => conf) + } + }); + } +} + +export default new ChangeTheme \ No newline at end of file diff --git a/json-to-class/src/utils/JsonDatabase.ts b/json-to-class/src/utils/JsonDatabase.ts new file mode 100644 index 0000000..173c7ae --- /dev/null +++ b/json-to-class/src/utils/JsonDatabase.ts @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import { BaseDirectory, createDir, exists, writeTextFile, readTextFile } from "@tauri-apps/plugin-fs"; +import { homeDir } from '@tauri-apps/api/path'; + +export type value = 1 | 0; +export type themeValueType = 'light' | 'dark'; + + +export interface DbConfig { + JsonType: value; + needProperty: value; + needPropertyValue: value; + nullAlias: string; + + autoSave: value; + savePath: string; + saveFileName: string + + theme: themeValueType, + autoThemeSystem: value; + autoLoginStart: value; + + lineNumbers: 'on' | 'off'; + minimap: value; + autoClipboard: value; +} + +class JsonDatabase { + + // 文件夹名称 + DirectoryName: string = ".jsontoclass" + + // 保存配置的json文件名 + JsonFileName: string = "db.json" + + // 文件夹 + json 文件 .jsontoclass/db.json + DbFullPath: string = `${this.DirectoryName}/${this.JsonFileName}` + + // UI框架限制RadioGroup这类UI组件的 items 中 value 和 bind:value 必须为 string,所以这里 + // 存储 设置项 不使用 boolean,组件内 会对 number 0 进行 String + DataBaseConfig: DbConfig = { + JsonType : 0, + needProperty : 0, + needPropertyValue: 0, + nullAlias : "string", + + autoSave : 0, + savePath : "", + saveFileName: "", + + theme : "light", + autoThemeSystem: 0, + autoLoginStart : 0, + + lineNumbers: "off", + minimap: 0, + autoClipboard: 0 + } + + /** + * 创建json数据库 + * @constructor + */ + public async CreatedJsonDataBase() { + let rootPath = await homeDir(); + let fullPath: string = `${ await homeDir() }/${ this.DbFullPath }` + if (!await exists(`${ rootPath }/${ this.DirectoryName }`)) { + await createDir(this.DirectoryName, { dir: BaseDirectory.Home }) + if (!await exists(fullPath)) { + await this.writeJson(this.DataBaseConfig); + } + } + } + + public async readJson(): Promise { + await this.CreatedJsonDataBase(); + const res = await readTextFile(this.DbFullPath, { dir: BaseDirectory.Home }); + return JSON.parse(res); + } + + public async writeJson(str: DbConfig) { + await writeTextFile(this.DbFullPath, JSON.stringify(str), { dir: BaseDirectory.Home }); + } +} + +export default new JsonDatabase diff --git a/json-to-class/src/utils/MonacoEditor.ts b/json-to-class/src/utils/MonacoEditor.ts new file mode 100644 index 0000000..01fd79a --- /dev/null +++ b/json-to-class/src/utils/MonacoEditor.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import * as monaco from 'monaco-editor'; +import { themeConfig } from "@/stores/ThemeStore"; +import { get } from 'svelte/store'; + +// 使用插件 vite-plugin-monaco-editor 简化了 MonacoEditor 的一些配置 +// 原配置方法参考:https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md#using-vite +export class MonacoEditor { + + public static conf = get(themeConfig) + + public static creatMonacoEditor(el: HTMLElement) { + return monaco.editor.create(el, { + value: '', + language: 'json', + formatOnPaste: true, + formatOnType: true, + tabSize: 2, + fontSize: 16, + contextmenu: false, + automaticLayout: true, + theme: "vs", + lineNumbers: MonacoEditor.conf.lineNumbers, + minimap: { + enabled: Boolean(MonacoEditor.conf.minimap) + } + }); + } +} \ No newline at end of file diff --git a/json-to-class/src/utils/Notification.ts b/json-to-class/src/utils/Notification.ts new file mode 100644 index 0000000..d2c62e6 --- /dev/null +++ b/json-to-class/src/utils/Notification.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +import { isPermissionGranted, requestPermission, sendNotification, type Options } from '@tauri-apps/plugin-notification'; + +export default class Notification { + + /** + * 有权限,发送系统通知 + */ + public static async send(options: Options) { + if (await Notification.checkisPermission()) { + sendNotification(options); + } + } + + /** + * 检查是否具有通知权限,没有就请求发送通知的权限 + */ + public static async checkisPermission() { + let permissionGranted = await isPermissionGranted(); + if (!permissionGranted) { + const permission = await requestPermission(); + permissionGranted = permission === 'granted'; + } + return permissionGranted + } + +} diff --git a/json-to-class/src/vite-env.d.ts b/json-to-class/src/vite-env.d.ts new file mode 100644 index 0000000..d9961d4 --- /dev/null +++ b/json-to-class/src/vite-env.d.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023. + * + * 作者:bmy + * 邮箱:2271608011@qq.com + * gitee:https://gitee.com/bmycode + * github:https://github.com/helpcode + * + */ + +/// +/// diff --git a/json-to-class/svelte.config.js b/json-to-class/svelte.config.js new file mode 100644 index 0000000..de2ddd6 --- /dev/null +++ b/json-to-class/svelte.config.js @@ -0,0 +1,7 @@ +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; + +export default { + // Consult https://svelte.dev/docs#compile-time-svelte-preprocess + // for more information about preprocessors + preprocess: vitePreprocess(), +}; diff --git a/json-to-class/tsconfig.json b/json-to-class/tsconfig.json new file mode 100644 index 0000000..a4871ac --- /dev/null +++ b/json-to-class/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "@tsconfig/svelte/tsconfig.json", + "compilerOptions": { + "baseUrl": "./", + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "moduleResolution": "node", + "resolveJsonModule": true, + "verbatimModuleSyntax": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "allowJs": true, + "checkJs": true, + "isolatedModules": true, + "paths": { + "@/*": ["src/*"] + } + }, + "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], + "files": [ "src/global.d.ts" ], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/json-to-class/tsconfig.node.json b/json-to-class/tsconfig.node.json new file mode 100644 index 0000000..494bfe0 --- /dev/null +++ b/json-to-class/tsconfig.node.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler" + }, + "include": ["vite.config.ts"] +} diff --git a/json-to-class/vite.config.ts b/json-to-class/vite.config.ts new file mode 100644 index 0000000..9ffa7b0 --- /dev/null +++ b/json-to-class/vite.config.ts @@ -0,0 +1,49 @@ +import { defineConfig, type PluginOption } from "vite"; +import { svelte } from "@sveltejs/vite-plugin-svelte"; +import { internalIpV4 } from "internal-ip"; +import { less } from 'svelte-preprocess-less'; +import { visualizer } from "rollup-plugin-visualizer"; +import { join } from "path"; +import monacoEditorPlugin, { IMonacoEditorOpts } from 'vite-plugin-monaco-editor'; + +const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM); +const monacoEditorPluginDefault = ((monacoEditorPlugin as any).default) as (options: IMonacoEditorOpts) => any; + +export default defineConfig(async () => ({ + base: "./", + build: { + target: 'esnext' + }, + plugins: [ + visualizer({ + template: 'treemap' + }) as PluginOption, + svelte({ + preprocess: { + style: less(), + }, + }), + monacoEditorPluginDefault({ + languageWorkers: [ 'json' ] + }) + ], + + clearScreen: false, + server : { + port : 1420, + strictPort: true, + host : mobile ? "0.0.0.0" : false, + hmr : mobile + ? { + protocol: "ws", + host : await internalIpV4(), + port : 1421, + } + : undefined, + }, + resolve: { + alias: { + '@': join(__dirname, "src/"), + } + } +}));