2017 © Pedro Peláez
 

symfony-bundle sam-bundle

Bundle to integrate Sam library to Symfony

image

johnkrovitch/sam-bundle

Bundle to integrate Sam library to Symfony

  • Friday, November 17, 2017
  • by JohnKrovitch
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,751 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

SamBundle

Build Status GuardRails badge Scrutinizer Code Quality Code Coverage, (*1)

SamBundle for Symfony. Add a command to build the assets using configuration in app/config. SamBundle use the Sam library (stand for Simple Asset Manager) and will allow to configure how your assets will be build, minified and merged., (*2)

Introduction

SamBundle will read a yaml configuration file. This file should contains a list of tasks. Each task is a list of sources files (js, css, scss...), a list of filters applied to those files, and a list a destination file., (*3)

Installation

    composer require johnkrovitch/sam-bundle

Configuration

Add your configuration in config.yml, (*4)

    jk_assets:
        # filters configuration
        filters:
            compass:
                # path to compass binary (if it is in $PATH, you could leave the default)
                bin: compass
            # activate merge, minify and copy filters
            merge: ~
            minify: ~
            copy: ~
        tasks:
            # a task
            # main.css is just a name, you could put what ever you want, but each task should have a unique name
            main.css:
                # first will apply the Compass filter, then the merge filter, then we minify
                # the process should be as following :
                #   1) the Compass filter will only take the ".scss" files, and compile them to ".css" files. The ".scss"
                # files we be replaced by the ".css" files in the sources list
                #   2) the merge filter will take all the files in the sources list
                filters:
                    - compass
                    - merge
                    - minify
                sources:
                    - app/Resources/assets/sass/main.scss
                    - vendor/components/bootstrap/css/bootstrap.min.css
                    - vendor/components/bootstrap/css/bootstrap-theme.min.css
                    - vendor/components/font-awesome/css/font-awesome.min.css
                    - app/Resources/assets/css/hover-min.css
                destinations:
                    - web/css/main.css

            fonts:
                filters: ~
                sources:
                    - vendor/components/bootstrap/fonts/
                    - vendor/components/font-awesome/fonts/
                destinations:
                    - web/fonts/

            cms.js:
                filters:
                    - merge
                    - minify
                sources:
                    - src/JK/CmsBundle/Resources/assets/js/jquery.iframe-transport.js
                    - src/JK/CmsBundle/Resources/assets/js/cms/fileupload.js
                    - vendor/blueimp/jquery-file-upload/js/jquery.fileupload.js
                destinations:
                    - src/JK/CmsBundle/Resources/public/js/cms.js

            tinymce.css:
                filters:
                    - compass
                    - merge
                    - minify
                sources:
                    - src/JK/CmsBundle/Resources/assets/sass/tinymce.scss
                    - web/css/custom-tinymce.css
                destinations:
                    - src/JK/CmsBundle/Resources/public/css/tinymce.css

Usage

After configuring your assets, you can execute the tasks with the following command :, (*5)

    bin/console jk:assets:build

During development, you can use the watch command which monitor the configured assets and rebuild automatically the assets., (*6)

    bin/console jk:assets:watch

The Versions

17/11 2017

dev-release/v0.1.1

dev-release/v0.1.1

Bundle to integrate Sam library to Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar JohnKrovitch

symfony2 assets admin generic backoffice

22/04 2017

dev-master

9999999-dev

Bundle to integrate Sam library to Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar JohnKrovitch

symfony2 admin generic backoffice

22/04 2017

v0.1

0.1.0.0

Bundle to integrate Sam library to Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar JohnKrovitch

symfony2 admin generic backoffice

21/04 2017

dev-dev

dev-dev

Bundle to integrate Sam library to Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar JohnKrovitch

symfony2 admin generic backoffice