{"id":13486865,"url":"https://github.com/neatfx/tiny-evt","last_synced_at":"2026-04-10T06:49:32.833Z","repository":{"id":230228593,"uuid":"263676055","full_name":"neatfx/tiny-evt","owner":"neatfx","description":"Electron + Vite + Vue3 + TypeScript","archived":false,"fork":false,"pushed_at":"2022-04-21T10:14:18.000Z","size":22609,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-12T07:12:22.349Z","etag":null,"topics":["dexiejs","electron","playwright","typescript","vite","vue-test-utils","vue3"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neatfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"custom":["https://github.com/neatfx/donation"]}},"created_at":"2020-05-13T15:53:50.000Z","updated_at":"2024-03-28T12:40:50.000Z","dependencies_parsed_at":"2024-04-06T22:32:00.524Z","dependency_job_id":null,"html_url":"https://github.com/neatfx/tiny-evt","commit_stats":null,"previous_names":["neatfx/tiny-evt"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neatfx%2Ftiny-evt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neatfx%2Ftiny-evt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neatfx%2Ftiny-evt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neatfx%2Ftiny-evt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neatfx","download_url":"https://codeload.github.com/neatfx/tiny-evt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241389133,"owners_count":19955106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dexiejs","electron","playwright","typescript","vite","vue-test-utils","vue3"],"created_at":"2024-07-31T18:00:52.271Z","updated_at":"2025-10-12T21:36:09.207Z","avatar_url":"https://github.com/neatfx.png","language":"Vue","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"120\" src=\"main/resources/icons/icon.png\" alt=\"Awesome\"\u003e\n  \u003cp\u003e\u003cb\u003e\u003ci\u003etiny-evt\u003c/i\u003e\u003c/b\u003e\u003c/p\u003e\n  \u003cp\u003e\n    \u003cimg src=https://github.com/neatfx/tiny-evt/workflows/Lint/badge.svg\u003e\n    \u003cimg src=https://github.com/neatfx/tiny-evt/workflows/Test/badge.svg\u003e\n    \u003cimg src=https://github.com/neatfx/tiny-evt/workflows/Release/badge.svg\u003e\n    \u003cimg src=https://github.com/neatfx/tiny-evt/workflows/Build%20\u0026%20Publish/badge.svg\u003e\n  \u003c/p\u003e\n  \u003cp\u003e由 Vite 驱动，使用 TypeScript、Vue 开发 Electron 应用的项目基础代码\u003c/p\u003e\n  \u003cp\u003e简洁易用，准备工作更少，运行、HMR、打包速度更快！遵循 \u003ca href=\"https://www.electronjs.org/docs/tutorial/security\"\u003e安全建议\u003c/a\u003e、包含自动化测试构建\u003c/p\u003e\n  \u003cimg src=\"screenshot.png\" /\u003e\n\u003c/div\u003e\n\n\u003e 依赖列表\n\n| Dependence          | Category  | Required | Version          | Information |\n| :---:               |:---:      |:---:     |:---:             |:---:|\n| `vue`               |           | `true`   | `3.2.25`         |\n| `vue-router`        |           |          | `4.0.5`          |\n| `@playwright/test`  | `dev`     |          | `1.17.2`         | 测试工具\n| `@vue/test-utils`   | `dev`     |          | `2.0.0-rc.4`     | 测试工具\n| `@vitejs/plugin-vue`| `dev`     | `true`   | `2.1.0`          | 为 SFC@Vue3 提供支持\n| `electron`          | `dev`     | `true`   | `16.0.7`         |\n| `electron-builder`  | `dev`     | `true`   | `22.10.5`        |\n| `vite`              | `dev`     | `true`   | `2.7.13`         | 包含 `esbuild`\n\n---\n\n\u003e First Run\n\n```bash\n# 第一步\ncd tiny-evt \u0026\u0026 npm install \u0026\u0026 cp configs/.env-cmdrc.json .\n\n# 第二步，修改 ./.env-cmdrc.json 文件\n\"dist\": {\n  \"CSC_IDENTITY_AUTO_DISCOVERY\": false,\n  \"PUBLISH_BUILD\": false\n}\n\n应用包含 GitHub Graphql API 调用，需填写 \"GITHUB_TOKEN\" 字段，如留空则使用 Mock 数据代替真实请求\n```\n\n---\n\n\u003e 运行应用\n\n```bash\n# 编译脚本\n# scripts/dev-runner.ts ---\u003e esbuild.build() ---\u003e build/dev-runner.js\n\n# 运行脚本（ 环境变量，NODE_ENV=development ）\n# node build/dev-runner.js\n\n# 脚本执行操作 - 启动本地服务器运行 Renderer Process ( Vue APP )\n# renderer/**/* ---\u003e Vite ---\u003e dev-server @ localhost:3000\n\n# 脚本执行操作 - 利用 Vite 中引入的 esbuild 编译打包 Main Process ( TypeScript APP )\n# main/**/* ---\u003e esbuild.build() ---\u003e build/main.js、build/preload.js\n\n# 脚本执行操作 - 运行 Electron 应用\n# electron ---\u003e build/main.js\n\n# 开发版环境下，测试版本 Electron 应用的 main-window 指向本地 Vite-dev-server\n# main-window @ TinyEvt @ development ---\u003e localhost:3000\n\nnpm run dev\n```\n\n---\n\n\u003e 运行测试\n\n```js\n/**\n * 测试类型：`Unit Testing`\n * 测试目标：`Components @ Vue App @ Renderer`\n * 测试工具：`Vue Test Utils`、`Jest`\n *\n * 编译脚本\n * scripts/dev-runner.ts ---\u003e esbuild.build() ---\u003e build/dev-runner.js\n *\n * 运行脚本（ 环境变量 NODE_ENV=development、TEST=vtu ）\n * node build/dev-runner.js\n *\n * 脚本执行操作 - 编译 Tests ( 利用既有 vite 配置，无缝支持解析 .vue 文件以及编译 TypeScript )\n * tests/vtu/*.spec.ts ---\u003e Vite.build() ---\u003e tests/vtu/build\n *\n * 脚本执行操作 - 启动 Jest 运行测试用例 ( tests/vtu/build/*.js )\n */\n\nnpm run vtu\n```\n\n```js\n/**\n * 测试类型：`End-to-End Testing`\n * 测试目标：`Vue App @ Renderer`\n * 测试工具：`playwright`\n *\n * 编译脚本\n * scripts/dev-runner.ts ---\u003e esbuild.build() ---\u003e build/dev-runner.js\n *\n * 运行脚本（ 环境变量 NODE_ENV=development、TEST=e2e ）\n * node build/dev-runner.js\n *\n * 脚本执行操作 - 启动本地服务器运行 Renderer Process ( Vue APP )\n * renderer/* ---\u003e Vite ---\u003e dev-server @ localhost:3000\n *\n * 脚本执行操作 - 启动 playwright 测试（ e2e/*.spec.ts，测试页面指向 localhost:3000 ）\n *\n * 测试环境下 playwright 打开浏览器进行测试，构建环境下 playwright 以 headless 模式运行方式\n */\n\nnpm run e2e\n```\n\n---\n\n\u003e 应用打包\n\n```bash\n# 编译脚本\n# scripts/app-builder.ts ---\u003e esbuild.build() ---\u003e build/app-builder.js\n\n# 运行脚本\n# node build/app-builder.js\n\n# 脚本执行操作 - 编译打包 Renderer Process ( Vue APP )\n# renderer/**/* ---\u003e Vite.build() ---\u003e build/renderer/\n\n# 脚本执行操作 - 编译打包 Main Process ( TypeScript APP )\n# main/**/* ---\u003e esbuild.build() ---\u003e build/main.js、build/preload.js\n\n# 脚本执行操作 - 打包创建应用\n# package.json ---\u003e electron-builder ---\u003e dist/~app.asar/package.json\n# build/**/*（ dev-runner.js、app-builder.js 除外 ）---\u003e electron-builder ---\u003e dist/~app.asar/build/\n# main/resources/**/* ---\u003e electron-builder ---\u003e dist/~app.asar/build/resources/\n# dist/mac/**/* ---\u003e electron-builder ---\u003e dist/TinyEvt.dmg\n\n# 以可分发格式打包后的 Electron 应用指向 Vue 应用打包后的本地文件\n# main-window @ TinyEvt（ packaged，DMG 格式 ）---\u003e app.asar/build/renderer/index.html\n\n# 注意：本机环境下执行打包操作时，默认忽略 `Code Signing` 以及 `publish` 操作\n\nnpm run dist\n```\n\n---\n\n\u003e GitHub Workflow\n\n```bash\n# Build \u0026 Release\n\n# 1. 更新 `package.json` 中的版本号，例如从 `v1.2.2` 变更至 `v1.2.3`\n# 2. `git commit -am v1.2.3`\n# 3. `git tag v1.2.3`，使用指定的命名格式 `v*.*.*`\n# 4. `git push \u0026\u0026 git push --tags`\n# 5. 指定格式标签的推送事件会触发 GitHub Actions 自动创建 Release v1.2.3、打包生成不同平台格式的应用并发布\n```\n\n```bash\n# Build \u0026 Release - Code Signing @ macOS runner\n\n# 1. 导出与应用相关的所有证书至单个文件 `certs.p12`，并设置强密码\n# 2. 运行命令 `base64 -i certs.p12 -o encoded.txt` 对导出文件进行编码\n# 3. 在项目仓库的 `Secrets` 设置项中添加 `mac_certs`（ 即 `encoded.txt` 的内容 ）\n# 4. 在项目仓库的 `Secrets` 设置项中添加 `mac_certs_password`（ 即导出证书时设置的密码 ）\n# 5. 在 `.github/workflows/build-release.yml` 中添加 `CSC_LINK`, `CSC_KEY_PASSWORD` 环境变量配置\n\n# .github/workflows/build-release.yml\n# - name: Build App and publish\n#   env: |\n#     CSC_LINK: ${{ secrets.CSC_LINK }}\n#     CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}\n```\n","funding_links":["https://github.com/neatfx/donation"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneatfx%2Ftiny-evt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneatfx%2Ftiny-evt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneatfx%2Ftiny-evt/lists"}