{"id":19751155,"url":"https://github.com/mipengine/mip-cli-plugin-site","last_synced_at":"2026-06-09T02:31:14.867Z","repository":{"id":81009008,"uuid":"147491520","full_name":"mipengine/mip-cli-plugin-site","owner":"mipengine","description":"Plugin for `mip2 site`","archived":false,"fork":false,"pushed_at":"2018-09-26T08:28:26.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-02-28T08:32:41.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mipengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-09-05T09:14:53.000Z","updated_at":"2019-07-17T15:00:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"a72a666c-fd53-4098-9e1c-2701ac94baae","html_url":"https://github.com/mipengine/mip-cli-plugin-site","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mipengine/mip-cli-plugin-site","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip-cli-plugin-site","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip-cli-plugin-site/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip-cli-plugin-site/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip-cli-plugin-site/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mipengine","download_url":"https://codeload.github.com/mipengine/mip-cli-plugin-site/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mipengine%2Fmip-cli-plugin-site/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34089325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-12T02:42:39.775Z","updated_at":"2026-06-09T02:31:14.848Z","avatar_url":"https://github.com/mipengine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"对应命令 `mip2 site`，帮助开发者把开发插件和开发页面两部分融合，获取更好的开发体验。\n\n## 为什么需要 mip2 site？\n\n一般开发 MIP 页面需要两个部分：\n\n* 开发 MIP 组件\n  根据每个站点各自的业务需求，站长需要开发包含自身业务的 MIP 组件。\n\n  例如某个博客站点可能需要开发一个组件 `\u003cmip-blog-list\u003e`，这个组件根据当前 URL 上的 ID 获取用户信息，从而展示他发过的博客的列表。\n\n* 开发 MIP 页面\n  根据已有的 MIP 组件（可能是内置组件，也可能是刚才自己开发的自定义组件）拼装成一个 HTML 页面。\n\n开发组件时我们大多使用 MIP CLI 内置的 `mip2 dev` 启动服务器。其他还有例如 `mip2 add`, `mip2 build` 之类的专门针对组件开发的快捷方式。\n\n但开发 MIP1 页面目前并没有单独的工具，更多的是在开发组件的项目中，随便找一个 example，把拼装各个组件的最终页面写进去，之后预览效果。这就相当于 __在单测脚本中写集成测试用例__，是一种失配的现象。\n\n此外，作为一个 MIP 页面，还应当考虑到搜索环境的 SuperFrame （简称 SF） 中显示是否正常。虽然我们额外提供了 `mip2 sf` 命令帮助本地调试，但 __需要同时打开两个 bash 并分别启动 `mip2 dev` 和 `mip2 sf` 也是反人类的__。\n\n`mip2 site` 基于这些实际开发中的问题，主要解决了以下几个问题：\n\n1. 将开发组件和开发页面融合到同一个项目中，我们称为 “MIP 站点项目”\n\n2. 内置 SF 调试环境，不必额外启动命令\n\n3. 保留 `mip2` 本身的全部功能，例如 `mip2 add`, `mip2 build` 等均有快捷命令一一对应，无需反复切换目录。\n\n## 快速开始\n\n作为 MIP CLI 的插件，首先要求开发者全局安装最新版本的 mip2。如果没有，请运行 `npm i mip2 -g` 进行全局安装。\n\n1. `mip2 site init` 初始化项目\n\n2. `cd` 到项目根目录并执行 `npm i`\n\n3. `mip2 site dev` 启动初始项目\n\n4. 访问 `http://localhost:8200/weather/shanghai` 查看初始项目的示例页面\n\n5. 访问 `http://localhost:8200/sf` 查看 SF 线下调试环境\n\n## 命令详解\n\n* [mip2 site init](https://github.com/mipengine/mip-cli-plugin-site/blob/master/doc/init.md)\n* [mip2 site dev](https://github.com/mipengine/mip-cli-plugin-site/blob/master/doc/dev.md)\n* [mip2 site add-component](https://github.com/mipengine/mip-cli-plugin-site/blob/master/doc/add-component.md)\n* [mip2 site build-component](https://github.com/mipengine/mip-cli-plugin-site/blob/master/doc/build-component.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmipengine%2Fmip-cli-plugin-site","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmipengine%2Fmip-cli-plugin-site","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmipengine%2Fmip-cli-plugin-site/lists"}