@mengyou/iceworks-scaffolder
用于操作项目模板的工具集
Last updated 6 months ago by mengyou .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @mengyou/iceworks-scaffolder 
SYNC missed versions from official npm registry.

@mengyou/iceworks-scaffolder

用于向模板目录添加页面,菜单,路由等功能,提供给 GUI 工具 iceworks 操作项目使用

安装

npm install @mengyou/iceworks-scaffolder --save

使用

import Scaffolder from 'iceworks-scaffolder';

const scaffolder = new Scaffolder({
  cwd: 'project_path', // 项目地址
  interpreter: function({ type, message, data }, callback) { // 根据应用进程返回 true/false 表示是否继续
    callback(Boolean)
  };
});

API

  • async createPage({ name: pageNmae, layout, blocks, preview = false }) 创建页面
  • async appendMenu({ name, path: menuPath, icon }, prettierConfig) 创建菜单
  • async removeMenu({ path: menuPath }, prettierConfig) 删除菜单
  • async appendRouter({ path: routerPath, component: pageComponentName = '', module: pageModule = '', pagePath, layoutName = '', layoutPath, }) 添加 router
  • async removeRouter({ path: routerPath, pagePath }) 删除 router
  • async removePreviewPage({ menuPath = '/IceworksPreviewPage', routerPath = '/IceworksPreviewPage' } = {}) 移除页面

Current Tags

  • 0.3.1                                ...           latest (6 months ago)

2 Versions

  • 0.3.1                                ...           6 months ago
  • 0.3.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 3
Last Day 0
Last Week 0
Last Month 2
Dependencies (22)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |