{"id":19751157,"url":"https://github.com/mipengine/mip2-extensions-platform","last_synced_at":"2025-11-23T03:03:35.238Z","repository":{"id":53546875,"uuid":"136425722","full_name":"mipengine/mip2-extensions-platform","owner":"mipengine","description":"MIP 2.0 站长组件","archived":false,"fork":false,"pushed_at":"2021-03-25T02:54:39.000Z","size":17349,"stargazers_count":20,"open_issues_count":24,"forks_count":163,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-01-10T21:32:46.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mipengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-07T05:24:35.000Z","updated_at":"2023-12-07T08:32:56.000Z","dependencies_parsed_at":"2022-08-26T03:11:09.049Z","dependency_job_id":null,"html_url":"https://github.com/mipengine/mip2-extensions-platform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip2-extensions-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip2-extensions-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip2-extensions-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip2-extensions-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mipengine","download_url":"https://codeload.github.com/mipengine/mip2-extensions-platform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241080828,"owners_count":19906355,"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":[],"created_at":"2024-11-12T02:42:40.312Z","updated_at":"2025-11-23T03:03:30.189Z","avatar_url":"https://github.com/mipengine.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mip2-extensions-platform\n\n\u003e 站长组件是扩展 MIP 功能的一种形式，在开发提交站长组件之前，请首先阅读[《请优先使用 MIP 现有机制和官方组件来实现业务功能》](https://www.mipengine.org/v2/contribute/getting-start/use-official-mip-first.html)一文，以及查看现有的[官方组件列表](https://www.mipengine.org/v2/components/index.html)，看看所需要开发的站长组件是否已被 MIP 现有的机制和官方组件覆盖了，能够覆盖到的功能请勿重复开发相应的站长组件，减少开发和审核的时间成本。\n\n## MIP 2 站长组件\n\n与 MIP 1.0 采用的方式不同，MIP 2.0 以项目（一个站点）的粒度来管理站长组件。每一个项目（使用 `mip2 init` 命令生成）中包含了这个站点所需的所有自定义组件。\n\nMIP 2.0 的站长组件托管在 [Github 站长组件仓库](https://github.com/mipengine/mip2-extensions-platform)，项目结构如下：\n\n```\n├──sites\n    ├── test.a.com\n    │   ├── common\n    │   ├── components\n    │   ├── example\n    │   ├── mip.config.js\n    │   ├── node_modules\n    │   ├── package-lock.json\n    │   ├── package.json\n    │   └── static\n    └── test.b.com\n        ├── common\n        ├── components\n        ├── example\n        ├── mip.config.js\n        ├── package-lock.json\n        ├── package.json\n        └── static\n├── LICENSE\n└── README.md\n\n```\n\n`sites` 目录即是站点项目的集合。示例中已经托管了 `test.a.com` 和 `test.b.com` 两个站点的自定义组件。站长各自在其 `components` 目录下[编写组件](https://www.mipengine.org/v2/contribute/development/component-syntax.html)。\n\n在站长组件开发完成并测试无误后，通过 `Pull Request` 的方式提交审核，官方通过审核后会定期编译上线。审核标准会严格根据以下原则进行审核：\n\n1. 组件功能能够直接通过 MIP 现有机制和 MIP 官方组件实现的，此类组件没有意义，将会直接打回；\n2. 组件不满足[《MIP 组件开发规范》](https://www.mipengine.org/v2/contribute/getting-start/component-spec.html)的要求的，此类组件不规范，将会直接打回；\n3. Pull Request 和 组件 REAME.md 不清晰导致审核人员无法理解组件的功能、用法的，会直接打回或要求补全相关文档。README.md 文档翔实度请参考官方组件； \n4. 审核人员给出审核意见但不进行修复，也不进行回复说明的，预期 1 个月 PR 无更新则直接 close PR。\n\n供站点使用的最终发布地址为：\n\n```bash\nhttps://c.mipcdn.com/extensions/platform/v2/{站点项目名}/{组件名}/{组件名}.js\n\n# 例如 test.a.com 下的 mip-example 组件\n\nhttps://c.mipcdn.com/extensions/platform/v2/test.a.com/mip-example/mip-example.js\n```\n\n## 站长组件开发、提交流程\n\n1.**fork 官方组件仓库**\n\n在 Github fork `https://github.com/mipengine/mip2-extensions-platform` 仓库，并 `clone` 到本地。\n\n2.**开发**\n\n进入仓库目录，先安装依赖，这一步将在本地安装 `eslint` 等工具辅助检查代码规范。不符合规范的组件将无法提交合入。\n\n```\n$ npm install\n```\n\n进入 `sites` 目录，如果是第一次提交一个站点的组件，运行命令\n\n```\n$ mip2 init\n```\n\n按照提示输入项目名称，如 `cafe.com`，新增一个站点项目。\n\n```\n$ cd cafe.com\n```\n切换到站点项目目录即可快速进行组件开发工作了：\n- [如何开发 MIP 组件](https://www.mipengine.org/v2/contribute/development/component-syntax.html)\n- [调试](https://www.mipengine.org/v2/contribute/debug/mip-dev.html)\n- [校验](https://www.mipengine.org/v2/contribute/getting-start/mip-cli-usage.html#mip2-validate-%E7%BB%84%E4%BB%B6%E5%92%8C%E9%A1%B5%E9%9D%A2%E6%A0%A1%E9%AA%8C)\n\n\n3.**发起 Pull Request**\n\n开发完成后，[发起 pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)\n\n4.**官方审核通过，合入上线**\n\n官方审核通过后，代码将合入 `master` 分支并上线。若不通过，请根据反馈修改后再次提交。\n\n5.**调用组件脚本**\n\n```\n// 页面中引用\n\u003cscript src=\"https://c.mipcdn.com/extensions/platform/v2/{站点项目名}/{组件名}/{组件名}.js\"\u003e\u003c/script\u003e\n\n# 例如 test.a.com 下的 mip-example 组件\n\n\u003cscript src=\"https://c.mipcdn.com/extensions/platform/v2/test.a.com/mip-example/mip-example.js\"\u003e\u003c/script\u003e\n```\n\n## 相关资料\n\n- [MIP 官网](https://www.mipengine.org/)\n- [如何提交站长组件代码](https://www.mipengine.org/v2/contribute/getting-start/how-to-contribute.html)\n- [MIP 官方组件列表](https://www.mipengine.org/v2/components/index.html)\n- MIP QQ 群：580967494，欢迎前来咨询\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmipengine%2Fmip2-extensions-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmipengine%2Fmip2-extensions-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmipengine%2Fmip2-extensions-platform/lists"}