Metadata-Version: 2.1
Name: sc.recipe.staticresources
Version: 1.0b1
Summary: FIXME
Home-page: http://github.com/simplesconsultoria/sc.recipe.staticresources/
Author: Simples Consultoria
Author-email: products@simplesconsultoria.com.br
License: UNKNOWN
Description: *************************
        sc.recipe.staticresources
        *************************
        
        .. contents:: Table of Contents
        
        Life, the Universe, and Everything
        ==================================
        
        This package is used as a recipe to integrate Plone and `webpack <https://webpack.js.org/>`_ using Buildout.
        
        In the recent years, many tools were created to manage static resource files, these tools can:
        
        * automatically compress images
        * use CSS pre and post-processors to write less and better code, taking advantage of new standards still not available to all browsers
        * use JavaScript transpilers to write ES6 code and generate ES5 equivalent code, that works on all browsers
        * minify the resulting code
        
        And many other options, pratically everything related to process static resources can be achived by an official or community package.
        
        This package facilitates the integration of webpack with Plone,
        writing less lines into your Buildout configuration and providing a nice template to start with.
        
        We choose webpack because it's proven to be the best toolchain available, and many people in the Plone community are using it.
        
        Mostly Harmless
        ===============
        
        .. image:: http://img.shields.io/pypi/v/sc.recipe.staticresources.svg
           :target: https://pypi.python.org/pypi/sc.recipe.staticresources
        
        .. image:: https://img.shields.io/travis/simplesconsultoria/sc.recipe.staticresources/master.svg
            :target: http://travis-ci.org/simplesconsultoria/sc.recipe.staticresources
        
        .. image:: https://img.shields.io/coveralls/simplesconsultoria/sc.recipe.staticresources/master.svg
            :target: https://coveralls.io/r/simplesconsultoria/sc.recipe.staticresources
        
        Got an idea? Found a bug? Let us know by `opening a support ticket <https://github.com/simplesconsultoria/sc.recipe.staticresources/issues>`_.
        
        Don't Panic
        ===========
        
        Installation
        
        To enable this product in a buildout-based installation:
        
        #. Edit your buildout.cfg and add these lines:
        
        .. code-block:: ini
        
            [buildout]
            ...
            parts +=
                node
                staticresources
        
            [node]
            recipe = gp.recipe.node
            version = 8.11.2
            npms = npm yarn
            scripts = npm yarn
        
            [staticresources]
            recipe = sc.recipe.staticresources
            name = my.package.name
            short_name = mypackagename
        
        After updating the configuration you need to run ''bin/buildout'', which will take care of updating your system.
        
        The recipe is responsible for:
        
        * creating the webpack folder structure, if none exists
        * creating the script to access webpack environment to handle more complex scenarios
        * create all scripts listed in webpack/package.json scripts entries.
        
        Configuration options
        ---------------------
        
        name (required)
        ^^^^^^^^^^^^^^^
        This is the package name or the theme name used in the package.
        This field is required.
        
        short_name (required)
        ^^^^^^^^^^^^^^^^^^^^^
        A short name is needed to be used as the UMD JavaScript library name and the name of the script inserted into Plone.
        This field is required.
        
        directory
        ^^^^^^^^^
        Relative path to webpack folder, you can use this field to define more than one webpack folder for different themes.
        If this option is not present, the default value is ``${buildout:directory}/webpack``.
        
        destination
        ^^^^^^^^^^^
        Destination path relative to webpack directory, you should add this option to point the resulting static resources folder,
        it can be the theme folder or a static resources directory.
        If this option is not present, the default value is ``./dist`` folder.
        
        bobtemplate
        ^^^^^^^^^^^
        Custom webpack bobtemplate path.
        It's possible to change the default bobtemplate path to another that follows your project needs, if you prefer.
        If this option is not present, the default value is the bobtemplate that exists into this package.
        
        The default template
        --------------------
        In the default template we selected what webpack tools are valid to our needs, what is basically theme and addons development.
        This is the list of what we include:
        
        `HTML Loader <https://github.com/webpack-contrib/html-loader>`_
            Used to process the HTML file; in our use case it's used when we create a new theme.
        
        `Image Webpack Loader <https://github.com/tcoopman/image-webpack-loader>`_
            Process all images referenced to save space in the final images,
            it tile the workflow with some specialized tools for each image format.
        
        `SVG URL Loader <https://github.com/bhovhannes/svg-url-loader>`_
            Process all SVG files and creates a data-url string.
            For example it inserts the SVG file into the final CSS file to save requests.
        
        `Webpack SpriteSmith <https://github.com/mixtur/webpack-spritesmith>`_
            Brings an easy way to create image sprites,
            you simply add the icon images in one folder and it creates all you need to use the sprite with your choosen CSS pre-processor.
        
        `Babel <https://babeljs.io/>`_
            A transpiler that makes possible to use the next generation of JavaScript today.
        
        `Sass <http://sass-lang.com/>`_
            The most mature, stable, and powerful professional grade CSS extension language in the world.
        
        `PostCSS <https://github.com/postcss/postcss>`_
            A post-processor used to transform styles with JavaScript plugins.
            In our configuration we use just `CSS next <http://cssnext.io/>`_ plugin to add automatically all vendor prefixes for the last 3 versions of major browsers,
            as soon as the browsers support more features,
            your final CSS will automatically cost less bytes.
        
        Usage
        -----
        
        In our simplest example, the following scripts are created:
        
        .. code-block:: console
        
            $ bin/env-mypackagename
        
        This command sets the buildout node installation in the system PATH, this way you can use webpack as described in their docs.
        
        .. code-block:: console
        
            $ bin/watch-mypackagename
        
        This command makes webpack wait for any change in any SASS, JS (ES6) files and generates the minified version of CSS and JS (ES5) UMD module for your application.
        
        .. code-block:: console
        
            $ bin/debug-mypackagename
        
        This does the same as watch command, but don't try to minify the final CSS and JS.
        Used for debug purposes.
        
        .. code-block:: console
        
            $ bin/build-mypackagename
        
        This command builds the CSS and JS minified, but doesn't wait for any change.
        
        .. code-block:: console
        
            $ bin/test-mypackagename
        
        This command runs the JavaScript tests using `karma <https://karma-runner.github.io>`_, `mocha <https://mochajs.org/>`_, `chai <http://chaijs.com/>`_ and `sinon <http://sinonjs.org/>`_.
        
        Note that ``short_name`` is added at the end of the script name.
        This way you can have multiple webpack folders in the same package (if you have multiple themes inside the same package, for example).
        
        Share and Enjoy
        ===============
        
        This package would not have been possible without the contribution of the following people:
        
        - Rodrigo Ferreira de Souza
        - Héctor Velarde
        
        Changelog
        =========
        
        1.0b1 (2018-08-24)
        ------------------
        
        - Change template to use a package Known-Good-Set (KGS).
          [rodfersou]
        
        - Update package versions.
          [rodfersou]
        
        
        1.0a2 (2018-01-24)
        ------------------
        
        - Review how HTML and CSS are processed (closes `#23 <https://github.com/simplesconsultoria/sc.recipe.staticresources/issues/23>`_).
          [rodfersou]
        
        - Remove old scripts generated by this recipe after buildout run (closes `#21 <https://github.com/simplesconsultoria/sc.recipe.staticresources/issues/21>`_).
          [rodfersou]
        
        - Rename script to debug instead of dev to avoid misunderstanding (closes `#22 <https://github.com/simplesconsultoria/sc.recipe.staticresources/issues/22>`_).
          [rodfersou]
        
        - Fix webpack installation conflict (closes `#25 <https://github.com/simplesconsultoria/sc.recipe.staticresources/issues/25>`_).
          [rodfersou]
        
        - Fix package license typo on template.
          [hvelarde]
        
        - Run build command after update recipe (closes `#18 <https://github.com/simplesconsultoria/sc.recipe.staticresources/issues/18>`_).
          [rodfersou]
        
        - Add an error log if directory parameter is invalid.
          [rodfersou]
        
        
        1.0a1 (2017-11-21)
        ------------------
        
        - Initial release.
        
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Buildout
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Build Tools
Provides-Extra: test
