option2meta

1.2.0 • Public • Published

[TOC]

描述

根据option.json生成对应的meta.js文件

安装依赖【开发】

pnpm i --registry=https://registry.npmjs.org

版本要求

  • node >= 16.16.0

功能

输出包版本信息 -v --version

执行:

o2m -v
o2m --version

输出帮助信息 -h --help

o2m -h
o2m --help

配置编译 -b --build

o2m -b configPath
o2m --build configPath

注意,这里接收参数configPath,它是一个绝对文件路径,比如:

o2m --build ./test/configs/.o2m.config.json

处理json文件,还支持js文件:

o2m --build ./test/configs/.o2m.config.js

配置

下面说一下文件配置,以js文件为例:

module.exports = {
    //是否格式化
    "format": false,
    //配置路径
    "optionPath": "../options/option.js", //支持.js .json .xlsx .xls
    //meta.ts文件生成路径
    "metaPath": "../metas/meta.ts",
    //模板文件路径
    "templatePath": "../templates/template.ts",
    //通过接口处理
    "url": 'http://www.example.com/function/importmaterial',
    //组件名称--可选,默认BizFormInput
    "componentName":"TestComponent",
}

下面依此说明每个配置的意义:

后续支持的功能

  1. [x] 根据excel文件生成配置
  2. [x] 支持通过接口获取json

Readme

Keywords

none

Package Sidebar

Install

npm i option2meta

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

15.4 kB

Total Files

19

Last publish

Collaborators

  • ylvfeng