Giter Club home page Giter Club logo

leo's Introduction

leo

leo 脚手架是一款覆盖前端开发全链路、可扩展、可定制的终端运行的脚手架工具,并支持模板、构建器、扩展命令等丰富的周边生态扩展。

背景与介绍

在过去,脚手架虽然被前端广泛使用,但往往都局限于部门和团队内部,其中提供的模板、构建器等提效工具仅在内部使用,难以在团队、部门之间甚至公司层面做到复用和标准化,而新团队如需快速沉淀自己内部的规范,又需要额外开发脚手架工具,造成资源浪费。

leo 通过提供模板,构建器统一扩展来打破部门、团队之间模板和构建复用的壁垒,提高了新团队快速沉淀规范的效率,并且通过生成器和构建器分离,解耦了代码与构建配置的关联,使得模板和构建配置可以一对多或者多对一,减少了 webpack 等构建工具配置的困扰。

如何使用

leo 提供了丰富的配置项用于快速完成一套定制化的脚手架

npm i @jdfed/leo-core

新建一个脚手架项目目录如下

yourProject
 |- bin
 |   |- index.js
 |- package.json

package.json中声明指令入口

{
  "bin": {
    "yourCommand": "bin/index.js"
  }
}

bin/index.js中进行配置leo/core

#!/usr/bin/env node

const LeoCore = require('@jdfed/leo-core').default;

const customConfig = {
  // 模板仓库group
  gitTemplateGroupURL: '',
  // 项目中配置文件名,默认为 leorc.js
  rcFileName: 'xxx-rc.js',
};

const customCore = new LeoCore({
  config: customConfig,
  hooks: {
    beforeStart() {
      console.log(this.leoRC);
    },
    afterCommandExecute() {
      console.log(this);
    },
  },
});

customCore.start();

更多配置项

本地调试

npm link

yourCommand -h

更多文档

  1. config
  2. leorc
  3. meta

leo's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.