lib/nodes/bundle.js
function(techName, techPath, declPath, bundleNode, magicNode, forked) {

        var arch = this.ctx.arch,
            buildNode = new BemBuildNode.BemBuildNode({
                root: this.root,
                bundlesLevel: this.level,
                levels: this.getLevels(techName),
                declPath: declPath,
                techPath: techPath,
                techName: techName,
                output: this.getNodePrefix(),
                forked: forked === undefined? ~this.getForkedTechs().indexOf(techName): forked
            });

        var tech = this.level.getTech(techName, techPath),
            metaNode;

        /* techs-v2: don't create meta node */
        if (tech.API_VER !== 2) metaNode = buildNode.getMetaNode();

        // Set bem build node to arch and add dependencies to it
        arch.setNode(buildNode)
            .addChildren(buildNode, buildNode.getDependencies());

        // Add file aliases to arch and link with buildNode as parents
        buildNode.getFiles().forEach(function(f) {

            if (buildNode.getId() === f) return;

            var alias = new fileNodes.FileNode({ path: f, root: this.root });
            arch.setNode(alias).addParents(buildNode, alias);

        }, this);

        bundleNode && arch.addParents(buildNode, bundleNode);
        magicNode && arch.addChildren(buildNode, magicNode);

        /* techs-v2: don't add dependency on meta node */
        if (metaNode) {
            // Set bem build meta node to arch
            arch.setNode(metaNode)
                .addParents(metaNode, buildNode)
                .addChildren(metaNode, metaNode.getDependencies());
        }

        return buildNode;

    }
function(techName, techPath, declPath, bundleNode, magicNode, forked) {

        var arch = this.ctx.arch,
            buildNode = new BemBuildNode.BemBuildNode({
                root: this.root,
                bundlesLevel: this.level,
                levels: this.getLevels(techName),
                declPath: declPath,
                techPath: techPath,
                techName: techName,
                output: this.getNodePrefix(),
                forked: forked === undefined? ~this.getForkedTechs().indexOf(techName): forked
            });

        var tech = this.level.getTech(techName, techPath),
            metaNode;

        /* techs-v2: don't create meta node */
        if (tech.API_VER !== 2) metaNode = buildNode.getMetaNode();

        // Set bem build node to arch and add dependencies to it
        arch.setNode(buildNode)
            .addChildren(buildNode, buildNode.getDependencies());

        // Add file aliases to arch and link with buildNode as parents
        buildNode.getFiles().forEach(function(f) {

            if (buildNode.getId() === f) return;

            var alias = new fileNodes.FileNode({ path: f, root: this.root });
            arch.setNode(alias).addParents(buildNode, alias);

        }, this);

        bundleNode && arch.addParents(buildNode, bundleNode);
        magicNode && arch.addChildren(buildNode, magicNode);

        /* techs-v2: don't add dependency on meta node */
        if (metaNode) {
            // Set bem build meta node to arch
            arch.setNode(metaNode)
                .addParents(metaNode, buildNode)
                .addChildren(metaNode, metaNode.getDependencies());
        }

        return buildNode;

    }
function ( techName , techPath , declPath , bundleNode , magicNode , forked ) { var arch = this . ctx . arch , buildNode = new BemBuildNode . BemBuildNode ( { root : this . root , bundlesLevel : this . level , levels : this . getLevels ( techName ) , declPath : declPath , techPath : techPath , techName : techName , output : this . getNodePrefix ( ) , forked : forked === undefined ? ~ this . getForkedTechs ( ) . indexOf ( techName ) : forked } ) ; var tech = this . level . getTech ( techName , techPath ) , metaNode ; /* techs-v2: don't create meta node */ if ( tech . API_VER !== 2 ) metaNode = buildNode . getMetaNode ( ) ; // Set bem build node to arch and add dependencies to it arch . setNode ( buildNode ) . addChildren ( buildNode , buildNode . getDependencies ( ) ) ; // Add file aliases to arch and link with buildNode as parents buildNode . getFiles ( ) . forEach ( function ( f ) { if ( buildNode . getId ( ) === f ) return ; var alias = new fileNodes . FileNode ( { path : f , root : this . root } ) ; arch . setNode ( alias ) . addParents ( buildNode , alias ) ; } , this ) ; bundleNode && arch . addParents ( buildNode , bundleNode ) ; magicNode && arch . addChildren ( buildNode , magicNode ) ; /* techs-v2: don't add dependency on meta node */ if ( metaNode ) { // Set bem build meta node to arch arch . setNode ( metaNode ) . addParents ( metaNode , buildNode ) . addChildren ( metaNode , metaNode . getDependencies ( ) ) ; } return buildNode ; }
Create a bem build node, add it to the arch, add
dependencies to it. Then create a meta node and link
it to the build node.

@param {String} techName
@param {String} techPath
@param {String} declPath
@param {String} bundleNode
@param {String} magicNode
@param {Boolean} [forked]
@return {Node}
Create a bem build node add it to the arch add dependencies to it . Then create a meta node and link it to the build node .