npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

enb-bevis-helper

v3.2.0

Published

enb-bevis-helper [![Build Status](https://travis-ci.org/enb-make/enb-bevis-helper.png?branch=master)](https://travis-ci.org/enb-make/enb-bevis-helper) ==========

Downloads

27

Readme

enb-bevis-helper Build Status

Надстройка над ENB для типовой конфигурации BEViS-проекта

ENB - инструмент для сборки, разбитый на несколько отдельных модулей. При ручном конфигурировании сборки нужно устанавливать каждый модуль самостоятельно, указывать нужные версии и зависимости между ними, указывать технологии для сборки, параметризировать их.

Модуль enb-bevis-helper упрощает эту процедуру, сводя все конфги к трём типам:

  • сборка статических страниц

  • сборка динамических страниц

  • сборка тестов

###package.json

Укажите зависимость от последней версии пакета enb-bevis-helper, и все нужные модули для сборки вашего проекта подтянутся самостоятельно.

//...
    "dependencies": {
        "enb-bevis-helper": "1.0.0",
        //...
    }
//...

Здесь же в дополнительной секции enb укажите пути к ресурсам вашего проекта и сборщик подхватит их автоматически.

//...
    "dependencies": {
        "enb-bevis-helper": "1.0.0",
        //...
    },
    "enb": {
        // директории с исходниками
        "sources": [
            "blocks",
            "core",
            "pages"
        ]
    }
//...

Дальнейшие объяснения основаны на предположении, что исходный код страниц хранится в папке /pages, собранные страницы оказываются в /build, а имена файлов выглядят так:

/pages
    /index-page
    /news-page
...
/build/
    /index
    /news

##Руководство

  1. Выполнить npm install.
  2. Проверить, что ENB установлен. Команда node_modules/.bin/enb должна выполниться без ошибок.
  3. Создать .enb/make.js
    module.exports = function(config) {
    
    };
  4. Подключить конфиг enb-bevis-helper
    module.exports = function(config) {
        config.includeConfig('enb-bevis-helper');
    };
    
  5. Настроить enb-bevis-helper
    module.exports = function(config) {
        config.includeConfig('enb-bevis-helper');
    
        var browserSupport = [
            'IE >= 9',
            'Safari >= 5',
            'Chrome >= 33',
            'Opera >= 12.16',
            'Firefox >= 28'
        ];
    
        var bevisHelper = config.module('enb-bevis-helper')
            .browserSupport(browserSupport) // Какие браузеры будем поддерживать в проекте
            .useAutopolyfiller();           // Будем использовать Autopolyfiller.js
    };
  6. Теперь нужно настроить ноду. Для примера, приведу вариант настройки ноды build/index. Это страница, которая строится из динамических данных на основе технологии priv-js
    module.exports = function(config) {
        config.includeConfig('enb-bevis-helper');
    
        var browserSupport = [
            'IE >= 9',
            'Safari >= 5',
            'Chrome >= 33',
            'Opera >= 12.16',
            'Firefox >= 28'
        ];
    
        var bevisHelper = config.module('enb-bevis-helper')
            .browserSupport(browserSupport)
            .useAutopolyfiller();
    
        // Языки для проекта
        config.setLanguages(['ru', 'en']);
    
        // Динамическая страница
        config.node('build/index', function (nodeConfig) {
            bevisHelper
                .sourceDeps('index-page') // Нода будет искать зависимости внутри блока index-page
                .forServerPage()          // Конфигурирует динамическую страницу
                .configureNode(nodeConfig);
            nodeConfig.addTech(require('./techs/priv-js'));
            nodeConfig.addTarget('?.priv.js');
        });
    
    };
  7. Сконфигурировать статическую страницу. Она собирается на основе btjson.js декларации
    module.exports = function(config) {
        config.includeConfig('enb-bevis-helper');
    
        var browserSupport = [
            'IE >= 9',
            'Safari >= 5',
            'Chrome >= 33',
            'Opera >= 12.16',
            'Firefox >= 28'
        ];
    
        var bevisHelper = config.module('enb-bevis-helper')
            .browserSupport(browserSupport)
            .useAutopolyfiller();
    
        config.setLanguages(['ru', 'en']);
    
        config.node('build/index', function (nodeConfig) {
            bevisHelper
                .sourceDeps('index-page')
                .forServerPage()
                .configureNode(nodeConfig);
            nodeConfig.addTech(require('./techs/priv-js'));
            nodeConfig.addTarget('?.priv.js');
        });
    
        // Статическая страница
        config.node('build/examples', function (nodeConfig) {
            bevisHelper
                .forStaticHtmlPage() // Конфигурирует статическую страницу
                .configureNode(nodeConfig);
        });
    
    };
  8. Сконфигурировать тесты.
    module.exports = function(config) {
        config.includeConfig('enb-bevis-helper');
    
        var browserSupport = [
            'IE >= 9',
            'Safari >= 5',
            'Chrome >= 33',
            'Opera >= 12.16',
            'Firefox >= 28'
        ];
    
        var bevisHelper = config.module('enb-bevis-helper')
            .browserSupport(browserSupport)
            .useAutopolyfiller();
    
        config.setLanguages(['ru', 'en']);
    
        config.node('build/index', function (nodeConfig) {
            bevisHelper
                .sourceDeps('index-page')
                .forServerPage()
                .configureNode(nodeConfig);
            nodeConfig.addTech(require('./techs/priv-js'));
            nodeConfig.addTarget('?.priv.js');
        });
    
        config.node('build/examples', function (nodeConfig) {
            bevisHelper
                .forStaticHtmlPage()
                .configureNode(nodeConfig);
        });
    
        // Тесты
        bevisHelper.configureUnitTests('test/client');
    };

Примеры