{"id":24414468,"url":"https://github.com/guixianleng/dk-cli","last_synced_at":"2025-03-13T11:15:10.108Z","repository":{"id":188439567,"uuid":"373697608","full_name":"guixianleng/dk-cli","owner":"guixianleng","description":"自定义脚手架","archived":false,"fork":false,"pushed_at":"2021-06-24T06:08:53.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"v1","last_synced_at":"2025-01-20T07:18:27.585Z","etag":null,"topics":["cli","command-line","download"],"latest_commit_sha":null,"homepage":"","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/guixianleng.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}},"created_at":"2021-06-04T02:25:38.000Z","updated_at":"2021-06-24T07:00:23.000Z","dependencies_parsed_at":"2023-08-15T10:44:36.139Z","dependency_job_id":"9c56d259-9e08-4ae5-9f66-c3eead7a9d4b","html_url":"https://github.com/guixianleng/dk-cli","commit_stats":null,"previous_names":["guixianleng/dk-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guixianleng%2Fdk-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guixianleng%2Fdk-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guixianleng%2Fdk-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guixianleng%2Fdk-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guixianleng","download_url":"https://codeload.github.com/guixianleng/dk-cli/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392326,"owners_count":20283564,"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":["cli","command-line","download"],"created_at":"2025-01-20T07:18:31.646Z","updated_at":"2025-03-13T11:15:10.058Z","avatar_url":"https://github.com/guixianleng.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 搭建一个脚手架工\n\n前端脚手架 CLI，是一个命令行工具，它的出现主要解决这几个问题：\n\n- 减少重复性工作\n- 规范项目开发目录结构\n- 统一团队统一开发风格，便于跨团队合作，以及后期维护，降低新人上手成本\n- 提供一键前端项目的创建、配置、本地开发、插件扩展等功能，让开发者更多时间专注于业务\n\n随着前端工程化的发展，越来越多企业选择脚手架来从零到一搭建自己的项目。\n\n## 脚手架思路\n\n### CLI 搭建项目\n\n- 根据用户输入生成配置文件\n- 下载指定项目模板\n- 在目标目录生成新项目\n\n### 依赖分析\n\n- commander：命令行工具，有了它我们就可以读取命令行命令，知道用户想要做什么了\n- inquirer： 交互式命令行工具，给用户提供一个漂亮的界面和提出问题流的方式\n- download-git-repo：下载远程模板工具，负责下载远程仓库的模板项目\n- chalk：颜色插件，用来修改命令行输出样式，通过颜色区分 info、error 日志，清晰直观\n- ora：用于显示加载中的效果，类似于前端页面的 loading 效果，像下载模板这种耗时的操作，有了 loading 效果可以提示用户正在进行中，请耐心等待\n\n## 本地运行项目\n\n```bash\n# install dependencies\ngit clone \u0026\u0026 npm install\n\n# create command line and run the command\nnpm link\n\n# build for production with minification\npdk create \u003cprojectName\u003e\n```\n\n## 安装\n```bash\n# install grobally\nnpm install -g pdk-cli\n\n# or yarn\nyarn global add pdk-cli\n```\n\n## 快速运行\n```bash\npdk create \u003cprojectName\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguixianleng%2Fdk-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguixianleng%2Fdk-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguixianleng%2Fdk-cli/lists"}