0.0.18 • Published 7 years ago

@tbuilder/core v0.0.18

Weekly downloads
3
License
GPL
Repository
-
Last release
7 years ago

@tbuilder/core

tBuilder是一个通过DSL来自动快速生成前端项目的编译器,提供通过同一份DSL编译到不同目标平台(vue,h5,小程序等)的能力

核心库安装

npm i @tbuilder/core

核心库使用

import TBuilder from '@tbuilder/core'

const builder = new TBuilder(finalPath)

builder.compile()
builder.generate()

TBuilder类

方法参数说明
new(dsl: string | object)dsl: dsl文件路径或dsl对象创建实例
compile() : tBuilderAST-返回通过dsl解析生成的AST
generate() : Promise-通过DSL创建前端项目

tBuilder DSL

{
  "project": {
    "name": "测试项目",
    "version": "0.0.1",
    "description": "一个测试用的项目",
    "author": "tBuilder",
    "compileTarget": "vue",
    "uiLib": "iView",
    "dist": "/Users/inlost/Downloads/tBuilder"
  },
  "pages": [{
    "name": "test page",
    "route": "/test",
    "components": [{
      "name": "Card",
      "props": [{
        "key": "bordered",
        "value": false
      }, {
        "key": "shadow",
        "value": true
      }],
      "children": [{
        "name": "p",
        "props": [{
          "key": "slot",
          "value": "title"
        }],
        "content": "No border title"
      }, {
        "name": "p",
        "content": "Content of no border type. Content of no border type. Content of no border type. Content of no border type."
      }],
      "content": "test content"
    }]
  }],
  "dataModules": [{
    "name": "test module",
    "apis": [{
      "name": "test api1",
      "path": "/api/test/api1",
      "method": "GET",
      "share": true,
      "has_param": true
    }, {
      "name": "test api2",
      "path": "/api/test/api2",
      "method": "POST",
      "share": false,
      "has_param": false
    }]
  }, {
    "name": "test test module",
    "apis": [{
      "name": "test api3",
      "path": "/api/test/api3",
      "method": "POST",
      "share": true,
      "has_param": true
    }]
  }]
}

tBuilder cli

生成项目的命令行工具

详见@tBuilder/cli

插件扩展

TODO


Generated by tmaker.

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago