Giter Site home page Giter Site logo

project-stub's Introduction

Minimal setup to start a new BEM project

This repository contains the minimal configuration-files and folders you will need to create a BEM project from scratch.


Installation Requirements:

You may also consider installing bem-tools locally to your environment for ease of use, though this is not required to use this project.


Installation:

So, how easy is it to get started with BEM? Super easy.

It's as easy as...

1 › git clone git://github.com/bem/project-stub.git
2 › cd project-stub
3 › make

(hint: execute the above commands in your terminal)

Now that bem server is running, check it out:

Navigate to: http://localhost:8080/desktop.bundles/index/index.html

(here, have a link: http://localhost:8080/desktop.bundles/index/index.html)


That's it, it's that simple. Congratulations, your BEM project is already underway!


Was that too easy?

Here's the replay... that make command will:

  1. Install a local copy of all required dependencies from npm into the ./node_modules directory. (specifically: bem-tools)
  2. Start a local bem server on port 8080.

Note:

What do we mean by "a local copy of all required dependencies"?

Well, when you run the make command for the first time, we install all of the required dependencies (bem-tools) to the ./node_modules directory within the local project directory. This is not the same thing as installing bem-tools locally to your environment - which, if you haven't done already, we strongly suggest that you do. This is by far the easiest, quickest way to use bem-tools in a more beautiful way.


Usage:

Start the Server:

› make

Each subsiquent time you wish to start the server you may simply run the make command in your terminal.

Alternatively you may opt to use the following command:

› ./node_modules/.bin/bem server

This is the ugly way to run the bem server command. If you think it's ugly too and wish for a better way keep reading...

An Easier, More Beautiful Way:

Once you have either (a) fixed your PATH environment variable, or (b) properly installed bem-tools to your local environment. You may now, more elegantly, start your bem server by running:

› bem server

Stopping the Server:

Stopping the server is also easy:

[ctrl] + [c]

Pressing [ctrl] + [c] while the terminal is your active window will stop the server.


Fix your PATH environment variable:

For a more permanent way to "easily" use the local-to-this-project's installation of bem-tools all you must do is ensure that the path to the bem executable (./node_modules/.bin) is included in your PATH environment variable.

> export PATH=./node_modules/.bin:$PATH

Optionally you may also add export PATH=PATH_TO_PROJECT_DIRECTORY/node_modules/.bin:$PATH to your .profile (obviously replacing PATH_TO_PROJECT_DIRECTORY with the actual path to your project)


BEM is an abbreviation for Block-Element-Modifier. BEM is a way to write code which is easy to support and develop.

For more information about the BEM metodology check out http://bem.info.

project-stub's People

Contributors

tadatuta avatar corpix avatar jeremyiglehart avatar

Watchers

uberBuilder Projects avatar James Cloos avatar

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.