{"id":26418791,"url":"https://github.com/karinjs/karin-plugin-template-ts","last_synced_at":"2026-02-15T06:33:47.925Z","repository":{"id":249353480,"uuid":"823002402","full_name":"KarinJS/karin-plugin-template-ts","owner":"KarinJS","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-26T17:03:48.000Z","size":1224,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-08T08:54:08.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KarinJS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-07-02T08:40:33.000Z","updated_at":"2024-12-26T17:03:30.000Z","dependencies_parsed_at":"2024-07-20T07:22:30.478Z","dependency_job_id":"cb721f36-7031-433f-bd67-57df0e44ed44","html_url":"https://github.com/KarinJS/karin-plugin-template-ts","commit_stats":null,"previous_names":["karinjs/karin-plugin-template-ts"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/KarinJS/karin-plugin-template-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarinJS%2Fkarin-plugin-template-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarinJS%2Fkarin-plugin-template-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarinJS%2Fkarin-plugin-template-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarinJS%2Fkarin-plugin-template-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarinJS","download_url":"https://codeload.github.com/KarinJS/karin-plugin-template-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarinJS%2Fkarin-plugin-template-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29471943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T05:26:30.465Z","status":"ssl_error","status_checked_at":"2026-02-15T05:26:21.858Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-03-18T01:54:35.927Z","updated_at":"2026-02-15T06:33:47.909Z","avatar_url":"https://github.com/KarinJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# karin的ts插件开发模板\n\n## 前言\n\nts插件的开发较为繁琐，但请不要着急，容我娓娓道来~  \n\n- `TypeScript` 开发编写 -\u003e 编译为`js` -\u003e 发布 `npm` 包 -\u003e 用户安装\n\n## 克隆模板仓库\n\n\u003e 需要注意 请先安装`karin`哦~\n\n打开[模板仓库](https://github.com/KarinJS/karin-plugin-template-ts)\n\n点击`Use this template`或`使用此模板`按钮，创建自己的仓库。\n![202404121412587](https://cdn.jsdelivr.net/gh/Zyy955/imgs/img/202404121412587.png)\n\n填写仓库名称，描述，选择是否公开。\n![202404121414580](https://cdn.jsdelivr.net/gh/Zyy955/imgs/img/202404121414580.png)\n\n```bash\n# 请改成你自己的仓库 注意！ 现在是克隆成单独的文件夹 而不是以前一样作为插件\ngit clone https://github.com/karinjs/karin-plugin-template-ts.git\n```\n\n## 安装开发依赖\n\n```bash\npnpm install\n```\n\n## 开始你的开发\n\n```bash\nnpx karin ts\n```\n\n```bash\n# 编译\nnpm run build\n# or\npnpm build\n```\n\n## 配置基本秘钥\n\n\u003e 需要1个基本的`npm`秘钥\n\n1. 前往[npmjs](https://www.npmjs.com/)注册账号\n2. 注册完成点击`右上角头像` -\u003e `Access Tokens` -\u003e `Granular Access Token` -\u003e `Classic Token`\n3. 填写`token`的`name`，选择`Automation`，如下图\n  ![npm](./resources//image/npm.png)\n4. 随后点击`Generate Token`即可\n5. 打开[Github](https://github.com)，请自行登录账号。\n6. 打开你刚才`Fork`的仓库，点击`Settings(设置)` -\u003e `Secrets and variables(机密和变量)` -\u003e `actions(操作)`\n7. 选择`Repository secrets(仓库机密)`，点击`New repository secret(新建仓库机密)`\n8. `Name *(名称 *)` 输入 `NPM_TOKEN` ， `Secret *(机密 *)` 输入你刚才得到的`npm`秘钥，随后保存即可。\n9. 允许`github-actions`发起`pr`，打开仓库主页，点击`Settings(设置)` -\u003e `Actions(操作)` -\u003e 勾选`Allow GitHub Actions to create and approve pull requests(允许 GitHub Actions 创建和批准拉取请求)` -\u003e `Save(保存)`\n\n这里的步骤很长，请仔细认真一步步来，`npm`的秘钥，获取一次之后，多个仓库都可以重复使用，建议`npm`账户打开`2FA`\n\n## 设置npm包名称\n\n\u003e [!IMPORTANT]\n\u003e 对于包名，请自行查看`npm`上是否已经冲突，`npm`的包名必须是唯一的。\n\n你需要更改以下这些选项:\n\n- `package.json`:\n  - `name`: 改成npm包名，请注意使用`全部小写`\n  - `author`: 改成你的名字，需要英文哦\n  - `description`: 改成插件描述\n  - `homepage`: `npm`显示的主页\n  - `bugs.url`: 反馈bug\n  - `repository`: 指定项目的代码存储库地址\n- `.github/workflows/release-please.yml`:\n  - 修改其中的`package-name`，注意，这里需要和上面`package.json`的一致。\n\n\u003e 对于更多选项，请自行查看注释。\n\n## 推送\n\n\u003e [!IMPORTANT]\n\u003e 编写好代码之后，正常`git pull`，随后等待几秒钟，合并`pr`即可。\n\n利用`Gihub`提供的`actions`来编译，推送`npm`。\n\n## 安装发布的包\n\n```bash\n# 在karin根目录执行\npnpm add package.name -w\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarinjs%2Fkarin-plugin-template-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarinjs%2Fkarin-plugin-template-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarinjs%2Fkarin-plugin-template-ts/lists"}