0.0.5 • Published 7 years ago

huddler v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Huddler

A streaming build system designed for Symfony PHP projects.

Place a huddler taskfile.js in the root of your project and let it gather the assets from each bundle and place them in the web directory. Like any other streaming system, individual assets can be piped around, compiled and/or combined. Almost all gulp plugins can be used with Huddler.

This module is intended to be used by twifty/huddler-bundle which provides some useful commands and twig templating features.

Sample taskfile

var Huddler = require('huddler'),
    concat = require('gulp-concat');

Huddler.task('scripts', () => {
	return Huddler.huddle()
	    .pipe(Huddler.webDir());
});

Huddler.task('styles', () => {
	return Huddler.huddle()
	    .pipe(concat('main.css'))
	    .pipe(Huddler.webDir());
});

function fonts() {
    return Huddler.huddle().pipe(Huddler.webDir());
}

function images() {
	return Huddler.huddle().pipe(Huddler.webDir());
}

Huddler.task('install', Huddler.parallel('scripts', 'styles', fonts, images));

Individual Symfony bundles can export their own taskfile.js allowing them to handle their own assets, and if one isn't exported, their assets will be gathered from their Resources/public directory.

Assets are written or symlinked into the web directory under a subdirectory matching the task name. This avoids having to use the Symfony assets:install command which creates a bundles directory in the web folder. When multiple assets with the same name are detected, they are auto renamed. All written asset paths are also written to a tracker.json file allowing for easy integration into PHP code.

NOTE

This is my first node.js project. Any and all help is very much appreciated.

TODOs:

  1. tests
  2. use existing modules where possible
  3. make sure all configured paths are relative to the file within which they are defined.