{"id":13790740,"url":"https://github.com/jd-opensource/leo","last_synced_at":"2025-04-09T22:18:48.673Z","repository":{"id":57110986,"uuid":"438516213","full_name":"jd-opensource/leo","owner":"jd-opensource","description":"一个可覆盖前端开发全链路、可扩展、可定制的终端运行的脚手架工具","archived":false,"fork":false,"pushed_at":"2021-12-22T06:18:07.000Z","size":524,"stargazers_count":307,"open_issues_count":0,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T22:18:44.487Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jd-opensource.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":"2021-12-15T06:12:53.000Z","updated_at":"2025-04-05T03:30:26.000Z","dependencies_parsed_at":"2022-08-20T19:50:43.403Z","dependency_job_id":null,"html_url":"https://github.com/jd-opensource/leo","commit_stats":null,"previous_names":["jdfed/leo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2Fleo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2Fleo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2Fleo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jd-opensource%2Fleo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jd-opensource","download_url":"https://codeload.github.com/jd-opensource/leo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119285,"owners_count":21050755,"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-08-03T22:00:50.781Z","updated_at":"2025-04-09T22:18:48.643Z","avatar_url":"https://github.com/jd-opensource.png","language":"TypeScript","readme":"# leo\n\nleo 脚手架是一款覆盖前端开发全链路、可扩展、可定制的终端运行的脚手架工具，并支持模板、构建器、扩展命令等丰富的周边生态扩展。\n\n## 背景与介绍\n\n在过去，脚手架虽然被前端广泛使用，但往往都局限于部门和团队内部，其中提供的模板、构建器等提效工具仅在内部使用，难以在团队、部门之间甚至公司层面做到复用和标准化，而新团队如需快速沉淀自己内部的规范，又需要额外开发脚手架工具，造成资源浪费。\n\nleo 通过提供模板，构建器统一扩展来打破部门、团队之间模板和构建复用的壁垒，提高了新团队快速沉淀规范的效率，并且通过生成器和构建器分离，解耦了代码与构建配置的关联，使得模板和构建配置可以一对多或者多对一，减少了 webpack 等构建工具配置的困扰。\n\n## 如何使用\n\nleo 提供了丰富的配置项用于快速完成一套定制化的脚手架\n\n```shell script\nnpm i @jdfed/leo-core\n```\n\n新建一个脚手架项目目录如下\n\n```\nyourProject\n |- bin\n |   |- index.js\n |- package.json\n```\n\n`package.json`中声明指令入口\n\n```json\n{\n  \"bin\": {\n    \"yourCommand\": \"bin/index.js\"\n  }\n}\n```\n\n在`bin/index.js`中进行配置`leo/core`\n\n```js\n#!/usr/bin/env node\n\nconst LeoCore = require('@jdfed/leo-core').default;\n\nconst customConfig = {\n  // 模板仓库group\n  gitTemplateGroupURL: '',\n  // 项目中配置文件名，默认为 leorc.js\n  rcFileName: 'xxx-rc.js',\n};\n\nconst customCore = new LeoCore({\n  config: customConfig,\n  hooks: {\n    beforeStart() {\n      console.log(this.leoRC);\n    },\n    afterCommandExecute() {\n      console.log(this);\n    },\n  },\n});\n\ncustomCore.start();\n```\n\n[更多配置项](./docs/config.md)\n\n本地调试\n\n```shell script\nnpm link\n\nyourCommand -h\n```\n\n## 更多文档\n\n1. [config](./docs/config.md)\n2. [leorc](./docs/leorc.md)\n3. [meta](./docs/meta.md)\n","funding_links":[],"categories":["Used by"],"sub_categories":["Building Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-opensource%2Fleo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjd-opensource%2Fleo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjd-opensource%2Fleo/lists"}