flatjs-cli-plugin-module-create
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

flatjs-cli-plugin-module-create

The cli plugin module-create for flatjs

The usages

npm i flatjs-cli-plugin-module-create
flat moduleCreate -m="demo/test"

The configurations

  • 支持文件和文件夹模板路径配置

  • 如:modules/${modulePath}

  • 默认变量:

    • moduleName-模块名称
    • camelModuleName-驼峰模块名称
    • CamelModuleName-首字母大写驼峰模块名称
    • modulePath-模块路径
    • ModulePath-首字母大写模块路径
    • initialModuleName-去除最后一个路径后的模块路径
    • tailModuleName-去除第一个路径后的模块路径
  • flatjs.cli.js

const flatjsConfig = {
  flatjsCli: {
    pluginConfigs: {
      moduleCreateConfig: {
        // 模板路径
        templatePath: '',
      },
    },
  },
};
  • _module-create-config.js
// 每个模板中可配置js
module.exports = (config) => {
  // 模板中使用的变量参数,可在文件路径中使用 
  const templateParams = {};
  // 需要删除的文件或文件夹列表
  const deleteList = [];
  return {
    templateParams,
    deleteList,
  }
};

Package Sidebar

Install

npm i flatjs-cli-plugin-module-create

Weekly Downloads

0

Version

2.0.4

License

MIT

Unpacked Size

96.1 kB

Total Files

78

Last publish

Collaborators

  • shaokr