4.1.2-alpha.0 • Published 4 years ago

@iceworks/dsl2code v4.1.2-alpha.0

Weekly downloads
5
License
-
Repository
-
Last release
4 years ago

搭建协议转源码包

鉴于 iceluna 的 schema 转源码包(iceluna-compiler)功能尚不完善,且是基于旧版搭建协议,因此 iceworks 拷贝 iceluna-compiler 源代码进行修改,未来待 iceluna 的包功能完善后切回 iceluna 包。

Usage

import compile from '@iceworks/dsl2code';
import dsl from './dsl.js'; // 基于 iceluna 搭建协议的 schema
import componentsMap from './componentsMap.js'; // 所有物料的配置信息

/**
 * 返回数据格式
 * [
 *  {
 *    name: 'index.jsx', // 文件名
 *    value: 'import React, {Component} from "react";...' // 文件源码
 *  },
 *  {
 *    ...
 *  }
 * ]
*/
const files = compile(dsl, componentsMap);

Debug

进入 examples 目录

tnpm install
npm start

Publish

tnpm publish