Bud v6.1.0 released

bud v6.1.0 released

For more information refer to the the v6.1.0 release notes on bud.js.org.

Fix: bud.assets

This release makes some changes to bud.assets in response to feedback from the roots/sage team and members of the Roots Discourse community. Specifically, you will find that directories listed in the bud.assets call will have their structure preserved in the @dist directory.

accounting for the path change

After upgrading, it is possible that assets will be emitted to a different directory than you expect. Likely you are anticipating that copied files will be available in the root of @dist and are finding them now in a subdirectory.

You can specify the dist root as a target to compensate for the change:

// from this (will copy from images dir to dist/images)
bud.assets(['images'])

// to this (will copy from images dir to dist)
bud.assets([['images', './']])

bud.assets api change

bud.assets is no longer variadic. If you are specifying copy jobs using multiple parameters just wrap them in an array:

// from this
bud.assets('images', 'fonts')

// to this
bud.assets(['images', 'fonts'])

Feature: bud.denylist

Bud extensions are automatically utilized in a build if they are listed under the devDependencies or dependencies field of package.json.
They are also automatically utilized when marked as a dep of another extension.

You can add a bud.denylist field to package.json to prevent certain extensions from being registered, regardless.

{
  "bud": {
    "denylist": ["@roots/bud-criticalcss"]
  }
}

There is also a bud.allowlist to whitelist extensions. You should be aware that there are many internal extensions, and things may break if they are not available. If you run a build with the --log flag the tapped extensions will be summarized at the bottom, but it’s probably better to use bud.denylist.

Improve: @roots/bud-preset-recommend

Use @roots/bud-esbuild over @roots/bud-babel when possible

The @roots/bud-preset-recommend extension will check to see if @roots/bud-esbuild is available before registering @roots/bud-babel.
This didn’t cause errors prior to 6.1.0, but it did have a cost in terms of build time for users of @roots/bud-preset-recommend who wanted to use @roots/bud-esbuild iorf @roots/bud-typescript instead of @roots/bud-babel.

Improve: @roots/sage

A few changes here:

domReady now async compatible

The domReady named export of @roots/sage/client can now take an async callback:

import {domReady} from '@roots/sage/client'

domReady(async () => {
  // do async stuff
})

New theme.json features

In addition to the theme color palette, you can now generate font sizes and font families from tailwind.config.js using bud.wpjson.useTailwindFontSize and bud.wpjson.useTailwindFontFamily.

app.wpjson
  .useTailwindColors()
  .useTailwindFontSize()
  .useTailwindFontFamily()
  .enable()

You can also modify fields which are not under the settings key using the standard extension API’s setOptions method:

// callback
app.wpjson.setOptions(opts => ({
  ...options,
  customTemplates: [],
}))

// literal
app.wpjson.setOptions({
  // using without a callback
  // will fully override theme.json
  ...app.wpjson.options,
})

app.wpjson.settings can be used to change the settings prop granularly:

app.wpjson.settings(theme => theme.set('custom', {}))

Check the updated @roots/sage docs for additional usage guidance.

Fix: ts-bud incompatible with bud.typescript.typecheck

The fix for this issue is pretty in the weeds but you can read about it in #1492.

Fix: @roots/bud-eslint incompatible with filesystem caching

Previously users of @roots/bud-eslint needed to use bud.persist('memory') in order to guarantee linting worked as expected. This is no longer the case thanks to #1492.

More information

For more information review the diff to see what’s changed.

2 Likes