Skip to main content

6.5.0

· 3 min read
kellymears

Filesystem API, S3 uploads, and more.

Updates available

There are patches available for this release. Please update to 6.5.3.

⚠️ This release deprecates the optIn property and decorator for extensions. This doesn't matter unless you are authoring an extension. If you are, you can probably just use dependsOnOptional instead.

✨ bud.fs

bud.fs is a new filesystem API for bud.js. It uses fs-jetpack and includes support for managing s3 assets.

Example of a file write operation:

await bud.fs.write(`README.md`, `# Hello, world!`);

Example of the S3 API which uploads @dist contents to a bucket after compilation:

bud.fs
.setCredentials({
accessKeyId: `***`,
secretAccessKey: `***`,
})
.setEndpoint(`https://sfo2.digitaloceanspaces.com`)
.setBucket("bud-test")
.upload();

Check the bud.fs docs for more information.

✨ bud.after

Config function for executing tasks after the compilation is fully complete. This is useful for tasks that need to run after the compilation is complete, but don't need to be part of the compilation process (like uploading assets to s3!)

bud.config.mjs
export default async (bud) => {
bud.after(async (bud) => {
await bud.fs.write(
`dist/credits.txt`,
`${bud.context.manifest.name} built by me!`
);
});
};

Execute a command with bud.sh:

bud.config.mjs
export default async (bud) => {
bud.after(async (bud) => await bud.sh(`yarn jest`));
};

Check the bud.after docs for more information.

🩹 Fix: duplicative logs

Some logs would be displayed twice in the terminal if they were emitted around the same time that the dashboard was being updated. It was also possible, depending on user configuration, for requests for the dashboard to update to fire twice. This has been fixed.

  1. console.* events are now caught by a new service: bud.bufferConsole. The service catches logs, trims and deduplicates them, and then emits them using an instance of the standard bud logger. If bud is invoked with the --ci flag the service will let them pass through normally.
  2. The bud.dashboard service's stats method is now debounced. Duplicative calls should be ignored.

It's likely that our handling of process.stdout is still imperfect, but this is a step in the right direction.

🩹 Fix: notifications only fire once (macos)

In dev mode only the first compilation would result in a desktop notification. This has been fixed. You should now receive a notification for every compilation.

🩹 Fix: bud.env is not an instance of Container

bud.env was not an instance of Container and therefore did not have methods like is. This has been fixed and it should now behave as documented.

🩹 Fix: dynamically imported chunks not hashed

Dynamically imported chunks were not being hashed. This has been fixed.

🩹 Fix: @roots/bud-criticalcss

A breaking change in the critical package had broken this extension. This change has now been accounted for and the extension should work again. This extension is still listed as experimental.

ℹ️ Release information

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