Coder Social home page Coder Social logo

enb-borschik's Introduction

ENB

NPM Status Travis Status Windows Status Coverage Status Dependency Status

The tool for building web projects created with the BEM methodology.

Introduction

The main purpose of ENB is to combine source files into bundles, usually for further use in the browser.

The build includes combining all source files, processing them and converting the code, as well as preparing and packing the resources (images, fonts, and so on).

Read more about building BEM projects on the bem.info site.

Basic features of ENB

  • Searches for only those source files needed for the build.
  • Connects the necessary source files based on dependency declarations.
  • Defines the order of connecting the source files.
  • Combines source files spread across the project's file system.
  • Creates bundles and files.
  • Extends the build for project-specific processing and conversion.
  • Provides a local development service that supports builds on demand.

Installation

$ npm install --save-dev enb

Getting started

To create a BEM project configured for the build with ENB, use one of these options:

  1. Install a project-stub template project that supports ENB builds by default.
  2. Create a project that suits your tasks. To do this, answer the questions in the BEM project generator based on Yeoman.

Documentation

Materials

Extensions

ENB technology packages are located in NPM: packages with the enb prefix.

Name Status Description
BEM methodologies
BEM NPM version Technologies for building BEM projects.
BEViS NPM version Technologies for building BEViS projects.
Templating
bem-xjst NPM version Building BEMTREE and BEMHTML templates with bem-xjst.
xjst NPM version Building BEMTREE and BEMHTML templates with XJST.
bh NPM version Building BH templates.
bt NPM version Building BT templates.
Styles
CSS NPM version Building and minimizing CSS files.
PostCSS NPM version Building and processing CSS files with postcss.
Stylus NPM version Building and minimizing Stylus files.
Saas NPM version Building Sass files.
Roole NPM version Building roo files.
JavaScript
JavaScript ![NPM version] (https://img.shields.io/npm/v/enb-js.svg) Building, processing and minimizing JS files.
YModules NPM version Building JS files with YModules.
Public facilities
Examples NPM version Building BEM examples.
Docs NPM version Building BEM documentation.
Browser tests NPM version Building and running tests for client-side JavaScript.
Node tests NPM version Building and running tests for BEM templates.
Template tests NPM version Building and running tests for BEM templates.

License

© 2013 YANDEX LLC. The code is released under the Mozilla Public License 2.0.

enb-borschik's People

Contributors

andre487 avatar arikon avatar blond avatar dfilatov avatar doochik avatar golyshevd avatar j0tunn avatar mdevils avatar mishanga avatar tadatuta avatar tormozz48 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

enb-borschik's Issues

Add `borschik-include` tech

If in source code use borschik:include then to correctly replace by the file's content need build target which is borschik:include and use borschik tech.

Expected target result for js-borschik-include tech:

/*borschik:include:./path/to/file-1.js*/
/*borschik:include:./path/to/file-2.js*/
/* ... */

Reed more about borschik:include in the docs.

Error: Unexpected token operator «=», expected punc «,»

ES6 default params crash:

Error: Unexpected token operator «=», expected punc «,» (line: 14895, col: 49, pos: 453112)
 14893 |     * @private
 14894 |     */
 14895 |    request._prepareSettings = function(settings = {}) {
---------------------------------------------------------^
 14896 |        const qs = querystring.parse(location.search);
 14897 |
Error result in /usr/src/app/desktop.bundles/index/index.ru.min.js.borschik-error
    at /usr/src/app/node_modules/enb-borschik/node_modules/borschik/lib/tech.js:86:31
    at Array.<anonymous> (/usr/src/app/node_modules/vow/lib/vow.js:712:56)
    at Immediate.callFns [as _onImmediate] (/usr/src/app/node_modules/vow/lib/vow.js:23:35)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)

Error: CssSyntaxError: Unexpected input if minify: true in v2.3.1

Обновился пакет, появилась такая ошибка при сборке.

Css на вход подается валидный.

Error: CssSyntaxError: Unexpected input
Error result in /Users/voischev/projects/ui/dist/desktop/ui.min.css.borschik-error
    at /Users/voischev/projects/ui/node_modules/enb-borschik/node_modules/borschik/lib/tech.js:86:31
    at Array.<anonymous> (/Users/voischev/projects/ui/node_modules/enb-borschik/node_modules/vow/lib/vow.js:712:56)
    at Immediate.callFns [as _onImmediate] (/Users/voischev/projects/ui/node_modules/enb-borschik/node_modules/vow/lib/vow.js:23:35)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

если minify: false то отрабатывает норм

c "enb-borschik": "2.3.0" тоже нормально работает

Freeze by default

The reason to apply freeze by default is that without .borschik config in the project folder no freezing will be applied anyway. And in case there is such config it's obvious that user want freeze to be turned on.

Add tests

  • #18 Implement tests for borschik technology
  • #19 Implement tests for js-borschik-include technology

Фриз bemtree.

Дано: нодовое приложение

app.get('*', function(req, res) { BEMTREE.apply({ block : 'root' }).then(function(bemjson) {
    res.send(BEMHTML.apply(bemjson));
}) })

root.bemtree

block('root').def()(function(){
   return {
      block : 'page',
      styles : [{ elem : 'css', url : '/_site.css' }],
      scripts : { elem : 'js', url : '/_site.js' }
   };
})

Задача: фризить статику(js, css, ico, ...) и отдавать клиенту подобный html

<doctype html>
<head>
    <link href="sha-1.css">
    <script src="sha-1.js">
...

Проблемы:

  1. enb-borschik ничего не знает про готовность замораживаемых таргетов, т.е. на примере выше _?.css и _?.js таргеты могут не существовать в момент фриза борщиком.
  2. Борщик замораживает файлы с определенными расширениями, по умолчанию среди них нет css и js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.