Skip to content

wtfil/bemdeps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Converting jsdoc @deps directives to deps.js file

install

npm install bemdeps

or

npm install -g bemdeps

usage

bemdeps -l blocks-desktop blocks-touch blocks-common -t js css

options

-l --levels bem levels (default is "blocks-desktop and blocks-common")
-t --tetchs bem tetchs (default is "css js bemhtml")
-f --forse will replace original deps.js file without extending

example

/**
 * @deps b-block1, b-block2 elem1 elem2, !b-block3 mod_val
 */

is equal to

/**
 * @shouldDeps b-block1, b-block2 elem1 elem2
 * @mustDeps b-block3 mod_val
 */

and will be converted into

({
    "mustDeps": [
        {
            "block": "b-block3",
            "mods": {
                "mod": "val"
            }
        }
    ],
    "shouldDeps": [
        {
            "block": "b-block1"
        },
        {
            "block": "b-block2",
            "elems": [
                "elem1",
                "elem2"
            ]
        }
    ]
})

About

Auto generation of deps.js files besed on jsdoc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published