Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@justeat/gulp-build-fozzie

justeat482Apache-2.011.3.0

Gulp build tasks for use across Fozzie modules

readme

gulp-build-fozzie :bear:

npm version CircleCI build status Coverage Status

Gulp build tasks for use across Fozzie modules.

Contents

Setup

First, add gulp and gulp-build-fozzie as dependencies

yarn add gulp @justeat/gulp-build-fozzie

Next, inside your gulpfile.js, require the build function from @justeat/gulp-build-fozzie, then pass gulp as the first argument.

const gulp = require('gulp');
const { build } = require('@justeat/gulp-build-fozzie');

build(gulp, /*options*/);

You can optionally pass in options which will override the default config values.

That's it! You can now run any of the Gulp tasks.

Optional setup

Transpile es2015 code

To ensure that the scripts:bundle task can transpile es2015 code, add a .babelrc file, with the @babel/preset-env preset, to the root of your project:

{
    "presets": ["@babel/preset-env"]
}

If you do not add a .babelrc file (you may be writing es5 code for example) then the code will be bundled up as is.

JavaScript Linting

Add an .eslintrc file to the root of your project with the following content to use the JS linting rules we recommend when running the scripts:lint task:

{
    "extends": "@justeat/eslint-config-fozzie"
}

If you wish to extend or override these rules you can simply add them after the extends line in the .eslintrc file.

For more information on how you can configure eslint check out the documentation.

N.b. You may also find that you get an error when adding eslint which reads Parsing error: Cannot read property 'ecmaFeatures' of undefined. If you see this message, then add this to your package.json followed by running yarn install:

"resolutions": {
  "espree": "3.5.4"
}

This is a temporary fix dependent on the progress of this issue open on ESLint.

CSS Linting

To use our recommended fozzie stylelint linting rules add the following into your package.json file:

"stylelint": {
    "extends": "@justeat/stylelint-config-fozzie"
}

If you wish to extend or override these rules you can simply add them after the extends line in the package.json file.

For more information on how you can configure stylelint check out the documentation.

Config and pathBuilder

You can also access the config and pathBuilder objects which are used inside of gulp-build-fozzie by requiring them:

const { config, pathBuilder } = require('@justeat/gulp-build-fozzie');

These are exposed for convenience, and means that you do not need to manually build paths and maintain a separate config object for any custom tasks in your project. It also reduces duplication and prevents bugs which can arise from specifying incorrect paths.

config object

This is the config object which is used inside of gulp-build-fozzie, if you have passed any options via the build method they will be available here.

See the Options section below for the details of this object.

pathBuilder object

The pathBuilder object is used inside of gulp-build-fozzie in order to build the paths used in the gulp tasks.

See the Path Builder section below for details on which paths are available.

The Gulp Tasks

css

Runs the following tasks

  • scss:lint

    Lint all SCSS files in the source directory — this runs before the css:bundle task.

    This task will also automatically fix any errors that it can (through stylelint's autofix setting).

  • css:lint

    Lint all CSS files in the dist directory — this runs after the css:bundle task.

  • clean:css

    Removes any CSS already in the dist directory.

  • css:bundle

    Performs a variety of tasks including;

    • Makes environment variables available to Sass
    • Pull in Eyeglass modules
    • Run postcss plugins
    • Minify the CSS
    • Add hashed version to file name
    • Output bundle to the dist directory

scripts

Runs the following tasks

  • scripts:lint

    Lint all JavaScript in the source directory. This task will also attempt to automatically fix any rules via the ESLint --fix flag.

  • scripts:test

    Runs any unit tests found in the JavaScript source directory using Jest.

  • scripts:test:coverage

    Runs the JS unit tests and display a coverage report once complete.

  • clean:scripts

    Removes any JavaScript already in the dist directory.

  • Custom Tasks

    The names of custom tasks can be passed into the config object to be run here. See customTasks for more details.

  • scripts:bundle

    Performs a variety of tasks including;

    • ES2015 transpilation using Babel
    • Bundle all code into a single file
    • Generate sourcemap files
    • Minify the JavaScript
    • Add hashed version to file name
    • Output bundle to the dist directory

logger:createFile

Adds the server-side file required for the errorLogger to be inserted into the filesystem.

images

Runs the following tasks

  • clean:images

    Removes any images already in the dist directory.

  • images:optimise

    Optimises all images found in the source directory then copies them to the dist directory.

  • images:svg-sprite

    Generate an SVG sprite and copy into the dist directory

It also runs the copy:img and copy:assets tasks.

service-worker

Runs the following tasks

  • service-worker:locate

Discovers scripts in the service worker directory.

  • service-worker:copy

Copies the worker's internal scripts to the dist directory.

  • service-worker:write

Generates a service worker to pre-cache the assets defined in the config.

copy:js, copy:css, copy:img, copy:fonts & copy:docs

Each of these tasks copies the specified set of assets from the src to the dist asset folders.

See the config section for details on how to configure these tasks.

watch

Runs the default task then the following watch tasks.

  • watch:css

Runs the css task when a CSS file is changed.

  • watch:scripts

Runs the scripts task when a JavaScript file is changed.

  • watch:scripts:test

Runs the scripts:lint and scripts:test tasks when a JavaScript unit test file is changed.

  • watch:images

Runs the images task when an image file is changed.

watch:docs

Runs the same tasks as watch as well as the following watch tasks.

  • watch:docs:templates

Runs the assemble task when documentation files are changed.

Development-only tasks

  • docs

Builds a fresh copy of any documentation found in the config.docs.rootDir directory using Assemble, then watches for any file changes and reloads the web page when changes are detected in the config.docs.distDir directory.

  • docs:deploy

Builds the documentation and then pushes the dist directory to the gh-pages branch.

  • docs:release

Pushes the documentation dist directory to the gh-pages branch.

  • clean:docs

Removes document files already in the docs dist directory.

  • copy:img:docs

Copies all of the images in the assets dist folder over to the docs dist folder.

  • browser-sync

Watches for changes to files and reloads a local website instance.

  • browser-sync:docs

Generates the documentation files then opens the docs in a local server.

  • assemble

Generates the documentation files.

Config

Here is the outline of the configuration options, descriptions of each are below.

{
    webRootDir,
    assetSrcDir,
    assetDistDir,
    applyRevision,
    packageVersion,
    css: {
        scssDir,
        cssDir,
        lintPaths,
        sourcemaps,
        usePackageVersion
    },
    js: {
        files: {
            main: {
                srcPath,
                distFile
            },
            …
        ],
        customTasks,
        jsDir,
        lintPaths,
        allowEmpty
        usePackageVersion,
        stripDebug
    },
    logger: {
        dir,
        file
    },
    img: {
        imgDir,
        optimiseImages,
        optimiseSVGs,
        optimiseGIFs,
        optimiseJPEGs,
        optimisePNGs,
        spriteSvgs,
        svgSpriteFilename,
    },
    importedAssets: {
        importedAssetsSrcGlob,
        verbose
    },
    sw: {
        isEnabled,
        swDir,
        outputFile,
        staticFileGlobs,
        dynamicFileRegex,
        dynamicFileStrategy,
        importScripts,
        cacheId
    },
    copy: {
        js,
        css,
        img,
        fonts,
        docs
    },
    docs: {
        rootDir,
        srcDir,
        distDir,
        assetDir,
        templDir,
        dataDir,
        outputAssets,
        remoteBase,
        helpers,
        excludeTemplateDirs
    },
    fonts: {
      fontsDir
    },
    browserSync: {
        files,
        proxy,
        reloadDebounce
    },
    misc: {
        showFileSize,
        showFiles
    },
    gulp: {
        changeEvent,
        onError
    },
    isProduction,
    isDev
}

webRootDir

Type: string

Default: '.'

The root directory of your website.

assetSrcDir

Type: string

Default: 'src'

Root source directory for your assets.

assetDistDir

Type: string

Default: 'dist'

Root dist directory for your assets.

applyRevision

Type: boolean

Default: true

Will add a content hash to the JS and CSS filenames, generating a new filename if any of the file's contents have changed. This can be utilised to force the clients to get the latest version of an updated asset.

packageVersion

Type: String

Returns the current package version.

css

  • scssDir

    Type: string

    Default: 'scss'

    The directory where your SCSS files reside.

  • cssDir

    Type: string

    Default: 'css'

    The bundled CSS file will be output to this directory.

  • lintPaths

    Type: array

    Default: ['']

    Allows additional paths to be included or excluded from the linting task.

    By default, the task will lint all .scss files within the scssDir directory.

  • sourcemaps

    Type: boolean

    Default: isDev

    Turns sourcemaps on or off.

  • usePackageVersion

    Type: boolean

    Default: false

    When set to true this will bundle a versioned css file e.g 'filename-[version].css'.

js

  • files

    Type: Object

    Default:

    {
        main: {
            srcPath: 'index.js',
            distFile: 'script.js'
        }
    }

    An Object, that takes one or more child objects each describing a JavaScript bundle entry point and destination. Each of these objects can have the following properties:

    • srcPath

      Type: string

      Default: 'index.js'

      The file path to a bundle entry point in your JavaScript.

    • distFile

      Type: string

      Default: 'script.js'

      The filename for the JavaScript bundle once compiled.

  • customTasks

    Type: array<string>

    Default: []

    Array of strings, containing the names of the custom tasks to be run as part of the gulp:scripts command, in parallel with scripts:bundle.

    These should be defined by (or made available within) the consuming application, e.g., compiling third-party libraries within a scripts:libs task.

    Gulp 4 does not easily allow for the entire default gulp:scripts implementation to be overridden, so any extra JS-related tasks that you need to run should be passed in here.

  • jsDir

    Type: string

    Default: 'js'

    Name of the directory where all of your JavaScript files are kept.

    Compiled JavaScript files will be placed inside a directory with the same name.

  • lintPaths

    Type: array

    Default: ['']

    Allows additional paths to be included or excluded from the JS linting task.

    By default, the task will lint all files within the jsDir directory.

  • allowEmpty

    Type: boolean

    Default: true

    When set to true, it will allow the globbing patterns not to return any files without failing. If set to false, no files will result in an exception.

  • usePackageVersion

    Type: boolean

    Default: false

    When set to true this will bundle a versioned JS file e.g 'filename-[version].js'.

  • stripDebug

    Type: boolean

    Default: true

    This can also be controlled using the --noStripDebug flag. When this flag is added, console.log() statements will not be removed for production builds.

    Examples:

    gulp scripts:bundle --prod --noStripDebug

    This would generate the JS files as part of a production build, but would still include console.log() statements. Intended for QA releases.

    gulp scripts:bundle --prod

    This is a normal production build and would not include console.log() statements.

    gulp scripts:bundle --noStripDebug

    For non-production builds, the flag has no effect: you will still get debug statements even if include the flag.

logger

  • dir

    Type: string

    Default: 'js/shared'

    Name of the directory where your js error logger file will live.

  • file

    Type: string

    Default: 'js-error.js'

    Name of the error logger file.

img

  • imgDir

    Type: string

    Default: 'img'

    Name of the directory where your image files are kept.

    Processed image files will be placed inside a directory with the same name.

  • optimiseImages

    Type: boolean

    Default: 'true'

    Controls whether or not all image typesare optimised as part of the image tasks.

  • optimiseSVGs

    Type: boolean

    Default: 'true'

    Controls whether or not SVGs are optimised as part of the image tasks.

  • optimiseGIFs

    Type: boolean

    Default: 'true'

    Controls whether or not GIFs are optimised as part of the image tasks.

  • optimiseJPEGs

    Type: boolean

    Default: 'true'

    Controls whether or not JPEGs are optimised as part of the image tasks.

  • optimisePNGs

    Type: boolean

    Default: 'true'

    Controls whether or not PNGs are optimised as part of the image tasks.

  • spriteSvgs

    Type: boolean

    Default: 'true'

    Controls whether or not SVGs are turned into an SVG Sprite as part of the image tasks

  • svgSpriteFilename

    Type: string

    Default: 'sprite.svg'

    Filename of the SVG sprite which is generated from any SVG assets found in the image directory.

importedAssets

  • importedAssetsSrcGlob

    Type: string

    Default: 'node_modules/@justeat/*/'

    Glob of packages containing assets to be copied to assetDistDir.

  • verbose

    Type: boolean

    Default: 'true'

    Whether to log the names of all assets being copied. Passed on to f-copy-assets.

sw

  • isEnabled

    Type: boolean

    Default: false

    Determines whether the service worker is generated or not.

  • swDir

    Type: string

    Default: 'sw'

    Name of the directory where your service worker's custom internal scripts are kept in.

    Scripts here will be placed inside a directory with the same name.

  • outputFile

    Type: string

    Default: 'service-worker.js'

    The name of the generated service worker file, to be placed in the root of your application.

  • staticFileGlobs

    Type: array

    Default: []

    The static files in your application to be cached by the service worker.

  • dynamicFileRegex

    Type: array

    Default: []

    An array of regex to match the dynamic content or API calls to cache e.g. [/^https:\/\/example\.com\/api/, /^https:\/\/fonts.googleapis.com\/css/].

  • dynamicFileStrategy

    Type: string

    Default: cacheFirst

    The cache strategy to be used for content matched by dynamicFileRegex - these correspond to the sw-toolbox handlers.

  • importScripts

    Type: array

    Default: []

    Any additional internal scripts to include, aside from those in swDir.

  • cacheId

    Type: string

    Default: ''

    An optional string used to differentiate caches on the same origin during local development.

copy

  • js, css img, fonts & docs

    Type: Object

    Default: {}

    copy.js, copy.css, copy.img, copy.fonts and copy.docs each take an object list of assets in the format:

      copy:
        js: {
          prism: {
              path: '/libs/**/*',
              dest: '/libs',
              revision: false
          }
        }
      }

    In which:

    • path is a string specifying the path within the relevant asset src folder of the asset to be copied.
    • dest is a string specifying that destination folder for the asset to be copied to, within the relevant asset dist folder.
    • revision is a boolean such that if it is true, the asset will be revision hashed when copied to its destination.

    path and dest must always be defined for each asset you wish to copy (except for copy:docs which uses the root docsDist path for the dest).

    The object key (which in the above example is prism) of each asset is simply for your own use to identify each asset in your config.

  • copy:assets

    Copies assets from packages to the dist directory.

docs

  • rootDir

    Type: string

    Default: './docs'

    Root directory where your documentation files reside.

    By default your source files will be searched for in docs/src, and the generated content will be output to docs/dist.

  • srcDir

    Type: string

    Default: 'src'

    The source directory for your documentation template files.

    By default the documentation task will use the path docs/src – with the src part of this path controlled by this config variable.

  • distDir

    Type: string

    Default: 'dist'

    The directory your documentation will be compiled to.

    By default the documentation task will use docs/dist – with the dist part of this path controlled by this config variable.

  • assetDir

    Type: string

    Default: 'assets/'

    The directory your generated assets will be placed inside the documentation directory.

    By default the documentation task will use docs/dist/assets/ – with the assets/ part of this path controlled by this config variable.

  • templDir

    Type: string

    Default: 'templates'

    The name of the directory where your documentation template files are kept.

  • dataDir

    Type: string

    Default: 'data'

    The name of the directory where your documentation data files are kept.

  • outputAssets

    Type: boolean

    Default: false

    Indicates whether or not the JavaScript, CSS and image files should be placed into the docs/dist/assets/ directory.

  • remoteBase

    Type: string

    Default: ''

    Applies a base path to asset URLs when publishing documentation to Github pages. By default this is set to be an empty string.

  • helpers

    Type: object

    Default: {}

    Can pass in an object set of functions, which will be exposed in handlebars as helper functions in the documentation tasks when called using their object key.

    For example:

    {
      'toLowercase': input => input.toLowerCase()
    }

    Will expose the helper toLowercase so that using {{toLowercase name}} within a handlebars template will convert the handlebars string name to lowercase.

  • excludeTemplateDirs

    Type: array

    Default: ['resources']

    Directory names which should be ignored when adding any shared templates to the documentation. By default the array contains known directory names which should be ignored.

fonts

  • fontsDir

    Type: string

    Default: 'fonts'

    Name of the directory where your font files are kept.

browserSync

  • files

    Type: array

    Default: []

    List of paths to watch for changes. Accepts globs.

  • proxy

    Type: string

    Default: ''

    URL of local website instance.

  • reloadDebounce

    Type: number

    Default: 1000

    Wait for a specified window of event-silence (in milliseconds) before sending any reload events.

misc

  • showFileSize

    Type: boolean

    Default: true

    Should file sizes be displayed when a task is run?

  • showFiles

    Type: boolean

    Default: true

    Should file names be displayed when a task is run?

gulp

  • changeEvent

    Type: function

    Event which fires when a file is modified.

  • onError

    Type: function

    Event which fires when an error occurs.

Other config

The following options are also present in the config but cannot be overridden.

  • isProduction

    Type: boolean

    Set to true when the --prod flag is passed.

  • isDev

    Type: boolean

    Set to the opposite value of isProduction.

  • lintModules

    Type: boolean

    When set to true, by setting the --lintModules flag when running the build, the build will also lint SCSS files within sub-dependencies. This is intended to help with local development when using dependency linking.

Path Builder

You can access the pathBuilder paths like this.

const { pathBuilder } = require('@justeat/gulp-build-fozzie');

gulp.task('scss', () => gulp.src(`${pathBuilder.scssSrcDir}/**`)

…

These are the paths which the pathBuilder object provides.

CSS

  • scssSrcDir

    Default: 'src/scss'

  • cssDistDir

    Default: 'dist/css'

  • jsSrcDir

    Default: 'src/js'

  • jsDistDir

    Default: 'dist/js'

  • imgSrcDir

    Default: 'src/img'

  • imgDistDir

    Default: 'dist/img'

  • importedAssetsDistDir

    Default: 'dist/imported-assets'

  • swOutputPath

    Default: '.'

  • swSrcDir

    Default: 'src/sw'

  • swDistDir

    Default: 'dist/sw'

  • docsSrcDir

    Default: './docs/src'

  • docsDistDir

    Default: './docs/dist'

  • docsTemplateDir

    Default: './docs/src/templates'

  • docsDataDir

    Default: './docs/src/data'

  • docsAssetsDistDir

    Default: './docs/dist/assets/'

  • docsCssDistDir

    Default: './docs/dist/assets/css'

  • docsJsDistDir

    Default: './docs/dist/assets/js'

  • docsImgDistDir

    Default: './docs/dist/assets/img'

  • fontsSrcDir

    Default: 'src/fonts'

  • fontsDistDir

    Default: 'dist/fonts'

Running the unit tests

To run the unit tests for the project run the yarn test script. To see the test coverage run the test:cover script.

changelog

Changelog

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v11.3.0

January 27, 2023

Changed

  • config.img.optimiseGIFs which allows more granular control over whether GIFs get optimised or not.
  • config.img.optimiseJPEGs which allows more granular control over whether JPEGs get optimised or not.
  • config.img.optimisePNGs which allows more granular control over whether PNGs get optimised or not.

v11.2.0

December 22, 2022

Changed

  • config.img.optimiseSVGs which allows more granular control over whether SVGs get minified or not.

v11.1.0

December 22, 2022

Changed

  • gulp-svgmin package updated to latest.
  • Some other minor dependency updates.

v11.0.1

October 4, 2022

Fixed

  • Assorted security updates via dependabot.

v11.0.0

August 1, 2022

Removed

  • eyeglass package. Consuming applications will need to specify the path to modules correctly.
    • e.g 'import fozzie' > '@use @justeat/fozzie/src/scss/fozzie'

v10.6.0

July 26, 2022

Changed

  • Upgraded the version of gulp-sass from 4.0.2 to 5.1.0

v10.5.1

May 27, 2022

Fixed

  • Variable name

v10.5.0

May 25, 2022

Added

  • customTasks property to JavaScript config.
    • This allows tasks (provided by the consuming application) to be run as part of the gulp:scripts command, in parallel with scripts:bundle.

v10.4.0

May 23, 2022

Fixed

  • Failing images tasks.
  • Character warnings, e.g., ❯❯ -> >>.

Changed

  • Re-enable optimiseImages and spriteSvgs by default now that they're working again.

Removed

  • Some unnecessary callbacks (they were showing as <anonymous> in the output).

v10.3.0

May 19, 2022

Changed

  • Use circleci instead of Travis for CI

Fixed

  • Use of spread operator for tasks:
    • service-worker
    • images:optimise
    • copy:img:docs
    • images:svg-sprite

v10.2.1

May 6, 2020

Fixed

  • watch tasks so they work with Gulp v4.

v10.2.0

May 5, 2020

Changed

  • Adapted the default task so that it works with Gulp v4.

v10.1.0

March 10, 2020

Changed

  • Turns out there were more changes needed for Gulp v4 😆 Specifically, regarding runSequence (which no longer works in Gulp v4). Have converted these tasks to use gulp.series and gulp.parallel instead. This ahs been tested with how HomeWeb uses its default task – this is likely to need more specific testing/updates if/when we migrate this into other applications that use this package).

v10.0.0

March 6, 2020

Changed

  • Upgrade gulp to v4 (so that it's now compatible with Node v12)

v9.1.0

February 19, 2020

Changed

  • Upgrade jest-cli to v25, and use jest package instead to support runCLI command
  • Minor package updates
  • Destructure some imports

v9.0.1

December 11, 2019

Fixed

  • Copy issue where for some reason the gulpif package was incorrectly stopping all images being copied over when gulp.dest was run. Have split out the base copy and the docs copy streams so they don't impact one another.

v9.0.0

November 12, 2019

Changed

  • Updating dependencies. ESLint to v6, Eslint config updated to latest, and a host of other smaller dependency changes

v8.5.0

October 25, 2019

Changed

  • problematic images:optimise and images:svg-sprite from images task can now be toggled on/off in config. default is off.

Fixed

  • Linting in assemble.js.

v8.4.0

February 12, 2019

Fixed

  • Adjusted copy:assets task so that it copies the assets over to the relevant docs folder when running in docs mode.

v8.3.0

November 27, 2018

Fixed

  • Downgrading event-stream due to security vulnerability

Changed

  • Updating package dependencies

v8.2.1

October 12, 2018

Changed

  • Updating README with Babel 7 FAQ info

v8.2.0

October 12, 2018

Changed

  • Babel 7 config is now added into the gulp-build-fozzie module directly, rther than managing in each separate project package.json. Resolutions for babel 7 bridge and Espree (Eslint fix) also added.

v8.1.1

October 10, 2018

Fixed

  • README updated with Babel 7 config changes. Also includes note about adding Espree v3.5.4 as a resolution when adding linting with ESLint v6.

v8.1.0

October 10, 2018

Changed

  • Updated f-templates-loader dependency.

v8.0.0

October 3, 2018

Changed

  • Package dependency updates. Using the package will now require an upgrade to Babel 7.

v7.26.0

September 1, 2018

Added

  • gulp-stylelint plugin replaces postcss for the SCSS compilation so that the task can autofix any issues (as the postcss plugin isn't capable of doing this).

Changed

  • Updated eslint-config-fozzie dependency to remove warnings coming from airbnb-base config.
  • Update a bunch of minor dependencies.

v7.25.0

August 24, 2018

Changed

  • Updated eslint-config-fozzie dependency.

v7.24.0

August 23, 2018

Changed

  • Use ES6 compatible uglify component

v7.23.0

August 20, 2018

Added

Can now lint sub-modules Sass (for local development) by using the --lintModules flag.

Changed

  • Dependency on gulp-gh-pages removed in favour of our own forked version (as the maintainer had moved it to Gulp 4, which hasn't been released).
  • Tests updated in line with config changes to CSS lintPaths

Removed

  • Gemnasium removed from README

v7.22.0

August 3, 2018

Changed

  • Lots of BAU package updates as well as for f-template-loader to allow importing inline SVGs.

v7.21.0

July 13, 2018

Changed

  • Package versions updated (including gulp-gh-pages after contacting package owner).
  • Updated to v2 of eslint-config-fozzie
  • Quoted glob pattern in scripts lint config, as was picking up package names such as asn1.js incorrectly for linting.

Fixed

  • New eslint config updates reflected in --fix of task js files

v7.20.1

July 10, 2018

Fixed

  • Added resolutions value for gift, as gulp-gh-pages was using an old version of this package which was stopping the docs:deploy task from running.

v7.20.0

July 6, 2018

Added

  • Adding copy:docs task for copying docs sites specific files (such as CNAME records)

v7.19.0

April 11, 2018

Added

  • Added copy:img:docs task and documentation.

Changed

  • The images:optimise no longer copies images into the docs asset dist folder.
  • The images task now copies all of the images in the assets dist folder over to the docs dist folder if running a docs task.

v7.18.0

April 11, 2018

Changed

  • Register shared templates as partials rather than helpers.

v7.17.0

April 10, 2018

Changed

  • Updated f-templates-loader module.

v7.16.0

April 9, 2018

Added

  • Added f-templates-loader module which handles locating and registering shared templates.
  • Added config.docs.excludeTemplateDirs property to allow directories to be ignored when adding shared templates.

Changed

  • .gitignore updated to exclude yalc config files

v7.15.0

April 3, 2018

Added

  • ESLint flag for automatically fixing ESLint rule violations. Will now fix a number of issues in-line when the lint task is run. For more info, check out the fix rule in the ESLint docs and to see a list of the rules this will auto-fix, see the ESLint rule list.

Changed

  • .gitignore updated to exclude yalc config files

v7.14.0

March 26, 2018

Added

  • Tests added to take coverage to 100%
  • Unminified JS files compiled to docs folder
  • Lodash clonedeep added for deep cloning objects in tests

Changed

  • Split out the tests into more manageable chunks

v7.13.0

March 8, 2018

Changed

  • Default gulp tasks so that the logger file is created when gulp is run.
  • Updated the pathBuilder jsErrorLoggerDir property to assetDistDir so it outputs in the correct directory.
  • Updated pathBuilder unit tests.

v7.12.0

February 16, 2018

Added

  • gulp-file to dependencies

Changed

  • Add logger-file.js to tasks - this will add the server-side file required for the errorLogger to be inserted into the filesystem
  • Add logger paths to config
  • Add logger paths to pathbuilder
  • Updated unit tests
  • Added .idea to gitignore
  • Updated config.logger.dir to be js
  • Updated config.logger.subDir to be shared
  • Updated readme docs

Remove

  • Removed jsErrorLoggerDir from pathBuilder.js

v7.11.0

February 7, 2018

Changed

  • Javascript task to handle versioning if usePackageVersion is set to true.

v7.10.0

February 7, 2018

Changed

  • Changed imagemin config to maintain svg viewBox.

v7.9.0

February 2, 2018

Added

  • stripDebug option to config.js to allow the inclusion of console statements in production builds.
  • --noStripDebug command line flag.

Changed

  • Jest rollback from v22.1.4 to v21.2.1.

v7.8.0

February 1, 2018

Added

  • Added the ability to pass environment variables into the SCSS compilation
  • Added $isDev, $isProd, $env and $server variables that are now available in Sass
  • :bear: added to fozzie log notification

Changed

  • Minor package updates

v7.7.0

January 30, 2018

Added

  • Run npm scripts concurrently.

Changed

  • Updated eslint module versions.
  • Updated jest version.
  • Using Object.assign in jest task as object spread is only supported in node v8.6.0 and up.

Remove

  • Removed eslint jest module as Jest is already specified within eslint-config-fozzie.

v7.6.0

January 30, 2018

Changed

  • Updated f-copy-assets module.

v7.5.0

January 30, 2018

Fixed

  • Fix the way that arguments are combined when calling jestTestRun.

v7.4.0

January 30, 2018

Changed

  • Set passWithNoTests argument to true for all Jest test runs to prevent error when there are no tests in the project.

v7.3.0

January 30, 2018

Changed

  • Set bail argument to true only when run in production.

v7.2.0

January 23, 2018

Changed

  • Added usePackageVersion to config file to handle the css versioning, default value is set to false.
  • Added packageVersion to config file which returns the current scoped package version.
  • Updated config.test tests to cover the above changes.

v7.1.0

January 18, 2018

Changed

  • Set bail argument to true for all Jest test runs so that it returns the correct exit code when a test run fails.

v7.0.0

January 17, 2018

Changed

  • Whole host of packages updated. Main ones to know about are:
  • Updated the Danger config in Travis, as the call is now yarn danger ci to run the checks

v6.5.0

December 4, 2017

Changed

  • Output unhashed, minified JS file

v6.4.0

December 4, 2017

Changed

  • Move applyRevision variable out of the JS-only config so that it can be used for applying revision identifiers to the CSS files as well.
  • Updated readme to reflect new config structure.
  • Updated unit tests.

v6.3.0

October 18, 2017

Changed

  • Updated dependencies.
  • Updated jest.runCLI to match new signature.
  • Moved duplicate jest calls out into a single function.
  • Updated code formatting in css:bundle task.

v6.2.1

October 4, 2017

Changed

  • Changed the log message to display the consuming package name and gulp-build-fozzie version.

v6.2.0

October 3, 2017

Changed

  • Updated the CSS task so that it produces map files for both the concatenated and the minified files produced

v6.1.1

September 22, 2017

Changed

  • Commit message for docs:deploy updated so that it doesn't clash with commit checks

v6.1.0

September 20, 2017

Changed

  • Run cleanupIDs plugin to ensure all IDs are unique inside SVG sprite.

v6.0.0

September 1, 2017

Changed

  • copy:assets task has moved from the css task to the images task.
  • Changed the order in which the images tasks run — images are now copied, optimised, and then the SVG sprite is created.
  • SVG sprite is created from assets found in the dist directory rather than src.

v5.5.3

August 25, 2017

Changed

  • Lint task plumber only used in dev (so that it breaks the travis build if it errors)

v5.5.2

August 25, 2017

Added

  • Better error handling for JS bundling so that errors in the browserify build don’t break the stream

v5.5.1

August 24, 2017

Changed

  • Fixed a bug in copy:assets where the task callback was called too many times.

v5.5.0

August 24, 2017

Added

  • Added config.importedAssets.verbose option.
  • Added unit tests for config.importedAssets.verbose option.

Changed

  • copy:assets task uses the f-copy-assets module rather than npm-assets
  • The Readme config.importedAssets section was updated.

v5.4.0

August 22, 2017

Changed

  • copy:assets task copies to config.assetDistDir instead of the pathBuilder.importedAssetsDistDir.
  • css:bundle task loads the config.DistDir into postcss rather than importedAssetsDistDir
  • The Readme copy:assets and config.importedAssets sections were updated.

Removed

  • Removed config.importedAssets.importedAssetsDir .
  • Removed pathBuilder.importedAssetsDistDir.
  • Removed unit tests for above properties.
  • Removed clean:assets task.
  • The above properties and task were removed from the Readme.

v5.3.1

August 21, 2017

Changed

  • License update

v5.3.0

August 18, 2017

Added

  • Added the scripts:test:coverage task.

v5.2.0

August 18, 2017

Added

  • Added docs:deploy and docs:release tasks.
  • Added documentation for the new docs tasks.

Removed

  • Removed debug from assemble task.
  • Removed copy:fonts task from docs as it's called later in the default task.

Changed

  • Renamed the Options section to Config in the README.

v5.1.0

August 16, 2017

Added

  • Added browser-sync task along with config settings and tests.
  • Added docsAssetsDistDir path to pathBuilder.

v5.0.0

August 16, 2017

Changed

  • JavaScript task can now handle multiple files to be bundled via Browserify/Babel. Check the README for updated config changes.
  • Updatd copy task error handling

v4.5.0

August 15, 2017

Changed

  • test:cover task simplified.
  • docs task now copies fonts correctly.
  • default task refactored — now using the spread operator to conditionally add the service-worker task to runSequence.

v4.4.0

August 11, 2017

Changed

  • Changed config.importedAssets.importedAssetsSrcGlob default option.
  • copy:assets task no longer recursively checks dependencies of dependencies.
  • Fixed a bug with the callback in copy:assets
  • Dangerfile updated – result json couldn’t be accessed, so had to pass in result variable

Removed

  • Removed watch:assets task.

v4.3.0

August 10, 2017

Added

  • Added config.importedAssets object.
  • Added imported assets paths to pathBuilder.
  • Added copy:assets task.
  • Added clean:assets task.
  • Added watch:assets task.
  • Unit tests added for new config and pathBuilder properties.
  • The Readme Imported Assets config section was added.
  • The Readme Imported Assets pathBuilder section was added.
  • The Readme was updated to document the new tasks added.

Changed

  • Updated clean task comments.
  • The css:bundle task loads the importedAssetsDistDir into postcss, so that Fozzie modules can access assets copied there.

v4.2.0

August 8, 2017

Added

  • Added config.fonts object.
  • Added fonts paths to pathBuilder.
  • Added copy.fonts object.
  • Added copy:fonts task.
  • Unit tests added for new config and pathBuilder properties.
  • Unit tests added to test all config.copy properties are updated correctly.
  • The Readme Fonts config section was added.
  • The Readme Fonts pathBuilder section was added.

Changed

  • Updated copy task comments.
  • If no dest property is defined in the copy config then it will default to an empty string.
  • Improved logging for copy tasks.
  • The Readme config.copy and copy tasks sections were updated to include the new font additions.
  • Updated copy task comments.

v4.1.1

August 8, 2017

Fixed

  • Fixed lint errors in danger.js.

v4.1.0

August 7, 2017

Added

  • Danger.js has been added to do basic PR checks. This will leave comments on the PR when the changelog hasn’t been updated, the version needs incrementing or if it thinks the README might need an update.

v4.0.0

August 4, 2017

Changed

  • The return value is now an object containing the build, config, and pathBuilder objects instead of the build function.
  • Service worker path no longer contains the service worker filename.

Added

  • The Readme Setup section was updated to reflect the changes to the default return value.
  • The Readme Path Builder section was added.

v3.8.0

August 3, 2017

Added

  • Added copy:js, copy:css and copy:img tasks to copy over separate files without bundling. See README for more information.

v3.7.0

August 3, 2017

Added

Changed

  • The for...in loop in assemble.js was throwing eslint errors, in order to fix this we converted the loop to use Object.keys and forEach instead.

v3.6.0

August 2, 2017

Added

  • config.docs.helpers object added for passing through helper function for handlebars to use

v3.5.0

August 2, 2017

Changed

  • Updating numerous package dependencies in package.json and yarn.lock

v3.4.1

August 2, 2017

Fixed

  • Fixed isProduction check for docs base URL.

v3.4.0

August 2, 2017

Changed

  • Consistent formatting of gulp-if statements.

Fixed

  • CSS sourcemap hack removed as the original issue appears to have been fixed.
  • CSS sourcemaps are written to separate files.
  • JavaScript sourcemaps are now written correctly.
  • watch:docs task now outputs assets correctly.