0.4.0 • Published 6 years ago

omodule v0.4.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

omodule

omodule 是一种简单实用的文件目录管理规范,帮助开发者更好的管理项目模块。目前可使用 babel 插件 babel-plugin-transform-omodule-scope 进行 omodule 作用域常量的代码编译。

omodule 规范下的文件目录结构 🌲

例子: ./omodule-structure-example

root
|__ omodules
    |__ account
    |   |__ omodules
    |       |__ login
    |       |__ register
    |__ homepage
    |__ order

三个 omodule 作用域常量的定义

__onamespace

  • 当前 omodule 的命名空间(基于根节点)

文件路径:root/omodules/account/omodules/login/loginPage.js

console.log(__onamespace); // Prints: /account/login

__oname

  • 当前 omodule 的名称

文件路径:root/omodules/account/omodules/register/registerPage.js

console.log(__oname); // Prints: register

__ofilepath

  • 基于 omodule 根节点的文件路径

文件路径:root/omodules/homepage/homePage.js

console.log(__ofilepath); // Prints: omodules/homepage/homePage.js

关于 babel 插件

目前可配合 babel-plugin-transform-omodule-scope 编译 omodule 作用域常量。

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

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