Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if i want use not easy template which the depends from another blocks - "e-b-s" can't build this template #59

Open
pavelpower opened this issue Jun 8, 2016 · 0 comments

Comments

@pavelpower
Copy link

smaple:

$ tree
app/block1/
├──app/block2/
├──app/block3/
├──app/block3/
         └──block3.deps.js
cat app/block3/block3.deps.js

({
    mustDeps: [{block: 'block1'}, {block: 'block2'}]
});

And what i will see after build specs?
cat specs/app/block3/block3.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <link href="block3.css" rel="stylesheet"/>
    <script src="block3.spec.js"></script>
</head>
<body>
<div class="mocha" 0="i" 1="d"></div>
<div class="spec-content">
    <div class="block3"></div>
</div>
</body>
<script class="spec-runner">(function () {
    var global = this;
    typeof modules === "object" ? modules.require(["jquery", "mocha", "spec"], function ($, mocha) {
        init($, mocha);
    }) : init(global.jQuery, global.mocha);
    function init($, mocha) {
        global.mochaPhantomJS ? global.mochaPhantomJS.run(done) : mocha.run(done);
        function done() {
            $("#mocha").show()
        }
    }
}());</script>
</html>

this was supposed to be like this:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <link href="block3.css" rel="stylesheet"/>
    <script src="block3.spec.js"></script>
</head>
<body>
<div class="mocha" 0="i" 1="d"></div>
<div class="spec-content">
<div class="block3" style="display: none;">
    <div class="block3-button block3-button_menu" data-button="menu"><a
        class="block3-button__link block3-button__link_menu" data-button="menu" href="#"><span
        class="block2-button__icon"></span><span class="block1-button__title">button menu</span></a></div>
    <div class="block3-button block3-button_red" data-button="red"><a
        class="block3-button__link block3-button__link_red" data-button="red" href="#"><span
        class="block2-button__icon"></span><span class="block1-button__title">button red</span></a></div>
    <div class="block3-button block3-button_delete" data-button="delete"><a
        class="block3-button__link block3-button__link_delete" data-button="delete" href="#"><span
        class="block2-button__icon"></span><span class="block1-button__title">button delete</span></a></div>
    <div class="block3-button block3-button_green" data-button="green"><a
        class="block3-button__link block3-button__link_green" data-button="green" href="#"><span
        class="block2-button__icon"></span><span class="block1-button__title">button green</span></a></div>
    <div class="block3-button block3-button_yellow" data-button="yellow"><a
        class="block3-button__link block3-button__link_yellow" data-button="yellow" href="#"><span
        class="block2-button__icon"></span><span class="block1-button__title">button yellow</span></a></div>
    <div class="block3-button block3-button_blue" data-button="blue"><a
        class="block3-button__link block3-button__link_blue" data-button="blue" href="#"><span
        class="block2-button__icon"></span><span class="block1-button__title">button blue</span></a></div>
</div>
</div>
</body>
<script class="spec-runner">(function () {
    var global = this;
    typeof modules === "object" ? modules.require(["jquery", "mocha", "spec"], function ($, mocha) {
        init($, mocha);
    }) : init(global.jQuery, global.mocha);
    function init($, mocha) {
        global.mochaPhantomJS ? global.mochaPhantomJS.run(done) : mocha.run(done);
        function done() {
            $("#mocha").show()
        }
    }
}());</script>
</html>

Becose my block3 used block1 and block2!

Where I see a mistake?

Look on this: https://github.com/enb/enb-bem-specs/blob/master/lib/node-configurator.js#L87-L92

and to build deps.js must be so:

         // Deps
        nodeConfig.addTechs([
            [provide, { target: '?.bemjson.js' }],
            [provide, { target: '?.base.bemdecl.js' }],

            [bemjsonToBemdecl, { target: '?.bemjson.bemdecl.js' }],

            [depsByTechToBemdecl, {
                target: '?.spec-js.bemdecl.js',
                filesTarget: '?.base.files',
                sourceTech: 'spec.js',
                destTech: 'js'
            }],

            // @pavelpower: this merge all decls
            [mergeDeps, {
                target: '?.merge.bemdecl.js',
                sources: ['?.base.bemdecl.js', '?.bemjson.bemdecl.js', '?.spec-js.bemdecl.js']
            }],
            // @pavelpower: build ?.deps.js form all blocks 
            [depsTech, {
                bemdeclFile: '?.merge.bemdecl.js',
                target: '?.bemdecl.js'
            }],
            // @pavelpower: final build all deps to bemdecl
            [depsTech],
        ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant